text
stringlengths
2.85k
2.55M
label
class label
11 classes
Best Friends Forever (BFF): Finding Lasting Dense Subgraphs Konstantinos Semertzidis 1 , Evaggelia Pitoura 1 , Evimaria Terzi 2 , Panayiotis Tsaparas 1 1 Dept. of Computer Science and Engineering, University of Ioannina, Greece 2 Dept. of Computer Science, Boston University, USA arXiv:1612.05440v3 [cs.SI] 3 Oct 2017 1 {ksemer,pitoura,tsap}@cs.uoi.gr 2 [email protected] Abstract—Graphs form a natural model for relationships and interactions between entities, for example, between people in social and cooperation networks, servers in computer networks, or tags and words in documents and tweets. But, which of these relationships or interactions are the most lasting ones? In this paper, we study the following problem: given a set of graph snapshots, which may correspond to the state of an evolving graph at different time instances, identify the set of nodes that are the most densely connected in all snapshots. We call this problem the Best Friends For Ever (B FF) problem. We provide definitions for density over multiple graph snapshots, that capture different semantics of connectedness over time, and we study the corresponding variants of the B FF problem. We then look at the On-Off B FF (O2 B FF) problem that relaxes the requirement of nodes being connected in all snapshots, and asks for the densest set of nodes in at least k of a given set of graph snapshots. We show that this problem is NP-complete for all definitions of density, and we propose a set of efficient algorithms. Finally, we present experiments with synthetic and real datasets that show both the efficiency of our algorithms and the usefulness of the B FF and the O2 B FF problems. I. I NTRODUCTION Graphs offer a natural model for capturing the interactions and relationships among entities. Oftentimes, multiple snapshots of a graph are available; for example, these snapshots may correspond to the states of a dynamic graph at different time instances, or the states of a complex system at different conditions. We call such sets of graph snapshots, a graph history. Analysis of the graph history finds a large spectrum of applications, ranging from social-network marketing, to virus propagation and digital forensics. A central question in this context is: which interactions, or relationships in a graph history are the most lasting ones? In this paper, we formalize this question and we design algorithms that effectively identify such relationships. In particular, given a graph history, we introduce the problem of efficiently finding the set of nodes, that remains the most tightly connected through history. We call this problem the Best Friends For Ever (B FF) problem. We formulate the B FF problem as the problem of locating the set of nodes that have the maximum aggregate density in the graph history. We provide different definitions for the aggregate density that capture different notions of connectedness over time, and result in four variants of the B FF problem. We then extend the B FF problem to capture the cases where subsets of nodes are densely connected for only a subset of the snapshots. Consider for example, a set of collaborators that work intensely together for some years and then they drift apart, or, a set of friends in a social network that stop interacting for a few snapshots and then, they reconnect with each other. To identify such subsets of nodes, we define the On-Off B FF problem, or O2 B FF for short. In the O2 B FF problem, we ask for a set of nodes and a set of k snapshots such that the aggregate density of the nodes over these snapshots is maximized. Identifying B FF nodes finds many applications. For example, in collaboration and social networks such nodes correspond to well-acquainted individuals, and they can be chosen to form teams, or organize successful professional or social events. In a protein-interaction network, we can locate protein complexes that are densely interacting at different states, thus indicating a possible underlying regulatory mechanism. In a network where nodes are words or tags and edges correspond to their co-occurrences in documents or tweets published in a specific period of time, identifying B FF nodes may serve as a first step in topic identification, tag recommendation and other types of analysis. In a computer network, locating servers that communicate heavily over time may be useful in identifying potential attacks, or bottlenecks. The problem of identifying a dense subgraph in a static (i.e., single-snapshot) graph has received a lot of attention (e.g., [1], [2], [3]). There has been also work on finding dense subgraphs in dynamic graphs (e.g., [4]). However, in this line of work, the goal is to efficiently locate the densest subgraph in the current graph snapshot, whereas we are interested in locating subgraphs that remain dense in the whole graph history. To the best of our knowledge, we are the first to systematically introduce and study density in a graph history, and define the B FF and O2 B FF problems. The most related work to ours is [5] where the authors study just one of the four variants of the B FF problem in the context of graph databases. We compare the performance of our algorithms for this variant with the algorithm proposed in [5] experimentally. We study the complexity of the different variants of the B FF and O2 B FF problems. Two of the B FF variants can be solved optimally, while the O2 B FF is NP-hard. We propose a generic algorithmic framework for solving our problems, that works in linear time. Experimental results with real and synthetic datasets show the efficiency and effectiveness of our algorithms in discovering lasting dense subgraphs. Two case studies on bibliographic collaboration networks, and hashtag co-occurrence networks in Twitter validate our approach. To summarize, the main contributions of this work are the following: while the minimum density, dm (G), of the graph is the minimum degree of any node in V : • We introduce the novel B FF and O2 B FF problems of identifying a subset of nodes that define dense subgraphs in a graph history. To this end, we extend the notion of density for graph histories, and provide definitions that capture different semantics of density over time leading to four variants of our problems. dm (G) = min degree(u, G). • We study the complexity of the variants of the B FF and O2 B FF problems and propose appropriate algorithms. We prove the optimality, or the approximation factor of our algorithms whenever possible. • We extend our definitions and algorithms to identify the B FFs of an input set of query nodes. • We perform experiments with both real and synthetic datasets and demonstrate that our problem definitions are meaningful, and that our algorithms work well in identifying dense subgraphs in practice. Roadmap: In Section II, we provide definitions of aggregate density. We introduce the B FF problem and its algorithms in Section III, and the O2 B FF problem and its algorithms in Section IV, while in Section V we study extensions to the original problem. Our experimental evaluation is presented in Section VI and comparison with related work in Section VII. Section VIII concludes the paper. II. AGGREGATE DENSITY We assume that we are given as input multiple graph snapshots over the same set of nodes. Snapshots may be ordered, for example, when the snapshots correspond to the states of a dynamic graph. We may also have an unordered collection of graphs, for example, when the snapshots correspond to graphs collected as a result of some scientific experiments. We refer to such graph collections as a graph history. Definition 1 (G RAPH H ISTORY ). A graph history G = {G1 , G2 , . . . , Gτ } is a collection of τ graph snapshots, where each snapshot Gt = (V, Et ), t ∈ [1, τ ], is defined over the same set of nodes V . An example of a graph history with four snapshots is shown in Figure 1. Note that our definition is applicable to graph snapshots with different set of nodes by considering V as their union. We will now define the notion of density for a graph history. We start by reviewing two basic definitions of graph density for a single graph snapshot. Given an undirected graph G = (V, E) and a node u in V , we use degree(u, G) to denote the degree of u in G. The average density, da (G), of the graph G is the average degree of the nodes in V : da (G) = 2|E| 1 X degree(u, G) = |V | |V | u∈V u∈V Intuitively, for a given graph, dm is defined by a single node, the one with the minimum degree, while da accounts for the degrees and thus the connectivity of all nodes. For example, in Figure (1a), dm (G1 ) = 2, while da (G1 ) = 10/3. Clearly, dm is a lower bound for da . From now on, when the subscript of d is ignored, density can be either da or dm . We also define the density of a subset of nodes S ⊆ V in the graph G = (V, E). To this end, we use the induced subgraph G[S] = (S, E(S)) in G, where E(S) = {(u, v) ∈ E : u ∈ S, v ∈ S}. We define the density d(S, G) of S in G as d(G[S]). For example, again for snapshot G1 in Figure 1, for Sx = {x1 , x2 , x3 , x4 }, dm (Sx , G1 ) = da (Sx , G1 ) = 3, while for Sy = {y1 , y2 , y3 , y4 , y5 }, dm (Sy , G1 ) = 2 and da (Sy , G1 ) = 16/5. Between Sx and Sy , Sx has the highest minimum density, whereas Sy the highest average density. We now define the density of a set of nodes S on a graph history. For this, we need a way to aggregate the density of a set of nodes over multiple graph snapshots. Aggregating density sequences: Given a graph history G = {G1 , . . . , Gτ }, we will use d(S, G) = {d(S, G1 ), . . . , d(S, Gτ )} to denote the sequence of density values for the graph induced by the set S in the graph snapshots. We consider two definitions for an aggregation function g(d(S, G)) that aggregates the densities over snapshots: the first, gm , computes the minimum density over all snapshots: gm (d(S, G)) = min d(S, Gt ), Gt ∈G while the second, ga , computes the average density over all snapshots: 1 X d(S, Gt ). ga (d(S, G)) = |G| Gt ∈G Intuitively, the minimum aggregation function requires high density in each and every snapshot, while the average aggregation function looks at the snapshots as a whole. Again, we use g to collectively refer to gm or ga . We can now define the aggregate density f . Definition 2 (AGGREGATE D ENSITY ). Given a graph history G = {G1 , . . . , Gτ } defined over a set of nodes V and S ⊆ V , we define the aggregate density f (S, G) to be f (S, G) = g(d(S, G)). Depending on the choice of the density function d and the aggregation function g, we have the following four versions of f : (a) fmm (S, G) = gm (dm (S, G)), (b) fma (S, G) = gm (da (S, G)), (c) fam (S, G) = ga (dm (S, G)), and (d) faa (S, G) = ga (da (S, G)). Each density definition associates different semantics with the meaning of density among nodes in a graph history. Large values of fmm (S, G) correspond to groups of nodes S where each member of the group is connected with a large number of other members of the group at each snapshot. A node ceases y5 y5 y5 y5 x1 x4 y1 y4 x1 x4 y1 y4 x1 x4 y1 y4 x1 x4 y1 y4 x2 x3 y2 y3 x2 x3 y2 y3 x2 x3 y2 y3 x2 x3 y2 y3 (a) G1 (b) G2 (c) G3 (d) G4 Fig. 1: A graph history G = {G1 , . . . , G4 } consisting of four snapshots. to be considered a member of the group, if it loses touch with the other members even in a single snapshot. Large values of fma (S, G) are achieved for groups with high average density at each snapshot G ∈ G. As opposed to fmm (S, G), where the requirement is placed at each member of the group, large values of fma (S, G) are indicative that the group S has persistently high density as a whole. The faa (S, G) metric takes large values when the group S has many connections on average; thus, faa is more “loose” both in terms of consistency over time and in terms of requirements at the individual group member level. Lastly, fam (S, G) takes the average of the minimum degree node at each snapshot, thus is less sensitive to the density of S at a single instance. For example, in the graph history G in Figure 1, all aggregate densities for Sx are equal to 3. However, for Sy faa (Sy , G) = 31/10, while fma (Sy , G) = 12/5. That is, while faa (Sy , G) > faa (Sx , G), fma (Sy , G) < fma (Sx , G) due to the last instance. Note also that fmm (Sy , G) = 1 and that this value is determined by just one node in just one snapshot, i.e., node y4 in the last snapshot, while fam (Sy , G) = 2. The average graph: Finally, let us define the average graph of a graph history G which is an edge-weighted graph where the weight of an edge is equal to the fraction of snapshots in G where the edge appears. Definition 3 (AVERAGE G RAPH ). Given a graph history G = bG = {G1 , . . . , Gτ } on a set of nodes V , the average graph H b (V, E, w) b is a weighted, undirected graph on the set of nodes b = V × V , and for each (u, v) ∈ E, b w(u, V , where E b v) = |Gt =(V,Et )∈G|(u,v)∈Et | . |G| As usual, the degree of a node u in a weighted graph is bG ) = P defined as: degree(u, H b v). The average b w(u, (u,v)∈E graph performs aggregation on a per-node basis, in that, the b G is the average degree of u in degree of each node u in H time. With the average graph. we lose information regarding density at individual snapshots. With some algebraic manipulation, we can prove the following lemma that shows a connection between the average graph and the faa density function: Lemma 1. Let G = {G1 , . . . , Gτ } be a graph history over a set of nodes V and  S a subset of nodes in V , it holds: b faa (S, G) = da HG [S] . III. T HE B FF P ROBLEM In this section, we introduce the B FF problem, we study its hardness and propose appropriate algorithms. A. Problem definition Given the snapshots of a graph history G, our goal is to locate the Best Friends For Ever (B FF), that is, to identify a subset of nodes of V such that these nodes remain densely connected with each other in all snapshots of G. Formally: Problem 1 (The Best Friends Forever (B FF) Problem). Given a graph history G and an aggregate density function f , find a subset of nodes S ⊆ V , such that f (S, G) is maximized. By considering the four choices for the aggregate density function f , we have four variants of the B FF problem. Specifically, fmm , fma , fam and faa give rise to problems: B FF - MM, B FF - MA, B FF - AM and B FF - AA respectively. B. B FF algorithms We now introduce a generic algorithm for the B FF problem. The algorithm (shown in Algorithm 1) is a “greedy-like” algorithm inspired by a popular algorithm for the densest subgraph problem on a static graph [6], [1]. We use G[S] = {G1 [S], . . . , Gτ [S]} to denote the sequence of the induced subgraphs of the set of nodes S. The algorithm starts with a set of nodes S0 consisting of all nodes V , and then it performs n − 1 steps, where at each step i it produces a set Si by removing one of the nodes in the set Si−1 . It then finds the set Si with the maximum aggregate density f (S, G). Algorithm 1 The F IND B FF algorithm. Input: Graph history G = {G1 , . . . , Gτ }; aggregate density function f Output: A subset of nodes S 1: S0 = V 2: for i = 1, . . . , n − 1 do 3: vi = arg min score (v, G [Si−1 ]) v∈Si−1 Si = Si−1 \ {vi } 5: return arg max f (Si , G) 4: i=0...n−1 The F IND B FF algorithm forms the basis for the algorithms we propose for the four variants of the B FF problem. Interestingly, by defining appropriate scoring functions, score (v, G [S]), (used in line 3 to select which node to remove), we can get efficient algorithms for each of the variants. Algorithm 2 The scorem algorithm. Algorithm 3 The scorea algorithm. Input: Graph history G = {G1 , . . . , Gτ } Output: Node with the minimum scorem 1: Lt [d] ← list of nodes with degree d in Gt 2: 3: procedure S CORE A ND U PDATE() 4: for t = 1, . . . , τ do 5: dmint ← smallest d s.t. Lt [d] 6= ∅ 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: scorem = 0 min dmint t=1,...,τ t = arg min dmint t=1,...,τ u = Lt0 [scorem ].get() for each Gt ∈ G do Lt [scorem ].remove(u) for each (u, v) ∈ Et do Lt [degree(v, Gt )].remove(v) Et = Et − (u, v) // update degreev∈V (v, Gt ) Lt [degree(v, Gt )].add(v) V = V \ {u} return u 1) Solving B FF - MM : For the B FF - MM problem, we define the score for a node v in S, scorem , as the minimum degree of v in the sequence G [S]. That is, scorem (v, G [S]) = min degree (v, Gt [S]) . Gt ∈G At the i-th iteration of the F IND B FF algorithm, we select the node vi with the minimum scorem value. We call this instantiation of the F IND B FF algorithm F IND B FF M . Below we prove that F IND B FF M provides the optimal solution to the B FF - MM problem. Proposition 1. The B FF - MM problem can be solved optimally in polynomial time using the F IND B FF M algorithm. Proof: Let i be the iteration of the F IND B FF M algorithm, where for the first time, a node that belongs to an optimal solution S ∗ is selected to be removed. Let vi be this node. Then clearly, S ∗ ⊆ Si−1 and by the fact that at every iteration we remove edges from the graphs we have that scorem (vi , G [St−1 ]) ≥ scorem (vi , G [S ∗ ]) . Since vi is the node we pick at iteration i, every node u ∈ Si−1 satisfies: minGt ∈G degree(u, Gt [Si−1 ]) = scorem (u, G [Si−1 ]) ≥ scorem (vi , G [Si−1 ]) ≥ scorem (vi , G [S ∗ ]). Since this is true for every node u, this means that Si−1 is indeed optimal and that our algorithm will find it. The running time of F IND B FF M is O(nτ + M ), where n = |V |, τ the number of snapshots in the history graph and M = m1 +m2 +. . .+mτ the total number of edges that appear in all snapshots. The node with the minimum scorem value is computed by the procedure S CORE A ND U PDATE shown in Algorithm 2, which also removes the node and its edges from all snapshots. For each snapshot Gt , we keep the list of nodes with degree d (line 1 in Algorithm 2); these lists can be constructed in time O(nτ ). Given these lists, the time required Input: Graph history G = {G1 , . . . Gτ } Output: Node with the minimum scorea 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: b G ← construct the average graph of G H bG L[d] ← list of nodes with degree d in H procedure S CORE A ND U PDATE() scorea ← smallest d s.t. L[d] 6= ∅ u = L[scorea ].get() L[scorea ].remove(u) b do for each (u, v) ∈ E b G )].remove(v) L[degree(v, H b=E b − (u, v) // update degreev∈V (v, H bG ) E b L[degree(v, HG )].add(v) V = V \ {u} return u to find the node with the minimum scorem is O(τ ) (lines 4–8). Now in all snapshots, the neighbors of the removed node need to be moved from their position in the τ lists (lines 9–14); the degree of every neighbor of the removed node is decreased by one. Throughout the execution of the algorithm at most O(M ) such moves can happen. Therefore, the total running time of F IND B FF M is O(nτ + M ). Note that an algorithm that iteratively removes from a graph G the node with the minimum degree was first studied in [6] and shown to compute a 2approximation of the densest subgraph problem for the da (G) density in [1] and the optimal for the dm (G) density in [7]. 2) Solving B FF - AA: To solve the B FF - AA problem, we b shall use the average  HG of G. Lemma 1 shows that  graph b G [S] . Thus, based on the results of faa (S, G) = da H Charikar [1] and Goldberg [2], we conclude that: Proposition 2. The B FF - AA problem can be solved optimally in polynomial time. Although there exists a polynomial-time optimal algorithms for B FF - AA, the computational complexity of these algorithms b 2 ) for the case of the max-flow algorithm (e..g., O(|V ||E| in [2]), makes them hard to use for large-scale real graphs. Therefore, instead of these algorithm we use the F IND B FF algorithm, where we define the score of a node v in S, scorea , to be equal to its average degree of v in graph history G[S]. That is, 1 X scorea (v, G [S]) = degree (v, Gt [S]) . |G| Gt ∈G At the i-th iteration, we select the node vi with the minimum average degree in G. We will refer to this instantiation of the F IND B FF, as F IND B FF A . Using Lemma 1 and the results of Charikar [1] we have the following: Proposition 3. F IND B FF A is a 21 -approximation algorithm for the B FF - AA problem. Proof: It is easy to see that F IND B FF A removes the node b G . Charikar [1] has shown that with the minimum density in H an algorithm that iteratively removes from a graph the node with minimum density provides a 12 -approximation for finding the subset of nodes that maximizes the average density on a single (weighted) graph snapshot. Given the equivalence we established in Lemma 1, F IND B FF A is also a 12 -approximation algorithm for B FF - AA. We show the steps for finding the node with the minimum scorea value in Algorithm 3 that uses lists of nodes with degree d in the average graph to achieve an O(nτ + M ) total running time for F IND B FF A . 3) Solving B FF - MA and B FF - AM: We consider the application of F IND B FF M and F IND B FF A algorithms for the two problems. In the following propositions, we prove that the two algorithms give a poor approximation ratio for both problems. Recall that all our problems are maximization problems, and, therefore, the lower the approximation ratio, the worse the performance of the algorithm. Proposition 4. The approximation ratio of algorithm F IND B FF M for the B FF - AM problem is O n1 where n is the number of nodes. f . We refer to this algorithm as F IND B FF G . F IND B FF G requires to check all nodes when choosing which node to remove at each step (shown in Algorithm 4), thus leading to complexity O(n2 τ + nM ). Algorithm 4 The scoreg algorithm. Input: Graph history G = {G1 , . . . Gτ }; an aggregate density function f Output: Node with the minimum scoreg 1: procedure S CORE A ND U PDATE() 2: scoreg [u] = ∅ for u ∈ V 3: for each u ∈ V do 4: V 0 = V \ {u} 5: scoreg [u] = f (V 0 , G) 6: 7: 8: 9: 10: 11: u = arg min scoreg [v] v∈V for each Gt ∈ G do for each (u, v) ∈ Et do Et = Et − (u, v) V = V \ {u} return u Proof: In the Appendix. Proposition 5. The approximation ratio of algorithm F IND B FF A for the B FF - AM problem is O n1 where n is the number of nodes. Proof: In the Appendix. Proposition 6. The approximation ratio  algorithm  of F IND B FF M for the B FF - MA problem is O √1n where n is the number of nodes. IV. T HE O2 B FF P ROBLEM In this section, we relax the requirement that the nodes are connected in all snapshots of a graph history. Instead, we ask to find the subset of nodes with the maximum aggregate density in at least k of the snapshots. We call this problem On-Off B FF (O2 B FF) problem. We formally define O2 B FF, we show that it is NP-hard and develop two general types of algorithms for efficiently solving it in practice. A. Problem definition Proof: In the Appendix. We also consider applying the F IND B FF A algorithm that selects to remove the node with the minimum average degree. We can show that F IND B FF A has a poor approximation ratio for the B FF - AM problem. In the O2 B FF problem, we seek to find a collection Ck of k graph snapshots, and a set of nodes S ⊆ V , such that the subgraphs induced by S in Ck have high aggregate density. Formally, the O2 B FF problem is defined as follows: Proposition 7. The approximation ratio  of  algorithm 1 √ F IND B FF A for the B FF - MA problem is O where n is n the number of nodes. Problem 2 (The On-Off B FF (O2 B FF) Problem). Given a graph history G = {G1 , G2 , . . . , Gτ }, an aggregate density function f , and an integer k, find a subset of nodes S ⊆ V , and a subset Ck of G of size k, such that f (S, Ck ) is maximized. Proof: In the Appendix. The complexity of B FF - MA and B FF - AM is an open problem. Jethava and Beerenwinkel [5] conjecture that the B FF - MA problem is NP-hard, yet they do not provide a proof. Given that F IND B FF A and F IND B FF M have no theoretical guarantees, we also investigate a greedy approach, which selects which node to remove based on the objective function of the problem at hand. This greedy approach is again an instance of the iterative algorithm shown in Algorithm 1. More specifically, for a target function f (either fam or fma ), given a set Si−1 , we define the score scoreg (v, G[Si ]) of node v ∈ Si as follows: As for Problem 1, depending on the choice of the aggregate density function f , we have four variants of O2 B FF. Thus, fmm , fma , fam and faa give rise to problems O2 B FF - MM, O2 B FF - MA, O2 B FF - AM and O2 B FF - AA respectively. Note that the subcollection of graphs Ck ⊂ G does not need to consist of contiguous graph snapshots. If this were the case, then the problem could be solved easily by considering all possible contiguous subsets of [1, τ ] and outputting the one with the highest density. However, all the four variants of the O2 B FF become NP-hard if we drop the constraint for consecutive graph snapshots. scoreg (v, G[Si−1 ]) = f (Si−1 , G) − f (Si−1 \ {v}, G) . Theorem 1. Problem 2 is NP-hard for any definition of the aggregate density function f . At iteration i, the algorithm selects the node vi that causes the smallest decrease, or the largest increase in the target function We will prove that there exists a clique of size at least k in graph G if and only if there exists a set of nodes S and Algorithm 5 The Iterative (ITR) F IND O2 B FF algorithm. Input: Graph history G = {G1 , . . . Gτ }; an aggregate-density function f ; integer k Output: A subset of nodes S and a subset of snapshots Ck ⊆ G. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: converged = False (Ck0 , S 0 ) = I NITIALIZE (G, f ) ds0 = 0 while not converged do Ck = B EST S NAPSHOTS(S 0 , f ) S = F IND B FF(Ck , f ) ds = f (S, Ck ) if ds < ds0 then Converged = True else ds0 = ds, S 0 = S return S, Ck a subset Ck ⊆ G of k snapshots, with f (S, Ck ) ≥ 1. The forward direction is easy; if there exists a subset of nodes S in G, with |S| ≥ k, that form a clique, then selecting this set of nodes S, and a subset Ck of k snapshots that correspond to nodes in S will wield fmm (S, Ck ) = fam (S, Ck ) = 1. This follows from the fact that every snapshot is a complete star where dm (S, Gi ) = 1 for all Gi ∈ Ck . To prove the other direction, we observe that all our snapshots consist of a star graph, and a collection of disconnected nodes. Given a set S, dm (S, Gi ) = 1, if i ∈ S and all nodes in S are connected to the center node i, and zero otherwise. Therefore, if fmm (S, Ck ) = 1 or fam (S, Ck ) = 1, then this implies that dm (S, Gi ) = 1 for all Gi ∈ Ck , which means that the k centers of the graph snapshots in Ck are connected to all nodes in S, and hence to each other. Therefore, they form a clique of size k in the graph G. In the case of faa and fma the construction proceeds as follows: given the graph G = (V, E), with |E| = m edges, we construct a graph history G = {G1 , . . . , Gτ } with τ = m snapshots. All snapshots are defined over the vertex set V . There is a snapshot Ge for each edge e ∈ E, consisting of the single edge e. We can prove that there exists a clique of size at least k in graph G if and only if there exists a set of nodes S and a subset CK ⊆ G of K = k(k − 1)/2 snapshots, with f (S, CK ) ≥ 1/k. We will prove that there exists a clique of size at least k in graph G if and only if there exists a set of nodes S and a subset CK ⊆ G of K = k(k − 1)/2 snapshots, with f (S, CK ) ≥ 1/k. The forward direction is easy. If there exists a subset of nodes S in G, with |S| = k, that form a clique, then selecting this set of nodes S, and the k2 snapshots CK in G that correspond to the edges between the nodes in S will yield faa (S, CK ) = fma (S, CK ) = 1/k. To prove the other direction, assume that there is no clique of size greater or equal to k in G. Let CK be any subset of K = k(k − 1)/2 snapshots, and let S be the union of the endpoints of the edges in CK . Since S cannot be a clique, it follows that |S| = ` > k. Therefore, faa (S, CK ) = fma (S, CK ) = 1/` < 1/k. B. O2 B FF algorithms We consider two general types of algorithms: iterative and incremental algorithms. The iterative algorithm starts with an initial size k collection Ck of graph snapshots and improves it, whereas the incremental algorithm builds the collection incrementally, adding one snapshot at a time. Next, we describe these two types of algorithms in detail. Note that depending on whether we are solving the O2 B FF - MM, O2 B FF - MA, O2 B FF - AM or O2 B FF - AA problem, we use the appropriate version of the F IND B FF algorithm in each of these algorithms. 1) Iterative Algorithm: The iterative (ITR) algorithm (shown in Algorithm 5) starts with an initial collection of snapshots Ck0 and set of nodes S 0 (routine I NITIALIZE). At each iteration, given a set S, it finds the k graph snapshots with the highest d(S, Gi ) score; this is done by B EST S NAPSHOTS. B EST S NAPSHOTS computes the density d(S, Gi ) of S in each snapshot Gi ∈ G and outputs the k snapshots Ck with the highest density. Given Ck , the algorithm then finds the set S ⊆ V such that f (S, Ck ) is maximized. This step essentially solves Problem 1 on input Ck for aggregate density function f using the F IND B FF algorithm. The ITR algorithm keeps iterating between collections Ck and dense sets of nodes S until no further iterations can improve the score f (S, Ck ). An important step of the Iterative F IND O2 B FF is the initialization of Ck0 and S 0 . We consider three different alternatives for this initialization: random, contiguous, and at least-k. Random initialization (ITRR ): In this initialization, we randomly pick k snapshots Ck0 from G. These snapshots are then used for solving the corresponding B FF problem on input Ck0 and produce S 0 = F IND B FF(Ck0 , f ). Contiguous initialization (ITRC ): In this initialization, we first find an S 0 that consists of the best k contiguous graph snapshots. Given G = {G1 , . . . , Gτ }, we go over all the O(τ ) contiguous sets of k snapshots from G, and find the set of k snapshots Ck0 and corresponding set of nodes S 0 that maximize f (S 0 , Ck0 ). The intuition behind this initialization technique is that it assumes that the best k snapshots of G are going to be contiguous. Our experiments demonstrate that in practice this is true in many datasets – e.g., in collaboration networks that evolve over time and we expect to see some temporal locality. At least-k initialization (ITRK ): In this initialization, we solve the B FF problem independently in each snapshot Gi ∈ G. This results in τ different sets Si ⊆ V , one for each solution of B FF on Gi . S 0 includes the nodes that appear in at least k of the τ sets Si . The intuition behind this initialization is to include in the initial solution those nodes that appear to be densely connected in many snapshots. We also experimented with other natural alternatives, such as the union: S 0 = ∪i=1...τ Si and the intersection: S 0 = ∩i=1...τ Si ; the at least-k approach seems to strike a balance between the two. The running time of the iterative F IND O2 B FF algorithm is O (I (nτ + M )), where I is the number of iterations required until convergence, and the O(nτ +M ) comes from the running time of F IND B FF. In practice, we observed that the algorithm converges in at most 6 iterations. Algorithm 6 The Incremental Density (INCD ) F IND O2 B FF algorithm. Input: Graph history G = {G1 , . . . Gτ }; aggregate-density function f ; integer k Output: A subset of nodes S and a subset of snapshots Ck ⊆ G. 1: Sij = F IND B FF({Gi , Gj }, f ), ∀Gi , Gj ∈ G 2: C2 = arg max f (Sij , {Gi , Gj }) Gi ,Gj ∈G 3: for i = 3 ; i ≤ k do 4: for each Gt ∈ G \ Ci−1 do 5: St = F IND B FF(Ci−1 ∪ {Gt }, f ) 6: Gm = arg max f (St , Ci−1 ∪ {Gt }) Gt Ci = Ci−1 ∪ {Gm } 8: S = F IND B FF(Ck , f ) 9: return S, Ck 7: Algorithm 7 The Incremental Overlap (INCO ) F IND O2 B FF algorithm. 1: 2: 3: 4: 5: 6: 7: 8: Input: Graph history G = {G1 , . . . Gτ }; aggregate-density function f ; integer k Output: A subset of nodes S and a subset of snapshots Ck ⊆ G. Si = F IND B FF(Gi , f ), ∀Gi ∈ G |Si ∩ Sj | C2 = arg max Gi ,Gj ∈G |Si ∪ Sj | for i = 3 ; i ≤ k do SC = F IND B FF(Ci−1 , f ) |St ∩ SC | Gm = arg max Gt |St ∪ SC | Ci = Ci−1 ∪ {Gm } S = F IND B FF(Ck , f ) return S, Ck 2) Incremental Algorithm: The incremental algorithm starts with a collection C2 with two snapshots and incrementally adds snapshots to it until a collection Ck with k snapshots is formed. Then, the appropriate F IND B FF algorithm is used to compute the most dense subset of nodes S in Ck . We use two different policies for selecting snapshots. The first one, termed incremental density (INCD ) algorithm (shown in Algorithm 6), selects graph snapshots so as to maximize density, whereas the second one, termed incremental overlap (INCO ) algorithm (shown in Algorithm 7), selects graph snapshots so as to maximize the overlap among nodes in the dense subsets. Incremental density (INCD ): To select the pair of snapshots to form the initial collection C2 , we solve the B FF problem independently  for each pair of snapshots Gi , Gj ∈ G. This gives us τ2 dense sets Sij as solutions. We select the pair of snapshots whose dense subgraph Sij has the largest density (lines 1–2). The algorithm then builds the solution incrementally in iterations. In iteration i, we construct the solution Ci by adding to solution Ci−1 the graph snapshot Gm that maximizes the density function f . That is if St is the densest subset in the sequence Ci−1 ∪ {Gt }, Gm = arg max f (St , Ci−1 ∪ {Gt }) Gt (lines 3–6). The running time of the INCD algorithm is O τ 2 (n + M ) + kτ (knτ + M ) . The first term is due to the initialization step in line 1, where we look for the best pair of snapshots. If efficiency is important we can initialize the algorithm with a random pair to save time. Incremental overlap (INCO ): To form the initial collection C2 , we first solve the B FF problem independently in each snapshot Gi ∈ G. This gives us τ different sets Si ⊆ V , where Si is the most dense subgraph in Gi . The algorithm selects from these τ sets the two most similar ones, Si and Sj , and initializes C2 with the corresponding snapshots Gi and Gj (lines 1–2). For defining similarity between sets of nodes, we use the Jaccard similarity. To form Ci from Ci−1 , the algorithm first solves the B FF problem in Ci−1 . Let SC be the solution. Then, it selects from the remaining snapshots and adds to Ci−1 the snapshot Gm whose dense set St is the most similar with SC (lines 3–6). The running time of the INCO algorithm is O(τ 2 n + k (nτ + M )), where the first term is the time for the initialization and the second term for the for-loop. V. B FF P ROBLEM E XTENSIONS The definitions of the B FF and O2 B FF problem focus on the identification of a set of nodes S such that their aggregate density is maximized. We now consider natural extensions of the B FF problem by placing additional constraints on the dense subgraphs. Query-node constraint: An interesting extension is introducing a set Q of seed query nodes and requiring that the output set of nodes S has high density and also contains the input seed nodes. A similar extension was introduced for static (e.g., single snapshots) graphs in [7]. In practice, this variant of B FF identifies the lasting “best friends” of the query nodes. We call this the Q R -B FF problem. We can modify the F IND B FF algorithms appropriately so that they take into consideration this additional constraint. In particular, F IND B FF M stops when a query node in Q is selected to be removed. Let us call this modified algorithm, Q R -F IND B FF M . We can prove the following proposition. (We omit the proof due to space constraints.) Proposition 8. Q R -F IND B FF M solves the Q R -B FF - MM problem optimally in polynomial time. We also modify F IND B FF A so that it does not remove seed nodes as follows: If at any step, the node with the minimum average degree happens to be a seed node, the algorithm selects to remove the node with the next smallest degree that is not a seed node. The algorithm stops when the only remaining nodes are seed nodes. Let us call this modified algorithm, Q R -F IND B FF A . Proposition 9. Let S ∗ be an optimal solution for the Q R -B FF - AA problem and SA be the solution of the (S ∗ )+2 ω , Q R -F IND B FF A algorithm. It holds: faa (SA ) ≥ s faa2(s+q) P where q = |Q|, s = |S ∗ \ Q| and ω = u∈Q degree(u, S ∗ ). Proof: By Lemma 1, it suffices to show that the Q R -F IND B FF A algorithm provides an approximation of the average density of a single graph G. Let S ∗ be the optimal solution for G. Let G0 be the graph that results from G when we delete all edges between two query nodes in G. Clearly, S ∗ is also an optimal solution for G0 . Assume that we assign each edge (u, v) to either u or v. For each node u, let a(u) be the number of edges assigned to it and let amax = maxu {a(u)}. It is easy to see that faa (S ∗ ) ≤ 21 amax , since each edge in the optimal solution must be assigned to a node in it. Now assume that the assignment of edges to nodes is performed as the Q R -F IND B FF A algorithm proceeds. Initially, all edges are unassigned. When at step i, a node u is deleted, we assign to u all the edges that go from Si−1 to u. Note that this assignment maintains the invariant that at each step, all edges between two nodes in the current set S are unassigned, while all other edges are assigned. When the algorithm stops, all edges have been assigned. Consider a single iteration of the algorithm when a node umin is selected to be removed and let S be the current set. Let s be the number of non-query nodes in S, and q = |Q| Pbe the number 1 of query nodes. It holds: faa (S) = s+q u∈S degree(u) P P 1 1 = s+q degree(u)+ degree(u). Let Ω = u∈Q s+q P v∈S\Q 1 degree(u). Since u has the smallest degree min u∈Q s+q among all nodes in S but the seed nodes, we have faa (S) ≥ 1 s+q s a(umin ) + Ω. Since all edges are assigned and edges are assigned to a node only when this node is removed, at some step of the execution of the algorithm a(umin ) = amax . Thus, s s 1 ∗ for some S, faa (S) ≥ s+q amax +Ω ≥ s+q 2 faa (S )+Ω. Connectivity constraint: Another meaningful extension is to impose restrictions on the connectivity of S. The connectivity of S in a graph history G = {G1 , . . . , Gτ } may have many different interpretations. One may consider a version where all the induced subgraphs Gt [S] for t ∈ {1, . . . , τ } are connected. Another alternative is that at least m > 0 of the τ Gt [S]’s are connected. Here, we assume that a definition of connectivity for S is given in the form of a predicate connected(S, G) which is true if S is connected and false otherwise. Our problem now becomes: given a graph history G, a set of query nodes Q ⊂ V and an aggregate density function f , find a subset of nodes S ⊆ V , such that (1) f (S, G) is maximized, (2) Q ⊆ S, and (3) connected(S, G) is true. To solve this problem, we can modify F IND B FF so that it tests for the connectivity predicate connected(S, G) and stops when the connectivity constraint no longer holds. In our experiments, we apply a simplest test, just running the algorithms on the connected components of the query nodes. Size constraint: Finally, note that the definition of B FF does not impose a constraint on the size of the output set of nodes S. In that respect the problem is parameter-free. If necessary, one can add an additional constraint to the problem definition by imposing a cardinality constraint on the output S. However the cardinality constraint makes the subgraph-discovery problem computationally hard [7]. This also holds for the B FF problem; simply consider a graph history with replicas of the same single-snapshot graph. VI. E XPERIMENTAL E VALUATION The goal of our experimental evaluation is threefold. First, we want to evaluate the performance of our algorithms for the B FF and the O2 B FF problems in terms of the quality of the solutions and running time. Second, we want to compare the different variants of the aggregate density functions. Third, we want to show the usefulness of the problem, by presenting results of B FF’s and O2 B FF’s in two real datasets, namely research collaborators in DBLP and hashtags in Twitter. TABLE I: Real dataset characteristics Dataset DBLP10 Oregon1 Oregon2 Caida Twitter AS # Nodes 2,625 11,492 11,806 31,379 849 7,716 # Edges (aver. per snapshot) 1,143 22,569 31,559 45,833 100 7,783 # Snapshots 10 9 9 122 15 733 Datasets and setting. To evaluate our algorithms, we use a number of real graph histories, where the snapshots correspond to collaboration, computer, and concept networks. • The DBLP10 1 dataset contains yearly snapshots of the coauthorship graph in the 2006-2015 interval, for 11 top database and data mining conferences. There is an edge between two authors in a graph snapshot, if they coauthored a paper in the corresponding year and more than two papers in the corresponding interval. • The Oregon1 2 dataset consists of nine graph snapshots of AS peering information inferred from Oregon route-views between March 31 2001 and May 26 2001 (one snapshot per week). • The Oregon2 3 dataset consists of nine weekly snapshots of AS graphs, between March 31, 2001 and May 26, 2001. • The Caida4 dataset, contains 122 CAIDA autonomous systems (AS) graphs, derived from a set of route views BGP-table instances. • In the Twitter dataset [8], nodes are hashtags of tweets and edges represent the co-appearance of hashtags in a tweet. The dataset contains 15 daily snapshots from October 27, 2013 to November 10, 2013. • The AS5 dataset represents a communication network of who-talks-to-whom from the BGP (Border Gateway Protocol) logs. The dataset contains 733 daily snapshots which span an interval of 785 days from November 8, 1997 to January 2, 2000. The dataset characteristics are summarized in Table I. Since we do not have any ground truth information for the real datasets, we also use synthetic datasets. In particular, we create graph snapshots using the forest fire model [9], a wellknown model for creating evolving networks, using the default forward and backward burning probabilities of 0.35. Then, we plant dense subgraphs in these snapshots, by randomly selecting a set X ⊂ V of the nodes and creating additional edges between them, different at each snapshot. 1 http://dblp.uni-trier.de/ 2 https://snap.stanford.edu/data/oregon1.html 3 https://snap.stanford.edu/data/oregon2.html 4 http://www.caida.org/data/as-relationships/ 5 https://snap.stanford.edu/data/as.html A. B FF evaluation Since, as shown in Section III-B, F IND B FF M and F IND B FF A are provably good for the B FF - MM and B FF - AA problems respectively, we only consider these algorithms for these problems. For the B FF - MA and B FF - AM problems, we use all three algorithms, i.e., F IND B FF M , F IND B FF A , and F IND B FF G . For the B FF - MA problem, we also use the DCS algorithm proposed in [5] for a problem similar to B FF - MA. The DCS algorithm is also an iterative algorithm that removes nodes, one at a time. At each step, DCS finds the subgraphs with the largest average density for each of the snapshots. Then, it identifies the subgraph with the smallest average density among them and removes the node that has the smallest degree in this subgraph. Accuracy of F IND B FF and comparison of the density definitions: We start by an evaluation of the accuracy of our algorithms along with a comparison of the different aggregate densities. Since we do not have any ground truth information for the real data, we use first the synthetic datasets. First, we create 10 graph snapshots with 4, 000 nodes each using the forest fire model [9]. Then, in each one of the 10 snapshots we plant a dense random subgraph A with 100 nodes by inserting extra edges with probability pA . We vary the edge probabilities from pA = 0.1 to pA = 0.9, and in Fig. 2(a), we report the F measure achieved for the four density definitions, when trying to recover subgraph A. Recall that the F takes values in [0, 1] and the larger the value the better the recall and precision of the solution with respect to the ground truth (in this case A). B FF - MM is the most sensitive measure, since it reports A as a dense subgraph even for the smallest edge probability. B FF - MA and B FF - AM achieve a perfect F value, for an edge probability larger than pA = 0.1 and B FF - AA for an edge probability at least pA = 0.3. For smaller values, these three density definitions locate supersets of A, due to averaging. All variations of the F IND B FF algorithms produce the same results. We now study how the various density definitions behave when there is a second dense subgraph. In this case, we plant a subgraph A with edge probability pA = 0.5 in all snapshots and a second dense subgraph B with the same number of nodes as A and edge probability pB = 0.9 in a percentage ` of the snapshots, for different values of `. Fig. 2(b) depicts which of two graphs, graph A (shown in blue), or graph B (shown in red), is output by the F IND B FF algorithms for the different density definitions. B FF - MM and B FF - MA report A as the densest subgraph, since these measures ask for high density at each and every snapshot. However, B FF - AM and B FF - AA report B, when the very dense subgraph B appears in a sufficient number (more than half) of the snapshots. All density definitions and algorithms, recover the exact set A, or B, at each case. We also run all algorithms using the real datasets and present the results in Table II, where we report the value of the BFF-MM BFF-MA BFF-AM BFF-AA BFF-AA 1 0.8 F-measure We ran our experiments on a system with a quad-core Intel Core i7-3820 3.6 GHz processor, with 64 GB memory. We only used one core in all experiments. BFF-AM A B 0.6 BFF-MA 0.4 0.2 BFF-MM 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 PA (a) F -measure for the BF F problems 0% 20% 40% 60% 80% Fraction of planted snapshots for B 100% (b) Dense graph reported by each of the BF F problems Fig. 2: Accuracy and density definition comparison for B FF objective function and the size of the solution. A first observation is that as expected, the value of the aggregate density of the reported solution (independently of the problem variant) increases with the density of the graphs. For B FF - MM problem we observe that the solutions usually have small cardinality compared to the solutions for other problems, since the fmm objective is rather strict (the solution for Twitter was empty). The solutions for B FF - MM problem in the autonomous-system datasets appear to have higher fmm scores. This may be due to the fact that there are larger groups of nodes with lasting connections in these datasets, e.g., nodes that communicate intensely between each other during the observation period. Comparison of F IND B FF alternatives for B FF - MA and B FF - AM: As shown in Table II, for the B FF - MA problem, F IND B FF G and F IND B FF A perform overall the best in all datasets producing subgraphs with large fma values. F IND B FF A performs slightly worse than F IND B FF G only in the Caida dataset. In the Caida dataset, due probably to the large number of snapshots, F IND B FF A – which is based on the average degree – returns a set with the smallest density. F IND B FF M and DCS have comparable performance, since they both remove nodes with small degrees in individual snapshots. They are both outperformed by F IND B FF A and F IND B FF G . For the B FF - AM problem, F IND B FF A outperforms both F IND B FF M and F IND B FF G . Our deeper analysis of the inferior performance of F IND B FF G for this problem revealed that F IND B FF G often gets trapped in local maxima after removing just a few nodes of the graph and it cannot find good solutions. Running time: In Table III, we report execution times. As expected, the response time of F IND B FF G algorithm is the slowest in all datasets, due to its quadratic complexity. For the B FF - MA problem, F IND B FF A is in general faster than DCS. The difference in times in F IND B FF M algorithms are due to differences in the computation of the density functions. Additional experiments including ones with synthetic datasets with larger graphs and more intervals that show similar behavior are depicted in Figs. 3(a)(b). In particular the Fig. 3(a) show the execution time of the different algorithms for the B FF - MA problem for varying nodes with τ = 10, whereas Fig. 3(b) shows the execution time for varying snapshots. Summary: In conclusion, our algorithms successfully discovered the planted dense subgraphs even when their density is small, with B FF - MM being the most sensitive measure. Minimum aggregation over densities (i.e., B FF - MM, B FF - MA) requires a dense subgraph to be present at all snapshots, TABLE II: Results of the different algorithms for the B FF problem on the real datasets. B FF - MM F IND B FF M Size fmm Datasets 11 33 75 17 15 DBLP10 Oregon1 Oregon2 Caida Twitter AS 1.0 14.0 23.0 8.0 0.0 4.0 F IND B FF M Size fma B FF - MA F IND B FF A F IND B FF G Size fma Size fma DCS Size fma 3 80 140 33 836 19 8 73 131 29 7 18 14 77 116 57 720 16 1.33 23.7 44.33 13.76 0.04 8.53 1.75 23.86 45.24 12.76 0.29 6.67 61 80 132 60 13 20 1.7 24.05 45.95 15.43 0.62 9.0 F IND B FF M Size fam 1.29 24.05 44.91 15.05 0.05 8.75 11 33 63 20 12 1.0 14.22 24.44 12.72 0.0 7.44 B FF - AM F IND B FF A Size fam 4 35 44 36 3 14 1.7 15.0 23.22 18.11 1.0 9.05 F IND B FF G Size fam B FF - AA F IND B FF A Size faa 4 20 461 311 3 14 8 59 147 96 5 38 1.0 2.0 3.22 3.43 1.0 3.14 2.75 25.73 47.89 33.21 1.38 16.38 TABLE III: Execution time (sec) of the different algorithms for the B FF problem on the real datasets. Datasets B FF - MM F IND B FF M F IND B FF M DBLP10 Oregon1 Oregon2 Caida Twitter AS 0.08 0,27 0.36 2.24 0.37 3.49 0.05 0.24 0.29 2.51 0.57 2.82 F IND B FF M F IND B FF A 1,000 F IND B FF A 2.04 48 52 2,519 2.81 738 DCS F IND B FF G 15 Time (sec) Time (sec) 0.03 0.21 0.47 2.30 0.24 2.16 F IND B FF M DCS F IND B FF G B FF - MA F IND B FF A F IND B FF G 800 600 400 10 5 200 0 0 8 16 24 32 # nodes in thousands (a) 40 10 20 30 40 50 # snapshots (b) Fig. 3: Synthetic dataset (pA = 0.5): execution time of the different algorithms for the B FF - MA problem for varying number of (a) nodes, and (b) snapshots. whereas average aggregation over densities (i.e., B FF - AM, B FF - AA) asks that the nodes are sufficiently connected with each other on average. For the B FF - MA and B FF - AM problems, F IND B FF A returns in general more dense subgraphs than the alternatives (including DCS). Both F IND B FF A and F IND B FF M scale well. They perform similarly for the different density functions with the differences in running time attributed to the complexity of calculating the respective functions. B. O2 B FF evaluation In this set of experiments, we evaluate the performance of the iterative and incremental F IND O2 B FF algorithms. Comparison of the algorithms in terms of solution quality: Similar to before, we plant a dense random graph A in k snapshots. We then run the F IND O2 B FF algorithms with the same value of k. In Fig. 4, we report the F measure for the different values of k expressed as a percentage of the total number of snapshots. For the iterative F IND O2 B FF algorithm, the at-least-k initialization (ITRK ) outperforms the other two, and it successfully locates A for all four density definitions, when A appears in a sufficient number of snapshots. Non-surprisingly, all initializations work equally well for average aggregation over time (i.e., O2 B FF - AM and O2 B FF - AA). For the incremental F IND O2 B FF algorithm, den- DCS F IND B FF M B FF - AM F IND B FF A F IND B FF G B FF - AA F IND B FF A 0.34 0.83 1.03 11.22 0.47 17.37 0.05 0.48 0.58 6.31 0.85 9.29 0.08 0.57 0.65 5.97 0.28 10.43 1.58 131 57 1,652 2.65 470 0.04 0.28 0.48 2.14 0.52 2.64 sity (INCD ) slightly outperforms overlap (INCO ). Overall, the incremental algorithms achieve highest F , when compared with the iterative ones. We also conduct a second experiment in which we plant a dense random graph A with edge probability pA = 0.5 in all snapshots and a dense random graph B with edge probability pB = 0.9 in k snapshots. In Fig. 5, we report the F measure assuming that B is the correct output for the O2 B FF problem for different values of k expressed as a percentage of the total number of snapshots. Again, by comparing the different initializations for the iterative F IND O2 B FF algorithm, we observe that among the iterative algorithms, ITRK successfully locates B for all four density definitions, when B appears in a sufficient number of snapshots. As in the previous experiment, all initializations work equally well for average aggregation over time. The incremental algorithms outperform the iterative ones with INCD being the champion, since they achieve higher F measure values even when B appears in a few snapshots. We also apply the F IND O2 B FF algorithms on all real datasets for various values of k. In Figs. 6 – 8, we report the value of the aggregate density for DBLP10 , Oregon1 , and Oregon2 for different values of k, again expressed as a percentage of the total number of snapshots of the input graph history. Overall, we observed that, in contradistinction to the experiments with real datasets, the contiguous initialization (ITRC ) of the iterative O2 B FF - AA algorithm emerges as the best algorithm in many cases, slightly outperforming INCD . This is indicative of temporal locality of dense subgraphs in these datasets, i.e., in these datasets dense subgraphs are usually alive in a few contiguous snapshots. This is especially evident in datasets from collaboration networks such as the DBLP datasets. We also notice that the incremental algorithms find solutions with density very close to that of the iterative algorithms. Finally, we also observe that as k increases the aggregate density of the solutions decrease. This again is explained by the fact that often dense subgraphs are only “alive” in a few snapshots. IN CD IN CO 1 0.8 0.6 0.4 0.2 0 IT RC 20 40 60 80 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 IT RC 20 k (in % of snapshots) 40 60 80 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 IT RC F-measure for B FF - AA IT RR F-measure for B FF - AM IT RK F-measure for B FF - MA F-measure for B FF - MM IT RC 20 k (in % of snapshots) 40 60 80 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 20 k (in % of snapshots) 40 60 80 k (in % of snapshots) Fig. 4: Synthetic dataset (pA = 0.9): F -measure values for the O2 B FF problems IN CD IN CO IT RC 1 0.8 0.6 0.4 0.2 0 20 40 60 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 80 IT RC 20 k (in % of snapshots) 40 60 80 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 IT RC F-measure for B FF - AA IT RR F-measure for B FF - AM IT RK F-measure for B FF - MA F-measure for B FF - MM IT RC 20 k (in % of snapshots) 40 60 80 IT RK IT RR IN CD IN CO 1 0.8 0.6 0.4 0.2 0 20 k (in % of snapshots) 40 60 80 k (in % of snapshots) Fig. 5: Synthetic dataset (pA = 0.5, pB = 0.9): F -measure values for the O2 B FF problems IT RK IT RR IN CD IT RC IN CO IT RK IT RR IN CD IN CO IT RC IT RK IT RR IN CD IN CO IT RC 5 5 4 4 4 4 3 2 2 1 3 20 40 60 1 80 faa 5 fam 5 fma fmm IT RC 3 2 20 40 60 1 80 IT RR IN CD IN CO 3 2 20 k (in % of snapshots) k (in % of snapshots) IT RK 40 60 1 80 20 k (in % of snapshots) 40 60 80 k (in % of snapshots) Fig. 6: DBLP10 dataset: scores of aggregate density functions f IT RC IT RK IT RR IN CD IT RC IN CO IT RK IT RR IN CD IN CO IT RC 17 IT RK IT RR IN CD IT RC IN CO IT RK IT RR IN CD IN CO 17 26 26 25 faa fam fma fmm 16 16 24 15 24 14 15 20 40 60 20 80 k (in % of snapshots) 40 60 80 20 k (in % of snapshots) 40 60 22 80 20 k (in % of snapshots) 40 60 80 k (in % of snapshots) Fig. 7: Oregon1 dataset: scores of aggregate density functions f IT RC IT RK IT RR IN CD IN CO IT RC IT RK IT RR IN CD IN CO IT RC 30 IT RK IT RR IN CD IN CO IT RC IT RK IT RR IN CD IN CO 30 50 50 48 fam 26 faa 28 fma fmm 28 26 46 24 22 46 24 20 40 60 k (in % of snapshots) 80 44 20 40 60 k (in % of snapshots) 80 22 48 20 40 60 80 k (in % of snapshots) Fig. 8: Oregon2 dataset: scores of aggregate density functions f 44 20 40 60 k (in % of snapshots) 80 IT RC IT RK IT RR IN CD IN CO IT RC IT RK IT RR IN CD IN CO 600 TABLE IV: The B FF solutions for DBLP10 (in parenthesis dense author subgroups). Time (sec) Time (sec) 60 400 200 B FF - MM (Wei Fan, Philip S. Yu, Jiawei Han, Charu C. Aggarwal), (Lu Qin, Jeffrey Xu Yu, Xuemin Lin), (Guoliang Li, Jianhua Feng), (Craig Macdonald, Iadh Ounis) 40 20 B FF - MA 0 (Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han, Charu C. Aggarwal), (Jeffrey Xu Yu, Xuemin Lin, Ying Zhang) 0 20 40 60 80 20 k (in % of snapshots) 40 60 80 k (in % of snapshots) (a) B FF - AM (b) (Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han) Fig. 9: Execution time of the different algorithms for the O2 B FF - MM problem in (a) Synthetic (pA = 0.5, pB = 0.9), and (b) Oregon2 datasets. Convergence and running time: In terms of convergence, iterative F IND O2 B FF requires 2-6 iterations to converge in all datasets. In Fig. 9 we report the execution time of O2 B FF algorithms for the B FF - MM problem in synthetic (pA = 0.5, pB = 0.9), and (b) Oregon2 datasets. As we observed, iterative and incremental INCO algorithms scale well with k. Comparing incremental algorithms, INCO is up to 6x and 3.5x faster than INCD in synthetic and Oregon2 datasets respectively due to the quadratic complexity of the latter. Additional experiments including ones with synthetic datasets with larger graphs and more intervals are depicted in Fig. 10(a) and Fig. 10(b) respectively. In particular, Fig. 10(a) shows the execution time of the different algorithms for the O2 B FF - MM problem for varying number of nodes, with τ = 10 and k = 6 whereas Fig. 10(b) shows the execution time for varying number of snapshots with k = 16 τ . Summary: In conclusion, all algorithms successfully discovered the planted dense subgraphs that lasted a sufficient percentage (much less than half) of the snapshots with the incremental ones being more sensitive. Among the F IND O2 B FF algorithms, incremental algorithms outperform the iterative ones in most cases. Among the incremental algorithms, INCD is slightly better than INCO . However, given the slow running time of INCD , INCO is a more preferable choice. Finally, in datasets consisting of dense subgraphs with temporal locality, ITRC is a good choice for detecting such graphs. IT RC IT RK IT RR IN CD IT RC IN CO IT RK IT RR IN CD IN CO 213 213 Time (sec) Time (sec) 211 29 27 27 24 25 23 210 21 8 16 24 32 # nodes in thousands (a) 40 10 20 30 40 50 # snapshots (b) Fig. 10: Synthetic dataset (pA = 0.5): execution time (log scale) of the different algorithms for the O2 B FF - MM problem for varying number of (a) nodes, and (b) snapshots. B FF - AA (Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han, Charu C. Aggarwal, Mohammad M. Masud, Latifur Khan, Bhavani M. Thuraisingham) C. Case studies In this section, we report indicative results we obtained using the DBLP10 and the Twitter datasets. These results identify lasting dense author collaborations and hashtag cooccurrences respectively. Lasting dense co-authorships in DBLP10 : In Table IV, we report the set of nodes output as solutions to the different B FF problem variants, on the DBLP10 dataset. First, observe that three authors “Wei Fan”, “Philip S. Yu”, and “Jiawei Han” are part of all four solutions. These three authors have co-authored only two papers together in our dataset, but pairs of them have collaborated very frequently over the last decade. The solutions for B FF - AM and B FF - AA contain additional collaborators of these authors. For B FF - AA we obtain a solution of 8 authors. Although, this group has no paper in which they are all co-authors, subsets of the authors have collaborated with each other in many snapshots, resulting in high value of faa . The solutions for B FF - MM and B FF - MA contain the aforementioned three authors and some of their collaborators, but also some new names. These are authors that have scarce or no collaborations with the former group. Thus, in this case, the solutions consist of more than one dense subgroups of authors (grouped in parentheses), that are densely connected within themselves, but sparsely or not connected with others, while this is not the case for B FF - AM and B FF - AA. In Table V, we report results for O2 B FF - MM, O2 B FF - MA, 2 O B FF - AM and O2 B FF - AA on the same dataset. These authors are the most dense collaborators for k = 2, 4, 6, and 8 (recall there are 10 years in the dataset). We also report the corresponding years of their dense collaborations. Many new groups of authors appear. For example, we have new groups of collaborators from Tsinghua University, CMU and RPI among others. The authors appeared in the solutions of B FF also appear here for large values of k. We also studied experimentally the Q R -B FF problem. In Table VI, we show indicative results for three of the authors of this paper as seed nodes. For E. Pitoura, we retrieve a group of ex-graduate students with whom she had a lasting and prolific collaboration; for E. Terzi close collaborators from BU University, and for P. Tsaparas, a group of collaborators from his time at Microsoft Research. Note that in the last case, the selected set consists of researchers with whom P. TABLE V: The authors output as solutions to the O2 B FF problem on DBLP10 . k=2 Years: k=4 Years: k=6 Years: k=8 Years: B FF - MM, B FF - MA, B FF - AM, B FF - AA Christos Faloutsos, Leman Akoglu, Lei Li, Keith Henderson, Hanghang Tong, Tina Eliassi-Rad 2010 - 2011 B FF - MM, B FF - MA, B FF - AM B FF - AA Mo Liu, Chetan Gupta, Song Wang, Ismail Ari, Elke A. Rundensteiner 2010 - 2013 Yong Yu, Dingyi Han, Zhong Su, Lichun Yang, Shengliang Xu, Shenghua Bao) B FF - MM, B FF - MA, B FF - AM 2007, 2009 - 2011 B FF - AA Liyun Ru, Min Zhang, Yiqun Liu, Shaoping Ma Min Zhang, Liyun Ru Bhavani, Yiqun Liu, Shaoping Ma), Latifur Khan, M. Thuraisingham, Mohammad M. Masud, Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han 2007 - 2012 B FF - MM 2007 - 2012 B FF - AM B FF - MA B FF - AA Min Zhang, Yiqun Liu, Shaoping Ma Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han, Charu C. Aggarwal Liyun Ru, Min Zhang, Yiqun Liu, Shaoping Ma 2007 - 2014 2007 - 2008, 2010 - 2015 2007 - 2014 TABLE VI: An example of authors output as solutions to the Q R -B FF problem on DBLP10 . Q R -B FF E. Pitoura: G. Koloniari, M. Drosou, K. Stefanidis E.Terzi: V. Ishakian, D. Erdos, A. Bestavros P. Tsaparas: A. Fuxman, A. Kannan, R. Agrawal C. Faloutsos, D. Koutra: Chris H. Q. Ding, L. Akoglu, H. Huang, Lei Li, Tao Li, H. Tong Tsaparas has co-authored several papers in the period recorded in our dataset, but these authors are also collaborating amongst themselves. Finally, we use one of the authors appearing in the dense subgraphs of the O2 B FF, namely C. Faloutsos as seed node. In this case, we obtain a dense subgraph similar to the one we have reported in Table V. Finally, we consider a query with two authors: C. Faloutsos and his student D. Koutra. Adding D. Koutra to the query set changes the consistency of the result, focusing more on authors that are collaborators of both query nodes. Lasting dense hashtag appearances in Twitter: In Table VII, we report results of the O2 B FF problem on the Twitter dataset. Note that the results of the B FF problem on this dataset (as shown in Table II) are very small graphs, since very few hashtags appear together in all 15 days of the dataset. As seen in Table VII, we were able to discover interesting dense subgraphs of hashtags appearing in k = 3, 6, and 9 of these days. These hashtags correspond to actual events (including f1 races and wikileaks) that were trending during that period. For each solution, we also report the selected snapshot dates. As expected there is time-contiguity in the selected dates, but our approach also captures the interest fluctuation over time. For example, for the wikileaks topic that is captured in the dense hashtag set {“wikileaks”, “snowden”, “nsa”, “prism”}, the best snapshots are collections of contiguous intervals, rather than a single contiguous interval. Note also, that for large values of k, we do not get interesting results which is a fact consistent with the ephemeral nature of Twitter, where hashtags are short-lived. This is especially true for fmm and fma that impose strict density constraints and as a result the solutions consist of disconnected edges. Latifur Khan, Bhavani M. Thuraisingham, Mohammad M. Masud, Wei Fan, Jing Gao, Philip S. Yu, Jiawei Han, Charu C. Aggarwal 2007 - 2012, 2014 - 2015 VII. R ELATED W ORK To the best of our knowledge, we are the first to systematically study all the variants of the B FF, and O2 B FF problems. The research most related to ours is the recent work of Jethava and Beerenwinkel [5] and Rozenshtein et al. [10]. To the best of our understanding, the authors of [5] introduce one of the four variants of the B FF problem we studied here, namely, B FF - MA. In their paper, the authors conjecture that the problem is NP-hard and they propose a heuristic algorithm. Our work performs a rigorous and systematic study of the general B FF problem for multiple variants of the aggregate density function. Additionally, we introduce and study the O2 B FF problem, which is not studied in [5]. The authors of [10] study a problem that can be considered a special case of the O2 B FF problem. In particular, their goal is to identify a subset of nodes that are dense in the graph consisting of the union of edges appearing in the selected snapshots, which is a weak definition of aggregate density. Furthermore, they focus on finding collections of contiguous intervals, rather than arbitrary snapshots. They propose an algorithm similar to the iterative algorithm we consider, which we have shown to be outperformed by the incremental algorithms. There is a huge literature on extracting “dense” subgraphs from a single graph snapshot. Most formulations for finding subgraphs that define near-cliques are often NP-hard and often hard to approximate due to their connection to the maximumclique problem [11], [12], [13], [14], [15]. As a result, the problem of finding the subgraph with the maximum average or minimum degree has become particularly popular, due to its computational tractability. Specifically, the problem of finding a subgraph with the maximum average degree can be solved optimally in polynomial time [1], [2], [3], and there exists a practical greedy algorithm that gives a 2-approximation guarantee in time linear to the number of edges and nodes of the input graph [1]. The problem of identifying a subgraph with the maximum minimum degree, can be solved optimally in polynomial time [7], using again the greedy algorithm proposed by Charikar [1]. In our work, we use the average and minimum degree to quantify the density of the subgraph TABLE VII: The hashtags and the chosen snapshot dates output as solutions to the O2 B FF problem on Twitter. k=3 Dates: k=6 Dates: k=9 Dates: k = 12 B FF - MM, B FF - MA B FF - AM B FF - AA kimi, abudhabigp, f1, allowin ozpol, nz, mexico, malaysia, signapore, vietnam, chile, peru, tpp, japan, canada Oct 27-28, Nov 7 abudhabigp, fp1, abudhabi, guti, f1, pushpush, skyf1, hulk, allowin, bottas, kimi, fp3, fp2 Oct 31-Nov 2 Oct 31-Nov 2 B FF - MM, B FF - MA B FF - AM B FF - AA abudhabigp, f1, skyf1 wikileaks, snowden, nsa, prism Oct 28-Nov 2 Oct 27-28, Nov 3,5,7 abudhabigp, fp1, abudhabi, guti, f1, pushpush, skyf1, hulk, allowin, bottas, kimi, fp3, fp2 Oct 28, Oct 30-Nov 1, Nov 9 B FF - MM, B FF - MA B FF - AM B FF - AA (Too many tags to report) wikileaks, snowden, nsa, prism Oct 27-31, Nov 3,5-7 assange, wikileaks, snowden, nsa, prism Oct 27-29,31, Nov 3,5-7,10 B FF - MM, B FF - MA B FF - AM B FF - AA (Too many tags to report) wikileaks, snowden, nsa Oct 27-Nov 1, Nov 3-7,10 assange, wikileaks, snowden, nsa, prism Oct 27-31, Nov 2-7, 10 Dates: in a single graph snapshot, and we extend these definitions to sets of snapshots. The algorithmic techniques we use for the B FF problem are inspired by the techniques proposed by Charikar [1], and by Sozio and Gionis [7]; however, adapting them to handle multiple snapshots is non-trivial. Existing work also studies the problem of identifying a dense subgraph on time-evolving graphs [4], [16], [17]; these are graphs where new nodes and edges may appear over time and existing ones may disappear. The goal in this line of work is to devise a streaming algorithm that at any point in time it reports the densest subgraph for the current version of the graph. In our work, we are not interested in the dynamic version of the problem and thus the algorithmic challenges that our problem raises are orthogonal to those faced by the work on streaming algorithms. Other recent work [18] focuses on detecting dense subgraphs in a special class of temporal weighted networks with fixed nodes and edges, where edge weights change over time and may take both positive and negative values. This is a different problem, since we consider graphs with changing edge sets. Furthermore, density in the presence of edges with negative weights is different than density when edges have only positive weights. Finally, another line of research focuses on processing queries e.g., reachability, path distance, graph matching, etc. over multiple graph snapshots [19], [20], [21], [22], [23]. The main goal of this work is to devise effective storage, indexing and retrieving techniques so that queries over such sequences of graphs are answered efficiently. In this paper, we propose a novel problem that of finding dense subgraphs. VIII. S UMMARY In this paper, we introduced and systematically studied the problem of identifying dense subgraphs in a collection of graph snapshots defining a graph history. We showed that for many definitions of aggregate density functions the problem of identifying a subset of nodes that are densely-connected in all snapshots (i.e., the B FF problem) can be solved in linear time. We also demonstrated that other versions of the B FF problem (i.e., B FF - MA and B FF - AM) cannot be solved with the same algorithm. To identify dense subgraphs that occur in k, yet not all, the snapshots of a graph history we also defined the O2 B FF problem. For all variants of this problem we showed that they are NP-hard and we devised an iterative and an incremental algorithm for solving them. Our extensive experimental evaluation with datasets from diverse domains demonstrated the effectiveness and the efficiency of our algorithms. R EFERENCES [1] M. Charikar, “Greedy approximation algorithms for finding dense components in a graph,” in Approximation Algorithms for Combinatorial Optimization, 2000, pp. 84–95. [2] A. V. Goldberg, Finding a maximum density subgraph. University of California Berkeley, CA, 1984. [3] S. Khuller and B. Saha, “On finding dense subgraphs,” in ICALP, 2009, pp. 597–608. [4] A. Epasto, S. Lattanzi, and M. Sozio, “Efficient densest subgraph computation in evolving graphs,” in WWW, 2015, pp. 300–310. [5] V. Jethava and N. Beerenwinkel, “Finding dense subgraphs in relational graphs,” in ECML PKDD, 2015, pp. 641–654. [6] Y. Asahiro, K. Iwama, H. Tamaki, and T. Tokuyama, “Greedily finding a dense subgraph,” in SWAT, 1996, pp. 136–148. [7] M. Sozio and A. Gionis, “The community-search problem and how to plan a successful cocktail party,” in ACM SIGKDD, 2010, pp. 939–948. [8] P. Tsantarliotis and E. Pitoura, “Topic detection using a critical term graph on news-related tweets,” in Proceedings of the Workshops of the EDBT/ICDT, 2015, pp. 177–182. [9] J. Leskovec, J. M. Kleinberg, and C. Faloutsos, “Graph evolution: Densification and shrinking diameters,” TKDD, vol. 1, no. 1, 2007. [10] P. Rozenshtein, N. Tatti, and A. Gionis, “Discovering dynamic communities in interaction networks,” in ECML PKDD, 2014, pp. 678–693. [11] J. I. Alvarez-Hamelin, L. Dall’Asta, A. Barrat, and A. Vespignani, “Large scale networks fingerprinting and visualization using the k-core decomposition,” in NIPS, 2005, pp. 41–50. [12] J. Bourjolly, G. Laporte, and G. Pesant, “An exact algorithm for the maximum k-club problem in an undirected graph,” European Journal of Operational Research, vol. 138, no. 1, pp. 21–28, 2002. [13] K. Makino and T. Uno, “New algorithms for enumerating all maximal cliques,” in SWAT, 2004, pp. 260–272. [14] B. McClosky and I. V. Hicks, “Combinatorial algorithms for the maximum k-plex problem,” J. Comb. Optim., vol. 23, no. 1, pp. 29–49, 2012. [15] C. E. Tsourakakis, F. Bonchi, A. Gionis, F. Gullo, and M. A. Tsiarli, “Denser than the densest subgraph: extracting optimal quasi-cliques with quality guarantees,” in ACM SIGKDD, 2013, pp. 104–112. [16] B. Bahmani, R. Kumar, and S. Vassilvitskii, “Densest subgraph in streaming and mapreduce,” PVLDB, vol. 5, no. 5, pp. 454–465, 2012. [17] S. Bhattacharya, M. Henzinger, D. Nanongkai, and C. E. Tsourakakis, “Space- and time-efficient algorithm for maintaining dense subgraphs on one-pass dynamic streams,” in STOC, 2015, pp. 173–182. [18] S. Ma, R. Hu, L. Wang, X. Lin, and J. Huai, “Fast computation of dense temporal subgraphs,” in ICDE, 2017, pp. 361–372. [19] K. Semertzidis, E. Pitoura, and K. Lillis, “Timereach: Historical reachability queries on evolving graphs,” in EDBT, 2015, pp. 121–132. [20] V. Z. Moffitt and J. Stoyanovich, “Towards a distributed infrastructure for evolving graph analytics,” in WWW, 2016, pp. 843–848. [21] K. Semertzidis and E. Pitoura, “Durable graph pattern queries on historical graphs,” in ICDE, 2016, pp. 541–552. [22] U. Khurana and A. Deshpande, “Efficient snapshot retrieval over historical graph data,” in ICDE, 2013, pp. 997–1008. [23] C. Ren, E. Lo, B. Kao, X. Zhu, and R. Cheng, “On querying historical evolving graph sequences,” PVLDB, vol. 4, no. 11, pp. 726–737, 2011. IX. A PPENDIX In this section we present counter-examples that demonstrate that the F IND B FF M and F IND B FF A when applied to the B FF - MA and B FF - AA yield a solution that is a poor approximation of the optimal solution. For the following, we use n = |V | to denote the number of nodes in the different snapshots, and τ = |G| to denote the number of snapshots. A. Proof of Proposition 4 Proof: In order to prove our claim we need to construct an instance of the B FF - AM problem where the F IND B FFM algorithm produces a solution with approximation ratio O n1 . We construct the graph history G = {G1 , ..., Gτ } as follows. The first τ − 1 snapshots consist of a full clique with n − 1 nodes, plus an additional node v that is connected to a single node u from the clique. The last snapshot Gτ consists of just the edge (v, u). In the first n − 2 iterations of the F IND B FF M algorithm, the node with the minimum minimum degree is one of the nodes in the clique (other than the node u). Thus the nodes in the clique will be iteratively removed, until we are left with the edge (u, v). Since node v is present in all intermediate subsets Si , the minimum degree in all snapshots Gt is 1. Therefore, the solution S of the F IND B FF M algorithm has fam (S) = 1. On the other hand clearly the optimal solution S ∗ consists of the nodes in the clique, where we have minimum degree n−2, except of the last instance where the minimum degree is zero. which proves our claim. Therefore, f (S ∗ ) = (n − 2) τ −1 τ B. Proof of Proposition 5 Proof: In order to prove our claim we need to construct an instance of the B FF - AM problem where the F IND B FFA algorithm produces a solution with approximation ratio O n1 . We construct the graph history G = {G1 , ..., Gτ }, where τ is even, as follows. Each snapshot Gt contains n = 2b+3 nodes. The 2b of these nodes form a complete b × b bipartite graph. Let u, v, and s denote the additional three nodes. Node s is connected to all nodes in the graph, in all snapshots, except for the last snapshot where s is connected only to u and v. Nodes u and v are connected to each other in all snapshots, and node u is connected to all 2b nodes of the bipartite graph in the first τ /2 snapshots, while node v is connected to all 2b nodes of the bipartite graph in the last τ /2 snapshots. Throughout assume that τ ≥ 2. Note that the optimal set S ∗ for this history graph consists of the 2b nodes in the bipartite graph, with fam (S ∗ , G) = b = Θ(n). The score scorea for every node w of the 2b nodes in the bipartite graph is scorea (w, G) = b + 1 + τ −1 τ . For the nodes u and v, we have scorea (u, G) = scorea (v, G) = 2bτ /2+2τ = τ b + 2. Node s has score scorea (s, G) = 2b τ −1 + 2. τ Therefore, in the first iteration, the algorithm will remove one of the nodes of the bipartite graph. Without loss of generality assume that it removes one of the nodes in the left partition. Now, for a node w in the left partition, we still have that scorea (w, G[S1 ]) = b + 1 + τ −1 τ . For a node w in the right partition we have that scorea (w, G[S1 ]) = b + τ −1 τ . For nodes u and v we have scorea (u, G[S1 ]) = scorea (v, G[S1 ]) = (2b−1)ττ /2+2τ = b + 23 . For node s we have that scorea (s, G[S1 ]) = (2b − 1) τ −1 τ + 2. Therefore, in the second iteration the algorithm will select to remove one of the nodes in the right partition. Note that the resulting graph G[S2 ] is identical in structure with G, with n = 2(b − 1) + 3 nodes. Therefore, the same procedure will be repeated until all the nodes from the bipartite graph are removed, while nodes u and v will be kept in the set until the last iterations. As a result, the set S returned by F IND B FF A has fam (S, G) = 2 (the degree of the nodes u and v), yielding  approximation ratio O n1 . C. Proof of Proposition 6 Proof: In order to prove our claim we need to construct an instance of the B FF - MA problem where the F IND B FF M algo rithm produces a solution with approximation ratio O √1n . We construct the graph history G = {G1 , ..., Gτ } as follows. We have τ = m snapshots that are all identical. They consist of two sets of nodes A and B of size m and m2 respectively. The nodes in B form a cycle. The nodes in A in graph snapshot Gt form a clique with all nodes except for one node vt , different for each snapshot. The optimal set S ∗ consists of the nodes in A, that have average degree (m−1)(m−2) = Θ(m). m The F IND B FF M starts with the set of all nodes. The average 2 = Θ(1), which is degree of any snapshot is 2m +(m−1)(m−2) m2 +m also the value of the fma (V ) function. In the first m iterations of the algorithm, the nodes in A have scorem (v, Si ) = 0, so these are the ones to be removed first. Then the nodes in B are removed. In all iterations the average degree in each snapshot remains O(1). Therefore, the set S returned by the F IND B FFM 1 has fma (S)√= Θ(1), and the approximation ratio is Θ m . Since m = n, this proves our claim. D. Proof of Proposition 7 Proof: In order to prove our claim we need to construct an instance of the B FF - MA problem where the F IND B FF A algo rithm produces a solution with approximation ratio O √1n . The construction of the proof is very similar to before. We construct the graph history G = {G1 , ..., Gτ } as follows. We have τ = m snapshots that are all identical, except for the last snapshot Gm . The snapshots G1 , ..., Gm−1 consist of two sets of nodes A and B that form two complete cliques of size m and m2 respectively. In the last snapshot the nodes in B are all disconnected. The optimal set S ∗ consists of the nodes in A, that have fma (A) = m(m−1) = Θ(m − 1). m The F IND B FF A starts with the set of all nodes. The value of fma (V ) is determined by the last snapshot Gm that has average degree m(m−1) m2 +m = Θ(1). The nodes in A have average degree (over time) m(m−1) = Θ(m), while the nodes in m 2 −1) B have average degree (m−1)(m = Θ(m2 ). Therefore, m the algorithm will iteratively remove all nodes in A. In each iteration the resulting set Si has fma (Si ) = O(1). When all the nodes in A are removed, we have that fma (Si ) = 0. Therefore, 1 the approximation ratio for this instance is Θ( m ). Our claim 2 follows from the fact that n = m + m.
8cs.DS
Dimensionality reduction of SDPs through sketching Andreas Bluhm∗ arXiv:1707.09863v1 [math.OC] 31 Jul 2017 1 1 and Daniel Stilck França† 1 Department of Mathematics, Technical University of Munich, 85748 Garching, Germany August 1, 2017 We show how to sketch semidefinite programs (SDPs) using positive maps in order to reduce their dimension. More precisely, we use Johnson-Lindenstrauss transforms to produce a smaller SDP whose solution preserves feasibility or approximates the value of the original problem with high probability. These techniques allow to improve both complexity and storage space requirements. They apply to problems in which the Schatten 1-norm of the matrices specifying the SDP and of a solution to the problem is constant in the problem size. Furthermore, we provide some no-go results which clarify the limitations of positive, linear sketches in this setting. Finally, we discuss numerical examples to benchmark our methods. Contents 1. Introduction 2 2. Preliminaries 3 3. Sketching the Hilbert-Schmidt product with positive maps 6 4. Sketching linear matrix inequality feasibility problems 8 5. Approximating the value of semidefinite programs through sketching 10 6. Complexity and memory gains 16 ∗ † [email protected] [email protected] 1 7. Applications and numerical examples 17 7.1. Estimating the value of a semidefinite packing problem . . . . . . . . . . . 17 7.2. Linear matrix inequality feasibility problems . . . . . . . . . . . . . . . . . 18 8. Conclusion 19 A. Complexifying Johnson-Lindenstrauss transforms 23 B. Proof of Theorem 3.2 24 C. Lower bound on the value of SDPs through sketching 26 D. Random feasibility problems 29 1. Introduction Semidefinite programs (SDPs) are a prominent class of optimization problems [LA16]. They have applications across different areas of science and mathematics, such as discrete optimization [WA02] or control theory [BEFB94]. However, although there are many different algorithms that solve an SDP up to an error ǫ in a time that scales polynomially with the dimension and logarithmically with ǫ−1 [Bub15], solving large instances of SDPs still remains a challenge. This is not only due to the fact that the number and cost of the iterations scale superquadratically with the dimension for most algorithms to solve SDPs, but also due to the fact that the memory required to solve large instances is beyond current capabilities. This has therefore motivated research on algorithms that can solve SDPs, or at least obtain an approximate solution, with less memory requirements. One such example is the recent [YUAC17], where ideas similar to ours were applied to achieve optimal storage requirements necessary to solve a certain class of SDPs. While their work proposes a new way to solve an SDP using linear sketches, our approach relies on standard convex optimization methods. In this work, we develop algorithms to estimate the value of an SDP with linear inequality constraints and to determine if a given linear matrix inequality (LMI) is feasible or not. These algorithms convert the original problem to one of the same type, but of smaller dimension, which we call the sketched problem. Subsequently, this new problem can be solved with the same techniques as the original one, but potentially using less memory and achieving a smaller runtime. Therefore, we call this a black box algorithm. With high probability an optimal solution to the sketched problem allows us to infer something about the original problem. In the case of LMIs, if the sketched problem is infeasibile, we obtain a certificate that the original problem is also infeasibile. If the sketched problem is feasible, we are able to infer that the original problem is either “close to feasible” or feasible with high probability, under some technical assumptions. In the case of estimating the value of SDPs, we are able to give an upper bound that holds with high probability and a lower bound on the value of the SDP from the value 2 of the sketched problem, again under some technical assumptions. For a certain class of SDPs, which includes the so-called semidefinite packing problems [IPS05], we are able to find a feasible point of the original problem which is close to the optimal point and most technical aspects simplify significantly. For this class it can be checked whether this feasible point is indeed optimal. Our algorithms work by conjugating the matrices that define the constraints of the SDP with Johnson-Lindenstrauss transforms [Woo14], thereby preserving the structure of the problem. Similar ideas have been proposed to reduce the memory usage and complexity of solving linear programs [VPL15]. While those techniques aim to reduce the number of constraints, our goal is to reduce the dimension of the matrices involved. Unfortunately, the dimension of the sketch needed to have a fixed error with high probability scales with the Schatten 1-norm of the constraints and that of an optimal solution to the SDP, which significantly restricts the class of problems to which these methods can be applied. We are able to show that one cannot significantly improve this scaling and that one cannot sketch general SDPs using linear maps. This paper is organized as follows: in Section 2, we fix our notation and recall some basic notions from matrix analysis, Johnson-Lindenstrauss transforms, semidefinite programs and convex analysis which we will need throughout the paper. We then proceed to show how to sketch the Hilbert-Schmidt scalar product with positive maps in Section 3. We apply these techniques in Section 4 to show how to certify that certain LMIs are infeasible by showing the infeasibility of an LMI of smaller dimension. In Section 5, we apply similar ideas to estimate the value of an SDP with linear inequality constraints by solving an SDP of lower dimension. This is followed by a discussion of the possible gains in the complexity of solving these problems and for the memory requirements in Section 6. Furthermore, we make some numerical simulations in Section 7 to benchmark our findings by applying our techniques to a problem from the field of optimal designs of experiments and to a random LMI with matrices sampled from the Gaussian unitary ensemble. 2. Preliminaries We begin by fixing our notation. For brevity, we will write the set {1, . . . , d} as [d]. The set of d × D matrices over some field K ∈ {R, C} will be written as Md,D (K) and just Md (K) if d = D. We will often omit the underlying field if it is not relevant for the statement. We will denote by Msym the set of symmetric d × d matrices in the d real case and the set of Hermitian matrices in the complex case. For A ∈ Md , AT will denote the transpose of A in the real case and the Hermitian conjugate in the complex case. To avoid cumbersome notation and redundant theorems, we will prove most of the statements only for real matrices. However, note that all statements translate to the complex case in a straightforward fashion. We will state most of the definitions just for real matrices, but it should be clear how to generalize them to the complex case. For A ∈ Msym we will write A ≥ 0 if A is positive semidefinite. We will denote the cone of d d × d positive semidefinite matrices by Sd+ and its interior, the positive definite matrices, 3 by Sd++ . Definition 2.1 (Schatten p-norm and Hilbert-Schmidt scalar product). Let A ∈ Md and s1 , . . . , sd be its singular values. We define the Schatten p-norm of A for p ≥ 1, denoted by kAkp , to be given by d X p spi kAkp = i=1 and for p = ∞ by kAk∞ = max si The Schatten 2−norm is induced by the Hilbert1≤i≤d Schmidt scalar product, which is given by hA, BiHS = Tr AT B for A, B ∈ Md .  We will sometimes refer to the case p = 2 as the Hilbert-Schmidt (HS) norm and p = ∞ as the operator norm. Definition 2.2 (Positive Map). A linear map Φ : MD → Md is called positive if + ) ⊆ Sd+ . Φ(SD The structure of the set of positive maps is still not very well understood [Stø13]. For our purposes, however, we will only need maps of the form Φ(X) = SXS T with S ∈ Md,D , which are easily seen to be positive. We will adopt the standard Big O notation for the asymptotic behavior of functions. That is, for two functions f, g : R → R, we will write g = O(f ) if there exists a constant M > 0 such that for all x > x0 we have |g(x)| ≤ M |f (x)|. Analogously, we write g = Ω(f ) if there exists a constant M > 0 such that for all x > x0 we have |g(x)| ≥ M |f (x)|. The following families of matrices will play a crucial role for our purposes: Definition 2.3 (Johnson-Lindenstrauss transform). A random matrix S ∈ Md,D (K) is a Johnson-Lindenstrauss transform (JLT) with parameters (ǫ, δ, k) if with probability at least 1 − δ, for any k-element subset V ⊆ KD , for all v, w ∈ V it holds that |hSv, Swi − hv, wi| ≤ ǫkvk2 kwk2 . Note that one usually only demands that the norm of the vectors involved is distorted by at most ǫ in the definition of JLTs, but this is equivalent to the definition we chose by the polarization identity. There are many different examples of JLTs in the literature and we refer to [Woo14] and references therein for more details. Most of the constructions of JLTs focus on real matrices, but in Section A we show how to lift some of these results to cover complex matrices. The most prominent JLT is probably the following: √1 R d ∈ Md,D (R), where the entries of R  are i.i.d. standard Gaussian random variables. If d = Ω(ǫ−2 log kδ−1 ), then S is an (ǫ, δ, k)-JLT. Theorem 2.4. Let 0 < ǫ, δ < 1 and S = 4 Proof. We refer to [Woo14, Lemma 2.12] for a proof. The main drawback of using Gaussian JLTs is that these are dense matrices. We will denote by nnz(X) the number of nonzero elements of a matrix X ∈ MD . As we later want to compute products of the form SXS T , it will be advantageous to have a sparse S to speed up the computation of this product. The computational cost of forming this product will most often be the bottleneck of our algorithms. Fortunately, there has been a lot of recent work on sparse JLTs. In particular, we have the following almost optimal result. Theorem 2.5 (Sparse JLT 1.1]). There is an (ǫ, δ, k)-JLT S ∈ Md,D  [KN14, Section  −2 −1 −1 −1 with d = O ǫ log kδ and s = O(ǫ log kδ ) nonzero entries per column. Proof. We refer to [KN14, Section 1.1] for a proof and remark that the proof is constructive. Given some JLT S ∈ Md,D , the positive map Φ : MD → Md , X 7→ SXS T will be called the sketching map and d the sketching dimension. We will now fix our notation for semidefinite programs. Semidefinite programs are a class of optimization problems in which a linear functional is optimized under linear constraints over the set of positive semidefinite matrices. We refer to [LA16] for an introduction to the topic. There are many equivalent ways of formulating SDPs. In this work, we will assume w.l.o.g. that the SDPs are given in the following form: Definition 2.6 (Sketchable SDP). Let A, B1 , . . . , Bm ∈ Msym and γ1 , . . . , γm ∈ R. We D will call the constrained optimization problem maximize Tr (AX) subject to Tr (Bi X) ≤ γi , X ≥ 0, i ∈ [m] (1) a sketchable SDP. Sometimes we will also refer to a sketchable SDP as the original problem. We will see later how to approximate the value of these SDPs. SDPs have a rich duality theory, in which, instead of optimizing over positive semidefinite matrices that satisfy certain constraints, one optimizes over the points that satisfy a linear matrix inequality (LMI). The dual problem of a sketchable SDP is given by the following: minimize subject to hc, γi m X ci Bi − A ≥ 0 (2) i=1 c ∈ Rm +, m where γ ∈ Rm is the vector with coefficients γi . Here, Rm + = { x ∈ R : xi ≥ 0 }. SDPs and LMIs will be called feasible if there is at least one point satisfying all the constraints, 5 otherwise we will call it infeasible. A sketchable SDP will be called strictly feasible if there is a point X ≥ 0 such that all the constraints in (1) are satisfied with strict inequality. Under some conditions the primal problem (1) and the dual problem (2) have the same value. One widely used sufficient condition is Slater’s condition [LA16], which asserts that if we have a strictly feasible point of full rank for the primal problem and if the dual problem is feasible, then the primal and the dual have the same value and there is an optimal solution to the dual problem. We will need some standard concepts from convex analysis. Given a1 , . . . , an ∈ V for a vector space V , we denote by conv{a1 , . . . , an } the convex hull of the points. By cone{a1 , . . . , an } we will denote the cone generated by these elements and a convex cone C will be called pointed if C ∩ −C = {0}. 3. Sketching the Hilbert-Schmidt product with positive maps One of our main ingredients to sketch an SDP or LMI will be a random positive map Φ : MD → Md that preserves the Hilbert-Schmidt scalar product with high probability. We demand positivity to assure that the structure of the SDP or LMI is preserved. Below, we first consider the example Φ(X) = SXS T with S a JLT. Lemma 3.1. Let B1 , . . . , Bm ∈ Msym and S ∈ Md,D be an (ǫ, δ, k)-JLT with ǫ ≤ 1 and D k such that m X rank Bi . k≥ i=1 Then    P ∀i, j ∈ [m] : |Tr SBi S T SBj S T − Tr (Bi Bj ) | ≤ 3ǫkBi k1 kBj k1 ≥ 1 − δ. (3) Proof. Observe that the eigenvectors of the Bi corresponding to nonzero eigenvalues of the Bi form a subset of cardinality at most k of KD . Let A, B ∈ {B1 , . . . , Bm }. As S is an (ǫ, δ, k)-JLT, with probability at least 1 − δ we have for all normalized eigenvectors ai of A and bj of B that |hSai , Sbj i| − |hai , bj i| ≤ ǫ by the reverse triangle inequality. We also have that for any ai , bj √ kSai k2 ; kSbj k2 ≤ 1 + ǫ, again by the fact that S is a JLT. As ǫ ≤ 1 and by the Cauchy-Schwarz inequality, it follows that |hSai , Sbj i| + |hai , bj i| ≤ 3 and hence |hSai , Sbj i|2 − |hai , bj i|2 ≤ 3ǫ. 6 (4) Now let λi and µj be the eigenvalues of A and B, respectively. We have: T Tr SAS SBS T  − Tr (AB) = D X i,j=1 λi µj (|hSai , Sbj i|2 − |hai , bj i|2 ) ≤ 3ǫ D X i,j=1 |λi ||µj | = 3ǫkAk1 kBk1 with probability at least 1 − δ. As A, B were arbitrary, the claim follows. The scaling of the error with the Schatten 1-norm of the matrices involved in Lemma 3.1 is highly undesirable and the estimates used to prove it are admittedly crude. We note that a similar estimate was proved in [SH15]. Moreover, just using the fact that D(D+1) D(D+1) 2 as a Hilbert space, we could use an (ǫ, δ, k)-JLT L for R 2 Msym D (R) ≃ R and isometrically embed the resulting vector into a symmetric matrix. Denoting this transformation by L̃, we obtain h   i P ∀i, j ∈ [n] : Tr L̃(Bi )L̃(Bj ) − Tr (Bi Bj ) ≤ 3ǫkBi k2 kBj k2 ≥ 1 − δ. That is, if only demand the sketching map to map symmetric matrices to symmetric matrices, we clearly obtain a better scaling of the error with this procedure. Note, however, that the map L may not be positive, one of the requirements to later sketch SDPs. The next theorem shows that a scaling of the error with the Schatten 2−norm of the matrices involved is not possible with positive maps if we want to achieve a non-trivial compression. Theorem 3.2. Let Φ : MD → Md be a random positive map such that with strictly positive probability for any Y1 , . . . YD+1 ∈ MD and 0 < ǫ < 14 we have Then d = Ω(D).   |Tr Φ(Yi )T Φ(Yj ) − Tr YiT Yj | ≤ ǫkYi k2 kYj k2 . (5) Proof. We refer to Appendix B for a proof. One could hope to achieve a better bound for low rank matrices, but we note that this does not significantly improve our bound, as for A ∈ MD of rank r we have kAk1 ≤  √ rkAk2 . That is, by choosing an rǫ , δ, k -JLT, we may ensure that inequality (3) holds with the HS norm if the rank of the matrices involved is bounded by r ≪ d. This just increases the dimension of the involved JLT matrices by a factor of r 2 if we have the usual ǫ−2 dependence on the dimension for the JLTs. It remains open if one could achieve a better compression for a sublinear number of matrices. 7 4. Sketching linear matrix inequality feasibility problems In this section we will show how to use JLTs to certify that certain linear matrix inequalities (LMI) are infeasible by showing that an LMI of smaller dimension is infeasible. We will consider inequalities like the ones in the following lemma: Lemma 4.1. Let A, B1 , . . . , Bm ∈ Msym D \ { 0 } such that m X i=1 ci Bi − A 6≥ 0 (6) for all c ∈ Rm + . Suppose further that Λ = cone{B1 , . . . , Bm } + + such that for all i ∈ [m] = {0}. Then there exists a ρ ∈ SD is pointed and Λ ∩ SD Tr (ρBi ) < 0, Tr (−Aρ) < 0 and Tr (ρ) = 1. + ∩ E = ∅. Suppose there Proof. Let E = conv{−A, B1 , . . . , Bm }. We will show that SD m P + exists an X = −p0 A + ∩ E with p ∈ [0, 1]m+1 . If p0 > 0, we could rescale p i Bi ∈ S D i=1 X by p−1 0 and obtain a feasible point for (6), a contradiction. If p0 = 0 and X 6= 0, + = {0}. And if X = 0, the cone Λ would not be this would in turn contradict Λ ∩ SD pointed. From these arguments it follows that 0 6∈ E. The set E is therefore closed, + . We may thus find a convex, compact and disjoint from the convex and closed set SD + such that w.l.o.g. hyperplane that strictly separates SD from E. That is, a ρ ∈ Msym D + + , and Tr (Y ρ) < 0 for all Y ∈ E. As Tr (ρX) ≥ 0 , as 0 ∈ SD Tr (ρX) ≥ 0 for all X ∈ SD for all X ≥ 0, it follows that ρ is positive semidefinite and it is clear that by normalizing ρ we may choose ρ with Tr (ρ) = 1. The main idea is now to show that under these conditions we may sketch the hyperplane in a way that it still separates the set of positive semidefinite matrices and the P sketched version of the set { m γ B i=1 i i − A|γi ≥ 0}. Theorem 4.2. Let A, B1 , . . . , Bm ∈ Msym D \ { 0 } such that m X i=1 ci Bi − A 6≥ 0 for all c ∈ Rm + . Suppose further that Λ = cone{B1 , . . . , Bm } + + be such that for all i ∈ [m] = {0}. Moreover, let ρ ∈ SD is pointed and Λ ∩ SD Tr (ρBi ) < 0, Tr (−Aρ) < 0 8 and Tr (ρ) = 1. Set 1 ǫ = min 2  Tr (ρB1 ) Tr (ρBm ) Tr (ρA) ,..., , kB1 k1 kBm k1 kAk1  and take S ∈ Md,D to be an (ǫ, δ, k)-JLT. Here, k ≥ rank A + rank ρ + m X rank Bi . i=1 Then m X i=1 ci SBi S T − SAS T 6≥ 0 (7) for all c ∈ Rm + , with probability at least 1 − δ. Proof. It should first be noted that ρ exists and ǫ > 0 by Lemma 4.1. The matrix ρ defines a hyperplane that strictly separates the set ) ( m X ci Bi − A c ∈ Rm E= + i=1 + . We will now show that SρS T strictly separates the sets and SD ) ( m X T T m ci SBi S − SAS ES = c ∈ R+ i=1 and Sd+ with probability at least 1 − δ, from which the claim follows. Note that by our choice of ρ and ǫ, it follows from Lemma 3.1 that we have  Tr SρS T SBi S T ≤ Tr (ρBi ) + ǫkBi k1 < 0 with probability at least 1 − δ and similarly for −A instead of Bi . Therefore, it follows that Tr(ZSρS T ) < 0 for all Z ∈ ES . As SρS T is a positive semidefinite matrix, it follows that Tr Y SρS T ≥ 0 for all Y ∈ Sd+ . We have therefore found a strictly separating + and the LMI (7) is infeasible. hyperplane for ES and SD Theorem 4.2 suggests a way of sketching feasibility problems of the form m X i=1 ci Bi − A ≥ 0, 9 c ∈ Rm +. (8) If we are interested in the case in which it is infeasible, we investigate if the LMI m X i=1 ci SBi S T − SAS T ≥ 0, c ∈ Rm + (9) is feasible, for S a suitably chosen JLT as in Theorem 4.2. If Equation (9) is infeasible, we know that Equation (8) is infeasible, as any choice of a feasible c leads to a feasible c for Equation (9). Moreover, it follows from Theorem 4.2 that if the cone spanned by the Bi is well-behaved enough and the JLT is suitably chosen, it only happens with very low probability that Equation (9) is feasible and Equation (8) is not. To obtain more concrete bounds on the probability that the original problem is feasible, one would need to know the parameter ǫ, which is not possible in most applications. We emphasize that this is a black box algorithm. That is, we can decide whether a large instance of an LMI is infeasible by showing that a smaller instance of an LMI is infeasible. In Section 6 we will discuss the implications for the complexity and memory usage of the last theorems. 5. Approximating the value of semidefinite programs through sketching We will now show how to approximate with high probability the value of a sketchable SDP by conjugating the target matrix and the matrices that describe the constraints with JLTs and subsequently solving a smaller instance of an SDP. The next theorem shows that in general it is not possible to approximate the value of a sketchable SDP using linear sketches with high probability and that we need to make further assumptions on the problem to achieve a non-trivial compression using linear maps. Theorem 5.1. Let Φ : M2D → Rd be a random linear map such that for all sketchable SDPs there exists an algorithm which allows us to estimate the value of an SDP up to a constant factor 1 ≤ τ < √23 given the sketch {Φ(A), Φ(B1 ), . . . , Φ(Bm )} with probability at least 9/10. Then d = Ω(D 2 ). Proof. By the duality relations for Schatten p-norms, it is easy to see that the value of the SDP maximize Tr (AX) subject to Tr (X) ≤ 1 (10) X≥0 with A=  0 GT G 0  is twice the operator norm of the matrix G ∈ MD . In [Woo14, Theorem 6.5] it was shown that any algorithm that estimates the operator norm of a matrix from a linear sketch 10 with probability larger than 9/10 must have sketch dimension Ω(D 2 ). As the sketch { Φ(A), Φ(1) } would thus allow to sketch the operator norm, the assertion follows. The above result remains true even if we restrict to SDPs that have optimal points with small Schatten 1-norm and low rank. This follows from the fact that the SDP given in Equation (10) has an optimal solution with rank 1 and trace 1. We may even restrict to SDPs whose value scales sublinearly. To see that, notice that to show that the operator norm cannot be sketched, √ [Woo14] constructs two families of random matrices whose operator norm is of order D (cf. [Woo14, Lemma 6.3]). As the class of SDPs considered here covers this problem, we obtain the claim. As we will see soon, the main hurdle to sketch SDPs and thus overcome the last no-go theorem is that we also need to suppose that the matrices that define the constraints and the target function have a small Schatten 1-norm, not only one optimal solution. To this end, we define: Definition 5.2 (Sketched SDP). Let A, B1 , . . . , Bm ∈ Msym D , η, γ1 , . . . , γm ∈ R and + ∗ ǫ > 0. Given that an optimal point X ∈ SD of the sketchable SDP defined through these matrices satisfies Tr (X ∗ ) ≤ η and given a random matrix S ∈ Md,D , we call the optimization problem maximize Tr SAS T Y subject to  Tr SBi S T Y ≤ γi + µkBi k1 ,  Y ≥0 i ∈ [m] (11) with µ = 3ǫη the sketched SDP. The motivation for defining the sketched SDP is given by the following theorem. Theorem 5.3. Let A, B1 , . . . , Bm ∈ Msym D , η, γ1 , . . . , γm ∈ R and ǫ > 0. Denote by α the value of the sketchable SDP and assume it is attained at an optimal point X ∗ which satisfies Tr (X ∗ ) ≤ η. Moreover, let S ∈ Md,D be an (ǫ, δ, k)-JLT, with ∗ k ≥ rank X + rank A + m X rank Bi . i=1 Let αS be the value of the sketched SDP defined by A, Bi and S. Then αS + 3ǫηkAk1 ≥ α with probability at least 1 − δ. Proof. It follows from Lemma 3.1 that SX ∗ S T is a feasible point of the sketched SDP with probability at least 1 − δ. Again by Lemma 3.1, we have that  Tr SAS T SX ∗ S T ≥ Tr (AX ∗ ) − 3ǫηkAk1 . 11 It then follows that αS + 3ǫηkAk1 ≥ α. In Section 6, we will discuss the implications for memory usage and complexity of approximating the value of an SDP. Note that the optimal value of an SDP is not necessarily attained. We could also demand X ∗ to be only close to optimality which would slightly increase the error made by the sketch. Since this makes notation more cumbersome, we assume the existence of such an optimal point. Although it is not customary to assume a bound on the Schatten 1-norm of an optimal solution to an SDP, it is common to assume that for example the solution lies in a given ellipsoid when using the ellipsoid method to solve SDPs [LA16]. From such assumptions it is straightforward to derive bounds on the HS norm of the solution. If we are also given that an optimal solution to the SDP is low rank, the HS norm gives a good upper bound on the Schatten 1-norm, as remarked after the proof of Lemma 3.1. Solutions of low rank of SDPs have been extensively studied over the past years and there are many results available in the literature which guarantee that the optimal solution to an SDP has low rank. In general, it has been shown [Bar95, Pat98] that if we have m constraints √ ⌋. and the SDP is feasible, there is an optimal solution with rank at most r = ⌊ 8m+1−1 2 Notice that Theorem 5.3 does not rule out the possibility that the value of the sketched problem is much larger than that of the sketchable SDP. To investigate this issue, we introduce the following: Definition 5.4 (Relaxed SDP). Let A, B1 , . . . , Bm ∈ Msym D , η, γ1 , . . . , γm ∈ R and ǫ > 0. Given that an optimal point X ∗ of the sketchable SDP defined through these matrices satisfies Tr (X ∗ ) ≤ η, we call the optimization problem maximize Tr (AX) subject to Tr (Bi X) ≤ γi + µkBi k1 , X≥0 i ∈ [m] (12) with µ = 3ǫη the relaxed SDP. Notice that, given a feasible point Y to the sketched SDP, S T Y S is a feasible point for the relaxed problem by the cyclicity of the trace. It follows that if the values of the original and the relaxed are close, the values of the original and the sketched problem are close as well. We formalize this intuition and prove the following bound in Appendix C. Theorem 5.5. We are in the setting of Definition 2.6. Assume that there exists an X0 > 0 such that all the constraints of the sketchable SDP are strictly satisfied and that the dual problem is feasible. Then the value of the sketched SDP αS is bounded by αS ≤ α(0) + ǫC1 (α(0) − Tr (AX0 )) /C2 . 12 Here C1 = max { 3ηkBi k1 | i ∈ [m] } , C2 = min { (γi − Tr (Bi X0 )) | i ∈ [m] } , where η ≥ Tr (X ∗ ) for an optimal point X ∗ of the sketchable SDP. Proof. We refer to Appendix C for the proof. Note that this statement is not probabilistic and holds regardless of the choice of the sketching map. It could also be the case that Tr (AX0 ) itself gives a better lower bound on the value than the one in Theorem 5.5. One can therefore say that Theorem 5.5 guarantees that in general the value of the sketched SDP cannot differ significantly from the value of the original one if we have feasible points which are not too close to the boundary. Combining Theorem 5.3 and Theorem 5.5 it is possible to pick ǫ small enough to have an arbitrarily small additive error under some structural assumptions on the SDP. That is, we need bounds on the Schatten 1-norms of A and Bi , be given a strictly feasible point for the relaxed SDP and a bound on the Schatten 1-norm of an optimal solution to the sketchable SDP. In the case that all the γi > 0 for a sketchable SDP we may obtain a bound on the value and an approximate solution to it in a much simpler way. This class includes the so-called semidefinite packing problems [IPS05], where we have in addition that Bi ≥ 0. Note that we may set all γi = 1 w.l.o.g. by dividing Bi by γi . We then obtain: Theorem 5.6. For a sketchable SDP with γi = 1 and κ = max kBi k1 , we have that i∈[m] αS ≤ α, 1+ν (13) where ν = 3ǫηκ. Moreover, denoting by XS∗ an optimal point of the sketched SDP, we 1 have that 1+ν S T XS∗ S is a feasible point of the sketchable SDP that attains this lower bound. Furthermore, if kBi k1 = κ for all i ∈ [m] it can be checked if this lower bound is the optimal value. Proof. The lower bound in Equation (13) follows immediately from the cyclicity of the 1 S T XS∗ S is a feasible point of the sketchable SDP. Given an optimal solution trace, as 1+ν {ci }i∈[m] to the dual of the sketched SDP and that kBi k1 = κ for all i ∈ [m], it is possible to check if the lower bound given by the sketched SDP is indeed optimal as follows. Slater’s condition holds for the sketched and sketchable SDP, as ϑ1 is a strictly feasible point for ϑ > 0 small enough. If we have m X i=1 ci Bi − A ≥ 0, then the obtained feasible point is indeed optimal for the sketchable SDP by strong duality. 13 It is possible to relax the condition that all the Schatten 1-norms of the matrices that define the constraints are the same and still obtain a lower bound for which it can be checked whether it is indeed optimal. To achieve this, it is necessary to modify all the constraints of the sketched SDP, as in Equation (11), to 1 + µκ instead of 1 + µkBi k1 . In the primal picture, we will find an optimal point of the sketchable SDP through the + such that S T Y S = X ∗ , for X ∗ an optimal sketched SDP whenever there is a Y ∈ SD point of the sketchable SDP. Note that for semidefinite packing problems it is possible to derive a bound on the Schatten 1-norm of an optimal solution in a straightforward way. Lemma 5.7. Let B1 , . . . , Bm ∈ MD be positive semidefinite matrices such that the m P smallest strictly positive eigenvalue of Bi is given by λ. Then for a sketchable SDP i=1 with constraints Bi , γ1 , . . . , γm ∈ R+ , A ≥ 0 and finite value there exists an optimal point X ∗ such that m 1X ∗ γi . (14) Tr (X ) ≤ λ i=1 Proof. As we assume that the SDP has a finite value, we may restrict to solutions whose m P support is contained in the support of Bi . Denote by P the projection onto the support of m P i=1 Bi . We then have i=1 λP ≤ 1 m X Bi . (15) i=1 Conjugating both sides with (X ∗ ) 2 and taking the trace we obtain λTr (X ∗ ) ≤ m X Tr (X ∗ Bi ) , i=1 as we supposed w.l.o.g. that the support of X ∗ is contained in the support of X ∗ is a feasible point, we have Tr (X ∗ Bi ) ≤ γi and we obtain the claim. m P Bi . As i=1 Of all the assumptions we needed for the results of Theorem 5.3, the bound on the Schatten 1-norm of an optimal solution to the SDP is arguably the most difficult to show, as bounds of this form are not readily available in the literature. Moreover, some SDPs have Tr (X) ≤ η as constraint and would be natural candidates to apply these methods to. As Tr (1) = D we will not be able to obtain any non-trivial compression with the scheme discussed so far. However, if one is only interested in obtaining an upper bound on the value of the SDP, it is still possible to have 1 as a constraint or as the target matrix and achieve a non-trivial compression. Theorem 5.8. Let A, B1 , . . . , Bm−1 ∈ Msym D , Bm = 1. Further, let γ1 , . . . , γm−1 ∈ R, γm = η and ǫ > 0. Denote the value of the sketchable SDP by α and assume it is attained 14 at an optimal point X ∗ . Moreover, let S ∈ Md,D be an (ǫ, δ, k)-JLT, with ∗ k ≥ rank X + rank A + m X rank Bi . i=1 Let α′S be the value of the modifed sketched SDP defined by A, Bi and S, given by  maximize Tr SAS T X  subject to Tr SBi S T X ≤ γi + µkBi k1 , i ∈ [m − 1] (16) Tr (X) ≤ (1 + ǫ)η, X≥0 with µ = 3ǫη. Then α′S + 3ǫηkAk1 ≥ α with probability at least 1 − δ. Proof. The proof is essentially the same as the one of Theorem 5.3, as we have that |Tr SX ∗ S T − Tr (X ∗ ) | ≤ 3ǫTr (X ∗ ) and so SX ∗ S T is a feasible point with probability at least 1 − δ. The main difference between the modified sketched SDP and the sketched SDP is that here we do not conjugate the identity with S, only the other constraints. With this, we do not have that S T X ∗ S is a feasible point of the relaxed SDP, but we do not need the assumption Tr (X ∗ ) ≤ η to obtain an upper bound. It should be clear from Theorem 5.8 that we may also optimize over the trace, i.e. A = 1, without conjugating with S and still have an upper bound and non-trivial compression. We may therefore summarize the results of this section as follows. If we want to obtain an upper bound on the value of the sketchable SDP with our techniques, it is necessary to have upper bounds on the Schatten 1-norm of all the matrices that define the constraints, the target matrix and of an optimal solution. We may then choose a JLT of suitable dimension to solve the sketched SDP, whose value will allow us to infer an upper bound to the original problem with high probability. If we are addtionaly given a strictly feasible point of the sketchable SDP or if we are solving a semidefinite packing problem, we also obtain a lower bound on the value of the sketchable SDP in terms of the sketched one. In the case of semidefinite packing problems, we even obtain a feasible point of the sketchable SDP whose value is close to the sketched value. If we are not given a bound on the Schatten 1-norm of an optimal solution, we may impose it as a constraint as in Theorem 5.8 and obtain an upper bound on the value of the sketchable SDP constrained to points which have their Schatten 1-norm bounded by η. Although we are able to drop the assumption on the Schatten 1-norm of an optimal solution, we are not able to prove that this upper bound cannot differ significantly from the true value in this case. 15 6. Complexity and memory gains In this section, we will discuss how much we gain by considering the sketched SDP instead of the sketchable SDP. We focus on the results of Section 5, but the discussion carries over to the results of Section 4. Throughout this section we will assume that we are guaranteed that the Schatten 1−norm of an optimal solution to our SDP and of the matrices that define the constraints is O(1). It is therefore Theorem 5.3 for which we need a sketch of appropriate size. The theorem states that we need an (ǫ, δ, k)JLT for the upper bound on α to hold with probability at least 1 − δ. As stated in Theorem 5.3, we can choose a sketching matrix S ∈ Md,D with d = O(ǫ−2 log kδ−1 )  and s = O(ǫ−1 log kδ−1 ) nonzero entries per column. Here k is as in Theorem 5.3. The cost of generating S is at most O(dD), which will be of smaller order than the necessary matrix multiplications. We will therefore not take this cost into account for the rest of the analysis. One could argue that one needs to know the Schatten 1-norm of the different matrices that define our constraints for estimating the value or obtaining more concrete bounds for the feasibility problems. We will, however, suppose that an upper bound on the Schatten 1-norm of an optimal solution and the constraints is given or that this can be computed in a time which is O(D 2 ). This is the case if for example we have a semidefinite packing problem, where the matrices are positive semidefinite and we can compute their Schatten 1-norm in O(D) time. To generate the sketched SDP, we need to compute m + 1 matrices of the form SBS T , where B ∈ MD . Each of this computations needs O(max { nnz(B), Dd } ǫ−1 log kδ−1 ) operations. In the worst case, when all matrices { A, B1 , . . . , Bm } are dense and have full rank, this becomes O(mD 2 log(mD)) operations to generate the sketched SDP for fixed ǫ and δ. Let us collect these considerations in a proposition: Proposition 6.1. Let A, B1 , . . . , Bm ∈ Msym D , γ1 , . . . , γm ∈ R of a sketchable SDP be given. Furthermore, let z := max { nnz(A), nnz(B1 ), . . . , nnz(Bm ) } and SDP(m, d, ζ) be the complexity of solving a sketchable SDP (up to accuracy ζ) of dimension d. Then a number of     O(max z, Dǫ−2 log kδ−1 ǫ−1 m log kδ−1 + SDP(m, ǫ−2 log kδ−1 , ζ)) operations is needed to generate and solve the sketched SDP, where k is defined as in Theorem 5.3. It is easy to see that we can parallelize computing the matrices SBi S T . Typically, the costs of forming the sketched matrices SBi S T dominates the overall complexity. For example, using the ellipsoid method [GS88, Chapter 3], the complexity of solving  6 an SDP becomes SDP(m, D, ζ) = O(max m, D 2 D (cf. [Bub15, p.250]).  log(1/ζ)) Assuming that ǫ, δ and ζ are fixed, we need O(max m, D 2 D 6 ) operations to solve the sketchable SDP, compared to O(mD 2 log(mD)) operations to obtain an approximate solution via first forming the sketched problem and then solving it. Admittedly, the 16 ellipsoid method is not used but using interior point methods, we still need  3in practice, 2 2 SDP(m, D, ζ) = O(max m , D m , mD ω D 0.5 log(D/ζ)) operations [dK02, Chapter 5], where ω is the exponent of matrix multiplication. The best known algorithms achieve ω ≈ 2.37 [LG14]. If the SDP can be sketched, doing so gives a speedup as long as the complexity of solving the SDP directly is Ω(mD 2+µ ), where µ > 0. A great advantage is that for the sketched problem, we only need to store m + 1 matrices of size d × d instead of D × D. We collect this in a proposition. Proposition 6.2. Let A, B1 , . . . , Bm ∈ Msym D , γ1 , . . . , γm ∈ R be a sketchable SDP. 2 −4 Then we need only store O(mǫ log(mk/δ) ) entries for the sketched problem, where k is defined as in Theorem 5.3. 7. Applications and numerical examples 7.1. Estimating the value of a semidefinite packing problem Inspired by [Sag11] we will test our techniques on an SDP stemming from the field of optimal design of experiments. The problem is the following: an experimenter wishes to estimate the quantity hc, θi, where θ ∈ RD is an unknown D-dimensional parameter and c ∈ RD is given. To this end, one is given linear measurements of the parameter yi = Ai θ, up to a (centered) measurement noise for Ai ∈ MD . We refer to [Puk06] for more details on the topic. To find the amount of effort to spend on the i−th experiment to minimize the variance is given by the SDP  maximize Tr ccT X subject to Tr (Mi X) ≤ 1, X≥0 i ∈ [m] (17) with Mi = ATi Ai . This problem always admits optimal solutions of rank 1 [Sag11]. We generated random instances of this SDP in the following way: 1. We sampled four matrices Ai distributed as follows: the first three rows of Ai are sampled independently from the uniform distribution on the unit sphere in RD . The other D − 3 rows of Ai are set to 0. 2. Given the Ai , we generate c by getting four samples k1 , k2 , k3 , k4 from the uniform distribution on { 1, 2, 3 } and four samples x1 , x2 , x3 , x4 from the standard normal 4 P distribution. c is then given by xi (Ai )ki , where (Ai )ki is the ki -th row of Ai . i=1 This gives matrices Mi of rank 3 almost surely and Schatten 1-norm equal to 3. The fact that c is a linear combination of the rows of Ai ensures that the problem is bounded, as can be easily seen by looking at the dual problem [Sag11]. Note that this is a semidefinite packing problem, so we are able to use the results of Theorem 5.6 to obtain a lower bound. There exists an optimal solution whose Schatten 1-norm is bounded by 8 with very high 17 D 100 100 200 200 500 500 700 700 d 10 20 20 40 50 100 70 140 Value 2.52 2.50 2.69 2.53 2.55 2.66 2.57 2.49 Error L.B. 0.0880 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Error U.B. 0.156 0.250 0.269 0.00102 0.255 0.266 0.257 0.249 M.R.T. Sketchable [s] 1.27 1.17 6.50 6.82 98.0 97.6 557 548 M.R.T Sketch [s] 0.324 0.305 0.299 0.375 0.453 1.23 1.38 3.53 Table 1: For each combination of the sketchable dimension (D) and dimension of the sketch (d) we have generated 40 instances of the SDP in Equation (17). Here “M.R.T.” stands for mean running time, “L.B.” stands for lower bound and “U.B.” for upper bound and each column shows the mean of the sample. The column “Value” stands for the optimal value of the sketchable SDP. probability. This easily follows from Theorem 5.7 and the fact that i.i.d. unit vectors are almost orthogonal. To obtain the upper bound we have used the results of Theorem 5.3 and for the lower bound Theorem 5.6. We have chosen η = 0.1 to generate these results. We used sparse JLTs with sparsity parameter s = 1 [KN14] to obtain faster matrix multiplications to form the sketches. We define the error of the lower bound to be given 1 αS and of the upper to be αS − α. To solve the SDP given in Equation (17) by α − 1+η we used cvx, a package for specifying and solving convex programs [GB14, GB08]. As we can see, the results of Table 1 show that, excluding the case where the sketching dimension was 10, we were able to find feasible points which were numerically indistinguishable from being optimal by using our sketching methods. Moreover, the time needed to find an optimal solution was smaller by 1 or 2 orders of magnitude. 7.2. Linear matrix inequality feasibility problems We will now apply our techniques to an LMI feasibility problem. Let Gi ∈ Md′ , i ∈ [m], be random matrices sampled independently from the Gaussian unitary ensemble (GUE). See for example [AGZ10, Section 2.2] or Section D for their definition. Consider the rescaled and shifted matrices G̃i (α) = √1d′ Gi + α1 for some α ∈ R. For V : Md′ → MD a random isometry, we will test our techniques on the feasibility of the LMI m X i=1 ti V G̃i (α)V ∗ − V V ∗ ≥ 0, t ∈ Rm + (18) depending on α. As V is an isometry, Equation (18) is clearly feasible if and only if the LMI m X ti G̃i (α) − 1 ≥ 0, t ∈ Rm (19) + i=1 18 is feasible. Using standard techniques from random matrix theory, we show that Equation (19), and so Equation (18), is feasible with high probability for α > √2m and infeasible with high probability for α < √2m in case m ≪ d′ . We refer to Appendix Section D for a proof of this claim. This therefore allows us to quantify “how close to feasible” the LMI inequality is in terms of how close α is to √2m and to know whether the LMI was feasible or not. We will choose d′ ≪ D, as this way we avoid having a Schatten 1-norm of the matrices that define the LMI which is of the same order as the dimension. The technique we used to solve Equation (18) is the same as discussed in Section 4. That is, we will check for the feasibility of m X i=1 ti SV G̃i (α)V ∗ S T − SV V ∗ S T ≥ 0, t ∈ Rm + (20) for a complex Gaussian JLT S. That is, S = √12 (S1 + iS2 ) with S1 and S2 independent Gaussian JLTs. We refer to Section A for a proof that this choice of random matrices indeed gives a JLT with the same scaling of the parameters as the real one. We refer to Theorem D.4 for a proof that the LMI defined in Equation (20) satisfies the assumptions of Theorem 4.2 with high probability. To solve the SDP given in Equation (20) we used cvx, a package for specifying and solving convex programs [GB14, GB08]. The results are summarized in Table 2. We can observe that by using our methods we were able to show that the LMI is infeasibile in a much smaller running time or even show that certain LMI were infeasible when a direct computation was not possible due to memory constraints in most choices of the parameters. In some cases it was, however, necessary to increase the sketch dimension to show that the inequality was infeasibile. 8. Conclusion We have shown how to obtain sketches of the HS product using positive maps obtained from JLTs, how to apply these to show that certain LMI are infeasible and to obtain approximations of the value of certain SDPs. In some cases, these techniques can lead to significant improvements in the runtime necessary to solve the instances of the SDPs and significant gains in the memory needed to solve them. However, the class of problems to which these techniques can be applied is significantly restricted by the fact that the matrices that define the constraints of the problems and a solution must have Schatten 1-norms which do not scale with the dimension for them to be advantageous. Moreover, the no-go theorems proved here show that one cannot significantly improve our results using positive linear maps to sketch the HS norm or to approximate the value of SDPs. Acknowledgements We would like to thank Ion Nechita for helpful discussions. A.B. acknowledges support from the ISAM Graduate Center at Technical University of Munich. D.S.F. acknowl- 19 D 200 200 200 200 200 200 200 200 400 400 400 400 400 400 400 400 d 50 50 50 50 100 100 100 100 50 50 50 50 100 100 100 100 d′ 100 100 100 100 100 100 100 100 200 200 200 200 200 200 200 200 α 0.3 0.4 0.5 0.6 0.3 0.4 0.5 0.6 0.3 0.4 0.5 0.6 0.3 0.4 0.5 0.6 M.R.T. Original [s] 452 407 383 407 449 344 393 457 - M.R.T. Sketch [s] 4.65 4.31 5.71 6.46 66.3 86.6 102 91.4 4.02 7.04 3.39 2.35 114 122 118 115 Error Rate 0 0 0 0 0 0 0 0 0 0 0.975 1.0 0 0 0 0 Table 2: For each combination of the dimension of the image of the random isometry (D), dimension of the domain of the random isometry (d′ ), dimension of the sketch (d) and α we have generated 40 instances of the random LMI in Equation (18) with m = 9. Here “M.R.T.” stands for mean running time. The error rate gives the ratio of infeasible problems that were not detected to be infeasible by sketching. A dash in the running time means that we were not able to solve the LMI because we ran out of memory. . 20 edges support from the graduate program TopMath of the Elite Network of Bavaria, the TopMath Graduate Center of TUM Graduate School at Technical University of Munich. D.S.F. is supported by the Technical University of Munich – Institute for Advanced Study, funded by the German Excellence Initiative and the European Union Seventh Framework Programme under grant agreement no. 291763. References [AGZ10] G. W. Anderson, A. Guionnet, and O. Zeitouni. An Introduction to Random Matrices. Cambridge University Press, 2010. [Bar95] A. I. Barvinok. Problems of distance geometry and convex properties of quadratic maps. Discrete & Computational Geometry, 13(2):189–202, 1995. [BEFB94] S. Boyd, L. El Ghaoui, E. Feron, and V. Balakrishnan. Linear Matrix Inequalities in System and Control Theory, volume 15 of Studies in Applied Mathematics. SIAM, June 1994. [Bha97] R. Bhatia. Matrix analysis, volume 169 of Graduate Texts in Mathematics. Springer, 1997. [Bub15] S. Bubeck. Convex optimization: Algorithms and complexity. Found. Trends Mach. Learn., 8(3-4):231–357, November 2015. [BV04] S. Boyd and L. Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [dK02] E. de Klerk. Aspects of Semidefinite Programming: Interior Point Algorithms and Selected Applications. Applied Optimization. Springer US, 2002. [GB08] M. Grant and S. Boyd. Graph implementations for nonsmooth convex programs. In V. Blondel, S. Boyd, and H. Kimura, editors, Recent Advances in Learning and Control, Lecture Notes in Control and Information Sciences, pages 95–110. Springer, 2008. http://stanford.edu/~boyd/graph_dcp.html. [GB14] M. Grant and S. Boyd. CVX: Matlab software for disciplined convex programming, version 2.1. http://cvxr.com/cvx, March 2014. [GS88] Lovász L. Grötschel, M. and A. Schrijver. Geometric algorithms and combinatorial optimization. Springer, 1988. [IPS05] G. Iyengar, D. J. Phillips, and C. Stein. Approximation Algorithms for Semidefinite Packing Problems with Applications to Maxcut and Graph Coloring, pages 152–166. Springer, 2005. [KN14] D. M. Kane and J. Nelson. Sparser Johnson-Lindenstrauss transforms. J. ACM, 61(1):4:1–4:23, January 2014. 21 [LA16] J.B. Lasserre and M.F. Anjos. Handbook on Semidefinite, Conic and Polynomial Optimization. International Series in Operations Research & Management Science Series. Springer, 2016. [LG14] F. Le Gall. Powers of tensors and fast matrix multiplication. In Proceedings of the 39th International Symposium on Symbolic and Algebraic Computation, ISSAC ’14, pages 296–303. ACM, 2014. [LR10] M. Ledoux and B. Rider. Small deviations for beta ensembles. Electronic Journal of Probability, 15(41):1319 – 1343, 2010. [Pat98] G. Pataki. On the rank of extreme matrices in semidefinite programs and the multiplicity of optimal eigenvalues. Mathematics of Operations Research, 23(2):339–358, 1998. [Puk06] F. Pukelsheim. Optimal Design of Experiments. Classics in Applied Mathematics. Society for Industrial and Applied Mathematics, 2006. [RV13] M. Rudelson and R. Vershynin. Hanson-Wright inequality and sub-gaussian concentration. Electronic Journal of Probability, 18(82):1–9, 2013. [Sag11] G. Sagnol. A class of semidefinite programs with rank-one solutions. Linear Algebra and its Applications, 435(6):1446 – 1463, 2011. [SH15] C. J. Stark and A. W. Harrow. Compressibility of positive semidefinite factorizations and quantum models. In ISIT, pages 2777–2781. IEEE, 2015. [Stø13] E. Størmer. Positive Linear Maps of Operator Algebras. Springer Monographs in Mathematics. Springer, 2013. [Ver12] R. Vershynin. Compressed sensing, chapter Introduction to the nonasymptotic analysis of random matrices, pages 210–268. Cambridge University Press, 2012. [VPL15] K. Vu, P.-L. Poirion, and L. Liberti. Using the Johnson-Lindenstrauss lemma in linear and integer programming. ArXiv 1507.00990, July 2015. [WA02] H. Wolkowicz and M. F. Anjos. Semidefinite programming for discrete optimization and matrix completion problems. Discrete Appl. Math., 123(13):513–577, November 2002. [Wol12] M. M. Wolf. Quantum channels and operations: Guided tour. Lecture notes available at http://www-m5.ma.tum.de/foswiki/pub/M5/Allgemeines/MichaelWolf/QChannelLecture. 2012. [Woo14] D. P. Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends in Theoretical Computer Science, 10(1–2):1–157, 2014. 22 [YUAC17] A. Yurtsever, M. Udell, Tropp J. A., and V. Cevher. Sketchy Decisions: Convex Low-Rank Matrix Optimization with Optimal Storage. ArXiv 1702.06838, February 2017. A. Complexifying Johnson-Lindenstrauss transforms In this Appendix we will generalize some of the results we need concerning JLTs to complex vector spaces. We will see that, up to a constant, most of the statements that hold in the real case also hold in the complex case. We will consider matrices of the form √1 (S + iT ), with S, T independent and with i.i.d. entries that are sub-gaussian 2d and show that they give us complex JLTs. Note that these constructions clearly give sparse JLTs if the real JLTs used are sparse. Definition A.1 (Sub-Gaussian Distribution). The probability distribution of a random variable X is called sub-gaussian if there exist C, v > 0 such that ∀t > 0 2 P(|X| > t) ≤ Ce−vt . p A random variable is sub-gaussian if and only if for p ≥ 1, E(|X|p ) = O(p) 2 and the sub-gaussian norm of X is defined as: 1 1 kXkψ2 = sup p− 2 (E(|X|p ) p . (21) p≥1 See for example [Ver12, Section 5.2.3] for more details on this. The main ingredient to show how to generalize JLTs to the complex case will be the following theorem. Theorem A.2 ([RV13, Theorem 2.1]). Let A ∈ Md,D (R) be fixed. Consider a random vector X = (X1 , . . . , XD ), where Xi are independent random variables satisfying E[Xi ] = 0, E[Xi2 ] = 1 and kXi kψ2 ≤ K. Then for any t ≥ 0, we have " P [|kAXk2 − kAkHS | > t] ≤ 2 exp − ct2 K 4 kAk2∞ # . Using this, we have a different way of proving the Johnson-Lindenstrauss lemma which generalizes to the complex case. We follow the proof of [RV13, Theorem 3.1]. Lemma A.3. Let S, T ∈ Md,D (R) have independent sub-gaussian entries with E[Xij ] = 2 ] = 1 and kX k −2 ln(2/δ) , we 0, E[Xij ij ψ2 ≤ K, for all X ∈ { S, T }. Then for d = O ǫ have   S + iT √ x ∈ (1 ± ǫ)kxk2 ≥ 1 − δ P 2d 2 for any fixed x ∈ CD . 23 Proof. Define the linear operator Φ : Md,D (C) → Cd , G 7→ Gx, where x ∈ Cd is a fixed vector. We use the standard isomorphisms Md,D (C) ≃ R2dD and Cd ≃ R2d and denote by Φ̃ the map Φ composed with these isomorphisms, which is now a linear map from a real vector space to another real vector space. Moreover, observe that a matrix of the form X + iY ∈ Md,D (C) with X, Y ∈ Md,D (R) is mapped to (X, Y ) under the isomorphism. The map Φ̃ will play the role of A in the statement of Theorem A.2. It is straightforward to compute the norms involved in the statement, as explained in [RV13, Section 3.1]. We have Φ̃ 2 2 = 2dkxk22 , Φ̃ 2 ∞ = kxk22 , Φ̃((S, T )T ) 2 2 = 2k(S + iT )xk22 . As S, T have sub-gaussian entries, the vector (S, T ) satisfies the assumptions of Theorem A.2 and the statement follows. Unfortunately, the sparse JLTs discussed in Theorem 2.5 are not of this form. The entries of these JLTs are not independent from each other, one of the assumptions of Lemma A.3. B. Proof of Theorem 3.2 Theorem 3.2. Let Φ : MD → Md be a random positive map such that with positive probability for any Y1 , . . . , YD+1 ∈ MD and 0 < ǫ < 14 we have Then d = Ω(D).   |Tr Φ(Yi )T Φ(Yj ) − Tr YiT Yj | ≤ ǫkYi k2 kYj k2 . (22) Proof. Let {ei }1≤i≤D be an orthonormal basis of CD and define Xi = ei eTi . As Equation (22) is satisfied with positive probability, there must exist a positive map Φ : MD → Md such that Equation (22) is satisfied for Yi = Xi , i ∈ [D], and YD+1 = 1. As the Xi are orthonormal w.r.t. the Hilbert-Schmidt scalar product and by the positivity of Φ we have for i, j ∈ [D] ( [0, ǫ], for i 6= j (23) Tr (Φ(Xi )Φ(Xj )) ∈ [1 − ǫ, 1 + ǫ], for i = j. Define the matrix A ∈ MD with (A)ij = Tr (Φ(Xi )Φ(Xj )) for i, j ∈ [D]. It is clear that A is Hermitian and that its entries are positive. We have X Aij = Tr (Φ(1)Φ(1)) ∈ [(1 − ǫ)D, (1 + ǫ)D] . i,j∈[D] As Aii ≥ (1 − ǫ), it follows that X i6=j Aij ≤ 2ǫD. 24 (24) Let J = { (i, j) ∈ [D] × [D] | i 6= j, Aij ≤ 1 }. D It follows from Equation (24) that | { (i, j) ∈ [D] × [D] | i 6= j, (i, j) ∈ / J } | ≤ 2D 2 ǫ and so  |J| ≥ (1 − 2ǫ)D 2 − D . Since for (i, j) ∈ J also (j, i) ∈ J, we can write J = (I × I)\{(i, i)|i ∈ I} for I ⊆ [D]. Thus, we infer for D ≥ 2   1 2 − 2ǫ D 2 . |J| = |I|(|I| − 1) ≥ ((1 − 2ǫ)D − D) ≥ 2 From this it follows that 1 |I|2 ≥ |I|(|I| − 1) ≥ ( − 2ǫ)D 2 , 2 and we finally obtain |I| ≥ p 1/2 − 2ǫD. (25) ′ Notice that it follows from Equation (23) that we may rescale all  the Xi to Xi such that  1 Tr Φ(Xi′ )2 = 1 and the pairwise scalar product still satisfies Tr Φ(Xi′ )Φ(Xj′ ) ≤ D(1−ǫ) p for (i, j) ∈ J. If there is an N ∈ N such that d > p 1/2 − 2ǫD for all D ≥ N , the claim follows. We therefore now suppose that d ≤ 1/2 − 2ǫD. Hence, d ≤ |I| by Equation (25). By the positivity of Φ and the fact that the Xi′ are positive semidefinite, we have that Φ(Xi′ ) is positive semidefinite. In [Wol12, Proposition 2.7] it is shownthat for any set {Pi }i∈I of |I| ≥ d positive semidefinite matrices in Md such that Tr Pi2 = 1 we have that X (|I| − d)2 |I| . Tr (Pi Pj )2 ≥ (|I| − 1)d2 i6=j By the definition of the set J, we have that X (i,j)∈J Tr Xi′ Xj′ 2 ≤ |J| 1 ≤ , 2 2 (1 − ǫ) D (1 − ǫ)2 as |J| ≤ D 2 . From Equation (25) it follows that 1 ≥ (1 − ǫ)2 p !2 1/2 − 2ǫD −1 d and after some elementary computations we finally obtain p (1 − ǫ) 1/2 − 2ǫ D. d≥ 2−ǫ 25 C. Lower bound on the value of SDPs through sketching We will obtain lower bounds on the value of the sketchable SDP in terms of the value of the sketched SDP through continuity bounds on the relaxed SDP. As the continuity bound we use is for SDPs given in equality form, we begin by giving an equivalent formulation of a sketchable SDP with equality constraints. The method of using duality to derive perturbation bounds on a convex optimization problem used here is standard and we refer to [BV04, Section 5.6] for a similar derivation. Given a sketchable SDP, define the maps Φ : MD → Mm Φ(X) = m X Tr (Bj X) ej eTj j=1 m for { ej }m j=1 an orthonormal basis of R and Ψ : MD+m → Mm Ψ  X ∗ ∗ Z  = Φ(X) + [Zjj ]j . With the help of the matrix G= m X γj ej eTj , (26) j=1 the sketchable SDP can be written in equality form as    A 0 X ∗ maximize Tr 0 0 ∗ Z   X ∗ subject to Ψ =G ∗ Z   X ∗ ≥ 0, ∗ Z (27) where ∗ are submatrices which are not relevant for our discussion. The dual problem of Equation (27) may be written as minimize subject to m X j=1 m X j=1 γj Yjj Bj Yjj ≥ A Yjj ≥ 0, 26 ∀j ∈ [m]. (28) Lemma C.1. If there is an X > 0 such that the sketchable SDP is satisfied with strict inequality and the dual problem is feasible, then both the primal problem given in Equation (27) and dual in Equation (28) are feasible, there is no duality gap and there is a dual solution which attains the optimal value. Furthermore, this condition is equivalent to Slater’s condition. Proof. If we can show equivalence with Slater’s condition, the first statement follows automatically. Slater’s condition for the primal problem is the following. If there is a   X ∗ > 0 which satisfies the constraints, then the duality gap is zero and there is a ∗ Z Y which attains the optimal value. For such a block matrix, we also need X > 0, Z > 0. Hence, we can formulate Slater’s condition with off-diagonal entries ∗ = 0. We observe   γ1 − Tr (B1 X)   X ∗   .. Ψ =G⇔  = Z > 0. . ∗ Z γm − Tr (Bm X) Hence X > 0 satisfies the constraints with strict inequality. The converse is clear. Now we can bound the optimal solution to Equation (11). We denote by A(ǫ) the feasible set of the relaxed SDP as in Definition 5.4 for some ǫ > 0. With this notation, A(0) is the feasible set for the primal problem. Analogously, we denote by α(ǫ) the optimal value of the relaxed problem, by α(0) the optimal value of the sketchable SDP. Lemma C.2. Assume that there exists X0 ∈ A(0) such that X0 > 0 and the constraints are strictly satisfied. Then α(0) ≤ α(ǫ) ≤ α(0) + hǫ̃, y ∗ i, where y ∗ is an optimal solution to the dual problem to the sketchable SDP and ǫ̃ ∈ Rm with ǫ̃i = 3ǫηkBi k. Proof. The first inequality is obvious, since any X ∈ A(0) is also in A(ǫ). By Lemma C.1, strong duality holds and there is a y ∗ ≥ 0 which achieves the optimal value. Hence α(0) = m X yj∗ γj j=1 ≥ m X j=1 yj∗ γj − Tr = Tr (AX) − m X i=1 " m X i=1 # yi∗ Bi − A X ! yi∗ [Tr (Bi X) − γi ] . 27 , X≥0 (29) The first line holds by duality. If we take the supremum over X ∈ A(ǫ), we infer α(0) ≥ α(ǫ) − m X yi∗ ǫ̃i , i=1 since yi∗ ≥ 0. Corollary C.3. Assume that there exists X0 ∈ A(0) such that X0 > 0 and the constraints are strictly satisfied. Then     α(ǫ) ≤ α(0) + max ǫ̃i (α(0) − Tr (AX0 )) / min (γk − Tr (Bk X0 )) , k i∈[m] where ǫ̃ ∈ Rm is defined as in Lemma C.2. Proof. By Equation (29), we have that α(0) ≥ Tr (AX0 ) − m X i=1 yi∗ [Tr (Bi X0 ) − γi ] . Since [Tr (Bi X0 ) − γi ] < 0, it follows that m X i=1 yi∗ ≤ (α(0) − Tr (AX0 ))/ min [γi − Tr (Bi X0 )] . With hǫ̃, y ∗ i ≤ [max ǫi ] i∈[m] i∈[m] Pm ∗ i=1 yi for y ∗ ≥ 0, the Corollary follows. Theorem C.4. Assume that there exists X0 ∈ A(0) such that X0 > 0 and the constraints are strictly satisfied. Then the value of the sketched SDP αS is bounded by αS ≤ α(0) + ǫC1 (α(0) − Tr (AX0 )) /C2 . Here C1 = max { 3ηkBi k1 | i ∈ [m] } , C2 = min { (γi − Tr (Bi X0 )) | i ∈ [m] } , where η = Tr (X ∗ ) for an optimal point X ∗ of the sketchable SDP.   Proof. The key step is to recognize that Tr SCS T X is equal to Tr CS T XS by the cyclicity of the trace. Thus, the relaxed SDP gives an upper bound for the sketched SDP. The theorem then follows by Corollary C.3. Note that this result is not probabilistic and holds regardless of the sketching matrix S used. 28 D. Random feasibility problems In this section, we investigate under which conditions the convex hull of m random GUE [AGZ10, Section 2.2] matrices shifted by a multiple of the identity both contains a positive semidefinite matrix and the cone they define is pointed. This is used in Section 7.2. Let Gi ∈ Md′ , i ∈ [m], be random matrices sampled independently from the GUE. This means that Gi is Hermitian and that ( (Gi )kl = Yk for k = l , (Gi )kl = (Gi )kl = Zkl for k > l where Yk is a real normal random variable with mean 0 and variance 1 and Zkl is a complex normal random variable with mean 0 and variance 1. Since we will need similar matrices with different variance, we will call this distribution GUE(0, 1). Consider the rescaled and shifted matrices G̃i (α) = √1d′ Gi + α1 for some α ∈ R. We call the convex hull of these matrices n o Xα := conv . G̃i (α) i ∈ [m] Lemma D.1. Let α ≥ √2 (1 m + ǫ). Then   ′ 3/2 P Xα ∩ Sd++ 6= ∅ ≥ 1 − Ce−2d ǫ /C , ′ where C is a numerical constant independent of m, d′ , ǫ. Pm Proof. Let t ∈ Rm + such that i=1 ti = 1. By the definition of the GUE, G(t) := m X ti Gi i=1 Pn is again in GUE(0, i=1 t2i ). By [LR10, Theorem 1] and the fact that the GUE is invariant under unitary transformations, it holds that i h √ ′ 3/2 P λmin (G(t)/ d′ ) ≤ −2ktk2 (1 + ǫ) ≤ Ce−2d ǫ /C . The expression −2ktk2 (1 + ǫ) is maximized by tmin = (1/m, . . . , 1/m), for which we √ √ obtain the value −2/ m (see [Bha97, Remark II.3.7]). Hence, for α ≥ 2(1 + ǫ)/ m, we infer that h i h i √ √ P λmin (G(tmin )/ d′ + α1) ≤ 0 = P λmin (G(tmin )/ d′ ) ≤ −α   √ 2 ′ ≤ P λmin (G(tmin )/ d ) ≤ − √ (1 + ǫ) m ′ 3/2 /C ≤ Ce−2d ǫ 29 . √ √ As λmin (G(tmin )/ d′ + α1) > 0 implies that G(tmin )/ d′ + α1 is positive definite, the assertions follows.  Lemma D.2. Let α ≤ √2m (1 − ǫ) with ǫ ∈ 0, 12 . Then  P Xα ∩ Sd+′  √ m  1 8 m ′ 3/2 3/2 ′ C 4 e− 4C (8+d ǫ )ǫ d , =∅ ≥1−m 1+ ǫ where C is a numerical constant independent of m, d′ , ǫ. √ Proof. Take an ǫ/(4 m)-net N for the ℓ1 -sphere S1m−1 in Rm . This means that for all √ t ∈ S1m−1 , there is an s ∈ N such that kt − sk1 < ǫ/(4 m). It can be shown as in [Ver12, √ Section 5.2.2] that we can choose N such that |N | ≤ (1 + 8 m/ǫ)m . Now assume that √ √ λmax (Gi / d′ ) ≤ 2(1 + ǫ) ∧ λmin (Gi / d′ ) ≥ −2(1 + ǫ) ∀i ∈ [m]. This implies that √ Gi / d′ ∞ ≤ 2(1 + ǫ). By Weyl’s perturbation theorem [Bha97, Theorem II.2.6], it follows that for t ∈ S1m−1 ∩ Rm +. √ √ √ √ |λmin (G(t)/ d′ ) − λmin (G(s)/ d′ )| ≤ G(t)/ d′ − G(s)/ d′ ≤ m X i=1 √ |ti − si | Gi / d′ ∞ ∞ ǫ ≤ 2(1 + ǫ)kt − sk1 ≤ √ . m √ √ Now assume further that λmin (G(s)/ d′ + α1) ≤ −ǫ/ m for all s ∈ N . Then clearly Xα ∩ Sd+′ = ∅ by the above. We thus have to estimate the probability with which our assumptions are met. Using a union bound, we obtain   P Xα ∩ Sd+′ = ∅        Gi ǫ Gi √ √ √ ∀s ∈ N ∧ ≤ 2(1 + ǫ) ∀i ∈ [m] ≤− ≥P λmin α1 + m d′ d′ ∞         Y Gi ǫ Y G(s) 2  P λmin √ 1− ≥1 − P λmin √ ≥ −√ ≤ −2(1 + ǫ) ′ m 2 d′ d s∈N i∈[m]     Gi P λmax √ ≥ 2(1 + ǫ) . d′ 30 Using again [LR10, Theorem 1] we infer that for all i ∈ [m]     ′ 3/2 Gi ≤ −2(1 + ǫ) ≤ Ce−2d ǫ /C , P λmin √ ′ d     Gi ′ 3/2 P λmax √ ≥ 2(1 + ǫ) ≤ Ce−2d ǫ /C , ′ d          ǫ 2  ǫ G(s) G(s) ≥ −√ ≥ −2ksk2 1 − ≤ P λmin √ 1− P λmin √ 2 2 m d′ d′ ′2 (ǫ/2)3 /C ≤ C 2 e−2d . For the last estimate, we have used that G(s) is again a GUE element with different variance (cf. proof of Lemma D.1). Combining this with the estimates concerning |N |, the assertion follows. We obtain as a corollary that the cone generated by the G̃(α) is pointed with high probability if m << d′ .  Corollary D.3. Let α ≤ √2m (1−ǫ) for ǫ ∈ 0, 12 and denote by Cα = cone { G̃1 (α), . . . , G̃m (α) }. Then  √ m 1 8 m ′ 3/2 3/2 ′ P [Cα ∩ −Cα = { 0 }] ≥ 1 − m 1 + C 4 e− 4C (8+d ǫ )ǫ d , ǫ where C is a numerical constant independent of m, d′ , ǫ. Proof. We know from Lemma D.2 that we have the same lower bound for the probability of the event A = { Xα ∩ Sd+′ = ∅ }. But note that the event A implies that the cone is pointed. That is because if the cone was not pointed, there would exist γ, µ ∈ Rm +\ { 0 } such that m m X X µi G̃i (α) γi G̃i (α) = − i=1 i=1 and so 1 m P (γi + µi ) i=1 m X (µi + γi )Gi (α) = 0, i=1 which implies that Xα ∩ Sd+′ 6= ∅. Theorem D.4. Consider the LMI m X i=1  Let ǫ ∈ 0, 12 . Then for α ≥ √2 (1 m ti G̃i (α) − 1. + ǫ), this LMI is feasible with probability at least ′ 3/2 /C 1 − Ce−2d ǫ 31 . (30) Moreover, for α ≤ √2 (1 m + ǫ), this LMI is infeasible, the cone generated by the G̃(α) is pointed and we have Xα ∩ Sd+′ = ∅ with probability at least  √ m 1 8 m ′ 3/2 3/2 ′ 1−m 1+ C 4 e− 4C (8+d ǫ )ǫ d . ǫ (31) Proof. Pm For the first assertion, by Lemma D.1 Xα contains a positive definite element i=1 ri G̃i (α) with probability lower bounded by the expression in Equation (30). Then G(µr) is feasible for µ ∈ R+ large enough. For the second assertion, we note that the LMI being infeasible is equivalent to Xα not containing a positive definite element. From Lemma D.2 the lower bound in (31) for the probability that the LMI is infeasible. Moreover, the fact that the same lower bound holds for the probability that the cone is pointed follows from Corollary D.3. 32
8cs.DS
QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS arXiv:1509.05385v2 [math.RA] 15 Jan 2016 CHRIS FRASER Abstract. We introduce quasi-homomorphisms of cluster algebras, a flexible notion of a map between cluster algebras of the same type (but with different coefficients). The definition is given in terms of seed orbits, the smallest equivalence classes of seeds on which the mutation rules for non-normalized seeds are unambiguous. We present examples of quasi-homomorphisms involving familiar cluster algebras, such as cluster structures on Grassmannians, and those associated with marked surfaces with boundary. We explore the related notion of a quasi-automorphism, and compare the resulting group with other groups of symmetries of cluster structures. For cluster algebras from surfaces, we determine the subgroup of quasi-automorphisms inside the tagged mapping class group of the surface. Introduction The general structural theory of cluster algebras has been well developed during the 15 years since their inception [15]. Despite this, there does not seem to be a consensus on what the “right” notion of a homomorphism between cluster algebras should be– several such notions have arisen in different mathematical settings, see e.g. [1, 2, 6, 7, 26, 27]. From our perspective, the key difficulty in defining homomorphisms of cluster algebras is rooted in the fact that the construction of a cluster algebra involves three operations: the addition, the multiplication, and the auxiliary addition used in the normalization condition. Most preexisting notions of a “cluster homomorphism” are designed to respect all three of these operations, a rather restrictive requirement. We suggest instead that even in the ordinary (i.e., normalized) setting, it is fruitful to consider maps that only preserve the structures intrinsic to non-normalized cluster algebras, ignoring the auxiliary addition. This leads us to the concept of seed orbits and to the mutation patterns these orbits form. The morphisms between such mutation patterns are the main object of our interest; we call them quasi-homomorphisms. This paper is devoted to a systematic study of quasi-homomorphisms and related algebraic constructs. A cluster algebra is defined by specifying a distinguished set of generators (called cluster variables) inside an ambient field of rational functions in n variables. Starting from an initial cluster of n cluster variables, the remaining cluster variables are obtained by iterating algebraic steps called mutations. Each mutation produces a new cluster from a current one by exchanging one cluster variable for a new one. The specific rules for computing the latter are encoded by two additional ingredients, an n×n exchange matrix B 2010 Mathematics Subject Classification. 13F60. Key words and phrases. Cluster algebra, seed orbit, quasi-homomorphism, cluster modular group, tagged mapping class group. This work was supported by a graduate fellowship from the National Physical Science Consortium and NSF grant DMS-1361789. 1 2 CHRIS FRASER and a coefficient tuple p consisting of elements of some fixed coefficient group. The triple consisting of the cluster, the exchange matrix, and the coefficient tuple, is called a seed. When a cluster mutates, the ingredients B and p also do: the new matrix B ′ is given explicitly in terms of B, and the new tuple p′ satisfies a constraint involving p and B. A collection of seeds related to each other by mutations in all possible directions forms a seed pattern. In the most general cluster algebra setup – that of non-normalized seed patterns [3, 13, 15], the mutation recipe does not uniquely specify the new coefficient tuple p′ from p and B. This ambiguity propagates through iterated mutations, and consequently the set of cluster variables is not uniquely determined by the initial seed. The usual way to remove this ambiguity is to impose the additional assumption that the coefficient group is endowed with an additional operation of “auxiliary addition” (making it into a semifield ), and then require the corresponding normalization condition to hold at every seed. This assumption is satisfied for the most important examples of cluster algebras arising in representation theory. In this paper, we make use of another way of removing the ambiguity by considering seed orbits, the smallest equivalence classes of seeds on which the mutation rules are unambiguous. This gives rise to to the concept of a mutation pattern of seed orbits. Such a pattern is determined uniquely by any one of its constituent seed orbits. The natural notion of a homomorphism between two mutation patterns of seed orbits brings us to the definition of a quasi-homomorphism, a rational map (more precisely, a semifield homomorphism) that respects the seed orbit structure and commutes with mutations. Though the appropriate context for defining quasi-homomorphisms is that of nonnormalized seed patterns, we see two ways in which quasi-homomorphisms are useful in the structural theory of ordinary (normalized) seed patterns. First, it is important to understand the relationships between cluster algebras with the same underlying pattern of exchange matrices but with different choices of coefficients. One celebrated result of this kind is the separation of additions formula ([17, Theorem 3.7]). For a given mutation pattern of exchange matrices, this formula expresses the cluster variables in a cluster algebra with any choice of coefficients in terms of those in a cluster algebra with a special choice of principal coefficients. Our Proposition 4.3 puts this formula in a wider context, in which every quasi-homomorphism between a pair of normalized seed patterns witnesses its own separation of additions. This idea can be used to construct a new cluster algebra starting from a known one. (More precisely, using a known cluster structure on an algebra R, one can produce a cluster structure on another algebra R′ by describing an appropriate map from R to R′ .) Second, the naturally defined concept of a quasi-automorphism gives rise to the quasiautomorphism group of a seed pattern. This group interpolates between previously defined groups that are either too sensitive to coefficients (these groups are too small) or don’t refer to coefficients at all (these groups are too large). Most cluster algebras arising in applications have nontrivial coefficients, and these cluster algebras often afford nontrivial self-maps that are quasi-automorphisms of the cluster structure. The twist map on the Grassmannian [24] is one important example, cf. Remark 6.5. In a forthcoming companion paper we construct a large group of quasi-automorphisms of the Grassmannian cluster QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 3 algebras [28] whose action on cluster variables has a simple description. Much of the abstract setup in this paper was developed with that application in mind. The paper is organized as follows. Section 1 presents background on non-normalized seed patterns. This is mostly standard and taken from [13, 17], but with emphasis on the notion of the ambient semifield, cf. Definition 1.4. The section ends with a motivating example: a pair of seed patterns which will illustrate the various notions in subsequent sections. A reader familiar with cluster algebras can skim this section and head directly to Example 1.8. Sections 2 and 3 are the conceptual core of the paper. We define seed orbits as the smallest equivalence classes of non-normalized seeds on which the mutation rule is unambiguous. In Proposition 2.3 we give a more explicit characterization of seed orbits as orbits with respect to a rescaling action on seeds. Section 3 introduces quasi-homomorphisms of seed patterns and their basic properties. We end this section by describing the key differences between quasi-homomorphisms and some preexisting notions, specifically rooted cluster morphisms [1] and coefficient specializations [16, 26, 27]. In Section 4 we discuss quasi-homomorphisms between normalized seed patterns. For seed patterns of geometric type, we relate quasi-homomorphisms to linear combinations of the rows of an extended exchange matrix, making connections to the separation of additions formula and to gradings on cluster algebras. Section 5 introduces the easiest way of specifying a quasi-homomorphism in practice, by checking that a given semifield map sends cluster variables to rescaled cluster variables on a nerve. In Section 6 we define the quasi-automorphism group of a seed pattern and compare it with the cluster modular group [9] and the group of cluster automorphisms [2]. Sections 7 and 8 focus on cluster algebras associated with bordered marked surfaces [12, 13]. The main result is Theorem 7.5 describing the quasi-automorphism group of such a cluster algebra as a subgroup of the tagged mapping class group (excluding a few exceptional surfaces). In particular, it establishes that regardless of the choice of coefficients in such a cluster algebra, the quasi-automorphism group is always a finite index subgroup of the cluster modular group. The concept of a nerve introduced in Section 5 is new and includes as a special case the star neighborhood of a vertex. Star neighborhoods show up in the algebraic Hartogs’ principle argument used to establish that a given cluster algebra is contained in another algebra [11, Proposition 3.6]. In Appendix 9 we extend this argument from a star neighborhood to an arbitrary nerve. Section 10 illustrates the techniques in Section 4. We generalize Example 1.8 by describing a quasi-isomorphism between the Grassmannian cluster algebras [28] and polynomial rings arising as coordinate rings of band matrices. Acknowledgements I would like to thank Ian Le, Greg Muller, and Gregg Musiker for helpful conversations. I especially thank Sergey Fomin for many conversations and suggestions. This work was supported by a graduate fellowship from the National Physical Science Consortium and NSF grant DMS-1361789. While in the midst of carrying out this work, I learned that Thomas Lam and David Speyer had independently obtained results similar to Corollary 4.5 and Remark 4.6. 4 CHRIS FRASER 1. Preliminaries on seed patterns A (non-normalized) cluster algebra is constructed from a set of data called a nonnormalized seed pattern. We define this data now while fixing standard notation. For a number x we let [x]+ ∶= max(x, 0). We let sign(x) equal either −1, 0 or 1 according to whether x is negative, zero, or positive. We denote {1, . . . , n} by [1, n]. The setup begins with a choice of ambient field of rational functions F with coefficients in a coefficient group P. The coefficient group is an abelian multiplicative group without torsion. The ambient field is a field of rational functions in n variables with coefficients in P: it is the set of expressions that can be made out of n elements x1 , . . . , xn and the elements of of P, using the standard arithmetic operations +, −, × and ÷, under the usual notion of equivalence of such rational expressions. The integer n is called the rank. Definition 1.1 (Non-normalized seed, [15, 13]). Let P and F be as above. A nonnormalized seed in F is a triple Σ = (B, p, x), consisting of the following three ingredients: ● a skew-symmetrizable n × n matrix B = (bij ), ● a coefficient tuple p = (p±1 , . . . , p±n ) consisting of 2n elements in P, ● a cluster x = (x1 , . . . , xn ) in F , whose elements (called cluster variables) are algebraically independent and freely generate F over QP. The more restrictive notion of normalized seed is given in Definition 4.1. Normalized seeds are much more studied in the literature, where they are usually simply called seeds. Thus, we persistently use the adjective non-normalized in our setting, although this is a little clumsy. Definition 1.2. A labeled n-regular tree, Tn , is an n-regular tree with edges labeled by k integers so that the set of labels emanating from each vertex is [1, n]. We write t Ð → t′ to indicate that vertices t, t′ are joined by an edge with label k. An isomorphism Tn → Tn of labeled trees Tn and Tn sends vertices to vertices and edges to edges, preserving incidences of edges and the edge labels. Such an isomorhism is uniquely determined by its value at a single vertex t ∈ Tn . Definition 1.3 (Non-normalized seed pattern, [13, 15]). Let P and F be as above. A collection of non-normalized seeds in F , with one seed Σ(t) = (B(t), p(t), x(t)) for each t ∈ k Tn , is called a non-normalized seed pattern if for each edge t Ð → t′ , the seeds Σ(t) and Σ(t′ ) are related by a mutation in direction k: ● The matrices B(t) and B(t′ ) are related by a matrix mutation (1.1) (1.2) −bij (t) bij (t′ ) = { bij (t) + sign(bik (t))[bik (t)bkj (t)]+ ● the coefficient tuples p(t) and p(t′ ) are related by (1.3) when j ≠ k, p±k (t′ ) = p∓k (t) and p+ ⎧ j (t) + bkj(t) ⎪ ⎪ ⎪ p−j (t pk (t) = ⎨ p+j (t) p−j (t′ ) ⎪ ⎪ p− (t)bkj(t) − ⎪ ⎩ pj (t) k p+j (t′ ) if i = k or j = k otherwise, if bkj ≥ 0 if bkj ≤ 0 QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS (1.4) 5 ● and the clusters x(t) and x(t′ ) are related by xj (t′ ) = xj (t) for j ≠ k, and xk (t)xk (t′ ) = p+k ∏ xj (t)[bjk ]+ + p−k ∏ xj (t)[−bjk ]+ , (1.5) the latter of which is called an exchange relation. The rules (1.1) through (1.5) are ambiguous, meaning Σ(t′ ) is not determined uniquely p+ (t′ ) from Σ(t). Indeed, since (1.3) only mentions the ratio p−j (t′ ) , for each j ≠ k one can j rescale both of p+j (t′ ) and p−j (t′ ) by a common element of P while preserving (1.3). We µk write Σ ↭ Σ′ to indicate that two seeds Σ and Σ are related by a mutation in direction k; this condition is symmetric in Σ and Σ′ . Thinking of (1.5) as a recipe for computing xk (t′ ) from Σ(t), we crucially observe that the computation is subtraction-free: the only operations needed are +, × and ÷ in F . This motivates the following definition: Definition 1.4 (Ambient semifield). Let E be a non-normalized seed pattern, and x(t) one of its clusters. The ambient semifield, F>0 = F>0 (E) ⊂ F is the subset of all elements which can be given as a subtraction-free rational expression in the elements of x(t), with coefficients in P. Thus, it is the set of rational functions which can be built out of x1 (t), . . . , xn (t) and the elements of P using the operations +, × and ÷ in F . Since (1.5) is subtraction-free, F>0 is independent of the choice of t (it only depends on E), and every cluster variable for E lies in F>0 . Recall that a semifield is an abelian multiplicative group, with an additional binary operation (called the auxiliary addition) that is commutative and associative, and distributes over multiplication. The ambient semifield is a semifield with respect to the multiplication and addition operations in F , justifying its name. Homomorphisms between semifields are defined in the obvious way. The ambient semifield has the following universality property. Lemma 1.5 ([17, Definition 2.1]). Let E be a non-normalized seed pattern with coefficient group P and ambient semifield F>0 . Fix a cluster x(t) in E. Let S be any semifield. Then given a multiplicative group homomorphism P → S, and a function x(t) → S, there exists a unique semifield homomorphism F>0 → S agreeing with the given maps on P ∪ x(t). The following elements of F>0 will play a prominent role in Section 2. Definition 1.6 (Hatted variables). Let E be a non-normalized seed pattern. Let ŷ(t) = (ŷ1 (t), . . . , ŷn (t)) denote the n-tuple of hatted variables (1.6) ŷj (t) = p+j (t) p−j (t) ∏ xi (t)bij (t) , i obtained by taking the ratio of the two terms on the right hand side of (1.5). The hatted variables in adjacent seeds determine each other as follows: Proposition 1.7 ([13, Proposition 2.9]). Let E = (B(t), p(t), x(t)) be a non-normalized k seed pattern with hatted variables ŷ(t). For each edge t Ð → t′ , the n-tuples ŷ(t) and ŷ(t′ ) 6 CHRIS FRASER satisfy (1.7) ŷj (t)−1 ŷj (t′ ) = { ŷj (t)ŷk (t)[bkj (t)]+ (ŷk (t) + 1)−bkj (t) if j = k if j ≠ k. The propagation rule (1.7) takes place in F>0 , and only depends on the B matrix. The preceding discussion is what we will need for Section 2. We briefly recall a few more definitions which will be useful in presenting our examples. First, the exchange graph E associated with a seed pattern E is the graph whose vertices are the unlabeled seeds in E, and whose edges correspond to mutations between these seeds. More precisely, permuting the indices [1, n] in a non-normalized seed commutes with the mutation rules (1.1) through (1.5). The exchange graph is the n-regular graph obtained by identifying vertices t1 , t2 ∈ Tn if the seeds Σ(t1 ) and Σ(t2 ) are permutations of each other. The star neighborhood star(t) of a vertex t ∈ E is the set of n edges adjacent to it. Rather than being indexed by [1, n], the data in an unlabeled seed Σ(t) for t ∈ E is indexed by the n seeds adjacent to Σ(t), i.e. by the elements of star(t). Second, in the concrete examples in this paper, we have chosen a distinguished finite set of elements called frozen variables, and the coefficient group P is the free abelian multiplicative group of Laurent monomials in these frozen variables. The cluster algebra A associated with the seed pattern E is the Z-algebra generated by the frozen variables and all of the cluster variables arising in the seeds of E. Example 1.8. We now introduce a pair of affine algebraic varieties X and Y and a pair of seed patterns in their respective fields of rational functions. The cluster algebras associated with these seed patterns are the coordinate rings C[X] and C[Y]. Both cluster algebras are of finite Dynkin type A2 . Let X = Ĝr(3, 5) be the affine cone over the Grassmann manifold of 3-dimensional planes in C5 . The points in X are the decomposable tensors {x ∧ y ∧ z∶ x, y, z ∈ C5 } ⊂ Λ3 (C5 ). Its coordinate ring is generated by the Plücker coordinates ∆ijk for 1 ≤ i < j < k ≤ 5, extracting the coefficient of ei ∧ ej ∧ ek in x ∧ y ∧ z, where e1 , . . . , e5 is the standard basis for C5 . Representing a given x ∈ Ĝr(3, 5) by a 3 × 5 matrix, ∆ijk (x) is the maximal minor of this matrix in columns i, j, and k. There is a well known cluster structure on C[X] [15, 16]. It is a special case of a cluster structure for arbitrary Grassmannians constructed by Scott [28]. The frozen variables are the Plücker coordinates consisting of cyclically consecutive columns (1.8) ∆123 , ∆234 , ∆345 , ∆145 , ∆125 . There are five cluster variables, listed in (1.9) with cyclically adjacent pairs of cluster variables forming clusters (1.9) ∆245 , ∆235 , ∆135 , ∆134 , ∆124 . The clusters and exchange relations are given in Figure 1. All of the other data in the seed pattern can be determined from these. For example, focusing on the seed whose cluster QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 7 is (x1 , x2 ) = (∆235 , ∆245 ), from the first and fifth exchange relations in Figure 1 follows (p+1 , p−1 , p+2 , p−2 ) = (∆125 ∆234 , ∆123 , ∆145 , ∆345 ∆125 ) ∆125 ∆234 ∆145 ∆235 (ŷ1 , ŷ2 ) = ( (1.11) , ). ∆123 ∆245 ∆345 ∆125 The exchange relations are written so that mutating is moving clockwise in the exchange graph. If a mutation moves counterclockwise, one should swap the order of the two terms in the exchange relation. (1.10) (∆235 , ∆245 ) ● (∆245 , ∆124 ) (∆135 , ∆235 ) ● ● ● (∆124 , ∆134 ) ● (∆134 , ∆135 ) ∆245 ∆135 = ∆145 ∆235 + ∆125 ∆345 ∆235 ∆134 = ∆234 ∆135 + ∆123 ∆345 ∆135 ∆124 = ∆125 ∆134 + ∆123 ∆145 ∆134 ∆245 = ∆345 ∆124 + ∆123 ∆345 ∆124 ∆235 = ∆123 ∆245 + ∆125 ∆234 Figure 1. The exchange graph for C[X]. The vertices are clusters and edges between vertices are mutations. Each mutation exchanges two cluster variables via an exchange relation listed in the table at top right. The extra data in each seed can be inferred from these exchange relations. Second, let Y ≅ C9 the affine space of band matrices of the form (1.12) 0 ⎞ ⎛y1,1 y1,2 y1,3 0 y = ⎜ 0 y2,2 y2,3 y2,4 0 ⎟ . ⎝ 0 0 y3,3 y3,4 y3,5 ⎠ Its coordinate ring C[Y] contains the minors YI,J . Evaluating YI,J on y ∈ Y returns the minor of y occupying rows I and columns J, e.g. Yi,j (y) = yi,j and Y12,23 (y) = y1,2y2,3 − y1,3 y2,2 . Some of these minors factor, e.g. Y12,13 = Y1,1 Y2,3 . Figure 2 shows a seed pattern whose cluster algebra is C[Y]. The frozen variables are the following minors (1.13) Y1,1 , Y2,2 , Y3,3 , Y1,3 , Y2,4 , Y3,5 , Y123,234 . The cluster variables are listed in (1.14), with cyclically adjacent pairs forming clusters (1.14) Y1,2 , Y12,23 , Y2,3 , Y23,34 , Y3,4 . 2. Seed orbits We introduce seed orbits by first describing them as equivalence classes under a certain equivalence relation on seeds. Proposition 2.3 gives another characterization as orbits under an explicit rescaling action. 8 CHRIS FRASER (Y1,2 , Y3,4 ) ● (Y12,23 , Y1,2 ) ● ● (Y3,4 , Y23,34 ) (Y2,3 , Y12,23 ) ● Y1,2 Y2,3 = Y12,23 + Y2,2 Y1,3 Y12,23 Y23,34 = Y123,234 Y2,3 + Y2,2 Y3,3 Y1,3 Y2,4 ● (Y23,34 , Y2,3 ) Y2,3 Y3,4 = Y23,34 + Y3,3 Y2,4 Y23,34 Y1,2 = Y2,2Y1,3 Y3,4 + Y123,234 Y3,4 Y12,23 = Y3,3Y2,4 Y1,2 + Y123,234 Figure 2. The exchange graph and exchange relations for C[Y], mirroring Figure 1. Definition 2.1. Let k⃗ = (k1 , . . . , kℓ ) be a sequence of elements of [1, n]. Choosing a base kℓ k1 k2 point t0 ∈ Tn , such a sequence determines a walk t0 Ð→ t1 Ð→ ⋯ Ð→ tℓ in Tn . We say that k⃗ is contractible if this walk starts and ends at the same vertex of Tn , i.e. tℓ = t0 . Given non-normalized seeds Σ and Σ∗ , we write Σ ∼ Σ∗ if there is a contractible sequence of mutations from Σ to Σ∗ , i.e. a contractible sequence k⃗ and non-normalized seeds Σ1 , . . . , Σℓ−1 such that (2.1) µk1 µk2 µkℓ Σ = Σ0 ↭ Σ1 ↭ Σ2 ⋯Σℓ−1 ↭ Σℓ = Σ∗ . Clearly, ∼ is an equivalence relation on non-normalized seeds. Furthermore, it removes the ambiguity present in mutation of non-normalized seeds: µk Lemma 2.2. The mutation rule ↭ becomes unambiguous and involutive once it is thought of as a rule on equivalence classes of seeds under ∼. That is, fixing a ∼-equivalence class S and a direction k ∈ [n], the set of seeds (2.2) {Σ′ ∶ Σ′ ↭ Σ for some Σ ∈ S} µk is again a ∼-equivalence class of seeds. We now characterize ∼-equivalence classes explicitly. We say two elements z, x ∈ F are proportional, written z ≍ x, if xz ∈ P. We emphasize that P does not include constants, e.g. −1, 2 ∉ P, and thus x is not proportional to −x, 2x, etc. Proposition 2.3 (Seed orbits). Let Σ = (B, p, x), Σ∗ = (B ∗ , p∗ , x∗ ) be non-normalized seeds in F , of rank n ≥ 2, with x = (xi ), p = (p±i ), x∗ = (x∗i ), p∗ = ((p∗ )±i ). Then the following are equivalent: (1) Σ ∼ Σ∗ . (2) B = B ∗ , ŷ(Σ) = ŷ(Σ∗ ), and xi ≍ x∗i for all i. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 9 (3) B = B ∗ , and there exist scalars c1 , . . . , cn , d1 , . . . , dn ∈ P, such that xj (2.3) x∗j = cj p±j [±bij ]+ ∗ ± (p )j = (2.4) . ∏ ci dj Equations (2.3) and (2.4) define a rescaling action of Pn × Pn on non-normalized seeds, ⃗ ⋅ Σ where (⃗ ⃗ ∈ Pn × Pn and Σ is a non-normalized seed. Proposition denoted by (⃗ c, d) c, d) 2.3 says that a ∼-equivalence class of non-normalized seeds is precisely a Pn × Pn orbit under this action; we henceforth refer to these equivalence classes as seed orbits. Proof. Conditions (2) and (3) are a re-translation of each other by immediate calculation. We show (1) implies (2). Defining a seed orbit by (2), this implication follows from the ⃗ are fact that seed orbits are “closed under mutation.” More precisely, if Σ and Σ† = (⃗ c, d)⋅Σ µk µk in the same seed orbit and Σ′ and (Σ† )′ are two seeds satisfying Σ ↭ Σ′ and Σ† ↭ (Σ† )′ , then Σ′ and (Σ† )′ are in the same seed orbit. By (1.1) and Proposition 1.7, we know that B ′ = (B † )′ and ŷ′ = (ŷ† )′ , so the claim will follow if we check (x† )′j ≍ x′j for all j. This is obvious when j ≠ k from (1.4). When j = k, (1.5) for the mutation Σ† ↭ (Σ† )′ says that µk (2.5) (2.6) (2.7) (2.8) (x† )′k = (x†k )−1 ((p† )+k ∏(x†j )[bjk ]+ + (p† )−k ∏(x†j )[−bjk ]+ ) = (x†k )−1 (p† )−k (1 + ŷk (Σ† )) ∏(x†j )[−bjk ]+ ck [−b ] = (xk )−1 p−k (1 + ŷk (Σ)) ∏ xj jk + dk ck = x′k , dk as desired. Returning to the implication (1) ⇒ (2), from the symmetry of ↭ it follows ⃗ Since seed orbits are closed that Σ is related to itself along any contractible sequence k. ∗ under mutation, any seed Σ related to Σ by a contractible sequence of mutations is therefore in the same seed orbit as Σ. Now we show (3) implies (1). Let ĉj (a) ∈ Pn × Pn denote the vector with cj = a and all other entries equal to 1, and define similarly dˆj (a). Clearly, it suffices to show that Σ ∼ ĉj (a) ⋅ Σ and Σ ∼ dˆj (a) ⋅ Σ, since rescalings of this type generate Pn × Pn . Seeds of the form dˆj (a) ⋅ Σ are equivalent to Σ, as follows by mutating twice in any µj direction k ≠ j. For seeds of the form ĉj (a) ⋅ Σ, let Σ′ be any seed satisfying Σ ↭ Σ′ : µk (2.9) (2.10) (2.11) (2.12) Σ ∼ dˆj (a−1 ) ⋅ Σ µj ↭ (ĉj (a−1 )dˆj (a−1 )) ⋅ Σ′ ∼ (ĉj (a−1 )) ⋅ Σ′ ↭ ĉj (a) ⋅ Σ, µj where (2.10) and (2.12) follow from the calculation in (2.8), and (2.9) and (2.11) are admissible since we already know rescaling by dˆj (a) preserves equivalence of seeds. Since 10 CHRIS FRASER (2.9) through (2.12) amounts to mutating in direction j twice on seed equivalence classes, it follows that Σ ∼ ĉj (a) ⋅ Σ as desired.  3. Quasi-homomorphisms We will now give the definition of a quasi-homomorphisms from a seed pattern E to another seed pattern E. We retain the notation of Section 1 for all the data in E, and we use bars to denote the analogous quantities in the second pattern E. Thus E has coefficient group P, ambient field F, seeds Σ(t) = (B(t), p(t), x(t)), hatted variables ŷ j (t), and so on. It is built on a second copy of the n-regular tree, Tn . The motivating observation is the following: since the mutation rules (1.3) through (1.5) are certain algebraic relations in in F>0 , they are preserved by a homomorphism of semifields. Definition 3.1 (Quasi-homomorphism). Let E and E be non-normalized seed patterns. Let Ψ∶ F>0 → F >0 be a semifield homomorphism satisfying Ψ(P) ⊂ P (in this case we say Ψ preserves coefficients). We say Ψ is a quasi-homomorphism from E to E if it maps each seed in E to a seed that is ∼-equivalent to a seed in E, in a way that is compatible with mutation. More precisely, let t ↦ t be an isomorphism of the labeled trees Tn and Tn . Then Ψ is a quasi-homomorphism if and only if (3.1) Ψ(Σ(t)) ∼ Σ(t) for all t ∈ Tn , where Ψ(Σ(t)) = (B(t), Ψ(p), Ψ(x)) is the triple obtained by evaluating Ψ on Σ(t). As motivation for this definition, we imagine a situation where E is well understood combinatorially, and we would like to understand another seed pattern E by comparing it with E. The requirement (3.1) says that the seeds Ψ(Σ(t)) mutate “in parallel” with the seeds in E, in the sense that their corresponding seeds only differ by the rescalings (2.3) and (2.4). The following Propositions 3.2 and 3.3 show two ways in which quasi-homomorphisms are well-behaved. Both of their proofs follow immediately from the observation that applying a semifield homomorphism commutes with mutation. Proposition 3.2. Let Ψ∶ F>0 → F >0 be a semifield homomorphism satisfying (3.1) for some t ∈ Tn . Then Ψ is a quasi-homomorphism. That is, rather than checking that (3.1) holds at every t ∈ Tn , it suffices to check this at a single t ∈ Tn . Proposition 3.3. Let Ψ be a quasi-homomorphism from E to E. Let Σ be a seed in E, and let Σ∗ be a non-normalized seed satisfying Σ ∼ Σ∗ . Then Ψ(Σ) ∼ Ψ(Σ∗ ). Proposition 3.3 says that quasi-homomorphism preserves ∼-equivalence of seeds. Thus, if S(t) denotes the seed orbit of Σ(t) and ditto for S(t) and Σ(t), then Ψ maps S(t) inside S(t) for all t. A quasi-homomorphism is therefore a natural notion of homomorphism between the respective seed orbit patterns (t, S(t)) and (t, S(t)). Now we describe a quasi-homomorphism between the pair of seed patterns in Example 1.8. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 11 Example 3.4. Given Y ∈ Y, let Y [1], Y [2], Y [3] ∈ C5 denote its rows. There is a F surjective map of varieties F ∶ Y → X sending Y ↦ Y [1] ∧ Y [2] ∧ Y [3]. It determines a map on cluster algebras F ∗ ∶ C[X] → C[Y] sending ∆ijk ↦ Y123,ijk . Figure 3 shows the non-normalized seed pattern that arises from applying F ∗ to Figure 1 and factoring the cluster variables inside C[Y]. The seeds in Figure 3 are in the same seed orbit as the corresponding seeds in Figure 2, and thus F ∗ is a quasi-homomorphism from C[X] to C[Y]. (Y3,5 Y12,23 , Y2,4 Y3,5 Y1,2 ) ● (Y2,4 Y3,5 Y1,2 , Y1,1 Y2,2 Y3,4) ● (Y1,1 Y2,2 Y3,4 , Y1,1 Y23,34 ) ● (Y1,1 Y3,5 Y2,3 , Y3,5 Y12,23 ) ● ● (Y1,1 Y23,34 , Y1,1 Y3,5 Y2,3 ) 2 Y2,4 (Y12,23 + Y2,2 Y1,3 ) Y2,4 Y3,5 Y1,2 ⋅ Y1,1 Y3,5 Y2,3 = Y1,1 Y3,5 Y3.5 Y12,23 ⋅ Y1,1 Y23,34 = Y1,1 Y3,5(Y123,234 Y2,3 + Y2,2 Y3,3 Y1,3 Y2,4) 2 Y2,2 Y35 (Y23,34 + Y3,3 Y24 ) Y1.1 Y3.5 Y2,3 ⋅ Y1.1 Y2.2 Y3,4 = Y1.,1 Y1.1 Y23,34 ⋅ Y24 Y3.5 Y1,2 = Y1.1 Y24 Y3,5 (Y2,2 Y1,3 Y3,4 + Y123,234 ) Y1.1 Y2.2Y3,4 ⋅ Y35 Y12,23 = Y1.1 Y22 Y3,5 (Y3,3 Y2,4 Y1,2 + Y123,234 ) Figure 3. The non-normalized seed pattern obtained by applying F ∗ to the seed pattern in Figure 1. The clusters agree with the clusters in Figure 2 up to the frozen variables listed in (1.13). Cancelling the common frozen variable factors from both sides of the exchange relations yields the exchange relations in Figure 2. It follows that the ŷ values are the same in both figures. Definition 3.5. Two quasi-homomorphisms Ψ1 , Ψ2 from E to E are called proportional if Ψ1 (Σ) ∼ Ψ2 (Σ) for all seeds Σ in E. We say a quasi-homomorphism Ψ from E to E is a quasi-isomorphism if there is a quasi-homomorphism Φ from E to E such that Φ ○ Ψ is proportional to the identity map on F>0 . We say that Ψ and Φ are quasi-inverses of one another. Once we have a quasi-isomorphism between two seed patterns, we think of them as being essentially “the same.” Up to coefficients, the maps in both directions allows us to write the cluster variables in one seed pattern in terms of the cluster variables in the other one. 12 CHRIS FRASER Remark 3.6. The set of seed patterns with quasi-homomorphisms as morphisms is a category. Proportionality is an equivalence relation on the morphisms in this category, and this equivalence relation respects composition of quasi-homomorphisms. This yields a quotient category whose objects are seed patterns and whose morphisms are proportionality classes of quasi-homomorphisms. A morphism in this quotient category is an isomorphism if and only if one (hence any) of its constituent quasi-homomorphisms is a quasi-isomorphism. The following lemma provides a simple method for checking a candidate map is a quasi-inverse of a given quasi-homomorphism. Lemma 3.7. Let Ψ be a quasi-homomorphism from E to E, and Φ∶ F >0 → F>0 a semifield map that preserves coefficients and for which Φ ○ Ψ(x) ≍ x for all cluster variables x in E. Then Ψ and ϕ are quasi-inverse quasi-isomorphisms. Lemma 3.7 follows from the more general Proposition 5.2 below. In fact, it will suffice to merely check that ϕ ○ Ψ(x) ≍ x for all x lying on a nerve (cf. Definition 5.1). Example 3.8. Using Lemma 3.7 we describe a quasi-inverse G∗ for the quasi- homomorphism F ∗ from Example 3.4. Let G∶ X → Y be the morphism sending X ∈ X to the the band matrix 0 0 ⎞ ⎛∆145 (X) ∆245 (X) ∆345 (X) 0 ∆125 (X) ∆135 (X) ∆145 (X) 0 ⎟∈Y G(X) = ⎜ ⎝ 0 0 ∆123 (X) ∆124 (X) ∆125 (X)⎠ all of whose entries are Plücker coordinates of X. The coordinate ring map C[Y] → C[X] sends Yi,j to the Plücker coordinate in the (i, j) entry of G(X), e.g. G∗ (Y1,2 ) = ∆245 . The matrix G(X) has an interesting property: all of its minors are monomials in the Plücker coordinates of X. In particular, its maximal minors agree with those of X, up to a multiplicative factor: (3.2) ∆ijk (G(X)) = ∆145 (X)∆125 (X)∆ijk (X). Thus, G∗ ○ F ∗ (∆ijk ) = ∆145 ∆125 ∆ijk ≍ ∆ijk for each cluster variable ∆ijk . Since G∗ preserves coefficients (the only nontrivial check is G∗ (Y123,234 ) = ∆125 ∆145 ∆234 ), from Lemma 3.7 it follows that G∗ is a quasi-inverse of F ∗ . Remark 3.9. A quasi-homomorphism is defined as a map on ambient semifields since these maps transparently preserve the mutation rules (1.1)–(1.5). This should be suitable for most purposes, since one is mostly interested in evaluating a quasi-homomorphism on cluster variables or coefficients. However, the cluster algebra A is the more familiar algebraic object associated to a seed pattern. If one wants to think of a quasi-homomorphism Ψ as an algebra map of cluster algebras A → A, one will sometimes need to first localize at the frozen variables in A. We close this section by explaining the differences between quasi-homomorphisms and preexisting notions of homomorphisms between cluster algebras. Specifically, we consider the notion of a rooted cluster morphism in the category of cluster algebras described by Assem, Dupont, and Shiffler [1], and also of a coefficient specialization defined by Fomin and Zelevinsky [17] and studied by Reading [26, 27]. The key difference between QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 13 these notions and quasi-homomorphisms is that a quasi-homomorphism allows for cluster variables to be rescaled by an element of P. This extra flexibility provides more freedom in constructing new cluster algebras from old ones (cf. Section 4) or in finding nice self-maps of cluster algebras giving rise to elements of the cluster modular group (cf. Section 6). In a little more detail, a coefficient specialization is a map whose underlying map on coefficients can be any group homomorphism P → P, but that must send each cluster variable to a cluster variable. Thus, each coefficient specialization is a quasi-homomorphism, but a very special one since cluster variables are not allowed to be rescaled by elements of P. Rooted cluster morphisms require choosing a pair of initial seeds in E and E (this is the sense in which the morphism is rooted). Between this pair of seeds, a morphism is an algebra map that sends each cluster variable to either a cluster variable or an integer, and sends each frozen variable to either a frozen variable, a cluster variable, or an integer. Hence, while quasi-homomorphisms are more flexible in allowing for cluster variables to be rescaled and for frozen variables to be sent to monomials in the frozen variables, they are also less flexible as they do not allow for unfreezing frozen variables or specializing variables to integers. It probably would not be hard to combine these two notions. One more technicality: to streamline the discussion, we have formulated Definition 3.1 so that quasi-homomorphisms preserve exchange matrices, whereas rooted cluster morphisms allow for B ↦ −B. To make Definition 3.1 more consonant with these preexisting notions, one could modify (3.1) to say that either Ψ(Σ(t)) ∼ Σ(t) or Ψ(Σ(t)) ∼ Σ(t)opp (see the definition of opposite seed in Section 5 below) without any significant changes. 4. Normalized seed patterns In this section, we recall the definition of normalized seed patterns and apply the results of Section 2 in the case that E and E are normalized. Definition 4.1 (Normalized seed pattern). A seed pattern E as in Definition 1.3 is called normalized if the coefficient group P is a semifield, and each coefficient tuple p(t) satisfies p+j (t) ⊕ p−j (t) = 1 for all j, (4.1) where ⊕ is the addition in P. The advantage of this normalization condition is that it makes the mutation rule (1.3), and therefore mutation of normalized seeds, unambiguous. Indeed, (1.3) specifies the p+ (t′ ) ratio yj (t′ ) = pj− (t′ ) in terms of B(t) and p(t), and there is a unique choice of p±j (t′ ) ∈ P j with this ratio and satisfying the normalization condition, namely the pair (4.2) p+j (t′ ) = yj (t′ ) 1 and p−j (t′ ) = . ′ 1 ⊕ yj (t ) 1 ⊕ yj (t′ ) Furthermore, mutating twice in a given direction is the identity. At the same time, the disadvantage is that computing a cluster algebra now involves three operations, the two operations present in F>0 along with ⊕ in P. The definition of quasi-homomorphism prioritizes these first two operations. Proposition 4.3 says that in the case of a quasi-homomorphism between normalized seed patterns, there is a “separation of additions” phenomenon, separating the addition in F>0 from the one in P. 14 CHRIS FRASER Before stating Proposition 4.3, we say a little more about normalized seed patterns and Y -patterns. In a normalized seed pattern, the tuple of ratios (y1 (t), . . . , yn (t)) determines the coefficient tuple by (4.2). Accordingly, for normalized seed patterns one keeps track of yj (t) rather than p±j (t). Rewriting (1.2) and (1.3) in terms of yj (t) determines a Y -pattern recurrence in the semifield P: (4.3) yj (t)−1 yj (t′ ) = { yj (t)yk (t)[bkj (t)]+ (yk (t) ⊕ 1)−bkj (t) if j = k if j ≠ k. A collection of quantities (B(t), y(t))t∈Tn satisfying (1.1) and (4.3), with the y(t) lying in some semifield S, is called a Y-pattern in the semfield S. Notice that the concept of semifield is now playing two different roles, either as the ambient semifield F>0 in which the exchange relation calculations take place, or as the coefficient semifield P used to remove the ambiguity in mutation of seeds. The surprising connection between these two roles is Lemma 1.7, which we now recognize as saying that the (B(t), ŷ(t)) form a Y -pattern in the ambient semfield F>0 . The most important example of a coefficient semifield arising in applications is the tropical semifield. Definition 4.2. A tropical semifield is a free abelian multiplicative group in some generators u1 , . . . , um , with auxiliary addition ⊕ given by a min(aj ,bj ) b j j ∏ uj ⊕ ∏ uj = ∏ uj j j . j A normalized seed pattern over a tropical semifield is said to be of geometric type. When this is the case, denoting the frozen variables by xn+1 , . . . , xn+m , the data of (B(t), y(t)) is entirely described by an (n+m)×n matrix B̃(t) = (bij (t)), called the extended exchange matrix. Its top n × n submatrix is B(t) and is called the principal part. Its bottom m n+i,j rows are called coefficient rows. They are specified from the equality yj (t) = ∏ xn+i m b (t) . i=1 The mutation rule (4.3) translates into the rule (1.1) on B̃. The seed pattern in Figure 1 is of geometric type over the tropical semifield in the frozen variables in (1.8). The same holds for the seed pattern in Figure 2 over the frozen variables in (1.13). On the other hand, the seed pattern in Figure 3 is not normalized, e.g. the first exchange relation there satisfies p+2 ⊕ p−2 = Y1,1 Y2,4 Y3,5 . Now we state Proposition 4.3 describing quasi-homomorphisms between normalized seed patterns E and E. It arose during the process of writing a forthcoming book on cluster algebras [14], in proving one direction of the finite type classification (namely, that a cluster algebra with a quiver whose principal part is an orientation of a Dynkin quiver necessarily has only finitely many seeds). We will state it as a recipe for constructing a normalized seed pattern from a given one, since we envision this being useful in applications. Proposition 4.3. Let E be a non-normalized seed pattern, with the usual notation. Let (xi ) = (xi (t0 )) be a fixed initial cluster in E. Let P be a semifield, and F >0 the semifield of subtraction-free rational expressions in algebraically independent elements x1 , . . . , xn with coefficients in P. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 15 Let Ψ∶ F>0 → F >0 be a semifield map satisfying Ψ(xi ) ≍ xi , and let c∶ F>0 → P be xi ↦1 Ψ the composition of semifield maps F>0 Ð → F >0 ÐÐ→ P where the second map in this composition specializes all xi to 1 and is the identity on P. Then there is a normalized seed pattern E in F >0 with seeds (B(t), p(t), x(t)) satisfying (4.4) B(t) = B(t) (4.5) xi (t) = (4.6) (4.7) Ψ(xi (t)) c(xi (t)) ŷ i (t) = Ψ(ŷi (t)) y i (t) = c(ŷi (t)). Clearly, Ψ is a quasi-homomorphism from E to E. Proof. Formulas (4.5) through (4.7) follow by applying [13, Proposition 3.4]) to Ψ(E), renormalizing by the scalars c(xi ), and massaging the formulas given there. Alternatively, it is also straightforward to check the right hand sides of (4.5) through (4.7) satisfy the required recurrences directly (this is carried out in [14]).  Example 4.4. Beginning with the seed pattern in Figure 1, one can construct the normalized seed pattern in Figure 2 by first applying the semifield map F ∗ – obtaining the nonnormalized seed pattern in Figure 3– and then normalizing by a semifield map c∶ F>0 → P. This map c agrees with F ∗ on frozen variables and sends a cluster variable x to the frozen variable monomial dividing F ∗ (x), e.g. c(∆235 ) = Y3,5 and c(∆245 ) = Y2,4 Y3,5. When both E and E are of geometric type, constructing a quasi-homomorphism that sends one seed into (the seed orbit of) another seed is a matter of linear algebra: Corollary 4.5. Let Σ = (B̃, {x1 , . . . , xn }) and Σ = (B̃, {x1 , . . . , xn }) be seeds of geometric type, with frozen variables xn+1 , . . . , xn+m and xn+1 , . . . , xn+m respectively. Let E and E be the respective seed patterns. Let Ψ be a quasi-homomorphism from E to E such that Ψ(Σ) ∼ Σ. It determines a monomial map from the xi to the xi . Let MΨ denote the matrix of exponents of this monomial map, thus MΨ is an (n + m) × (n + m) matrix satisfying Ψ(xk ) = ∏ xi n+m (MΨ )ik . i=1 Then the extended exchange matrices B̃, B̃ are related by (4.8) B̃ = MΨ B̃. In particular, such a a quasi-homomorphism Ψ exists if and only if the principal parts of B̃, B̃ agree, and the (integer) row span of B̃ contains the (integer) row span of B̃. Proof. Indeed, the (i, j) entry of the left hand side of (4.8) encodes the exponent of xi in ŷ j , while the (i, j) entry of the right hand side encodes the exponent of xi in Ψ(ŷj ). So (4.8) now follows from (4.6). The final statement follows by studying (4.8): the “interesting” rows of MΨ are its bottom m rows. Each of these rows determines a particular linear combination of the rows of B̃, and these linear combinations can be prescribed arbitrarily by prescribing the exponent of xi in Ψ(xj ) for 1 ≤ i ≤ m, 1 ≤ j ≤ n + m using Lemma 1.5.  16 CHRIS FRASER Remark 4.6 (Exchange graphs and separation of additions). The formulas (4.4),(4.5) and (4.7) show that if there is a quasi-homomorphism from E to E, then the exchange graph of E covers that of E. In particular, by Corollary 4.5, if the rows of B̃ span Zn , then the exchange graph for the corresponding cluster algebra A(B̃) covers the exchange graph of every other cluster algebra A with the same underlying exchange matrix. This is a natural generalization of the separation of additions formula [17, Theorem 3.7] from the case of a quiver with principal coefficients to any B̃-matrix whose rows span Zn . Namely, let Σ0 = (B0 , y, x) and Σ0 = (B0 , y, x) be a pair of normalized seeds with the same exchange matrix, and suppose Σ0 has principal coefficients, i.e. yi = xn+i . There is a natural choice of maps Ψ mapping Σ0 to Σ0 as in Proposition 4.3, defined by Ψ(xi ) = xi and Ψ(xn+i ) = y i . For this choice of Ψ, formula (4.5) becomes separation of additions: the numerator of [17, Theorem (3.7)] (evaluating the “X polynomial” in F) is applying the semifield homomorphism Ψ, while the denominator (specializing the cluster variables to 1 and evaluating the X polynomial in P) is applying the semifield map c. Remark 4.7 (Proportionality and gradings). Let E be a seed pattern of geometric type. We recall briefly the concept of a Zr -grading on E cf. [21, 22]. Choosing an initial seed (B̃, {xi }) in E, such a choice of grading is determined by a r × (n + m) grading matrix G satisfying GB̃ = 0. The ith column of G determines the grading of xi as a vector in Zr , for 1 ≤ i ≤ n + m. The condition GB̃ = 0 guarantees that every exchange relation (1.5) is homogeneous with respect to this Zr -grading; this in turn defines the multi-grading of each adjacent cluster variable and thereby each adjacent grading matrix. It can be seen that these adjacent grading matrices again satisfy the left kernel condition, so that the grading propagates to a Zr -grading on the entire cluster algebra in which the cluster variables and coefficients are homogeneous. Now we suppose we are given two seeds E and E of geometric type with notation as in Corollary 4.5. Let Ψ1 and Ψ2 be a pair of proportional quasi-homomorphisms of E and E. We obtain as in (4.8) matrices MΨ1 and MΨ2 such that MΨ1 B̃ = MΨ2 B̃ = B̃, which implies that MΨ1 −MΨ2 defines a Zm -grading G on E (the first n rows of MΨ1 −MΨ2 define the trivial grading). Conversely, fixing a quasi-homomorphism Ψ1 with matrix MΨ1 , any choice of Zm -grading matrix G on B̃ provides a quasi-homomorphism Ψ2 , proportional to Ψ1 , whose matrix is MΨ2 = MΨ1 + G. Remark 4.8. For simplicity, we stated Corollary 4.5 in terms of Z row spans, but a similar statement holds for Q row spans. To do this, one enlarges the tropical semifield P to the Puiseux tropical semifield consisting of Puiseux monomials with rational exponents in the frozen variables. This is unpleasant from the perspective of cluster algebras as coordinate rings, but is perfectly fine if one is only interested in writing algebraic formulas for cluster variables, etc. This is foreshadowed in the work of Sherman and Zelevinsky [29, Section 6], which 0 a ). discusses the coefficient-free rank 2 cluster algebra A(b, c) with exchange matrix ( −b 0 The authors write the cluster variables in any cluster algebra with this B matrix in terms of the cluster variables for A(b, c). Their formulas involve Puiseux monomials in the frozen variables. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 17 5. Nerves By Proposition 3.2, to check that a given semifield map Ψ is a quasi-homomorphism from E to E, it suffices to check that Ψ(Σ(t)) ∼ Σ(t) for some pair of seeds Σ(t) in E and Σ(t). By Proposition 2.3, this means checking that B(t) = B(t) and ŷ(t) = ŷ(t), and furthermore Ψ(xj (t)) ≍ xj (t) holds for all j. We envision applications where checking the proportionality condition on cluster variables is easy and can be done in many seeds t, but checking the equality of exchange matrices or ŷ’s is inconvenient. The goal of this section is to give a criterion that guarantees Ψ is a quasi-homomorphism by only checking these proportionality conditions. The relevant concept is that of a nerve for a seed pattern. Definition 5.1. Let E be a seed pattern. A nerve N for Tn , is a connected subgraph of Tn such that every edge label k ∈ [1, n] arises at least once in N . The basic example of a nerve is the star neighborhood of a vertex. We believe that there are many theorems of the form, “if a property holds on a nerve, then it holds on the entire seed pattern.” We give an example of such a theorem in the appendix, generalizing the “Starfish Lemma” [11, Proposition 3.6] from a star neighborhood to a nerve. Before stating the result of this section, we need to address the (mostly unimportant) difference between a seed and its opposite seed. We say a seed is indecomposable if the underlying graph described by its exchange matrix (the vertex set is [1, n] and vertices i, j are joined by an edge if bi,j ≠ 0) is connected. For a seed Σ = (B, p, x), the opposite = xi . seed Σopp = (B opp , popp , xopp ) is the seed defined by B opp = −B, (popp )±j = p∓j , and xopp i opp 1 It satisfies ŷj = ŷj . The operations of restricting to an indecomposable component and replacing a seed by its opposite seed both commute with mutation. Proposition 5.2. Let E and E be non-normalized seed patterns, with respective ambient semifields F>0 and F >0 . Suppose the seeds in E are indecomposable. Let Ψ∶ F>0 → F >0 be a semifield homomorphism that preserves coefficients and satisfies Ψ(xj (t)) ≍ xj (t) for j every vertex t and label j such that t Ð → t′ is in N . Then Ψ is a quasi-homomorphism opp from E to E or from E to E . In particular applying the proposition when N is the star neighborhood of a vertex t, to check that Ψ is a quasi-homomorphism, it suffices to check that Ψ(xj (t)) ≍ xj (t) for → t′ . Lemma all j ∈ [1, n], as well as checking Ψ(xj (t′ )) ≍ xj (t′ ) for each adjacent edge t Ð 3.7 now follows. j Proof. Choose a vertex t ∈ N . By hypothesis for all j, Ψ(xj (t)) = cj (t)xj (t) for some cj (t) ∈ P, so we are left checking that B(t) = B(t) and ŷ(t) = ŷ(t). Suppose t Ð → t′ is an ′ ′ ′ ′ edge in N , then there is a scalar ck (t ) such that Ψ(xk (t )) = ck (t )xk (t ). The exchange relation defining xk (t′ ) in E is k (5.1) xk (t)xk (t′ ) = p+k (t) ∏ xj (t)[bjk (t)]+ + p−k (t) ∏ xk (t)[−bjk (t)]+ . On the other hand, applying Ψ to the relation defining xk (t′ ) in E and rearranging yields (5.2) 1 xk (t)xk (t′ ) = (Ψ(p+k (t)) ∏ Ψ(xj (t))[bjk (t)]+ + Ψ(p−k (t)) ∏(Ψ(xj (t)))[−bjk (t)]+ ). ′ ck (t )ck (t) 18 CHRIS FRASER Abbreviating the two terms on the right hand side of (5.1) as X + Y , and the two terms in (5.2) as Z + W , we see by algebraic independence in the seed at t that either X = Z, Y = W , or X = W, Y = Z. Refer to these as Case 1 or Case 2 respectively. By Z inspection, we see that ŷ k (t) is the ratio X Y , while Ψ(ŷk (t)) is W . Thus in Case 1 we deduce that Ψ(ŷk (t)) = ŷ k (t) and the matrices B(t) and B(t) have the same k th column. opp In Case 2 we deduce the same thing once we replace E by E . Now apply Lemma 5.3.  Lemma 5.3. Let Y = {y(t), B(t)} and Y = {y(t), B(t)} be two Y -patterns whose matrices B(t) are indecomposable. Let N be a nerve for Tn . Suppose for every vertex t ∈ N and k label k such that the edge t Ð → t′ is in N , one of the following holds (5.3) (5.4) yk (t) = y k (t) and bjk (t) = bjk (t) for all j ∈ [1, n], or ykopp (t) = y k (t) and bopp jk (t) = bjk (t) for all j ∈ [1, n], then Y = Y or Y opp = Y accordingly. Roughly, there are two issues here: first the question of whether Y -patterns can be checked on a nerve (they can), and second whether we are dealing with Y or Y opp (this relies on indecomposability). Proof. In any Y -pattern, for a given (k, t) pair (not necessarily in N ), we will refer to yk (t) and the k th column of B(t) as the k-part of the seed at t. The equations in (5.3) k → t′ ∈ N . say that Y, Y have either the same k-parts, or opposite k-parts, for any edge t Ð Pick a vertex t0 ∈ N , and an edge k ∈ N incident to t0 . If necessary, replace Y by Y opp so that the given Y -patterns have the same k-part at t0 . We seek to prove Y, Y have the same j-part at t0 , for all j ∈ [n]. k Let t0 Ð → t1 ∈ N be an edge in the nerve incident to t0 . The mutation rules (1.1), (4.3) are involutive and have the property that for any j, the j-part of the seed at t1 depends only on the j-part and k-part of the seed at t0 . Since the given Y -patterns agree at k, we see that their j-parts agree at t1 if and only if they agree at t0 . Repeatedly apply this observation, mutating in all possible directions in the nerve, while preserving the fact that the j-parts at t ∈ N coincide if and only if they coincide at t0 . Since the nerve is connected and every edge label shows up at least once in N , we conclude that for all j, the j-parts at Y and Y are either the same or opposite. The connectedness hypothesis assures they are all in fact the same.  6. Quasi-automorphisms and the cluster modular group A quasi-automorphism is a quasi-isomorphism from a given seed pattern E to itself, cf. Definition 3.5. One can think of a quasi-automorphism as a choice of a map describing an automorphism of the pattern of seed orbits associated to E. We will use quasi-automorphisms to define a variant of a group of automorphisms of E, generalizing the group of cluster automorphisms defined for seed patterns with trivial coefficients in [2] while retaining many of the properties of cluster automorphisms (e.g. Proposition 3.2, Corollary 4.5 and Proposition 5.2). QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 19 The following example illustrates that the notion of quasi-automorphism is more general than the “naive” notion of a semifield automorphism preserving the seed orbit pattern. Example 6.1. A quasi-automorphism does not have to be an automorphism of semifields. Consider the composition G∗ ○ F ∗ from Example 3.8, which is a quasi-automorphism of C[X] proportional to the identity map. It rescales each Plücker variable by a product of frozens: G∗ ○ F ∗ (∆S ) = ∆145 ∆125 ∆S . The ambient semifield of C[X] has a grading for which every Plücker variable is degree one, and every homogeneous element in the image of G∗ ○ F ∗ has degree a multiple of 3. Thus G∗ ○ F ∗ cannot be surjective. Definition 6.2. The quasi-automorphism group QAut0 (E) is the set of proportionality classes of quasi-automorphisms of E. This is the automorphism group of E in the quotient category discussed in Remark 3.6. Remark 6.3. Let us call a quasi-automorphism trivial if it is proportional to the identity map. The set of trivial quasi-automorphisms is a monoid (but not usually a group) under composition; the composition G∗ ○ F ∗ from Example 3.8 bears witness to this. One way to construct quasi-automorphisms proportional to a given Ψ is to compose ǫ1 ○ Ψ ○ ǫ2 with ǫ1 and ǫ2 trivial. It is tempting to try and define QAut0 (E) purely in terms of thse trivial quasi-automorphisms, without mentioning proportionality. However the relation ≡ defined by Ψ1 ≡ Ψ2 if Ψ2 = ǫ1 ○ Ψ ○ ǫ2 is neither symmetric nor transitive, so one cannot form a quotient category using this relation. We write QAut0 (E) = QAut0 (B̃) when E is of geometric type and specified by an initial matrix B̃. By Remark 4.7, two quasi-automorphisms are proportional to each other if and only if their ratio defines a Zm -grading on E (taking exponents of elements of P to obtain elements of Zm ). Fixing a particular quasi-automorphism Ψ, the number of degrees of freedom in specifying another quasi-automorphism proportional to Ψ is therefore the corank of B̃. Lemma 6.4. Let E be a seed pattern of geometric type and Ψ a quasi-homomorphism from E to itself. Then Ψ is a quasi-automorphism. Thus when E is of geometric type, every quasi-homomorphism Ψ from E to itself determines an element of QAut0 (E), i.e. any such Ψ has a quasi-inverse. Proof. By [3, Lemma 3.2], if two B̃-matrices B̃(t0 ) and B̃(t0 ) are in the same mutation class, they are related by a pair of unimodular integer matrices: B̃(t0 ) = M B̃(t0 )N, for M ∈ GLm+n (Z), and N ∈ GLn (Z). By Corollary 4.5, for a pair of vertices t0 , t0 ∈ Tn , there is a quasi-homomorphism Ψ sending the seed orbit at t0 to the seed orbit at t0 if and only if the principal parts of B̃(t0 ) and B̃(t0 ) agree, and the row span of B̃(t0 ) contains the row span of B̃(t0 ). By the unimodularity of mutation, this criterion is preserved under swapping the roles of t0 and t0 – if the row span of B̃(t0 ) contains the row span of B̃(t0 ) then in fact the two row spans are equal submodules of Zn .  Remark 6.5. Marsh and Scott [24] described a version of the twist for the Grassmannian cluster algebras. One can show that it is a quasi-automorphism using [24, Corollary 8.6]. We will now recall the definitions of some preexisting groups of automorphisms associated a seed pattern E. Namely: 20 CHRIS FRASER ● the cluster modular group CMG(E) of Fock and Goncharov [9], and ● the group Aut(E) of automorphisms in the category of (rooted) cluster algebras defined by Assem, Dupont and Schiffler [1]. We first present these definitions and then discuss a particular example where all the groups are computed and compared to each other and to the quasi-automorphism group. Definition 6.6 (Cluster modular group [9, Definition 2.14]). Let E be a seed pattern with exchange graph E. The cluster modular group CMG(E) is the group of graph automorphisms g ∈ Aut(E) that preserve the exchange matrices. More precisely, recall that the unlabeled seed at vertex t ∈ E is indexed not by [1, n] but by the elements of star(t). Then an element of the cluster modular group is a graph automorphism g ∈ Aut(E) satisfying B(t)t′ ,t′′ = B(g(t))g(t′ ),g(t′′ ) for all t ∈ E and t′ , t′′ ∈ star(t). Such a graph automorphism can be determined by choosing a pair of vertices t0 , t0 ∈ E and an identification of star(t0 ) with star(t0 ) under which B(t0 ) = B(t0 ). Remark 6.7. Because Definition 6.6 is in terms of automorphisms of the exchange graph, the cluster modular group appears to depend on the entire seed pattern E, and not just the underlying exchange matrices in E. However, it is widely believed that the exchange graph – and therefore the cluster modular group – is in fact independent of the choice of coefficients (i.e., it only depends on the exchange matrices, and therefore can be prescribed by giving a single such matrix). This has been proven for skew-symmetric exchange matrices [23]. The quasi-automorphism group is a subgroup of the cluster modular group. Indeed, each quasi-automorphism Ψ determines a cluster modular group element g via Ψ(Σ(t)) ∼ Ψ(g(t)), and proportional quasi-automorphisms determine the same g. Since Ψ preserves exchange matrices and evaluating Ψ commutes with permuting the cluster variables in a seed, the element g produced this way is indeed an element of the cluster modular group. One can also consider automorphisms in the category of cluster algebras defined in [1]. We reproduce a version of the definition for the sake of convenience. Definition 6.8. Let E be a seed pattern. We say two seeds Σ1 and Σ2 in E are similar if Σ2 coincides with Σ1 after first permuting the frozen variables, and then permuting the indices [1, n] appropriately. Suppose the exchange matrices in E are indecomposable. Let A be its cluster algebra. A Z-algebra map f ∶ A → A is an automorphism of E if for every (equivalently, for any) seed Σ in E, f (Σ) or f (Σ)opp is similar to a seed in E. We denote the group of automorphisms of E by Aut(E). The elements of Aut(E) are similar to strong isomorphisms from [16] but slightly more general since one is allowed to permute the frozen variables. We say f as in Definition 6.8 is a direct automorphism or inverse automorphism according to whether f (Σ) or f (Σ)opp is a seed in E. Let Aut+ (E) ⊂ Aut(E) denote the subgroup of direct automorphisms. By similar reasoning to [2, Theorem 2.11], this subgroup has index two in Aut(E) if each seed Σ in E is mutation-equivalent to Σopp ; otherwise Aut+ (E) = Aut(E). An important special case of Definition 6.8 is when E has trivial coefficients in which case the group Aut(E) is the group of cluster automorphisms [2]. When E has trivial QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 21 coefficients, we have Aut+ (E) = CMG(E). Furthermore, a direct cluster automorphism is the same as a quasi-automorphism in this case. We can summarize the containments between the preceding groups as (6.1) Aut+ (E) ⊂ QAut0 (E) ⊂ CMG(E) = Aut+ (Etriv ). ? where E is a seed pattern and Etriv is the seed pattern obtained from E by trivializing its ? coefficients. The equality CMG(E) = Aut+ (Etriv ) depends on the belief that CMG(E) = CMG(Etriv ), cf. Remark 6.3. The group Aut(Etriv ) contains all of the groups in (6.1), and the group Aut(E) doesn’t sit nicely with the rest of the containments when Aut+ (E) ⊊ Aut(E). We next illustrate the differences between the groups in (6.1) using a particular cluster algebra associated with a bordered marked surface. Basic notions and references concerning this class of cluster algebras are given in Section 7. Example 6.9. Let (S, M) be an annulus with two marked points on each boundary component cf. Figure 4. We have colored the marked points either black or white to aid in describing the automorphism groups below. v1 v2 v3 v4 v1 ∧ v3 v4 ∧ v2 v3 v∨4 Figure 4. An annulus with two marked points on each boundary component. At right, we show a “flat form” of this annulus obtained by cutting along the dashed line. The cluster modular group CMG(S, M) for a cluster algebra associated with this annulus coincides with the mapping class group of the annulus (see Proposition 7.2 below). This group has the following explicit description: let ρ be the (isotopy class of) the homeomorphism of S that rotates the inner boundary of the annulus clockwise by a half-turn. Let τ be the clockwise half-turn of the outer boundary. Let σ be the homeomorphism represented by a 180 degree turn of the flat form of the annulus; it swaps the inner and outer boundary components. Then the elements ρ, τ, and σ generate the cluster modular group. The group has a presentation CMG(S, M) = ⟨ρ, τ, σ∶ (ρτ )2 = σ 2 = 1, ρτ = τ ρ, σρ = τ σ⟩ with respect to these generators. It is a central extension 1 ↦ Z/2Z ↦ CMG ↦ Dih∞ ↦ 1 of the infinite dihedral group Dih∞ = ⟨r, s∶ s2 = (sr)2 = 1⟩ by Z/2Z = ⟨ρτ ⟩, using the map σ ↦ s, ρ ↦ r, τ ↦ r −1 . Figure 5 gives a choice of lamination L and triangulation T , as well as the quivers B̃(T ), B̃(ρ(T )) and B̃(ρ2 (T )). Let A be the corresponding cluster algebra with frozen variable xL , E its seed pattern, and F>0 its ambient semifield. The cluster modular group element σρτ permutes the arcs in T . It induces an automorphism of the quiver B̃(T ), and therefore an element of Aut(E). 22 CHRIS FRASER T a c L xd B̃(T ) B̃(ρ(T )) B̃(ρ2 (T )) xb xd xf xL xc xf xL xe xh xL xg d b xa xc xe Figure 5. A lamination L consisting of two copies of the same curve on the annulus, determining a single frozen variable xL . We have also drawn a triangulation T of this annulus by the arcs a, b, c, d. The quivers B̃(T ), B̃(ρ(T )), and B̃(ρ2 (T )) are shown at right, where the extra arcs are e = ρ2 (a), f = ρ2 (b), g = ρ2 (c), h = ρ2 (d). The values of ŷ in each quiver are read off as the Laurent monomial “incoming variables divided by outgoing variables.” The quivers B̃(T ) and B̃(ρ2 (T )) are neither isomorphic nor opposite, so there is no strong automorphism sending the seed at T to the seed at ρ2 (T ). Likewise, there is no strong automorphism between T and ρ±4 (T ), ρ±6 (T ), ρ±8 (T ), and so on. However, there is a quasi-automorphism relating these seeds, which we describe now. It is the semifield map Ψ∶ F>0 → F>0 defined by Ψ(xL ) = xL as well as Ψ(xγ ) = x−1 L ⋅ xρ2 (γ) for γ = a, b, c, d. It sends each ŷ for Σ(T ) to the corresponding ŷ for Σ(ρ2 ⋅T ), defining a quasi-automorphism of E whose map on seed orbits is ρ2 . It has a simple global description on cluster variables which can be checked inductively by performing appropriate mutations away from T . Namely, for each arc γ let ι(γ, L) denote the number of times γ crosses the two curves in L. For example, ι(a, L) = 0 and ι(c, L) = 1. Then (6.2) Ψ(xγ ) = xL ι(γ,L)−ι(ρ2 (γ),L) ⋅ xρ2 (γ) for all arcs γ in the annulus. The power of xL on the right hand side of (6.2) is always equal to 0, 1, or −1. It is also simple to describe quasi-automorphisms realizing σ and ρτ . Perhaps surprisingly, the seeds at T and ρ(T ) are not related by a quasi-automorphism. Indeed, the values of ŷ are equal at the top and bottom vertices of B̃(T ) in Figure 5, but they are not equal in B̃(ρ(T )). The same holds for T and τ (T ). Putting all of this together, there is only one nontrivial strong automorphism of E, namely the element σρτ . On the other hand, the quasi-automorphism group is infinite, generated by ρ2 , σ and ρτ . It is a direct product Dih∞ ×Z/2Z. It is an index two subgroup of CMG(S, M), namely the kernel of the map CMG ↠ Z/2Z that computes the parity of the number of black marked points sent to a white marked point. Example 6.9 suggests that although the cluster modular group CMG(E) may be strictly larger than the quasi-automorphism group QAut0 (E), the gap between these groups is not so large. Indeed, Section 7 establishes that for seed patterns associated with surfaces, QAut0 (E) is always a finite index subgroup of the cluster modular group. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 23 7. Quasi-automorphisms of cluster algebras from surfaces In this section we place Example 6.9 in context via results valid for any cluster algebra associated to a marked bordered surface as in [10, 12, 13, 20]. We describe quasiautomorphisms of these cluster algebras in terms of the tagged mapping class group of the marked surface. We follow the setup and notation in [13]. Let A(S, M, L) denote the cluster algebra of geometric type determined by the triple (S, M, L). Here S is an oriented bordered surface with a nonempty set M of marked points. The marked points reside either in the interior of S (we call these punctures) or in ∂S (we call these cilia). The set of punctures is M. We disallow a few possibilities for (S, M), namely a sphere with three or fewer punctures, an n-gon when n < 4, and a once-punctured monogon. The choice of coefficients is specified by a multi-lamination L = (L1 , . . . , Lm ), an m-tuple of (integral unbounded measured) laminations on (S, M). Each lamination Li consists of a finite number of curves in (S, M). The cluster variables in A(S, M) are indexed by tagged arcs γ, the set of which we denote by A⋈ (S, M). The seeds in A(S, M, L) are indexed by tagged triangulations T of (S, M). The extended exchange matrix B̃(T ) for a seed has the signed adjacency matrix B(T ) as its principal part, and has the shear coordinate vector ⃗b(T, Li ) of the lamination Li with respect to T as its ith row of coefficients. The exchange graph of the resulting cluster algebra is independent of the choice of coefficients [13, Corollary 6.2]. We let CMG(S, M) denote the corresponding cluster modular group. It is closely related to the following geometrically defined group. Definition 7.1 (Tagged mapping class group [2]). Let (S, M) be a bordered marked surface that is not a closed surface with exactly one puncture. A tagged mapping class for (S, M) is a pair g = (f, ψ), where ● f is an element of the mapping class group of (S, M) – i.e. f is an orientiationpreserving homeomorphism of S mapping M to itself setwise, considered up to isotopies of S that fix M pointwise, and ● ψ∶ M → {±1} is a function from the set of punctures to {±1}. When (S, M) is a closed surface with one puncture p, we make the same definition but impose ψ(p) = 1 since tagged versions of arcs are not in the cluster algebra. The tagged mapping classes comprise the tagged mapping class group, denoted MG⋈ (S, M). We understand MG⋈ (S, M) by its action on tagged arcs γ ∈ A⋈ (S, M). A tagged mapping class g = (f, ψ) acts on γ by first performing the homeomorphism f to γ, and then changing the tag of any end of γ incident to a puncture p for which ψ(p) = −1. The resulting action on tagged triangulations preserves the signed adjacency matrices, and embeds MG⋈ (S, M) as a subgroup of CMG(S, M), cf. [2]. In fact the following is true: Proposition 7.2 (Bridgeland-Smith). The tagged mapping class group MG⋈ (S, M) coincides with the cluster modular group CMG(S, M), unless (S, M) is a sphere with four punctures, a once-punctured square, or a digon with one or two punctures. Thus barring these exceptional cases, two tagged triangulations of (S, M) have isomorphic quivers precisely when they are related by an element of the tagged mapping class group (see [4, Proposition 8.5] and the subsequent discussion; see also [2, Conjecture 1]). 24 CHRIS FRASER In the exceptional cases listed in Proposition 7.2, the tagged mapping class group is a proper finite index subgroup of the cluster modular group. Motivated by Proposition 7.2, we set out to describe, for various choices of coefficients L, the quasi-automorphism group QAut0 (S, M, L) from Definition 6.2 as a subgroup of the tagged mapping class group. The main ingredient in our answer is a black-white coloring similar to one in the examples from Section 6. Definition 7.3. The even components of (S, M) are the punctures C ∈ M as well the as boundary components C ⊂ ∂S having an even number of cilia. We let r denote the number of even components, and label the even components C1 , . . . , Cr . For each even boundary component C ⊂ ∂S, we color the cilia on C black or white so that the colors alternate, i.e. adjacent cilia have opposite colors. Using the black-white coloring in Definition 7.3, each tagged mapping class g = (f, ψ) determines an r × r signed permutation matrix πg whose entries are indexed by the even components. The (i, j) entry of πg is 0 unless f (Ci ) = Cj . If Cj ⊂ ∂S is a boundary component and f (Ci ) = Cj , then the (i, j) entry is +1 if f sends black cilia on Ci to black cilia on Cj , and is −1 if f sends black cilia on Ci to white cilia on Cj . When Ci and Cj are punctures, the sign of the (i, j) entry is the sign ψ(Cj ). Not all signed permutation matrices will arise in this way since f can only permute components that have the same number of cilia. Definition 7.4. Let L be a lamination. For each curve α in L, Figure 6 shows how to assign a sign to an end of α that either lands on even boundary component or spirals around a puncture. At a puncture, the sign is chosen according to whether α spirals counterclockwise or clockwise into the puncture. At a boundary component, the sign is chosen according to whether the nearest neighboring cilium in the clockwise direction along C is black or white. An end on an odd component has zero sign. The pairing p(L; C) of a lamination L with the even component C is the sum of all the signs associated to L, i.e. the sum over all curves α in L of the signs of the two ends of α. We let p⃗(L) = (p(L; Ci ))i=1,...,r ∈ Zr denote the vector of pairings of L with the even components. Example 7.8 works out these signs for the annulus from Example 6.9. +1 -1 ● +1 ● -1 Figure 6. The conventions for assigning signs to each end of a curve that lands on an even boundary component (in this case, a boundary component with 4 cilia) or spirals around a puncture. The pairing p(L, C) is obtained by adding up all of these signs. In addition to acting on tagged arcs, MG⋈ (S, M) also acts on laminations L. A tagged mapping class g = (f, ψ) acts by first performing the homeomorphism f to L, and then changing the direction of spiral at each puncture p for which ψ(p) = −1. This action preserves sheard coordinates in the sense that ⃗b(T, L) = ⃗b(g(T ), g(L)) for a triangulation QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 25 T and lamination L. It is easy to see that g acts on the vector of pairings by the matrix πg , i.e. p⃗(g(L)) = πg ⋅ p⃗(L) for a lamination L. The next theorem is the main result of this section, describing QAut(S, M, L) inside the marked mapping class group in very concrete terms. Theorem 7.5. Suppose (S, M) is not one of the four exceptional surfaces in Proposition 7.2. Let L be a multi-lamination. Let VL = span({⃗ p(L)∶ L ∈ L}) ⊂ Zr be the submodule spanned by the vectors of pairings associated to the laminations L in L. Then (7.1) QAut0 (S, M, L) = {g ∈ MG⋈ (S, M)∶ πg (VL ) = VL }. We prove Theorem 7.5 in Section 8. The subgroup of MG⋈ (S, M) described in (7.1) only depends on the endpoint behavior of laminations – it doesn’t mention the topology of the surface, or how much curves wrap around the holes and handles of the surface. The map g ↦ πg is a group homomorphism from MG⋈ (S, M) to the group of signed permutation matrices. The subgroup in (7.1) is an inverse image of the subgroup of signed permutation matrices that fix VL and therefore is always finite index in MG⋈ (S, M). Corollary 7.6. Let g be a tagged mapping class. If πg is plus or minus the identity matrix, then g ∈ QAut0 (S, M, L) for any choice of multi-lamination L. Otherwise, g ∉ QAut0 (S, M, L) for some choice of L. Remark 7.7. The tagged mapping classes in Corollary 7.6 are those that fix all even components setwise, and furthermore either preserve the black-white coloring of ends of curves, or simultaneously swap all colors. This group is generated by the following four types of elements (see [8] for generators of the mapping class group): Dehn twists about simple closed curves, homeomorphisms that permute odd components, fractional Dehn twists rotating the cilia on a given boundary component by two units, and the tagged rotation. This last element is the one that simultaneously changes tags at all punctures and rotates all boundary components by one unit. It was studied in [5], where it was shown to coincide with the shift functor of a 2-Calabi-Yau cluster category associated with the surface. Proof. If πg = ±1, then πg clearly preserves VL regardless of the choice of L and by Theorem 7.5 g is in QAut0 (S, M, L) for any L. If πg ≠ ±1, think of πg as a signed permutation σ of {±1, . . . , ±r} in the usual way. If there is any index i ∈ [1, r] such that σ(i) ≠ ±i, then let L be a lamination consisting of a curve with two black ends on Ci , satisfying p(L; C) = 2. If there is no such index i, we can choose a pair of indices i, j ∈ [1, r] such that σ(i) = −i but σ(j) = j. In this case we let L be a lamination consisting of a curve connecting the even components Ci and Cj by a curve that is black at both ends. In both of these two cases, we see that πg (⃗ p(L)) is not in the span of p⃗(L) and by Theorem 7.5, g ∉ QAut0 (S, M, L).  Example 7.8. We order the boundary components in Figure 5 so that the inner boundary is first. The vector of pairings for the lamination L in Figure 5 is p⃗(L) = (−2, −2). Then ρ and τ act on the vector of parings by swapping the sign of the first or second component respectively, and σ acts by permuting the first and second component. The description of QAut0 (S, M, L) in Example 6.9 matches the one in Theorem 7.5. The subgroup of elements described in Corollary 7.6 is a a direct product Z × Z/2Z generated by ρ2 and ρτ . It has index 4 in the cluster modular group. 26 CHRIS FRASER Remark 7.9. Theorem 7.5 can be modified in the case that (S, M) is one of the exceptional surfaces in Proposition 7.2. Namely, the left hand side of (7.1) merely describes the subgroup of QAut0 (S, M, L) consisting of tagged mapping classes (that is, ignoring the exotic symmetries). For particular choices of coefficients, the “extra” elements of the cluster modular group might also be inside QAut0 . 8. Proofs for Section 7 The key result of this section is Proposition 8.4 describing quasi-homomorphisms of cluster algebras from surfaces. Theorem 7.5 follows from it as a special case. Let B(S, M) denote the set of boundary segments connecting adjacent cilia in ∂S. There is an especially natural choice of multi-lamination Lboundary = (Lβ )β∈B(S,M) with one frozen variable for each boundary segment (see e.g. in [13, Remark 15.8]). Lemma 8.1 expresses the shear coordinates of certain laminations in terms of the extended exchange matrix determined by Lboundary . It is patterned after [13, Lemma 14.3]. Lemma 8.1. Let L be a lamination none of whose curves has an end that spirals at a puncture. Given an arc γ the transverse measure of γ in L is the minimal number of intersections of γ with the curves in L. We denote it by l(γ, L). For a boundary segment β ∈ B(S, M), we similarly let l(β, L) denote the number of ends of the curves in L on β. We let ⃗l(T, L) = (l(⋆, L))⋆∈T ∪B(S,M) be the row vector containing all of these transverse measures. Then (8.1) − 2⃗b(T, L) = ⃗l(T, L)B̃(T, Lboundary ). Proof. We check that the γ0 components of the left and right hand sides of (8.1) are equal, where γ0 ∈ T . Let γ1 , . . . , γ4 be the quadrilateral containing γ0 (number in clockwise order). Some of the γi may be boundary segments. Each time α shears across the quadrilateral in an ‘S’ crossing, it contributes +1 to the left hand side, while contributing − 21 (−1 + −1) to the right hand side. And so on.  This argument is like [13, Lemma 14.13] but simpler because our we are not dealing with spirals at the puncture, for which l(T, L) = ∞. Comparing (8.1) with (4.8), we see that if L is any multi-lamination none of whose curves spiral at punctures, then there is a quasi-homomorphism from A(S, M, Lboundary ) to A(S, M, L). A version of Lemma 8.1 allowing for spirals at punctures would involve the extended exchange matrix B̃(T , L) on the fully opened surface (S, M), where L and T are lifts of L and T to the opened surface (see [13, Sections 9,14] for details). The corresponding version of (8.1) determines a quasi-homomorphism from A(S, M, L) to A(S, M, L). Our next step is to to describe the row span of the signed adjacency matrices B(T ). It strengthens [12, Theorem 14.3] which states that the corank of B(T ) is the number of even components. The description requires associating a sign to the ends of arcs γ ∈ A⋈ (S, M), in a similar fashion as was done for the ends of curves in Definition 7.4. Namely if γ has an endpoint on a boundary component C ⊂ ∂S, the endpoint gets sign ±1 if its endpoint is a black or white cilium respectively. If the endpoint is on a puncture C ∈ M , the sign is ±1 if the end is plain or tagged respectively. An endpoint on an odd component gets sign 0. The pairing p(γ; C) of γ with C is the sum of the signs of the ends of γ that reside on C, and the vector of pairings is p⃗(γ) = (p(γ; Ci ))i=1,...,r . This pairing satisfies p(γ; C) = p(Lγ ; C) QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 27 where Lγ is the elementary lamination determined by γ (cf. [13, Definition 17.2], see also [27, Section 5]). Lemma 8.2. For a tagged triangulation T , let Q(T ) = Q(γ∶ γ ∈ T ) be Q-vector space of row vectors with entries indexed by γ ∈ T . Let Q(T )∗ = Q(γ ∗ ∶ γ ∈ T ) be the dual space of column vectors with entries indexed by the dual basis {γ ∗ ∶ γ ∈ T }. For each even component C, consider the column vector (8.2) RC = ∑ p(γ; C)γ ∗ ∈ Q(T )∗ . γ∈T Then a vector a ⃗ ∈ Q(T ) is in the the row span of B(T ) if and only if the dot product a ⃗ ⋅ RC vanishes for all C. Said differently, the map γ ↦ (γ, Ci ) for Ci an even component determines a Z-grading on the coefficient-free cluster algebra A(S, M). These gradings form a standard Zr -grading as i varies from 1, . . . , r (a standard grading is one that spans the kernel of the B-matrices, see [21]). We will not rely on gradings in what follows. Lemma 8.2 is proved at the end of this section. For a vector a ⃗ ∈ Q(T ), the residue of a ⃗ around C in T is the dot product a⃗ ⋅ RC = ⃗ as the shear coordinate of a lamination L, the residue has the ∑γ∈T (γ, C)aγ . Writing a following simple description. Lemma 8.3. Let L be a lamination and C an even component. Then the residue of ⃗b(T, L) around C is the pairing p(L; C) from Definition 7.4. Proof. The residue is computed in terms of the shear coordinates of arcs adjacent to C. To compute these shear coordinates, rather than considering the entire surface, we can focus on the set of triangles having at least one vertex on C. Lifting to a finite cover of S perhaps (in order to remove interesting topology nearby C that is irrelevant to computing the residue) this union of triangles will either be a triangulated annulus (when C ⊂ ∂S is a boundary component) or a once-punctured n-gon for some n (if C is a puncture). We call this set of triangles the annnular neighborhood of C. Even when L consists of a single curve, the intersection of L with this annular neighborhood might consist of several curves. By the linearity of shear coordinates and residues, it suffices to consider the case that L consists of a single curve in the annular neighborhood. When C is a puncture, its annular neighborhood is a punctured disc with a triangulation all of whose arcs are radii joining the puncture to the boundary of the disc. By inspection, a curve L contributes nonzero residue at C if and only it spirals at C, and the value of this residue is ±1 according to whether it spirals counterclockwise or clockwise respectively as claimed. When C is a even boundary component, we compute the residue of ⃗b(T, L) using the right hand side of (8.1). We split up this right hand side into two terms by splitting up ⃗l(T, L) as a concatenation of (l(γ, L)γ∈T and (l(β, L)β∈∂S , and performing the matrix multiplication with B̃ in block form. The first term in this expression has zero residue around C since it is a linear combination of the rows of B(T ). What’s left over is a sum 1 (8.3) − p(γ; C)l(β, L)Bβ,γ . ∑ 2 γ∈T,β∈B(S,M) 28 CHRIS FRASER We claim the sum above evaluates to p(L; C). For the sum to be nonzero, L must have a nonzero end at some segment β = [vi−1 , vi ] with vi−1 , vi in clockwise order. This segment β is contained in a unique triangle in T . Call the other two sides in this triangle γi−1 and γi , whose endpoint on C is vi−1 and vi respectively. There are cases according to whether either of these sides is a boundary segment. If neither is, then p(γi−1 ; C)Bβ,γi−1 = p(γi ; C)Bβ,γi is ±1 according to whether vi is white or black. The total contribution to (8.3) is p(C; L). In the degenerate case that γi is a boundary segment, it does not contribute to (8.3), but p(γi−1 ; C) = 2 and this effect is cancelled out, and so on.  Proposition 8.4. Suppose (S, M) is not among the four listed exceptions in Proposition 7.2. Let L, L′ be multi-laminations on (S, M) and recall the submodules VL and VL′ from Theorem 7.5. Let g ∈ MG⋈ (S, M) be a tagged mapping class and πg the corresponding signed permutation matrix. The following are equivalent: ● there is a quasi-homomorphism Ψ from A(S, M, L) to A(S, M, L′ ) whose map on tagged triangulations is T ↦ g(T ) (that is, Ψ(Σ(T )) ∼ Σ(g(T ))), ● VL′ ⊂ πg (VL ). Proof of Proposition 8.4. A quasi-homomorphism Ψ from A(S, M, L) to A(S, M, L′ ) is determined by a pair of tagged triangulations T and T ′ , such that B̃(T, L) and B̃(T ′ , L′ ) are related as in (4.8). Since the principal parts of these matrices agree, by Proposition 7.2 there is a tagged mapping class g such that g(T ) = T ′ . Furthermore, for each lamination L′ ∈ L′ , the vector ⃗b(T ′ , L′ ) must be in span({⃗b(T, L)∶ L ∈ L}). Since ⃗b(T ′ , L′ ) = ⃗b(T, g −1 (L′ )), by Lemma 8.2, it is equivalent to find a linear combination of ⃗b(T, g −1 (L′ )) and {⃗b(T, L)∶ L ∈ L} that has zero residue around every even component. Proposition 8.4 follows now from Lemma (8.3) and the fact that g acts on a vector of pairings by the matrix πg .  Proof of Lemma 8.2. Restating the Lemma, we seek to show that the RC form a basis for the dual space to the row span.We begin by verifying each of these vectors pair to zero with the row span. First, we check this when C is a puncture. We begin with the case that all of the arcs in T are untagged at C. We need to check that ∑γ∈T p(γ; C)B(T )γ ′ ,γ vanishes for each γ ′ ∈ T . Indeed, letting L be the lamination consisting of a tiny simple closed curve contractible to C, the shear coordinate vector ⃗b(T, L) is clearly 0. Now we apply (8.1) for this choice of L: the γ ′th component of (8.1) says 0 = ∑γ∈T p(γ; C)B(T )γ,γ ′ as desired, using the fact that l(γ, L) = 0 if γ is a boundary segment. The argument when all arcs are tagged at C is identical. If C is incident to exactly two arcs, namely the plain and tagged version of the same arc, then RC follows from [12, Definition 9.6] (or a calculation in a once-punctured digon). Second we check this when C ⊂ ∂S is a boundary component. Number the cilia on C by v1 , . . . , v2m . For each i ∈ [1, 2m], let Li be a tiny lamination contractible to vi – its two endpoints are on the two boundary segments adjacent to vi . Again, ⃗b(T, Li ) is clearly 0 and in particular ∑vi black ⃗b(T, Li ) = ∑vi white ⃗b(T, Li ). Summing over the corresponding right hand sides of (8.1), again performing the matrix multiplication in (8.1) in block form as in the argument for Lemma 8.3, the terms corresponding to boundary segments are present in both the sum over black vi and the sum over white vi . Canceling these common QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 29 terms, we get the equality ∑vi black, γ ∈ T l(γ, Li )B(T )γ,γ ′ = ∑vi white l(γ, Li )B(T )γ,γ ′ for all γ ′ , which says ∑γ∈T p(γ, C)B(T )γ,γ ′ = 0 for all γ ′ as desired. Thus all of the RC pair to zero with the row span of B(T ). We will now show that they are linearly independent, which completes the proof since they have the expected size by [12, Theorem 14.3]. Consider a linear relation of the form (8.4) ∑ aC RC = 0. We define scalars av for all marked points v ∈ M as follows: if v is a puncture C, then bv = aC . If v is a cilium residing on an even component C, then bv = ±aC , with ± sign consistent with the black-white coloring on C. If v is cilium on an odd component, we set av = 0. Now consider any vertices v1 , v2 forming an edge in the triangulation T . We claim (8.5) av1 + av2 = 0. Indeed, if v1 , v2 are the endpoints of an arc γ ∈ T , the γ th component of the relation (8.4) is av1 + av2 by construction, and (8.5) holds. If they are the endpoints of a boundary segment, then (8.5) clearly holds. However, in any given triangle in T with vertices v1 , v2 , v2 , the only way for (8.5) to hold for all 3 of the pairs (v1 , v2 ), (v1 , v3 ), (v2 , v3 ) is if av1 = av2 = av3 = 0. Varying the vertex and triangle containing it, this establishes that all av = 0 for all v ∈ M, and hence all aC = 0, as desired.  9. Appendix: The starfish lemma on a nerve We give the appropriate generalization of the Starfish Lemma [11, Proposition 3.6] from a star neighborhood to a nerve. Our proof follows the proof of the Starfish Lemma in [14], with appropriate modifications. Let R be a domain. We say two elements r, r ′ ∈ R are coprime if they are not contained in the same prime ideal of height 1. When R is a unique factorization domain, every pair of non-associate irreducible elements are coprime. Proposition 9.1. Let N be a nerve in Tn . Let R be a C-algebra and a Noetherian normal domain. Let E be a seed pattern of geometric type, satisfying the following: ● all frozen variables are in R ● for each vertex t ∈ N , the cluster x(t) ⊂ R, and the cluster variables x ∈ x(t) are pairwise coprime elements of R; k ● for each edge t Ð → t′ in N , the cluster variables xk (t) and xk (t′ ) are pairwise coprime. Then the cluster algebra A defined by E satisfies A ⊂ R. The proof relies on the following two lemmas, the first of which is a standard fact from commutative algebra. For a prime ideal P , let RP = R[(R/P )−1 ] denote the localization of R away from P . Lemma 9.2 ([25, Theorem 11.5]). For a normal Noetherian domain R, the natural inclusion R ⊂ ∩ht P = 1 RP (intersection over height one primes) is an equality. 30 CHRIS FRASER Lemma 9.3. With hypotheses as in Proposition 9.1, let P be a height one prime ideal in R. Then at least one of the products (9.1) ∏ x x∈x(t),t∈N is not in P . Proof. By the coprimeness in each cluster t ∈ N , at most one of the cluster variables x in a product (9.1) satisfies x ∈ P . We will show that for at least one t, none of the cluster variables is in P , establishing our claim since P is prime. Pick any vertex t0 ∈ N , and j suppose the cluster variable xi ∈ P . Given an edge t0 Ð → t′0 ⊂ N where j ≠ i, the cluster variable xj (t′0 ) ∉ P by the coprimality assumption in the cluster at t′0 . Repeatedly applying this assumption while mutating along the nerve, using the connectedness hypothesis and the fact that every edge label shows up in the nerve, we finally arrive at a vertex t ∈ N i such that the edge t Ð → t′ ⊂ N , and all of the extended cluster variables xj ∈ x̃(t) with j ≠ i are not in P . By the coprimeness assumption along edge i, we see xi (t′ ) ∉ P , and the cluster at t′ is one where the product (9.1) is not in P .  Proof of Proposition 9.1. We need to prove each cluster variable z is in R. By Lemma 9.2, it suffices to show z ∈ RP for any height one prime P . Indeed, by Lemma 9.3 there is a cluster t ∈ N such that ∏x∈x(t) x ∉ P . By the Laurent Phenomenon, z is a Laurent polynomial in the elements of x(t), with coefficients in C[xn+1 , . . . , xn+m ]. In particular, z ∈ RP , as desired.  10. Appendix: Grassmannians and Band Matrices As an illustration of Proposition 4.3, we extend the constructions in Example 3.4 and Example 3.8 from the case (k, n) = (2, 5) to general (k, n). Let (10.1) X = Ĝr(n − k, n) (10.2) Y ≅ C(n−k)(k+1) be the affine cone over the Grassmannian of (n − k)-dimensional subspaces of Cn . Its points are the decomposable tensors in Λn−k Cn . Let be the affine space of (n − k) × n band matrices of width k + 1, i.e. the set of matrices Y whose entries yi,j are zero unless i ≤ j ≤ i + k. We will describe a quasi-isomorphism of the coordinate rings C[X] and C[Y], and in particular a cluster structure on C[Y] which appears to be new. The coordinate ring C[X] is the ring generated by the Plücker coordinates ∆S as S ranges over (n − k)-subsets of n. It has a cluster structure of geometric type cf. [28] in which the frozen variables are those Plücker coordinates consisting of cyclically consecutive columns. The non-frozen Plücker coordinates are all cluster variables. We will introduce a useful sign convention: if S is any set of (n − k) natural numbers, we let ∆S denote the Plücker coordinate obtained by first reducing all the elements of S to their least positive residue modulo n, sorting these residues, and then taking the corresponding Plücker coordinate. If there are fewer than (n − k) distinct elements in S modulo n, then ∆S is identically zero. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 31 The coordinate ring C[Y] contains minors YI,J for I ⊂ [1, n − k], J ⊂ [1, n] subsets of the same size denoting row and column indices respectively. It is a polynomial ring in the coordinate functions Yi,j , 1 ≤ i ≤ j ≤ i + k ≤ n. The following elements will serve as frozen variables in C[Y]: (10.3) Y1,1 , Y2,2 , . . . , Yn−k,n−k and Y1,k+1 , Y2,k+1 , . . . , Yn−k,n , and (10.4) Y[1,n−k],[2,n−k+1] , Y[1,n−k],[3,n−k+2] , . . . , Y[1,n−k],[k,n−1] ; we let P denote the corresponding tropical semifield in these frozen variables. Just as in Example 3.4, there is a morphism of varieties F ∶ Y → X sending Y ∈ Y to the decomposable tensor Y [1] ∧ ⋯ ∧ Y [n − k] ∈ X, where the Y [i] are the rows of Y . The map on coordinate rings is (10.5) F ∗ ∶ C[X] → C[Y], defined by F ∗ (∆S ) = Y[1,n−k],S . Letting ∆S be any non-frozen Plücker coordinate, one sees that (10.6) F ∗ (∆S ) = c(S) ⋅ YI(S),J(S) where c(S) ∈ P and YI(S),J(S) is a non-frozen irreducible row-solid minor in C[Y]. The map ∆S ↦ YI(S),J(S) is a bijection between the non-frozen Plücker coordinates in C[X] and the non-frozen irreducible row-solid minors in C[Y]. Just as in Example 3.8, there is a morphism of varieties G∶ X → Y sending X ∈ X to the band matrix whose whose (i, j) entry is a certain Plücker coordinate evaluated on X: (10.7) G(X)i,j = ∆[i+k+1,n+i−1]∪j (X). Since the Plücker coordinate on the right hand side of (10.7) is only nonzero when unless i ≤ j ≤ i + k, G(X) is indeed a point in Y. The map on coordinate rings is (10.8) G∗ (Yi,j ) = ∆[i+k+1,n+i−1]∪j . Theorem 10.1. Let X and Y be the varieties in (10.1) and (10.2). Let F >0 be the semfield of subtraction-free expressions in the Yi,j . Abusing notation, let F ∗ ∶ F>0 → F >0 be the semfield map determined by the map F ∗ from (10.5), and let G∗ ∶ F >0 → F>0 be the map determined by (10.8). Then C[Y] is a cluster algebra of geometric type, and the maps F ∗ and G∗ are quasi-inverses. All of the irreducible row-solid minors in C[Y] are cluster or frozen variables. Proof. The proof relies on the following well-known properties of the cluster structure on C[X]: (1) There exist clusters in C[X] consisting entirely of Plücker coordinates (called Plücker clusters). Every non-frozen Plücker coordinate shows up in at least one of these clusters. (2) The set of Plücker clusters are connected to one another by mutations whose exchange relations are short Plücker relations, of the form ∆S∪ik ∆Sjℓ = ∆Sij ∆Skℓ + ∆Sjk ∆Siℓ , for i < j < k < l and Sij denotes the union S ∪ {i, j}). (3) For certain Plücker clusters, every neighboring cluster is again a Plücker cluster. The first two of these facts are consequences of the technology of plabic graphs and square moves, the third fact follows by considering a particular explicit Plücker seed for the Grassmannian (one whose quiver is a “grid quiver”). 32 CHRIS FRASER We can now state Theorem 3.4 more carefully. Let Σ be any Plücker cluster in C[X]. For each Plücker coordinate xi ∈ Σ, let xi be the irreducible row-solid minor in C[Y] related to xi as in (10.6). We will see below that {xi ∶ xi ∈ Σ} are algebraically independent generators for F >0 over P. Assuming this has been proved, applying the construction in Proposition 4.3, we obtain a semifield map cΣ ∶ F>0 → P and a normalized seed F ∗ (Σ) ∗ (x ) i whose cluster variables are xi = FcΣ (x as in (4.5). The semifield map cΣ satisfies cΣ (∆S ) = i) c(S) for all S ∈ Σ, where c(S) is defined by (10.6). The key claim is that in fact cΣ (∆S ) = c(S) holds for all ∆S , and therefore the semifield map cΣ does not depend on Σ. From this key claim, it follows that the seeds F ∗ (Σ) are all related to each other by mutation using Proposition 4.3. Furthermore, every non-frozen irreducible row-solid minor is a cluster variable in E by (4.5). Since this includes all of the Yi,j , this shows that the F ∗ (Σ) are indeed seeds – each seed has the expected size necessary to form a transcendence basis for C(Y), the seeds are all related to each other by mutation, and their union clearly contains a generating set for the field of fractions. The cluster algebra for the resulting seed pattern clearly contains C[Y]. The opposite containment follows from the Algebraic Hartogs’ argument on a starfish cf. Section 9, using Fact (3) above. Thus it remains to check the key claim that cΣ (∆S ) = c(S) for all non-frozen S. By Fact (2), it suffices to check that c preserves the short Plücker relations, i.e. (10.9) c(Sik)c(Sjℓ) = c(Sij)c(Skℓ) ⊕ c(Sjk)c(Siℓ). Verifying (10.9) is a direct piecewise check: the exponent of Ya,a in the left hand side of (10.9) is 0, 1, 2 according to whether neither, one of, or both of Sik and Sjℓ contain the interval [1, a]. Performing the similar computation for Sij and Skℓ, as well as Sjk and Siℓ, and taking the minimum of their respective answers, gives the exponent of Ya,a in the right hand side, and we claim these left and right hand exponents are always equal. This can be done by a case analysis: let E be the largest number such that [1, E] ⊂ Sijkl. If E < i, then both sides return a 2 if a ≤ E, and 0 otherwise. If i ≤ E < j, then both sides return a 2 if a < i, return a 1 if i ≤ a ≤ E, and return a 0 otherwise. If j ≤ E then both sides return a 2 if a < i, return a 1 if i ≤ a < j, and return a 0 otherwise. A similar calculation checks that the exponents of Ya,a+k match up in both sides of (10.9). Finally we check that G∗ is a quasi-inverse to F ∗ . By Lemma 3.7, we only need to see that G∗ preserves coefficients and that G∗ ○F ∗ is proportional to the identity. It suffices to check that G∗ ○ F ∗ (∆S ) ≍ ∆S for every ∆S . This follows from the determinantal identity Lemma 10.2 below, applied to G∗ ○ F ∗ (∆S ) = G∗ (Y[1,n−k],S ).  Lemma 10.2. Let I = [a, a + s − 1] be some consecutive subset of [n − k], and J a subset of [a, a + s − 1 + k] of size s. Then for X ∈ C[X], YI,J (G(X)) = ( ∏ ∆[i+k+1,n+i] (X)) ⋅ ∆[a+k+s,n+a−1]∪J (X) a+s−2 (10.10) i=a Notice that the first product on the right hand side of (10.10) is a monomial in the frozen Plücker coordinates. QUASI-HOMOMORPHISMS OF CLUSTER ALGEBRAS 33 Proof. Proceed by induction on s. It’s clear when s = 1. For s > 1, we will need a Plücker relation (10.11) ∆[a+k+1,n+a] (X)∆[a+k+s,n+a−1]∪J (X) = ∑(−1)ℓ+1 ∆[a+1+k,n+a−1]∪jℓ (X)∆[a+k+s,n+a]∪(J−jℓ ) (X), s ℓ=1 see e.g. [19, Section 9.1, Exercise 1]. Let J = {j1 , . . . , js } with j1 < j2 < ⋅ ⋅ ⋅ < js . Assuming (10.10) holds for smaller values of s, we expand along the first row to see YI,J (G(X)) = ∑(−1)ℓ+1 Ya,jℓ (G(X))Y(I−a),(J−jℓ ) (G(X)) s ℓ=1 s = ∑(−1)ℓ+1 ∆[a+k+1,n+a−1] (X)( ∏ ∆i+k+1,n+i (X)) ⋅ ∆[a+k+s,n+a]∪(J−jℓ ) ℓ=1 a+s−2 a+s−2 i=a+1 = ( ∏ ∆i+k+1,n+i (X)) ∑(−1)ℓ+1 ∆[a+1+k,n+a−1]∪jℓ (X)∆[a+k+s,n+a]∪(J−jℓ ) (X), i=a+1 s ℓ=1 and the result follows using (10.11).  Remark 10.3. In the case k = 2, our construction is the “motivating example” considerd by Yang and Zelevinsky [30]. They establish that the homogeneous coordinate ring of a certain SLn+1 -double Bruhat cell is a Dynkin type An cluster algebra with principal coefficients. The elements of this double Bruhat cell are (n + 1) × (n + 1) band matrices of width 3. Their example follows from ours by setting certain frozen variables equal to 1, and setting Y1,1 and Yn−k,n equal to 0 (this latter operation is permissible because both of these frozen variables are isolated vertices in the quivers for C[Y]). We also remark that it is already known that the Grassmannian cluster algebras are quasi-isomorphic to a polynomial ring, by a fairly uninteresting quasi-isomorphism. Indeed, we can realize the affine space of (n − k) × k matrices as the closed subvariety of Ĝr(n − k, n) defined by specializing the frozen variable ∆[1,n−k] to 1, and this specialization is a quasi-isomorphism. The resulting cluster structure on the polynomial ring is unrelated to the one we have given in this section. References [1] I. Assem, G. Dupont, R. Schiffler. On a category of cluster algebras. J. Pure Appl. Algebra 218 (2014), no. 3, 553–582. [2] I. Assem, R. Schiffler, V. Shramchenko. Cluster Automorphisms, Proc. Lond. Math. Soc. (3) 104 (2012), no. 6, 1271–1302. [3] A. Berenstein, S. Fomin, and A. Zelevinsky, Cluster algebras. III. Upper bounds and double Bruhat cells, Duke Math. J. 126 (2005), no. 1, 1–52. [4] T. Bridgeland, I. Smith, Quadratic differentials as stability conditions, Publ. Math. Inst. Hautes tudes Sci. 121 (2015), 155278. [5] T. Brüstle, Y. Qiu, Tagged mapping class groups: Auslander-Reiten translation, Math. Z. 279 (2015), no. 3-4, 1103–1120. [6] W. Chang, B. Zhu Cluster automorphism groups and automorphism groups of exchange graphs, arXiv:1506.02029. [7] W. Chang, B. Zhu Cluster automorphism groups of cluster algebras with coefficients, arXiv:1506.01950. [8] B. Farb and D. Margalit, A Primer on Mapping Class Groups, Princeton Mathematical Series, 49. Princeton University Press, Princeton, NJ, 2012. 34 CHRIS FRASER [9] V. Fock and A. Goncharov, Cluster ensembles, quantization and the dilogarithm, math.AG/0311245. Ann. Sci. Éc. Norm. Supér. (4) 42 (2009), no. 6, 86 [10] V. V. Fock and A. B. Goncharov, Moduli spaces of local systems and higher Teichmüller Theory, Publ. Math. Inst. Hautes. Etudes. Sci. no. 103 (2006) 1-211. [11] S. Fomin and P. Pylyavskyy, Tensor diagrams and cluster algebras,237 arXiv:1210.1888, to appear in Adv. in. Math. [12] S. Fomin, M. Shapiro, and D. Thurston, Cluster algebras and triangulated surfaces. Part I: Cluster complexes, Acta Math. 201 (2008), no. 1, 83–146. [13] S. Fomin and D. Thurston, Cluster algebras and triangulated surfaces. Part II: Lambda lengths, arXiv:1210.5569. [14] S. Fomin, L. Williams, and A. Zelevinsky, Introduction to cluster algebras, in preparation. [15] S. Fomin and A. Zelevinsky, Cluster algebras I: Foundations, J. Amer. Math. Soc. 15 (2002), no. 2, 497–529 [16] S. Fomin and A. Zelevinsky, Cluster algebras II: Finite type classification, Invent. Math. 154 (2003), no. 1, 63–121. [17] S. Fomin and A. Zelevinsky, Cluster algebras IV: Coefficients, Compos. Math. 143 (2007), no. 1, 112–164. [18] C. Fraser, in preparation. [19] W. Fulton, Young tableaux. With applications to representation theory and geometry. London Mathematical Society Student Texts, 35. Cambridge University Press, Cambridge, 1997. [20] M. Gehktman, M. Shapiro, and A. Vainshtein, Cluster algebras and Poisson geometry, Mosc. Math. J. 3 (2003), no. 3, 899-934. [21] J. E. Grabowski, Graded cluster algebras, (2013), arXiv:1309.6170. [22] J. E. Grabowski, S. Launois, Graded quantum cluster algebras and an application to quantum Grassmannians, Proc. Lond. Math. Soc. 109 (2014), no. 3, 697–732. [23] G. Cerulli Irelli, B. Keller, D. Labardini-Fragoso, P.–G. Plamondon, Linear independence of cluster monomials for skew-symmetric cluster algebras, Compos. Math. 149 (2013), no. 10, 1753–1764. [24] R. J. Marsh, J. Scott, Twists of Plücker coordinates as dimer partition functions, arXiv:1309.6630. [25] H. Matsumura, Commutative ring theory, second ed., vol. 8 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1989. Trans- lated from the Japanese by M. Reid. [26] N. Reading, Universal Geometric Cluster Algebras, Math. Z. 277 (2014), no. 1-2, 499–547. [27] N. Reading, Universal geometric cluster algebras from surfaces, Trans. Amer. Math. Soc. 366 (2014), no. 12, 6647–6685. [28] J. Scott, Grassmannians and cluster algebras, Proc. London Math. Soc. 92 (2006) 345-380. [29] P. Sherman, A. Zelevinsky, Positivity and canonical bases in rank 2 cluster algebras of finite and affine types Moscow Math. J. 4 (2004) 947-974. [30] S.W. Yang and A. Zelevinsky, Cluster algebras of finite type via Coxeter elements and principal minors, Transform. Groups 13 (2008) 855-895, Department of Mathematics, University of Michigan, Ann Arbor, MI, 48109, USA E-mail address: [email protected]
0math.AC
ENUMERATING GRADED IDEALS IN GRADED RINGS ASSOCIATED TO FREE NILPOTENT LIE RINGS arXiv:1606.04515v1 [math.RA] 14 Jun 2016 SEUNGJAI LEE AND CHRISTOPHER VOLL Abstract. We compute the zeta functions enumerating graded ideals in the graded Lie rings associated with the free d-generator Lie rings fc,d of nilpotency class c for all c ď 2 and for pc, dq P tp3, 3q, p3, 2q, p4, 2qu. We apply our computations to obtain information about p-adic, reduced, and topological zeta functions, in particular pertaining to their degrees and some special values. 1. Introduction 1.1. Enumerating graded ideals in graded Lie rings. Let R be the ring of integers of a number field or the completion of such a ring at a nonzero prime ideal. Let L be a nilpotent R-Lie algebra of nilpotency class c, free of finite rank over R, with lower central series pγi pLqqci“1 . For i P t1, . . . , cu, set Lpiq :“ γi pLq{γi`1 pLq. The associated À graded R-Lie algebra is grL “ ci“1 Lpiq . An R-ideal I of grL (of finite index in grL) is graded or homogeneous if it is generated by homogeneous elements or, equivalently, À if I “ ci“1 pI X Lpiq q. In this case we write I Ÿgr grL. We define the graded ideal zeta function of L as the Dirichlet generating series ÿ Ÿ |grL : I|´s , (1.1) ζL gr psq “ IŸgr grL enumerating graded ideals in grL of finite index in grL. Here s is a complex variable; Ÿ our assumptions on L guarantee that ζL gr psq converges on a complex half-plane. (For a similar definition in a slightly more general setting, see [11, Section 3.1]). Assume now that R “ O is the ring of integers of a number field. For a (nonzero) prime ideal p P SpecpOq we write Op for the completion of O at p, a complete discrete valuation ring of characteristic zero and residue field O{p of cardinality q, say. Primary decomposition yields the Euler product ź Ÿgr Ÿ psq, ζLpO ζL gr psq “ pq pPSpecpOq Ÿ ζL gr psq as an infinite product of “local”, or p-adic expressing the “global” zeta function ones. By slight abuse of notation we denote here by SpecpOq the set of nonzero prime ideals of O. Each individual Euler factor is a rational function in the parameter q ´s . In fact, (1.1) is an Euler product of cone integrals in the sense of [4] (cf. [11, Theorem 3.3]), and the far-reaching results of this paper – regarding both the factors and the product’s Date: June 15, 2016. 2000 Mathematics Subject Classification. 17B70, 11M41, 11S40. Key words and phrases. Graded ideal zeta functions, free nilpotent Lie rings, local functional equations. 2 SEUNGJAI LEE AND CHRISTOPHER VOLL analytic properties – apply. The fact that the analysis of [4] is restricted to the case R “ Z is insubstantial for this conclusion. 1.2. Main results. In the present paper we are concerned with graded ideal zeta functions of free nilpotent Lie rings of finite rank. Given c P N and d P Ně2 , let fc,d be the free nilpotent Lie ring of nilpotency class c on d Lie generators. One may identify fc,d with the quotient of the free Z-Lie algebra fd on d generators by the c ` 1-th term γc`1 pfd q of its lower central series. For i P t1, . . . , cu, the Z-rank of the i-th lower-central-series quotient γi pfc,d q{γi`1 pfc,d q is given by the Witt function 1ÿ µpjqdi{j , (1.2) Wd piq :“ i j|i ř where µ denotes the Möbius function; cf. [18, Satz 3]. Hence rkZ pfc,d q “ ci“1 Wd piq. Given a commutative ring R – in this paper always of the form O or Op as above – we write fc,d pRq “ fc,d bZ R, considered as an R-Lie algebra. For c “ 1, the (graded ideal) zeta function of the free abelian Lie ring f1,d pOq, enumerating all finite index O-sublattices of Od , is well known to be equal to Ÿ ζf1,dgrpOq psq “ (1.3) d ź ζK ps ´ i ` 1q, i“1 where ζK denotes the Dedekind zeta function of K; cf. [7, Proposition 1.1]. The Euler ś product (1.1) reflects the well-known Euler product ζK psq “ pPSpecpOq p1 ´ |O{p|´s q´1 : (1.4) Ÿ ζf1,dgrpOq psq “ ź pPSpecpOq d ź 1 “ 1 ´ |O{p|i´1´s i“1 ź ζOdp psq, say. pPSpecpOq For c “ 2, the second author computed in [15] the ideal zeta functions enumerating (O-)ideals of finite index in the rings f2,d pOq. (The paper only discusses the case R “ Z, but its computations carry over – mutatis mutandis – to the case of general number Ÿ rings.) We compute the graded ideal zeta functions ζf2,dgrpOq psq for all d ě 2 in Section 4 and those for pc, dq P tp3, 2q, p4, 2qu in Section 5 of the current paper. The paper’s most involved result is the computation, in Section 3, of the graded ideal Ÿ zeta function of f3,3 pOq. To this end we compute an explicit formula for ζf3,3grpoq psq, valid for all finite extension o of the p-adic integers Zp , where p is a prime, viz. a local ring of the form o “ Op for a nonzero prime ideal p of O lying above p. Ÿ Theorem 1.1. There exists an explicitly determined rational function W3,3gr P QpX, Y q such that, for all primes p and all finite extensions o of Zp , with residue cardinality q, Ÿ Ÿ ζf3,3grpoq psq “ W3,3gr pq, q ´s q. Ÿ It may be written as W3,3gr “ N3,3 {D3,3 where D3,3 pX, Y q “p1 ´ Y qp1 ´ XY qp1 ´ X 2 Y qp1 ´ X 3 Y 4 qp1 ´ XY 5 qp1 ´ X 2 Y 5 qp1 ´ Y 6 q p1 ´ X 7 Y 7 qp1 ´ X 8 Y 7 qp1 ´ X 8 Y 8 qp1 ´ X 12 Y 8 qp1 ´ X 6 Y 9 qp1 ´ X 15 Y 9 q p1 ´ X 16 Y 10 qp1 ´ X 15 Y 11 qp1 ´ X 12 Y 12 qp1 ´ X 7 Y 13 qp1 ´ Y 14 q, ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 3 a polynomial of degree 115 in X and 131 in Y , and N3,3 P QrX, Y s is a polynomial of degree 81 in X and 108 in Y . Ÿ The rational function W3,3gr satisfies the functional equation Ÿ Ÿ W3,3gr pX ´1 , Y ´1 q “ X 34 Y 23 W3,3gr pX, Y q. (1.5) We note that the Witt function W `33˘ (cf.`3(1.2)) ˘ `8˘takes the values pW3 p1q, W3 p2q, W3 p3qq “ p3, 3, 8q and that 115 ´ 81 “ 34 “ 2 ` 2 ` 2 and 131 ´ 108 “ 23 “ 3 ¨ 3 ` 2 ¨ 3 ` 1 ¨ 8; cf. Conjecture 6.2. Ÿ Our proof of Theorem 1.1 yields W3,3gr as a sum of 15 explicitly given summands, listed essentially in Section 3.2. We do not reproduce the “final” outcome of this summation Ÿ here, as the numerator N3,3 of W3,3gr fills several pages. We do record, however, several Ÿ corollaries of the explicit formula for W3,3gr . Ÿ The first corollary concerns analytic properties of the global zeta function ζf3,3grpOq psq. Ÿ Corollary 1.2. The global graded ideal zeta function ζf3,3grpOq psq converges on ts P C | Repsq ą 3u and may be continued meromorphically to ts P C | Repsq ą 14{9u. ś This follows from two observations. Firstly, the product pPSpecpOq D3,3 pq, q ´s q´1 – a product of finitely many translates of the Dedekind zeta function ζK psq – has abscissa of convergence 3 and may be continued meromorphically to the whole complex plain. ś Secondly, the product pPSpecpOq N3,3 pq, q ´s q may be continued meromorphically to ts P ř C | Repsq ą 14{9u. Indeed, if N3,3 pX, Y q “ 1 ` iPI αi X ai Y bi for a finite index set ś ´s I and αi P Zzt0u, ai P N0 , bi P N, then pPSpecpOq N3,3 pq, q q may be continued ai meromorphically to ts P C | Repsq ą βu, where β :“ maxt bi | i P Iu; cf. [5, Lemma 5.5]. That β “ 14{9 follows from inspection of N3,3 . The second corollary concerns the reduced graded ideal zeta function Ÿ Ÿ ζf3,3gr,red pY q :“ W3,3gr p1, Y q P QpY q; cf. Section 2.4. This concept was introduced in [6], albeit not in the context of graded ideal zeta functions. We expect that our ad hoc definition will fit into a general definition of reduced graded ideal zeta functions along the lines of [6]. Ÿ Corollary 1.3. The reduced graded ideal zeta function ζf3,3gr,red pY q satisfies (1.6) Ÿ ζf3,3gr,red pY q “ N3,3,red pY q p1 ´ Y q3 p1 ´ Y 3 qp1 ´ Y 4 q2 p1 ´ Y 5 q ś14 i“8 p1 ´ Y iq , 4 SEUNGJAI LEE AND CHRISTOPHER VOLL where N3,3,red pY q P ZrY s is equal to 1 ` 2Y 3 ` 4Y 4 ` 5Y 5 ` 16Y 6 ` 34Y 7 ` 53Y 8 ` 77Y 9 ` 98Y 10 ` 121Y 11 ` 182Y 12 ` 302Y 13 ` 483Y 14 ` 712Y 15 ` 953Y 16 ` 1187Y 17 ` 1425Y 18 ` 1689Y 19 ` 2046Y 20 ` 2579Y 21 ` 3298Y 22 ` 4162Y 23 ` 5059Y 24 ` 5826Y 25 ` 6398Y 26 ` 6894Y 27 ` 7475Y 28 ` 8270Y 29 ` 9265Y 30 ` 10260Y 31 ` 11041Y 32 ` 11529Y 33 ` 11745Y 34 ` 11798Y 35 ` 11811Y 36 ` 11811Y 37 ` 11798Y 38 ` 11745Y 39 ` 11529Y 40 ` 11041Y 41 ` 10260Y 42 ` 9265Y 43 ` 8270Y 44 ` 7475Y 45 ` 6894Y 46 ` 6398Y 47 ` 5826Y 48 ` 5059Y 49 ` 4162Y 50 ` 3298Y 51 ` 2579Y 52 ` 2046Y 53 ` 1689Y 54 ` 1425Y 55 ` 1187Y 56 ` 953Y 57 ` 712Y 58 ` 483Y 59 ` 302Y 60 ` 182Y 61 ` 121Y 62 ` 98Y 63 ` 77Y 64 ` 53Y 65 ` 34Y 66 ` 16Y 67 ` 5Y 68 ` 4Y 69 ` 2Y 70 ` Y 73 . Ÿ It seems remarkable that W3,3gr p1, Y q has a simple pole at Y “ 1 of order 14 “ 3`3`8, the Z-rank of f3,3 , and that N3,3,red has nonnegative, unimodal coefficients. This is Ÿ consistent with the speculation that W3,3gr p1, Y q is in fact the Hilbert-Poincaré series of a 14-dimensional graded algebra, associated to f3,3 in a natural way; cf. Remark 6.5. Note that the right hand side of (1.6) is not in lowest terms. The palindromic symmetry of the coefficients of N3,3,red is implied by the functional equation (1.5). The third corollary concerns another limiting object of the local graded ideal zeta Ÿ Ÿ functions ζf3,3grpoq psq, viz. the topological graded ideal zeta function ζf3,3gr,top psq; cf. Section 2.5. In [9], Rossmann introduced and studied so-called topological zeta functions associated to a range of Dirichlet generating series. Informally speaking, topological zeta functions may be viewed as suitably defined limits of local zeta functions. Whilst topoŸ logical versions of zeta functions such as ζf3,3grpoq psq have not yet been studied specifically, Ÿ Ÿ one may define ζf3,3gr,top psq as the coefficient of pq ´ 1q´14 in the expansion of ζf3,3grpoq psq in q ´ 1; cf. [9, Definition 5.13]. Ÿ Corollary 1.4. The topological graded ideal zeta function ζf3,3gr,top psq satisfies Ÿ ζf3,3gr,top psq “ p33250s4 ´ 81537s3 ` 66573s2 ´ 20800s ` 1920q{56 D3,3,top psq, where D3,3,top psq P Zrss is defined to be s3 ps´1q4 ps´2qp3s´2qp4s´3qp5s´1qp5s´2qp7s´8qp2s´3qp3s´5qp5s´8qp11s´15qp13s´7q A number of further features of the p-adic, topological, and reduced graded ideal zeta functions associated to f3,3 considered above seem remarkable. Some of the numerical values in the following corollary are presented so as to illustrate the general conjectures in Section 6 which we extracted from the paper’s explicit computations. By the degree of a rational function f “ P {Q P QpY q in Y we mean degY f “ degY P ´ degY Q. Corollary 1.5. (1) ¯ ´ Ÿ degs ζf3,3gr,top psq “ ´14 “ ´p3 ` 3 ` 8q “ ´ rkZ pf3,3 q, ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 5 (2) Ÿ s´14 ζf3,3gr,top ps´1 q|s“0 “ 19 Ÿ “ p1 ´ Y q14 ζf3,3gr,red pY q|Y “1 P Qą0 , 288, 288 (3) Ÿ s3 ζf3,3gr,top psq|s“0 “ (4) ´1 p´1q2`2`7 3 ¨ 3 ¨ 8 “ , 70, 560 3 ¨ 6 ¨ 14 ¨ 2! ¨ 2! ¨ 7! ˇ ˇ ˇ ˇ ζo3 psqζo3 psqζo8 psq ˇ Ÿ ζf3,3grpoq psq s“0 “ 2 3¨3¨8 “ . 7 3 ¨ 6 ¨ 14 If the above-mentioned connection between the reduced graded ideal zeta function and Hilbert-Poincaré series of graded algebras were to hold, the rational number in part (2) – for which we currently do not have an interpretation – were to be interpreted in terms of the multiplicity of the associated graded algebra; cf., for instance, [1, Section 4]. 1.3. Background, motivation, and methodology. Recall that L is a nilpotent Lie algebra over the ring of integers O of a number field. The ideal zeta function of L is the Dirichlet generating series enumerating the O-ideals of L of finite index, viz. ÿ ź Ÿ |L : I|´s “ ζLpO ζLŸ psq “ psq, pq IŸL pPSpecpOq where s is a complex variable and, for a (nonzero) prime ideal p of O, ÿ Ÿ ζLpO psq “ |LpOp q : I|´s pq IŸLpOp q enumerates Op -ideals of LpOp q. Ideal zeta functions of nilpotent Lie rings are well-studied relatives of the graded ideal zeta functions studied in the present paper. One of the main results of [7], which introduced the former zeta functions, establishes the rationality of Ÿ each of the Euler factors ζLpO psq in q ´s , where q “ |O : p|; cf. [7, Theorem 3.5]. For pq numerous examples of ideal zeta functions of nilpotent Lie rings, see [5]. By the Mal’cev correspondence, ideal zeta functions of nilpotent Lie rings are closely related to the normal subgroup zeta functions enumerating finite index normal subgroups of finitely generated nilpotent groups. In particular, given c, d P N, almost all (i.e. all but finitely many) of the Euler factors of ζfŸc,d psq coincide with those of the normal subgroup zeta function of the free class-c-nilpotent d-generator group Fc,d ; cf. [7, Section 4]. The study of the normal subgroup growth of free nilpotent groups is connected with the enumeration of finite p-groups up to isomorphism; cf. [3]. Informally speaking, graded ideal zeta functions of nilpotent Lie rings may be seen as Ÿgr psq “approximations” of their ideal zeta functions. Indeed, almost all Euler factors ζLpO pq Ÿ actually enumerate a sublattice of the lattice of ideals enumerated by ζLpO psq. In pq general, this approximation is quite coarse. In nilpotency class c ď 2, however, the problems of computing ideal zeta functions and graded ideal zeta functions are closely related, as the following example shows. 6 SEUNGJAI LEE AND CHRISTOPHER VOLL Example 1.6. Assume that L is nilpotent of class 2, with isolated commutator ideal L1 such that rkO pL{L1 q “ d. Then, essentially by [7, Lemma 6.1], ÿ ÿ (1.7) ζLŸ psq “ |L{L1 : Λ1 |´s |L1 : Λ2 |d´s , Λ1 ďL{L1 whereas (1.8) Ÿ ζL gr psq “ ÿ Λ1 ďL{L1 rΛ1 ,LsďΛ2 ďL1 |L{L1 : Λ1 |´s ÿ |L1 : Λ2 |´s . rΛ1 ,LsďΛ2 ďL1 In the special cases L “ f2,d , the proximity between (1.7) and (1.8) explains the proximity between the explicit formulae recorded in Theorems 4.1 and 4.2 of the current paper. In higher nilpotency classes, we are not aware of any such simple parallels. In the realm of free nilpotent Lie rings of class greater than two, explicit computations of ideal zeta functions seem all but unfeasible. In particular, we do not know of formulae for the ideal zeta functions of the Lie rings f3,3 pOq and f4,2 pOq. Numerous questions regarding ideal zeta functions have analogues regarding the “approximating” graded ideal zeta functions, and one may speculate that the latter are easier to answer than the former. On p. 188 of [7], Grunewald, Segal, and Smith formulate, for example, a conjecture which would imply that, for any c, d P N there exists Ÿ pX, Y q P QpX, Y q such that, for almost all p and all finite exa rational function Wc,d Ÿ Ÿ pq, q ´s q. This consequence is known to hold for c ď 2 tensions o of Zp , ζfc,d poq psq “ Wc,d and pc, dq “ p3, 2q but wide open in general, including the cases pc, dq P tp3, 3q, p4, 2qu. Our Conjecture 6.1 – which is verified by the explicit computations in the current paper in particular for c “ 2 and pc, dq P tp3, 3q, p3, 2q, p4, 2qu – may be viewed as a “graded” version of this conjecture. In [9], Rossmann formulates a number of conjectures on certain special values of padic and topological zeta functions, pertaining in particular to ideal zeta functions of nilpotent Lie rings. Our Conjectures 6.7, 6.9 and 6.11 are “graded” counterparts. In [17, Theorem 4.4], the second author proved a local functional equation for the generic Euler factors of the ideal zeta functions ζfŸc,d pOq psq upon inversion of the prime for all c P N and d P Ně2 . Our results suggest that this phenomenon also appears for graded ideal zeta functions of free nilpotent Lie rings; cf. Conjecture 6.2. All our computations owe their feasibility to the fact that, for the parameter values considered, viz. c “ 2 and pc, dq P tp3, 3q, p3, 2q, p4, 2qu, the enumeration of graded ideals is equivalent to the enumeration of various flags of lattices in free o-modules which depend only, and in a linear fashion, on the lattices’ elementary divisor types. Our computations rely on a simple polynomial formula, due to Birkhoff, for the numbers of o-submodules of given type in a finite o-module of given type; cf. Proposition 2.2. To obtain closed formulae for the relevant graded ideal zeta functions we need to organize the enumeration of infinitely many values of Birkhoff’s formula in a manageable way. We meet this challenge by organizing pairs of partitions, encoding two lattices’ elementary divisor types, by their overlap type, formally one of finitely many multiset permutations, viz. words in two letters (each with multiplicity); cf. Section 3.1. For pc, dq “ p3, 3q, for instance, we are led to consider 15 specific words of length 11 in the alphabet t1, 2u; cf. ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 7 Table 3.1. Restricting the relevant enumerations to a fixed word yields formulae which are products of q-multinomial coefficients and so-called Igusa functions; cf. Section 2.2. In Theorem 3.6 we compute such formulae for each of the 15 words in question. Similar methodology has been applied before to compute ideal zeta functions of Heisenberg Lie rings over number rings ([12]) and free nilpotent Lie rings of class 2 ([15]). That we are able to reduce our computations to combinatorial considerations with partitions is essentially owed to the fact that, for the parameters pc, dq considered, the automorphism groups of the free Lie rings fc,d act transitively on the lattices of given elementary divisor types in relevant sections of fc,d . This allows us to assume that the relevant lattices are generated by multiples of elements of Hall bases; cf. Section 2.3. That a lattice may always be generated by multiples of some linear basis follows, of course, from the elementary divisor theorem; that (subsets of) Hall bases may be used is a lucky consequence of the existence of “many” automorphisms, as we now explain. The automorphism group of fc,d poq contains a copy of GLd poq which allows us to perform arbitrary invertible o-linear transformations of Lie generators x1 , . . . , xd of fc,d poq. For c “ 2, this observation – which was already exploited in the proof of [7, Theorem 2] – in conjunction with Birkhoff’s formula is sufficient to compute the (graded) ideal zeta function of fc,d poq; cf. Section 4. On the Lie commutators rxi , xj s, 1 ď i ă j ď n, these linear transformations act via the exterior square representation. In general, the Ź image of the natural map 2 GLd poq Ñ GLpdq poq is rather small. The map is surjective, 2 however, if d ď 3, and an isomorphism if d “ 3. This facilitates our computations for pc, dq P tp3, 3q, p3, 2qu. If d “ 2, then the above-mentioned copy of GL2 poq even induces the full automorphism group of the o-module generated by the weight-3-commutators rrx1 , x2 s, x1 s and rrx1 , x2 s, x2 s, which we exploit for pc, dq “ p4, 2q. 1.4. Notation. Given n P N “ t1, 2, . . . u, we write rns for t1, 2, . . . , nu. We write Ně2 for t2, 3, . . . , u Ď N. Given a subset I Ď N, we write I0 for I Y t0u. If I Ď rn ´ 1s, we denote n ´ I “ tn ´ i | i P Iu. Given a, b P N0 , we denote the interval ta ` 1, . . . , bu by sa, bs and the interval ta ` 1, . . . , b ´ 1u by sa, br. We write 2S for the power set of a set S. The notation I “ ti1 , . . . , ih uă for a subset of I Ă N0 indicates that i1 ă i2 ă ¨ ¨ ¨ ă ih . Similarly, pλ1 , . . . , λn qě P Nn0 denotes a partition with non-ascending parts λ1 ě ¨ ¨ ¨ ě λn ě 0. We write o for a compact discrete valuation ring of characteristic zero, i.e. a finite extension of the ring Zp of p-adic integers or, equivalently, a ring of the form Op , the completion of O, the ring of integers of a number field K, at a nonzero prime ideal p of O. We write q for the cardinality of the residue field of o and p for its residue characteristic. We set t “ q ´s , where s is a complex variable. ζK is the Dedekind zeta function of K. 2. General preliminaries Let c P N, d P Ně2 , and set f “ fc,d be as above. The following is analogous to [7, Lemma 6.1]. Lemma 2.1. Let p be a prime and o be a finite extension of Zp . For each Λ2 ď fpoqp2q let (2.1) pXpΛ2 q ‘ fpoqp2q q{Λ2 “ Zppfpoqp1q ‘ fpoqp2q q{Λ2 q. 8 SEUNGJAI LEE AND CHRISTOPHER VOLL Then c ź ÿ Ÿ gr psq “ ζfpoq |fpoqpiq : Λi |´s Λ1 ďfpoqp1q ,..., Λc ďfpoqpcq i“1 @iP s1,cs: rΛi´1 ,fpoqp1q sďΛi (2.2) ÿ “ ζod psq |fpoqp1q : XpΛ2 q|´s c ź |fpoqpiq : Λi |´s . i“2 Λ2 ďfpoqp2q ,..., Λc ďfpoqpcq @iP s2,cs: rΛi´1 ,fpoqp1q sďΛi Proof. A graded additive sublattice Λ ď gr fpoq determines and is determined by the sequence pΛ1 , . . . , Λc q, where Λi :“ Λ X fpoqpiq for all i P rcs. We have Λ Ÿgr fpoq if and only if rΛi´1 , fpoqp1q s ď Λi for all i P s1, cs. This proves the first equality. The second follows from the definition of XpΛ2 q given in (2.1), noting that rΛ1 , fpoqp1q s ď Λ2 if and only if Λ1 ď XpΛ2 q and that, for each Λ2 ď fpoqp2q , ÿ |fpoqp1q : Λ1 |´s “ ζod psq|fpoqp1q : XpΛ2 q|´s .  Λ1 ďXpΛ2 q 2.1. Birkhoff ’s formula. Given a pair of partitions pσ, τ q, let αpτ, σ; qq denote the number of torsion o-modules of type τ contained in a fixed torsion o-module of type σ. Clearly αpσ, τ ; qq “ 0 unless τ ď σ. Notice that, for τ “ pτ1 , . . . , τn qě , pnq αpτ1 , τ ; qq “ #tΛ ď on | on {Λ – ‘nj“1 o{pτj u. The following explicit general formula for αpσ, τ ; qq is attributed to Birkhoff in [2]. Proposition 2.2 (Birkhoff). Let τ ď σ be partitions, with dual partitions τ 1 ď σ 1 . Then ź 1 1 1 ˆσ 1 ´ τ 1 ˙ αpσ, τ ; qq “ P Zrqs. q τk pσk ´τk q k 1 k`1 σk ´ τk1 q´1 kě1 2.2. Igusa functions and their functional equations. Definition 2.3. ([12, Definition 2.5]) Let h P N. Given variables X “ pX1 , . . . , Xh q and Y , we set ÿ ˆh˙ ź Xi 1 P QpY, X1 , . . . , Xh q, Ih pY ; Xq “ I Y iPI 1 ´ Xi 1 ´ Xh IĎrh´1s ÿ ˆh˙ ź Xi Xh ˝ Ih pY ; Xq “ P QpY, X1 , . . . , Xh q. I Y iPI 1 ´ Xi 1 ´ Xh IĎrh´1s We set I0 pY q “ I0˝ pY q “ 1 P QpY q. 1 Note that I1 pY ; Xq “ 1´X and I1˝ pY ; Xq “ functional equations ([12, Proposition 4.2]) X 1´X . We will make repeated use of the h Ih pY ´1 ; X´1 q “ p´1qh Xh Y ´p2q Ih pY ; Xq, (2.3) h Ih˝ pY ´1 ; X´1 q “ p´1qh Xh´1 Y ´p2 q Ih˝ pY ; Xq. h h Remark 2.4. The “symmetry centres” p´1qh Xh Y ´p2 q resp. p´1qh Xh´1 Y ´p2q in the functional equations (2.3) depend on Y and Xh , but not on X1 , . . . , Xh´1 . ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 9 Throughout this paper, we always substitute q ´1 for Y and hence write Ih pXq instead of Ih pq ´1 ; Xq and Ih˝ pXq instead of Ih˝ pq ´1 ; Xq. Igusa functions are ubiquitous in the theory of zeta functions of groups and rings. Note, for instance, that ζod psq “ Id ppq pd´jqj tj qjPrds q “ śd´1 1 j“0 p1 cf. (1.4). ´ q j tq ; 2.3. Hall bases for free nilpotent Lie rings. Let x1 , . . . , xd be Lie generators for f “ fc,d . A Hall basis for fc,d (on x1 , . . . , xd ) is a Z-basis Hc,d for fc,d which may be constructed by selecting inductively certain basic commutators in the xi ; see [8] for ř details. Note that |Hc,d | “ ci“1 Wd piq, where Wd denotes the Witt function (1.2). In Table 2.1 we record some Hall bases which are relevant for the current paper. Here we adopt the standard abbreviation xi1 xi2 xi3 . . . xir for left-normed commutators r. . . rrxi1 , xi2 s, xi3 s, . . . , xir s. In the case that d “ 2 (resp. d “ 3), we write x, y (and z) instead of x1 , x2 (and x3 q. pc, dq p1, dq p2, dq p3, 3q p3, 2q p4, 2q Hall basis Hc,d tx1 , . . . , xd u tx1 , . . . , xd , xi xj | 1 ď i ă j ď du tx, y, z, xy, xz, yz, xyx, xzx, yzx, xyy, xzy, yzy, xzz, yzzu tx, y, xy, xyx, xyyu tx, y, xy, xyx, xyy, xyxx, xyyx, xyyyu pWd piqqiPrcs pdq ` ˘ pd, d2 q p3, 3, 8q p2, 1, 2q p2, 1, 2, 3q Table 2.1. Some Hall bases 2.4. Reduced zeta functions. In [6], Evseev introduced a certain “limit as p Ñ 1” of various local zeta functions. Informally speaking, the idea is to exploit the fact that the coefficients of these generating functions enumerate Fq -rational points of constructible sets. The desired limit is obtained by replacing these constructible sets by their EulerPoincaré characteristics. The resulting rational functions are called reduced zeta functions; cf. [6, Section 3]. This paper does not define reduced graded ideal zeta functions explicitly, but provides a theoretical framework that allows this quite readily. If c, d are Ÿ Ÿ Ÿ such that ζfc,dgrpoq psq “ Wc,dgr pq, q ´s q for a rational function Wc,dgr pX, Y q P QpX, Y q, for alŸ Ÿ most all primes p and all finite extensions o of Zp , then ζfc,dgr,red psq “ Wc,dgr p1, Y q P QpY q. Evseev proved in [6, Section 4] that reduced ideal zeta functions of Lie rings with socalled nice and simple bases are Hilbert-Poincaré series enumerating integral points in rational polyhedral cones. The Hall bases H2,d given in Table 2.1, for instance, have this property. Comparing (1.7) and (1.8) one sees that, for nilpotent Lie rings L of Ÿgr Ÿ pY q “ ζL,red pY q; cf. also Remark 5.2. nilpotency class 2, ζL,red 2.5. Topological zeta functions. Another means of defining limits of p-adic zeta funcŸ Ÿ tions are topological zeta functions. If c, d are such that ζf grpoq psq “ Wc,dgr pq, q ´s q for c,d 10 SEUNGJAI LEE AND CHRISTOPHER VOLL Ÿ a rational function Wc,dgr pX, Y q P QpX, Y q, for almost all primes p and all finite extenŸ sions o of Zp , then ζfc,dgr,top psq is simply the coefficient of pq ´ 1q´r in the expansion of Ÿ Wc,dgr pq, q ´s q in q ´ 1, where r “ rkZ pfc,d q. Example 2.5. For a P N0 and b P N, 1 1´q a´bs “ 1 bs´a pq ´ 1q´1 ` Op1q. Thus 1 pq ´ 1q´d ` Oppq ´ 1q´d`1 q, sps ´ 1q . . . ps ´ d ` 1q Ÿ ζf1,dgrpoq psq “ ζod psq “ whence Ÿ ζf1,dgr,top psq “ 1 . sps ´ 1q . . . ps ´ d ` 1q More generally, [9, Definition 5.13] applies to any system of local zeta functions of Denef type over a number field, in the sense of [9, Definition 5.7]. Examples of such systems are families of p-adic zeta functions arising from families of the form pW pq, q ´s qqpPSpecpOq , for suitable W pX, Y q P QpX, Y q (and, as usual, q “ |O{p| for p P SpecpOq); cf. also [10]. All the local graded ideal zeta functions considered in the current paper fit into such “uniform” families. We expect this phenomenon to be universal in the context of free nilpotent Lie rings; cf. Conjecture 6.1. For a formal and far more general definition of topological zeta functions we refer to [9, Section 5]. In [9, Section 8], Rossmann collects a number of intriguing conjectures about analytic properties of topological zeta functions associated to various group- and ring-theoretic counting problems. We expect most of these conjectures to have analogues in the realm of topological graded ideal zeta functions. Motivated by the computation of various topological graded ideal zeta functions of free nilpotent Lie rings made throughout the current paper, we make a number of such conjectures in Section 6. 3. Proof of Theorem 1.1 (pc, dq “ p3, 3q) Let Let p fpoqp1q fpoqp3q f “ f3,3 be the free nilpotent Lie ring on 3 generators of nilpotency class 3. be a prime and o be a finite extension of Zp , with uniformizer π. Note that – o3 – fpoqp2q and fpoqp3q – o8 . In order to parameterize lattices in fpoqp2q and we denote by µ “ pµ1 , µ2 , µ3 qě and ν “ pν1 , . . . , ν8 qě integer partitions of at most 3 and 8 parts respectively, and set p2q p3q p3q µ “ pµ1 , µ2 , µ3 q “ pµ1 , µ1 , µ2 , µ2 , µ2 , µ3 , µ3 , µ3 qě . Proposition 3.1. (3.1) Ÿ ζf3,3grpoq psq “ ζo3 psq ÿ µ p3q αpµ1 , µ; qqq ´sp3µ1 `2µ2 `µ3 q ÿ αpµ, ν; qqq ´s νďµ ř8 k“1 νk . Proof. Our starting point is (2.2) in Lemma 2.1, which in this case reads ÿ ÿ Ÿ |fpoqp3q : Λ3 |´s . ζf3,3grpoq psq “ ζo3 psq |fpoqp1q : XpΛ2 q|´s |fpoqp2q : Λ2 |´s Λ2 ďfpoqp2q Λ3 ďfpoqp3q , rΛ2 ,fpoqp1q sďΛ3 ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 11 p3q Let µ “ pµ1 , µ2 , µ3 qě be a partition. There are αpµ1 , µ; qq lattices Λ2 ď fpoqp2q whose elementary divisor type with respect to fpoqp2q is given by µ. Clearly |fpoqp2q : Λ2 | “ ř3 q j“1 µj . We claim that |fpoqp1q : XpΛ2 q| “ q 2µ1 `µ2 . Indeed, lattices such as Λ2 may be parametrized by their elementary divisor type and a coset αΓµ P SL3 poq{Γµ of a certain stabilizer subgroup Γµ ď SL3 poq. Then |fpoqp1q : XpΛ2 q| is the index of the lattice of solutions to the simultaneous congruences ˛ ¨ 0 α1j α2j px1 , x2 , x3 q ˝´α1j 0 α3j ‚ ” 0 mod pµj ´α2j ´α3j 0 for j “ 1, 2, 3; cf. [14, Section 2.2] for details. This index clearly is q 2µ1 `µ2 . After a change of generators for fpoq if necessary, we may assume that Λ2 “ pµ1 xy ‘ pµ2 xz ‘ pµ3 yz. At this point we crucially use the fact that d “ 3, as GLd poq – if d “ 3. We obtain Ź2 GLd poq if and only (3.2) rΛ2 , fpoqp1q s “ xπ µ1 xyx, π µ1 xyy, π µ1 xyz, π µ2 xzx, π µ2 xzy, π µ2 xzz, π µ3 yzx, π µ3 yzy, π µ3 yzzyo . The Jacobi identity involving the three underlined terms is the only nontrivial relation between these terms. Indeed, the relation xyz ` zxy ` yzx “ 0 implies that xπ µ1 xyz, π µ2 xzy, π µ3 yzxyo “ xπ µ1 pxzy ´ yzxq, π µ2 xzy, π µ3 yzxyo “ pµ2 xzy ‘ pµ3 yzx. Hence (3.2) implies that rΛ2 , fpoqp1q s “ pµ1 xyx ‘ pµ1 xyy ‘ pµ2 xzx ‘ pµ2 xzy ‘ pµ2 xzz ‘ pµ3 yzx ‘ pµ3 yzy ‘ pµ3 yzz, whence rΛ2 , fpoqp1q s has type µ with respect to fpoqp3q . This shows that the number of lattices Λ3 ď fpoqp3q whose elementary divisor type with respect to fpoqp3q is given by a partition ν “ pν1 , . . . , ν8 qě and which satisfy rΛ2 , fpoqp1q s ď Λ3 is equal to αpµ, ν; qq. ř8 p3q ´s k“1 νk .  Each such lattice satisfies |fpoq : Λ3 | “ q 3.1. Overlap types and 2-dimensional words. Our approach to computing the right hand side of (3.1) is similar to the one taken in [12] to compute local factors of the (Z-) ideal zeta functions of Lie rings of the form f2,2 pOq. To compute the right hand side of (3.1) we carry out a case distinction with respect to the finitely many ways in which the partitions µ and ν may “overlap”. To be precise, let µ and ν be partitions of 3 and 8 parts, respectively, satisfying ν ď µ. There are uniquely determined numbers r P N0 and Mi , Ni P N (i P rr ´ 1s), such that µ 1 ě ¨ ¨ ¨ ě µ M 1 ě ν 1 ě ¨ ¨ ¨ ě ν N1 ą µM1 `1 ě ¨ ¨ ¨ ě µM2 ě νN1 `1 ě ¨ ¨ ¨ ě νN2 ą . . . µMr´1`1 ě ¨ ¨ ¨ ě µ3 ě νNr´1 `1 ě ¨ ¨ ¨ ě ν8 . 12 SEUNGJAI LEE AND CHRISTOPHER VOLL Define Mr “ 3, Nr “ 8, and M0 “ N0 “ 0. We call the integer sequence pMi , Ni qiPrr´1s arising the overlap type of the pair pµ, νq. Set p : N0 Ñ N0 , n ÞÑ n ¨ p2, 3, 3q :“ 2δně1 ` 3δně2 ` 3δně3 , An overlap type determines and is determined by the 2D-word v “ 1M1 2N1 1M2 ´M1 2N2 ´N1 . . . 13´Mr´1 28´Nr´1 , i.e. a word on the alphabet t1, 2u of length eleven such that 1 occurs three times and 2 xi ě Ni for i P rr ´ 1s. Observe that the latter condition is equivalent eight times, and M to ν ď µ. In this case we write vpµ, νq “ v. We denote by Dp2q the set of 15 2D-words arising in this way. Remark 3.2. Our notion of 2D-word is related to the classical one of (2-dimensional) Dyck word of length 2n. The latter are words in t1, 2u, featuring n occurrences of each letter. They may be used to model the overlap types of two partitions, each of at most n parts; cf. [12, Section 2.4]. 2D-words, in contrast, model the overlaps of two partitions ν and µ; whilst ν has genuinely at most 8 parts, µ has at most 3 distinct parts, with ties in blocks of respective sizes 2, 3, and 3. We chose to phrase our results and the supporting notation as similar to the relevant material in [12] as possible, leaving the reader free to concentrate on the crucial technical differences. Our Lemmata 3.4 and 3.5, for instance, are similar to, but subtly different from Lemmata 2.16 and 2.17 in [12]. Theorem 3.6 is analogous to [12, Theorem 3.1]. For v P Dp2q we set (3.3) Dv pq, tq :“ ÿ p3q αpµ1 , µ; qqαpµ, ν; qqq ´sp3µ1 `2µ2 `µ3 ` pµ,νq vpµ,νq“v Proposition 3.1 allows us to write (3.4) Ÿ ζf3,3grpoq psq “ ζo3 psq ÿ ř8 k“1 νk q . Dv pq, tq. vPDp2q This section’s main result is Theorem 3.6, giving a general formula for the functions Dv . Table 3.1 lists the 15 words in Dp2q together with their overlap types and an indication where in Section 3.2 an explicit formula for Dv may be found. In order to obtain such formulae, it is useful for us to have notation for the successive differences of the parts of µ and ν. For j P r8s we set # νj ´ νj`1 if j R tN1 , . . . , Nr u , (3.5) rj “ νNi ´ µMi `1 if j “ Ni , where we define µ4 “ 0. Similarly, for j P r3s we set # µj ´ µj`1 if j R tM1 , . . . , Mr u , (3.6) sj “ µMi ´ νNi´1 `1 if j “ Mi . By definition, rj , sj ě 0 for all j. Note also that rj ą 0 if j P tN1 , . . . , Nr´1 u and observe that µMi ą µMi `1 and νNi ą νNi `1 for each i P rr ´ 1s. Set q : N0 Ñ N0 , n ÞÑ n ¨ p3, 2, 1q :“ 3δně1 ` 2δně2 ` 1δně3 . ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 13 Table 3.1. Overlap types and 2D-words r pMi , Ni qiPrr´1s v P Dp2q 1 2 2 2 2 2 2 3 3 3 3 2 3 3 3 13 28 – p2, 1q p2, 2q p2, 3q p2, 4q p2, 5q p1, 1q p1, 1; 2, 2q p1, 1; 2, 3q p1, 1; 2, 4q p1, 1; 2, 5q p1, 2q p1, 2; 2, 3q p1, 2; 2, 4q p1, 2; 2, 5q Then 3µ1 ` 2µ2 ` µ3 “ 3 ÿ j“1 ν1 ` ¨ ¨ ¨ ` ν8 “ 8 ÿ j“1 Finally, for each i P rrs we define Section 3.2.1 12 2127 12 22 126 12 23 125 12 24 124 12 25 123 1212 27 1212126 12122 125 12123 124 12124 123 122 12 26 122 12125 122 122 124 122 123 123 q jsj ` jrj ` r ÿ i“1 r´1 ÿ i“1 3.2.2 3.2.3 3.2.4 ˘ ` |i rN `1 ` ¨ ¨ ¨ ` rN , M i´1 i ˘ ` Ni sMi `1 ` ¨ ¨ ¨ ` sMi`1 . (3.7) Jiµ “ tj P rMi ´ Mi´1 ´ 1s | µMi ´j ą µMi ´j`1 u , (3.8) Jiν “ tj P rNi ´ Ni´1 ´ 1s | νNi ´j ą νNi ´j`1 u . We start with an immediate consequence of Proposition 2.2. Lemma 3.3. Let µ and ν be partitions of 3 and 8 parts, respectively, satisfying ν ď µ. Then ˙ ˙ ˆ x1 ˆ 1 1 ÿ ź 1 µk ´ νk`1 x1 ´ν 1 q 3 ´ µk`1 p3q µk p3´µ1k q`νk1 pµ k k . αpµ1 , µ; qqαpµ, ν; qq “ q 1 x1 ´ ν 1 3 ´ µ µ ´1 ´1 k q µ kě1 k k q Let µ and ν be partitions as in Lemma 3.3. Let pMi , Ni qiPrr´1s be their overlap type and µ1 resp. ν 1 be their dual partitions. For k P N, set Also, set x1 ´ ν 1 q. dk :“ µ1k p3 ´ µ1k q ` νk1 pµ k k ´ ¯ xi ´ j , aj :“ Mi p3 ´ Mi q ` j M j P sNi´1 , Ni s , ´ ¯ bj :“ j p3 ´ jq ` Ni´1 p j ´ Ni´1 , j P sMi´1 , Mi s . 14 SEUNGJAI LEE AND CHRISTOPHER VOLL Note that j determines a unique i. Lemma 3.4. For i P rrs, µMi´1 `1 ź k“µMi q dk ˆ 3 ´ µ1k`1 3 ´ µ1k ˙ q ˆ x1 ˙ 1 µk ´ νk`1 x1 ´ ν 1 µ ´1 k “ k Mi ´M źi´1 q q ´1 bMi´1 `j sMi´1 `j j“1 ˙ ˆ ˆ ˙ Mi ´ Mi´1 3 ´ Mi´1 . Jiµ 3 ´ Mi q´1 q ´1 Proof. Since all the indices k appearing in the product on the left hand side satisfy 1 “ Ni´1 for all k in the νNi´1 ą µMi´1`1 ě k ě µMi ě νNi´1 `1 , we have νk1 “ νk`1 interval rµMi , µMi´1 `1 s. Thus µMi´1 `1 ˆ x ź µ1k k“µMi 1 ´ νk`1 x1 ´ ν 1 µ k k ˙ “ 1. q ´1 For j P rMi ´ Mi´1 s we have µ1k “ Mi´1 ` j when µMi´1 `j`1 ă k ď µMi´1 `j ; observe that it may be the case for some j that no index k satisfies this condition. As a result, we see that for each j P rMi ´Mi´1 s, there are exactly sMi´1`j elements k of the segment rµMi , µMi´1 `1 s for which µ1k “ Mi´1 ` j. Now, note that ˙ ˆ 3 ´ µ1k`1 ‰1 3 ´ µ1k q´1 if and only if µ1k`1 ‰ µ1k . This is the case exactly when there exists an i such that µi “ k. It follows that if Jiµ “ tji,1 , . . . , ji,γi u, with ji,1 ă . . . ă ji, γi , ji, 0 :“ 0, ji, γi `1 :“ Mi ´ Mi´1 , then (3.9) µMi´1 `1 ˆ ź k“µMi 3 ´ µ1k`1 3 ´ µ1k ˙ q ´1 ˙ γi ˆ ź 3 ´ Mi ` ji, m`1 . “ 3 ´ Mi ` ji,m q´1 m“0 We make use of the well-known identity ˆ ˙ ˆ ˙ α 1 ´ Xα α ´ 1 “ β X 1 ´ X a´β β X for Gaussian binomial coefficients. Applying it inductively, we see that for all m P rγi ´1s, ˆ ˆ ˙ `3´Mi `ji, m`1 ˘ ˙ 3´Mi ji,m`1 3 ´ Mi ` ji, m`1 q ´1 . “ `3´Mi `ji, m ˘ ji,m q´1 3 ´ Mi ` ji,m q´1 ´1 3´Mi Hence the right-hand side of (3.9) is equal to ˙ ˆ ˆ ˙ Mi ´ Mi´1 3 ´ Mi´1 . Jiλ 3 ´ Mi q´1 q ´1 q ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 15 Thus µMi´1 `1 ź q dk k“µMi ˆ 3 ´ µ1k`1 3 ´ µ1k ˙ q ˆ x1 ˙ 1 µk ´ νk`1 x1 ´ ν 1 µ ´1 k k Mi ´M źi´1 “ q q ´1 bMi´1 `j sMi´1 `j j“1 as required. ˆ Mi ´ Mi´1 Jiµ ˙ q ´1 ˆ 3 ´ Mi´1 3 ´ Mi ˙ q ´1  Lemma 3.5. For i P rrs, µMi ´1 ź q k“µMi `1 `1 dk ˆ 3 ´ µ1k`1 3 ´ µ1k ˙ q “ ˙ ˆ x1 1 µk ´ νk`1 x1 ´ ν 1 µ ´1 k k Ni ´N źi´1 q q ´1 aNi´1 `j rNi´1 `j j“1 ˆ Ni ´ Ni´1 Jiν ˙ ˆx ˙ Mi ´ Ni´1 . xi ´ Ni q´1 M q ´1 Proof. Note that the product on the left hand side may be empty; this happens in the case µMi “ νNi´1 `1 “ ¨ ¨ ¨ “ νNi “ µMi `1 ` 1. Since µMi ą k ą µMi `1 , we have µ1k “ µ1k`1 “ Mi for all k in the interval sµMi `1 , µMi ´1 s. Finally, observe that for j P rNi ´ Ni´1 s we have νk1 “ Ni´1 ` j when νNi´1 `j`1 ă k ď νNi´1 `j . The claim follows as in the proof of the previous lemma.  With these preparations in place we now give a formula for the functions Dv . ˘ ś ` Theorem 3.6. Let v “ ri“1 1Mi ´Mi´1 2Ni ´Ni´1 P Dp2q . Then ˙ ˆx ˙ ź r ˆ r ź ˘ ` Mi ´ Ni´1 3 ´ Mi´1 Dv pq, tq “ IMi ´Mi´1 YMi´1 `1 , . . . , YMi xi ´ Ni q´1 3 ´ Mi q´1 M i“1 i“1 ¸ ˜ r´1 ź ˘ ` ˘ ` ˝ , X , . . . , X ¨ I ¨ IN X , . . . , X N `1 8 8´N N `1 N ´N r´1 r´1 i´1 i i i´1 i“1 with numerical data (3.10) (3.11) | Xj “ q aj tMi `j j P sNi´1 , Ni s , q j`Ni´1 Yj “ q bj t j P sMi´1 , Mi s . Proof. Given v “ pv1 , v2 , v3 q P N30 and v1 “ pv11 , . . . , v81 q P N80 , we set, for each i P rrs, ( suppM i pvq “ j P rMi ´ Mi´1 ´ 1s | vMi´1 `j ą 0 , ! ) 1 1 suppN pv q “ j P rN ´ N ´ 1s | v ą 0 . i i´1 i Ni´1 `j In practice, v will be one of the vectors of successive differences s “ ps1 , s2 , s3 q (cf. (3.6)) and v 1 will be one of the vectors of successive differences r “ pr1 , . . . , r8 q (cf. (3.5)). Given a pair pµ, νq of partitions satisfying ν ď µ, recall our definitions (3.7) and (3.8). It is easy to see that, for every i P rrs, µ suppM i pvq “ Mi ´ Mi´1 ´ Ji and 1 ν suppN i pv q “ Ni ´ Ni´1 ´ Ji . 16 SEUNGJAI LEE AND CHRISTOPHER VOLL Thus it follows that ˙ ˆ ˆ ˙ ˙ ˆ ˆ ˙ Mi ´ Mi´1 Mi ´ Mi´1 Ni ´ Ni´1 Ni ´ Ni´1 “ and “ . 1 Jiµ suppM Jiν suppN i pvq q ´1 i pv q q ´1 q ´1 q ´1 Let δij be the usual Kronecker delta function. Substituting Lemma 3.4 and 3.5, rewriting the expressions in terms of rj and sj and using (3.1), we find that formula (3.3) for Dv pq, tq splits into a product as follows: ˙ ˆx ˙ ź r ˆ r ź Mi ´ Ni´1 3 ´ Mi´1 Ai Bi , Dv pq, tq “ xi ´ Ni q´1 3 ´ Mi q´1 M i“1 i“1 where, for i P rrs, Ai “ 8 ÿ ¨¨¨ rNi ´1“0 rN “1´δir i rNi´1 `1 “0 Bi “ 8 ÿ ¨¨¨ sMi´1 `1 “0 8 ÿ 8 ÿ 8 ÿ sMi ´1“0 ˆ ˙ Ni ¯ ´ ź Ni ´ Ni´1 |i `j rj aj M q t , 1 suppN i pv q q ´1 j“N `1 i´1 ˙ Mi 8 ˆ ¯s ´ ÿ ź Mi ´ Mi´1 bj Ni´1 `q j j q t . suppM i pvq q ´1 j“M s “0 `1 Mi i´1 We now show that all of the factors Ai and Bi are products of Igusa functions and Gaussian binomial coefficients. Given i P rrs and I Ď rMi ´ Mi´1 ´ 1s, we define Si pIq ˘ ` M ´M to be the set of vectors si “ sMi´1 `1 , . . . , sMi P N0 i i´1 such that sj “ 0 unless j P tMi´1 ` k | k P Iu Y tMi u. With the numerical data defined in (3.11), we have Bi “ ÿ IĎrMi ´Mi´1 ´1s ˆ ˆ Mi ´ Mi´1 I ˙ ˙ ÿ ź q ´1 si PSi pIq jPpI`Mi´1 qYtMi u ¨ ¨ ´ ¯ q sj q bj tNi´1 `j ˛˛ 8 ÿ ˘s ` Mi ´ Mi´1 ˝ ˝ pYMi qsMi YMi´1 `ι Mi´1 `ι ‚‚ I ´1 q sMi “0 sMi´1 `ι “1 ιPI IĎrMi ´Mi´1 ´1s ˆ ˙ ź YMi´1 `ι ÿ 1 Mi ´ Mi´1 “ I 1 ´ YMi q ´1 ιPI 1 ´ YMi´1 `ι IĎrMi ´Mi´1 ´1s ˘ ` “IMi ´Mi´1 YMi´1 `1 , . . . , YMi . “ ÿ ź 8 ÿ Analogously one shows that, with the numerical data defined in (3.10), # ˘ ` ˝ IN for i ă r, X , . . . , X N `1 N i´1 i ´N i i´1 Ai “ ˘ ` for i “ r. I8´Nr´1 XNr´1 `1 , . . . , X8 This completes the proof of Theorem 3.6. 3.2. Explicit formulae for the functions Dv . 3.2.1. v “ 13 28 . ` ˘ D13 28 pq, tq “ I3 q 2 t3 , q 2 t5 , t6 I8 ppq ip8´iqq t6`i qi“1,...,8 q. ` ˘ Ÿ Remark 3.7. Note that ζf2,3grpoq psq “ ζo3 psqI3 q 2 t3 , q 2 t5 , t6 ; cf. Proposition 4.10.  ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 17 3.2.2. v “ 12 2j 128´j , j P t1, . . . , 5u. ˆ ˙ ˆ ˙ ` ˘ 5 3 D12 2j 128´j pq, tq “ I2 q 2 t 3 , q 2 t 5 j q´1 1 q´1 ¨ Ij˝ ppq 2`ip5´iq t5`i qi“1,...,j qI1 pq jp8´jq t6`j qI8´j ppq ip8´iq t6`i qi“j`1,...,8 q. 3.2.3. v “ 1212j´1 128´j , j P t1, . . . , 5u. For j “ 1, ˆ ˙ ˆ ˙ 3 2 D1212 27 pq, tq “ I1 pq 2 t3 qI1˝ pq 3 t4 qI2 pq 6 t6 , q 7 t7 qI7 ppq ip8´iq t6`i qi“2,...,8 q. 1 q´1 1 q´1 For j P t2, . . . , 5u, D1212j´1128´j pq, tq “ ˆ ˙ ˆ ˙ ˆ ˙2 4 3 2 I1 pq 2 t3 qI1˝ pq 3 t4 qI1 pq 6 t6 q j ´ 1 q´1 1 q´1 1 q´1 ˝ ¨ Ij´1 ppq 2`ip5´iq t5`i qi“2,...,j qI1 pq jp8´jq t6`j qI8´j ppq ip8´iq t6`i qi“j`1,...,8 q. 3.2.4. v “ 122 12j´1 127´j , j P t1, . . . , 4u. For j “ 1, ˆ ˙ 3 D122 12 26 pq, tq “ I1 pq 2 t3 qI2˝ pq 3 t4 , q 2 t5 qI2 pq 8 t7 , q 12 t8 qI6 ppq ip8´iq t6`i qi“3,...,8 q. 1 q´1 For j P t2, 3, 4u, D122 12j´1 127´j pq, tq “ ˆ 3 j ´1 ˙ ˆ ˙ ˆ ˙ 3 2 I1 pq 2 t3 qI2˝ pq 3 t4 , q 2 t5 qI1 pq 8 t7 q 1 1 ´1 ´1 ´1 q q q ˝ ¨ Ij´1 ppq 2`ip5´iq t5`i qi“3,...,j`1 qI1 pq pj`1qp8´pj`1qq t7`j qI8´pj`1q ppq ip8´iq t6`i qi“j`2,...,8 q. 3.3. Completion of the proof. The first two claims of Theorem 1.1 follows from (3.4) and the explicit formulae for Dv , v P Dp2q , given in Section 3.2. To deduce the local functional equation (1.5), one checks, repeatedly using the functional equations (2.3) the Igusa `functions Ih resp. Ih˝ and the well-known fact that, for a, b P N0 , a ě b, `for ˘ ˘ a bpa´bq a b q “q b q ´1 , that each of the functions Dv satisfies Dv pq ´1 t´1 q “ ´q 31 t20 Dv pq, tq. The functional equation (1.5) follows from (3.4) as ζo3 psq|qÑq´1 “ ´q 3 t3 ζo3 psq. 4. Nilpotency class two (c “ 2) Ÿ Let d P Ně2 . In this section we compute the local graded ideal zeta functions ζfd,2grpoq psq. We prove functional equations for these functions and establish their behaviour at s “ 0. We use them to determine the abscissae of convergence of the global graded ideal zeta Ÿ functions ζf grpOq psq and some properties of the associated topological and reduced graded d,2 `˘ ideal zeta functions. Throughout we write d1 for d2 “ W2 pdq; cf. (1.2). 18 SEUNGJAI LEE AND CHRISTOPHER VOLL 4.1. p-Adic formulae. The paper [15] determines the normal subgroup zeta functions of the free class-2-nilpotent d-generator groups F2,d , enumerating these groups’ normal subgroups of finite index. By the Mal’cev correspondence, these are the ideal zeta functions of the free nilpotent Z-Lie rings f2,d . The computations generalize to the case of general number rings in a straightforward manner. To recall the paper’s main result define the function ˆ ˙ i`1 1 ϕ : rd ´ 1s0 Ñ rd s, i ÞÑ id ´ . 2 1 Given pI, Jq P 2rd´1s0 ˆ 2rd s , the paper [15, p. 71] defines a total order ăϕpIq,J on the disjoint union I Y J. Without loss of generality, we may assume that the sets I and J have the same cardinality h. For i P I “ ti1 , . . . , ih uă and j P J “ tj1 , . . . , jh uă , set ( ( jpiq :“ min j P J Y d1 | ϕpiq ăϕpIq,J , j , ( ipjq :“ max i P I Y t0u | ϕpiq ăϕpIq,J , j , and j0 :“ i0 :“ 0 ăϕpIq,J ϕ prd ´ 2sq Z rd1 ´ 1s ăϕpIq,J jh`1 :“ d1 . The following is essentially the main result of [15], in notation compatible with the current paper. (The underlining of terms of the form d` in (4.3) is meant to facilitate comparison with the “graded” numerical data (4.5) in Theorem 4.2, and may be ignored.) Theorem 4.1. [15, Theorem 4] For all primes p and all finite extensions o of Zp , ÿ (4.1) ζfŸ2,d poq psq “ ζod psq AŸ I,J pq, tq, IĎrd´2s,JĎrd1 ´1s |I|“|J|,ϕpIqďJ where (4.2) AŸ I,J pq, tq ´1 “ ζoih psq Ij1 ppXα qαPrj1 ´1s , X0 q ¨ ˙ h ˆ ź jr`1 ´ ϕpir q r“1 jr ´ ϕpir q q ´1 ˆ d ´ ir´1 d ´ ir ˙ q ´1 ¨ Ii˝r ´ir´1 ppYβ qβPsir´1 ,ir r , Yi1r qIjr`1 ´jr ppXα qαPsjr ,jr`1r , Xjr q, with numerical data “ ‰ j P d1 ´ 1 0 , Xj “ q ipjqpd´ipjqq`pd ´jqpd`j´ϕpipjqqq td´ipjq`d ´j , 1 (4.3) 1 Yi “ q ipd´iq`pd ´jpiqqpd`jpiq´ϕpiqq td´i`d ´jpiq , 1 1 i P rd ´ 2s , Yi1r “ q ir´1 pd´ir´1 q`pd ´jpir qqpd`jpir q´ϕpir´1 qq td´ir´1`d ´jpir q , 1 1 The following is a graded analogue of Theorem 4.1. Theorem 4.2. For all primes p and all finite extensions o of Zp , ÿ Ÿ Ÿ (4.4) ζf2,dgrpoq psq “ ζod psq AI,Jgr pq, tq, IĎrd´2s,JĎrd1 ´1s |I|“|J|,ϕpIqďJ r P rhs . ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 19 Ÿ where AI,Jgr pq, tq is defined as AŸ I,J pq, tq in (4.2), but with numerical data “ ‰ 1 1 Xj “ q ipjqpd´ipjqq`pd ´jqpj´ϕpipjqqq td´ipjq`d ´j , j P d1 ´ 1 0 , 1 1 Yi “ q ipd´iq`pd ´jpiqqpjpiq´ϕpiqq td´i`d ´jpiq , (4.5) Yi1r “ q ir´1 pd´ir´1 q`pd1 ´jpi r qqpjpir q´ϕpir´1 qq i P rd ´ 2s , td´ir´1 `d1 ´jpi rq , r P rhs . Proof. The difference between (4.3) and (4.5) reflects the difference between (1.7) and (1.8).  Corollary 4.3. (4.6) (4.7) ˇ 1 ˇ d`d1 pd`d 2d`d1 Ÿ 2 qt “ p´1q q ζfŸ2,d poq psqˇ ζf2,d poq psq, ´1 qÑq ˇ 1 ˇ Ÿ d`d1 pd2q`pd2 q 2d`d1 Ÿgr “p´1q q t ζf2,d poq psq. ζf2,dgrpoq psqˇ ´1 qÑq Proof. Eq. (4.6) is [15, Theorem 3(a)]. The proof proceeds by establishing the symmetry in question for each of the summands in (4.1), using (2.3). The formulae (4.1) and (4.4) only differ in their numerical data. By Remark 2.4, it suffices to control the value of ś X X0 ¨ hr“1 Y j1r in both cases. Inspection of (4.3) and (4.5), respectively, reveals that in ir 1 the ideal case this term is by a factor q dd larger than in the graded ideal case. Thus ˇ 1 ˇ Ÿ ´dd1 2d`d1 Ÿgr d`d1 pd`d 2 q ζf2,d poq psq. t q “ p´1q ζf2,dgrpoq psqˇ ´1 As `d`d1 ˘ 2 ´ dd1 “ `d˘ 2 qÑq ` `d1 ˘ 2 , this establishes (4.7). Ÿ  4.2. p-Adic behaviour at zero. We describe the behaviours of ζfŸ2,d poq psq and ζf grpoq psq 2,d at s “ 0. Theorem 4.4. For all primes p and all finite extensions o of Zp , ˇ ζfŸ2,d poq psq ˇˇ (4.8) “ 1, ˇ ζod`d1 psq ˇ s“0 ˇ Ÿgr ˇ ζf poq psq ˇ d´1 d ¨ d1 2,d (4.9) “ . “ ˇ 1 ζod psqζod1 psq ˇ d ¨ pd ` d q d`1 s“0 Proof. To prove (4.8) we note that, by (4.1), ¨ 1 ζfŸ2,d poq psq d`d ź´1 “ p1 ´ q j tq ˝AŸ ∅,∅ pq, tq ` ζod`d1 psq j“d ÿ pI,Jq‰p∅,∅q 1 ˛ ‚ AŸ I,J pq, tq . pd`pd ´jqqj td`j q By inspection of (4.3) we see that AŸ jPrd1 s q and that ∅,∅ pq, tq “ Id1 ppq # 0 if pI, Jq ‰ p∅, ∅q, AŸ śd`d1 ´1 1 ´jqqj I,J pq, 1q “ pd`pd j qjPrd1 s q “ j“d p1 ´ q q if pI, Jq “ p∅, ∅q. Id1 ppq To prove (4.9) we note that Ÿ ζf2,dgrpoq psq ζod psqζod1 psq “ 1 ´1 dź j“0 ¨ Ÿ gr p1 ´ q j tq ˝A∅,∅ pq, tq ` ÿ pI,Jq‰p∅,∅q ˛ Ÿ AI,Jgr pq, tq‚. 20 SEUNGJAI LEE AND CHRISTOPHER VOLL Ÿ 1 gr By inspection of (4.5) we see that A∅,∅ pq, tq “ Id1 ppq pd ´jqj td`j qjPrd1 s q, which has a simple Ÿ pole at t “ 1. In contrast, AI,Jgr pq, tq has no pole at t “ 1 when pI, Jq ‰ p∅, ∅q. Hence ˇ ˇ ˇ Ÿ 1 1 ζf2,dgrpoq psq ˇˇ Id1 ppq pd ´jqj td`j qjPrd1 s q ˇˇ 1 ´ td ˇˇ d1 “ “ .  “ ˇ ˇ ˇ 1 ζod psqζod1 psq ˇ 1 ´ td`d1 ˇ d ` d1 Id1 ppq pd ´jqj tj qjPrd1 s q ˇ t“1 s“0 t“1 Remark 4.5. In the pertinent special cases, (4.8) confirms [9, Conjecture IV (P-adic form)]. 4.3. Global analytic properties. The following result compares some of the known Ÿ analytic properties of ζfŸ2,d pOq psq (cf. [15, Theorem 3]) with those of ζf grpOq psq. 2,d ζfŸ2,d pOq psq Ÿ ζf2,dgrpOq psq are Theorem 4.6. The abscissae of convergence of resp. + # ` ˘ ˆ ˙ p d2 ´ jqpd ` jq ` 1 d Ÿ |jPr (4.10) ´ 1s resp. , α pf2,d q “ max d, `d`1˘ 2 ´j 2 # ` ˘ + ˆ ˙ p d2 ´ jqj ` 1 d Ÿgr |jPr α pf2,d q “ max d, `d`1˘ (4.11) ´ 1s . 2 ´ j 2 The respective meromorphic continuations of both zeta functions beyond their abscissae of convergence have simple poles at s “ αŸ pf2,d q resp. s “ αŸgr pf2,d q. Proof. Eq. (4.10) and the ensuing claim about the meromorphic continuation is essentially [15, Theorem 3]. Eq. (4.11) and the analogous claim are proved analogously.  4.4. Topological zeta functions – degree and behaviour at zero. Theorem 4.7. Moreover, ¯ ´ ¯ ´ Ÿ degs ζfŸ2,d ,top psq “ ´pd ` d1 q “ degs ζf2,dgr,top psq . ˇ ˇ sζfŸ2,d ,top psqˇ (4.12) ˇ ˇ Ÿ s2 ζf2,dgr,top psqˇ (4.13) 1 s“0 p´1qd`d ´1 , “ pd ` d1 ´ 1q! s“0 p´1qpd´1q`pd ´1q d1 “ . pd ` d1 q pd ´ 1q! pd1 ´ 1q! 1 Proof. Note that, given h P N and, for i P rhs, Xi “ q ai tbi for ai P N0 , bi P N, h! pq ´ 1q´h ` Oppq ´ 1q´h`1 q. Ih pX1 , . . . , Xh q “ śh i“1 pbi s ´ ai q The summands in the formula (4.1) for ζfŸ2,d poq psq are all products of Igusa functions and Ÿ Ÿ Gaussian binomial coefficients. Hence there exist aŸ I,J,i P N0 and bI,J,i , cI,J P N such that ζfŸ2,d poq psq “ ÿ I,J śd`d1 cŸ I,J Ÿ i“1 pbI,J,i s 1 ´ aŸ I,J,i q 1 pq ´ 1q´pd`d q ` Oppq ´ 1q´pd`d q`1 q. (Here and in the sequel, the sums are over pairs pI, Jq as in (4.1).) Hence ÿ cŸ I,J (4.14) ζfŸ2,d ,top psq “ śd`d1 Ÿ Ÿ I,J i“1 pbI,J,i s ´ aI,J,i q ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 21 is a rational function in s of degree ´pd ` d1 q, confirming the first claim. Ÿ The second claim, on the degree of ζf2,dgr,top psq, follows from analogous considerations Ÿ Ÿ Ÿ gr gr , cI,Jgr P N such that P N0 and bI,J,i based on (4.4). Indeed, there exist aI,J,i Ÿ ζf2,dgrpoq psq “ ÿ I,J Hence Ÿ śd`d1 cI,Jgr Ÿgr i“1 pbI,J,i s Ÿ ζf2,dgr,top psq (4.15) ´ “ Ÿgr pq q aI,J,i ÿ I,J 1 1 ´ 1q´pd`d q ` Oppq ´ 1q´pd`d q`1 q. Ÿ śd`d1 i“1 cI,Jgr Ÿ Ÿ gr gr q s ´ aI,J,i pbI,J,i is a rational function in s of degree ´pd ` d1 q, too. Turning to the behaviour at s “ 0, we start with the observation that ζod psqAŸ I,J pq, tq has no pole at t “ 1 unless pI, Jq “ p∅, ∅q, in which case it is simple. Thus the summand cŸ I,J Ÿ Ÿ i“1 pbI,J,i s´aI,J,i q in (4.14) has no pole at s “ 0 unless pI, Jq “ p∅, ∅q, in which case it śd`d1 is simple. Specifically, 1 ipd´iq i t qiPrds qId1 ppq pd`d ´jqj td`j qjPrd1 s q, ζod psqAŸ ∅,∅ pq, tq “ Id ppq whence śd`d1 i“1 and thus cŸ ∅,∅ pd1 q! 1 ¨ śd1 “ śd´1 Ÿ 1 pbŸ i“0 ps ´ iq j“1 ppd ` jqs ´ pd ` d ´ jqjq ∅,∅,i s ´ a∅,∅,i q ˇ ˇ sζfŸ2,d ,top psqˇ 1 p´1qd`d ´1 “ , “ śd´1 śd1 1 pd ` d1 ´ 1q! i“1 p´iq j“1 p´pd ` d ´ jqjq pd1 q! s“0 which establishes (4.12). Ÿ The proof of (4.13) goes along similar lines. We observe that ζod psqAI,Jgr pq, tq has a simple pole at t “ 1 unless pI, Jq “ p∅, ∅q, in which case it is double. Thus the summand Ÿgr cI,J Ÿgr Ÿgr i“1 pbI,J,i s´aI,J,i q śd`d1 in (4.15) has a simple pole at s “ 0 unless pI, Jq “ p∅, ∅q, in which case it is double. Specifically, Ÿ 1 gr ζod psqA∅,∅ pq, tq “ Id ppq ipd´iq ti qiPrds qId1 ppq pd ´jqj td`j qjPrd1 s q, whence Ÿ śd`d1 gr c∅,∅ Ÿgr i“1 pb∅,∅,i s and thus ˇ ˇ Ÿ s2 ζf2,dgr,top psqˇ s“0 ´ Ÿgr q a∅,∅,i pd1 q! 1 ¨ śd1 “ śd´1 1 i“0 ps ´ iq j“1 ppd ` jqs ´ pd ´ jqjq 1 pd1 q! p´1qpd´1q`pd ´1q d1 , “ “ ś ś d1 ´1 1 pd ` d1 qpd ´ 1q!pd1 ´ 1q! pd ` d1 q d´1 i“1 p´iq j“1 p´pd ´ jqjq which proves (4.13).  Remark 4.8. In the pertinent special cases, the theorem’s first statement confirms [9, Conjecture 1], whereas (4.12) confirms [9, Conjecture IV (topological form)]. 22 SEUNGJAI LEE AND CHRISTOPHER VOLL 4.5. Explicit examples. We record the following consequences of Theorem 4.2. Proposition 4.9 (pc, dq “ p2, 2q – Heisenberg). Ÿ Ÿ ζf2,2grpoq psq “ ζo2 psqI1 pt3 q “: W2,2gr pq, tq, 1 Ÿ Ÿ ζf2,2gr,red pY q “ W2,2gr p1, Y q “ p1 ´ 1 Ÿ ζf2,2gr,top psq “ Y q2 p1 3s2 ps ´ 1q ´ Y 3q , . Ÿ The global graded ideal zeta function ζf2,2grpOq psq “ ζK psqζK ps ´ 1qζK p3sq has abscissa of convergence 2 and meromorphic continuation to the whole complex plane. Proposition 4.10 (pc, dq “ p2, 3q). Ÿ Ÿ ζf2,3grpoq psq “ ζo3 psqI3 pq 2 t3 , q 2 t5 , t6 q “: W2,3gr pq, tq, Ÿ 1 ` 2Y 3 ` 2Y 5 ` Y 8 , p1 ´ Y q3 p1 ´ Y 3 qp1 ´ Y 4 qp1 ´ Y 5 qp1 ´ Y 6 q 1 Ÿ . ζf2,3gr,top psq “ 2 s ps ´ 1qps ´ 2qp3s ´ 2qp5s ´ 2q Ÿ ζf2,3gr,red pY q “ W2,3gr p1, Y q “ Ÿ The global graded ideal zeta function ζf2,3grpOq psq has abscissa of convergence 3 and may be continued meromorphically to ts P C | Repsq ą 1{3u. Ÿ Ÿ Remark 4.11. The formulae for ζf2,2grpoq resp. ζf2,3grpoq (for almost all p) are also given in [11, Table 2] under the labels m3 2 resp. m6 2 1. Ÿ We omit the (largish) formula for ζf2,4grpoq psq, but do note the following consequences. Proposition 4.12 (pc, dq “ p2, 4q). There exists a rational function W2,4 pX, Y q P QrX, Y s such that Ÿ Ÿ ζf2,4grpoq psq “ W2,4gr pq, q ´s q. Setting N2,4 pY q “ Y 33 `5Y 33 `12Y 28 `6Y 27 `15Y 26 `26Y 25 `11Y 24 `39Y 23 `40Y 22 `43Y 21 ` 62Y 20 ` 45Y 19 ` 66Y 18 ` 61pY 17 ` Y 16 q ` 66Y 15 ` 45Y 14 ` 62Y 13 ` 43Y 12 ` 40Y 11 ` 39Y 10 ` 11Y 9 ` 26Y 8 ` 15Y 7 ` 6Y 6 ` 12Y 5 ` 5Y 3 ` 1 P QrY s we have Ÿ Ÿ ζf2,4gr,red pY q “ W2,4gr p1, Y q “ Ÿ ζf2,4gr,top psq “ p1 ´ Y q4 p1 N2,4 pY q , ś i ´ Y 3 q 10 i“6 p1 ´ Y q 36s2 ´ 43s ` 12 3 . 10 s2 ps ´ 1q3 ps ´ 2qps ´ 3qp3s ´ 4q2 p2s ´ 1qp7s ´ 9qp9s ´ 5q The global graded ideal zeta function ζfŸ2,4 pOq psq has abscissa of convergence 4 and may be continued meromorphically to ts P C | Repsq ą 7{6u. ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 23 5. Two generators (d “ 2) Ÿ We compute the graded ideal zeta functions ζfc,2grpoq psq for c P t3, 4u as well as their reduced and topological counterparts. (For c “ 1 see (1.3), for c “ 2 see Proposition 4.9.) Proposition 5.1. ppc, dq “ p3, 2qq 1 ` t4 Ÿ “: W3,2gr pq, tq, p1 ´ t3 qp1 ´ qt4 qp1 ´ t5 q 1`Y4 Ÿ Ÿ ζf3,2gr,red pY q “ W3,2gr p1, Y q “ , p1 ´ Y q2 p1 ´ Y 3 qp1 ´ Y 4 qp1 ´ Y 5 q 2 Ÿ . ζf3,2gr,top psq “ 3 15s ps ´ 1qp4s ´ 1q Ÿ ζf3,2grpoq psq “ ζo2 psq The global graded ideal zeta function Ÿ ζf3,2grpOq psq “ ζK psqζK ps ´ 1qζK p3sqζK p4sqζK p4s ´ 1qζK p5sq ζK p8sq has abscissa of convergence 2 and meromorphic continuation to the whole complex plane. Proof. (sketch) Let f “ f3,2 and recall the Hall basis H3,2 for f from Table 2.1. Recall formula (2.2) for the zeta function of fpoq in terms of pairs pΛ2 , Λ3 q of sublattices of fpoqp2q – o and fpoqp3q – o2 , respectively. Note that |fpoqp2q : Λ2 | “ q µ for some µ P N0 , |fpoqp1q : XpΛ2 q| “ q 2µ , and pΛ2 , Λ3 q satisfies the condition in (2.2) if and only if pµ fpoqp3q ď Λ3 . (5.1) This proves the first claim; the others are trivial consequences.  Ÿ Remark 5.2. Comparison with ζfŸ3,2 poq psq (cf. [5, Theorem 2.35]) yields ζf3,2gr,red pY q “ ζfŸ3,2 ,red pY q. Note that the Hall basis H3,2 is nice and simple in the sense of [6]. The Ÿ formula for ζf3,2grpoq (for almost all p) is also given in [11, Table 2] under the label m5 3 1. Proposition 5.3. ppc, dq “ p4, 2qq Set N4,2 pX, Y q “ ´X 2 pY 22 ` Y 18 ` Y 17 ` Y 16 ` Y 15 ` Y 11 q ´ XpY 16 ` Y 15 ´ Y 13 ` Y 9 ´ Y 7 ´ Y 6 q ` Y 11 ` Y 7 ` Y 6 ` Y 5 ` Y 4 ` 1 P QrX, Y s. Then N4,2 pq, tq p1 ´ ´ ´ ´ qt5 qp1 ´ q 2 t6 qp1 ´ q 2 t7 qp1 ´ t8 q Y 17 ` Y 13 ` 2pY 12 ` Y 11 ` Y 10 ` Y 7 ` Y 6 ` Y 5 q ` Y 4 ` 1 Ÿ , ζf4,2gr,red pY q “ ś p1 ´ Y q2 8i“3 p1 ´ Y i q 1 p20s ´ 3q Ÿ ζf4,2gr,top psq “ . 4 60 s ps ´ 1qp5s ´ 1qp4s ´ 1qp7s ´ 2qp3s ´ 1q Ÿ ζf4,2grpoq psq “ ζo2 psq t3 qp1 qt4 qp1 t5 qp1 The global graded ideal zeta function ζfŸ4,2 pOq psq has abscissa of convergence 2 and may be continued meromorphically to ts P C | Repsq ą 2{11u. 24 SEUNGJAI LEE AND CHRISTOPHER VOLL Proof. (sketch) Let f “ f4,2 and recall the Hall basis H4,2 for f from Table 2.1. Recall formula (2.2) for the zeta function of fpoq in terms of triples pΛ2 , Λ3 , Λ4 q of sublattices of fpoqp2q – o, fpoqp3q – o2 , and fpoqp4q – o3 , respectively. Note that |fpoqp2q : Λ2 | “ q µ for some µ P N0 , |fpoqp1q : XpΛ2 q| “ q 2µ , and pΛ2 , Λ3 , Λ4 q satisfies the condition in (2.2) if and only if pΛ2 , Λ3 q satisfies (5.1) and rΛ3 , fpoqp1q s ď Λ4 . To investigate the latter condition, we may assume that Λ3 “ xπ ν1 xyx, π ν2 xyyyo for a partition ν “ pν1 , ν2 qě . Then rΛ3 , fpoqp1q s “ xπ ν1 xyxx, π ν1 xyxy, π ν2 xyyx, π ν2 xyyyyo As xyxy “ xyyx by the Jacobi identity, the underlined term may be omitted, whence rΛ3 , fpoqp1q s “ π ν1 xyxx ‘ π ν2 xyyx ‘ π ν2 xyyy. To enumerate the lattices Λ4 ď fpoqp4q satisfying rΛ3 , fpoqp1q s ď Λ4 , we distinguish according to the “overlap type” such a lattice may have with rΛ3 , fpoqp1q s. Indeed, if Λ4 has elementary divisor type given by a partition pξ1 , ξ2 , ξ3 qě , then either ν1 ě ν2 ě ξ 1 ě ξ 2 ě ξ 3 ν1 ě ξ 1 ą ν2 ě ξ 2 ě ξ 3 . or Each of the two cases is covered by a formula similar to the one established in Theorem 3.6. Adding them yields a formula for the zeta function, viz. Ÿ ζf4,2grpoq psq “ ζo2 psqI1 pt3 q ˜ ¨ ¸ ˆ ˙ 2 4 ˝ 5 2 6 2 7 8 I2 pqt , t qI3 pq t , q t , t q ` I1 pqt qI1 pqt qI1 pq t qI2 pq t , t q . 1 q´1 4 5 2 6 2 7 8 This proves the first claim; the others are trivial consequences. The claim about the meromorphic continuation follows from [5, Lemma 5.5].  6. General conjectures Let c P N and d P Ně2 . We record a number of general conjectures regarding the Ÿ graded ideal zeta functions ζfc,dgrpoq psq as well as their topological and reduced counterparts. We write W for the Witt function Wd (cf. (1.2)) and set r “ rkZ pfc,d q “ řc i“1 W piq. With the exception of Conjecture 6.7 for c “ 2 and d ě 5, all conjectures in this section are confirmed, in the relevant special cases, by the results in this paper. Ÿ Conjecture 6.1 (Uniformity). There exists Wc,dgr pX, Y q P QpX, Y q such that, for almost all primes p and all finite extensions o of Zp , Ÿ Ÿ ζfc,dgrpoq psq “ Wc,dgr pq, q ´s q. Conjecture 6.2 (Local functional equations). For almost all primes p and all finite extensions o of Zp , Ÿ ζfc,dgrpoq psq|qÑq´1 “ p´1qr q řc i“1 pW2piqq´ řc i“1 pc`1´iqW piqs Ÿ ζfc,dgrpoq psq. Remark 6.3. Local functional equations are a universal feature for quite general subring zeta functions ([16, Theorem A]) and for ideal zeta functions of nilpotent Lie rings of nilpotency class 2 ([16, Theorem C]). In fact, we expect that the proof of the latter result should carry over to the graded setting, making the functional equations (4.7) an ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 25 instance of a general phenomenon in class 2; cf. Example 1.6. If Conjecture 6.1 holds, then Conjecture 6.2 states that Ÿ Wc,dgr pX ´1 , Y ´1 q “ p´1qr X řc i“1 pW2piqq Y řc i“1 pc`1´iqW piq Ÿ Wc,dgr pX, Y q. In general, the operation q Ñ q ´1 is defined rather more delicately in terms of inversion of Frobenius eigenvalues. In nilpotency class greater than 2 local functional equations are not to be expected in general for ideal zeta functions of nilpotent Lie rings: see [5, Section 1.2.3] for counterexamples in the ungraded setting and [11, Table 2] in the graded setting. A sufficient criterion for local functional equations in an enumerative setup generalizing ideal zeta functions of nilpotent Lie rings is given in [17, Theorem 1.2]. It applies to the ideal zeta functions of the free nilpotent Lie rings fc,d ; [17, Theorem 4.4]. Note ř řc that, in the notation of this result, N0 “ r and c´1 i“0 Ni “ i“1 pc ` 1 ´ iqW piq. For the following conjecture, assume that Conjecture 6.1 holds. In this case, we may define the reduced graded ideal zeta function Ÿ Ÿ ζfc,dgr,red pY q “ Wc,dgr p1, Y q P QpY q. We expect that the technology in [6] may be adapted to define the reduced graded ideal zeta function even without the assumption of Conjecture 6.1. Ÿ Conjecture 6.4 (Reduced zeta function). The reduced graded ideal zeta function ζfc,dgr,red pY q has a pole of order r at 1 and there exist ei P N, i P rrs, as well as nonnegative integers ř ř aj P N0 , j P rN s0 , where N :“ p ri“1 ei q ´ cj“1 pc ` 1 ´ jqWd pjq, with a0 “ 1 and (6.1) aj “ aN ´j for all j P rN s0 and řN j Ÿgr j“0 aj Y ζfc,d ,red pY q “ śr . ei i“1 p1 ´ Y q Remark 6.5. The palindromic property (6.1) holds, of course, in particular if Conjecture 6.2 holds. What Conjecture 6.4 suggests is that the reduced graded ideal zeta funcŸ tions ζfc,dgr,red pY q share key properties with the Hilbert-Poincaré series of graded CohenMacaulay algebras. If there were such an algebra for each c, d, its Cohen-Macaulayness would explain the nonnegativity of the coefficients aj , whereas their palindromy would reflect its Gorensteinness (assuming that it is a domain; cf. [13]). Ÿgr pY q “ For c “ 2, the validity of Conjecture 6.4 may be seen from the facts that ζf2,d,red Ÿ ζf2,d,red pY q and the Hall basis H2,d for f2,d in Table 2.1 is nice and simple in the sense of [6]. Hence [6, Proposition 4.1] is applicable. The following is a graded analogue of [9, Conjecture I]. Conjecture 6.6 (Degree of topological zeta function). ¯ ´ Ÿ degs ζfc,dgr,top psq “ ´r. Conjecture 6.7 (Behaviour of topological zeta function at 8). ˇ ˇ ˇ ˇ Ÿ Ÿ P Qą0 . “ p1 ´ Y qr ζfc,dgr,red pY qˇ s´r ζfc,dgr,top ps´1 qˇ s“0 Y “1 26 SEUNGJAI LEE AND CHRISTOPHER VOLL Remark 6.8. We have no interpretation in terms of c and d for the numbers featuring in Conjecture 6.7. If Conjecture 6.4 were to hold for the reasons we explained in Remark 6.5, they were related to the “multiplicity” of the associated graded algebra. We close with two conjectures on the behaviour of p-adic and topological graded ideal zeta functions at s “ 0. Conjecture 6.9 (Behaviour of topological zeta function at zero). The topological graded Ÿ ideal zeta function ζfc,dgr,top psq has a pole of order c at s “ 0 with leading coefficient řc ś ˇ p´1q i“1 pW piq´1q ci“1 W piq ˇ c Ÿgr ´ ¯ “ś s ζfc,d ,top psqˇ . ři c s“0 j“1 W pjq pW piq ´ 1q! i“1 Remark 6.10. [9, Conjecture IV (topological form)] asserts that ζfŸc,d ,top psq has a simple pole at s “ 0 with residue ˇ p´1qr´1 ˇ “ . sζfŸc,d ,top psqˇ s“0 pr ´ 1q! Conjecture 6.11 (Behaviour of p-adic zeta function at zero). ˇ Ÿ śc ζf grpoq psq ˇˇ W piq c,d ¯. śc “ ś ´i“1 (6.2) ˇ ř i c i“1 ζoW piq psq ˇ W pjq s“0 i“1 j“1 Remark 6.12. [9, Conjecture IV (P-adic form)] asserts that ˇ ζfŸc,d poq psq ˇˇ “ 1. (6.3) ˇ ζor psq ˇ s“0 It seems remarkable that the right hand sides of both (6.2) and (6.3) are independent of o. Note that s “ 0 is outside the domain of convergence of the series defining ζfŸc,d poq psq Ÿ resp. ζfc,dgrpoq psq. Remark 6.13. Simply replacing the numbers W piq by the ranks of the successive quotients of the upper central series does not extend Conjectures 6.9 and 6.11 to graded ideal zeta functions of general (non-free) nilpotent Lie rings. Consider, for instance, the direct product L :“ f2,2 ˆ f2,2 . Then, for all primes p and all finite extensions o of Zp , 1 ´ t5 . p1 ´ t3 q2 p1 ´ qt5 q Indeed, L is the “fundamental graded Lie ring” m6 2 3, whose local graded ideal zeta functions are recorded (for almost all p) in [11, Section 10, Table 2]. Formula (6.4) may also easily be derived directly from formulae for the ideal zeta functions of L (cf. [5, Theorem 2.4]), using the comparison identities recorded in Example 1.6. In any case, ˇ p´1q3`1 4 ¨ 2 1 5 ˇ 2 Ÿgr ‰ “ . “ s ζL,top psqˇ 54 4 ¨ 6 ¨ 3! ¨ 1! 18 s“0 Likewise, ˇ Ÿgr psq ˇˇ ζLpoq 5 4¨2 1 “ ‰ “ . ˇ ˇ ζo4 psqζo2 psq 9 4¨6 3 (6.4) Ÿ gr psq “ ζo4 psq ζLpoq s“0 ENUMERATING GRADED IDEALS IN FREE NILPOTENT LIE RINGS 27 That this value, however, is a nonnegative rational number independent of o, as well as the coincidence ˇ ˇ 1 ˇ ˇ Ÿgr Ÿgr P Qą0 , pY qˇ “ “ p1 ´ Y q6 ζL,red ps´1 qˇ s´6 ζL,top Y “1 9 s“0 seem to indicate that some of the conjectures made in this section may have generalizations to more general graded ideal zeta functions. Acknowledgments Our work was supported by DFG Sonderforschungsbereich 701 “Spectral Structures and Topological Methods in Mathematics” at Bielefeld University. The first author was also supported by A23200000 fund from the National Institute for Mathematical Sciences. We acknowledge numerous helpful conversations with Tobias Rossmann. References [1] W. Bruns and J. Herzog, Cohen-Macaulay rings, Cambridge Studies in Advanced Mathematics, vol. 39, Cambridge University Press, Cambridge, 1993. [2] L. M. Butler, A unimodality result in the enumeration of subgroups of a finite abelian group, Proc. Amer. Math. Soc. 101 (1987), no. 4, 771–775. [3] M. P. F. du Sautoy, Counting p-groups and nilpotent groups, Publ. Math. I.H.E.S. 92 (2000), 63–112. [4] M. P. F. du Sautoy and F. J. Grunewald, Analytic properties of zeta functions and subgroup growth, Ann. of Math. (2) 152 (2000), 793–833. [5] M. P. F. du Sautoy and L. Woodward, Zeta functions of groups and rings, Lecture Notes in Mathematics, vol. 1925, Springer-Verlag, Berlin, 2008. [6] A. Evseev, Reduced zeta functions of Lie algebras, J. Reine Angew. Math. 633 (2009), 197–211. [7] F. J. Grunewald, D. Segal, and G. C. Smith, Subgroups of finite index in nilpotent groups, Invent. Math. 93 (1988), 185–223. [8] M. Hall Jr., A basis for free Lie rings and higher commutators in free groups, Proc. Amer. Math. Soc. 1 (1950), 575–581. [9] T. Rossmann, Computing topological zeta functions of groups, algebras, and modules, I, Proc. Lond. Math. Soc. (3) 110 (2015), no. 5, 1099–1134. , Stability results for local zeta functions of groups and related structures, arXiv:1504.04164, [10] 2015. [11] , Computing local zeta functions of groups, algebras, and modules, preprint, arXiv:1602.00919, 2016. [12] M. M. Schein and C. Voll, Normal zeta functions of the Heisenberg groups over number rings I – the unramified case, J. Lond. Math. Soc. (2) 91 (2015), no. 1, 19–46. [13] R. P. Stanley, Hilbert functions of graded algebras, Adv. Math. 28 (1978), 57–83. [14] C. Voll, Zeta functions of groups and enumeration in Bruhat-Tits buildings, Amer. J. Math. 126 (2004), 1005–1032. , Normal subgroup growth in free class-2-nilpotent groups, Math. Ann. 332 (2005), 67–79. [15] [16] , Functional equations for zeta functions of groups and rings, Ann. of Math. (2) 172 (2010), no. 2, 1181–1218. [17] , Local functional equations for submodule zeta functions associated to nilpotent algebras of endomorphisms, preprint, arXiv:1602.07025, 2016. [18] E. Witt, Treue Darstellung Liescher Ringe, J. Reine Angew. Math. 177 (1937), 152–160. 28 SEUNGJAI LEE AND CHRISTOPHER VOLL Mathematical Institute, Oxford University, OX2 6GG, United Kingdom Current address: National Institute for Mathematical Sciences, Daejeon 305-811, South Korea E-mail address: [email protected] Fakultät für Mathematik, Universität Bielefeld, D-33501 Bielefeld, Germany E-mail address: [email protected]
4math.GR
Differential Privacy on Finite Computers arXiv:1709.05396v1 [cs.DS] 15 Sep 2017 Victor Balcer∗ Salil Vadhan† Center for Research on Computation & Society School of Engineering & Applied Sciences Harvard University [email protected], salil [email protected] September 19, 2017 Abstract We consider the problem of designing and analyzing differentially private algorithms that can be implemented on discrete models of computation in strict polynomial time, motivated by known attacks on floating point implementations of real-arithmetic differentially private algorithms (Mironov, CCS 2012) and the potential for timing attacks on expected polynomialtime algorithms. We use a case study the basic problem of approximating the histogram of a categorical dataset over a possibly large data universe X . The classic Laplace Mechanism (Dwork, McSherry, Nissim, Smith, TCC 2006 and J. Privacy & Confidentiality 2017) does not satisfy our requirements, as it is based on real arithmetic, and natural discrete analogues, such as the Geometric Mechanism (Ghosh, Roughgarden, Sundarajan, STOC 2009 and SICOMP 2012), take time at least linear in |X |, which can be exponential in the bit length of the input. In this paper, we provide strict polynomial-time discrete algorithms for approximate histograms whose simultaneous accuracy (the maximum error over all bins) matches that of the Laplace Mechanism up to constant factors, while retaining the same (pure) differential privacy guarantee. One of our algorithms produces a sparse histogram as output. Its “per-bin accuracy” (the error on individual bins) is worse than that of the Laplace Mechanism by a factor of log |X |, but we prove a lower bound showing that this is necessary for any algorithm that produces a sparse histogram. A second algorithm avoids this lower bound, and matches the per-bin accuracy of the Laplace Mechanism, by producing a compact and efficiently computable representation of a dense histogram; it is based on an (n + 1)-wise independent implementation of an appropriately clamped version of the Discrete Geometric Mechanism. ∗ Supported by NSF grant CNS-1237235 and CNS-1565387. http://seas.harvard.edu/~ salil. Supported by NSF grant CNS-1237235, a Simons Investigator Award, and a grant from the Sloan Foundation. † 1 1 Introduction Differential Privacy [DMNS06] is by now a well-established framework for privacy-protective statistical analysis of sensitive datasets. Much work on differential privacy involves an interplay between statistics and computer science. Statistics provides many of the (non-private) analyses that we wish to approximate with differentially private algorithms, as well as probabilistic tools that are useful in analyzing such algorithms, which are necessarily randomized. From computer science, differential privacy draws upon a tradition of adversarial modeling and strong security definitions, techniques for designing and analyzing randomized algorithms, and considerations of algorithmic resource constraints (such as time and memory). Because of its connection to statistics, it is very natural that much of the literature on differential privacy considers the estimation of real-valued functions on real-valued data (e.g. the sample mean) and introduces noise from continuous probability distributions (e.g. the Laplace distribution) to obtain privacy. However, these choices are incompatible with standard computer science models for algorithms (like the Turing machine or RAM model) as well as implementation on physical computers (which use only finite approximations to real arithmetic, e.g. via floating point numbers). This discrepancy is not just a theoretical concern; Mironov [Mir12] strikingly demonstrated that common floating-point implementations of the most basic differentially private algorithm (the Laplace Mechanism) are vulnerable to real attacks. Mironov shows how to prevent his attack with a simple modification to the implementation, but this solution is specific to a single differentially private mechanism and particular floating-point arithmetic standard. His solution increases the error by a constant factor and is most likely more efficient in practice than the algorithm we will use to replace the Laplace Mechanism. However, he provides no bounds on asymptotic running time. Gazeau, Miller and Palamidessi [GMP16] provide more general conditions for which an implementation of real numbers and a mechanism that perturbs the correct answer with noise maintains differential privacy. However, they do not provide an explicit construction with bounds on accuracy and running time. From a theoretical point of view, a more appealing approach to resolving these issues is to avoid real or floating-point arithmetic entirely and only consider differentially private computations that involve discrete inputs and outputs, and rational probabilities. Such algorithms are realizable in standard discrete models of computation. However, some such algorithms have running times that are only bounded in expectation (e.g. due to sampling from an exponential distribution supported on the natural numbers), and this raises a potential vulnerability to timing attacks. If an adversary can observe the running time of the algorithm, it learns something about the algorithm’s coin tosses, which are assumed to be secret in the definition of differential privacy. (Even if the time cannot be directly observed, in practice an adversary can determine an upper bound on the running time, which again is information that is implicitly assumed to be secret in the privacy definition.) Because of these considerations, we advocate the following principle: Differential Privacy for Finite Computers: We should describe how to implement differentially private algorithms on discrete models of computation with strict bounds on running time (ideally polynomial in the bit length of the input) and analyze the effects of those constraints on both privacy and accuracy. Note that a strict bound on running time does not in itself prevent timing attacks, but once we have such a bound, we can pad all executions to take the same amount of time. Also, while standard discrete models of computation (e.g. randomized Turing machines) are defined in terms of countable 2 rather than finite resources (e.g. the infinite tape), if we have a strict bound on running time, then once we fix an upper bound on input length, they can indeed be implemented on a truly finite computer (e.g. like a randomized Boolean circuit). In many cases, the above goal can be achieved by appropriate discretizations and truncations applied to a standard, real-arithmetic differentially private algorithm. However, such modifications can have a nontrivial price in accuracy or privacy, and thus we also call for a rigorous analysis of these effects. In this paper, we carry out a case study of achieving “differential privacy for finite computers” for one of the first tasks studied in differential privacy, namely approximating a histogram of a categorical dataset. Even this basic problem turns out to require some nontrivial effort, particularly to maintain strict polynomial time, optimal accuracy and pure differential privacy when the data universe is large. We recall the definition of differential privacy. Definition 1.1. [DMNS06] Let M : X n → R be a randomized algorithm. We say M is (ε, δ)differentially private if for every two datasets D and D ′ that differ on one row and every subset S⊆R Pr[M(D) ∈ S] ≤ eε · Pr[M(D ′ ) ∈ S] + δ We say an (ε, δ)-differentially private algorithm satisfies pure differential privacy when δ = 0 and say it satisfies approximate differential privacy when δ > 0. In this paper, we study the problem of estimating the histogram of a dataset D ∈ X n , which is the vector c = c(D) ∈ NX , where cx is the number of rows in D that have value x. Histograms can be approximated while satisfying differential privacy using the Laplace Mechanism, introduced in the original paper of Dwork, McSherry, Nissim and Smith [DMNS06]. Specifically, to obtain (ε, 0)differential privacy, we can add independent noise distributed according to a Laplace distribution, specifically Lap(2/ε), to each component of c and output the resulting vector c̃. Here Lap(2/ε) is the continuous, real-valued random variable with probability density function f (z) that is proportional to exp(−ε · |z|/2). The Laplace Mechanism also achieves very high accuracy in two respects: Per-Query Error: For each bin x, with high probability we have |c̃x − cx | ≤ O(1/ε). Simultaneous Error: With high probability, we have maxx |c̃x − cx | ≤ O(log(|X |)/ε). Note that both of the bounds are independent of the number n of rows in the dataset, and so the fractional error vanishes linearly as n grows. Simultaneous error is the more well-studied notion in the differential privacy literature, but we consider per-query error to be an equally natural concept: if we think of the approximate histogram c̃ as containing approximate answers to the |X | different counting queries corresponding to the bins of X , then per-query error captures the error as experienced by an analyst who may be only interested in one or a few of the bins of c̃. The advantage of considering per-query error is that it can be significantly smaller than the simultaneous error, as is the case in the Laplace Mechanism when the data universe X is very large. It is known that both of the error bounds achieved by the Laplace Mechanism are optimal up to constant factors; no (ε, 0)-differentially private algorithm for histograms can achieve smaller per-query error or simultaneous error [HT10, BBKN14]. Unfortunately, the Laplace Mechanism uses real arithmetic and thus cannot be implemented on a finite computer. To avoid real arithmetic, we could use the Geometric Mechanism [GRS12], which adds noise to each component of c according to the 2-sided geometric distribution, Geo(2/ε), which is supported on the integers and has probability mass function f (z) ∝ exp(−ε·|z|/2). However, this 3 mechanism uses integers of unbounded size and thus cannot be implemented on a finite computer. Indeed, while the algorithm can be implemented with a running time that is bounded in expectation (after reducing ε so that eε/2 and hence all the probabilities are rational numbers), truncating long executions or allowing an adversary to observe the actual running time can lead to a violation of differential privacy. Thus, it is better to work with the Truncated Geometric Mechanism of Ghosh, Roughgarden and Soundararajan [GRS12], where we clamp each noisy count c̃x to the interval [0, n]. We observe that the resulting probability distribution of c̃x , supported on {0, 1, . . . , n}, can be described explicitly in terms of cx , ε and n, and it can be sampled in polynomial time using only integer arithmetic (after ensuring eε/2 is rational). Thus, we obtain: Theorem 1.2 (Bounded Geometric Mechanism, informal statement of Thm. 3.7). For every finite X , n and ε ∈ (0, 1], there is an (ε, 0)-differentially private algorithm M : X n → {0, 1, . . . , n}X for histograms achieving: • Per-query error O(1/ε). • Simultaneous error O(log |X |)/ε. • Strict running time |X | · poly(N ), where N is the bit length of the input (n, ε and a dataset D ∈ X n ). We note that while we only consider our particular definition of per-query accuracy, namely that with high probability |c̃x − cx | ≤ O(1/ε), Ghosh et al. [GRS12] proved that the output of the Bounded Geometric Mechanism can be used (with post-processing) to get optimal expected loss with respect to an extremely general class of loss functions and arbitrary priors. The same result applies to each individual noisy count c̃x output by our mechanism, since each bin is distributed according to the Bounded Geometric Mechanism (up to a modification of ε to ensure rational probabilities). The Bounded Geometric Mechanism is not polynomial time for large data universes X . Indeed, its running time (and output length) is linear in |X |, rather than polynomial in the bit length of data elements, which is log |X |. To achieve truly polynomial time, we can similarly discretize and truncate a variant of the Stability-Based Histogram of Bun, Nissim and Stemmer [BNS16]. This mechanism only adds Lap(2/ε) noise to the nonzero components of cx and then retains only the noisy values c̃x that are larger than a threshold t = Θ(log(1/δ)/ε). Thus, the algorithm only outputs a partial histogram, i.e. counts c̃x for a subset of the bins x, with the rest of the counts being treated as zero. By replacing the use of the Laplace Mechanism with the (rational) Bounded Geometric Mechanism as above, we can implement this algorithm in strict polynomial time: Theorem 1.3 (Stability-Based Histogram, informal statement of Thm. 5.2). For every finite X , n, ε ∈ (0, 1] and δ ∈ (0, 1/n), there is an (ε, δ)-differentially private algorithm M : X n → {0, 1, . . . , n}⊆X for histograms achieving: • Per-query error O(1/ε) on bins with true count at least O(log(1/δ)/ε). • Simultaneous error O(log(1/δ)/ε). • Strict running time poly(N ), where N is the bit length of the input (n, ε and a dataset D ∈ X n ). Notice that the simultaneous error bound of O(log(1/δ)/ε) is better than what is achieved by the Laplace Mechanism when δ > 1/|X |, and is known to be optimal up to constant factors in this 4 range of parameters (see Theorem 6.1). The fact that this error bound is independent of the data universe size |X | makes it tempting to apply even for infinite data domains X . However, we note that when X is infinite, it is impossible for the algorithm to have a strict bound on running time (as it needs time to read arbitrarily long data elements) and thus is vulnerable to timing attacks and is not implementable on a finite computer. Note also that the per-query error bound only holds on bins with large enough true count (namely, those larger than our threshold t); we will discuss this point further below. A disadvantage of the Stability-based Histogram is that it sacrifices pure differential privacy. It is natural to ask whether we can achieve polynomial running time while retaining pure differential privacy. A step in this direction was made by Cormode, Procopiuc, Srivastava and Tran [CPST11]. They observe that for an appropriate threshold t = Θ(log(|X |)/ε), if we run the Bounded Geometric Mechanism and only retain the noisy counts c̃x that are larger than t, then the expected number of bins that remain is less than n + 1. Indeed, the expected number of bins we retain whose true count is zero (“empty bins”) is less than 1. They describe a method to directly sample the distribution of the empty bins that are retained, without actually adding noise to all |X | bins. This yields an algorithm whose output length is polynomial in expectation. However, the output length is not strictly polynomial, as there is a nonzero probability of outputting all |X | bins. And it is not clear how to implement the algorithm in expected polynomial time, because even after making the probabilities rational, they have denominators of bit length linear in |X |. To address these issues, we consider a slightly different algorithm. Instead of trying to retain all noisy counts c̃x that are larger than some fixed threshold t, we retain the n largest noisy counts (since there are at most n nonzero true counts). This results in a mechanism whose output length is always polynomial, rather than only in expectation. However, the probabilities still have denominators of bit length linear in |X |. Thus, we show how to approximately sample from this distribution, to within an arbitrarily small statistical distance δ, at the price of a poly(log(1/δ)) increase in running time. Naively, this would result only in (ε, O(δ))-differential privacy. However, when δ is significantly smaller than 1/|R|, where R is the range of the mechanism, we can convert an (ε, δ)-differentially private mechanism to an (ε, 0)-differentially private mechanism by simply outputting a uniformly random element of R with small probability. (A similar idea for the case that |R| = 2 has been used in [KLN+ 11, CDK17].) Since our range is of at most exponential size (indeed at most polynomial in bit length), the cost in our runtime for taking δ ≪ 1/|R| is at most polynomial. With these ideas we obtain: Theorem 1.4 (Pure DP Histogram in Polynomial Time, informal statement of Thm. 4.14). For every finite X , n and ε ∈ (0, 2], there is an (ε, 0)-differentially private algorithm M : X n → {0, 1, . . . , n}⊆X for histograms achieving: • Per-query error O(1/ε) on bins with true count at least O(log(|X |)/ε). • Simultaneous error O(log(|X |)/ε). • Strict running time poly(N ), where N is the bit length of the input (n, ε and a dataset D ∈ X n ). Both Theorems 1.3 and 1.4 only retain per-query error O(1/ε) on bins with a large enough true count. We also prove a lower bound showing that this limitation is inherent in any algorithm that outputs a sparse histogram (as both of these algorithms do). Theorem 1.5 (Lower Bound on Per-Query Error for Sparse Histograms, Theorem 6.2). Suppose that there is an (ε, δ)-differentially private algorithm M : X n → {0, 1, . . . , n}X for histograms that 5 always outputs histograms with at most n′ nonempty bins and has per-query error at most E on all bins. Then   min{log |X |, log(1/δ)} E≥Ω , ε provided that ε > 0, ε2 > δ > 0 and |X | ≥ (n′ )2 . This lower bound is similar in spirit to a lower bound of [BBKN14], which shows that no (ε, 0)differentially private PAC learner for “point functions” (functions that are 1 on exactly one element of the domain) can produce sparse functions as hypotheses. To bypass this lower bound, we can consider algorithms that produce succinct descriptions of dense histograms. That is, the algorithm can output a polynomial-length description of a function c̃ : X → [0, n] that can be evaluated in polynomial time, even though X may be of exponential size. We show that this relaxation allows us to regain per-query error O(1/ε). Theorem 1.6 (Polynomial-Time DP Histograms with Optimal Per-Query Accuracy, informal statement of Thm. 7.3). For every finite X , n and ε ∈ (0, 1], there is an (ε, 0)-differentially private algorithm M : X n → H for histograms (where H is an appropriate class of succinct descriptions of histograms) achieving: • Per-query error O(1/ε). • Simultaneous error O(log(|X |)/ε). • Strict running time poly(N ), where N is the bit length of the input (n, ε and a dataset D ∈ X n ) for both producing the description of a noisy histogram c̃ ← M(D) and for evaluating c̃(x) at any point x ∈ X . The algorithm is essentially an (n+1)-wise independent instantiation of the Bounded Geometric Mechanism. Specifically, we release a function h : X → {0, 1}r selected from an (n + 1)-wise independent family of hash functions, and for each x ∈ X , we view h(x) as coin tosses specifying a sample from the Bounded Geometric Distribution. That is, we let S : {0, 1}r → [0, n] be an efficient sampling algorithm for the Bounded Geometric Distribution, and then c̃x = S(h(x)) is our noisy count for x. The hash function is chosen randomly from the family conditioned on values c̃x for the nonempty bins x, which we obtain by running the actual Bounded Geometric Mechanism on those bins. The (n + 1)-wise independence ensures that the behavior on any two neighboring datasets (which together involve at most n + 1 distinct elements of X ) are indistinguishable in the same way as in the ordinary Bounded Geometric Mechanism. The per-query accuracy comes from the fact that the marginal distributions of each of the noisy counts are the same as in the Bounded Geometric Mechanism. (Actually, we incur a small approximation error in matching the domain of the sampling procedure to the range of a family of hash functions.) As far as we know, the only other use of limited independence in constructing differentially private algorithms is a use of pairwise independence by [BBKN14] in differentially private PAC learning algorithms for the class of point functions. Although that problem is related to the one we consider (releasing a histogram amounts to doing “query release” for the class of point functions, as discussed below), the design and analysis of our algorithm appears quite different. (In particular, our analysis seems to rely on (n + 1)-wise independence in an essential way.) Another potential interest in our technique is as another method for bypassing limitations of synthetic data for query release. Here, we have a large family of predicates Q = {q : X → {0, 1}}, and are interested in differentially private algorithms that, given a dataset D = (x1 , . . . , xn ) ∈ X n , output a “summary” M(D) that allows one to approximate the answers to all of the counting queries 6 P q(D) = i q(xi ) associated with predicates q ∈ Q. For example, if Q is the family of point functions consisting of all predicates that evaluate to 1 on exactly one point in the data universe X , then this query release problem amounts to approximating the histogram of D. The fundamental result of Blum, Ligett, and Roth [BLR13] and successors show that this is possible even for families Q and data universes X that are of size exponential in n. Moreover, the summaries produced by these algorithms has the form of a synthetic dataset — a dataset D̂ ∈ X n̂ such that for every query q ∈ Q, we have q(D̂) ≈ q(D). Unfortunately, it was shown in [UV11] that even for very simple families Q of queries, such correlations between pairs of binary attributes, constructing such a differentially private synthetic dataset requires time exponential in the bitlength log |X | of data universe elements. Thus, it is important to find other ways of representing approximate answers to natural families Q of counting queries, which can bypass the inherent limitations of synthetic data, and progress along these lines was made in a variety of works [GRU12, CKKL12, HRS12, TUV12, CTUW14, DNT15]. Our algorithm, and its use of (n + 1)-wise independence, can be seen as yet another representation that bypasses a limitation of synthetic data (albeit a statistical rather than computational one). Indeed, a sparse histogram is simply a synthetic dataset that approximates answers to all point functions, and by Theorem 1.5, our algorithm achieves provably better per-query accuracy than is possible with synthetic datasets. This raises the question of whether similar ideas can also be useful in bypassing the computational limitations of synthetic data for more complex families of counting queries. 2 Preliminaries Throughout this paper, let N be the set {0, 1, . . .}, N+ be the set {1, 2, . . .}. For n ∈ N, let [n] be the nonstandard set {0, . . . , n}. Notice that |[n]| = n + 1. Given a set A and finite set B, we define AB to be the set of length |B| vectors over A indexed by the elements of B. 2.1 Differential Privacy We define a dataset D ∈ X n to be an ordered tuple of n ≥ 1 rows where each row is drawn from a discrete data universe X with each row corresponding to an individual. Two datasets D, D ′ ∈ X n are considered neighbors if they differ in exactly one row. Definition 2.1. [DMNS06] Let M : X n → R be a randomized algorithm. We say M is (ε, δ)differentially private if for every pair of neighboring datasets D and D ′ and every subset S ⊆ R Pr[M(D) ∈ S] ≤ eε · Pr[M(D ′ ) ∈ S] + δ We say an (ε, δ)-differentially private algorithm satisfies pure differential privacy when δ = 0 and say it satisfies approximate differential privacy when δ > 0. Intuitively, the ε captures an upper bound on an adversary’s ability to determine whether a particular individual is in the dataset. And the δ parameter represents an upper bound of the probability of a catastrophic privacy breach (e.g. the entire dataset is released). The common setting of parameters takes ε ∈ (0, 1] to be a small constant and δ to be negligible in n. The following properties of differentially private algorithms will be used in some of our proofs. Lemma 2.2 (post-processing [DMNS06]). Let M : X n → Y be (ε, δ)-differentially private and f : Y → Z be any randomized function. Then f ◦ M : X n → Z is (ε, δ)-differentially private. 7 Lemma 2.3 (group privacy [DMNS06]). Let M : X n → Y be (ε, δ)-differentially private. Let D1 , D2 ⊆ X n be datasets such that D2 can be obtained by changing at most m rows of D1 . Then for all S ⊆ Y Pr[M(D1 ) ∈ S] ≤ emε · Pr[M(D2 ) ∈ S] + emε · δ/ε Lemma 2.4 (composition [DL09]). Let M1 : X n → Y1 be (ε1 , δ1 )-differentially private and M2 : X n → Y2 be (ε2 , δ2 )-differentially private. Define M : X n → Y1 ×Y2 as M(D) = (M1 (D), M2 (D)) for all D ∈ X n . Then M is (ε1 + ε2 , δ1 + δ2 )-differentially private. 2.2 Histograms For x ∈ X , the point function cx : X n → N is defined to count the number of occurrences of x in a given dataset, i.e. for D ∈ X n cx (D) = |{i ∈ {1, . . . n} : Di = x}| In this paper we focus on algorithms for privately releasing approximations to the values of all point functions, also known as a histogram. A histogram is collection of bins, one for each element x in the data universe, with the xth bin consisting of its label x and a count cx ∈ N. 2.2.1 Representations The input to our algorithms is always a dataset (i.e. an element D ∈ X n ) and the outputs represent approximate histograms. We consider the following histogram representations as our algorithms’ outputs: • A vector in NX . We use {c̃x }x∈X to denote a histogram where c̃x ∈ N is the approximate count for the element x. • A partial vector h ∈ (X × N)∗ such that each element x ∈ X appears at most once in h with each pair (x, c̃x ) ∈ X × N interpreted as element x having approximate count c̃x . Elements x not listed in the partial vector are assumed to have count c̃x = 0. Implicitly an algorithm can return a partial vector by releasing bins for a subset of X . • A data structure, encoded as a string, which defines a function h : X → N where h(x), denoted hx , is the approximate count for x ∈ X and hx is efficiently computable given this data structure (e.g. time polynomial in the length of the data structure). In Section 7, this data structure consists of the coefficients of a polynomial, along with some parameters. Each representation is able to express any histogram over X . The difference between them is the memory used and the efficiency of computing a count. For example, computing the approximate count for x ∈ X , when using the data structure representation is bounded by the time it takes to compute the associated function. But when using partial vectors, one only needs to iterate through the vector to determine the approximate count. We define the following class of histograms. Let Hn,n′ (X ) ⊆ NX be the set of all histograms over X with integer counts in [0, n] (or N when n = ∞) and at most n′ of them nonzero. By using partial vectors each element of Hn,n′ (X ) can be stored in O(n′ · (log n + log |X |)) bits, which is shorter than the vector representation when n′ = o(|X |/ log |X |). 8 2.2.2 Accuracy In order to preserve privacy, our algorithms return histograms with noise added to the counts. Therefore, it is crucial to understand their accuracy guarantees. So given a dataset D ∈ X n we compare the noisy count c̃x = M(D)x of x ∈ X (the count released by algorithm M) to its true count, cx (D). We focus on the following two metrics: Definition 2.5. A histogram algorithm M : X n → NX has (a, β)-per-query accuracy if ∀D ∈ X n ∀x ∈ X Pr[|M(D)x − cx (D)| ≤ a] ≥ 1 − β Definition 2.6. A histogram algorithm M : X n → NX has (a, β)-simultaneous accuracy if ∀D ∈ X n Pr[∀x ∈ X |M(D)x − cx (D)| ≤ a] ≥ 1 − β Respectively, these metrics capture the maximum error for any one bin and the maximum error simultaneously over all bins. Even though simultaneous accuracy is commonly used in differential privacy, per-query accuracy has several advantages: • For histograms, one can provable achieve a smaller per-query error than is possible for simultaneous error. Indeed, the optimal simultaneous error for (ε, 0)-differentially private histograms is a = Θ (log(|X |/β)/ε) whereas the optimal per-query error is a = Θ (log(1/β)/ε), which is independent of |X | [HT10, BBKN14]. • Per-query accuracy may be easier to convey to an end user of differential privacy. For example, it is the common interpretation of error bars shown on a graphical depiction of a histogram. Figure 1: A histogram with error bars • For many algorithms (such as ours), per-query accuracy is good enough to imply optimal simultaneous accuracy. Indeed, an algorithm with (a, β)-per-query accuracy also achieves (a, β · |X |)-simultaneous accuracy (by a union bound). However, we may not always be able to achieve as good per-query accuracy as we want. So we will also use the following relaxation which bounds the error only on bins with large enough true count. Definition 2.7. A histogram algorithm M : X n → NX has (a, β)-per-query accuracy on counts larger than t if ∀D ∈ X n ∀x ∈ X s.t. cx (D) > t 2.3 Pr[|M(D)x − cx (D)| ≤ a] ≥ 1 − β Probability Terminology Definition 2.8. Let Z be an integer-valued random variable. 1. The probability mass function of Z, denoted fZ , is the function fZ (z) = Pr[Z = z] for all z ∈ Z. 9 2. The cumulative distribution function of Z, denoted FZ , is the function FZ (z) = Pr[Z ≤ z] for all z ∈ Z. 3. The support of Z, denoted supp(Z), is the set of elements for which f (z) 6= 0. Definition 2.9. Let Y and Z be random variables taking values in discrete range R. The total variation distance between Y and Z is defined as ∆(Y, Z) = max Pr[Y ∈ A] − Pr[Z ∈ A] A⊆R = 1 X Pr[Z = a] − Pr[Y = a] · 2 a∈R Lemma 2.10. Let Y and Z be random variables over discrete range R. Total variation distance has the following properties: 1. Y and Z are identically distributed, denoted Y ∼ Z, if and only if ∆(Y, Z) = 0. 2. Let T : R → R′ be any function with R′ discrete. Then ∆(T (Y ), T (Z)) ≤ ∆(Y, Z) 3. Let Y1 , Y2 , Z1 and Z2 be random variables over discrete range R. Then ∆((Y1 , Y2 ), (Z1 , Z2 )) ≤ ∆(Y1 , Z1 ) + 2.3.1 max a∈R,A⊆R Pr [Y2 ∈ A | Y1 = a] − Pr[Z2 ∈ A | Z1 = a] Sampling Because we are interested in the computational efficiency of our algorithms we need to consider the efficiency of sampling from various distributions. A standard method for sampling a random variable is via inverse transform sampling. Lemma 2.11. Let U be uniformly distributed on (0, 1]. Then for any integer-valued random variable Z we have FZ−1 (U ) ∼ Z where FZ−1 (u) is defined as min{z ∈ supp(Z) : FZ (z) ≥ u}. If Z, the random variable we wish to sample, has finite support we can compute the inverse cumulative distribution by performing binary search on supp(Z) to find the minimum. This method removes the need to compute the inverse function of the cumulative distribution function and is used in some of our algorithms. 2.3.2 Order Statistics Definition 2.12. Let Z1 , . . . , Zℓ be integer-valued random variables. The i-th order statistic of Z1 , . . . , Zℓ denoted Z(i) is the i-th smallest value among Z1 , . . . , Zℓ . Lemma 2.13. Let Z1 , . . . , Zℓ be i.i.d. integer-valued random variables with cumulative distribution function F . Then FZ(ℓ) (z) = (F (z))ℓ and ( 1 i FZ(i) |Z(i+1) =vi+1 ,...Z(ℓ) =vℓ (z) = FZ(i) |Z(i+1) =vi+1 (z) = F (z)/F (vi+1) for all 1 ≤ i < ℓ and vi+1 ≤ vi+2 ≤ . . . ≤ vℓ all in the support of Z1 . 10 if z > vi+1 otherwise From this lemma, we can iteratively sample random variables distributed identically to Z(ℓ) , Z(ℓ−1) , . . . , Z(i) without having to sample all ℓ of the original random variables. The inverse cumulative distributions for the order statistics are     −1 1/i −1 1/ℓ −1 u · F (v ) (u) = F F u (u) = F FZ−1 i+1 Z |Z =vi+1 ,...Z =vℓ (ℓ) (i) 2.4 (i+1) (ℓ) Two-Sided Geometric Distribution A common technique for creating differentially private algorithms is to perturb the desired output with appropriately scaled Laplace noise. Because our algorithms’ outputs are counts, we focus on a discrete analogue of the Laplace distribution as in [GRS12]. We say an integer-valued random variable Z follows a two-sided geometric distribution with scale parameter s centered at c ∈ Z (denoted Z ∼ c + Geo(s)) if its probability mass function fZ (z) is proportional to e−|z−c|/s . It can be verified that fZ and its cumulative distribution function FZ are ! ( 1/s e · e−(c−z)/s if z ≤ c e1/s − 1 −|z−c|/s e1/s +1 · e F (z) = fZ (z) = Z 1 1/s −(z−c)/s e +1 1 − 1/s · e otherwise e +1 for all z ∈ Z. When c is not specified, it is assumed to be 0. The inverse cumulative distribution of Z is (  s ln (u) + s ln e1/s + 1 − 1 if u ≤ 1/2 −1  FZ (u) = c +  1/s −s ln (1 − u) − s ln e + 1 otherwise or, equivalently, & FZ−1 (u) = c + s · sign(1/2 − u) ln(1 − |2u − 1|) + ln 2.5 e1/s + 1 2 !!' + ⌊2u⌋ − 1 Model of Computation We analyze the running time of our algorithms with respect to the w-bit word RAM model taking w = O(log N ) where N is the bit length of our algorithms’ inputs (D ∈ X n , ε and possibly some additional parameters). In this model, memory accesses and basic operations (arithmetic, comparisons and logical) on w-bit words are constant time. In addition, we assume the data universe X = [m] for some m ∈ N. Some parameters to our algorithms are rational. We represent rationals by pairs of integers. Because our algorithms require randomness, we assume that they have access to an oracle that when given a number d ∈ N+ returns a uniformly random integer between 1 and d inclusively. 3 The Geometric Mechanism In this section we show how to construct a differentially private histogram using the Laplace Mechanism only requiring integer computations of bounded length. As shown by Dwork, McSherry, Nissim and Smith [DMNS06], we can privately release a histogram by adding independent and appropriately scaled Laplace noise to each bin. Below we state a variant that uses discrete noise, formally studied in [GRS12]. 11 Algorithm 3.1. GeometricMechanism(D, ε) for D ∈ X n and ε > 0 1. For each x ∈ X , do the following: (a) Set c̃x to cx (D) + Geo(2/ε) clamped to the interval [0, n]. i.e.   if Zx ≤ 0 0 where Zx = cx (D) + Geo(2/ε). c̃x = n if Zx ≥ n   Zx otherwise (b) Release (x, c̃x ). Note that the output of this algorithm is a collection of bins (x, c̃x ) which represents a partial vector, but in this case we have a count for each x ∈ X so it defines a complete vector in Hn,|X |(X ) ⊆ NX . The privacy and accuracy properties of the algorithm are similar to those of the Laplace Mechanism. Theorem 3.2. GeometricMechanism(D, ε) has the following properties: i. GeometricMechanism(D, ε) is (ε, 0)-differentially private [GRS12]. ii. GeometricMechanism(D, ε) has (a, β)-per-query accuracy for   2 1 a= ln ε β iii. GeometricMechanism(D, ε) has (a, β)-simultaneous accuracy for      1 2 |X | 2 ln ln ≤ a= ε ε β 1 − (1 − β)1/|X | Proof of ii-iii. Let Z ∼ Geo(2/ε). For any x ∈ X Pr[|c̃x − cx (D)| ≤ a] ≥ Pr [|Z| ≤ ⌊a⌋] = 1 − 2 · Pr[Z ≤ −⌊a⌋ − 1] =1−2· Now, for a = l 2 ε ln β1 m Pr[|c̃x − cx (D)| ≤ a] ≥ 1 − e−⌊a⌋·ε/2 eε/2 + 1 2·β ≥1−β +1 eε/2 Part iii follows similarly after noting by independence of the counts that Pr[∀x ∈ X |c̃x − cx (D)| ≤ a] ≥ Pr[|Z| ≤ ⌊a⌋]|X | 12 The accuracy bounds up to constant factors match the lower bounds for releasing a differentially private histogram [HT10, BBKN14]. As presented above, this algorithm needs to store integers of unbounded size since Geo(2/ε) is unbounded in magnitude. As noted in [GRS12], by restricting the generated noise to a fixed range we can avoid this problem. However, even when the generated noise is restricted to a fixed range, generating this noise via inverse transform sampling may require infinite precision. By appropriately choosing ε, the probabilities of this noise’s cumulative distribution function can be represented with finite precision, and therefore generating this noise via inverse transform sampling only requires finite precision. Proposition 3.3. For k ∈ N, n ∈ N+ and c ∈ [n], the algorithm GeoSample(k, n, c) has output identically distributed to a two-sided geometric random variable with  scale parameter 2/ε̃ centered −k at c clamped to the range [0, n] where we define ε̃ = 2 · ln 1 + 2 . Morever, GeoSample(k, n, c) has running time poly(k, n). We have chosen ε̃ so that the cumulative distribution function of a two-sided geometric random variable with scale parameter 2/ε̃ clamped to [0, n] takes on only rational values with a common denominator d. Therefore, to implement inverse transform sampling on this distribution we only need to choose a uniformly random integer in {1, . . . , d} rather than a uniformly random variable over (0, 1]. Algorithm 3.4. GeoSample(k, n, c) for k ∈ N, n ∈ N+ and c ∈ [n] 1. Let d = (2k+1 + 1)(2k + 1)n−1 . 2. Define the function   k(c−z) 2k + 1 n+z−c  2 n−1−z+c F (z) = d − 2k(z−c+1) 2k + 1   d if 0 ≤ z ≤ c if c < z < n if z = n 3. Sample U uniformly at random from {1, . . . , d}. 4. Using binary search find the smallest z ∈ [n] such that F (z) ≥ U . 5. Return z. The function F is obtained by clearing denominators in the cumulative distribution function of c + Geo(2/ε̃) clamped to [0, n]. Lemma 3.5. Let F (z) be defined as in Algorithm 3.4. Then for z ∈ [n], F (z) ∈ [d] and F (z)/d equals the cumulative distribution function of c + Geo(2/ε̃) clamped to [0, n]. We prove this lemma after seeing how it implies Proposition 3.3. Proof of Proposition 3.3. Let U be drawn uniformly at random from {1, . . . , d}. By construction, for all z ∈ [n] Pr[GeoSample(k, n, c) ≤ z] = Pr[U ≤ F (z)] = F (z)/d 13 implying GeoSample(k, n, c) ∼ c + Geo(2/ε̃) by Lemma 3.5. We now bound the running time. Binary search takes O(log n) rounds. The largest number used is d with bit length O(nk) and all operations are polynomial in the bit length of these numbers. Therefore, GeoSample(k, n, c) has running time poly(k, n). Proof of Lemma 3.5. The cumulative distribution function   0     eε̃/2 · e−(c−z)·ε̃/2 ε̃/2 FZ (z) = e +1 1 1 − ε̃/2 · e(c−z)·ε̃/2  e +1    1 of Z ∼ c + Geo(2/ε̃) is if z < 0 if 0 ≤ z ≤ c if c < z < n if z ≥ n Consider the case when 0 ≤ z ≤ c. FZ (z) = −(c−z) 1 + 2−k  eε̃/2 −(c−z)ε̃/2 −k · e = · 1 + 2 2 + 2−k eε̃/2 + 1  k c−z 2k + 1 2 = k+1 · 2 +1 2k + 1 2k(c−z) = c−z−1 (2k+1 + 1) (2k + 1) n+z−c 2k(c−z) 2k + 1 = d F (z) = d ·  2k + 1 2k + 1 n−(c−z) A similar argument holds when c < z < n and FZ (n) = 1 = F (n)/d. So FZ (z) = F (z)/d for all z ∈ [n]. Using this algorithm we are ready to construct a private histogram algorithm with bounded time complexity whose accuracy is identical to that of GeometricMechanism up to constant factors. Algorithm 3.6. BoundedGeometricMechanism(D, ε) for D ∈ X n and rational ε ∈ (0, 1] 1. Let k = ⌈log(2/ε)⌉. 2. For each x ∈ X , do the following: (a) Let c̃x = GeoSample(k, n, cx (D)). (b) Release (x, c̃x ).  Theorem 3.7. Let rational ε ∈ (0, 1] and ε̃ = 2 · ln 1 + 2−⌈log(2/ε)⌉ ∈ (4/9 · ε, ε]. Then BoundedGeometricMechanism(D, ε) has the following properties: i. BoundedGeometricMechanism(D, ε) is (ε, 0)-differentially private. ii. BoundedGeometricMechanism(D, ε) has (a, β)-per-query accuracy for     1 2 1 9 ln ln a= ≤ ε̃ β 2ε β 14 iii. BoundedGeometricMechanism(D, ε) has (a, β)-simultaneous accuracy for     |X | 9 2 |X | ln ln ≤ a= ε̃ β 2ε β iv. BoundedGeometricMechanism(D, ε) has running time |X | · poly(N ) where N is the bit length of the algorithm’s input (D ∈ X n and ε). Proof of i-iii. By Proposition 3.3, GeoSample(k, n, cx(D)) generates a two-sided geometric random variable with scale parameter 2/ε̃ centered at cx (D) clamped to [0, n]. So this algorithm is identically distributed to GeometricMechanism(D, ε̃). As ε̃ ∈ (4/9 · ε, ε], parts i-iii follows from Theorem 3.2. Proof of iv. For each x ∈ X , computing cx (D) takes time O(n log |X |) and by Proposition 3.3 GeoSample(k, n, cx (D)) takes times poly(n, log(1/ε)) as k = O(log(1/ε)). 4 Improving the Running Time For datasets over large domains X , the linear in |X | running time of Algorithm 3.6 can be prohibitive. We present an algorithm that reduces the running time’s dependence on the universe size from nearly linear to poly-logarithmic based on the observation that most counts are 0 when n ≪ |X |; this is the same observation made by Cormode, Procopiuc, Srivastava and Tran [CPST11] to output sparse histograms. 4.1 Sparse Histograms We start by reducing the output length of GeometricMechanism to release only the bins with the heaviest (or largest) counts (interpreted as a partial vector). Algorithm 4.1. KeepHeavy(D, ε) for D ∈ X n and ε > 0 1. For each x ∈ X , set c̃x to cx (D) + Geo(2/ε) clamped to [0, n]. 2. Let x1 , . . . , xn+1 be the elements of X with the largest counts in sorted order, i.e. c̃x1 ≥ c̃x2 ≥ . . . ≥ c̃xn+1 ≥ max x∈X \{x1 ,...,xn+1 } c̃x 3. Release h = {(x, c̃x ) : c̃x > c̃xn+1 } ∈ Hn,n (X ). Observe that the output length has been improved to O(n · (log n + log |X |)) bits compared to the O(|X | · log n) bits needed to represent the outputs of GeometricMechanism. Theorem 4.2. KeepHeavy(D, ε) has the following properties: i. KeepHeavy(D, ε) is (ε, 0)-differentially private. 15 ii. KeepHeavy(D, ε) has (a, β)-per-query accuracy on counts larger than t for     2 2 2 2|X | ln ln and a = t=2 ε β ε β iii. KeepHeavy(D, ε) has (a, β)-simultaneous accuracy for   2 |X | a=2 ln ε β Note that, unlike GeometricMechanism, this algorithm only has (O(log(1/β)/ε), β)-per-query accuracy on counts larger than t = O(log(|X |/β)/ε). This loss is necessary for any algorithm that outputs a sparse histogram as we will show in Theorem 6.2. Proof of i. Privacy follows from the (ε, 0)-differential privacy of GeometricMechanism (part i of Theorem 3.2) along with differential privacy’s closure under post-processing (Lemma 2.2). To prove the remaining parts, we start with the following lemma. l m | Lemma 4.3. For any β ′ ∈ (0, 1), let t′ = 2 2ε ln |X and define the event β′ Et′ = {∀x ∈ X |c̃x − cx (D)| ≤ t′ /2} Pr[Et′ ] ≥ 1 − β ′ and Et′ implies that for all x ∈ X such that cx (D) > t′ we have c̃x > c̃xn+1 . Proof. The probability of Et′ occurring follows from part iii of Theorem 3.2 as the {c̃x }x∈X are identically distributed to the output of GeometricMechanism(D, ε). Assume the event Et′ . Then for all x ∈ X such that cx (D) > t′ , we have c̃x > t′ /2 and for all x ∈ X such that cx (D) = 0, we have c̃x ≤ t′ /2. Because there are at most n distinct elements in D, we have c̃x > c̃xn+1 for all x ∈ X such that cx (D) > t′ . Proof of part ii of Theorem 4.2. Let x ∈ X such that cx (D) > t. We have  Pr (|hx − cx (D)| > a) ≤ Pr c̃x ≤ c̃xn+1 + Pr (|c̃x − cx (D)| > a) ≤ β/2 + β/2 by Lemma 4.3 with β ′ = β/2 and t′ = t, and part ii of Theorem 3.2. Proof of part iii of Theorem 4.2. Let t = 2 ⌈(2/ε) · ln(|X |/β)⌉. The event Et in Lemma 4.3 occurs with probability at least 1 − β. Assume Et . By Lemma 4.3, for all x ∈ X such that cx (D) > t we have c̃x > c̃xn+1 . This implies |hx − cx (D)| ≤ t/2. For the remaining x ∈ X we trivially have |hx − cx (D)| ≤ t as hx = 0. However, as described KeepHeavy still requires adding noise to the count of every bin. The following algorithm M1 : X n × (0, 1] → Hn,n (X ) simulates KeepHeavy by generating a candidate set of heavy bins from which only the heaviest are released. This candidate set is constructed from all bins with nonzero true count and a sample representing the bins with a true count of 0 that have the heaviest noisy counts. 16 Algorithm 4.4. M1 (D, ε) for D ∈ X n , ε > 0 and |X | ≥ 2n + 1 1 1. Let A = {x ∈ X : cx (D) > 0} and w = |X \ A|. 2. For each x ∈ A, set c̃x to cx (D) + Geo(2/ε) clamped to [0, n]. 3. Pick a uniformly random sequence (q0 , . . . , qn ) of distinct elements from X \ A. 4. Sample (c̃q0 , . . . , c̃qn ) from the joint distribution of the order statistics (Z(w) , . . . , Z(w−n) ) where Z1 , . . . , Zw are i.i.d. and distributed as Geo(2/ε) clamped to [0, n]. 5. Sort the elements of A ∪ {q0 , . . . , qn } as x1 , . . . , x|A|+n+1 such that c̃x1 ≥ . . . ≥ c̃x|A|+n+1 . 6. Release h = {(x, c̃x ) : x ∈ {x1 , . . . , xn } and c̃x > c̃xn+1 } ∈ Hn,n (X ).2 Proposition 4.5. M1 (D, ε) is identically distributed to KeepHeavy(D, ε). Proof. Let {ĉx }x∈X be the noisy counts set by KeepHeavy(D, ε) and let x̂1 , . . . , x̂n+1 be the sorted ordering defined by these counts. We have c̃x ∼ ĉx for all x ∈ A and the Zi ’s are identically distributed to {ĉx }x∈X \A . {(qi , c̃qi )}ni=0 is identically distributed to the n + 1 bins with heaviest counts of {(x, ĉx )}x∈X \A . Let the random variable B be the set of the labels of the n + 1 bins with heaviest counts of {(x, ĉx )}x∈X \A . Therefore, h = {(x, c̃x ) : x ∈ {x1 , . . . , xn } and c̃x > c̃xn+1 } = {(x, c̃x ) : x ∈ A ∪ {q0 , . . . , qn } and c̃x ≥ c̃xn+1 } ∼ {(x, ĉx ) : x ∈ A ∪ B and ĉx ≥ ĉx̂n+1 } = {(x, ĉx ) : x ∈ X and ĉx ≥ ĉx̂n+1 } which shows that M1 (D, ε) is identically distributed to KeepHeavy(D, ε). In order to sample from the order statistics used by M1 we construct the following algorithm similar to GeoSample (Algorithm 3.4) from the previous section. Proposition 4.6. Let k ∈ N and n, w ∈ N+ . Let v ∈ [n] and i ∈ {1, . . . , w}. Define the i.i.d. random variables Z1 , . . . , Zw with each identically distributed to Geo(2/ε̃) clamped to [0, n] where ε̃ = 2 · ln(1 + 2−k ). The following subroutine OrdSample(k, n, v, i) is identically distributed to the i-th order statistic Z(i) conditioned on Z(i+1) = v. Also, OrdSample(k, n, v, i) has running time poly(n, k, i). 1 |X | ≥ 2n + 1 ensures that |X \ A| ≥ n + 1. One can use GeometricMechanism(D, ε) when |X | ≤ 2n. If instead we used continuous noise this last step is equivalent to releasing the n heaviest bins. However, in the discrete case, where ties can occur, from the set A ∪ {x1 , . . . , xn } we cannot determine all bins with a count tied for the n-th heaviest as there may be many other noisy counts tied with c̃xn . As a result, we only output the bins with a strictly heavier count than c̃xn+1 . 2 17 As in BoundedGeometricMechanism (Algorithm 3.6), we have chosen ε̃ so that the cumulative distribution function of Geo(2/ε̃) takes rational values with a common denominator of d. Therefore, the cumulative distribution function of Z(i) conditioned on Z(i+1) = v is also rational and we can sample from it with finite precision. Algorithm 4.7. OrdSample(k, n, v, i) for k ∈ N; n, i ∈ N+ and v ∈ [n] 1. Let d = (2k+1 + 1)(2k + 1)n−1 . 2. Define the function ( n−1−z d − 2k(z+1) 2k + 1 F (z) = d if 0 ≤ z < n if z = n 3. Sample U uniformly at random from {1, . . . , F (v)i }. 4. Using binary search find the smallest z ∈ [v] such that F (z)i ≥ U . 5. Return z. Proof. By Lemma 3.5, F (z)/d is the cumulative distribution of Geo(2/ε̃) clamped to [0, n]. Therefore, by Lemma 2.13, FZ(i) |Z(i+1) =v (z) =  F (z)/d F (v)/d i =  F (z) F (v) i for z ∈ [v]. Let U be drawn uniformly at random from {1, . . . , F (v)i }. Then, by construction, i Pr[OrdSample(k, n, v, i) ≤ z] = Pr[U ≤ F (z) ] =  F (z) F (v) i implying OrdSample(k, n, v, i) ∼ Z(i) | Z(i+1) = v. The binary search takes O(log n) iterations. Each iteration has running time polynomial in the bit length of the numbers used. Therefore, this algorithm has running time poly(log d, i) = poly(n, k, i). Now from M1 we replace sampling from the joint distribution of the order statistics with iterative calls to OrdSample to get the following algorithm. 18 Algorithm 4.8. M2 (D, ε) for D ∈ X n , rational ε ∈ (0, 1] and |X | ≥ 2n + 1 1. Let k = ⌈log(2/ε)⌉. 2. Let A = {x ∈ X : cx (D) > 0} and w = |X \ A|. 3. For each x ∈ A, let c̃x = GeoSample(k, n, cx (D)). 4. Pick a uniformly random sequence (q0 , . . . , qn ) of distinct elements from X \ A. 5. Let c̃q0 = OrdSample(k, n, n, w). 6. For each i ∈ {1, . . . , n}, let c̃qi = OrdSample(k, n, c̃qi−1 , w − i). 7. Sort the elements of A ∪ {q0 , . . . , qn } as x1 , . . . , x|A|+n+1 such that c̃x1 ≥ . . . ≥ c̃x|A|+n+1 . 8. Release h = {(x, c̃x ) : x ∈ {x1 , . . . , xn } and c̃x > c̃xn+1 } ∈ Hn,n (X ). Theorem 4.9. Let rational ε ∈ (0, 1] and ε̃ = 2 · ln(1 + 2−⌈log(2/ε)⌉ ) ∈ (4/9 · ε, ε]. M2 (D, ε) is identically distributed to KeepHeavy(D, ε̃). Therefore, i. M2 (D, ε) is (ε, 0)-differentially private. ii. M2 (D, ε) has (a, β)-per-query accuracy on counts larger than t for     2 2 2 2|X | ln ln and a = t=2 ε̃ β ε̃ β iii. M2 (D, ε) has (a, β)-simultaneous accuracy for   2 |X | ln a=2 ε̃ β Proof. By Proposition 4.6, we have (c̃q0 , . . . , c̃qn ) is identically distributed to the joint distribution (Z(w) , . . . , Z(w−n) ) used by M1 . Therefore, this algorithm is identically distributed to M1 (D, ε̃) and, then by Proposition 4.5, identically distributed to KeepHeavy(D, ε̃). Parts i to iii follow from Theorem 4.2. This algorithm only has an output of length O(n · (log n + log |X |)). However, its running time depends polynomially on |X | since sampling the wth order statistic, c̃q0 , using OrdSample takes time polynomial in w ≥ |X | − n. Indeed, this is necessary since the distribution of the order statistic Z(w) has probabilities that are exponentially small in w. 3 4.2 An Efficient Approximation To remedy the inefficiency of M2 we consider an efficient algorithm that approximates the output distribution of M2 . 3 Notice Pr[Z(w) = 0] = Pr[Z = 0]w where Z ∼ Geo(2/ε̃). And Pr[Z = 0]w = coins to sample from this distribution. 19  eε̃/2 −1 eε̃/2 +1 w . So we need to toss Ω(w) Theorem 4.10. There exists an algorithm NonzeroGeometric : X n × (0, 1] × (0, 1) → Hn,n (X ) such that for all input datasets D ∈ X n , rational ε ∈ (0, 1] and δ ∈ (0, 1) such that 1/δ ∈ N i. ∆ (M2 (D, ε), NonzeroGeometric(D, ε, δ)) ≤ δ. ii. NonzeroGeometric(D, ε, δ) is (ε, (eε + 1) · δ)-differentially private. iii. Moreover, the running time of NonzeroGeometric(D, ε, δ) is poly(N ) where N is the bit length of this algorithm’s input (D, ε and δ). Note that this algorithm only achieves (ε, δ)-differential privacy. By reducing δ, the algorithm better approximates M2 , improving accuracy, at the cost of increasing running time (polynomial in log(1/δ)). This is in contrast to most (ε, δ)-differentially private algorithms such as the stability based algorithm of Section 5, where one needs n ≥ Ω(log(1/δ)/ε) to get any meaningful accuracy. Now, we convert NonzeroGeometric to a pure differentially private algorithm by mixing it with a uniformly random output inspired by a similar technique in [KLN+ 11, CDK17]. Algorithm 4.11. M∗ (D, γ) for D ∈ X n and rational γ ∈ (0, 1) 1. With probability 1 − γ release M′ (D). 2. Otherwise release a uniformly random element of R. Lemma 4.12. Let M : X n → R be (ε, 0)-differentially private with discrete range R. Suppose algorithm M′ : X n → R satisfies ∆ (M(D), M′ (D)) ≤ δ for all input datasets D ∈ X n with parameter δ ∈ [0, 1). Then the algorithm M∗ has the following properties: i. M∗ (D, γ) is (ε, 0)-differentially private whenever δ≤ eε − 1 γ 1 · · eε + 1 1 − γ |R| ii. M∗ (D, γ) has running time upper bounded by the sum of the bit length to represent γ, the running time of M′ (D) and the time required to sample a uniformly random element of R. By taking γ and δ small enough and satisfying the constraint in part i, the algorithm M∗ satisfies pure differential privacy and has nearly the same utility as M (due to having a statistical distance at most γ + δ from M) while allowing for a possibly more efficient implementation since we only need to approximately sample from the output distribution of M. Proof of i. For all neighboring datasets D, D ′ ∈ X n and all r ∈ R 1 |R| 1 ≤γ· |R| 1 ≤γ· |R| 1 ≤γ· |R| Pr[M∗ (D, γ) = r] = γ · + (1 − γ) · Pr[M′ (D) = r] + (1 − γ) · (Pr[M(D) = r] + δ) + (1 − γ) eε · Pr[M(D ′ ) = r] + δ    + (1 − γ) eε · Pr[M′ (D ′ ) = r] + δ + δ 20 Rearranging terms and using the upper bound on δ yields 1 + (eε + 1) (1 − γ) · δ |R|   1 1 ε ′ ′ ε ≤ e (1 − γ) · Pr[M (D ) = r] + γ · + (e − 1) γ · |R| |R|   1 = eε (1 − γ) · Pr[M′ (D ′ ) = r] + γ · |R| ε ∗ ′ = e · Pr[M (D , γ) = r] Pr[M∗ (D, γ) = r] = eε (1 − γ) · Pr[M′ (D ′ ) = r] + γ · Proof of ii. This follows directly from the construction of M∗ . We can apply this lemma to NonzeroGeometric and under reasonable settings of parameters get accuracy bounds identical to M2 up to constant factors. Algorithm 4.13. PureNonzeroGeometric(D, ε, β) for D ∈ X n , rational ε ∈ (0, 1] and 1/β ∈ N 1. With probability 1 − β/3 release NonzeroGeometric(D, ε, δ) with δ= 2−⌈log(1/ε)⌉ β 1 · · 3 3 |Hn,n (X )| 2. Otherwise release a uniformly random element of Hn,n (X ).  Theorem 4.14. Let rational ε ∈ (0, 1], ε̃ = 2 · ln 1 + 2−⌈log(2/ε)⌉ ∈ (4/9 · ε, ε] and 1/β ∈ N. PureNonzeroGeometric(D, ε, β) has the following properties: i. PureNonzeroGeometric(D, ε, β) is (ε, 0)-differentially private. ii. PureNonzeroGeometric(D, ε, β) has (a, β)-per-query accuracy on counts larger than t for     2 6 2 6|X | ln ln and a = t=2 ε̃ β ε̃ β iii. PureNonzeroGeometric(D, ε, β) has (a, β)-simultaneous accuracy for   2 3|X | a=2 ln ε̃ β iv. PureNonzeroGeometric(D, ε, β) has running time poly(N ) where N is the bit length of this algorithm’s input (D ∈ X n , ε and β). Proof of i. Notice that 1/δ ∈ N (a constraint needed for NonzeroGeometric). Privacy follows from Lemma 4.12 by taking M = M2 , M′ = NonzeroGeometric, γ = β/3 and R = Hn,n (X ) as δ= 1 eε − 1 β/3 1 2−⌈log(1/ε)⌉ β · · ≤ ε · · 3 3 |Hn,n (X )| e + 1 1 − β/3 |Hn,n (X )| 21 Proof of ii-iii. For any D ∈ X n and x ∈ X such that cx (D) > t define the set G = {h ∈ Hn,n (X ) : |hx − cx (D)| ≤ a}. By construction, Pr[PureNonzeroGeometric(D, ε, β) ∈ G] ≥ Pr[NonzeroGeometric(D, ε, δ) ∈ G] − β/3 where δ is defined in Algorithm 4.13. Notice that δ ≤ β/3. So by Theorem 4.10, Pr[NonzeroGeometric(D, ε, δ) ∈ G] − β/3 ≥ Pr[M2 (D, ε) ∈ G] − 2 · β/3 And by part ii of Theorem 4.9, we have Pr[M2 (D, ε) ∈ G] − 2 · β/3 ≥ 1 − β Similarly, we can bound the simultaneous accuracy by using part iii of Theorem 4.9. Proof of iv. By Lemma A1.1, it takes poly(n, log |X |) time to sample a uniformly random element of Hn,n (X ) and compute |Hn,n (X )|. And by Theorem 4.10, NonzeroGeometric(D, ε, δ) with δ= 2−⌈log(1/ε)⌉ β 1 · · 3 3 |Hn,n (X )| has running time poly(N ). So by Lemma 4.12, PureNonzeroGeometric has the desired running time. 4.3 Construction of NonzeroGeometric We finish this section with the construction of NonzeroGeometric. Notice that M2 passes arguments to OrdSample that result in OrdSample exponentiating an integer, which represents the numerator of a fraction a/b = F (z)/F (v), to a power i ≥ |X | − n. We want to ensure that numbers used by OrdSample do not exceed some maximum s. The following algorithm will approximate s · (a/b)i by using repeated squaring and truncating each intermediate result to keep the bit length manageable. The following lemma provides a bound on the error and on the running time. Proposition 4.15. There is an algorithm ExpApprox(a, b, i, s) such that for all b, i, s ∈ N+ and a ∈ [b]: i. ExpApprox(a, b, i, s) is a nondecreasing function in a and ExpApprox (a, b, i, s) = s when a = b. ii. ExpApprox(a, b, i, s) satisfies the accuracy bound of   i ExpApprox (a, b, i, s)  a i ≤2· − s b s iii. ExpApprox(a, b, i, s) has running time poly(log b, log i, log s). Proof. The algorithm is defined as follows. Algorithm 4.16. ExpApprox(a, b, i, s) for b, i, s ∈ N+ and a ∈ [b]   1. If i = 1 return as b . (  r 2 /s  2. Otherwise let r = ExpApprox (a, b, ⌊i/2⌋, s) and return  (a/b) · (r 2 /s) 22 if i is even if i is odd Proof of i. We proceed by induction. The case when i = 1 is trivial. Let i > 1 and assume that ExpApprox(a, b, j, s) is a nondecreasing function in a for all j < i. Consider a ≤ a′ ≤ b. If i is odd, then   a ExpApprox(a, b, ⌊i/2⌋, s)2 · ExpApprox(a, b, i, s) = b s   ′ a ExpApprox(a′ , b, ⌊i/2⌋, s)2 · = ExpApprox(a′ , b, i, s) ≤ b s Likewise, the result holds when i is even. Therefore, ExpApprox(a, b, i, s) is a nondecreasing function in a. It is trivial that ExpApprox (a, b, i, s) = s when a = b. Proof of ii. For ease of notation define EA(i) = ExpApprox (a, b, i, s) as the other parameters do not change in our analysis. By construction EA (i) = ( 1 where mi = a/b mi · EA (⌊i/2⌋)2 + ωi s if i is even and |ωi | ≤ 1. We can now bound the error as if i is odd EA (i)  a i EA (i) mi · EA (⌊i/2⌋)2 mi · EA (⌊i/2⌋)2  a i ≤ − − − + s b s s2 s2 b EA (⌊i/2⌋)  a ⌊i/2⌋ EA (⌊i/2⌋)  a ⌊i/2⌋ |ωi | + mi · + · − ≤ s s b s b   ⌊i/2⌋ EA (⌊i/2⌋) a 1 − ≤ +2· s s b When i = 1, we have EA(1) a = − s b as b + ω1 a 1 ≤ − s b s So solving the recurrence gives   i EA (i)  a i ≤2· − s b s Proof of iii. The running time follows from the observation that a call to ExpApprox (a, b, i, s) makes at most O(log i) recursive calls with the remaining operations polynomial in the bit lengths of the numbers used. Now we can modify OrdSample using ExpApprox to keep the bit lengths of its numbers from becoming too large, yielding an efficient algorithm whose output distribution is close to that of OrdSample. 23 Algorithm 4.17. ApproxOrdSample(k, n, v, i, s) for k, n, i, s ∈ N+ and v ∈ [n] 1. Let d = (2k+1 + 1)(2k + 1)n−1 . 2. Define the function ( n−1−z d − 2k(z+1) 2k + 1 F (z) = d if 0 ≤ z < n if z = n 3. Sample U uniformly from {1, . . . , s}. 4. Using binary search find the smallest z ∈ [v] such that ExpApprox (F (z), F (v), i, s) ≥ U 5. Return z. Proposition 4.18. Let k, n, i, s ∈ N+ and v ∈ [n]. Then   i ∆(OrdSample(k, n, v, i), ApproxOrdSample(k, n, v, i, s)) ≤ 2 · (n + 1) · s In addition, ApproxOrdSample(k, n, v, i, s) has a running time of poly(k, n, log i, log s). Proof. Let Y ∼ OrdSample(k, n, v, i) and Ye ∼ ApproxOrdSample(k, n, v, i, s). Let z ∈ [v]. Then Pr[Y = z] =  F (z) F (v) i −  F (z − 1) F (v) i where we define F (−1) = 0. By part i of Proposition 4.15, ExpApprox(F (z), F (v), i, s) is an increasing function in z. Therefore, Pr[Ye = z] = ExpApprox(F (z), F (v), i, s) ExpApprox(F (z − 1), F (v), i, s) − s s Therefore, by the triangle inequality and part ii of Proposition 4.15 | Pr[Y = z] − Pr[Ye = z]| ≤ z X z ′ =z−1 ExpApprox(F (z ′ ), F (v), i, s) − s  F (z ′ ) F (v) i   i ≤4· s Summing over z ∈ [v] yields the desired bound on total variation distance (Definition 2.9). The running time is dominated by the O(log n) calls to ExpApprox(F (z), F (v), i, s). By part iii of Proposition 4.15, each call takes time poly(log F (v), log i, log s) = poly(k, n, log i, log s) as log F (v) ≤ log d = O(nk). So overall ApproxOrdSample has the desired running time. Because M2 samples from a joint distribution obtained by iterated calls to OrdSample we must also consider the accumulated distance between iterated calls to OrdSample and iterated calls to ApproxOrdSample. 24 Corollary 4.19. Let k, n, w, s ∈ N+ with w > n. Consider the following random variables: • Y0 ∼ OrdSample(k, n, n, w) • Yj ∼ OrdSample(k, n, Yj−1 , w − j) for each j ∈ {1, . . . , n} • Ye0 ∼ ApproxOrdSample(k, n, n, w, s) • Yej ∼ ApproxOrdSample(k, n, Yej−1 , w − j, s) for each j ∈ {1, . . . , n} Then w   ∆ (Y0 , . . . , Yn ), (Ye0 , . . . , Yen ) ≤ 2 · (n + 1)2 · s Proof. By part iii of Lemma 2.10 and Proposition 4.18, n w    X  e e e ∆ Yj |Yj−1 , Yej |Yej−1 ≤ 2 · (n + 1)2 · ∆ (Y0 , . . . , Yn ), (Y0 , . . . , Yn ) ≤ ∆ Y0 , Y0 + s j=1 where  ∆ Yj |Yj−1 , Yej |Yej−1 = max x∈[n],S⊆[n] n Pr[Yj ∈ S|Yj−1 = x] − Pr[Yej ∈ S|Yej−1 = x]} o We are ready to state the mechanism NonzeroGeometric and show it satisfies Theorem 4.10. It is identical to M2 except we replace calls to OrdSample with calls to ApproxOrdSample. Algorithm 4.20. NonzeroGeometric(D, ε, δ) for D ∈ X n , rational ε ∈ (0, 1], 1/δ ∈ N and |X | ≥ 2n + 1 1. Let k = ⌈log(2/ε)⌉ and s = 2 · (n + 1)2 · |X |/δ. 2. Let A = {x ∈ X : cx (D) > 0} and let w = |X \ A|. 3. For each x ∈ A, let c̃x = GeoSample(k, n, cx (D)). 4. Pick a uniformly random sequence (q0 , . . . , qn ) of distinct elements from X \ A. 5. Let c̃q0 = ApproxOrdSample(k, n, n, w, s). 6. For each i ∈ {1, . . . , n}, let c̃qi = ApproxOrdSample(k, n, c̃qi−1 , w − i, s). 7. Sort the elements of A ∪ {q0 , . . . , qn } as x1 , . . . , x|A|+n+1 such that c̃x1 ≥ . . . ≥ c̃x|A|+n+1 . 8. Release h = {(x, c̃x ) : x ∈ {x1 , . . . , xn } and c̃x > c̃xn+1 } ∈ Hn,n (X ). Theorem 4.10 (restated). The algorithm NonzeroGeometric(D, ε, δ) satisfies for all input datasets D ∈ X n , rational ε ∈ (0, 1] and δ ∈ (0, 1) such that 1/δ ∈ N i. ∆ (M2 (D, ε), NonzeroGeometric(D, ε, δ)) ≤ δ. ii. NonzeroGeometric(D, ε, δ) is (ε, (eε + 1) · δ)-differentially private. 25 iii. Moreover, the running time of NonzeroGeometric(D, ε, δ) is poly(N ) where N is the bit length of this algorithm’s input (D, ε and δ). Proof of i. Let M∗2 : X n × (0, 1] → Hn,2n+1 (X ) be the algorithm M2 except, instead of releasing the heaviest bins, M∗2 releases the bins for all elements of A ∪ {x0 , . . . , xn } (i.e. M∗2 releases (y, c̃y ) for all y ∈ A and (xi , c̃xi ) for all i ∈ [n]). Similarly, we define NonzeroGeometric∗ with respect to NonzeroGeometric. Notice that M∗2 and NonzeroGeometric∗ have the same distribution overs the bins with nonzero true count. Only on the bins with counts sampled using OrdSample and ApproxOrdSample respectively do their output distributions differ. As a result, we can apply Corollary 4.19 to the output distributions of M∗2 and NonzeroGeometric∗ . So for all D ∈ X n w ∆ (M∗2 (D, ε), NonzeroGeometric∗ (D, ε, δ)) ≤ 2 · (n + 1)2 · ≤δ s Now we consider the effect of keeping the heaviest counts. Define T : Hn,2n+1 → Hn,n (X ) to be the function that sets counts not strictly larger than the (n + 1)-heaviest count of its input to 0. Notice that T ◦ M∗2 ∼ M2 and T ◦ NonzeroGeometric∗ ∼ NonzeroGeometric. So for all D ∈ X n , by part ii of Lemma 2.10, ∆(M2 (D, ε), NonzeroGeometric(D, ε, δ)) = ∆(T (M∗2 (D, ε)), T (NonzeroGeometric∗ (D, ε, δ))) ≤ ∆(M∗2 (D, ε), NonzeroGeometric∗ (D, ε, δ)) ≤δ Proof of ii. Let D and D ′ be neighboring datasets. Let S ⊆ Hn,n (X ). By the previous part and part i of Theorem 4.9, Pr[NonzeroGeometric(D, ε, δ) ∈ S] ≤ Pr[M2 (D, ε) ∈ S] + δ ≤ eε · Pr[M2 (D ′ , ε) ∈ S] + δ  ≤ eε · Pr[NonzeroGeometric(D ′ , ε, δ) ∈ S] + δ + δ Therefore, NonzeroGeometric(D, ε, δ) is (ε, (eε + 1) · δ)-differentially private. Proof of iii. We consider the running time at each step. Construction of the true histogram takes O(n log |X |) time. And by Proposition 3.3, the at most n calls to GeoSample take poly(log(1/ε), n) time. Sampling n random bin labels from X takes O(n log |X |) time. Now, NonzeroGeometric makes n + 1 calls to ApproxOrdSample with no argument exceeding each term of (k, n, n, |X |, s) respectively. So by Proposition 4.18, these calls take time poly(log(1/ε), n, log |X |, log s) ≤ poly(log(1/ε), n, log |X |, log(1/δ)) Sorting the at most 2n + 1 elements of A ∪ {q0 , . . . , qn } and then releasing the heaviest counts takes O(n log n + n log |X |) time. Therefore, overall NonzeroGeometric has the desired running time. We have constructed algorithms for releasing a differentially private histogram, both pure and approximate, with running time polynomial in log |X | and simultaneous accuracy matching that of GeometricMechanism up to constant factors. 26 5 Removing the Dependence on Universe Size When we would like to have accuracy independent of |X |, we can use an approximate differentially private algorithm based on stability techniques [BNS16] (Proposition 2.20). We present a reformulation of their algorithm using two-sided geometric noise instead of Laplace noise. Algorithm 5.1. StabilityHistogram(D, ε, b) for D ∈ X n , ε > 0 and b ∈ [n] 1. Let A = {x ∈ X : cx (D) > 0}. 2. For each x ∈ A, set c̃x to cx (D) + Geo(2/ε) clamped to [0, n]. 3. Release h = {(x, c̃x ) : x ∈ A and c̃x > b} ∈ Hn,n (X ). Note that we only release counts for x ∈ X whose true count is nonzero, namely elements in the set A. Thus, the output length is O(n · (log n + log |X |)). However, releasing the set A is not (ε, 0)-differentially private because this would distinguish between neighboring datasets: one with a count of 0 and the other with a count of 1 for some element x ∈ X . Thus, we only release noisy counts c̃x that exceed a threshold b. If b is large enough, then a count of 1 will only be kept with small probability, yielding approximate differential privacy. Theorem 5.2. StabilityHistogram(D, ε, b) has the following properties: i. StabilityHistogram(D, ε, b) is (ε, δ)-differentially private provided that b≥1+ 2 1 ln ε δ ii. StabilityHistogram(D, ε, b) has (a, β)-per-query accuracy on counts larger than t for     2 1 2 1 t=b+ ln ln and a = ε β ε β iii. StabilityHistogram(D, ε, b) has (a, β)-simultaneous accuracy for   2 n a=b+ ln ε β Proof of i. Let D and D ′ be neighboring datasets. Let x ∈ X such that cx (D) 6= cx (D ′ ) and S ⊆ [n]. There are 3 cases to consider: • cx (D) ≥ 1 and cx (D ′ ) ≥ 1. Then c̃x ∼ cx (D) + Geo(2/ε) and similarly on the neighboring database we have a noisy count c̃′x ∼ cx (D ′ ) + Geo(2/ε). So by the differential privacy of GeometricMechanism (part i of Theorem 3.2) we have Pr[M(D)x ∈ S] ≤ eε/2 · Pr[M(D ′ )x ∈ S] 27 • cx (D) = 1 and cx (D ′ ) = 0. Notice Pr[M(D ′ )x 6= 0] = 0. c̃x is distributed as 1 + Geo(2/ε) clamped to [0, n]. Thus,   2 1 Pr[M(D)x 6= 0] = Pr[c̃x > b] ≤ Pr c̃x > 1 + ln ε δ   δ 2 1 δ ≤ ≤ Pr Z > ln = ε/2 ε δ 2 e +1 where Z ∼ Geo(2/ε). Therefore, Pr[M(D)x ∈ S] ≤ Pr[M(D ′ )x ∈ S] + δ/2 • cx (D) = 0 and cx (D ′ ) = 1. This case follows similarly to the previous case by considering Pr[M(D)x = 0]. Then overall Pr[M(D)x ∈ S] ≤ eε/2 · Pr[M(D ′ )x ∈ S] + δ/2 Because there are at most two bins on which D and D ′ have differing counts and each count c̃x is computed independently, by Lemma 2.4, this algorithm is (ε, δ)-differentially private. Proof of ii. Let x ∈ X such that cx (D) > t. Then x ∈ A. So by part ii of Theorem 3.2, we have Pr [|c̃x − cx (D)| ≤ a] ≥ 1 − β. |c̃x − cx (D)| ≤ a implies c̃x > t − a = b. Thus, (x, c̃x ) is included in the output of StabilityHistogram(D, ε, b) giving the desired accuracy. Proof of iii. Notice that the counts of elements not in A are trivially accurate. Therefore, we only need to consider the counts of elements in A. By part iii of Theorem 3.2,    2 |A| Pr ∀x ∈ A |c̃x − cx (D)| ≤ ln ≥1−β ε β The final step can increase the error additively by at most b. Also, |A| ≤ n. Therefore,    2 n ln ≥1−β Pr ∀x ∈ X |hx − cx (D)| ≤ b + ε β By using GeoSample (see Proposition 3.3), we can construct a computationally efficient algorithm for releasing a histogram that is (ε, δ)-differentially private with the accuracies matching Algorithm 5.1 up to constant factors. Algorithm 5.3. BoundedStabilityHistogram(D, ε, b) for D ∈ X n , rational ε ∈ (0, 1] and b ∈ [n] 1. Let k = ⌈log(2/ε)⌉. 2. Let A = {x ∈ X : cx (D) > 0}. 3. For each x ∈ A, let c̃x = GeoSample(k, n, cx (D)). 4. Release h = {(x, c̃x ) : x ∈ A and c̃x > b} ∈ Hn,n (X ). 28  Theorem 5.4. Let rational ε ∈ (0, 1], ε̃ = 2 · ln 1 + 2−⌈log(2/ε)⌉ ∈ (4/9 · ε, ε] and b ∈ [n]. Then BoundedStabilityHistogram(D, ε, b) satisfies the following properties: i. BoundedStabilityHistogram(D, ε, b) is (ε, δ)-differentially private provided that b ≥1+ 2 ln(1/δ) ε̃ ii. BoundedStabilityHistogram(D, ε, b) has (a, β)-per-query accuracy on counts larger than t for     2 1 2 1 ln ln and a = t=b+ ε̃ β ε̃ β iii. BoundedStabilityHistogram(D, ε, b) has (a, β)-simultaneous accuracy for   2 n a=b+ ln ε̃ β iv. BoundedStabilityHistogram(D, ε, b) has running time poly(N ) where N is the bit length of this algorithm’s input (D ∈ X n , ε and b). Proof of i-iii. By Proposition 3.3, GeoSample(k, n, cx(D)) generates a two-sided geometric random variable with scale parameter 2/ε̃ centered at cx (D) clamped to [0, n]. Therefore, this algorithm is identically distributed to StabilityHistogram(D, ε̃, b). Parts i-iii follow from Theorem 5.2. Proof of iv. Construction of the true histogram takes O(n log |X |) time. And by Proposition 3.3, the at most n calls to GeoSample take poly(log(1/ε), n) time. Because the counts do not exceed n, the final step takes poly(n, log |X |) time. Therefore, we have constructed an efficient algorithm for releasing a sparse histogram with approximate differential privacy. 6 Lower Bounds In this section, we prove a lower bound on the per-query accuracy of histogram algorithms whose outputs are restricted to H∞,n′ (X ) (i.e. sparse histograms) using a packing argument [HT10, BBKN14]. First, for completeness we state and reprove existing lower bounds for per-query accuracy and simultaneous accuracy as well as generalize them to the case of δ > 0. Theorem 6.1 (following [HT10, BBKN14]). Let M : X n → H∞,|X |(X ) be (ε, δ)-differentially private and β ∈ (0, 1/2]. i. If M has (a, β)-per-query accuracy and δ/ε ≤ β, then     1 1 1 ln − 1, n a ≥ · min 2 ε 4β 29 ii. If M has (a, β)-simultaneous accuracy, then     ε 1 |X | − 1 1 1 − 1, n log − 1, log a ≥ · min 2 ε 4β ε 4δ Proof of i. Assume a < n/2. Let x, x0 ∈ X such that x 6= x0 . Define the dataset D0 ∈ X n such that all rows are x0 . And define the dataset D such that the first m = ⌊2a⌋ + 1 rows are x and the remaining n − m rows are x0 . Notice that Pr[|M(D)x − cx (D)| > a] ≤ β by the (a, β)-per-query accuracy of M. By Lemma 2.3 and the fact that cx (D) > 2a while cx (D ′ ) = 0, Pr[M(D)x − cx (D)| > a] ≥ e−mε · Pr[M(D ′ )x − cx (D)| > a] − δ/ε ≥ e−mε · Pr[M(D ′ )x − cx (D ′ )| ≤ a] − δ/ε ≥ e−mε · (1 − β) − δ/ε Therefore, −(2a+1)·ε e   1 δ ≤ · β+ ≤ 4β 1−β ǫ Proof of ii. Assume a < n/2. Let x0 ∈ X . For each x ∈ X define the dataset D (x) ∈ X n such that the first m = ⌊2a⌋ + 1 rows are x and the remaining n − m rows are x0 . For all x ∈ X , let Gx = {h ∈ H∞,|X |(X ) : ∀x′ ∈ X |hx′ − cx′ (D (x) )| ≤ a} By Lemma 2.3, for all x ∈ X Pr[M(D (x0 ) ) ∈ Gx ] ≥ e−mε · Pr[M(D (x) ) ∈ Gx ] − δ/ε ≥ e−mε · (1 − β) − δ/ε Notice that Pr[M(D (x0 ) ) ∈ / Gx0 ] ≤ β and {Gx }x∈X is a collection of disjoint sets. Then X Pr[M(D (x0 ) ) ∈ / Gx0 ] ≥ Pr[M(D (x0 ) ) ∈ Gx ] x∈X :x6=x0  ≥ (|X | − 1) · e−mε · (1 − β) − δ/ε Therefore, −(2a+1)·ε e 1 · ≤ 1−β  β δ + |X | − 1 ε  which implies the desired lower bound. We now state our lower bound over sparse histograms. Theorem 6.2. Let M : X n → H∞,n′ (X ) be (ε, δ)-differentially private with (a, β)-per-query accuracy with β ∈ (0, 1/2] and δ/ε ≤ β. Then       1 |X | ε 1 1 ln ln − 1, − 1, n a ≥ · min 2 2ε 16βn′ 2ε 16βδ 30 The histogram algorithms of Sections 4 and 5 achieve (O(log(1/β)/ε), β)-per-query accuracy on large enough counts. However, on smaller counts we can only guarantee (a, β)-per-query accuracy with a = O(log(|X |/β)/ε) and a = O(log(1/(βδ))/ε) (by taking threshold b = O(log(1/δ)/ε)) for algorithms from Sections 4 and 5 respectively. Theorem 6.2 shows these bounds are the best possible when |X | ≥ poly(n′ ) and δ ≤ poly(1/ε). Proof. Assume a < n/2. Let x0 ∈ X . For each x ∈ X define the dataset D (x) ∈ X n such that the first m = ⌈2a⌉ rows are x and the remaining n − m rows are x0 . By definition of (a, β)-per-query accuracy and the fact that cx (D (x) ) ≥ 2a, we have h i h i Pr M(D (x) )x ≥ a ≥ Pr M(D (x) )x − cx (D (x) ) ≤ a ≥ 1 − β Then, by Lemma 2.3 and that D (x) is at distance at most m from D (x0 ) , we have h i Pr M(D (x0 ) )x ≥ a ≥ (1 − β)e−mε − δ/ε Thus, by linearity of expectations hn oi  E x ∈ X : M(D (x0 ) )x ≥ a ≥ |X | · (1 − β)e−mε − δ/ε On the other hand, as M(D (x0 ) ) ∈ H∞,n′ (X ) we have hn oi E x ∈ X : M(D (x0 ) )x ≥ a ≤ n′ Therefore, e−⌈2a⌉·ε ≤ 1 · 1−β  n′ δ + |X | ε  which along with ⌈2a⌉ ≤ 2a + 1 implies the lower bound of     1 1 |X | 1 ε a ≥ · min − 1, n ln − 1, ln 2 ε 4n′ ε 4δ Therefore, along with part i of Theorem 6.1, we have           1 1 |X | 1 1 1 ε a ≥ · min max min − 1 , ln ln − 1, ln −1 , n 2 ε 4n′ ε 4δ ε 4β           1 1 1 1 |X | 1 1 ε ≥ · min − 1 + ln · min ln − 1, ln −1 , n 2 2 ε 4n′ ε 4δ ε 4β       1 1 |X | ε 1 ≥ · min ln ln − 1, − 1, n 2 2ε 16βn′ 2ε 16βδ 7 Better Per-Query Accuracy via Compact, Non-Sparse Representations In this section, we present a histogram algorithm whose running time is poly-logarithmic in |X |, but, unlike Algorithm 4.13, is able to achieve (a, β)-per query accuracy with a = O(log(1/β)/ε). Our histogram algorithm will output a histogram from a properly chosen family. This family necessarily contains histograms that have many nonzero counts to avoid the lower bound of Theorem 6.2. 31 Lemma 7.1. Let k ∈ N, n ∈ N+ and Z ∼ GeoSample(k, n, 0). There exists a multiset of histograms Gk,n (X ) satisfying: i. Let h be drawn uniformly at random from Gk,n (X ). For all x ∈ X and c ∈ [n] −k+1 e−(2/3)·2 −k+1 · Pr[Z = c] ≤ Pr[hx = c] ≤ e(1/3)·2 · Pr[Z = c] ii. Let h be drawn uniformly at random from Gk,n (X ). For all x ∈ X and a ∈ [n] Pr[hx ≤ a] ≥ Pr[Z ≤ a] iii. Let h be drawn uniformly at random from Gk,n (X ). For all B ⊆ X such that |B| ≤ n + 1 and c ∈ [n]B Y Pr[∀x ∈ B hx = cx ] = Pr[hx = cx ] x∈B iv. For all h ∈ Gk,n , the histogram h can be represented by a string of length poly(k, n, log |X |) and given this representation for all x ∈ X the count hx can be evaluated in time poly (k, n, log |X |) v. For all A ⊆ X such that |A| ≤ n and c ∈ [n]A sampling a histogram h uniformly at random from {h′ ∈ Gk,n (X ) : ∀x ∈ A h′x = cx } can be done in time poly (k, n, log |X |) Parts i and ii state when a histogram is sampled uniformly at random from Gn,k (X ) the marginal distribution on each count is closely distributed to a two-sided geometric distribution centered at 0 clamped to [0, n]. Proof. (Construction) Let d = (2k+1 + 1)(2k + 1)n−1 . We would like to construct a (n + 1)-wise independent hash family consisting of functions p : X → {1, . . . , d}, i.e. for all x ∈ X , p(x) is uniformly distributed over {1, . . . , d} and for all distinct x1 , . . . , xn+1 ∈ X , the random variables p(x1 ), . . . , p(xn+1 ) are independent. Given any function p in this family we can construct a histogram by using p(x) as the randomness for evaluating the noisy count of x via inverse transform sampling in a similar manner to Algorithm 3.4 as the marginal distribution of p(x) is uniformly distributed over {1, . . . , d}. The set of all degree at most n polynomial over a finite field Fq is a (n + 1)-wise independent hash family. Ideally, we would have |X | ≤ d and take q = d. In this case, we can map X to a subset of Fq and use a bijection between {1, . . . d} and Fq to get the desired family of functions. However, |X | may be larger than d and d is not a prime power. Therefore, we must pick a large enough field Fq so that |X | ≤ q and that when mapping Fq to {1, . . . , d}, the resulting marginal distributions are approximately uniform. So let n l mo m = max ⌈log |X |⌉ , log(3 · 2k−1 · d) ′ (X ) as the family of polynomials over the finite field F m with degree at most n. We and define Gk,n 2 ′ (X ) by taking construct a histogram h ∈ Gk,n (X ) for each polynomial ph ∈ Gk,n  hx = min z ∈ [n] : F (z) ≥ (T (ph (T −1 (x))) mod d) + 1 32 for all x ∈ X where T : F2m → [2m − 1] is a bijection such that T and T −1 have running time poly(m) and  if z < 0  0 n−1−z k(z+1) k F (z) = d − 2 2 +1 if 0 ≤ z < n   d if z = n as defined in Algorithm 3.4 for c = 0. Notice that if h is drawn uniformly at random from Gk,n (X ), ′ (X ). then ph is drawn uniformly at random from Gk,n Proof of i. Let Z ∼ GeoSample(k, n, 0). For all x ∈ X and v ∈ [n], we have  Pr[hx = v] = Pr[min z ∈ [n] : F (z) ≥ (T (ph (T −1 (x))) mod d) + 1 = v] = Pr[F (v − 1) < (T (ph (T −1 (x))) mod d) + 1 ≤ F (v)] 1 = m · |{y ∈ F2m : F (v − 1) < (T (y) mod d) + 1 ≤ F (v)}| 2   m 2 1 + 1 (F (v) − F (v − 1)) ≤ m· 2 d   d = 1 + m · Pr[Z = v] 2 (by Lemma 3.5) m ≤ ed/2 · Pr[Z = v] Similarly, because d/2m ≤ 2/3  m  2 1 − 1 (F (v) − F (v − 1)) Pr[hx = v] ≥ m · 2 d   d ≥ 1 − m · Pr[Z = v] 2 m ≥ e−2·d/2 · Pr[Z = v] Now, part i follows as d/2m ≤ (1/3) · 2−k+1 by choice of m. Proof of ii. Pick q ∈ N and r ∈ [d − 1] such that 2m = q · d + r. We proceed by splitting the probability of Pr[hx ≤ a] based on whether or not the integer value of its randomness lies within one of the q intervals of length d. Let U be drawn uniformly at random from [2m ], D be drawn uniformly at random from {1, . . . , d} and Z ∼ GeoSample(k, n, 0). For all x ∈ X and a ∈ [n]  Pr[hx ≤ a] = Pr[min z ∈ [n] : F (z) ≥ (T (ph (T −1 (x))) mod d) + 1 ≤ a] = Pr[(T (ph (T −1 (x))) mod d) + 1 ≤ F (a)] = Pr[(U mod d) + 1 ≤ F (a)] q·d r = m · Pr[D ≤ F (a)] + m · Pr[D ≤ F (a) | D ≤ r] 2 2 q·d r ≥ m · Pr[D ≤ F (a)] + m · Pr[D ≤ F (a)] 2 2 = Pr[Z ≤ a] 33 (by monotonicity of F ) ′ (X ) is a (n + 1)-wise independent hash family, for all B ⊆ X such that Proof of iii. Because Gk,n |B| ≤ n + 1 and c ∈ [n]B   Pr[∀x ∈ B hx = cx ] = Pr ∀x ∈ B F (cx − 1) < (T (ph (T −1 (x))) mod d) + 1 ≤ F (cx ) Y   = Pr F (cx − 1) < (T (ph (T −1 (x))) mod d) + 1 ≤ F (cx ) x∈B = Y Pr[hx = vx ] x∈B Proof of iv. F2m can be represented by an irreducible polynomial of degree m over F2 encoded as a binary string of length m. Likewise, all elements of F2m can be represented by a polynomial of degree at most m − 1 over F2 (requires m bits). This encoding defines an efficient bijection T between F2m and [2m − 1] by also interpreting the string as the binary representation of an element in [2m − 1]. For all h ∈ Gk,n (X ), h can be represented by k, n, the coefficients of ph and a description of the field F2m . This representation can be encoded in poly(k, n, log |X |) bits. Now, given this encoding, evaluation of ph (x) can be done in poly(m) = poly (k, n, log |X |) time. And computing  hx = min z ∈ [n] : F (z) ≥ (T (ph (T −1 (x))) mod d) + 1 to get an approximate count takes poly (k, n, log |X |) time. Proof of v. Let A ⊆ X such that |A| ≤ n and c ∈ [n]A . We can sample h given by the coefficients a0 , . . . , an ∈ F2m uniformly at random from Gk,n (X ) such that hx = cx for all x ∈ A with the following steps. 1. Construct F2m by finding an irreducible polynomial of degree m over F2 . 2. For each x ∈ X , sample ũx uniformly at random from the set Sx = {y ∈ F2m : cx = min {z ∈ [n] : F (z) ≥ (T (y) mod d) + 1}} We can sample from this set by observing that Sx = {y ∈ F2m : F (cx − 1) < (T (y) mod d) + 1 ≤ F (cx )} = {y ∈ F2m : ∃i, r ∈ N such that T (y) = i · d + r and F (cx − 1) < r + 1 ≤ F (cx )} = T −1 ({i · d + r ∈ [2m − 1] : i ∈ N and F (cx − 1) < r + 1 ≤ F (cx )})  m  ⌊2 /d⌋−1 [ {i · d + r ∈ [2m − 1] : F (cx − 1) < r + 1 ≤ F (cx )} = T −1  i=0 3. Let B ⊆ X such that A ⊆ B and |B| = n + 1. For all x ∈ B \ A, sample ũx uniformly at random from F2m . 4. Take the coefficients a0 , . . . , an ∈ F2m to be the coefficients of the interpolating polynomial over F2m given the set of points (x, ũx ) for all x ∈ B. This polynomial exists and is unique. 34 We first prove correctness. Notice this procedure can only return a histogram h ∈ Gk,n (X ) such that hx = vx for all x ∈ A. Let h be any such histogram. Then Pr[Sampling h] = Pr[(a0 , . . . , an ) are the coefficients of ph ] = Pr[∀x ∈ B ũx = ph (x)] Y = Pr[ũx = ph (x)] x∈B = Y 1 |Sx | x∈A !   1 |B\A| · 2m Therefore, these steps output h ∈ Gk,n (X ) uniformly at random such that hx = vx for all x ∈ A. Construction of F2m can be done in O(m4 ) time [Sho90]. Integer operations are limited to numbers not exceeding 2m . And polynomial interpolation takes O(n2 ) · poly(m) time [BP70]. Therefore, this procedure runs in time poly(k, n, log |X |). Algorithm 3.6 (BoundedGeometricMechanism) has on each bin a count with marginal distribution Geosample(k, n, cx (D)) and its counts are independent. By using the previously defined family, the following algorithm has essentially the same marginal distributions as Algorithm 3.6, but the counts are only (n + 1)-wise independent. This yields an efficient algorithm as we only need a small number of random bits (polynomial in log |X |) compared to the amount required for all counts to be independent (linear in |X |). Algorithm 7.2. CompactHistogram(D, ε) for D ∈ X n and rational ε ∈ (0, 1] 1. Let k = ⌈log(4/ε)⌉. 2. Let A = {x ∈ X : cx (D) > 0}. 3. For each x ∈ A, let c̃x = GeoSample(k, n, cx (D)). 4. Release h drawn uniformly at random from {h′ ∈ Gk,n (X ) : ∀x ∈ A h′x = c̃x }.  Theorem 7.3. Let rational ε ∈ (0, 1] and ε̃ = 2 · ln 1 + 2−⌈log(4/ε)⌉ ∈ (2ε/9, ε/2]. Then CompactHistogram(D, ε) has the following properties: i. CompactHistogram(D, ε) is (ε, 0)-differentially private. ii. CompactHistogram(D, ε) has (a, β)-per-query accuracy for   2 1 ln a= ε̃ β iii. CompactHistogram(D, ε) has (a, β)-simultaneous accuracy for   2 |X | ln a= ε̃ β 35 iv. CompactHistogram(D, ε) has running time poly(N ) where N is the bit length of this algorithm’s input (D ∈ X n and ε) Proof of i. Let D, D ′ ∈ X n be neighboring datasets. Let A = {x ∈ X : cx (D) > 0}. Similarly, define A′ = {x ∈ X : cx (D ′ ) > 0}. Let B = A ∪ A′ . Notice |B| ≤ n + 1. Let g ∈ Gk,n (X ). Let h be drawn uniformly at random from Gk,n (X ). Then Pr[CompactHistogram(D, ε) = g] = Pr[∀x ∈ B CompactHistogram(D, ε)x = gx ] · Pr[h = g | ∀x ∈ B hx = gx ]  ! Y Y Pr[Zx (D) = gx ]  Pr[hx = gx ] · Pr[h = g | ∀x ∈ B hx = gx ] = x∈A x∈B\A where Zx (D) ∼ GeoSample(k, n, cx (D)). Now, because |B \ A| = 1 and and |B \ A′ | = 1 along with Proposition 3.3 and part i of Lemma 7.1 Pr[CompactHistogram(D, ε) = g] Pr[h = g | ∀x ∈ B hx = gx ]  ! Y Y Pr[Zx (D) = gx ]  Pr[hx = gx ] = x∈A (1/3)·2−k+1 ≤e · Y x∈B\A Pr[Zx (D) = gx ] x∈B −k+1 ≤ eε̃+(1/3)·2 · Y Pr[Zx (D ′ ) = gx ] x∈B ≤ ε̃+(1/3)·2−k+1 e · Y x∈A′ ≤ eε ·  ! Y −k+1 Pr[Zx (D ′ ) = gx ] e(2/3)·2 · Pr[hx = gx ] x∈B\A′ Pr[CompactHistogram(D ′ , ε) = g] Pr[h = g | ∀x ∈ B hx = gx ] as ε̃ ≤ ε/2 and 2−k+1 ≤ ε/2. Therefore, CompactHistogram(D, ε) is (ε, 0)-differentially private. Proof of ii. Let h ∼ CompactHistogram(D, ε) and A = {x ∈ X : cx (D) > 0}. Let x ∈ A. Then, by construction, hx ∼ GeoSample(k, n, cx (D)) and (a, β)-per-query accuracy follows from part ii of Theorem 3.7. Let x ∈ X \ A and h′ be drawn uniformly at random from Gk,n (X ). Notice cx (D) = 0 and |A| ≤ n. By parts ii and iii of Lemma 7.1 Pr[|hx | ≤ a] = Pr[h′x ≤ a | ∀x ∈ A h′x = hx ] = Pr[h′x ≤ a] ≥ Pr[Z ≤ a] where Z ∼ GeoSample(k, n, 0). Thus, (a, β)-per-query accuracy follows from part ii of Theorem 3.7. 36 Proof of iii. A union bound over each x ∈ X along with the previous part gives a bound on the (a, β)-simultaneous accuracy. Proof of iv. CompactHistogram(D, ε) makes at most n calls to GeoSample. Therefore, by Proposition 3.3 and by part v of Lemma 7.1, we get the desired bound on running time. Therefore, we have constructed a histogram algorithm with running time polynomial in and accuracy matching lower bounds for releasing private histograms up to constant factors. Acknowledgments We thank the Harvard Privacy Tools differential privacy research group, particularly Mark Bun and Kobbi Nissim, for informative discussions and feedback, and the anonymous TPDP reviewers for helpful comments. References [BBKN14] Amos Beimel, Hai Brenner, Shiva Prasad Kasiviswanathan, and Kobbi Nissim. Bounds on the sample complexity for private learning and private data release. Machine learning, 94(3):401–437, 2014. [BLR13] Avrim Blum, Katrina Ligett, and Aaron Roth. A learning theory approach to noninteractive database privacy. Journal of the ACM (JACM), 60(2):12, 2013. URL https://arxiv.org/pdf/1109.2229.pdf. [BNS16] Mark Bun, Kobbi Nissim, and Uri Stemmer. Simultaneous private learning of multiple concepts. In Proceedings of the 2016 ACM Conference on Innovations in Theoretical Computer Science, pages 369–380. ACM, 2016. URL https://arxiv.org/pdf/1511.08552.pdf. [BP70] Åke Björck and Victor Pereyra. Solution of vandermonde systems of equations. Mathematics of Computation, 24(112):893–903, 1970. [CDK17] Bryan Cai, Constantinos Daskalakis, and Gautam Kamath. Priv’it: Private and sample efficient identity testing. arXiv preprint arXiv:1703.10127, 2017. URL https://arxiv.org/pdf/1703.10127.pdf. [CKKL12] Mahdi Cheraghchi, Adam Klivans, Pravesh Kothari, and Homin K Lee. Submodular functions are noise stable. In Proceedings of the twenty-third annual ACM-SIAM symposium on Discrete Algorithms, pages 1586–1592. Society for Industrial and Applied Mathematics, 2012. URL https://arxiv.org/pdf/1106.0518.pdf. [CPST11] Graham Cormode, Magda Procopiuc, Divesh Srivastava, and Thanh TL Tran. Differentially private publication of sparse data. arXiv preprint arXiv:1103.0825, 2011. URL https://arxiv.org/pdf/1103.0825.pdf. [CTUW14] Karthekeyan Chandrasekaran, Justin Thaler, Jonathan Ullman, and Andrew Wan. Faster private release of marginals on small databases. In Proceedings of the 5th conference on Innovations in theoretical computer science, pages 387–402. ACM, 2014. URL https://arxiv.org/pdf/1304.3754.pdf. 37 [DL09] Cynthia Dwork and Jing Lei. Differential privacy and robust statistics. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 371–380. ACM, 2009. [DMNS06] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference, pages 265–284. Springer, 2006. [DNT15] Cynthia Dwork, Aleksandar Nikolov, and Kunal Talwar. Efficient algorithms for privately releasing marginals via convex relaxations. Discrete & Computational Geometry, 53(3):650–673, 2015. URL https://arxiv.org/pdf/1308.1385.pdf. [GMP16] Ivan Gazeau, Dale Miller, and Catuscia Palamidessi. Preserving differential privacy under finite-precision semantics. Theoretical Computer Science, 655:92–108, 2016. URL https://arxiv.org/pdf/1306.2691.pdf. [GRS12] Arpita Ghosh, Tim Roughgarden, and Mukund Sundararajan. Universally utilitymaximizing privacy mechanisms. SIAM Journal on Computing, 41(6):1673–1693, 2012. [GRU12] Anupam Gupta, Aaron Roth, and Jonathan Ullman. Iterative constructions and private data release. Theory of Cryptography, pages 339–356, 2012. URL https://arxiv.org/pdf/1107.3731.pdf. [HRS12] Moritz Hardt, Guy N Rothblum, and Rocco A Servedio. Private data release via learning thresholds. In Proceedings of the twenty-third annual ACM-SIAM symposium on Discrete Algorithms, pages 168–187. Society for Industrial and Applied Mathematics, 2012. URL https://arxiv.org/pdf/1107.2444.pdf. [HT10] Moritz Hardt and Kunal Talwar. On the geometry of differential privacy. In Proceedings of the forty-second ACM symposium on Theory of computing, pages 705–714. ACM, 2010. URL https://arxiv.org/pdf/0907.3754.pdf. [KLN+ 11] Shiva Prasad Kasiviswanathan, Homin K Lee, Kobbi Nissim, Sofya Raskhodnikova, and Adam Smith. What can we learn privately? SIAM Journal on Computing, 40(3):793– 826, 2011. URL https://arxiv.org/pdf/0803.0924.pdf. [Knu05] Donald E Knuth. Combinatorial Algorithms, Part 1, volume 4 of The Art of Computer Programming. Addison-Wesley Professional, 2005. [Mir12] Ilya Mironov. On significance of the least significant bits for differential privacy. In Proceedings of the 2012 ACM conference on Computer and communications security, pages 650–661. ACM, 2012. [Sho90] Victor Shoup. New algorithms for finding irreducible polynomials over finite fields. Mathematics of Computation, 54(189):435–447, 1990. [TUV12] Justin Thaler, Jonathan Ullman, and Salil Vadhan. Faster algorithms for privately releasing marginals. In International Colloquium on Automata, Languages, and Programming, pages 810–821. Springer, 2012. URL https://arxiv.org/pdf/1205.1758.pdf. [UV11] Jonathan Ullman and Salil P Vadhan. PCPs and the hardness of generating private synthetic data. In TCC, volume 6597, pages 400–416. Springer, 2011. URL https://pdfs.semanticscholar.org/bf6f/e68b91283787b9ad28494a78b4cead10fa12.pdf. 38 A1 Generating a Sparse Histogram Uniformly at Random Being able to efficiently compute |Hn,n′ (X )| and sample a uniformly random element from Hn,n′ (X ) is needed for an efficient implementation of Algorithm 4.13. Lemma A1.1. |Hn,n′ (X )| can be calculated and a uniformly random element of Hn,n′ (X ) can be sampled in time poly(n′ , log n, log |X |) Proof. We show HistSample(X , n, n′ ) defined below efficiently samples a uniformly random element of Hn,n′ (X ) by using a bijection between Hn,n′ (X ) and {1, . . . , |Hn,n′ (X )|}. Algorithm A1.2. HistSample(X , n, n′ ) for n, n′ ∈ N+ with n′ ≤ |X | P ′ 1. Pick U uniformly at random from {1, . . . , |Hn,n′ (X )|} = {1, . . . , ni=0  P 2. Find the smallest ℓ ∈ [n′ ] such that ℓi=0 |Xi | ni ≥ U . i Pℓ−1 |X | i h |X | ℓ 3. Let u′ = U − 1 − i=0 n ∈ · n − 1 . i ℓ 4. Use integer division to find q ∈ h |X | ℓ − |X | i i n }. i   1 and r ∈ nℓ − 1 such that u′ = qnℓ + r. 5. Map q to a corresponding subset of X of size ℓ specified by sorted elements q1 < . . . < qℓ . Specifically, we can let q1 , . . . , qℓ ∈ X be the sequence representing q in the combinatorial number system of degree ℓ, i.e. the unique sequence satisfying     qℓ q1 q= + ... + ℓ 1 This sequence can be found P greedily; for each j decreasing from ℓ to 1, using binary search, find the largest qj such that ℓi=j qii ≤ q [Knu05]. 6. Let r0 , . . . , rℓ−1 ∈ [n − 1] be the digits of the base n representation of r, i.e. r = rℓ−1 nℓ−1 + . . . + r1 n + r0 7. For each i ∈ {1, . . . , ℓ}, release (qi , ri−1 + 1). Steps 3 and 4 define a bijection mapping u to (ℓ, u′ ). Step 5 defines a bijection mapping (ℓ, u′ ) to (ℓ, q, r). In steps 6 and 7, the decompositions of q and r into their respective number systems are bijections. Likewise, there is a bijection mapping (q1 , . . . , qℓ , r0 , . . . , rℓ−1 ) to an element of Hn,n′ (X ). Therefore, our mapping from {1, . . . , |Hn,n′ (X )|} to Hn,n′ (X ) is bijective proving correctness.  P ′ Computing |Hn,n′ (X )| = ni=0 |Xi | ni takes poly(n′ , log n, log |X |) time. The remaining steps can be done in poly(n′ , log n, log |X |) time as no number used exceeds |Hn,n′ (X )|, all numbers used are expressible as the sum of at most n′ other numbers and steps 5-7 each consist of at most n′ iterations. 39
8cs.DS
arXiv:1803.06315v1 [cs.SY] 16 Mar 2018 Benchmarks for cyber-physical systems: A modular model library for building automation systems (Extended version) Nathalie Cauchi, Alessandro Abate Department of Computer Science, University of Oxford, Oxford, U.K [email protected] Abstract Building Automation Systems (BAS) are exemplars of Cyber-Physical Systems (CPS), incorporating digital control architectures over underlying continuous physical processes. We provide a modular model library for BAS drawn from expertise developed on a real BAS setup. The library allows to build models comprising of either physical quantities or digital control modules.The structure, operation, and dynamics of the model can be complex, incorporating (i) stochasticity, (ii) non-linearities, (iii) numerous continuous variables or discrete states, (iv) various input and output signals, and (v) a large number of possible discrete configurations. The modular composition of BAS components can generate useful CPS benchmarks. We display this use by means of three realistic case studies, where corresponding models are built and engaged with different analysis goals. The benchmarks, the model library and data collected from the BAS setup at the University of Oxford, are kept on-line at https:// github.com/natchi92/BASBenchmarks. Keywords 1 cyber-physical systems, building automation systems, thermal modelling, hybrid models, simulation, reachability analysis, probabilistic safety, control synthesis 1 Introduction This paper describes a library of models for Building Automation Systems (BAS), which can be employed to create benchmarks for verification, control synthesis, or simulation purposes of Cyber-Physical Systems (CPS). The models are inspired by and built around an experimental setup within the Department of Computer Science at the University of Oxford, which is part of on-going research in collaboration with service engineers and industrial partners in the sector. This library allows to create numerous meaningful models for BAS, which are examples of CPS integrating continuous dynamics and discrete modes. Interest in BAS, also colloquially known as smart buildings, is gaining rapid momentum, in particular as a means for ensuring thermal comfort ([1]), minimising energy consumption ([16, 18]), and ascertaining reliability ([3, 19]). Quantitative models are needed to 1 evaluate system performance, to verify correct behaviour, and to develop specific control algorithms. An overview of the different BAS modelling techniques used in literature is presented in [15]. Several simulation tools (see [5]) have been devised to aide in the development and analysis of models for BAS. Attempting a multi-dimensional characterisation of the broad spectrum of existing BAS models, we can find either deterministic or stochastic ones, low- to high-dimensional ones, with discrete or continuous inputs and states. The choice of a model is an art and a craft ([14]): one must select simplifying assumptions that accurately reflect the operational performance of the BAS in specific real-world environments, and introduce uncertainty to represent un-modelled components, unknown parameters or random occupants. We therefore aim to simplify the modelling process such that simulation, verification or strategy synthesis can be carried out seamlessly. Different verification and policy synthesis tools exist in literature ([6, 10, 11]). They are typically specific to a particular type of model structure and in the case of stochastic or hybrid models are oftenlimited to a small number of continuous variables. The use of such tools also requires expert knowledge on the specific formalism the tool makes use of. In order to display the versatility of the library of BAS models, we present three case studies that are built from its components. We focus on modelling temperature dynamics, a key element for ensuring thermal comfort. We employ the three generated models for different analysis goals, comprising simulation, reachability, and control synthesis. The models and delineation of the case-studies are kept on-line at https://github.com/natchi92/BASBenchmarks. This is to allow their use or modification for different applications and for comparison with other modelling approaches in BAS. The repository also contains real data gathered from the BAS lab at Oxford, which can be employed for further modelling studies. This article has the following structure: Section 2 introduces the BAS modelling framework for CPS. We identify three modelling trade-offs that introduce different complexities on the model dynamics. Based on these trade-offs, we develop and analyse three case studies in Section 3. 2 2.1 Building Automation Systems BAS: structure and components BAS models clearly depend on the size and topology of the building ([12]), and on its climate control setup. In this work, we consider the BAS setup in the Department of Computer Science, at the University of Oxford. A graphical depiction is shown in Figure 1a. The BAS consists of two teaching rooms that are connected to a boiler-heated system. The boiler supplies heat to the heating coil within the AHU and to two radiators. Valves control the rate of water flow in the heating coil and in radiators. The AHU supplies air to the two zones, which are connected back to back, and adjacent both to the outside and to an interior hall (cf. Figure 1a). The zone air of both rooms can mix with the outside air and exchanges circulating air with the AHU. Return water from the AHU heating coils and radiators is collected and pumped back to the boiler. Figure 1b presents the Resistor Capacitance (RC) network circuit of the two zones ([8]), which underpins the dynamics for temperature in the zone component - corresponding equations are in Table 3. The heat level in each room is modified by (i) radiative solar energy absorbed through the walls, (ii) occupants, (iii) AHU input supply air, (iv) radiators, and (v) AHU return water. The effect of heat stored in the walls and in rooms is depicted with capacitors, whereas thermal resistance to heat transfer by the walls is depicted by resistor elements. 2 (a) 2-zone boiler-based heating system with air handling unit and radiators (b) Resistance-capacitance circuit for the internal thermal dynamics within the two zones Figure 1: Building automation system setup 3 2.2 BAS: dynamics and configurations We define models for the individual components in the BAS system based on the expertise developed on the BAS setup at Oxford. Single components are intended as separate physical structures within the BAS. Their models are built from the underlying physics and are improved via industrial feedback and from existing literature ([8]). We obtain models with a number of unknown parameters: these are estimated and validated using data collected from the BAS setup [13]. We list indices in Table 1, while all the quantities (variables, parameters, inputs) are listed in Table 2. Table 3 presents all the relations among variables in the model: algebraic relations define static couplings, whereas differential relations define the dynamics for the corresponding variables. The structure in Figure 1a, the quantities in Table 2, and the variables (with associated dynamics) in Table 3, together allow to construct global models for the complete BAS setup. We refer to the set of models describing the individual components (cf. Table 3) as a library of models: one can select the individual components and models from the library, and build different BAS configurations. Table 1: Indices Index a adj, out d i = {1, 2} jw = {5, 6} l ∈ {1, 2} out ref sa sw w h Reference AHU adjacent exterior zones mixer individual zones zone walls with windows adjacent interior zone outside reference supply air supply water wall water Index adj b hall jn = {2, 3, 7} j = jn ∪ jw occ r rw solar v z ar Reference adjacent zone boiler hallway zone walls with no windows all zone walls occupants radiator return water solar energy collector zone air A global model of the BAS set-up can be complex, comprising both algebraic and differential relations that may be further affected by process noise. A model also contains a number of inputs which can either be construed as control signals or as exogenous signals. Some of the dynamics are non-linear in view of continuous variables that are bi-linearly coupled (cf. AHU air duct model in Table 3). The number of continuous variables also increase substantially when considering a BAS setup with multiple zones: employing the zone component for a configuration with n zones would result in a model with (2n + 1) + n continuous state variables. Furthermore, the model features multiple components that present switching discrete behaviours, affecting the dynamics of the continuous variables: these discrete modes are listed in Table 4 and can result in up to 144 discrete configurations. In order to tackle the complexity of global BAS models and to add a level of flexibility to the modelling framework, we consider each BAS component as a separate module, characterised by inputs and output elements, and internal variables. We make use of individual modules describing component type, and then connect different modules based on possible physical couplings. Coupling between different modules is also achieved via input-output relationships: e.g., in the zone module we have coupling between two zones through the continuous variable Tadj,l corresponding to the adjacent zones, which for the wall separating the two zones (cf. W7 in Figure 1b) corresponds to the individual zone temperatures of the two zone modules (cf. Table 3 zone equations). Having such a modular structure for the individual components provides an added level of versatility, since we can connect different components to create various new models. Modularisation also allows (i) to perform analysis of the whole setup by executing analysis of individual modules and (ii) to extend the library of models by defining new modules that connect to existing modules via their input-output relations. 4 Symbol Ai Ben C Cpa , Cpw CO2i kb m n Pout Q R T u (U A) V w wmax X {α, β, µ} σ ρ τ Quantity area of windows of each zone boiler switched off capacitance of medium specific heat capacity of air and water carbon-dioxide measurements in each zone steady-state of the boiler mass air flow rate number of zones radiator rated power output associated heat gain thermal resistance to heat from walls to medium temperature of associated medium mixing ratio overall transmittance factor of medium volume of medium water flow rate of associated medium maximum water-flow permitted by the valve valve position of associated component de-rating and offset factors the associated process noise density of medium time constant of the medium Type constant discrete constant constant input constant input constant constant\input input constant state\input input constant constant input constant input constants constant constant constant Table 2: List of variables, inputs, and parameters 2.3 BAS: description of model library The library of BAS components comes in the form of MATLAB scripts. Each script represents an individual BAS component. The models are in state-space form and are of two types linear or bilinear depending on the component they represent. They are defined using the symbolic toolbox, are parametrised and can be described both in discrete and continuous time. We provide the parameters which we estimated from data gathered from the BAS lab to construct the individual models. However, users can easily make use of their own parameters and construct their own model. Different components can be connected together based on their input-output relations by cascading the different symbolic models for each component. Once this is done, the provided scripts allow you to simulate the models and plots for the defined output variables are presented. 3 Case studies Next we set up three case studies and present the trade off between the discussed elements of complexity. For each of the case studies, we (i) establish the dynamics of the models, (ii) how they are constructed from the library of components and (iii) and describe the results obtained 3.1 Two-zone heating setup with deterministic or stochastic dynamics We consider two zones, each heated by one radiator and with a common supply air, as portrayed in Figure 2. From Table 3, we select two components and corresponding models: the 5 Component: Boiler Continuous(variables 0 dTsw,b (t) = −1 (τsw ) [(−Tsw,b (t) + kb )dt] + σsw dW Relation Ben (t) = 0 Ben (t) = 1 Component: Valve Continuous variables −1 w(t) = (τ ) [exp(ln(τ )X(t))wmax ] differential Relation algebraic Component: Mixer Continuous variables X Td (t) = ud Tout (t) + (1 − ud )( Tzi (t))(n)−1 Relation algebraic i Component: AHU heating coil Continuous variables −1 dTrw,a (t) = (Cpw ρh Va ) [(Cpw wa (t)(Tsw,b (t) − Trw,a (t)) + (U A)a (Td (t) − Trw,a (t)))dt] + σrw,a dW Relation differential Component: AHU air duct Continuous variables −1 dTsai (t) = (Ca ρa Va ) [ma (t)Cpa (Td (t) − Tsai (t)) + (U A)a (Tzi (t) − Tsai (t))]dt + σsai dW Relation differential Component: Radiator Continuous variables −1 dTrw,ri (t) = (Cpw ρh Vri ) [(Cpw wri (t)(Tsw,b (t) − Trw,ri (t)) + (U A)ri (Tzi (t) − Trw,ri (t)))dt] + σrw,ri dW Relation differential Component: Zone Continuous variables   −1 Twjn (t) − Tzi (t) dTzi (t) = (Czi ) + Qrw,ri (t) + Qocci (t) + Qsai (t) dt + σzi dW Rij " # −1 Tadj,out (t) − Tzi (t) X Tadjl (t) − Twjn (t) dTwjn (t) = Cwjn + + Qrw,ajn (t) dt + σwjn dW Rout Rlj l " # −1 Tadj,out (t) − Tzi (t) X Tadjl (t) − Twjw (t) dTwjw (t) = Cwjw + + Qsolarjw (t) + Qrw,ajw (t) dt + σwjw dW Rout Rljw Relation differential l Qrw,ri (t) = Pradi (α2 (Trw,ri (t) − Tzi (t)) + α1 ), Qocci (t) = µi (CO2i (t)) + β1i , Qsai (t) = ma (t)Cpa (Tsai (t) − Tzi (t))) Qrw,aj (t) = α3 (Trw,a (t) − Twj (t)), Qsolarjw (t) = (α0 Ai Tout (t) + β2 ) Component: Collector Continuous variables X Trw,b (t) = uv Trw,a (t) + (1 − uv )( Trw,ri (t))(n)−1 Relation algebraic i Table 3: Components dynamics and functional relations among variables Component Boiler AHU air duct Mixer AHU heating coil Radiator heating coil 1 Radiator heating coil 1 Discrete Modes Boiler on, off (Ben ) Fan off, medium, high (ma ) Open, closed (ud ) Valve healthy, faulty (Xa ) Valve healthy, faulty (Xr1 ) Valve fully open, half open, closed (Xr1 ) Table 4: Discrete operational modes radiator and the zone. We simplify these models with the following assumptions: (i) the wall temperature is constant across the zones and is a fixed value (Tw,ss ); (ii) the boiler is switched ON providing a supply temperature Tsw,bss ; (iii) we fix both the mass air flow rate ma and the radiator water flow rate wr ; and (iv) we do not include the heat gain from the windows and the AHU heating coils (Twss ) in each zone. We obtain a model with the four  T state variables xT = Tz1 Tz2 Trw,r1 Trw,r2 and with a common supply temperature u = Tsa as an input. For this setup we further consider three different dynamics: (i) a purely 6 Figure 2: BAS setup for the first case study deterministic one; (ii) a deterministic model with additive disturbance; and (iii) a stochastic model. For (i) and (ii), we thus remove the process noise in the template model, while for models (i) and (iii) we do not include the occupancy heat gain. We also discretise the dynamics by a Forward-Euler scheme (for the deterministic models) and a Euler-Maruyama scheme (for the stochastic model), using a uniform sampling time ∆ = 15 minutes, and obtain a set of linear discrete-time models. One should note that the models being considered are not fully observable since for all the individual zone temperatures (variables of interest) are the only variables provided as outputs. The dynamics of the deterministic model (i) are described by  Ax[k] + Bu[k]#+ Qd  x[k + 1] = " Md : (1) 1 0 0 0  = x[k], yd [k] 0 1 0 0 where again the matrices are properly sized and constructed based on the models in Table 3 and where,  T Twss ∆ Twss ∆ Cpw wr1 ∆ Cpw wr2 ∆ Tsw,bss Tsw,bss Qd = Cz1 R1 Cz2 R2 Cpw ρh Vr1 ,b Cpw ρh Vr2 ,b Here Ri is the mean resistance offered by the walls. The deterministic model with additive disturbances is  Ax[k] + Bu[k] + Fda dda [k]    x[k + 1] = " + Qda # Mda : (2)  1 0 0 0   = x[k]. yda [k] 0 1 0 0  T CO22 We have extended (1) with additive noise vector dT (cf. Qocci in da = CO21 Table 3) representing the different CO2 levels in each zone. Qda is defined as Qda = iT hβ ∆ β12 ∆ 1 0 0 and Fda is a properly sized matrix.The stochastic model is Qd + C1z Cz 1 2 expressed by extending (1) to include process noise, as  Ax[k] + Bu[k]#+ Qd + ΣW [k]  x[k + 1] = " Ms : (3) 1 0 0 0  = x[k], ys [k] 0 1 0 0 √ √ √ √ where Σ = diag([( ∆σz1 )2 ( ∆σz2 )2 ( ∆σrw,r1 )2 ( ∆σrw,r2 )2 ])encompasses the vari T ances of the process noise for each state. W = w1 w2 w3 w4 are independent Gaussian random variables, which are also independent of the initial condition of the process. A simulation run of all three models is depicted in Figure 3. 7 21.5 Tz1 (o C) Md Mda Ms 21 20.5 20 0 4 8 12 16 20 0 4 8 12 16 20 Time (hours) Figure 3: First case study: simulations over two days 3.1.1 Reachability analysis For this case study we would like to perform the following verification task: to decide whether traces generated by the models remain within a specified safe set for a given time period. This is achieved by reachability analysis, which takes a probabilistic flavour for the stochastic model. The safe set is described as an interval around the temperature set-point TSP = 20o C ±0.5o C. We constrain the input u to lie within the set {Tsa ∈ R|15 ≤ Tsa ≤ 22} for all models and employ a fixed time horizon N = 6×∆ = 1.5 hours. We perform reachability analysis with Axelerator ([2]), while we use FAUST2 ([17]) to perform probabilistic reachability analysis of Ms . In order to perform reachability analysis using Axelerator, for each of the models we set the  T  T initial condition as Tz1 Tz2 Trw,r1 Trw,r2 = 18 18 35 35 . The reach tube for model Md over the whole time horizon is shown in Figure 4: it encompasses the union of reachable states over that horizon. The results obtained using Axelerator (cf. Figure 4) are conservative results and confirm that the model can indeed stay in the required safe set for some initial states, but can also exit it.One can note the coupling between the two zones and that zone 1 tends to stay at higher zone temperatures then zone 2. A similar reach tube is obtained for model Mda . Similarly, we perform probabilistic reachability analysis on model Ms by defining the same safe set and assuming an input set of [15 22]. The resulting adaptive partition of the safe set along with the optimal safety probability for each partition set is depicted in Figure 5. When performing probabilistic reachability analysis using model Ms (cf. Figure 5), we deduce that the models have a high probability of being within the required safe set, specifically to have Tz1 ∈ [19.5 20] and Tz2 ∈ [19.5 20.5]. 3.2 Two-zone heating setup with large number of continuous variables In this second case study we focus on the dynamics of the zone component from Table 3 and consider the two zones shown in Figure 1b. We assume that (i) a central fan pumps in air in both rooms with a common supply temperature 15o C ≤ Tsa ≤ 30o C, (ii) the input mass airflow ma is fixed to 10 m3 /hour and (iii) the return water temperature of the AHU heating coils is fixed (Trw,ass = 35o C). As in the previous case study, the selected model is discretised using Forward-Euler, with a sampling time ∆ = 15 minutes, to obtain the discrete-time model ( xc [k + 1] = A h c xc [k] + Bc uc [k] + Fc dci[k] + Qc Mc : (4) yc [k] = 1 0 0 0 0 0 0 xc [k]. Here the variables are  xc = Tz1 Tz2 Tw5 Tw6 8 Tw2 Tw3 Tw7 T , Tz2 (o C) 20 15 10 5 10 12 14 16 18 20 22 o Tz1 ( C) Figure 4: First case study: reach tube of Md over whole time horizon Prob. Tz2 (o C) 20.5 0.8 20 0.6 19.5 19.5 20 Tz1 (o C) 20.5 Figure 5: First case study: partition of the safe set for model Ms , along with optimal safety probability for each partition set and a common fan supplies the two zones with a supply rate uc = Tsa , whereas  T dc = Tout Thall CO21 CO22 Trw,r1 Trw,r2 , and Qc = h qc0 ∆ qc0 ∆ qc2 ∆ qc2 ∆ qc1 ∆ qc1 ∆ qc1 ∆ Cz1 Cz2 Cw5 Cw6 Cw2 Cw3 Cw7 iT , where qc0 = β1i + α1 Pradi , qc1 = α3 Trw,ass and qc2 = α0 A2 β2 + qc1 . Matrices Ac , Bc , Fc are properly sized. Recall that the vector dc corresponds to the disturbance signals, while Qc represents constant additive terms within the model. We finally model the disturbances as random external effects. 3.2.1 Policy synthesis and refinement For Mc we would like to synthesise a policy ensuring that the temperature within zone 1 does not deviate from the set point by more then 0.5o C over a time horizon equal to four hours (i.e N = 16). This requirement can be translated into the following PCTL property 9 Φ := P=p [≤N =16 |Tz1 − TSP | ≤ 0.5]. We then aim at synthesising a policy maximising the safety probability p. This synthesis goal can be computationally hard due to the number of continuous variables making up Mc . To mitigate this limitation, we perform policy synthesis via abstractions ([9]). We simplify (4) into four abstract models using the technique in ([8]). The abstract models are labelled as Mca={4,...,1} , where a represents the number of continuous variables of the corresponding abstract model. The models take the form of Markov decision processes ([8]). We can quantify the error in the output variable, which has been introduced by the different levels of abstractions, through the use of (ε, δ)-approximate simulation relations ([9]). The pair (ε, δ) represents the deviation in the output trajectories between complex and abstract models and the differences in probability distribution of the processes, respectively. Such metrics allows the designer to select which of the considered abstract models provides the best trade off in precision: it is desirable to achieve little deviation in both the output trajectories (small ε) and in the probability distributions (small δ). δ Mc4 Mc3 Mc2 Mc1 1 0.0008 0.0006 0.0011 0.0010 −1 10 2 0.1754 0.1933 0.1950 0.1953 10−1 0.2084 0.2312 0.2373 0.2371 −3 10 2 0.2339 0.2598 0.2681 0.2595 10−2 0.2555 0.2831 0.2928 0.2854 −5 10 2 0.2745 0.3065 0.3155 0.3103 10−3 0.2910 0.3241 0.3278 0.3254 Table 5: Second case study: error metrics (ε, δ) for concrete and abstract models. We compute (ε, δ)-approximate simulation relations between Mc and the set of abstract models Mca={4,...,1} , as presented in Table 5. The (ε, δ) pair providing the optimal trade off is obtained with the abstract model Mc1 and corresponds to (0.2854, 10−2 ). Next, we use FAUST2 to perform a grid-based computation of the safety probability for Mc1 and obtain a model of size 14893 with an overall accuracy of 0.005. Over this approximation we synthesise the optimal policy for the abstract model which results in a safety probability of p0 = 0.9257. We refine the obtained policy ([8]), which results in one that can be used with Mc . The overall process results in Φ being satisfied with a safety probability of p = p0 − η − N δ = 0.7657, where η is the abstraction error introduced by FAUST2 . The results obtained further highlight that by trading off the complexity in the number of continuous variables and computing (ε, δ)-simulation relations, we can synthesise policies using simpler models, yet achieve high performance still when the refined policy is applied to the original model. 3.3 Single zone heating with multiple switching controls In this third and last case study, we focus on mixer, AHU air duct, and zone components from Table 3. We select the AHU as the only source of heat within the zone (the boiler is disconnected). A pictorial description of this setup is in Figure 6. The mixer operates in either of two modes: open (Op) or closed (Cl). The AHU air duct recirculates air from either the internal zone (when ud = 0 and the mixer is in mode Op) or from the outside (when ud = 1 and the mixer is in mode Cl) via the continuous variable Td (output of the mixer component). The rate of air being pumped into the zone (ma ) is controlled by the fan, which has three operating speeds (off O, medium M , and high H). The mixer position and the fan settings can be used to maintain a comfortable temperature within the zone. This setup can be described by a hybrid model. The discrete modes q are in the set {(O, −), (M, Op), (M, Cl), (H, Op), (H, Cl)}, and describe the possible configurations of fan operating speeds {O, M, H} and mixer position {Op, Cl}. (When the fan is switched off, the mixer can be in any position as no air is pumped into the zone.) Continuous variables model the zone temperature (Tz1 ) together with the supply air temperature (Tsa ) being pumped into the zone. Transitions between discrete modes are triggered by continuous dynamics crossing spatial guards: guards denote deviations from temperature set-point as δ, δk , k = {2, . . . , 5}, δ < δ2 < δ3 < δ4 < δ5 . A graphical description 10 Figure 6: BAS setup for third case study of the overall hybrid model, together with the different guard conditions, is shown in Figure 7. The continuous dynamics are built from Table 3 and follow Twss − Tz1 (t) + ma (t)Cpa (Tsa (t) − Tz1 (t) + µ1 CO21ss + β11 ], R −1 = (Ca ρa Va ) [ma (t)Cpa (Td (t) − Tsa (t)) + (U A)a (Tz1 (t) − Tsa (t)]. Ṫz1 = (Cz1 )−1 [ Ṫsa Figure 7: Hybrid model for the third case study, showing discrete states and guard conditions; the initial discrete state is (O, −) 11 The variables ma and Td take values according to the discrete mode as   q(t) = (O, −), 0 ma (t) = ma,med q(t) = (M, Op) ∨ q(t) = (M, Cl),   ma,high q(t) = (H, Op) ∨ q(t) = (H, Cl), and ( Td (t) = Tout Tz1 (t) q(t) = (M, Op) ∨ q(t) = (H, Op), else. Here, ma,med , ma,high correspond to the air flow rates when the fan is operating at medium and high speeds. 3.3.1 Reachability analysis We are interested in performing reachability analysis of the hybrid model, which we run using SpaceEx ([7]). Notice that in this case we do not discretise time and consider a continuous time horizon of 2 hours. We consider two different initial conditions: in the first experiment we select an initial condition equal to Tz1 = 15o C and Tsa = 15o C, while in the second we set Tz1 = 20o C and Tsa = 20o C. The resulting reach tube for the both experiments is shown in Figure 8a. 22 1 Tz (oC) 21.5 21 20.5 20 19.5 20 20.5 21 21.5 Tsa (oC) (a) Initial condition: Tsa = 15o C Tz1 = 15o C, (b) Initial condition: Tsa = 20o C Tz1 = 20o C, Figure 8: Third case study: reach tubes obtained from two different initial conditions In Figure 8a we can see that the model initially is in state (O, −) and jumps to a new state (H, Op) such that warm outside air is pumped into the zone (due to the low temperature of the initial conditions). From (H, Op) it switches to (M, Op) (notice the reduction in the gradient between the variables Tsa ∈ [15 18], Tz1 ∈ [17 19]) and eventually switches back to (O, −) in order to maintain the temperature within the comfort region. For Figure 8b, the reach tube shows that the system remains within the initial state (O, −) over the whole time horizon. 4 Conclusions This paper has presented a library of CPS models for BAS. The BAS modelling framework comprises three different types of complexities (stochasticity, number of continuous variables, 12 number of discrete modes) and is modular such that various BAS components can be composed. We illustrate the use of this BAS components library via three case studies, each of which highlights a different side of the complexity trade off and solves a different problem (simulation, (probabilistic) reachability analysis, and strategy synthesis respectively). Current work is developed towards obtaining a compositional tool that is able to allow for easy construction of BAS models and for interfacing with different (i) verification tools for performing analysis and (ii) synthesis tools for computation of optimal strategies. Acknowledgements This work has been funded by the European Commission in the Seventh Framework Programme project AMBI under Grant No.: 324432 and is in part supported by the Alan Turing Institute, UK and Malta’s ENDEAVOUR Scholarships Scheme. The authors would also like to thank Dario Cattaruzza, Sofie Haesaert and Honeywell Laboratories, Prague for their fruitful feedback. References [1] Hamza Belkhouane, Jan Hensen, and Shady Attia. Thermal comfort models for net zero energy buildings in hot climates. In Second International Conference on Energy and Indoor Environment for Hot Climates. Doha, 2017. [2] Dario Cattaruzza, Alessandro Abate, Peter Schrammel, and Daniel Kroening. Unbounded-time analysis of guarded LTI systems with inputs by abstract acceleration. In International On Static Analysis, pages 312–331. Springer, 2015. [3] Nathalie Cauchi, Khaza Anuarul Hoque, Alessandro Abate, and Mariëlle Stoelinga. Efficient probabilistic model checking of smart building maintenance using fault maintenance trees. arXiv preprint arXiv:1801.04263, 2018. [4] Scott Cotton, Goran Frehse, and Olivier Lebeltel. The spaceex modeling language, 2010. [5] Drury B Crawley, Jon W Hand, Michaël Kummert, and Brent T Griffith. Contrasting the capabilities of building energy performance simulation programs. Building and environment, 43(4):661–673, 2008. [6] Iulia Dragomir, Viorel Preoteasa, and Stavros Tripakis. The refinement calculus of reactive systems toolset. arXiv preprint arXiv:1710.08195, 2017. [7] Goran Frehse, Colas Le Guernic, Alexandre Donzé, Scott Cotton, Rajarshi Ray, Olivier Lebeltel, Rodolfo Ripado, Antoine Girard, Thao Dang, and Oded Maler. SpaceEx: Scalable verification of hybrid systems. In Computer Aided Verification, pages 379–395. Springer, 2011. [8] Sofie Haesaert, Nathalie Cauchi, and Alessandro Abate. Certified policy synthesis for general markov decision processes: An application in building automation systems. Performance Evaluation, 117:75–103, 2017. [9] Sofie Haesaert, Sadegh Esmaeil Zadeh Soudjani, and Alessandro Abate. Verification of general Markov decision processes by approximate similarity relations and policy refinement. SIAM Journal on Control and Optimization, 55(4):2333–2367, 2017. [10] Ernst Moritz Hahn, Arnd Hartmanns, Holger Hermanns, and Joost-Pieter Katoen. A compositional modelling and analysis framework for stochastic hybrid systems. Formal Methods in System Design, 43(2):191–232, 2013. [11] Ondrej Holub, Majid Zamani, and Alessandro Abate. Efficient hvac controls: A symbolic approach. In Control Conference (ECC), 2016 European, pages 1159–1164. IEEE, 2016. 13 [12] Woohyun Kim and Srinivas Katipamula. A review of fault detection and diagnostics methods for building systems. Science and Technology for the Built Environment, pages 1–18, 2017. [13] Niels Rode Kristensen, Henrik Madsen, and Sten Bay Jørgensen. Parameter estimation in stochastic grey-box models. Automatica, 40(2):225–237, February 2004. [14] Y. Ma, A. Kelman, A. Daly, and F. Borrelli. Predictive control for energy efficient buildings with thermal storage: modeling, stimulation, and experiments. Control Systems, IEEE, 32(1):44–64, February 2012. [15] S. Privara, J. Cigler, Z. Vana, F. Oldewurtel, C. Sagerschnig, and E. Zacekova. Building modeling as a crucial part for building predictive control. Energy and Buildings, 56:8–22, 2013. [16] S. Esmaeil Zadeh Soudjani and A. Abate. Aggregation and Control of Populations of Thermostatically Controlled Loads by Formal Abstractions. Control Systems Technology, IEEE Transactions on, 23(3):975–990, May 2015. [17] Sadegh Esmaeil Zadeh Soudjani, Caspar Gevaerts, and Alessandro Abate. Faust 2: Formal Abstractions of Uncountable-STate STochastic processes. In TACAS, volume 15, pages 272–286, 2015. [18] Wei Yu, Baizhan Li, Hongyuan Jia, Ming Zhang, and Di Wang. Application of multiobjective genetic algorithm to optimize energy efficiency and thermal comfort in building design. Energy and Buildings, 88:135–143, 2015. [19] Rongpeng Zhang and Tianzhen Hong. Modeling of {HVAC} operational faults in building performance simulation. Applied Energy, 202:178 – 188, 2017. 14 Appendix Discrete-time models for heating system of two zones with deterministic or stochastic dynamics We present the corresponding system matrices of the three models Md , Mda , Ms described in Sec. 3.1. Md is given by (1) and is characterised by the following system matrices:  0.6682 0   0.1320   3.4364  0.02632 0 0 0.6830 0 0.02096 2.9272 . , Qd = 13.0207 A = 1.0005 , B = 0.1402 0 −0.000499 0 0 0 0.8004 0 0 0.1996 10.4166 Mda is given by (2) and is characterised by the same system matrices used for Md together with,  8.760e−06   3.3378  0 0 2.704e−07 , Q 2.9106 Fda = da = 13.0207 . 0 0 0 10.4166 0 Ms is given by (3) and is characterised by the same system matrices used for Md together with,   0.0774 0 0 0 0 0.0774 0 0 . Σ= 0 0 0.3872 0 0 0 0 0.3098 In all cases we use, Twss = 18o C, TSP = 20o C, Tsw,bss = 75o C, Tz1ss = 20o C, Tz2ss = 20o C, Trw,r1ss = 35o C, Trw,r2ss = 35o C. We perform a simulation run of all three models over a two-day period, with ( 20o C k is between 8am - 12pm, 1pm - 6pm, u[k] = 18o C otherwise, and depict the resulting simulation runs for the temperature within zone 1 in Figure 3. Reachability analysis using Axelarator To perform reachability analysis using Axelarator we need to use the following commands in command line, ../aa/axelerator Dynamics.txt -init "[]" -sguard "[]" -inc -mpi -u where the file Dynamics.txt contains the corresponding system matrices and defines the dimensions of both the state space and control inputs of the underlying model. The initial conditions are defined using -init "[]" and -sguard "[]" will force the tool to stay inside the safe region (if possible) defined within "[]". The commands -inc -mpi -u set the conditions of the problem such that Axelarator makes use of incremental search with multiple precision intervals and to process unsound results. We also provide Axelerator with the safe set defined in the form of a polyhedral,         Tz1 19.5 Tz1 20.5 > ∧ < . Tz2 19.5 Tz2 20.5 This safe set is used as a reference once the resulting reach tube is computed. The results obtained using Axelarator are in the form of polyhedral sets which define the reach tube of 15 the underlying system over the N time steps. For Md the polyhedral sets are given as,   T < 22.2282, T < 22, z1                      z2 Trw,r1 −Tz1 −Trw,r1 Tz1 +Tz2 Tz1 +Trw,r2 Tz1 −Trw,r1 −Tz1 +Tz2 −Tz1 +Trw,r2 −Tz1 −Trw,r1 Tz2 +Trw,r1 Tz2 −Trw,r1 −Tz2 +Trw,r1 −Tz2 −Trw,r1 Trw,r1 +Trw,r2 −Trw,r1 +Trw,r2 < < < < < < < < < < < < < < < 40, Trw,r2 −10.0899, −Tz2 105.958, −Trw,r2 44, Tz1 +Trw,r1 62, Tz1 −Tz2 116.097, Tz1 −Trw,r2 7, −Tz1 +Trw,r1 25, −Tz1 −Tz2 95.8203, −Tz1 −Trw,r2 62, Tz2 +Trw,r2 114.105, Tz2 −Trw,r2 25, −Tz2 +Trw,r2 100.555, −Tz2 −Trw,r2 80, Trw,r1 −Trw,r2 126.441, −Trw,r1 −Trw,r2 < < < < < < < < < < < < < < < 40,  −5.40334,   −11.1481,   62,  9.40198,   1.12788,   25,  −15.4932, ,  −21.238,   62,  −5.50237,   25,  −16.5515,   10, 94.8101 Tz1 Trw,r1 −Tz1 −Trw,r1 Tz1 +Tz2 Tz1 +Trw,r2 Tz1 −Trw,r1 −Tz1 +Tz2 −Tz1 +Trw,r2 −Tz1 −Trw,r1 Tz2 +Trw,r1 Tz2 −Trw,r1 −Tz2 +Trw,r1 −Tz2 −Trw,r1 Trw,r1 +Trw,r2 −Trw,r1 +Trw,r2 < < < < < < < < < < < < < < < < 22.3242, T z2 40, Trw,r2 −10.1225, −Tz2 109.275, −Trw,r2 44, Tz1 +Trw,r1 62, Tz1 −Tz2 119.446, Tz1 −Trw,r2 7, −Tz1 +Trw,r1 25, −Tz1 −Tz2 99.1041, −Tz1 −Trw,r2 62, Tz2 +Trw,r2 117.336, Tz2 −Trw,r2 25, −Tz2 +Trw,r2 103.886, −Tz2 −Trw,r2 80, Trw,r1 −Trw,r2 129.684, −Trw,r1 −Trw,r2 < < < < < < < < < < < < < < < < 22, 40,  −5.38875,   −11.1512,   62,  9.50273,   1.20718,   25,  −15.5113,   −21.2737,   62,  −5.51993,   25,  −16.5399,   10, 98.1239. whereas for Mda                        Probabilistic reachability analysis using FAUST2 To solve this problem and achieve low errors within a computationally feasible time frame we abstract the model Ms such that xT = [Tz1 Tz2 ]T (the states of interest and we fix the rest of the state to steady-state). Based on this model, we construct a stochastic kernel in the form of a Gaussian conditional distribution, N (f (x, u), Σ) where f (x, u) = Ax + Bu + Qd (cf. (3)) and Σ = diag(∆[σz21 , σz22 ]) . The input space of the process is set to [15 22], while the safe-set is defined as   19.5 19.5 . 20.5 20.5 We select the PCTL Safety option in FAUST2 to compute the analysis. The model is abstracted based on adaptive partitioning, with a partitioning error of  = 10−5 , to obtain the discretised transition kernel. The maximal safety probability for each partition is computed, based on the transition kernel, recursively over the whole time horizon N = 6. 16 Discrete-time models for two-zone heating setup with large number of continuous variables We present the corresponding system matrices of the model Mc described in Subsection 3.2 as:  0.9998 6.54e−9 2.23e−5 2.23e−5 2.23e−5 4.88e−14 4.88e−14   0.000122  5.739e−9 0.9998 4.27e−14 4.27e−14 2.23e−5 2.23e−5 2.23e−5 0.0005 1.27e−12 0.9989 6.54e−9 6.54e−9 7.13e−18 7.13e−18  0.0005 1.27e−12 6.54e−9 0.9989 6.54e−9 7.13e−18 7.13e−18 , 0.00051 0.00058 5.73e−9 5.73e−9 0.9989 6.54e−9 6.54e−9  1.11e−12 0.00058 6.25e−18 6.25e−18 6.54e−9 0.9989 6.54e−9 1.11e−12 0.00058 6.25e−18 6.25e−18 6.54e−9 6.54e−9 0.9980  1.027e−8 5.734e−9 7.31e−9 2.71e−15 0.0013 0.0014  1.91e−7 5.73e−9 1.39e−17 1.24e−6 0.0021 0.0022  2.00e−12 0.0005 2.13e−12 3.96e−19 3.84e−7 3.84e−7   0.0009 1.11e−12 2.13e−12 3.96e−19 3.84e−7 3.84e−7 ,  3.90e−11 2.09e−12 1.87e−12 3.63e−10 9.78e−7 9.78e−7  3.72e−11 0.00051 2.042e−21 3.63e−10 6.41e−7 6.41e−7 0.01708 1.11e−12 2.04e−21 3.63e−10 6.40e−7 6.41e−7 0.000122  3.58e−8  3.58e−8  Bc =   6.72e−8 ,  Ac =   Fc = 3.58e−8 3.58e−8   Qc =  0.2482  −0.0055 0.1270  0.0201 . 0.0145 0.0144 0.0145 We model the disturbances as random external effects affecting the room temperature dynamics as Tout [k] ∼ N (9, 1), Thall [k] ∼ N (15, 1), CO2i [k] ∼ N (500, 100), i ∈ {1, 2}, Trw,ri [k] ∼ N (35, 5), i ∈ {1, 2}. Next, we present the abstract models Mca , a = {4, . . . , 1} taking the same form as (4) with xTc [Tz1 Tw5 Tw2 Tw7 ]T [Tz1 Tw5 Tw2 ]T [Tz1 Tw2 ]T [Tz1 ]T Model Mc4 Mc3 Mc2 Mc1 dTc [Tout [Tout [Tout [Tout and, Tz2 is ∼ N (20, 1). For Mc4 we have " 0.9998 0.00058 0.00058 0.00051 Ac4 = " Fc4 = 2.23e−5 0.9989 6.54e−9 5.73e−9 2.23e−5 6.54e−9 0.9989 5.73e−9 2.23e−5 6.54e−9 6.54e−9 0.9989 Thall CO21 Trw,r1 Tz2 ]T Thall CO21 Trw,r1 ]T CO21 Trw,r1 ]T CO21 Trw,r1 ]T # " , B c4 = 1.02e−8 5.73e−9 7.31e−9 0.0013 6.54e−9 2.00e−12 0.0005 2.13e−12 3.84e−7 1.27e−12 0.0009 1.11e−12 2.13e−12 3.84e−7 1.27e−12 1.75e−12 9.79e−13 1.87e−12 3.37e−7 0.00058 0.00012 3.5859e−8 3.5859e−8 3.1424e−8 # # , Qc4 = ,  0.2482  0.1270 , 0.0145 0.0145 while for Mc3 ,  0.9998 2.23e−5 2.23e−5 0.00058 0.9989 6.54e−9 0.00058 6.54e−9 0.9980  6.29e−9 5.73e−9 1.22e−12 0.00051 0.00056 1.11e−12 2.13e−12 3.84e−7 Ac 3 = Fc3 =  h 0.000122 i , Bc3 = 0.000122 , 3.58e−8  h 0.2482 i 7.31e−9 0.0013 2.13e−12 3.84e−7 , Qc3 = 0.1270 . 0.0145 For Mc2 the system matrices are  0.9998 2.237e−5   0.00012  Ac2 = 0.00058 , Bc2 = 3.58e−8 , 0.9989 h i  0.2482  1.027e−8 7.31e−9 0.0013 Fc2 = 0.00091 2.13e−12 3.84e−7 , Qc2 = 0.1270 . and Mc1 is described using Ac1 = [ 0.9998 ], Bc1 = [ 0.000122 ], Fc1 = [ 6.31e−5 7.31e−9 0.0013 ], Qc1 = [ 0.2482 ]. 17 Models for heating system setup with multiple switching controls To construct the hybrid model we use Twss = 18o C, Tout = 25o C, TSP = 20o C, δ = 1o C, δ2 = 2o C, δ3 = 3o C, δ4 = 4o C, δ5 = 5o C, ma,med = 10m3 /hr, ma,high = 15m3 /hr CO2ss = 500ppm. The continuous dynamics are composed via the following simplifying assumptions: (i) the outside air temperature is fixed Tout = 25o C and is used to warm up the zone such the temperature set-point TSP = 20o C is maintained; (ii) we fix CO21ss ; (iii) there is a constant wall temperature Twss ; (iv) there are no radiators within the zone; and (v) there is no process noise. The resulting continuous state models for each discrete mode using the corresponding models presented in Table ??. Discrete state q = (O, −) q = (M, Op) q = (M, Cl) q = (H, Op) q = (H, Cl) Continuous space dynamics Ṫz1 = −0.0116Tz1 (t) + 0.2565 Ṫsa = 0.0183Tz1 (t) − 0.0183Tsa (t) Ṫz1 = −0.0292Tz1 (t) + 0.0176Tsa (t) + 0.2565 Ṫsa = 0.0183Tz1 (t) − 0.0185Tsa (t) + 0.005 Ṫz1 = −0.0292Tz1 (t) + 0.0176Tsa (t) + 0.2565 Ṫsa = 0.0183Tz1 (t) − 0.0183Tsa (t) Ṫz1 = −0.038Tz1 (t) + 0.0264T sa(t) + 0.2565 Ṫsa = 0.0183Tz1 (t) − 0.0186Tsa (t) + 0.0076 Ṫz1 = −0.038Tz1 (t) + 0.0264T sa(t) + 0.2565 Ṫsa = 0.0186Tz1 (t) − 0.0186Tsa (t). Reachability analysis using SpaceEx We first implement the hybrid system delineated using Figure 7 within SpaceEx using SX (the SpaceEx modelling language [4]). We further bound the zone temperature to lie between Tz1 ∈ [10 30], while supply temperature to lie between Tsa ∈ [15 30]: corresponding to physically feasible states when BAS is operating in a good condition. This model file is loaded into SpaceEx and the input model is converted into a flat hybrid automaton representation over which reachability analysis can be performed. Next, we set-up the configuration file defining (i) the initial states in the form of "Tz1==15&Tsa==20&loc()==off", where "off" refers to the initial state label, (ii) any forbidden states (in our case study there is none), (iii) the time-horizon, and (iv) the direction of the reach sets (we select oct, but similar results are achieved when the direction of reach set was set to box). Once the configuration file is loaded, the reachability analysis algorithm is run over the defined time horizon, which in our case corresponds to two hours and the reachable sets are generated (cf. Figure 8). 18
3cs.SY
Beta-gamma algebra identities and Lie-theoretic exponential functionals of Brownian motion arXiv:1404.7029v3 [math.PR] 27 Apr 2016 Reda Chhaibi ∗ In memoriam Marc Yor Abstract We explicitly compute the exit law of a certain hypoelliptic Brownian motion on a solvable Lie group. The underlying random variable can be seen as a multidimensional exponential functional of Brownian motion. As a consequence, we obtain hidden identities in law between gamma random variables as the probabilistic manifestation of braid relations. The classical beta-gamma algebra identity corresponds to the only braid move in a root system of type A2 . The other ones seem new. A key ingredient is a conditional representation theorem. It relates our hypoelliptic Brownian motion conditioned on exiting at a fixed point to a certain deterministic transform of Brownian motion. The identities in law between gamma variables tropicalize to identities between exponential random variables. These are continuous versions of identities between geometric random variables related to changes of parametrizations in Lusztig’s canonical basis. Hence, we see that the exit law of our hypoelliptic Brownian motion is the geometric analogue of a simple natural measure on Lusztig’s canonical basis. MSC 2010 subject classifications: 60B15, 60B20, 60J65 Keywords: Beta-gamma algebra identities, Exponential functionals of Brownian motion, Braid relations, Total positivity, Brownian motion. ∗ Universität Zürich. Email: [email protected] 1 Contents 1 Introduction 2 Main results 2.1 Preliminaries . . . . . . . 2.2 Conditional representation 2.3 Exit law . . . . . . . . . . 2.4 Beta-gamma algebra . . . 2 . . . . . theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4 10 12 13 3 Identities in law 17 3.1 Gamma identities . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2 Exponential identities . . . . . . . . . . . . . . . . . . . . . . 17 3.3 Geometric identities . . . . . . . . . . . . . . . . . . . . . . . 20 4 Proof of the conditional representation theorem 21 5 Review of Dufresne’s identity and the relationship proven 23 by Matsumoto and Yor 5.1 Exponential functionals of Brownian motion . . . . . . . . . . 23 5.2 Proofs of the relationship between Brownian motions of opposing drifts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6 Some open questions 1 29 Introduction Let G be a complex semi-simple group of rank r. We fix a Borel subgroup B. B = N H where H ≈ (C∗ )r is a maximal complex torus and N is a lower unipotent subgroup N . We denote by h ≈ Cr the Lie algebra of H. If a ≈ Rr is the subspace where roots are real, we have h = a + ia. Moreover, we write A := exp (a). Since a is an Euclidean space thanks to the Killing form h·, ·i, there is a natural notion of Brownian motion on a. Then the Brownian motion with drift µ is denoted by: (µ) Xt := Xt + µ t In the context of geometric crystals, the Robinson-Schensted correspondence with random input X (µ) is performed by solving, on the Borel subgroup B, a left-invariant stochastic differential equation driven by this Brownian motion ([Chh14] section 10, [Chh13]). One then obtains a Lie group valued stochastic process Bt X (µ) , which was first introduced by [BBO05]. More is said in the preliminary section. We refer to this process as our hypoelliptic Brownian motion because its infinitesimal generator satisfies the 2 (parabolic) Hörmander condition. Although we will not make use of this fact, it is reassuring to know that it has a smooth transition kernel. The stochastic process Bt X (µ) has an N A decomposition:       Bt X (µ) = Nt X (µ) At X (µ) The A part is a multiplicative Brownian motion and does not converge. We focus on the N part which plays the role of a multidimensional exponential functional of Brownian motion. Let ∆ be set the set of simple roots and C be the open Weyl chamber: C := {x ∈ a | ∀α ∈ ∆, hα, xi > 0}  When µ ∈ C the N part converges to N∞ X (µ) . We refer to the law of  N∞ X (µ) as the exit of law of the hypoelliptic Brownian motion. The first result is the conditional representation theorem 2.12 that characterizes the law of a certain integral transform of Brownian motion as the Brownian motion X (µ) conditioned to N∞ X (µ) being fixed. As a consequence, we are able to give an explicit formula for the exit law in theorem 2.16. This is our second main result. The expression involves independent gamma variables. In the case of the group SL2 , one recovers Dufresne’s identity in law on the exponential functional of a Brownian motion with drift [Duf90]. For W a standard Brownian motion and µ > 0, R∞ (µ) this identity states that the random variable 2 0 e−2Ws ds has the same distribution as γ1µ , where γµ is a gamma random variable with parameter µ. For groups with higher rank, the presented construction gives the explicit law of multiple exponential functionals of Brownian motion.  Almost surely, N∞ X (µ) belongs to the set of totally positive matrices w0 N>0 ⊂ N . The study of totally positivity in reductive groups has been initiated by George Lusztig (see [Lus08] for a survey), motivated by the w0 theory of canonical bases. We will only need the fact that N>0 possesses equivalent charts indexed by reduced words i of the longest element  w0 in the Weyl group. Simply by noticing that the law of N∞ X (µ) uses gamma variables and charts that depend on a choice of reduced word, we find hidden identities in law between these gamma variables. Primitive identities are associated to braid moves. It follows that we have as many primitive identities as there are rank 2 root systems. That is the content of our third main result, stated as theorem 2.21. In fact, the identities between gamma variables tropicalize to identities between exponential random variables. We also prove the discrete version involving geometric random variables, using Lusztig’s parametrization of canonical bases. 3 Structure of the paper We begin by stating the three main theorems 2.12, 2.16 and 2.21 in section 2, after the necessary preliminaries on Lie theory and total positivity. We will illustrate our claims thanks to examples from SL2 and SL3 . It is more convenient to postpone the proof of the conditional representation theorem 2.12 and explain right away how it implies the two others. In section 3, we show how rational identities between gamma variables tropicalize to min-plus identities between exponential variables. It implies the discrete version involving geometric random variables. In section 4, we prove the conditional representation theorem. Thanks to results from [Chh14] and [Chh13], we reduce the problem to an induction whose base case is a result by Matsumoto and Yor on a relationship between Brownian motions with opposite drifts [MY01]. Just before diving into the proof, we explain how the Matsumoto-Yor theorem is the SL2 case of ours. We review this result for the sake of completeness in section 5, along with Dufresne’s identity. This section is absent in the published version. Finally, we conclude with some open questions. Acknowledgments The author is grateful to Marc Yor for fruitful discussions on exponential functionals of Brownian motion and beta-gamma identities. This paper is dedicated to his memory. I am also thankful to Philippe Bougerol for his guidance during my PhD thesis [Chh13], on which this article is based. 2 2.1 Main results Preliminaries Lie theory: We will need some (mostly standard) notations and terminology for semi-simple groups and algebras (see for example [Spr09], [Hum72]). Let g be a complex semi-simple Lie algebra of rank r, and h ≈ Cr is a maximal abelian subalgebra, the Cartan subalgebra. It has a Cartan decomposition g = n ⊕ h ⊕ u. ∆ = {αi , 1 ≤ i ≤ r} ⊂ h∗ (resp. ∆∨ ⊂ h) denote the simple roots (resp. coroots) of g. The real part of the Cartan subalgebra a ( h = a + ia) is the subspace where simple roots are real valued. The of g is entirely encoded by the Cartan matrix  structure   ∨ A = ai,j = αi αj . The coefficients in the Cartan matrix de1≤i,j≤r termine the relations between Chevalley generators (fα , hα = α∨ , eα ), for α ∈ ∆. Simple roots form a basis of h∗ dual to the fundamental coweights (ωα∨ )α∈∆ . Let G be a simply-connected complex Lie group with Lie algebra g. N , H and U are the subgroups with Lie algebras n ⊕ h ⊕ u. H ≈ (C∗ )r is a 4 maximal torus. B = N H and B + = HU form a pair of opposite Borel subgroups. We have a one-parameter subgroup for every α ∈ ∆: ∀t ∈ C, yα (t) := exp(tfα ), xα := exp (teα ) When convenient, they will sometimes be written yi and xi , 1 ≤ i ≤ r. We identify h and h∗ thanks to the Killing form h·, ·i. In this identifica2β 2α tion, α∨ = hα,αi . In general, we will write for any β ∈ h∗ , β ∨ = hβ,βi ∈ h. The reflection on h with respect to the hyperplane ker β is: ∀h ∈ h, sβ (h) = h − β (h) β ∨ The Weyl group of G is defined as W = Norm(H)/H. It acts on the torus H by conjugation and hence on h. As a Coxeter group, it is generated by the reflections (sα )α∈∆ . Every w ∈ W can be written as a product si1 . . . sik for a sequence i = (i1 , . . . , ik ). A reduced word for w ∈ W is a sequence i of shortest possible length ℓ(w). The set of all possible reduced words for w is denoted by R(w). The Weyl group has a unique longest element denoted by w0 and we set m = ℓ(w0 ). The Bruhat decomposition states that G is the disjoint union of cells: G G G= B + ωB + = Bτ B + τ ∈W ω∈W In the largest opposite Bruhat cell BB + = N HU , every element g admits a unique Gauss decomposition in the form g = nau with n ∈ N , a ∈ H, u ∈ U . In the sequel, we will write g = [g]− [g]0 [g]+ , [g]− ∈ N , [g]0 ∈ H and [g]+ ∈ U for the Gauss decomposition. Also [g]−0 := [g]− [g]0 . Remark 2.1. The reader unfamiliar with Lie groups can have in mind the example of SLn (C), of rank r = n − 1. The following matrices can be chosen as Chevalley generators. If Ei,j = (δi,r δj,s )1≤r,s≤n are the usual elementary matrices, then hi = Ei,i − Ei+1,i+1 , ei = Ei,i+1 , and fi = Ei+1,i . h is the set of complex diagonal matrices with zero trace, which we identify P n with {x ∈ C | xi = 0}. Then H is the set of diagonal matrices with determinant 1. N (resp. U ) is the set of lower (resp. upper) triangular unipotent matrices. We have: ∀t ∈ C, yi (t) = Id + tEi+1,i , xi (t) = Id + tEi,i+1 The Weyl group W is the group of permutation matrices and acts on h by permuting coordinates. In the identification with the symmetric group acting on n elements, the reflections si are identified with transpositions (i i + 1). The longest word w0 reorders the elements 1, 2, . . . , n in decreasing order. In the case of GLn , the second Bruhat decomposition is known in linear algebra as the LPU decomposition which states that every invertible matrix 5 can be decomposed into the product of a lower triangular matrix L, a permutation matrix P and an upper triangular matrix U . P is unique. The largest opposite Bruhat cell corresponds to P = id. It is dense as it is the locus where all principal minors are non-zero. Remark 2.2 (Cartan-Killing classification). Complex simple Lie algebras are known, and are classified by types: • Type Ar−1 : g = slr G = SLr (C) • Type Br : g = so2r+1 G = SO2r+1 (C) • Type Cr : g = spr G = Spr (C) • Type Dr : g = so2r G = SO2r (C) • Exceptional types: E6 , E7 , E8 , F4 , G2 . The number in subscript indicates the rank. The set of roots is denoted by Φ := {β ∈ h∗ | sβ ∈ W } . F Roots split into positive and negative roots Φ = Φ+ Φ− , with Φ+ being the set of roots that can be written as a positive sum of simple roots. Reduced expressions of Weyl group elements give convex orderings of positive roots (see [Hum90]): Lemma 2.3. Let (i1 , . . . , ik ) be a reduced expression of w ∈ W . Then for j = 1, . . . , k: βi,j := si1 . . . sij−1 αij produces all the positive roots in the set of inversions of w:  Inv (w) := β ∈ Φ+ , wβ ∈ Φ− . For w = w0 , it produces all positive roots i.e Inv (w0 ) = Φ+ . When i ∈ R(w0 ), we call the sequence (βi,j )1≤j≤m an enumeration of positive roots. When the chosen reduced expression is obvious from context, we will drop the subscript i. In appendix, we list positive root enumerations for rank 2 systems. 6 Total positivity: In the classical case of GLn , a totally non-negative matrix is a matrix such that all its minors are non-negative. Thanks to the classical Cauchy-Binet formula, totally non-negative matrices (GLn )≥0 form a semi-group. In [Lus94], Lusztig generalized total positivity to reductive groups motivated by the theory of canonical bases. At that level of generality, taking the semi-group property as a definition is simpler. The totally non-negative part of G is denoted G≥0 and is defined as the semi-group generated by the following sets: • The semi-group H>0 := A = exp (a) ≈ R∗+ r • The semi-group generated by {xα (t), t > 0, α ∈ ∆}: U≥0 • The semi-group generated by {yα (t), t > 0, α ∈ ∆}: N≥0 We will be interested in parametrizations of G≥0 . Lusztig proved that totally non-negative elements admit a Gauss decomposition made of totally non-negative elements. Theorem 2.4 ([Lus94] Lemma 2.3). Any element g ∈ G≥0 has a unique Gauss decomposition g = nau with n ∈ N≥0 , a ∈ A and u ∈ U≥0 . Therefore, one can focus on the parametrizations of U≥0 . The following theorem generalizes a result of Whitney [Whi52] from GLn to G. It says that a totally positive element in U can be written as a product of elementary matrices, depending on where it falls in the Bruhat decomposition. Theorem 2.5 ([Lus94] Proposition 2.7, [BZ97] Proposition 1.1). For any w ∈ W with k = ℓ(w), every reduced word i = (i1 , . . . , ik ) in R(w) gives rise w := U to a parametrization of U>0 ≥0 ∩ BwB by: xi : w → U>0 Rk>0 (t1 , . . . , tk ) 7→ xi1 (t1 ) . . . xik (tk ) We also define the transition maps: Ri,i′ := x−1 i ′ ◦ xi which play a particularly important role. For the purposes of this paper, we will only need the case of w = w0 and w0 we will call such a parametrization the Lusztig parametrization of U>0 . The w0 positive reals (t1 , . . . , tm ) such that u = xi (t1 , . . . , tm ) ∈ U>0 will be called Lusztig parameters of u, the dependence in i being implicit. 7 On Lusztig’s canonical basis: We will only be interested in the parametrizations of the canonical basis. The combinatorics of total posivity in the group G are related to the combinatorics of Lusztig’s canonical basis for the dual group, after a tropicalization procedure [.]trop . More is said on tropical  ization in section 3 where Ri,i′ trop is defined. For now, let us record the following: Theorem 2.6 (see [Lus90a], [Lus90b]). There is a canonical basis L of Uq (n∨ ), the lower unipotent part of the dual quantum group Uq (g∨ ). It has a natural parametrization associated to every reduced word i ∈ R (w0 ): Li : Nℓ(w0 ) −→ L and the changes of parametrizations are given by:   Ri,i′ trop = L−1 i′ ◦ Li . Brownian motion(s): Since a is made into an Euclidean space thanks to the Killing form h·, ·i, there is a natural notion of Brownian motion on a. Indeed, h·, ·i is a scalar product once restricted to a and the induced norm is denoted by || · ||. Let (Ω, A, P) be the canonical probability space of a Brownian motion X on a. For µ ∈ a, the Brownian motion with drift µ is denoted by: (µ) Xt := Xt + µ t . Brownian motion with drift µ and starting position x0 ∈ a is written: (x0 ,µ) Xt := x0 + Xt + µ t . One obtains a left-invariant Brownian motion Bt (X (µ) ) on B by solving the following stochastic differential equation driven by any path X. The symbol ◦ indicates that the SDE has to be understood in the Stratonovitch sense:  P ( (µ) 1 hα, αif dt + dX dBt (X (µ) ) = Bt (X (µ) ) ◦ α t α∈∆ 2 (2.1) B0 (X (µ) ) = Id The SDE can be explicitly solved ([BBO05]):   Z k Y  X ||αij ||2 −αij (Xt(µ) )  X (µ) e t j e Bt (X (µ) ) =  dt f . . . f j i1 ik   2 t≥tk ≥···≥t1 ≥0 j=1 k≥0 i1 ,...,ik (2.2) 8 Clearly, Bt (X (µ) ) has an N A decomposition is given by: 2 X Z (µ) (µ) −α (X )···−αik (Xt ) ||αi1 || (µ) k e i1 t1 Nt (X ) = ... 2 t≥tk ≥···≥t1 ≥0 (2.3) k≥0 i1 ,...,ik ... ||αik ||2 fi1 . . . fik dt1 . . . dtk 2   (µ) At X (µ) = eXt (2.4) (2.5) 2 Remark 2.7. The presence of half squared norms ||α|| is here to account 2 for the fact that time does not flow in the same fashion for all roots. In the simply-laced groups (ADE-types), one can choose all roots to be the same 2 length, hence choosing ||α|| 2 = 1 for all α. Remark 2.8. In the A1 case only, we opt out of the normalization made in the previous remark. Indeed, the classical choice for the only root is α = 2. 2 Hence the factor ||α|| 2 = 2 in the following example of SL2 . Example 2.9 (SL2 - A1 type). Let X (µ) be a Brownian motion with drift µ on R. The SDE is: ! (µ) 0 dXt (µ) (µ) dBt (X ) = Bt (X ) ◦ (µ) 2dt −dXt and its solution is: (µ) Bt (X (µ) ) = eXt (µ) eXt Rt 0 0 (µ) 2e−2Xs (µ) ds e−Xt ! Example 2.10 (SLn - An−1 type).P As in remark 2.1, let X be a Brownian n motion with drift µ on {x ∈ R | xi = 0}. For notational reasons, we drop the superscript (µ) and put indices as exponents. The SDE becomes:  1  0 0 ··· 0 dXt  ..  ..  dt dX 2 0 . .  t     .. .. dBt (X (µ) ) = Bt (X (µ) ) ◦  0 . . 0  dt    ..  .. ..  . . . dXtn−1 0  0 ··· 0 dt dXtn and its solution Bt (X (µ) ) is given by:  1 eXt 0 0 R 2 1 2 −X 1 t  X X X e t 0 e t 0 e s s ds   1 Rt 2 R R 2 1 1 3 2 3 2 s t Xs1 −Xs1 eXt ds1 0 1 eXs2 −Xs2 ds2 eXt 0 eXs −Xs ds eXt  0 e .. .. .. . . . 9  ··· · · ·  ..  .  .. . r The process At (X (µ) ) is a multiplicative Brownian motion on A ≈ R∗+ and does not converge. The main theorems concern the N part, which converges when the drift is inside the Weyl chamber, and we are able to give an explicit formula for the exit law. On a few occasions, we will need to consider the path π driving the flow B. (π) to be any path. The previous construction carries verbatim if π is a semi-martingale. 2.2 Conditional representation theorem L The symbol = stands for equality in law between random variables. Moreover, a generic gamma random variable with parameter a > 0 is denoted γa . 1 a−1 −x P (γa ∈ dx) = x e 1R+ (x) dx Γ(a) where Γ is the gamma Euler function. Let C (R+ , a) be the space of continuous functions with values in a. The following theorem defines our path transform: Theorem 2.11 ( [BBO09] Proposition 6.4 , [Chh14] section 5 ). For any totally non-negative g ∈ U≥0 , there is a path transform Tg : C (R+ , a) −→ C (R+ , a) such that for any path X: ∀t ≥ 0, Bt (Tg X) = [gBt (X)]−0 This transform is well-defined in the sense that the Gauss decomposition always exists for g ∈ U≥0 . From now on, fix a reduced word i ∈ R(w0 ) of length m = ℓ(w0 ) and call (β1 , . . . , βm ) the associated positive roots enumeration. Choose w̄0 to be any representative in G on the longest element w0 in W = Norm(H)/H. Also, we introduce the shift vector:   X hα, αi ωα∨ θ= log 2 α∈∆ where ωα∨ are the fundamental coweights. As in remark 2.7, for ADE groups, θ = 0 because all roots can be chosen and are chosen to be of the same squared norm 2. We can state the following theorem whose proof is postponed to section 4: w0 Theorem 2.12 (Conditional representation theorem). Let g ∈ U>0 ,µ∈C and W a standard Brownian motion on a.  Then Λx0 := x0 + Teθ ge−θ W (w0 µ) is distributed as a Brownian motion X x0 ,(µ) • with drift µ 10 • with initial position x0 • conditioned on N∞ (X 0,(µ) ) = Θ(g) where w0 w0 Θ : U>0 −→ N>0 is the bijective function Θ(g) := [gw̄0 ]− Moreover, if we pick g = xi1 (t1 ) . . . xim (tm ) , m = ℓ(w0 ) being random with L independent Lusztig parameters such that tj = γhβj∨ ,µi , then Λx0 is a standard Brownian motion with drift µ starting at x0 . Remark 2.13. The conditioning approach owes a lot to Baudoin and O’Connell [BO11] in spirit, but ends up being quite different. Indeed, that paper considered conditioning of Brownian motion X (µ) with respect to simple integrals R ∞ a−α(X (µ) ) , for α a simple root. Nevertheless, the geometric path model 0 e developed in [Chh14] and [Chh13] makes it more natural to condition with respect to N∞ (X (µ) ). The random variable N∞ (X (µ) ) not only contains the simple integrals, but also iterated ones. Example 2.14 (Θ in A1 -type). For G = SL2 , one can choose:   0 −1 w̄0 = 1 0 Then: Θ        1 0 1 t 1 t 0 −1 = 1 = 0 1 0 1 1 0 t 0 − Example 2.15 (Θ in A2 -type). For G = SL3 , one can choose:   0 0 1 w̄0 = 0 −1 0 1 0 0 If: Then:     1 t1 0 1 0 0 1 t3 0 g = 0 1 0 0 1 t2  0 1 0 0 0 1 0 0 1 0 0 1     1 1 t1 + t3 t1 t2 0 0 1 1  1 t2  0 −1 0 =  t1 Θ (g) = 0 1 0 0 1 1 0 0 − t1 t2 11 0 1 t 1+ t1 3 t2  0 0  1 2.3 Exit law Thanks to the conditional representation theorem, we obtain the exit law with little effort. Theorem 2.16 (Law of N∞ (X (µ) )). If X (µ) is a Brownian motion with drift µ the Weyl chamber, then Nt (X (µ) ) converges almost surely inside the w0 open cell N>0 and N∞ (X (µ) ) = Θ (xi1 (t1 ) . . . xim (tm )) where the Lusztig parameters tj are independent random variables with: L tj = γhβj∨ ,µi Proof. The condition µ ∈ C entails the convergence of iterated integrals in the explicit expression of Nt (X), equation (2.3). The fact that N∞ (X (µ) ) ∈ w0 N>0 follows from a total posivity criterion (Theorem 1.5 in [BZ97] or Theorem 1.11 in [FZ99]) formulated in terms of generalized minors. Basically, one has only to adapt the proofs of theorem 5.2 in [Chh14], or lemma 4.3 in [BBO05] to the case of infinite time horizon. The law of N∞ (X (µ) ) comes directly from theorem 2.12. It is worth noting that the probability measure has a smooth density and w0 charges the entire space N>0 , which is an open dense cell of N≥0 . Other cells are of smaller dimension and therefore of zero measure. Hence, it can be viewed as an N≥0 -valued random variable. Let us examine the example of SL2 , the group with smallest rank. Example 2.17 (A1 -type). For G = SL2 , a = R, α = 2, α∨ = 1 and: ! 1 0 (µ) N∞ (X ) = R ∞ −2X (µ) s ds 1 0 2e We know that Θ that:     1 0 = 1 , and as such theorem 2.16 tells us y 1 !   1 0 L 1 0 R ∞ −2X (µ) = 1 s ds 1 γµ 1 0 2e 1 y 0 1 This is exactly Dufresne’s identity in law [Duf90]. Here, the law of N∞ (X (µ) ) can be seen as a meaningful generalization of Dufresne’s identity which uses an inverse gamma. In the group setting, we see that the map Θ plays the role of the inverse map. Higher dimensional examples give new identities about exponential functionals of Brownian motion. 12  Example 2.18 (A2 -type). For G = SL3 , a = x ∈ R3 | x1 + x2 + x3 = 0 . (µ) Consider a Brownian motion with  drift µ in the Weyl chamber.  X on a  1 0 The simple roots are α1 = −1 , α2 =  1 . We obtain that: 0 −1  0 R ∞ −α (X (µ) )   1 s ds 1 0 N∞ (X (µ) ) =  0 e R R R ∞ −α (X (µ) (µ) (µ) s −α2 (Xu ) ∞ 1 s ) ds du 0 e−α2 (Xs ) ds 1 0 e 0 e  1 0 We choose the reduced word i = (1, 2, 1) ∈ R(w0 ). If:   L (t1 , t2 , t3 ) = γhα∨1 ,µi , γhα∨1 +α∨2 ,µi , γhα∨2 ,µi are independent gamma random variables with corresponding parameters, then example 2.15 and theorem 2.16 tell us that:   1 0 0 L  1 1 0 (2.6) N∞ (X (µ) ) =  t1  t 1+ t1 1 t1 t2 t2 1 3 This result in itself seems new. It can be restated as follows in terms of a = hα∨ the two positive parameters a = hα∨ 2 , µi > 0 and the two 2 , µi >, e correlated real Brownian motions:  1 Bt := √ Xt1 − Xt2 ; 2  et := √1 Xt2 − Xt3 B 2 The equality (2.6) is equivalent to the fact that the triple Z ∞ √ Z ∞ √ Z ∞ √ Z e e− 2Bs −as ds, e− 2Bs −eas ds, e− 2Bs −as ds 0 0 has the same distribution as 0  1 γa , 1+ γγa a e γa+ea , 0 1 γa γae  s e− √ eu −e 2B au  du . Notice that the two first marginals are consistent with Dufresne’s identity. In order to see that, one has to perform a Brownian rescaling of time by a factor 2 and invoke the classical identity 2.4 1+ γγa L 1 a e γa+ea = γae . Beta-gamma algebra We have then a natural notion of gamma law and inverse gamma law. Here γ. denote independent gamma random variables. 13 Definition 2.19 (gamma law on U and inverse gamma on N ). For µ ∈ C and (β1 , . . . , βm ) being the positive roots enumeration associated to a reduced expression of w0 = si1 . . . sim , define Γµ to be the law of the positive (in the w0 sense of total positivity) U>0 -valued random variable    L ∨ ,µi Γµ = xi1 γhβ1∨ ,µi . . . xim γhβm w0 Define the inverse gamma law on N>0 as: L Dµ = Θ (Γµ ) . Those laws are well defined, in the sense that the above expressions do not depend on the choice of a reduced expression: Proposition 2.20. If i and i′ are reduced words of w0 , then for every µ ∈ C, the following equality in law holds between independent gamma random variables:     L ∨ ,µi , . . . , γhβ ∨ ,µi γhβ ∨′ ,µi , . . . , γhβ ∨′ ,µi = Ri,i′ γhβi,1 i,m i ,1 i ,m Proof. Theorem 2.16 relates the above laws to the exit law of our hypoelliptic Brownian motion, which is intrinsically defined. The formula defining Γµ has more to it than meets the eye. Indeed, in order to have the law being the same for all reduced expressions of w0 , there must be hidden non-trivial equalities in law. These can be qualified as identities from the beta-gamma algebra, as some authors call them (see e.g [CPY98] and references therein). More is said in the next section. It is remarkable to think of them as a probabilistic manifestation of a group structure, more precisely of braid relationships. If s, s′ ∈ W are reflections associated to simple roots and d is the order of ss′ , a braid relationship in W is the equality between d terms: ss′ s · · · = s′ ss′ . . . A braid move or a d-move occurs when substituting ss′ s . . . for s′ ss′ . . . within a reduced word. Considering two reduced expressions of the same Weyl group element, a well known result due to Hideya Matsumoto [Mat64] and Tits [Tit69] states that one is obtained from the other by successive braid moves (see also [Hum90]). si sj si · · · = sj si sj . . . Using this fact, saying that Γµ is defined unambiguously is equivalent to saying that proposition 2.20 holds for reduced words which differ by a braid move. Hence for any µ ∈ a, such that αi (µ) > 0 and αj (µ) > 0, one has:       xi γhα∨i ,µi xj γhsi α∨j ,µi xi γhsi sj α∨i ,µi . . . 14       L =xj γhα∨j ,µi xi γhsj α∨i ,µi xj γhsj si α∨j ,µi . . . It turns out that the rank 2 cases (A2 , B2 , C2 and G2 ) contain all the possible hidden identities. This is the classical rank 2 reduction. Fix one of these root systems, and consider two reduced words i, i′ of the longest element w0 in a rank 2 system. The maps Ri,i′ can be computed for every group explicitly and have been tabulated by Berenstein and Zelevinsky as theorem 5.3 in [BZ97]. Now write thanks to fundamental coweights µ = a1 ωi∨ + a2 ωj∨ and (p1 , p2 , . . . ) = Ri,i′ (t1 , t2 , . . . ). By using the explicit formulas for the change of Lusztig parameters and the root enumerations given in tables 6, 6, 6 and 6, we obtain the following theorem: Theorem 2.21 (Beta-gamma algebra identities). Associated to every rank 2 root system, the following identities in law hold: • Type A2 (table 6): w0 = s1 s2 s1 = s2 s1 s2 . i = (1, 2, 1) and i′ = (2, 1, 2). t2 t3 , p2 = t1 + t3 , p3 = t1t1+t . Then: Let p1 = t1t2+t 3 3 L (t1 , t2 , t3 ) = (γa1 , γa1 +a2 , γa2 ) if and only if L (p1 , p2 , p3 ) = (γa2 , γa1 +a2 , γa1 ) • Type B2 (table 6): w0 = s1 s2 s1 s2 = s2 s1 s2 s1 . i = (1, 2, 1, 2) and i′ = (2, 1, 2, 1). Let: p1 = t2 t23 t4 π2 π2 t1 t2 t3 , p2 = , p3 = 1 , p4 = π2 π1 π2 π1 where π1 = t1 t2 + (t1 + t3 )t4 , π2 = t21 t2 + (t1 + t3 )2 t4 . Then: L (t1 , t2 , t3 , t4 ) = (γa1 , γa1 +a2 , γa1 +2a2 , γa2 ) if and only if L (p1 , p2 , p3 , p4 ) = (γa2 , γa1 +2a2 , γa1 +a2 , γa1 ) • Type C2 (table 6): w0 = s1 s2 s1 s2 = s2 s1 s2 s1 . i = (1, 2, 1, 2) and i′ = (2, 1, 2, 1). Let: p1 = t2 t3 t4 π2 π2 t1 t32 t3 , p2 = 1 , p3 = , p4 = π1 π2 π1 π1 where π1 = t1 t2 + (t1 + t3 )t4 , π2 = t3 t24 + (t2 + t4 )2 t1 . Then: L (t1 , t2 , t3 , t4 ) = (γa1 , γ2a1 +a2 , γa1 +a2 , γa2 ) 15 if and only if L (p1 , p2 , p3 , p4 ) = (γa2 , γa1 +a2 , γ2a1 +a2 , γa1 ) • Type G2 (table 6): w0 = s1 s2 s1 s2 s1 s2 = s2 s1 s2 s1 s2 s1 . i = (1, 2, 1, 2, 1, 2) and i′ = (2, 1, 2, 1, 2, 1). Let: p1 = π3 π3 t2 t33 t24 t35 t6 , p2 = , p3 = 2 π3 π2 π3 π4 p4 = π3 t1 t2 t23 t4 t5 π3 , p5 = 1 , p6 = π1 π2 π4 π1 where: π1 =t1 t2 t23 t4 + t1 t2 (t3 + t5 )2 t6 + (t1 + t3 )t4 t25 t6 π2 =t21 t22 t33 t4 + t21 t22 (t3 + t5 )3 t6 + (t1 + t3 )2 t24 t35 t6 + t1 t2 t4 t25 t6 (3t1 t3 + 2t2 + 2t3 t5 + 2t1 t5 ) π3 =t31 t22 t33 t4 + t31 t22 (t3 + t5 )3 t6 + (t1 + t3)3 t24 t35 t6 + t21 t2 t4 t25 t6 (3t1 t3 + 3t2 + 3t3 t5 + 2t1 t5 ) π4 =t21 t22 t33 t4 (t1 t2 t33 t4 + 2t1 t2 (t3 + t5 )3 t6 + (3t1 t3 + 3t23 + 3t3 t5 + 2t1 t5 )t4 t25 t6 ) + t26 (t1 t2 (t3 + t5 )2 + (t1 + t3 )t4 t25 )3 Then: L (t1 , t2 , t3 , t4 , t5 , t6 ) = (γa1 , γ3a1 +a2 , γ2a1 +a2 , γ3a1 +2a2 , γa1 +a2 , γa2 ) if and only if L (p1 , p2 , p3 , p4 , p5 , p6 ) = (γa2 , γa1 +a2 , γ3a1 +2a2 , γ2a1 +a2 , γ3a1 +a2 , γa1 ) 16 3 Identities in law 3.1 Gamma identities Let us make some remarks on the obtained gamma identities. The classical beta-gamma algebra identity states that if γa and γb are two independent gamma random variables with parameters a > 0 and b > 0, then:   γa , γa + γb (3.1) γa + γb form a pair of independent random variables. This fact is easy to retrieve from the A2 case. Indeed, by considering L (t1 , t2 , t3 ) = (γa1 , γa1 +a2 , γa2 ) independent variables with the designated laws and (p1 , p2 , p3 ) algebraically defined as above, we know that p2 and p3 are independent. And since p2 independent of t2 , we get that p2 = γa1 + γa2 is 1 . independent of pt23 = γa γa 1 +γa2 Moreover, Lukacs [Luk55] proved that the independence for the pair in (3.1) characterizes the gamma law. This leads to the first open question in section 6. 3.2 Exponential identities A generic exponential random variable with parameter µ > 0 is denoted by eµ : P (eµ ∈ dx) = µe−µx 1R+ (x) dx Consider a rational expression in k variables a ∈ Q (x1 , . . . , xk ) that has no minus sign. Tropicalizing a to [a]trop tantamounts to replacing the algebraic operations (+, ×, /) by (min, +, −). A rational expression in the operations (min, +, −) is now commonly referred to as a tropical expression. Formally, if a and b are rational subtraction-free functions, then: [a + b]trop = min(a, b) [ab]trop = a + b [a/b]trop = a − b [a ◦ b]trop = [a]trop ◦ [a ◦ b]trop For example:  t2 t3 t1 + t3  trop = t2 + t3 − min(t1 , t3 ) A less algebraic definition could be used, using a limit that always exists: 17 Proposition 3.1 (Analytic tropicalization). For a rational and subtractionfree expression in k variables a ∈ Q (x1 , . . . , xk ), we have that for h > 0:  x1  xk −h log a e− h , . . . , e− h = [a]trop (x1 , . . . , xk ) + O(h) (3.2) where O(h) is a quantity such that the variables (x1 , . . . , xk ). O(h) h is bounded as h → 0, uniformly in Proof. Let us prove the statement by induction on the size of the expression a, meaning the number of operations it uses (addition, multiplication and division). For the base case, notice that if a is a monomial or a constant, then the statement is trivially true. Now, for the inductive step, if a is a product or ratio of two rational subtraction-free expressions, for which the statement is true, the statement follows using the properties of the logarithm. If a is a sum whose terms satisfy the induction hypothesis: a = a1 + a2 , then for x = (x1 , . . . , xk ) ∈ Rk :  x1 xk  − h log a e− h , . . . , e− h  xk     x1 xk xk = − h log a1 e− h , . . . , e− h + a2 e− h , . . . , e− h   −1 −1 = − h log eO(1)−h [a1 ]trop (x) + eO(1)−h [a2 ]trop(x) = min ([a1 ]trop (x), [a2 ]trop (x)) + O(h)   −1 − h log 1 + eO(1)−h |[a1 ]trop−[a2 ]trop|(x) =[a]trop (x) + O(h) It is well known that Ri,i′ tropicalize to changes of parametrizations in Lusztig’s canonical basis (Theorem 2.6). Therefore, we consider the following crystallizing procedure for the rational subtraction-free expressions Ri,i′ . The use of the logarithm function has to be understood component-wise:   −u1 −u2   Ri,i′ trop (u1 , u2 , . . . ) := lim −h log Ri,i′ e h , e h , . . . h→0 Now, on the probabilistic side, one can recover a tropical version of gamma identities involving exponential variables. The following lemma shows how gamma variables degenerate to exponential variables. Lemma 3.2 (Yor [Yor12]). As h > 0 goes to zero, −h log γhµ converges in law to eµ , an exponential variable with parameter µ. 18 Proof. A direct proof using densities is possible and straightforward. Let us rather present an aesthetically more pleasing derivation suggested by Marc Yor during a private communication. We can reduce the problem to µ = 1 L because eµ = µ1 e1 and: lim −h log γhµ = h→0 1 lim −h log γh µ h→0 Now, if βa,b is a beta random variable with parameters a > 0 and b > 0, we can write γh as a product of two independent random variables: L γh = βh,1 γ1+h h is Knowing that (βh,1 )h is in fact a uniform random variable, − log βh,1 distributed as e1 . Hence: L −h log γh = e1 − h log γ1+h The proof is finished upon noticing that h log γ1+h converges to zero in probability. Hence the tropical version of proposition 2.20: Proposition 3.3. If i and i′ are reduced words of w0 , then for every µ ∈ C, the following equality in law holds between independent exponential random variables:       L ∨ ,µi , . . . , ehβ ∨ ,µi ehβ ∨′ ,µi , . . . , ehβ ∨′ ,µi = Ri,i′ trop ehβi,1 i,m i ,1 i ,m Proof. Before tropicalization, for the parameter hµ, we have:     L ∨ ,hµi , . . . , γhβ ∨ ,hµi γhβ ∨′ ,hµi , . . . , γhβ ∨′ ,hµi = Ri,i′ γhβi,1 i,m i ,1 i ,m Then, using the previous lemma:   ehβ ∨′ ,µi , ehβ ∨′ ,µi , . . . i ,1 i ,2   L = lim −h log γhβ ∨′ ,hµi , γhβ ∨′ ,hµi , . . . i ,1 i ,2 h→0   L ∨ ,hµi , γhβ ∨ ,hµi , . . . = lim −h log Ri,i′ γhβi,1 i,2 h→0         ∨ ,µi ∨ ,µi −h log γhhβi,2 −h log γhhβi,1  , exp  ,... = lim −h log Ri,i′ exp  h→0 h h     ∨ ,µi , ehβ ∨ ,µi , . . . = Ri,i′ trop ehβi,1 i,2 19 Again, as all the information is contained in the rank two case, there is a finite list of identities between exponential variables that sums up the results so far. Theorem 3.4 (Exponential identities). Associated to every rank 2 root system, the following identities in law hold: • Type A2 (table 6): w0 = s1 s2 s1 = s2 s1 s2 . Let p1 = t2 + t3 − min(t1 , t3 ), p2 = min(t1 , t3 ), p3 = t1 + t2 − min(t1 , t3 ).Then: L (t1 , t2 , t3 ) = (ea1 , ea1 +a2 , ea2 ) if and only if L (p1 , p2 , p3 ) = (ea2 , ea1 +a2 , ea1 ) • Type B2 (table 6): w0 = s1 s2 s1 s2 = s2 s1 s2 s1 . Let: p1 = t2 + 2t3 + t4 − π2 , p2 = π2 − π1 , p3 = 2π1 − π2 , p4 = t1 + t2 + t3 − π1 where π1 = min(t1 +t2 , min(t1 , t3 )+t4 ), π2 = min(2t1 +t2 , 2 min(t1 , t3 )+ t4 ). Then: L (t1 , t2 , t3 , t4 ) = (ea1 , ea1 +a2 , ea1 +2a2 , ea2 ) if and only if L (p1 , p2 , p3 , p4 ) = (ea2 , ea1 +2a2 , ea1 +a2 , ea1 ) • In the same fashion one can deduce the exponential identities for types C2 and G2 . At this point, it seems very important to mention that in [BBO09], a path model for Coxeter groups was developed, and exponential laws play a key role as infinima of a Brownian motion, with appropriate drift. There, once again, hidden identities in law can be found, involving general Coxeter braid relations. This goes beyond the crystallographic case we just considered. This leads to the second open question in section 6. 3.3 Geometric identities Let a generic geometric random variable with parameter 0 < z < 1 be denoted by Gz : ∀k ∈ N, P (Gz = k) = z k (1 − z) ∨ ∨ Let z ∈ A such that − log z ∈ C. We write zβ = ehβ ,log zi . The condition − log z ∈ C entails that for every positive coroot β ∨ ∈ Φ+∨ , ∨ 0 < zβ < 1. This allows us to formulate identities in law between geometric random variables. 20 Proposition 3.5. If i and i′ are reduced words of w0 , then for every µ ∈ C, the following equality in law holds between independent geometric random variables:       L ∨ , . . . , G β∨ = Ri,i′ trop G βi,1 G β ∨′ , . . . , G β ∨′ i,m z i ,1 z z i ,m z   Proof. The claim is true because Ri,i′ trop is one-to-one from Nm to Nm and thanks to the elementary fact that: L ⌊eµ ⌋ = Gz with z = e−µ . It is immediate that the same identities as in theorem 3.4 hold between geometric random variables. As a corollary, this allows us to prove that  a natural analogue of Γµ (or N∞ W (µ) ) exists at the level of Lusztig’s canonical basis. Corollary 3.6. For any  i ∈ R (w0 ) with (β  1 , . . . , βm ) the associated posi∨ independent geometric random tive root enumeration and Gzβ1∨ , . . . , Gzβm variables, the random variable defined by   ∨ Cz (∞) := Li Gzβ1∨ , . . . , Gzβm has a distribution on Lusztig’s canonical basis that is independent of the choice of i. 4 Proof of the conditional representation theorem Let us state a version of the Matsumoto and Yor relationship between Brownian motions with opposite drifts, which itself is based on many previous works related to exponential functionals of Brownian motion, including Dufresne’s identity. Theorem 4.1 ( Matsumoto-Yor [MY01], theorem 2.2 ). Let B (µ) be a Brownian motion on a Euclidean vector space V ≈ Rn with drift µ and β a linear form on V such that β(µ) > 0. Denote by sβ the hyperplane reflection with respect to ker β, by Qy the measure of Brownian motion conditionally on its exponential functional being equal to y > 0:   Z ∞ (µ) −β(Bs ) y e ds = y Q := P · 0 and: β∨ = 2β hβ, βi 21 Then: (sβ µ) B̂t (µ) = Bt   Z 1 t −β(Bs(µ) ) + log 1 − e ds β ∨ y 0 is a Qy -Brownian motion with drift sβ µ = µ − β(µ)β ∨ . This theorem has a dual version that characterises the reciprocal transform of Brownian motion as a Brownian motion conditioned with respect to its exponential functional: Theorem 4.2 ( Matsumoto-Yor [MY01], theorem 2.1). Let W (sβ µ) be a Brownian motion on V ≈ Rn with drift sβ µ, β(µ) > 0 and:   Z 1 t −β(Ws(sβ µ) ) (sβ µ) e ds β ∨ + log 1 + Xt = Wt y 0 Then X is a Brownian motion with drift µ, B (µ) , conditioned to: Z ∞ (µ) e−β(Bs ) ds = y. 0 L If moreover, we pick y as random with y = hβ,βiγ2 ∨ independent from W , hβ ,µi then X is a Brownian motion with drift µ. Notice that compared to the original formulation, we used a multidimensional setting. The change of sign is simply replaced by a hyperplane reflection. Let us now focus on proving the conditional representation theorem. In the case of g = xα (ξ) with ξ > 0, the group-theoretic path transform Tg has a simple expression ([Chh14] Properties 5.19):   Z t −α(Xs ) e ds α∨ (Tg X)t = Xt + log 1 + ξ 0 for any continuous path X. The result of Hiroyuki Matsumoto and Yor can be reformulated as: Theorem 4.3 (SL2 conditional representation). If g = xα (ξ), ξ > 0, W (sα µ) a Brownian motion on a with drift sα µ such that α(µ)R > 0 then X := ∞ Tg (W (sα µ) ) is a Brownian motion with drift µ conditioned to 0 e−α(Xs ) ds = 1 ξ. L If moreover we pick ξ as random with ξ = hα,αi 2 γhα∨ ,µi independent from W then X is a Brownian motion with drift µ.     1 0 1 ξ . Remark 4.4. Recall that in the case of SL2 , Θ = 1 0 1 ξ 1 Hence, theorem 2.12 becomes exactly theorem 4.3 in the particular case of the group SL2 . 22 It is very surprising and impressive that Matsumoto and Yor fully worked out the SL2 case without starting from any group-theoretic considerations. We are now ready to prove the conditional representation theorem. Proof of theorem 2.12 . We can of course take x0 = 0. Let X = Teθ ge−θ (W (w0 µ) ), and thanks to the composition property 5.19 in [Chh14] we have: X = Teθ ge−θ W (w0 µ) = T  hαi ,αi i 1 1 t 1 2  = T  hαi ,αi i 1 1 t 1 2  xi1 xi1 ...xim  hα im ,αim i tm 2 ◦ ··· ◦ T xim  hα  W (w0 µ) im ,αim i tm 2  W (w0 µ) We apply inductively theorem 4.3 with Lusztig parameters taken to follow the right laws, in order to get successive Brownian motions. The end of proof follows from the deterministic inversion lemma for Lusztig parameters in [Chh14] theorem 8.16, which we know to be also valid for an infinite time horizon ([Chh14] subsection 8.5):    = Θ (g) N∞ Teθ ge−θ W (w0 µ) Concerning notations, a little precision needs to be made at this point. The left-invariant flow (Bt (.); t ≥ 0) considered in this paper is a conjugation by eθ on the one in [Chh14] equation (5.7). Hence the little correction in the above formula. In the end:   N∞ X 0,(µ) = Θ (g) concluding the proof. 5 Review of Dufresne’s identity and the relationship proven by Matsumoto and Yor This section is mainly expository in nature and reviews the probabilistic results we needed, namely Dufresne’s identity and the proofs of theorems 4.1 4.2. 5.1 Exponential functionals of Brownian motion An important fact is Dufresne’s identity in law: Proposition 5.1 ( Dufresne [Duf90] ). If W (µ) is a one dimensional Brownian motion with drift µ > 0, then: Z ∞ (µ) L 1 e−2Ws ds = 2γµ 0 23 Quick proof. By time inversion, for any fixed t > 0, the random variable R t −2W (µ) (µ) R t (µ) 2Ws ds. Let (Z ; t > 0) be s ds has the same law as e−2Wt t 0 e 0 e given by: Z t (µ) e−Zt := e−2Wt (µ) e2Ws ds 0 And, by Ito’s lemma, Zt can be easily checked to be a diffusion process since it satisfies for t > 0 the SDE: (µ) dZt = 2dWt − eZt dt Hence it has as infinitesimal generator: L = 2∂z2 + (2µ − ez )∂z The sequence Zt converges in law to a unique invariant measure because e−Zt Rt (µ) has the same distribution as 0 e−2Ws ds, which converges almost surely. R∞ (µ) This invariant measure will be the law of 0 e−2Ws ds. Therefore, all we need to do is to prove that the distribution of log 2γµ is an invariant measure for Zt . This is done easily by checking that the adjoint of L annihilates the density p(z) of the random variable log 2γµ . We have:   1 1 z p(z) = exp µz − e Γ(µ)2µ 2 Applying L∗ , the adjoint of L: L∗ = 2∂z2 − ∂z (2µ − ez ) We get: ∗ L p(z) = 2∂z2 p(z) − 2∂z   1 z (µ − e )p(z) 2 = 2∂z2 p(z) − 2∂z2 p(z) =0 5.2 Proofs of the relationship between Brownian motions of opposing drifts Let us state a version of the Matsumoto and Yor relationship between Brownian motions with opposite drifts [MY01], which itself is based on many previous works related to exponential functionals of Brownian motion, including Dufresne’s identity. First let us start by proving theorem 4.1 using known results on expo(µ) nential functionals of Brownian motion. Now, let Bt be an n-dimensional 24 Brownian motion with drift µ, FtB its natural filtration, β a linear form such that β(µ) > 0 and: Z t Nt := 0 exp(−β(Bs(µ) ))ds N∞ = lim Nt t→∞ The law of N∞ comes as a simple corollary of Dufresne’s identity: Corollary 5.2. One has the identity in law: Z ∞   L exp −β(Bs(µ) ) ds = N∞ := 0 2 ||β||2 γhβ ∨ ,µi Therefore, the density is: P (N∞  hβ ∨ ,µi  dn 2 1 2 −hβ ∨ ,µi ∈ dn) = n exp − . ∨ 2 2 Γ(hβ , µi) ||β|| n ||β|| n Proof. Define the real Brownian motion W by β(Bt ) = ||β||Wt for t ≥ 0. Then: Z ∞ (µ) N∞ = e−β(Bt ) dt Z0 ∞ e−||β||Wt−β(µ)t dt = Z0 ∞ ||β|| L − √ W − β(µ)tc c dt using Brownian scaling for c > 0 e c tc = 0 Z ∞ ||β|| β(µ)u 1 − √ W − = e c u c du using change of variable u = tc c 0 Z ∞ ||β||2 4 −2Wu −4 β(µ)u ||β||2 du by choosing c = e = ||β||2 0 4 Z ∞ 4 ∨ = e−2(Wu +hβ ,µiu) du . 2 ||β|| 0 The result holds using Dufresne’s identity in law. As for the density, for all f ≥ 0 bounded measurable function, and while writing ν = hβ ∨ , µi, we have: E (f (N∞ )) Z ∞ 1 e−t tν dt = f( ) ||β||2 t/2 Γ(ν) t 0   ν Z ∞ 2 2 2 2 dn 1 by letting n = f (n) exp − = 2 2 2 Γ(ν) 0 ||β|| n ||β|| n ||β|| n ||β||2 t  ν  Z ∞ 1 dn 2 2 = n−ν . f (n) exp − 2 2 Γ(ν) 0 ||β|| n ||β|| n 25 Initial enlargement of the filtration F B using the random variable N∞ Now, we give a proof of theorem 4.1 following Matsumoto and Yor’s original presentation. In order to compute the law of N∞ conditionally on FtB , the following decomposition is essential: Z t (µ) (µ) e−β(Bs ) ds + e−β(Bt ) Ñ∞ , (5.1) N∞ = 0 with Ñ∞ is a copy of N∞ independent from FtB . Indeed: Z ∞ (µ) e−β(Bs ) ds N∞ = 0 Z t Z ∞ (µ) (µ) (µ) (µ) −β(Bs ) −β(Bt ) e ds + e e−β(Bs −Bt ) ds = 0 t Z t (µ) (µ) e−β(Bs ) ds + e−β(Bt ) Ñ∞ . = 0 For readability purposes, and because it is not necessary to invoke general filtration enlargement theorems, we will give a complete proof using the usual tools. Indeed, as proved before the law of N∞ has a (smooth) den∞ ≤y) with respect to the Lebesgue measure, making possible the sity dP(Ndy following computations. Let Qy = P (·|N∞ = y) be a regular version of the conditional probability, f ≥ 0 bounded measurable function, and A ∈ FtB . We have: Z  dP (N∞ ≤ y) =E QN∞ (A)f (N∞ ) dyf (y)Qy (A) dy =E (1A f (N∞ ))  =E 1A E f (N∞ ) |FtB   Z B =E 1A f (y)dP(N∞ ∈ dy|Ft )   Z dP(N∞ ≤ y|FtB ) = dyf (y)E 1A (Fubini) . dy Then: Qy (A) = E 1A dP dy N∞ ≤ y|FtB dP dy (N∞ ≤ y) ! . We conclude that Qy is absolutely continuous with respect to P and that the Radon-Nikodym derivative on FtB is given by the P-martingale: (µ) q(Bt , Nt , y) := dQy dP |FtB 26 = dP dy N∞ ≤ y|FtB dP dy (N∞ ≤ y)  Using the expression for the density of N∞ from corollary 5.2, we get: (µ) = q(Bt , Nt , y)   (µ) dP β(Bt ) |F B Ñ ≤ (y − N )e ∞ t t dy dP dy (µ) =eβ(Bt Hence: ) (N∞ ≤ dy)  2 exp −  (µ) (n − Nt )eβ(Bt (µ) β(Bt ) 2 ||β|| (n−Nt )e   exp − ||β||2 2n n−(1+hβ ∨ ,µi) ) −(1+hβ ∨ ,µi) . (µ) (µ) log q(Bt , Nt , n) = At − hβ ∨ (µ) , µiβ(Bt ) 2e−β(Bt ) − ||β||2 (n − Nt ) where At has a zero quadratic variation. Therefore, the semimartingale bracket between β(B (µ) ) and log q is: + * (µ) D E 2e−β(B. ) (µ) (µ) ∨ (µ) β(B ), log q = β(B ), −hβ , µiβ(B. ) − ||β||2 (n − N. ) t * + t (µ) ) −β(B . 2 e = − hβ ∨ , µi||β||2 − β(B), 2 ||β|| n − N. t (µ) Z t −β(Bs ) e = − 2β(µ) + 2 ds 0 n − Ns Z t dNs = − 2β(µ) + 2 0 n − Ns   Nt = − 2β(µ) − 2 log 1 − n In the end, using the Girsanov theorem ([?] Chapter VIII, theorem 1.4): B̂t = Bt − β hβ(B (µ) ), log qit ||β||2 is a Qy Brownian motion, which completes the proof of theorem 4.1. Inversion A natural question is whether we can recover B̂ or B from the other. The answer is yes and the argument is again due to Matsumoto and Yor [MY01]. The proof of theorem 4.2 follows from 4.1 and the following inversion lemma. 27 Lemma 5.3 (Inversion lemma). Let x and y be V valued paths i.e functions on R+ . Then Z 1 t −β(y) ∨ (1) x(t) = y(t) + log(1 + e )β n 0 if and only if (2) ( Rt ∀t > 0, 0 e−β(x) < n y(t) = x(t) + log(1 − Moreover, in any case: 1 (3) (1 + n and if R∞ 0 e−β(y) = ∞ then Z t −β(y) e 0 R∞ 0 1 )(1 − n 1 n Rt 0 Z t e−β(x) )β ∨ e−β(x) ) = 1 0 e−β(x) = n Proof. It is immediate to see that (1) and (2) are simultaneously true if and only if (3) is true. Then all we need to prove is (1) ⇒ (3) and (2) ⇒ (3) e−β(y) Rt (1 + n1 0 e−β(y) )2 " #t Z −1 1 t −β(x) e = Rt n 0 1 + n1 0 e−β(y) 0 Z 1 1 t −β(x) =1− e Rt n 0 1 + 1 e−β(y) (1) ⇒ e−β(x) = ⇒ ⇒ n 0 ⇒ (3) and e−β(x) Rt (1 − n1 0 e−β(x) )2 #t " Z 1 t −β(y) 1 e = Rt n 0 1 − n1 0 e−β(x) 0 Z 1 t −β(y) 1 =1+ e Rt n 0 1 − 1 e−β(x) (2) ⇒ e−β(y) = ⇒ ⇒ n 0 ⇒ (3) Then (3) gives the convergence of Rt 0 e−β(x) to n, right away. Now we are ready to prove theorem 4.2: 28 Proof of theorem 4.2: Consider a Brownian motion B (µ) with drift µ conR∞ (µ) ditioned to 0 e−β(Bs ) ds = n. By the previous filtration enlargement argument, there is B̂ a Brownian motion in the enlarged filtration, such that:   Z 1 t −β(Bs(µ) ) (s µ) (µ) e ds β ∨ . B̂t β = Bt + log 1 − n 0 Using the inversion lemma: (µ) Bt = (s µ) B̂t β  1 + log 1 + n Z t (sβ µ) −β(B̂s e 0 )  ds β ∨ . Then the following equalities in law between processes follow:   Z ∞ (µ) (µ) e−β(Bs ) ds = n Bt ; t ≥ 0| 0     Z 1 t −β(B̂s(sβ µ) ) (sβ µ) ∨ + log 1 + = B̂t e ds β ; t ≥ 0 n 0     Z 1 t −β(Ws(sβ µ) ) (sβ µ) L ∨ e ds β ; t ≥ 0 + log 1 + = Wt n 0 = (Xt ; t ≥ 0) . This ends the proof of the first fact. R∞ (µ) The second fact is just a consequence of knowing the law of 0 e−β(Bs ) ds and the usual disintegration formula. For F continuous functional on the sample space, we have:    Z ∞   (µ) −β(Bs ) (µ) (µ) ds e E F (B. ) = E E F (B. )| 0 6 Some open questions We end the paper by listing some open questions. Question 6.1. We noticed in section 3 that the beta-gamma algebra identities in theorem 2.21 for type A2 characterize the gamma random variable thanks to [Luk55]. Is it true in other types? We would like to say that if the group theoretic transforms related to total positivity give independent random variables, then the input is made of gamma variables. Question 6.2. In [BBO09], for example in proposition 5.9, a sequence of mutually independent exponential random variables naturally appears. These 29 depend on a choice of reduced expression, and one can deduce hidden identities in law identical to ours in the crystalligraphic case. However, the general Coxeter setting of [BBO09] goes beyond our framework, simply because for a non-crystalligraphic Coxeter group W there is no Lie group for which W is the Weyl group. Moreover, the tropical relations that appear there have irrational coefficients, and therefore cannot be the tropicalization of rational subtraction-free expressions. Indeed, in the proof of theorem 3.12, for the dihedral root system I(m), transition maps make use of λ = cos 2π m and Tchebicheff polynomials in λ. λ is indeed rational for the crystallographic values m = 2, 3, 4, 6, but this is not true in general. It would be very interesting to gain further insight in the Coxeter case and being able to explicit such relations. Is it possible to obtain a geometric lifting to identities between gamma variables? References [BBO05] Philippe Biane, Philippe Bougerol, and Neil O’Connell. Littelmann paths and Brownian paths. Duke Math. J., 130(1):127–167, 2005. [BBO09] Philippe Biane, Philippe Bougerol, and Neil O’Connell. Continuous crystal and Duistermaat-Heckman measure for Coxeter groups. Adv. Math., 221(5):1522–1583, 2009. [BO11] Fabrice Baudoin and Neil O’Connell. Exponential functionals of Brownian motion and class-one Whittaker functions. Ann. Inst. Henri Poincaré Probab. Stat., 47(4):1096–1120, 2011. [BZ97] Arkady Berenstein and Andrei Zelevinsky. Total positivity in Schubert varieties. Comment. Math. Helv., 72(1):128–166, 1997. [Chh13] Reda Chhaibi. Littelmann path model for geometric crystals, Whittaker functions on Lie groups and Brownian motion. phD thesis in Université Paris VI, pages 1–226, 2013, arXiv:1302.0902. [Chh14] Reda Chhaibi. Littelmann path model for geometric crystals. Preprint v2, pages 1–78, 2014, arXiv:1405.6437. [CPY98] Philippe Carmona, Frédérique Petit, and Marc Yor. Betagamma random variables and intertwining relations between certain Markov processes. Rev. Mat. Iberoamericana, 14(2):311–367, 1998. [Duf90] Daniel Dufresne. The distribution of a perpetuity, with applications to risk theory and pension funding. Scand. Actuar. J., (1-2):39–79, 1990. 30 [FZ99] Sergey Fomin and Andrei Zelevinsky. Double Bruhat cells and total positivity. J. Amer. Math. Soc., 12(2):335–380, 1999. [Hum72] James E. Humphreys. Introduction to Lie algebras and representation theory. Springer-Verlag, New York-Berlin, 1972. Graduate Texts in Mathematics, Vol. 9. [Hum90] James E. Humphreys. Reflection groups and Coxeter groups, volume 29 of Cambridge Studies in Advanced Mathematics. Cambridge University Press, Cambridge, 1990. [Luk55] Eugene Lukacs. A characterization of the gamma distribution. Ann. Math. Statist., 26:319–324, 1955. [Lus90a] G. Lusztig. Canonical bases arising from quantized enveloping algebras. J. Amer. Math. Soc., 3(2):447–498, 1990. [Lus90b] G. Lusztig. Canonical bases arising from quantized enveloping algebras. II. Progr. Theoret. Phys. Suppl., (102):175–201 (1991), 1990. Common trends in mathematics and quantum field theories (Kyoto, 1990). [Lus94] G. Lusztig. Total positivity in reductive groups. In Lie theory and geometry, volume 123 of Progr. Math., pages 531–568. Birkhäuser Boston, Boston, MA, 1994. [Lus08] G. Lusztig. A survey of total positivity. Milan J. Math., 76:125– 134, 2008. [Mat64] Hideya Matsumoto. Générateurs et relations des groupes de Weyl généralisés. C. R. Acad. Sci. Paris, 258:3419–3422, 1964. [MY01] Hiroyuki Matsumoto and Marc Yor. A relationship between Brownian motions with opposite drifts via certain enlargements of the Brownian filtration. Osaka J. Math., 38(2):383–398, 2001. [Spr09] T. A. Springer. Linear algebraic groups. Modern Birkhäuser Classics. Birkhäuser Boston, Inc., Boston, MA, second edition, 2009. [Tit69] Jacques Tits. Le problème des mots dans les groupes de Coxeter. In Symposia Mathematica (INDAM, Rome, 1967/68), Vol. 1, pages 175–185. Academic Press, London, 1969. [Whi52] A. M. Whitney. A reduction theorem for totally positive matrices. J. Analyse Math., 2:88–92, 1952. [Yor12] Marc Yor. Private communication, 2012. 31 Appendix: Positive root enumerations for rank 2 systems     1 0 β α1 = −1 , α2 =  1  1 β2 0 −1 β3 121 α1 α1 + α2 α2 212 α2 α1 + α2 α1 Table 1: Positive roots enumerations for type A2 α1 =     β1 1 0 , α2 = β2 −1 1 β3 β4 1212 α1 α1 + α2 α1 + 2α2 α2 2121 α2 α1 + 2α2 α1 + α2 α1 Table 2: Positive roots enumerations for type B2 α1 =    β1 0 1 , α2 = β2 2 −1 β3 β4  1212 α1 2α1 + α2 α1 + α2 α2 2121 α2 α1 + α2 2α1 + α2 α1 Table 3: Positive roots enumerations for type C2     0 1 α1 =  1  , α2 = −2 , −1 1 β1 β2 β3 β4 β5 β6 121212 α1 3α1 + α2 2α1 + α2 3α1 + 2α2 α1 + α2 α2 212121 α2 α1 + α2 3α1 + 2α2 2α1 + α2 3α1 + α2 α1 Table 4: Positive roots enumerations for type G2 32
4math.GR
Guarded Dependent Type Theory with Coinductive Types arXiv:1601.01586v1 [cs.LO] 7 Jan 2016 Aleš Bizjak1 , Hans Bugge Grathwohl1 , Ranald Clouston1 , Rasmus E. Møgelberg2, and Lars Birkedal1 1 Aarhus University {abizjak,hbugge,ranald.clouston,birkedal}@cs.au.dk 2 IT University of Copenhagen [email protected] Abstract. We present guarded dependent type theory, gDTT, an extensional dependent type theory with a ‘later’ modality and clock quantifiers for programming and proving with guarded recursive and coinductive types. The later modality is used to ensure the productivity of recursive definitions in a modular, type based, way. Clock quantifiers are used for controlled elimination of the later modality and for encoding coinductive types using guarded recursive types. Key to the development of gDTT are novel type and term formers involving what we call ‘delayed substitutions’. These generalise the applicative functor rules for the later modality considered in earlier work, and are crucial for programming and proving with dependent types. We show soundness of the type theory with respect to a denotational model. This is the technical report version of a paper to appear in the proceedings of FoSSaCS 2016. 1 Introduction Dependent type theory is useful both for programming, and for proving properties of elements of types. Modern implementations of dependent type theories such as Coq [16], Nuprl [10], Agda [20], and Idris [7], have been used successfully in many projects. However, they offer limited support for programming and proving with coinductive types. One of the key challenges is to ensure that functions on coinductive types are well-defined; that is, productive with unique solutions. Syntactic guarded recursion [11], as used for example in Coq [12], ensures productivity by requiring that recursive calls be nested directly under a constructor, but it is well known that such syntactic checks exclude many valid definitions, particularly in the presence of higher-order functions. To address this challenge, a type-based approach to guarded recursion, more flexible than syntactic checks, was first suggested by Nakano [19]. A new modality, written ⊲ and called ‘later’ [2], allows us to distinguish between data we have access to now, and data which we will get later. This modality must be 2 used to guard self-reference in type definitions, so for example guarded streams of natural numbers are described by the guarded recursive equation StrgN ≃ N × ⊲ StrgN asserting that stream heads are available now, but tails only later. Types defined via guarded recursion with ⊲ are not standard coinductive types, as their denotation is defined via models based on the topos of trees [5]. More pragmatically, the bare addition of ⊲ disallows productive but acausal [15] functions such as the ‘every other’ function that returns every second element of a stream. Atkey and McBride proposed clock quantifiers [3] for such functions; these have been extended to dependent types [18,6], and Møgelberg [18, Thm. 2] has shown that they allow the definition of types whose denotation is precisely that of standard coinductive types interpreted in set-based semantics. As such, they allow us to program with real coinductive types, while retaining productivity guarantees. In this paper we introduce the extensional guarded dependent type theory gDTT, which provides a framework where guarded recursion can be used not just for programming with coinductive types but also for coinductive reasoning. As types depend on terms, one of the key challenges in designing gDTT is coping with elements that are only available later, i.e., elements of types of the form ⊲A. We do this by generalising the applicative functor structure of ⊲ to the dependent setting. Recall the rules for applicative functors [17]: Γ ⊢t:A Γ ⊢ next t : ⊲A Γ ⊢ f : ⊲(A → B) Γ ⊢ t : ⊲A Γ ⊢ f ⊛ t : ⊲B (1) The first rule allows us to make later use of data that we have now. The second allows, for example, functions to be applied recursively to the tails of streams. Suppose now that f has type ⊲(Πx : A.B), and t has type ⊲A. What should the type of f ⊛t be? Intuitively, t will eventually reduce to some value next u, and so the resulting type should be ⊲(B[u/x]), but if t is an open term we may not be able to perform this reduction. This problem occurs in coinductive reasoning: if, e.g., A is StrgN , and B a property of streams, in our applications f will be a (guarded) coinduction assumption that we will want to apply to the tail of a stream, which has type ⊲ StrgN . We hence must introduce a new notion, of delayed substitution, similar to let-binding, allowing us to give f ⊛ t the type ⊲ [x t] .B binding x in B. Definitional equality rules then allow us to simplify this type when t has form next u, i.e., ⊲ [x next u] .B ≡ ⊲(B[u/x]). This construction generalises to bind a list of variables. Delayed substitution is essential to many examples, as shown in Sec. 3, and surprisingly the applicative functor termformer ⊛, so central to the standard presentation of applicative functors, turns out to be definable via delayed substitutions, as shown in Sec. 2. 3 Contributions. The contributions of this paper are: – We introduce the extensional guarded dependent type theory gDTT, and show that it gives a framework for programming and proving with guarded recursive and coinductive types. The key novel feature is the generalisation of the ‘later’ type-former and ‘next’ term-former via delayed substitutions; – We prove the soundness of gDTT via a model similar to that used in earlier work on guarded recursive types and clock quantifiers [18,6]. We focus on the design and soundness of the type theory and restrict attention to an extensional type theory. We postpone a treatment of an intensional version of the theory to future work (see Secs. 7 and 8). In addition to the examples included in this paper, we are pleased to note that a preliminary version of gDTT has already proved crucial for formalizing a logical relations adequacy proof of a semantics for PCF using guarded recursive types by Paviotti et. al. [21]. 2 Guarded Dependent Type Theory gDTT is a type theory with base types unit 1, booleans B, and natural numbers N, along with Π-types, Σ-types, identity types, and universes. For space reasons we omit all definitions that are standard to such a type theory; see e.g. Jacobs [14]. Our universes are à la Tarski, so we distinguish between types and terms, and have terms that represent types; they are called codes of types and b is the code of the type N. they can be recognised by their circumflex, e.g., N We have a map El sending codes of types to their corresponding type. We follow standard practice and often omit El in examples, except where it is important to avoid confusion. We fix a countable set of clock variables CV = {κ1 , κ2 , · · · } and a single clock constant κ0 , which will be necessary to define, for example, the function hd in Sec. 5. A clock is either a clock variable or the clock constant; they are intuitively temporal dimensions on which types may depend. A clock context ∆, ∆′ , · · · is a finite set of clock variables. We use the judgement ⊢∆ κ to express that either κ is a clock variable in the set ∆ or κ is the clock constant κ0 . All judgements, summarised in Fig. 1, are parametrised by clock contexts. Codes of types inhabit universes U∆ parametrised by clock contexts similarly. The universe U∆ is only well-formed in clock contexts ∆′ where ∆ ⊆ ∆′ . Intuitively, U∆ contains codes ⊢∆ κ valid clock Γ ⊢∆ well-formed context Γ ⊢∆ A type well-formed type Γ ⊢∆ t : A typing judgment Γ ⊢∆ A ≡ B type equality Γ ⊢∆ t ≡ u : A term equality κ ⊢∆ ξ : Γ _ Γ ′ Fig. 1. Judgements in gDTT. delayed substitution 4 of types that can vary only along dimensions in ∆. We have universe inclusions from U∆ to U∆′ whenever ∆ ⊆ ∆′ ; in the examples we will not write these explicitly. Note that we do not have Uc ∆ : U∆′ , i.e., these universes do not form a hierarchy. We could additionally have an orthogonal hierarchy of universes, i.e. 1 2 for each clock context ∆ a hierarchy of universes U∆ : U∆ : ···. All judgements are closed under clock weakening and clock substitution. The former means that if, e.g., Γ ⊢∆ t : A is derivable then, for any clock variable κ 6∈ ∆, the judgement Γ ⊢∆,κ t : A is also derivable. The latter means that if, e.g., Γ ⊢∆,κ t : A is derivable and ⊢∆ κ′ then the judgement Γ [κ′ /κ] ⊢∆ t[κ′ /κ] : A[κ′ /κ] is also derivable, where clock substitution [κ′ /κ] is defined as obvious. The rules for guarded recursion can be found in Figs. 2 and 3; rules for coinductive types are postponed until Sec. 4. Recall the ‘later’ type former ⊲, which expresses that something will be available at a later time. In gDTT we κ have ⊲ for each clock κ, so we can delay a type along different dimensions. As discussed in the introduction, we generalise the applicative functor structure of κ each ⊲ via delayed substitutions, which allow a substitution to be delayed until its substituent is available. We showed in the introduction how a type with a κ single delayed substitution ⊲ [x t] .A should work. However if we have a term κ f with more than one argument, for example of type ⊲ (Π(x : A).Π(y : B).C), and wish to type an application f κ t κ u (where κ is the applicative functor operation ⊛ for clock κ) we may have neither t nor u available now, and so κ we need sequences of delayed substitutions to define the type ⊲ [x t, y u] .C. Our concrete examples of Sec. 3 will show that this issue arises in practice. We therefore define sequences of delayed substitutions ξ. The new raw types, terms, and delayed substitutions of gDTT are given by the grammar κ A, B ::= · · · | ⊲ξ.A κ κ t, u ::= · · · | nextκ ξ.t | b ⊲ t ξ ::= · | ξ [x t] . Note that we just write ⊲A where its delayed substitution is the empty ·, and κ that ⊲ξ.A binds the variables substituted for by ξ in A, and similarly for next. The three rules DS-Emp, DS-Cons, and Tf-⊲ are used to construct the type κ ⊲ξ.A. These rules formulate how to generalise these types to arbitrarily long delayed substitutions. Once the type formation rule is established, the introduction rule Ty-Next is the natural one. With delayed substitutions we can define κ as   g f .g x. f κ t , nextκ x t Using the rules in Fig. 2 we can derive the following typing judgement for κ Γ ⊢∆ f : ⊲ξ.Π(x : A).B Γ ⊢∆ f κ κ t : ⊲ξ[x κ κ Γ ⊢∆ t : ⊲ξ.A t].B Ty-⊛ When a term has the form nextκ ξ [x nextκ ξ.u] .t, then we have enough information to perform the substitution in both the term and its type. The rule 5 TmEq-Force applies the substitution by equating the term with the result of an actual substitution, nextκ ξ.t[u/x]. The rule TyEq-Force does the same for its type. Using TmEq-Force we can derive the basic term equality (nextκ ξ.f ) κ (nextκ ξ.t) ≡ nextκ ξ.(f t). typical of applicative functors [17]. It will often be the case that a delayed substitution is unnecessary, because the variable to be substituted for does not occur free in the type/term. This is what TyEq-⊲-Weak and TmEq-Next-Weak express, and with these we can justify the simpler typing rule κ κ Γ ⊢∆ f : ⊲ξ.(A → B) Γ ⊢∆ f κ Γ ⊢∆ t : ⊲ξ.A κ t : ⊲ξ.B In other words, delayed substitutions on the type are not necessary when we apply a non-dependent function. Further, we have the applicative functor identity law (nextκ ξ.λx.x) κ t ≡ t. This follows from the rule TmEq-Next-Var, which allows us to simplify a term nextκ ξ [y t] .y to t. Sometimes it is necessary to switch the order in the delayed substitution. Two substitutions can switch places, as long as they do not depend on each other; this is what TyEq-⊲-Exch and TmEq-Next-Exch express. Rule TmEq-Next-Comm is not used in the examples of this paper, but it implies the rule nextκ ξ [x t] . nextκ x ≡ nextκ t, which is needed in Paviotti’s PhD work. 2.1 Fixed points and guarded recursive types In gDTT we have for each clock κ valid in the current clock context a fixed-point combinator fixκ . This differs from a traditional fixed-point combinator in that the type of the recursion variable is not the same as the result type; instead its κ type is guarded with ⊲. When we define a term using the fixed-point, we say that it is defined by guarded recursion. When the term is intuitively a proof, we say we are proving by Löb induction [2]. Guarded recursive types are defined as fixed-points of suitably guarded functions on universes. This is the approach of Birkedal and Møgelberg [4], but the generality of the rules of gDTT allows us to define more interesting dependent guarded recursive types, for example the predicates of Sec. 3. We first illustrate the technique by defining the (non-dependent) type of guarded streams. Recall from the introduction that we want the type of guarded κ streams, for clock κ, to satisfy the equation StrκA ≡ A × ⊲ StrκA . The type A will be equal to El(B) for some code B in some universe U∆ κ where the clock variable κ is not in ∆. We then define the code SA of StrκA in the 6 Universes ∆′ ⊆ ∆ Γ ⊢∆ Γ ⊢∆ U∆′ type Γ ⊢∆ A : U∆′ Univ Γ ⊢∆ El(A) type El Delayed substitutions: Γ ⊢∆ ⊢∆ κ κ ⊢∆ · : Γ _ · κ ⊢∆ ξ : Γ _ Γ ′ DS-Emp ⊢∆ ξ [x κ Γ ⊢∆ t : ⊲ξ.A κ t] : Γ _ Γ ′ , x : A DS-Cons Typing rules: κ Γ, Γ ′ ⊢∆ A type ⊢∆ ξ : Γ _ Γ ′ κ Γ ⊢∆ ⊲ξ.A type Γ, Γ ′ ⊢∆ t : A Tf-⊲ κ ⊢∆ ξ : Γ _ Γ ′ κ Γ ⊢∆ nextκ ξ.t : ⊲ξ.A Ty-Next κ ⊢∆′ κ Γ ⊢∆ A : ⊲U∆′ Ty-b ⊲ Γ ⊢∆ b ⊲κ A : U∆′ ⊢∆ κ κ Γ, x : ⊲A ⊢∆ t : A Γ ⊢∆ fixκ x.t : A Ty-Fix Fig. 2. Overview of the new typing rules involving ⊲ and delayed substitutions. κ κ bb b is the code of the (simple) universe U∆,κ to be SA , fixκ X.B × ⊲ X, where × κ product type. Via the rules of gDTT we can show StrκA ≃ A × ⊲ StrκA as desired. κ The head and tail operations, hdκ : StrκA → A and tlκ : StrκA → ⊲ StrκA are simply the first and the second projections. Conversely, we construct streams by pairing. We use the suggestive consκ notation which we define as   κ κ consκ , λ (a : A) as : ⊲ StrκA . ha, asi consκ : A → ⊲ StrκA → StrκA Defining guarded streams is also done via guarded recursion, for example the stream consisting only of ones is defined as ones , fixκ x. consκ 1 x. The rule TyEq-El-⊲ is essential for defining guarded recursive types as fixedpoints on universes, and it can also be used for defining more advanced guarded recursive dependent types such as covectors; see Sec. 3. 2.2 Identity types gDTT has standard extensional identity types IdA(t, u) (see, e.g., Jacobs [14]) but with two additional type equivalences necessary for working with guarded dependent types. We write rA t for the reflexivity proof IdA(t, t). The first type equivalence is the rule TyEq-⊲. This rule, which is validated by the model of Sec. 6, may be thought of by analogy to type equivalences often considered in homotopy type theory [24], such as IdA×B(hs1 , s2 i , ht1 , t2 i) ≡ IdA(s1 , t1 ) × IdB(s2 , t2 ). (2) 7 Definitional type equalities: κ κ ⊲ξ [x κ ⊲ξ [x t, y κ t] .A ≡ ⊲ξ.A κ u] ξ ′ .A ≡ ⊲ξ [y u, x t] ξ ′ .A κ κ ⊲ξ [x (TyEq-⊲-Weak) next ξ.t] .A ≡ ⊲ξ.A[t/x] κ κ (TyEq-Force) κ El(b ⊲ (next ξ.t)) ≡ ⊲ξ. El(t) κ κ (TyEq-⊲-Exch) (TyEq-El-⊲) κ Idκ⊲ξ.A(next ξ.t, next ξ.s) ≡ ⊲ξ.IdA(t, s) (TyEq-⊲) Definitional term equalities: nextκ ξ [x κ next ξ [x nextκ ξ [x t, y t] .u ≡ nextκ ξ.u (TmEq-Next-Weak) t] .x ≡ t u] ξ ′ .v ≡ nextκ ξ [y (TmEq-Next-Var) u, x t] ξ ′ .v nextκ ξ. nextκ ξ ′ .u ≡ nextκ ξ ′ . nextκ ξ.u κ next ξ [x nextκ ξ.t] .u ≡ nextκ ξ.u[t/x] fixκ x.t ≡ t[nextκ (fixκ x.t) /x] (TmEq-Next-Exch) (TmEq-Next-Comm) (TmEq-Force) (TmEq-Fix) Fig. 3. New type and term equalities in gDTT. Rules TyEq-⊲-Weak and TmEqNext-Weak require that A and u are well-formed in a context without x. Rules TyEq-⊲-Exch and TmEq-Next-Exch assume that exchanging x and y is allowed, i.e., that the type of x does not depend on y and vice versa. Likewise, rule TmEqNext-Comm assumes that exchanging the codomains of ξ and ξ ′ is allowed and that none of the variables in the codomains of ξ and ξ ′ appear in the type of u. There are two important differences. The first is that (2) is (using univalence) a propositional type equality, whereas TyEq-⊲ specifices a definitional type equality. This is natural in an extensional type theory. The second difference is that there are terms going in both directions in (2), whereas we would have a term κ of type Idκ⊲ξ.A(nextκ ξ.t, nextκ ξ.u) → ⊲ξ.IdA(t, u) without the rule TyEq-⊲. The second novel type equality rule, which involves clock quantification, will be presented in Sec. 4. 3 Examples In this section we present some example terms typable in gDTT. Our examples will use a term, which we call pη, of type Π(s, t : A × B).IdA(π1 t, π1 s) → IdB(π2 t, π2 s) → IdA×B(t, s). This term is definable in any type theory with a strong (dependent) elimination rule for dependent sums. The second property κ we will use is that StrκA ≡ A × ⊲ StrκA . Because hdκ and tlκ are simply first and second projections, pη also has type Π (xs, ys : StrκA ) .IdA(hdκ xs, hdκ ys) → Idκ⊲ Strκ (tlκ xs, tlκ ys) → IdStrκA(xs, ys). A 8 zipWithκ preserves commutativity. In gDTT we define the zipWithκ function which has the type (A → B → C) → StrκA → StrκB → StrκC by zipWithκ f , fixκ φ.λxs, ys. consκ (f (hdκ xs) (hdκ ys)) (φ κ tlκ xs κ tlκ ys) . We show that commutativity of f implies commutativity of zipWithκ f , i.e., that Π(f : A → A → B). (Π(x, y : A).IdB(f x y, f y x)) → Π(xs, ys : StrκA ).IdStrκB(zipWithκ f xs ys, zipWithκ f ys xs) is inhabited. The term that inhabits this type is λf.λc. fixκ φ.λxs, ys. pη (c (hdκ xs) (hdκ ys)) (φ κ tlκ xs κ tlκ ys) . κ Here, φ has type ⊲(Π(xs, ys : StrκA ).IdStrκB(zipWithκ f xs ys, zipWithκ f ys xs)) so to type the term above, we crucially need delayed substitutions. An example with covectors. The next example is more sophisticated, as it involves programming and proving with a data type that, unlike streams, is dependently typed. Indeed the generalised later, carrying a delayed substitution, is necessary to type even elementary programs. Covectors are the potentially infinite version of vectors (lists with length). To define guarded covectors we first co-natural numbers. The definition in gDTT is CoNκ ,  need guarded  κ κ κ b+ bb El fix X.(1 ⊲ X) ; this type satisfies CoNκ ≡ 1 + ⊲ CoNκ . Using CoNκ we \κ n), where can define the type family of covectors CoVecκA n , El(CoVec A  κ  \κ , fixκ φ : ⊲(CoNκ → U∆,κ ) .λ(n : CoNκ ). case n of CoVec A b inl u ⇒ 1 κ bb inr m ⇒ A × ⊲ (φ κ m). \κ . As an example of covectors, We will not distinguish between CoVecκA and CoVec A κ κ we define ones of type Π(n : CoN ). CoVecN n which produces a covector of any length consisting only of ones: ones , fixκ φ.λ(n : CoNκ ). case n of {inl u ⇒ inl hi; inr m ⇒ h1, φ κ mi} . Although this is one of the simplest covector programs one can imagine, it does not type-check without the generalised later with delayed substitutions. The map function on covectors is defined as map : (A → B) → Π(n : CoNκ ). CoVecκA n → CoVecκB n map f , fixκ φ.λ(n : CoNκ ). case n of inl u ⇒ λ(x : 1).x  κ inr m ⇒ λ p : A × ⊲ [n  m] .(CoVecκA n) . hf (π1 p) , φ κ m κ (π2 p)i . 9 It preserves composition: the following type is inhabited Π(f : A → B)(g : B → C)(n : CoNκ )(xs : CoVecκA n). IdCoVecκC n(map g n (map f n xs), map (g ◦ f ) n xs) by the term λ(f : A → B)(g : B → C). fixκ φ.λ(n : CoNκ ). case n of inl u ⇒ λ(xs : 1).r1 xs inr m ⇒ λ(xs : CoVecκA (inr m)). pη (rC g(f (π1 xs))) (φ 4 κ m κ π2 xs) . Coinductive types As discussed in the introduction, guarded recursive types on their own disallow productive but acausal function definitions. To capture such functions we need κ to be able to remove ⊲. However such eliminations must be controlled to avoid κ κ trivialising ⊲. If we had an unrestricted elimination term elim : ⊲A → A every type would be inhabited via fixκ , making the type theory inconsistent. κ However, we may eliminate ⊲ provided that the term does not depend on the clock κ, i.e., the term is typeable in a context where κ does not appear. Intuitively, such contexts have no temporal properties along the κ dimension, so we may progress the computation without violating guardedness. Fig. 4 extends the system of Fig. 2 to allow the removal of clocks in such a setting, by introducing clock quantifiers ∀κ [3,18,6]. This is a binding construct with associated term constructor Λκ, which also binds κ. The elimination term is clock application. Application of the term t of type ∀κ.A to a clock κ is written as t[κ]. One may think of ∀κ.A as analogous to the type ∀α.A in polymorphic lambda calculus; indeed the basic rules are precisely the same, but we have an additional construct κ prev κ.t, called ‘previous’, to allow removal of the later modality ⊲. Typing this new construct prev κ.t is somewhat complicated, as it requires ‘advancing’ a delayed substitution, which turns it into a context morphism (an actual substitution); see Fig. 5 for the definition. The judgement ρ :∆ Γ → Γ ′ expresses that ρ is a context morphism from context Γ ⊢∆ to the context Γ ′ ⊢∆ . We use the notation ρ[t/x] for extending the context morphism by mapping the variable x to the term t. We illustrate this with two concrete examples. First, we can indeed remove later under a clock quantier: κ force : ∀κ.⊲A → ∀κ.A force , λx. prev κ.x[κ] . κ The type is correct because advancing the empty delayed substitution in ⊲ turns it into the identity substitution ι, and Aι ≡ A. The β and η rules ensure that κ force is the inverse to the canonical term λx.Λκ. nextκ x[κ] of type ∀κ.A → ∀κ.⊲A. Second, we may see an example with a non-empty delayed substitution in the term prev κ. nextκ λn. succ n κ nextκ 0 of type ∀κ.N. Recall that κ is syntactic 10 Γ ⊢∆ Γ ⊢∆,κ A type Γ ⊢∆ ∀κ.A type Γ ⊢∆ Tf-∀ Γ ⊢∆,κ t : A Γ ⊢∆ Λκ.t : ∀κ.A Γ ⊢∆ ∆′ ⊆ ∆ Ty-Λ Γ ⊢∆ t : ∀κ.U∆′ ,κ Ty-∀-code b t : U∆′ Γ ⊢∆ ∀ ⊢∆ κ′ Γ ⊢∆ t : ∀κ.A   Ty-app Γ ⊢∆ t κ′ : A[κ′ /κ] κ Γ ⊢∆,κ t : ⊲ξ.A Γ ⊢∆ prev κ.t : ∀κ.(A(advκ∆ (ξ))) Ty-prev Fig. 4. Overview of the new typing rules for coinductive types. sugar and so more precisely the term is   nextκ λn. succ n κ f .f x. prev κ. next x nextκ 0 (3) Advancing the delayed substitution turns it into the substitution mapping the variable f to the term (prev κ. nextκ λn. succ n)[κ] and the variable x to the term (prev κ. nextκ 0)[κ]. Using the β rule for prev, then the β rule for ∀κ, this simplifies to the substitution mapping f to λn. succ n and x to 0. With this we have that the term (3) is equal to Λκ. ((λn. succ n) 0) which is in turn equal to Λκ.1. An important property of the term prev κ.t is that κ is bound in t; hence prev κ.t has type ∀κ.A instead of just A. This ensures that substitution of terms in types and terms is well-behaved and we do not need the explicit substitutions used, for example, by Clouston et al. [8] where the unary type-former  was used in place of clocks. This binding structure ensures, for instance, that the introduction rule Ty-Λ closed under substitution in Γ . The rule TmEq-∀-fresh states that if t has type ∀κ.A and the clock κ does not appear in the type A, then it does not matter to which clock t is applied, as the resulting term will be the same. In the polymorphic lambda calculus, the corresponding rule for universal quantification over types would be a consequence of relational parametricity. We further have the construct b ∀ and the rule Ty-∀-code which witness that the universes are closed under ∀κ. To summarise, the new raw types and terms, extending those of Sec. 2, are A, B ::= · · · | ∀κ.A t, u ::= · · · | Λκ.t | t[κ] | b ∀ t | prev κ.t Finally, we have the equality rule TyEq-∀-Id analogous to the rule TyEq⊲. Note that, as in Sec. 2.2, there is a canonical term of type Id∀κ.A(t, s) → ∀κ.IdA(t[κ] , s[κ]) but, without this rule, no term in the reverse direction. 4.1 Derivable type isomorphisms The encoding of coinductive types using guarded recursive types crucially uses a family of type isomorphisms commuting ∀κ over other type formers [3,18]. By 11 κ ⊢∆,κ · : Γ _ · advκ∆ (·) ⊢∆,κ ξ[x advκ∆ (ξ[x Γ ⊢∆ , ι :∆,κ Γ → Γ κ t] : Γ _ Γ ′ , x : A Γ ⊢∆ t]) , advκ∆ (ξ)[(prev κ.t)[κ] /x] :∆,κ Γ → Γ, Γ ′ , x : A Fig. 5. Advancing a delayed substitution. a type isomorphism A ∼ = B we mean two well-typed terms f and g of types f : A → B and g : B → A such that f (g x) ≡ x and g(f x) ≡ x. The first type isomorphism is ∀κ.A ∼ = A whenever κ is not free in A. The terms g = λx.Λκ.x of type A → ∀κ.A and f = λx.x[κ0 ] of type A → ∀κ.A witness the isomorphism. Note that we used the clock constant κ0 in an essential way. The equality f (g x) ≡ x follows using only the β rule for clock application. The equality g(f x) ≡ x follows using by the rule TmEq-∀-fresh. The following type isomorphisms follow by using β and η laws for the constructs involved. - If κ 6∈ A then ∀κ.Π(x : A).B ∼ = Π(x : A).∀κ.B. Σ (y : ∀κ.A) (∀κ.B [y[κ]/ x]). - ∀κ.Σ (x : A) B ∼ = κ ∼ - ∀κ.A = ∀κ.⊲A. There is an important additional type isomorphism witnessing that ∀κ commutes with binary sums; however unlike the isomorphisms above we require equality reflection to show that the two functions are inverse to each other up to definitional equality. There is a canonical term of type ∀κ.A+∀κ.B → ∀κ.(A+B) using just ordinary elimination of coproducts. Using the fact that we encode binary coproducts using Σ-types and universes we can define a term com+ of type ∀κ.(A+B) → ∀κ.A+∀κ.B which is a inverse to the canonical term. In particular com+ satisfies the following two equalities which will be used below. com+ (Λκ. inl t) ≡ inl Λκ.t 5 com+ (Λκ. inr t) ≡ inr Λκ.t. (4) Example programs with coinductive types b in clock context ∆ and κ a fresh clock variable. Let A be a type with code A κ Let StrA = ∀κ. StrA . We can define head, tail and cons functions hd : StrA → A tl : StrA → StrA cons : A → StrA → StrA hd , λxs. hdκ0 (xs[κ0 ]) tl , λxs. prev κ. tlκ (xs[κ]) cons , λx.λxs.Λκ. consκ x (nextκ (xs[κ])) . 12 Definitional type equalities: Γ ⊢∆ Γ ⊢∆ ∆′ ⊆ ∆ Γ ⊢∆,κ t : U∆′ ,κ TyEq-∀-el b Γ ⊢∆ El(∀ Λκ.t) ≡ ∀κ. El(t) Γ ⊢∆,κ A type Γ ⊢∆ t : ∀κ.A Γ ⊢∆ s : ∀κ.A Γ ⊢∆ ∀κ.IdA(t[κ] , s[κ]) ≡ Id∀κ.A(t, s) TyEq-∀-Id Definitional term equalities: ⊢∆ κ′ Γ ⊢∆,κ t : A  ′ TmEq-∀-β (Λκ.t) κ ≡ t[κ′ /κ] : A[κ′ /κ] Γ ⊢∆ Γ ⊢∆ κ 6∈ ∆ Γ ⊢∆ A type Γ ⊢∆ Γ ⊢∆ Γ ⊢∆ t : ∀κ.A     t κ′ ≡ t κ′′ : A κ ⊢∆,κ ξ : Γ _ Γ ′ κ 6∈ ∆ Γ ⊢∆ t : ∀κ.A Γ ⊢∆ Λκ.t[κ] ≡ t : ∀κ.A ⊢∆ κ′ ⊢∆ κ′′ Γ, Γ ′ ⊢∆,κ t : A Γ ⊢∆ prev κ. nextκ ξ.t ≡ Λκ.t(advκ∆ (ξ)) : ∀κ.(A(advκ∆ (ξ))) Γ ⊢∆ TmEq-∀-η TmEq-∀-fresh TmEq-prev-β κ Γ ⊢∆,κ t : ⊲A κ Γ ⊢∆,κ nextκ ((prev κ.t)[κ]) ≡ t : ⊲A TmEq-prev-η Fig. 6. Type and term equalities involving clock quantification. With these we can define the acausal ‘every other’ function eoκ that removes every second element of the input stream. It is acausal because the second element of the output stream is the third element of the input. Therefore to type the function we need to have the input stream always available, so clock quantification must be used. The function eoκ of type StrA → StrκA is defined as eoκ , fixκ φ.λ (xs : StrA ) . consκ (hd xs) (φ κ nextκ ((tl (tl xs)))) . The result is a guarded stream, but we can easily strengthen it and define eo of type StrA → StrA as eo , λxs.Λκ. eoκ xs. We can also work with covectors (not just guarded covectors as in Sec. 3). This is a dependent coinductive type indexed by conatural numbers which is the type CoN = ∀κ. CoNκ . It is easy to define 0 and succ as 0 , Λκ. inl hi and succ , λn.Λκ. inr (nextκ (n[κ])). Next, we can define a transport function comCoN of type comCoN : CoN → 1 + CoN satisfying comCoN 0 ≡ inl hi comCoN (succ n) ≡ inr n. (5) This function is used to define the type family of covectors as CoVecA n , ∀κ. CoVecκA n where CoVecκA : CoN → U∆,κ is the term n o b ⊲κ (φ κ (nextκ n)) . fixκ φ.λ (n : CoN) . case comCoN n of inl ⇒ b 1; inr n ⇒ A×b 13 Using term equalities (4) and (5) we can derive the type isomorphisms CoVecA 0 ≡ ∀κ.1 ∼ =1   κ CoVecA (succ n) ≡ ∀κ. A × ⊲ (CoVecκA n) ∼ = A × CoVecA n (6) which are the expected properties of the type of covectors. A simple function we can define is the tail function tl : CoVecA (succ n) → CoVecA tl , λv. prev κ.π2 (v[κ]) . Note that (6) is needed to type tl. The map function of type map : (A → B) → Π(n : CoN). CoVecA n → CoVecB n is defined as map f , λn.λxs.Λκ. mapκ f n (xs[κ]) where mapκ is mapκ : (A → B) → Π(n : CoN). CoVecκA n → CoVecκB n mapκ = λf. fixκ φ.λn. case comCoN n of inl ⇒ λv.v inr n ⇒ λv. hf (π1 v), φ 5.1 κ (nextκ n) κ π2 (v)i . Lifting guarded functions In this section we show how in general we may lift a function on guarded recursive types, such as addition of guarded streams, to a function on coinductive streams. Moreover, we show how to lift proofs of properties, such as the commutativity of addition, from guarded recursive types to coinductive types. Let Γ be a context in clock context ∆ and κ a fresh clock. Suppose A and B are types such that Γ ⊢∆,κ A type and Γ, x : A ⊢∆,κ B type. Finally let f be a function of type Γ ⊢∆,κ f : Π(x : A).B. We define L(f ) satisfying the typing judgement Γ ⊢∆ L(f ) : Π(y : ∀κ.A).∀κ. (B [y[κ] /x]) as L(f ) , λy.Λκ.f (y[κ]). Now assume that f ′ is another term of type Π(x : A).B (in the same context) and that we have proved Γ ⊢∆,κ p : Π(x : A).IdB(f x, f ′ x). As above we can give the term L(p) the type Π(y : ∀κ.A).∀κ.IdB[y[κ]/x](f (y[κ]), f ′ (y[κ])). which by using the type equality TyEq-∀-Id and the η rule for ∀ is equal to the type Π(y : ∀κ.A).Id∀κ.B[y[κ]/x](L(f ) y, L(f ′ ) y). So we have derived a property of lifted functions L(f ) and L(f ′ ) from the properties of the guarded versions f and f ′ . This is a standard pattern. Using Löb induction we prove a property of a function whose result is a “guarded” type and derive the property for the lifted function. For example we can lift the zipWith function from guarded streams to coinductive streams and prove that it preserves commutativity, using the result on guarded streams of Sec. 3. 14 6 Soundness gDTT can be shown to be sound with respect to a denotational model interpreting the type theory. The model is a refinement of Bizjak and Møgelberg’s [6] but for reasons of space we leave the description of a full model of gDTT for future work. Instead, to provide some intuition for the semantics of delayed substitutions, we just describe how to interpret the rule x : A ⊢ B type ⊢ t : ⊲A ⊢ ⊲ [x t] .B type (7) in the case where we only have one clock available. The subsystem of gDTT with only one clock can be modelled in the category S, known as the topos of trees [5], the presheaf category over the first infinite ordinal ω. The objects X of S are families of sets X1 , X2 , . . . indexed by the positive integers, together with families of restriction functions riX : Xi+1 → Xi indexed similarly. There is a functor ◮ : S → S which maps an object X to the object 1 ! X1 r1X X2 r2X X3 ··· where ! is the unique map into the terminal object. In this model, a closed type A is interpreted as an object of S and the type x : A ⊢ B type is interpreted as an indexed family of sets Bi (a), for a in Ai together with maps riB (a) : Bi+1 (a) → Bi (riA (a)). The term t in (7) is interpreted as a morphism t : 1 → ⊲A so ti (∗) is an element of Ai (here we write ∗ for the element of 1). The type ⊢ ⊲ [x t] .B type is then interpreted as the object X, defined by X1 = 1 Xi+1 = Bi (ti+1 (∗)). Notice that the delayed substitution is interpreted by substitution (reindexing) in the model; the change of the index in the model (Bi is reindexed along ti+1 (∗)) corresponds to the delayed substitution in the type theory. Further notice that if B does not depend on x, then the interpretation of ⊢ ⊲ [x t] .B type reduces to the interpretation ⊲B, which is defined to be ◮ applied to the interpretation of B. The above can be generalised to work for general contexts and sequences of delayed substitutions, and one can then validate that the definitional equality rules do indeed hold in this model. 7 Related Work Birkedal et al. [5] introduced dependent type theory with the ⊲ modality, with semantics in the topos of trees. The guardedness requirement was expressed using the syntactic check that every occurrence of a type variable lies beneath 15 a ⊲. This requirement was subsequently refined by Birkedal and Møgelberg [4], who showed that guarded recursive types could be constructed via fixed-points of functions on universes. However, the rules considered in these papers do not allow one to apply terms of type ⊲(Π(x : A).B), as the applicative functor construction ⊛ was defined only for simple function spaces. They are therefore less expressive for both programming (consider the covector ones, and function map, of Sec. 3) and proving, noting the extensive use of delayed substitutions in our example proofs. They further do not consider coinductive types, and so are restricted to causal functions. The extension to coinductive types, and hence acausal functions, is due to Atkey and McBride [3], who introduced clock quantifiers into a simply typed setting with guarded recursion. Møgelberg [18] extended this work to dependent types and Bizjak and Møgelberg [6] refined the model further to allow clock synchronisation. Clouston et al. [8] introduced the logic Lgλ to prove properties of terms of the (simply typed) guarded λ-calculus, gλ. This allowed proofs about coinductive types, but not in the integrated fashion supported by dependent type theories. Moreover it relied on types being “total”, a property that in a dependently typed setting would entail a strong elimination rule for ⊲, which would lead to inconsistency. Sized types [13] have been combined with copatterns [1] as an alternative type-based approach for modular programming with coinductive types. This work is more mature than ours with respect to implementation and the demonstration of syntactic properties such as normalisation, and so further development of gDTT is essential to enable proper comparison. One advantage of gDTT is that the later modality is useful for examples beyond coinduction, and beyond the utility of sized types, such as the guarded recursive domain equations used to model program logics [23]. 8 Conclusion and Future Work We have described the dependent type theory gDTT. The examples we have detailed show that gDTT provides a setting for programming and proving with guarded recursive and coinductive types. In future work we plan to investigate an intensional version of the type theory and construct a prototype implementation to allow us to experiment with larger examples. Preliminary work has suggested that the path type of cubical type theory [9] interacts better with the new constructs of gDTT than the ordinary Martin-Löf identity type. Finally, we are investigating whether the generalisation of applicative functors [17] to apply over dependent function spaces, via delayed substitutions, might also apply to examples quite unconnected to the later modality. Acknowledgements. This research was supported in part by the ModuRes Sapere Aude Advanced Grant and DFF-Research Project 1 Grant no. 4002-00442, both 16 from The Danish Council for Independent Research for the Natural Sciences (FNU). Aleš Bizjak was supported in part by a Microsoft Research PhD grant. References 1. Abel, A., Pientka, B.: Wellfounded recursion with copatterns: A unified approach to termination and productivity. In: ICFP. pp. 185–196 (2013) 2. Appel, A.W., Melliès, P.A., Richards, C.D., Vouillon, J.: A very modal model of a modern, major, general type system. In: POPL. pp. 109–122 (2007) 3. Atkey, R., McBride, C.: Productive coprogramming with guarded recursion. In: ICFP. pp. 197–208 (2013) 4. Birkedal, L., Møgelberg, R.E.: Intensional type theory with guarded recursive types qua fixed points on universes. In: LICS. pp. 213–222 (2013) 5. Birkedal, L., Møgelberg, R.E., Schwinghammer, J., Støvring, K.: First steps in synthetic guarded domain theory: step-indexing in the topos of trees. LMCS 8(4) (2012) 6. Bizjak, A., Møgelberg, R.E.: A model of guarded recursion with clock synchronisation. In: MFPS (2015) 7. Brady, E.: Idris, a general-purpose dependently typed programming language: Design and implementation. J. Funct. Programming 23(5), 552–593 (2013) 8. Clouston, R., Bizjak, A., Grathwohl, H.B., Birkedal, L.: Programming and reasoning with guarded recursion for coinductive types. In: FoSSaCS (2015) 9. Cohen, C., Coquand, T., Huber, S., Mörtberg, A.: Cubical type theory: a constructive interpretation of the univalence axiom (2015), unpublished 10. Constable, R.L., Allen, S.F., Bromley, H.M., Cleaveland, W.R., Cremer, J.F., Harper, R.W., Howe, D.J., Knoblock, T.B., Mendler, N.P., Panangaden, P., Sasaki, J.T., Smith, S.F.: Implementing Mathematics with the Nuprl Proof Development System. Prentice-Hall, Inc., Upper Saddle River, NJ, USA (1986) 11. Coquand, T.: Infinite objects in type theory. In: TYPES. pp. 62–78 (1993) 12. Giménez, E.: Codifying guarded definitions with recursive schemes. In: TYPES. pp. 39–59 (1995) 13. Hughes, J., Pareto, L., Sabry, A.: Proving the correctness of reactive systems using sized types. In: POPL. pp. 410–423 (1996) 14. Jacobs, B.: Categorical Logic and Type Theory. No. 141 in Studies in Logic and the Foundations of Mathematics, North Holland, Amsterdam (1999) 15. Krishnaswami, N.R., Benton, N.: Ultrametric semantics of reactive programs. In: LICS. pp. 257–266 (2011) 16. The Coq development team: The Coq proof assistant reference manual. LogiCal Project (2004), http://coq.inria.fr, version 8.0 17. McBride, C., Paterson, R.: Applicative programming with effects. J. Funct. Programming 18(1), 1–13 (2008) 18. Møgelberg, R.E.: A type theory for productive coprogramming via guarded recursion. In: CSL-LICS (2014) 19. Nakano, H.: A modality for recursion. In: LICS. pp. 255–266 (2000) 20. Norell, U.: Towards a practical programming language based on dependent type theory. Ph.D. thesis, Chalmers University of Technology (2007) 21. Paviotti, M., Møgelberg, R.E., Birkedal, L.: A model of PCF in guarded type theory. In: MFPS (2015) 17 22. Shulman, M.: Univalence for inverse diagrams and homotopy canonicity. Mathematical Structures in Computer Science 25, 1203–1277 (6 2015) 23. Svendsen, K., Birkedal, L.: Impredicative concurrent abstract predicates. In: ESOP. pp. 149–168 (2014) 24. The Univalent Foundations Program: Homotopy Type Theory: Univalent Foundations of Mathematics. http://homotopytypetheory.org/book, Institute for Advanced Study (2013) 18 Appendix A Overview of the appendix Sec. B contains type and term equalities of Fig. 3 in full detail. Sec. C starting on page 19 contains detailed explanations of examples from Sec. 3 explaining how the rules of gDTT are used. Sec. D starting on page 27 contains detailed explanations of examples with coinductive types. Sec. E starting on page 29 contains a detailed derivation of the type isomorphism ∀κ.A + B ∼ = ∀κ.A + ∀κ.B used in Sec. 4. B Typing rules Definitional type equalities: Γ, Γ ′ ⊢∆ A type ⊢∆ ξ[x κ κ Γ ⊢∆ ⊲ξ [x ⊢∆ ξ [x t] .A ≡ ⊲ξ.A TyEq-⊲-Weak Γ, Γ ′ , x : B, y : C, Γ ′′ ⊢∆ A type κ u] ξ ′ : Γ _ Γ ′ , x : B, y : C, Γ ′′ x not free in C t, y κ Γ ⊢∆ ⊲ξ [x t, y κ Γ ⊢∆ ⊲ξ [x κ ⊢∆′ κ κ u] ξ ′ .A ≡ ⊲ξ [y nextκ ξ.t] .A type κ nextκ ξ.t] .A ≡ ⊲ξ.A[t/x] Γ ⊢∆ ⊲ξ [x ∆′ ⊆ ∆ κ t] : Γ _ Γ ′ , x : B u, x t] ξ ′ .A TyEq-Force κ ⊢∆ ξ : Γ _ Γ ′ Γ, Γ ′ ⊢∆ A : U∆′ κ κ Γ ⊢∆ El(b ⊲ (nextκ ξ.A)) ≡ ⊲ξ. El(t) κ ⊢∆ ξ : Γ _ Γ ′ Γ, Γ ′ ⊢∆ t : A TyEq-⊲-Exch Γ, Γ ′ ⊢∆ s : A κ Γ ⊢∆ Idκ⊲ξ.A(nextκ ξ.t, nextκ ξ.s) ≡ ⊲ξ.IdA(t, s) TyEq-El-⊲ TyEq-⊲ 19 Definitional term equalities: Γ, Γ ′ ⊢∆ u : A κ t] : Γ _ Γ ′ , x : B ⊢∆ ξ [x Γ ⊢∆ nextκ ξ [x κ t] .u ≡ nextκ ξ.u : ⊲ξ.A TmEq-Next-Weak κ Γ ⊢∆ t : ⊲ξ.A Γ ⊢∆ nextκ ξ [x κ t] .x ≡ t : ⊲ξ.A TmEq-Next-Var Γ, Γ ′ , x : B, y : C, Γ ′′ ⊢∆ t : A κ ⊢∆ ξ [x t, y u] ξ ′ : Γ _ Γ ′ , x : B, y : C, Γ ′′ x not free in C Γ ⊢∆ nextκ ξ [x u] ξ ′ .v ≡ nextκ ξ [y t, y Γ ⊢∆ nextκ ξ [x Γ ⊢∆ nextκ ξ [x κ nextκ ξ.t] .u : ⊲ξ [x u, x κ t] ξ ′ .v : ⊲ξ [y nextκ ξ.t] .A κ nextκ ξ.t] .u ≡ nextκ ξ.u[t/x] : ⊲ξ.A[t/x] u, x t] ξ ′ .A TmEq-Force Γ ⊢∆ fixκ x.t : A TmEq-Fix Γ ⊢∆ fixκ x.t ≡ t[nextκ (fixκ x.t) /x] : A C Examples In this section we provide detailed explanations of typing derivations of examples described in Sec. 3. C.1 zipWithκ preserves commutativity The first proof is the simplest. We will define the standard zipWithκ (zipWith) function on streams and show that if a binary function f is commutative, then so is zipWithκ f . The zipWithκ : (A → B → C) → StrκA → StrκB → StrκC is defined by guarded recursion as zipWithκ f , fixκ φ.λ(xs, ys : StrκA ). consκ (f (hdκ xs) (hdκ ys)) (φ κ tlκ xs κ tlκ ys) Note that none of the new generalised ⊲ rules of gDTT are needed to type this function; this is a function on simple types. Where we need dependent types is, of course, to state and prove properties. To prove our example, that commutativity of f implies commutativity of zipWithκ f , means we must show that the type Π(f : A → A → B). (Π(x, y : A).IdB(f x y, f y x)) → Π(xs, ys : StrκA ).IdStrκB(zipWithκ f xs ys, zipWithκ f ys xs). TmEq-Next-Exch 20 is inhabited. We will explain how to construct such a term, and why it is typeable in gDTT. Although this construction might appear complicated at first, the actual proof term that we construct will be as simple as possible. Let f : A → A → B be a function and say we have a term c : Π(x, y : A).IdB(f x y, f y x) witnessing commutativity of f . We now wish to construct a term of type Π(xs, ys : StrκA ).IdStrκC(zipWithκ f xs ys, zipWithκ f ys xs) We do this by guarded recursion. To this end we assume  κ φ : ⊲ Π(xs, ys : StrκA ).IdStrκB(zipWithκ f xs ys, zipWithκ f ys xs) and take xs, ys : StrκA . Using c (the proof that f is commutative) we first have c (hdκ xs) (hdκ ys) of type IdB(f (hdκ xs) (hdκ ys), f (hdκ ys) (hdκ xs)) and because we have by definition of zipWithκ hdκ (zipWithκ f xs ys) ≡ f (hdκ xs) (hdκ ys) hdκ (zipWithκ f ys xs) ≡ f (hdκ ys) (hdκ xs) we see that c (hdκ xs) (hdκ ys) has type IdB(hdκ (zipWithκ f xs ys), hdκ (zipWithκ f ys xs)). To show that the tails are equal we use the induction hypothesis φ. The terms κ tlκ xs and tlκ ys are of type ⊲ StrκA , so we first have φ κ tlκ xs of type    κ zipWithκ f xs ys, ⊲ [xs tlκ xs] . Π (ys : StrκA ) .IdStrκC zipWithκ f ys xs Note the appearance of the generalised ⊲, carrying a delayed substitution. Beκ cause the variable xs does not appear in ⊲ StrκA we may apply the weakening rule TmEq-Next-Weak to derive κ tlκ ys : ⊲ [xs tlκ xs] . StrκA Hence we may use the derived applicative rule to have φ κ tlκ xs κ tlκ ys of type   κ xs tlκ xs ⊲ .IdStrκC(zipWithκ f xs ys, zipWithκ f ys xs) ys tlκ ys and which is definitionally equal to   κ xs  next ys  Idκ⊲ Strκ   C κ xs next ys the type   tlκ xs κ . zipWith f xs ys,  tlκ ys  . κ  tl xs κ . zipWith f ys xs tlκ ys 21 We also compute tlκ (zipWithκ f xs ys) ≡ nextκ (zipWithκ f ) κ tlκ xs κ tlκ ys   tlκ xs κ xs .(zipWithκ f xs ys) ≡ next ys tlκ ys and tlκ (zipWithκ f ys xs) ≡ nextκ   tlκ ys .(zipWithκ f ys xs). κ tl xs ys zs Using the exchange rule TmEq-Next-Exch we have the equality     xs tlκ xs ys tlκ ys .(zipWithκ f xs ys). .(zipWithκ f xs ys) ≡ nextκ nextκ κ κ ys tl ys xs tl xs Putting it all together we have shown that the term φ κ tlκ xs tlκ ys has type κ Idκ⊲ Strκ (tlκ (zipWithκ f xs ys), tlκ (zipWithκ f ys xs)) B which means that the term fixκ φ.λ (xs, ys : StrκA ) . pη (c (hdκ xs) (hdκ ys)) (φ κ tlκ xs κ tlκ ys) has type Π(xs, ys : StrκA ).IdStrκB(zipWithκ f xs ys, zipWithκ f ys xs). Notice that the resulting proof term could not be simpler than it is. In particular, we do not have to write delayed substitutions in terms, but only in the intermediate types. C.2 An example with covectors The next example is more sophisticated, as it will involve programming and proving with a data type that, unlike streams, is dependently typed. In particular, we will see that the generalised later, carrying a delayed substitution, is necessary to type even the most elementary programs. Covectors are to colists (potentially infinite lists) as vectors are to lists. To define guarded covectors we first need guarded co-natural numbers. This is the type satisfying κ CoNκ ≡ 1 + ⊲ CoNκ . where binary sums are encoded in a standard way. The defi in the type theory  κ κ κ b bb nition in gDTT is CoN , El fix φ.(1 + ⊲ φ) . κ Using CoN we define the type of covectors of type A, written CoVecκA , as a CoNκ -indexed type satisfying CoVecκA (inl hi) ≡ 1 κ CoVecκA (inr(nextκ m)) ≡ A × ⊲(CoVecκA m) 22 \κ In gDTT we first define CoVec A \κ , fixκ φ.λ(n : CoNκ ). case n of CoVec A b inl u ⇒ 1 κ bb inr m ⇒ A × ⊲ (φ κ m). \κ n). In the examples we will not distinguish and then CoVecκA n , El(CoVec A κ κ \κ . In the above φ has type ⊲(CoN between CoVecκA and CoVec → U∆,κ ) and A κ κ inside the branches, u has type 1 and m has type ⊲ CoN , which is evident from the definition of CoNκ . As an example of covectors, we define ones of type Π(n : CoNκ ). CoVecκN n which produces a covector of any length consisting only of ones: ones , fixκ φ.λ(n : CoNκ ). case n of inl u ⇒ inl hi inr m ⇒ h1, φ κ mi . When checking the type of this program, we need the generalised later. The type κ κ of the recursive call is ⊲(Π(n : CoNκ ). CoVecκN n), the type of m is ⊲ CoNκ , and therefore the type of the subterm φ κ m must be κ ⊲ [n m] .Π(n : CoNκ ). CoVecκN n.x We now aim to define the function map on covectors and show that it preserves composition. Given two types A and B the map function has type map : (A → B) → Π(n : CoNκ ). CoVecκA n → CoVecκB n. and is defined by guarded recursion as map f , fixκ φ.λ(n : CoNκ ). case n of inl u ⇒ λ(x : 1).x   κ λ p : A × ⊲ [n m] .(CoVecκA n) . inr m ⇒ hf (π1 p) , φ κ m κ (π2 p)i Let us see why the definition has the correct type. First, the types of subterms are κ φ : ⊲(Π(n : CoNκ ). CoVecκA n → CoVecκB n) u:1 κ m : ⊲ CoNκ 23 Let C = CoVecκA n → CoVecκB n, and write C(t) for C[t/n]. By the definition of CoVecκA and CoVecκB we have C(inl u) ≡ 1 → 1, and so λ(x : 1).x has type C(inl u). By the definition of CoVecκA we have  κ CoVecκA (inr m) ≡ A × El b ⊲ (nextκ (CoVecκA ) κ m) κ ≡ A × ⊲ [n m] . (CoVecκA n) and analogously for CoVecκB (inr m). Hence the type C(inr m) is convertible to     κ κ A × ⊲ [n m] . (CoVecκA n) → B × ⊲ [n m] . (CoVecκB n) . Further, using the derived applicative rule we have φ κ κ m : ⊲ [n m] .C(n) and because π2 p in the second branch has type κ ⊲ [n m] .(CoVecκA n) we may use the (simple) applicative rule again to get φ κ which allows us to type  κ λ p : A × ⊲ [n m κ κ (π2 p) : ⊲ [n m] .(CoVecκB n)  m] .(CoVecκA n) . hf (π1 p) , φ κ m κ π2 (p)i with type C(inr m). Notice that we have made essential use of the more general applicative rule to apply φ κ m to π2 p. Using the strong (dependent) elimination rule for binary sums we can type the whole case construct with type C(n), which is what we need to give map the desired type. Now we will show that map so defined satisfies a basic property, namely that it preserves composition in the sense that the type (in the context where we have types A, B and C) Π(f : A → B)(g : B → C)(n : CoNκ )(xs : CoVecκA n). IdCoVecκC n(map g n(map f n xs), map(g ◦ f ) n xs) (8) is inhabited. The proof is, of course, by Löb induction. First we record some definitional equalities which follow directly by unfolding the definitions map f (inl u) x ≡ x map f (inr m) xs ≡ hf (π1 xs) , nextκ (map f ) κ m κ π2 (xs)i   m κ n .(map f n ys)i ≡ hf (π1 xs), next ys π2 xs 24 and so iterating these two equalities we get map g (inl u) (map f (inl u) x) ≡ x map g (inr m) (map f (inr m) xs) ≡ hg(f (π1 xs)), si where s is the term   n m    .(map g n zs) n m nextκ  zs nextκ .(map f n ys) ys π2 xs which is convertible, by the rule TmEq-Force, to the term   n m .(map g n (map f n ys)). nextκ ys π2 xs Similarly we have map(g ◦ f ) (inl u) x ≡ x and map(g ◦ f ) (inr m) xs convertible to     m κ n .(map(g ◦ f ) n ys) . g(f (π1 xs)), next ys π2 xs Now let us get back to proving property (8). Take f : A → B, g : B → C and assume κ φ : ⊲Π(n : CoNκ )(xs : CoVecκA n).IdCoVecκC n(map g n(map f n xs), map(g ◦ f ) n xs) We take n : CoNκ and write P (n) = Π(xs : CoVecκA n).IdCoVecκC n(map g n(map f n xs), map(g ◦ f ) n xs). Then similarly as in the definition of map and the definitional equalities for map above we compute P (inl u) ≡ Π(xs : 1).Id1(xs, xs) and so we have λ(xs : 1).r1 xs of type P (inl u). The other branch (when n = inr m) is of course a bit more complicated. As before we have κ CoVecκA (inr m) ≡ A × ⊲ [n m] . CoVecκA n So take xs of type CoVecκA (inr m). We need to construct a term of type IdCoVecκC n(map g n(map f n xs), map(g ◦ f ) n xs). (9) 25 First we have rC g(f (π1 xs)) of type IdC(g(f (π1 xs)), g(f (π1 xs))). Then because κ m is of type ⊲ CoNκ we can use the induction hypothesis φ to get φ κ m of type κ ⊲ [n m] .Π(xs : CoVecκA n).IdCoVecκC n(map g n(map f n xs), map(g ◦ f ) n xs). κ Using (9) we have π2 xs of type ⊲ [n m] . CoVecκA n and so we can use the applicative rule again to give φ κ m κ π2 xs the type     κ n map g n(map f n xs), m ⊲ .IdCoVecκC n map(g ◦ f ) n xs xs π2 xs which by the rule TyEq-⊲ is the same as     m κ n next . (map g n(map f n xs)) ,     xs π2 xs  IdD   n m nextκ . (map(g ◦ f ) n xs) xs π2 xs κ where D is the type ⊲ [n m] . CoVecκC n. Thus we can give to the term λ(xs : CoVecκA (inr m)). pη (rC g(f (π1 xs))) (φ κ m κ π2 xs) the type P (inr m). Using the dependent elimination rule for binary sums we get the final proof of property (8) as the term λ(f : A → B)(g : B → C). fixκ φ.λ(n : CoNκ ). case n of inl u ⇒ λ(xs : 1).r1 xs inr m ⇒ λ(xs : CoVecκA (inr m)). pη (rC g(f (π1 xs))) (φ κ m κ π2 xs) which is as simple as could be expected. C.3 Lifting predicates to streams Let P : A → U∆ be a predicate on type A and κ a clock variable not in ∆. We can define a lifting of this predicate to a predicate P κ on streams of elements of type A. The idea is that P κ xs will hold precisely when P holds for all elements of the stream. However we do not have access to all the element of the stream at the same time. As such we will have P κ xs if P holds for the first element of the stream xs now, and P holds for the second element of the stream xs one time step later, and so on. The precise definition uses guarded recursion: P κ : StrκA → U∆,κ κ bb ⊲ (φ P κ , fixκ φ.λ (xs : StrκA ) .P (hdκ xs) × κ κ tlκ xs) . In the above term the subterm φ has type ⊲ (StrκA → U∆,κ ) and so because tlκ xs κ κ κ has type ⊲ StrκA we may form φ κ tlκ xs of type ⊲U∆,κ and so finally b ⊲ (φ κ tlκ xs) has type U∆,κ as needed. 26 To see that this makes sense, we have for a stream xs : StrκA κ ⊲ (nextκ P κ El (P κ xs) ≡ El (P (hdκ xs)) × El b Using delayed substitution rules we have nextκ P κ κ tlκ xs ≡ nextκ [xs κ κ  tlκ xs) . tlκ xs] . (P κ xs) which gives rise to the type equality El(b ⊲ nextκ P κ κ  tlκ xs] . (P κ xs) . κ tlκ xs) ≡ El b ⊲ nextκ [xs Finally, the type equality rule TyEq-El-⊲ gives us  κ κ El b ⊲ nextκ [xs tlκ xs] . (P κ xs) ≡ ⊲ [xs tlκ xs] . El(P κ xs). All of these together then give us the type equality κ El (P κ xs) ≡ El(P (hdκ xs)) × ⊲ [xs tlκ xs] . El(P κ xs). And so if xs = consκ x (nextκ ys) we can further simplify, using rule TyEqForce, to get κ ⊲ [xs κ κ nextκ ys] . El(P κ xs) ≡ ⊲ (El(P κ xs)[ys/xs]) ≡ ⊲ El(P κ ys) κ which then gives El(P κ xs) ≡ El (P x) × ⊲ El (P κ ys) which is in accordance with the motivation given above. Because P κ is defined by guarded recursion, we prove its properties by Löb induction. In particular, we may prove that if P holds on A then P κ holds on StrκA , i.e., that the type (Π(x : A). El (P x)) → (Π(xs : StrκA ). El (P κ xs)) is inhabited (in a context where we have a type A and a predicate P ). Take p : Π(x : A). El (P x), and since we are proving by Löb induction we assume the induction hypothesis later κ φ : ⊲ (Π(xs : StrκA ). El (P κ xs)) . Let xs : StrκA be a stream. By definition of P κ we have the type equality κ El(P κ xs) ≡ El (P hdκ xs) × ⊲ [xs tlκ xs] . El (P κ xs) Applying p to hdκ xs gives us the first component p(hdκ xs) : El (P (hdκ xs)) and applying the induction hypothesis φ we have φ κ κ tlκ xs : ⊲ [xs tlκ xs] . El(P κ xs) Thus combining this with the previous term we have the proof of the lifting property as the term λ (p : Π(x : A). El (P x)) . fixκ φ.λ (xs : StrκA ) hp (hdκ xs) , φ κ tlκ xsi . 27 D Example programs with coinductive types Let A be some small type in clock context ∆ and κ, a fresh clock variable. Let StrA = ∀κ. StrκA . We can define head, tail and cons functions hd : StrA → A hd , λxs. hd κ0 tl : StrA → StrA tl , λxs. prev κ. tlκ (xs[κ]) (xs[κ0 ]) cons : A → StrA → StrA cons , λx.λxs.Λκ. consκ x (nextκ (xs[κ])) . With these we can define the acausal ‘every other’ function eoκ that removes every second element of the input stream. This is acausal because the second element of the output stream is the third element of the input. Therefore to type the function we need to have the input stream always available, necessitating the use clock quantification. The function eoκ is eoκ : StrA → StrκA eoκ , fixκ φ.λ (xs : StrA ) . consκ (hd xs) (φ κ nextκ ((tl (tl xs)))) . i.e., we return the head immediately and then recursively call the function on the stream with the first two elements removed. Note that the result is a guarded stream, but we can easily strengthen it and define eo of type StrA → StrA as eo , λxs.Λκ. eoκ xs. A more interesting type is the type of covectors, which is a refinement of the guarded type of covectors defined in Sec. 3. First we define the type of co-natural numbers CoN as CoN = ∀κ. CoNκ . It is easy to define 0 and succ as 0 : CoN succ : CoN → CoN 0 , Λκ. inl hi succ , λn.Λκ. inr (nextκ (n[κ])) . Next, we will use type isomorphisms to define a transport function comCoN of type comCoN : CoN → 1 + CoN as comCoN , λn. case com+ n of inl u ⇒ inl u[κ0 ] inr n ⇒ inr prev κ.n[κ] This function satisfies term equalities comCoN 0 ≡ inl hi comCoN (succ n) ≡ inr n. (10) 28 Using this we can define type of covectors CoVecA as CoVecA n , ∀κ. CoVecκA n where CoVecκA : CoN → U∆,κ is the term fixκ φ.λ (n : CoN) . case comCoN n of 1 inl ⇒ b b ⊲κ (φ inr n ⇒ A×b κ (nextκ n)) . Notice the use of comCoN to transport n of type CoN to a term of type 1 + CoN which we can case analyse. To see that this type satisfies the correct type equalities we need some auxiliary term equalities which follow from the way we have defined the terms. Using term equalities (4) and (5) we can derive the (almost) expected type equalities CoVecA 0 ≡ ∀κ.1   κ CoVecA (succ n) ≡ ∀κ. A × ⊲ (CoVecκ n) (11) and using the type isomorphisms we can extend these type equalities to type isomorphisms CoVecA 0 ∼ =1 CoVecA (succ n) ∼ = A × CoVecA n which are the expected type properties of the covector type. A simple function we can define is the tail function tl : CoVecA (succ n) → CoVecA tl , λv. prev κ.π2 (v[κ]) . Note that we have used (11) to ensure that tl is type correct. Next, we define the map function on covectors. map : (A → B) → Π(n : CoN). CoVecA n → CoVecB n map f = λn.λxs.Λκ. mapκ f n (xs[κ]) where mapκ is the function of type mapκ : (A → B) → Π(n : CoN). CoVecκA n → CoVecκB n defined as λf. fixκ φ.λn. case comCoN n of inl ⇒ λv.v inr n ⇒ λv. hf (π1 v), φ κ (nextκ n) κ π2 (v)i . 29 Let us see that this has the correct type. Let DA (x) (and analogously DB (x)) be the type DA (x) case x of inl ⇒ b 1 , b ⊲κ ((nextκ CoVecκA ) inr n ⇒ A×b κ (nextκ n)) . where x is of type 1 + CoN. Using this abbreviation we can write the type of mapκ as (A → B) → Π(n : CoN).DA (comCoN n) → DB (comCoN n). Using this it is straightforward to show, using the dependent elimination rule for sums, as we did in Sec. 3, that mapκ has the correct type. Indeed we have κ DA (inl z) ≡ 1 and DA (inr n) ≡ A × ⊲ (CoVecA n). E Type isomorphisms in detail ∼ A. The terms are λx.x [κ0 ] and λx.Λκ.x. The rule – If κ 6∈ A then ∀κ.A = TmEq-∀-fresh is crucially needed to show that they constitute a type isomorphism. – If κ 6∈ A then ∀κ.Π(x : A).B ∼ = Π(x : A).∀κ.B. The terms are λz.λx.Λκ.z[κ] x of type ∀κ.Π(x : A).B → Π(x : A).∀κ.B and λz.Λκ.λx.(z x)[κ] of type Π(x : A).∀κ.B → ∀κ.Π(x : A).B. – ∀κ.Σ (x : A) B ∼ = Σ (y : ∀κ.A) (∀κ.B [y[κ]/ x]). The terms are λz. hΛκ.π1 (z[κ]) , Λκ.π2 (z[κ])i of type ∀κ.Σ (x : A) B → Σ (y : ∀κ.A) (∀κ.B [y[κ]/ x]) and λz.Λκ. h(π1 z)[κ] , (π2 z)[κ]i of the converse type. κ – ∀κ.A ∼ = ∀κ.⊲A. The terms are λz.Λκ. nextκ (z[κ]) κ of type ∀κ.A → ∀κ.⊲A and λz. prev κ. (z[κ]) of the converse type. The β and η rules for prev κ. ensure that this pair of functions constitutes an isomorphism. 30 Using these isomorphisms we can construct an additional type isomorphism witnessing that ∀κ commutes with binary sums. Recall that we encode binary coproducts using Σ-types and universes in the standard way. Given two codes b and B b in some universe U∆ we define A b+ b : U∆ bB A b+ b , Σ (b : B) if b then A b else B b bB A   b+ b . Suppose that ∆′ ⊆ ∆ and κ is a clock variable bB and we write A+B for El A b B b satisfying not in ∆. Suppose that Γ ⊢∆ and that we have two codes A, b : U∆′ ,κ Γ ⊢∆,κ A b : U∆′ ,κ Γ ⊢∆,κ B We start with an auxiliary function comif . Let b be some term of type B. We then define   b else B b comifb : ∀κ. El if b then A   b else b b → El if b then b ∀ Λκ.A ∀ Λκ.B comifb , if b then λx.x else λx.x which is typeable due to the strong elimination rule for B. We now define the function com+ com+ : ∀κ.(A + B) → ∀κ.A + ∀κ.B D E com+ , λz. π1 (z[κ0 ]) , comifπ1 (z[κ0 ]) (Λκ.π2 (z[κ])) . We need to check that the types are well-formed and the function well-typed. The side condition Γ ⊢∆ ensures that the types are well-formed. To see that the function com+ is well-typed we consider the types of subterms. - The term z has type ∀κ.(A + B). - The term π1 (z[κ0 ]) has type B. - The term Λκ.π2 (z[κ]) has type   b else B b ∀κ. El if π1 (z[κ]) then A - From TmEq-∀-fresh we get π1 (z[κ0 ]) ≡ π1 (z[κ]). Indeed, the term Λκ.π1 (z[κ]) has type B, which does not contain κ, and the required equality follows from TmEq-∀-fresh and the β rule for clock quantification. - Thus the term Λκ.π2 (z[κ]) has type   b else B b ∀κ. El if π1 (z[κ0 ]) then A 31 - And so the term comifπ1 (z[κ0 ]) Λκ.π2 (z[κ]) has type   b else b b ∀ Λκ.A ∀ Λκ.B El if π1 (z[κ0 ]) then b which is exactly the type needed to typecheck the whole term. For the term com+ we can derive the following definitional term equalities. com+ (Λκ. inl t) ≡ inl Λκ.t com+ (Λκ. inr t) ≡ inr Λκ.t (12) There is also a canonical term of type ∀κ.A + ∀κ.B → ∀κ.(A + B) defined as λz.Λκ. case z of inl a ⇒ inl (a[κ]) inl b ⇒ inl (b[κ]). This term is inverse to com+ , although we require equality reflection to show that the two functions are inverses to each other. Without equality reflection we can only prove they are inverses up to propositional equality. The isomorphisms defined previously do not require equality reflection.
6cs.PL
Static and Dynamic Semantics of NoSQL Languages Véronique Benzaken1 arXiv:1303.1716v1 [cs.PL] 7 Mar 2013 1 Giuseppe Castagna2 Kim Nguyễn1 Jérôme Siméon3 LRI, Université Paris-Sud, Orsay, France, 2 CNRS, PPS, Univ Paris Diderot, Sorbonne Paris Cité, Paris, France 3 IBM Watson Research, Hawthorne, NY, USA Abstract that is deduced directly from the structure of the program even in the absence of any explicit type declaration or annotation. We present a calculus for processing semistructured data that spans differences of application area among several novel query languages, broadly categorized as “NoSQL”. This calculus lets users define their own operators, capturing a wider range of data processing capabilities, whilst providing a typing precision so far typical only of primitive hard-coded operators. The type inference algorithm is based on semantic type checking, resulting in type information that is both precise, and flexible enough to handle structured and semistructured data. We illustrate the use of this calculus by encoding a large fragment of Jaql, including operations and iterators over JSON, embedded SQL expressions, and co-grouping, and show how the encoding directly yields a typing discipline for Jaql as it is, namely without the addition of any type definition or type annotation in the code. Example. We use Jaql [5, 18], a language over JSON [19] developed for BigData analytics, to illustrate how our proposed calculus works. Our reason for using Jaql is that it encompasses all the features found in the previously cited query languages and includes a number of original ones, as well. Like Pig [28] it supports sequence iteration, filtering, and grouping operations on non-nested queries. Like AQL [3] and XQuery [6], it features nested queries. Furthermore, Jaql uses a rich data model that allows arbitrary nesting of data (it works on generic sequences of JSON records whose fields can contain other sequences or records) while other languages are limited to flat data models, such as AQL whose data-model is similar to the standard relational model used by SQL databases (tuples of scalars and of lists of scalars). Lastly, Jaql includes SQL as an embedded sub-language for relational data. For these reasons, although in the present work we focus almost exclusively on Jaql, we believe that our work can be adapted without effort to a wide array of sequence processing languages. The following Jaql program illustrates some of those features. It performs co-grouping [28] between one JSON input, containing information about departments, and one relational input containing information about employees. The query returns for each department its name and id, from the first input, and the number of high-income employees from the second input. A SQL expression is used to select the employees with income above a given value, while a Jaql filter is used to access the set of departments and the elements of these two collections are processed by the group expression (in Jaql “$” denotes the current element). 1. Introduction The emergence of Cloud computing, and the ever growing importance of data in applications, has given birth to a whirlwind of new data models [19, 24] and languages. Whether they are developed under the banner of “NoSQL” [12, 35], for BigData Analytics [5, 18, 28], for Cloud computing [3], or as domain specific languages (DSL) embedded in a host language [21, 27, 32], most of them share a common subset of SQL and the ability to handle semistructured data. While there is no consensus yet on the precise boundaries of this class of languages, they all share two common traits: (i) an emphasis on sequence operations (eg, through the popular MapReduce paradigm) and (ii) a lack of types for both data and programs (contrary to, say, XML programming or relational databases where data schemas are pervasive). In [21, 22], Meijer argues that such languages can greatly benefit from formal foundations, and suggests comprehensions [7, 33, 34] as a unifying model. Although we agree with Meijer for the need to provide unified, formal foundations to those new languages, we argue that such foundations should account for novel features critical to various application domains that are not captured by comprehensions. Also, most of those languages provide limited type checking, or ignore it altogether. We believe type checking is essential for many applications, with usage ranging from error detection to optimization. But we understand the designers and programmers of those languages who are averse to any kind of type definition or annotation. In this paper, we propose a calculus which is expressive enough to capture languages that go beyond SQL or comprehensions. We show how the calculus adapts to various data models while retaining a precise type checking that can exploit in a flexible way limited type information, information group (depts -> filter each x (x.size > 50)) by g = $.depid as ds, (SELECT * FROM employees WHERE income > 100) by g = $.dept as es into { dept: g, deptName: ds[0].name, numEmps: count(es) }; The query blends Jaql expressions (eg, filter which selects, in the collection depts, departments with a size of more than 50 employees, and the grouping itself) with a SQL statement (selecting employees in a relational table for which the salary is more than 100). Relations are naturally rendered in JSON as collections of records. In our example, one of the key difference is that field access in SQL requires the field to be present in the record, while the same operation in Jaql does not. Actually, field selection in Jaql is very expressive since it can be applied also to collections with the effect that the selection is recursively applied to the components of the collection and the collection of the results returned, and similarly for filter and other iterators. In other words, the expression An extended abstract of this work is included in the proceeding of POPL 13, 40th ACM Symposium on Principles of Programming Languages, ACM Press, 2013. 1 2013/3/8 filter each x (x.size > 50) above will work as much when x is bound to a record (with or without a size field: in the latter case the selection returns null), as when x is bound to a collection of records or of arbitrary nested collections thereof. This accounts for the semistructured nature of JSON compared to the relational model. Our calculus can express both, in a way that illustrates the difference in both the dynamic semantics and static typing. In our calculus, the selection of all records whose mandatory field income is greater than 100 is defined as: let Sel = ‘nil => ‘nil | ({income: x, .. } as y , tail) => if x > 100 then (y,Sel(tail)) else Sel(tail) (collections are encoded as lists à la Lisp) while the filtering among records or arbitrary nested collections of records of those where the (optional) size field is present and larger than 50 is: let Fil = ‘nil => ‘nil | ({size: x, .. } as y,tail) => if x > 50 then (y,Fil(tail)) else Fil(tail) | ((x,xs),tail) => (Fil(x,xs),Fil(tail)) | (_,tail) => Fil(tail) The terms above show nearly all the basic building blocks of our calculus (only composition is missing), building blocks that we dub filters. Filters can be defined recursively (eg, Sel(tail) is a recursive call); they can perform pattern matching as found in functional languages (the filter p ⇒ f executes f in the environment resulting from the matching of pattern p); they can be composed in alternation (f1| f2 tries to apply f1 and if it fails it applies f2 ), they can spread over the structure of their argument (eg, ( f1 ,f2) —of which (x,Sel(tail)) is an instance— requires an argument of a product type and applies the corresponding fi component-wise). For instance, the filter Fil scans collections encoded as lists à la Lisp (ie, by right associative pairs with ‘nil denoting the empty list). If its argument is the empty list, then it returns the empty list; if it is a list whose head is a record with a size field (and possibly other fields matched by “. .”), then it captures the whole record in y, the content of the field in x, the tail of the list in tail, and keeps or discards y (ie, the record) according to whether x (ie, the field) is larger than 50; if the head is also a list, then it recursively applies both on the head and on the tail; if the head of the list is neither a list, nor a record with a size field, then the head is discarded. The encoding of the whole grouping query is given in Section 5.3. Our aim is not to propose yet another “NoSQL/cloud computing/bigdata analytics” query language, but rather to show how to express and type such languages via an encoding into our core calculus. Each such language can in this way preserve its execution model but obtain for free a formal semantics, a type inference system and, as it happens, a prototype implementation. The type information is deduced via the encoding (without the need of any type annotation) and can be used for early error detection and debugging purposes. The encoding also yields an executable system that can be used for rapid prototyping. Both possibilities are critical in most typical usage scenarios of these languages, where deployment is very expensive both in time and in resources. As observed by Meijer [21] the advent of big data makes it more important than ever for programmers (and, we add, for language and system designers) to have a single abstraction that allows them to process, transform, query, analyze, and compute across data presenting utter variability both in volume and in structure, yielding a “mind-blowing number of new data models, query languages, and execution fabrics” [21] . The framework we present here, we claim, encompasses them all. A long-term goal is that the compilers of these languages could use the type information inferred from the encoding and the encoding itself to devise further optimizations. Types. Pig [28], Jaql [18, 29], AQL [3] have all been conceived by considering just the map-reduce execution model. The type (or, schema) of the manipulated data did not play any role in their design. As a consequence these languages are untyped and, when present, types are optional and clearly added as an afterthought. Differences in data model or type discipline are particularly important when embedded in a host language (since they yield the so-called impedance mismatch). The reason why types were/are disregarded in such languages may originate in an alleged tension between type inference and heterogeneous/semistructured data: on the one hand these languages are conceived to work with collections of data that are weakly or partially structured, on the other hand current languages with type inference (such as Haskell or ML) can work only on homogeneous collections (typically, lists of elements of the same type). In this work we show that the two visions can coexist: we type data by semantic subtyping [16], a type system conceived for semistructured data, and describe computations by our filters which are untyped combinators that, thanks to a technique of weak typing introduced in [9], can polymorphically type the results of data query and processing with a high degree of precision. The conception of filters is driven by the schema of the data rather than the execution model and we use them (i) to capture and give a uniform semantics to a wide range of semi structured data processing capabilities, (ii) to give a type system that encompasses the types defined for such languages, if any, notably Pig, Jaql and AQL (but also XML query and processing languages: see Section 5.3), (iii) to infer the precise result types of queries written in these languages as they are (so without the addition of any explicit type annotation/definition or new construct), and (iv) to show how minimal extensions/modifications of the current syntax of these languages can bring dramatic improvements in the precision of the inferred types. The types we propose here are extensible record types and heterogeneous lists whose content is described by regular expressions on types as defined by the following grammar: Types t ::= | | | | | | | v { ℓ:t, . . . , ℓ:t}} { ℓ:t, . . . , ℓ:t , .. ..}} [r] int | char any | empty | null t||t \t t\ Regexp r ::= ε | t | r* | r+ | r? | r r | r||r (singleton) (closed record) (open record) (sequences) (base) (special) (union) (difference) where ε denotes the empty word. The semantics of types can be expressed in terms of sets of values (values are either constants —such as 1, 2, true, false, null, ’1’, the latter denoting the character 1—, records of values, or lists of values). So the singleton type v is the type that contains just the value v (in particular null is the singleton type containing the value null). The closed record type { a:int, b:int}} contains all record values with exactly two fields a and b with integer values, while the open record type { a:int, b:int , .. ..}} contains all record values with at least two fields a and b with integer values. The sequence type [r] is the set of all sequences whose content is described by the regular expression r; so, for example [char*] contains all sequences of characters (we will use string to denote this type and the standard double quote notation to denote its values) while [({{a:int}} { a:int}} )+] For the sake of precision, to comply with Jaql’s semantics the last pattern should rather be ({..},tail) => Fil(tail): since field selection e.size fails whenever e is not a record or a list, this definition would detect the possibility of this failure by a static type error. 2 2013/3/8 denotes nonempty lists of even length containing record values of type { a:int}}. The union type s||t contains all the values of s and \t contains all the values of s that of t, while the difference type s\ are not in t. We shall use bool as an abbreviation of the union of the two singleton types containing true and false: ‘true|| ‘false. any and empty respectively contain all and no values. Recursive type definitions are also used (see Section 2.2 for formal details). These types can express all the types of Pig, Jaql and AQL, all XML types, and much more. So for instance, AQL includes only homogeneous lists of type t, that can be expressed by our types as [ t* ]. In Jaql’s documentation one can find the type [ long(value=1), string(value="a"), boolean* ] which is the type of arrays whose first element is 1, the second is the string "a" and all the other are booleans. This can be easily expressed in our types as [1 "a" bool*]. But while Jaql only allows a limited use of regular expressions (Kleene star can only appear in tail position) our types do not have such restrictions. So for example [char* ’@’ char* ’.’ ((’f’ ’r’)|(’i’ ’t’))] is the type of all strings (ie, sequences of chars) that denote email addresses ending by either .fr or .it. We use some syntactic sugar to make terms as the previous one more readable (eg, [ .* ’@’ .* (’.fr’|’.it’)]). Likewise, henceforth we use { a?:t}} to denote that the field a of type t is optional; this is just syntactic sugar for stating that either the field is undefined or it contains a value of type t (for the formal definition see Appendix G). Coming back to our initial example, the filter Fil defined before expects as argument a collection of the following type: former and limited forms of the latter); finally, it includes first-class arbitrary deep composition (while most languages offer this operator only at top level), whose power is nevertheless restrained by the type system. An important contribution of this work is that it directly compares a programming language approach with the tree transducer one. Our calculus implements transformations typical of top-down tree transducers but has several advantages over the transducer approach: (1) the transformations are expressed in a formalism immediately intelligible to any functional programmer; (2) our calculus, in its untyped version, is Turing complete; (3) its transformations can be statically typed (at the expenses of Turing completeness) without any annotation yielding precise result types (4) even if we restrict the calculus only to well-typed terms (thus losing Turing completeness), it still is strictly more expressive than wellknown and widely studied deterministic top-down tree transducer formalisms. The technical contributions are (i) the proof of Turing completeness for our formalism, (ii) the definition of a type system that copes with records with computable labels (iii) the definition of a static type system for filters and its correctness, (iv) the definition of a static analysis that ensures the termination (and the proof thereof) of the type inference algorithm with complexity bounds expressed in the size of types and filters and (iv) the proof that the terms that pass the static analysis form a language strictly more expressive than top-down tree transducers. Outline. In Section 2 we present the syntax of the three components of our system. Namely, a minimal set of expressions, the calculus of filters used to program user-defined operators or to encode the operators of other languages, and the core types in which the types we just presented are to be encoded. Section 3 defines the operational semantics of filters and a declarative semantics for operators. The type system as well as the type inference algorithm are described in Section 4. In Section 5 we present how to handle a large subset of Jaql. Section 8 reports on some subtler design choices of our system. We compare related works in Section 9 and conclude in Section 10. In order to avoid blurring the presentation, proofs, secondary results, further encodings, and extensions are moved into a separate appendix. type Depts = [ ( {size?: int, ..} | Depts )* ] that is a, possibly empty, arbitrary nested list of records with an optional size field of type int: notice that it is important to specify the optional field and its type since a size field of a different type would make the expression x > 50 raise a run-time error. This information is deduced just from the structure of the filter (since Fil does not contain any type definition or annotation). We define a type inference system that rejects any argument of Fil that has not type Depts, and deduces for arguments of type [({size: int, addr: string}| {sec: int} | Depts)+] (which is a subtype of Depts) the result type [({size: int, addr: string}|Depts)*] (so it does not forget the field addr but discards the field sec, and by replacing * for + recognizes that the test may fail). By encoding primitive Jaql operations into a formal core calculus we shall provide them a formal and clean semantics as well as precise typing. So for instance it will be clear that applying the following dot selection [ [{a:3}] {a:5, b:true} ].a the result will be [ [3] 5 ] and we shall be able to deduce that _.a applied to arbitrary nested lists of records with an optional integer a field (ie, of type t = { a?:int}} | [ t * ] ) yields arbitrary nested lists of int or null values (ie, of type u = int | null | [ u * ]). Finally we shall show that if we accept to extend the current syntax of Jaql (or of some other language) by some minimal filter syntax (eg, the pattern filter) we can obtain a huge improvement in the precision of type inference. 2. Syntax In this section we present the syntax of the three components of our system: a minimal set of expressions, the calculus of filters used to program user-defined operators or to encode the operators of other languages, and the core types in which the types presented in the introduction are to be encoded. The core of our work is the definition of filters and types. The key property of our development is that filters can be grafted to any host language that satisfies minimal requirements, by simply adding filter application to the expressions of the host language. The minimal requirements of the host language for this to be possible are quite simple: it must have constants (typically for types int, char, string, and bool), variables, and either pairs or record values (not necessarily both). On the static side the host language must have at least basic and products types and be able to assign a type to expressions in a given type environment (ie, under some typing assumptions for variables). By the addition of filter applications, the host language can acquire or increase the capability to define polymorphic user-defined iterators, query and processing expressions, and be enriched with a powerful and precise type system. Contributions. The main contribution of this work is the definition of a calculus that encompasses structural operators scattered over NoSQL languages and that possesses some characteristics that make it unique in the swarm of current semi-structured data processing languages. In particular it is parametric (though fully embeddable) in a host language; it uniformly handles both width and deep nested data recursion (while most languages offer just the 2.1 Expressions The only exception are the “bags” types we did not include in order to focus on essential features. In this work we consider the following set of expressions 3 2013/3/8 Definition 1 (expressions). Exprs e ::= c (constants) | x (variables) | (e, e) (pairs) | {e:e, ..., e:e} (records) | e+e (record concatenation) | e\ℓ (field deletion) | op(e, ..., e) (built-in operators) | fe (filter application) where f ranges over filters (defined later on), c over generic constants, and ℓ over string constants. Record types come in two flavors: closed record types whose values are records with exactly the fields specified by the type, and open record types whose values are records with at least the fields specified by the type. Product types are standard and we have a complete set of type connectives, that is, finite unions, intersections and negations. We use empty, to denote the type that has no values and any for the type of all values (sometimes denoted by “_” when used in patterns). We added a term for recursive types, which allows us to encode both the regular expression types defined in the introduction and, more generally, the recursive type definitions we used there. Finally, we use Op (capitalized to distinguish it from expression operators) to denote the host language’s type operators (if any). Thus, when filter applications return values whose type belongs just to the foreign language (eg, a list of functions) we suppose the typing of these functions be given by some type operators. For instance, if succ is a user defined successor function, we will suppose to be given its type in the form Arrow(int,int) and, similarly, for its application, say apply(succ,3) we will be given the type of this expression (presumably int). Here Arrow is a type operator and apply an expression operator. The denotational semantics of types as sets of values, that we informally described in the introduction, is at the basis of the definition of the subtyping relation for these types. We say that a type t1 is a subtype of a type t2 , noted t1 ≤ t2 , if and only if the set of values denoted by t1 is contained (in the set-theoretic sense) in the set of values denoted by t2 . For the formal definition and the decision procedure of this subtyping relation the reader can refer to the work on semantic subtyping [16]. Intuitively, these expressions represent the syntax supplied by the host language —though only the first two and one of the next two are really needed— that we extend with (the missing expressions and) the expression of filter application. Expressions are formed by constants, variables, pairs, records, and operation on records: record concatenation gives priority to the expression on the right. So if in r1 + r2 both records contains a field with the same label, it is the one in r2 that will be taken, while field deletion does not require the record to contain a field with the given label (though this point is not important). The metavariable op ranges over operators as well as functions and other constructions belonging to or defined by the host language. Among expressions we single out a set of values, intuitively the results of computations, that are formally defined as follows: v ::= c | (v, v) | {ℓ:v; . . . ; ℓ:v} We use "foo" for character string constants, ’c’ for characters, 1 2 3 4 5 and so on for integers, and backquoted words, such as ‘foo, for atoms (ie, user-defined constants). We use three distinguished atoms ‘nil, ‘true, and ‘false. Double quotes can be omitted for strings that are labels of record fields: thus we write {name:"John"} rather than {"name":"John"}. Sequences (aka, heterogeneous lists, ordered collections, arrays) are encoded à la LISP, as nested pairs where the atom ‘nil denotes the empty list. We use [e1 . . . en ] as syntactic sugar for (e1 , . . . , (en , ‘nil)...). 2.3 Patterns Filters are our core untyped operators. All they can do are three different things: (1) they can structurally decompose and transform the values they are applied to, or (2) they can be sequentially composed, or (3) they can do pattern matching. In order to define filters, thus, we first need to define patterns. Definition 3 (patterns). Patterns 2.2 Types Expressions, in particular filter applications, are typed by the following set of types (typically only basic, product, recursive and —some form of— record types will be provided by the host language): Definition 2 (types). Types t ::= | | | | | | | | | | | | p ::= | | | | | | t (type) x (variable) ( p,,p)) (pair) { ℓ:p, . . . , ℓ:p}} (closed rec) { ℓ:p, . . . , ℓ:p , .. ..}} (open rec) p||p (or/union) &p p& (and/intersection) where the subpatterns forming pairs, records, and intersections have distinct capture variables, and those forming unions have the same capture variables. b (basic types) v (singleton types) ( t,,t)) (products) { ℓ:t, . . . , ℓ:t}} (closed records) { ℓ:t, . . . , ℓ:t , .. ..}} (open records) t||t (union types) &t t& (intersection types) ¬t (negation type) empty (empty type) any (any type) µT.t (recursive types) T (recursion variable) Op(t, ..., t) (foreign type calls) Patterns are essentially types in which capture variables (ranged over by x, y, . . . ) may occur in every position that is not under a negation or a recursion. A pattern is used to match a value. The matching of a value v against a pattern p, noted v/p, either fails (noted Ω) or it returns a substitution from the variables occurring in the pattern, into values. The substitution is then used as an environment in which some expression is evaluated. If the pattern is a type, then the matching fails if and only if the pattern is matched against a value that does not have that type, otherwise it returns the empty substitution. If it is a variable, then the matching always succeeds and returns the substitution that assigns the matched value to the variable. The pair pattern ( p1, p2) succeeds if and only if it is matched against a pair of values and each sub-pattern succeeds on the corresponding projection of the value (the union of the two substitutions is then returned). Both record patterns are similar to the product pattern with the specificity that in the open record pattern “..” matches all the fields that are not specified in the where every recursion is guarded, that is, every type variable is separated from its binder by at least one application of a type constructor (ie, products, records, or Op). Most of these types were already explained in the introduction. We have basic types (int, bool, ....) ranged over by b and singleton types v denoting the type that contains only the value v. 4 2013/3/8 pattern. An intersection pattern p1& p2 succeeds if and only if both patterns succeed (the union of the two substitutions is then returned). The union pattern p1| p2 first tries to match the pattern p1 and if it fails it tries the pattern p2 . & x,,y)) succeeds only if the For instance, the pattern ( int& matched value is a pair of values (v1 , v2 ) in which v1 is an integer —in which case it returns the substitution {x/v1 , y/v2 }— and fails otherwise. Finally notice that the notation “p as x” we &x. used in the examples of the introduction, is syntactic sugar for p& This informal semantics of matching (see [16] for the formal definition) explains the reasons of the restrictions on capture variables in Definition 3: in intersections, pairs, and records all patterns must be matched and, thus, they have to assign distinct variables, while in union patterns just one pattern will be matched, hence the same set of variables must be assigned, whichever alternative is selected. The strength of patterns is their connections with types and the fact that the pattern matching operator can be typed exactly. This is entailed by the following theorems (both proved in [16]): The expression filter e always returns the value corresponding to the evaluation of e (and discards its argument). The filter p ⇒ f applies the filter f to its argument in the environment obtained by matching the argument against p (provided that the matching does not fail). This rather powerful feature allows a filter to perform two critical actions: (i) inspect an input with regular pattern-matching before exploring it and (ii) capture part of the input that can be reused during the evaluation of the subfilter f . If the argument application of fi to vi returns vi′ then the application of the product filter ( f1 ,f2) to an argument (v1 , v2 ) returns (v1′ , v2′ ); otherwise, if any application fails or if the argument is not a pair, it fails. The record filter is similar: it applies to each specified field the corresponding filter and, as stressed by the “. .”, leaves the other fields unchanged; it fails if any of the applications does, or if any of the specified fields is absent, or if the argument is not a record. The filter f1| f2 returns the application of f1 to its argument or, if this fails, the application of f2 . The semantics of a recursive filter is given by standard unfolding of its definition in recursive calls. The only real restriction that we introduce for filters is that recursive calls can be done only on arguments of a given form (ie, on arguments that have the form of values where variables may occur). This restriction in practice amounts to forbid recursive calls on the result of another recursively defined filter (all other cases can be easily encoded). The reason of this restriction is technical, since it greatly simplifies the analysis of Section 4.5 (which ensures the termination of type inference) without hampering expressiveness: filters are Turing complete even with this restriction (see Theorem 7). Filters can be composed: the filter f1 ;f2 applies f2 to the result of applying f1 to the argument and fails if any of the two does. The condition that in every subterm of the form f ;g, f does not contain free recursion variables is not strictly necessary. Indeed, we could allow such terms. The point is that the analysis for the termination of the typing would then reject all such terms (apart from trivial ones in which the result of the recursive call is not used in the composition). But since this restriction does not restrict the expressiveness of the calculus (Theorem 7 proves Turing completeness with this restriction), then the addition of this restriction is just a design (rather than a technical) choice: we prefer to forbid the programmer to write recursive calls on the left-hand side of a composition, than systematically reject all the programs that use them in a non-trivial way. Finally, we singled out some specific filters (specifically, we chose groupby and orderby ) whose semantics is generally specified in a declarative rather than operational way. These do not bring any expressive power to the calculus (the proof of Turing completeness, Theorem 7, does not use these declarative operators) and actually they can be encoded by the remaining filters, but it is interesting to single them out because they yield either simpler encodings or more precise typing. Theorem 4 (Accepted type [16]). For every pattern p, the set of all values v such that v/p 6= Ω is a type. We call this set the accepted type of p and note it by *p+. The fact that the exact set of values for which a matching succeeds is a type is not obvious. It states that for every pattern p there exists a syntactic type produced by the grammar in Definition 2 whose semantics is exactly the set of all and only values that are matched by p. The existence of this syntactic type, which we note *p+, is of utmost importance for a precise typing of pattern matching. In particular, given a pattern p and a type t contained in (ie, subtype of) *p+, it allows us to compute the exact type of the capture variables of p when it is matched against a value in t: Theorem 5 (Type environment [16]). There exists an algorithm that for every pattern p, and t ≤ *p+ returns a type environment t/p ∈ Vars(p) → Types such that (t/p)(x) = {(v/p)(x) | v : t}. 2.4 Filters Definition 6 (filters). A filter is a term generated by: Filters f ::= | | | | | | | | e (expression) p⇒ f (pattern) ( f ,f)) (product) { ℓ:f, . . . , ℓ:f , ..}} (record) f|| f (union) µ X..f (recursion) Xa (recursive call) f ;f (composition) o (declarative operators) Operators o ::= | groupby f orderby f Arguments a ::= | | | x c ( a,a)) { ℓ:a, ..., ℓ:a}} (filter grouping) (filter ordering) 3. Semantics The operational semantics of our calculus is given by the reduction semantics for filter application and for the record operations. Since the former is the only novelty of our work, we save space and omit the latter, which are standard anyhow. (variables) (constants) (pairs) (record) 3.1 Big step semantics such that for every subterm of the form f ;g, no recursion variable is free inf . We define a big step operational semantics for filters. The definition is given by the inference rules in Figure 1 for judgements of the form δ;γ ⊢eval f (a) r and describes how the evaluation of the application of filter f to an argument a in an environment γ yields an object r where r is either a value or Ω. The latter is a special value which represents a runtime error: it is raised by the rule (error) either because a filter did not match the form of its argument (eg, the argument of a filter product was not a pair) Filters are like transducers, that when applied to a value return another value. However, unlike transducers they possess more “programming-oriented” constructs, like the ability to test an input and capture subterms, recompose an intermediary result from captured values and a composition operator. We first describe informally the semantics of each construct. 5 2013/3/8 δ;γ ⊢eval f1 (v) r1 δ;γ ⊢eval (f1| f2 )(v) r1 (union1) (expr) δ;γ ⊢eval e(v) r = eval(γ, e) r (prod) δ;γ ⊢eval f1 (v1 ) r1 δ;γ ⊢eval f2 (v2 ) δ;γ ⊢eval ( f1 ,f2) (v1 , v2 ) (r1 , r2 ) (patt) δ;γ , v/p ⊢eval f (v) δ;γ ⊢eval (p ⇒ f )(v) (comp) r2 δ;γ ⊢eval f1 (v) Ω δ;γ ⊢eval f2 (v) δ;γ ⊢eval (f1| f2 )(v) r2 (rec) r r δ;γ ⊢eval f1 (v) r1 δ;γ ⊢eval f2 (r1 ) δ;γ ⊢eval (f1 ;f2 )(v) r2 (union2) if r1 = 6 Ω and r2 = 6 Ω if v/p 6= Ω r2 r2 δ, (X → 7 f );γ ⊢eval f (v) r µ X..f )(v) δ;γ ⊢eval (µ r (rec-call) if r1 6= Ω δ;γ ⊢eval (δ(X))(a) δ;γ ⊢eval (Xa)(v) (error) (recd) if r1 6= Ω δ;γ ⊢eval f (a) r r Ω δ;γ ⊢eval f1 (v1 ) r1 ··· δ;γ ⊢eval fn (vn ) rn }({ { ℓ1 :v1 , ..., ℓn :vn , ..., ℓn+k :vn+k } ) δ;γ ⊢eval { ℓ1 :f1 , ..., ℓn :fn , ..} { ℓ1 :r1 , ..., ℓn :rn , ..., ℓn+k :vn+k } if no other rule applies if ∀i, ri 6= Ω Figure 1. Dynamic semantics of filters Proof (sketch). We can encode untyped call-by-value λ-calculus by first applying continuation passing style (CPS) transformations and encoding CPS term reduction rules and substitutions via filters. Thanks to CPS we eschew the restrictions on composition. or because some pattern matching failed (ie, the side condition of (patt) did not hold). Notice that the argument a of a filter is always a value v unless the filter is the unfolding of a recursive call, in which case variables may occurr in it (cf. rule rec-call). Environment δ is used to store the body of recursive definitions. The semantics of filters is quite straightforward and inspired by the semantics of patterns. The expression filter discards its input and evaluates (rather, asks the host language to evaluate) the expression e in the current environment (expr). It can be thought of as the right-hand side of a branch in a match_with construct. The product filter expects a pair as input, applies its sub-filters component-wise and returns the pair of the results (prod). This filter is used in particular to express sequence mapping, as the first component f1 transforms the element of the list and f2 is applied to the tail. In practice it is often the case that f2 is a recursive call that iterates on arbitrary lists and stops when the input is ‘nil. If the input is not a pair, then the filter fails (rule (error) applies). The record filter expects as input a record value with at least the same fields as those specified by the filter. It applies each sub-filter to the value in the corresponding field leaving the contents of other fields unchanged (recd). If the argument is not a record value or it does not contain all the fields specified by the record filter, or if the application of any subfilter fails, then the whole application of the record filter fails. The pattern filter matches its input value v against the pattern p. If the matching fails so the filter does, otherwise it evaluates its subfilter in the environment augmented by the substitution v/p (patt). The alternative filter follows a standard first-match policy: If the filter f1 succeeds, then its result is returned (union-1). If f1 fails, then f2 is evaluated against the input value (union-2). This filter is particularly useful to write the alternative of two (or more) pattern filters, making it possible to conditionally continue a computation based on the shape of the input. The composition allows us to pass the result of f1 as input to f2 . The composition filter is of paramount importance. Indeed, without it, our only way to iterate (deconstruct) an input value is to use a product filter, which always rebuilds a pair as result. Finally, a recursive filter is evaluated by recording its body in δ and evaluating it (rec), while for a recursive call we replace the recursion variable by its definition (rec-call). This concludes the presentation of the semantics of nondeclarative filters (ie, without groupby and orderby). These form a Turing complete formalism (full proof in Appendix B): 3.2 Semantics of declarative filters To conclude the presentation of the semantics we have to define the semantics of groupby and orderby. We prefer to give the semantics in a declarative form rather than operationally in order not to tie it to a particular order (of keys or of the execution): Groupby: groupby f applied to a sequence [v1 . . . vm ] reduces to a sequence [ (k1 , l1 ) . . . (kn , ln ) ] such that: 1. ∀i, 1 ≤ i ≤ m, ∃j, 1 ≤ j ≤ n, s.t. kj = f (vi ) 2. ∀j, 1 ≤ j ≤ n, ∃i, 1 ≤ i ≤ m, s.t. kj = f (vi ) 3. ∀j, 1 ≤ j ≤ n, lj is a sequence: [ v1j . . . vnj j ] 4. ∀j, 1 ≤ j ≤ n, ∀k, 1 ≤ k ≤ nj , f (vkj ) = kj 5. ki = kj ⇒ i = j 6. l1 , . . . , ln is a partition of [v1 . . . vm ] Orderby: orderby f applied to [v1 . . . vn ] reduces to [v1′ . . . vn′ ] such that: 1. [v1′ . . . vn′ ] is a permutation of [v1 . . . vn ], 2. ∀i, j s.t. 1 ≤ i ≤ j ≤ n, f (vi ) ≤ f (vj ) Since the semantics of both operators is deeply connected to a notion of equality and order on values of the host language, we give them as “built-in” operations. However we will illustrate how our type algebra allows us to provide very precise typing rules, specialized for their particular semantics. It is also possible to encode co-grouping (or groupby on several input sequences) with a combination of groupby and filters (cf. Appendix H). 3.3 Syntactic sugar Now that we have formally defined the semantics of filters we can use them to introduce some syntactic sugar. Expressions. The reader may have noticed that the productions for expressions (Definition 1) do not define any destructor (eg, projections, label selection, . . . ), just constructors. The reason is that destructors, as well as other common expressions, can be encoded by filter applications: e.ℓ fst(e) snd(e) let p = e1 in e2 if e then e1 else e2 Theorem 7 (Turing completeness). The language formed by constants, variables, pairs, equality, and applications of nondeclarative filters is Turing complete. 6 def = def = def = def = def = ({{ℓ:x , .. ..}} ⇒ x)e (((x,,any)) ⇒ x)e (((any,,x)) ⇒ x)e (p ⇒ e2 )e1 (‘true ⇒ e1| ‘false ⇒ e2 )e 2013/3/8 match e with p1 ⇒ e1 |...|pn ⇒ en def = (p1 ⇒ e1| . . . | pn ⇒ en )e whether the type t1 of e1 is finite (ie, it contains only finitely many values, such as, say, Bool) or not. If a type is finite, (finiteness of regular types seen as tree automata can be decided in polynomial time [10]), then it is possible to write it as a finite union of values (actually, of singleton types). So consider again { e1 :e2} and let t1 be the type of e1 and t2 the type of e2 . First, t1 must be a subtype of string (since record labels are strings). So if t1 is finite it can be expressed as ℓ1| · · · | ℓn which means that e1 will return the string ℓi for some i ∈ [1..n]. Therefore { e1 :e2} will have type { ℓi : t2} for some i ∈ [1..n] and, thus, the union of all these types, as expressed by the rule [R CD -F IN ] below. If t1 is infinite instead, then all we can say is that it will be a record with some (unknown) labels, as expressed by rule [R CD -I NF ]. These are just a possible choice, but others are possible. For instance in Jaql dot selection is overloaded: when _.ℓ is applied to a record, Jaql returns the content of its ℓ field; if the field is absent or the argument is null, then Jaql returns null and fails if the argument is not a record; when applied to a list (‘array’ in Jaql terminology) it recursively applies to all the elements of the list. So Jaql’s “_.ℓ” is precisely defined as µX..({{ ℓ:x , .. ..}} ⇒ x | ({{..}}|null) ⇒ null | (h,,t)) ⇒ (Xh,Xt )) Besides the syntactic sugar above, in the next section we will use t1 + t2 to denote the record type formed by all field types in t2 and all the field types in t1 whose label is not already present in t2 . Similarly t \ ℓ will denote the record types formed by all field types in t apart from the one labelled by ℓ, if present. Finally, we will also use for expressions, types, and patterns the syntactic sugar for lists used in the introduction. So, for instance, [p1 p2 ... pn ] is matched by lists of n elements provided that their i-th element matches pi . [R CD -F IN ] Γ ⊢ e : ℓ1| · · · | ℓn Γ ⊢ {e:e } : { ℓ1 :t}}| · · · |{ ℓn :t}} [R CD -I NF ] Γ⊢e:t Γ ⊢ e′ : t′ ′ Γ ⊢ {e:e } : { ..}} 4. Type inference Γ ⊢ {e1 :e′1 } : t1 Γ⊢c:c Γ ⊢ {en :e′n } : tn [R CD -D EL ] [R CD -C ONC ] Variables, constants, and pairs are straightforwardly typed by Γ ⊢ x : Γ(x) ··· Γ ⊢ {e1 :e′1 , . . . , en :e′n } : t1 + · · · + tn 4.1 Typing of simple and foreign expressions [C ONSTANT ] t ≤ string t is infinite [R CD -M UL ] In this section we describe a type inference algorithm for our expressions. [VARS ] Γ ⊢ e′ : t ′ Γ ⊢ e1 : t1 Γ ⊢ e2 : t2 t1 ≤ { ..}} Γ ⊢ e1 + e2 : t1 + t2 t2 ≤ { ..}} [P ROD ] Γ ⊢ e1 : t1 Γ ⊢ e2 : t2 Γ ⊢ (e1 , e2 ) : ( t1, t2) Γ⊢e:t } t ≤ { ..} Γ ⊢e\ℓ: t\ℓ Records with multiple fields are handled by the rule [R CD -M UL ] which “merges” the result of typing single fields by using the type operator + as defined in CDuce [4, 15], which is a right-priority record concatenation defined to take into account undefined and unknown fields: for instance, { a:int, b:int}} + { a?:bool}} = { a:int||bool, b:int}} ; unknown fields in the right-hand side may override known fields of the left-hand side, which is why, for instance, we have { a:int, b:bool}} + { b:int , .. ..}} = { b:int , .. ..}} ; likewise, for every record type t (ie, for every t subtype of {..}}) we have t + { ..}} = { ..}}. Finally, [R CD -C ONC ] and [R CD -D EL ] deal with record concatenation and field deletion, respectively, in a straightforward way: the only constraint is that all expressions must have a record type (ie, the constraints of the form ... ≤ { ..}}). See Appendix G for formal definitions of all these type operators. Notice that these rules do not ensure that a record will not have two fields with the same label, which is a run-time error. Detecting such an error needs sophisticated type systems (eg, dependent types) beyond the scope of this work. This is why in the rule [R CD M UL ] we used type operator “+” which, in case of multiple occurring labels, since records are unordered, corresponds to randomly choosing one of the types bound to these labels: if such a field is selected, it would yield a run-time error, so its typing can be ambiguous. We can fine tune the rule [R CD -M UL ] so that when all the ti are finite unions of record types, then we require to have pairwise disjoint sets of labels; but since the problem would still persist for infinite types we prefer to retain the current, simpler formulation. where Γ denotes a typing environment that is a function from expression variables to types and c denotes both a constant and the singleton type containing the constant. Expressions of the host language are typed by the type function which given a type environment and a foreign expression returns the type of the expression, and that we suppose to be given for each host language. [F OREIGN ] Γ ⊢ e1 : t1 · · · Γ ⊢ en : tn Γ ⊢ op(e1 ,..., en ) : type((Γ, x1 :t1 , ..., xn :tn ), op(x1 ,..., xn )) Since the various ei can contain filter applications, thus unknown to the host language’s type system, the rule [F OREIGN ] swaps them with variables having the same type. Notice that our expressions, whereas they include filter applications, do not include applications of expressions to expressions. Therefore if the host language provides function definitions, then the applications of the host language must be dealt as foreign expressions, as well (cf. the expression operator apply in Section 2.2). 4.2 Typing of records The typing of records is novel and challenging because record expressions may contain string expressions in label position, such as in { e1 :e2} , while in all type systems for record we are aware of, labels are never computed. It is difficult to give a type to { e1 :e2} since, in general, we do not statically know the value that e1 will return, and which is required to form a record type. All we can (and must) ask is that this value will be a string. To type a record expression { e1 :e2} , thus, we distinguish two cases according to 4.3 Typing of filter application Filters are not first-class: they can be applied but not passed around or computed. Therefore we do not assign types to filters but, as for any other expression, we assign types to filter applications. The typing rule for filter application The function type must be able to handle type environments with types of our system. It can do it either by subsuming variable with specific types to the types of the host language (eg, if the host language does not support singleton types then the singleton type 3 will be subsumed to int) or by typing foreign expressions by using our types. [F ILTER -A PP ] Γ⊢e:t 7 Γ ;∅ ;∅ ⊢fil f (t) : s Γ ⊢ fe : s 2013/3/8 relies on an auxiliary deduction system for judgments of the form Γ ;∆ ;M ⊢fil f (t) : s that states that if in the environments Γ, ∆, M (explained later on) we apply the filter f to a value of type t, then it will return a result of type s. To define this auxiliary deduction system, which is the core of our type analysis, we first need to define *f +, the type accepted by a filter f . Intuitively, this type gives a necessary condition on the input for the filter not to fail: to define recursive types. In order to use them we need to define three different environments: Γ : Vars → Types denoting type environments that associate term variables with their types; ∆ : RVars → Filters denoting definition environments that associate each filter recursion variable with the body of its definition; M : RVars × Types → TVars denoting memoization environments which record that the call of a given recursive filter on a given type yielded the introduction of a fresh recursion type variable. Our typing rules, thus work on judgments of the form Γ ;∆ ;M ⊢ f (t) : t′ stating that applying f to an expression of type t in the environments Γ, ∆, M yields a result of type t′ . This judgment can be derived with the set of rules given in Figure 2. These rules are straightforward, when put side by side with the dynamic semantics of filters, given in Section 3. It is clear that this type system simulates at the level of types the computations that are carried out by filters on values at runtime. For instance, rule [F IL E XPR ] calls the typing function of the host language to determine the type of an expression e. Rule [F IL -P ROD ] applies a product filter recursively on the first and second projection for each member of the product decomposition of the input type and returns the union of all result types. Rule [F IL -R EC ] for records is similar, recursively applying sub-filters label-wise for each member of the record decomposition and returning the union of the resulting record types. As for the pattern filter (rule [F IL -PAT ]), its subfilter f is typed in the environment augmented by the mapping t/p of the input type against the pattern (cf. Theorem 5). The typing rule for the union filter, [F IL -U NION ] reflects the first match policy: when typing the second branch, we know that the first was not taken, hence that at runtime the filtered value will have a type that is in t but not in *f1 +. Notice that this is not ensured by the definition of accepted type — which is a rough approximation that discards grosser errors but, as we stressed right after its definition, is not sufficient to ensure that evaluation of f1 will not fail— but by the type system itself: the premises check that f1 (t1 ) is well-typed which, by induction, implies that f1 will never fail on values of type t1 and, ergo, that these values will never reach f2 . Also, we discard from the output type the contribution of the branches that cannot be taken, that is, branches whose accepted type have an empty intersection with the input type t. Composition (rule [F IL -C OMP ]) is straightforward. In this rule, the restriction that f1 is a filter with no open recursion variable ensures that its output type s is also a type without free recursion variables and, therefore, that we can use it as input type for f2 . The next three rules work together. The first, [F IL -F IX ] introduces for a recursive filter a fresh recursion variable for its output type. It also memoize in ∆ that the recursive filter X is associated with a body f and in M that for an input filter X and an input type t, the output type is the newly introduced recursive type variable. When dealing with a recursive call X two situations may arise. One possibility is that it is the first time the filter X is applied to the input type t. We therefore introduce a fresh type variable T and recurse, replacing X by its definition f . Otherwise, if the input type has already been encountered while typing the filter variable X, we can return its memoized type, a type variable T . Finally, Rule [F IL -O RD B Y ] and Rule [F IL -G RP B Y ] handle the special cases of groupby and orderby filters. Their typing is explained in the following section. Definition 8 (Accepted type). Given a filter f , the accepted type of f , written *f + is the set of values defined by: *e+ = any *Xa+ = any *p ⇒ f + = *p + & * f + µX.. f + *µ = *f + *f1| f2 + = *f1 + | * f2 + *groupby f + = [any*] *((f1 ,f2) + = ( * f1 + , * f2 + ) *orderby f + = [any*] *f1 ;f2 + = *f1 + *{{ ℓ1 :f1 ,.., ℓn :fn , ..}}+ = { ℓ1 : * f1 + ,.., ℓn : * f2 + , .. ..}} It is easy to show that an argument included in the accepted type is a necessary (but not sufficient, because of the cases for composition and recursion) condition for the evaluation of a filter not to fail: Lemma 9. Let f be a filter and v be a value such that v ∈ / *f +. For every γ, δ, if δ;γ ⊢eval f (v) r, then r ≡ Ω. The proof is a straightforward induction on the structure of the derivation, and is detailed in Appendix C. The last two auxiliary definitions we need are related to product and record types. In the presence of unions, the most general form for a product type is a finite union of products (since intersections distribute on products). For instance consider the type ( int,,int))|( string,,string)) This type denotes the set of pairs for which either both projections are int or both projections are string. A type such as (int||string,,int||string)) is less precise, since it also allows pairs whose first projection is an int and second projection is a string and vice versa. We see that it is necessary to manipulate finite unions of products (and similarly for records), and therefore, we introduce the following notations: Lemma 10 (Product decomposition). Let t ∈ Types such that t ≤ ( any,,any)). A product decomposition of t, denoted by π (t) is a set of types: n π (t) = {((t11, t12) , . . . , ( tn 1 , t2 ) } W such that t = ti ∈ππ (t) ti . For a given product decomposition, we say that n is the rank of t, noted rank(t), and use the notation π ji (t) for the type tji . There exist several suitable decompositions whose details are out of the scope of this paper. We refer the interested reader to [15] and [23] for practical algorithms that compute such decompositions for any subtype of ( any,,any)) or of {.. ..}}. These notions of decomposition, rank and projection can be generalized to records: Lemma 11 (Record decomposition). Let t ∈ Types such that t ≤ {..}} . A record decomposition of t, denoted by ρ(t) is a finite set of types ρ (t)={r1 , . . . , rn } where each ri is either of the form { ℓi1 :ti1 , . . . , ℓiniW :tini } or of the form { ℓi1 :ti1 , . . . , ℓini :tini , .. ..}} and such that t = ri ∈ρρ(t) ri . For a given record decomposition, we say that n is the rank of t, noted rank(t), and use the notation ρ jℓ (t) for the type of label ℓ in the j th component of ρ (t). 4.4 Typing of orderby and groupby While the “structural” filters enjoy simple, compositional typing rules, the ad-hoc operations orderby and groupby need specially crafted rules. Indeed it is well known that when transformation languages have the ability to compare data values type-checking (and also type inference) becomes undecidable (eg, see [1, 2]). We therefore provide two typing approximations that yield a good In our calculus we have three different sets of variables. The set Vars of term variables, ranged over by x, y, ..., introduced in patterns and used in expressions and in arguments of calls of recursive filters. The set RVars of term recursion variables, ranged over by X, Y, ... and that are used to define recursive filters. The set TVars of type recursion variables, ranged over by T, U, ... used 8 2013/3/8 [F IL -E XPR ] [F IL -PAT ] Γ ∪ t/p ;∆ ;M ⊢fil f (t) : s Γ ;∆ ;M ⊢fil p ⇒ f (t) : s Γ ;∆ ;M ⊢fil e(t) : type(Γ, e,) [F IL -P ROD ] i=1..rank(t), j=1, 2 t ≤ *p + & * f + π ij (t)) : sij Γ ;∆ ;M ⊢fil fj (π _ Γ ;∆ ;M ⊢fil ( f1 ,f2) (t) : ( si1, si2) i=1..rank(t) [F IL -R EC ] i=1..rank(t), j=1..m ρ iℓ (t)) : sij Γ ;∆ ;M ⊢fil fj (ρ j _ }(t) : } Γ ;∆ ;M ⊢fil { ℓ1:f1 , . . . , ℓm:fm , ..} { ℓ1:si1 , . . . , ℓm:sim , .. ..} [F IL -U NION ] i = 1, 2 Γ ;∆ ;M ⊢fil fi (ti ) : si _ Γ ;∆ ;M ⊢fil f1| f2 (t) : si {i|si 6=empty} i=1..rank(t) [F IL -C OMP ] Γ ;∆ ;M ⊢fil f1 (t) : s Γ ;∆ ;M ⊢fil f2 (s) : s′ [F IL -F IX ] Γ ;∆, (X 7→ f ) ;M, ((X, t) 7→ T ) ⊢fil f (t) : s Γ ;∆ ;M ⊢fil f1 ;f2 (t) : s′ µ X..f )(t) : µ T . s Γ ;∆ ;M ⊢fil (µ [F IL -C ALL -N EW ] Γ ;∆ ;M, ((X, t) 7→ T ) ⊢fil ∆(X)(t) : t′ [F IL -O RD B Y ] ∀ti ∈ item(t) Γ ;∆ ;M ⊢fil f (ti ) : si Γ ;∆ ;M ⊢fil (orderby f )(t) : OrderBy(t) T fresh [F IL -C ALL -M EM ] t = type(Γ, a) (X, t) 6∈ dom(M) T fresh Γ ;∆ ;M ⊢fil (Xa)(s) : µ T . t′ t ≤ *f1 + | * f2 + & * f1 + t1 = t& & ¬*f1 + t2 = t& Γ ;∆ ;M ⊢fil (Xa)(s) : M (X, t) t = type(Γ, a) (X, t) ∈ dom(M) [F IL -G RP B Y ] ∀ti ∈ item(t) Γ ;∆ ;M ⊢fil f (ti ) : si t ≤ [any*] W Γ ;∆ ;M ⊢fil (groupby f )(t) : [((( i si ),OrderBy(t))) *] t ≤ [any*] W isi is ordered Figure 2. Type inference algorithm for filter application compromise between precision and decidability. First we define an auxiliary function over sequence types: whose full proof is given in Appendix C. It is easy to write a filter for which the type inference algorithm, that is the deduction of ⊢fil , does not terminate: µX.. x ⇒ X((x,x)). The deduction of Γ ;∆ ;M ⊢fil f (t) : s simulates an (abstract) execution of the filter f on the type t. Since filters are Turing complete, then in general it is not possible to decide whether the deduction of ⊢fil for a given filter f will terminate for every input type t. For this reason we define a static analysis Check(f ) for filters that ensures that if f passes the analysis, then for every input type t the deduction of Γ ;∆ ;M ⊢fil f (t) : s terminates. For space reasons the formal definition of Check(f ) is relegated to Appendix A, but its behavior can be easily explained. Imagine that a recursive filter f is applied to some input type t. The algorithm tracks all the recursive calls occurring in f ; next it performs one step of reduction of each recursive call by unfolding the body; finally it checks in this unfolding that if a variable occurs in the argument of a recursive call, then it is bound to a type that is a subtree of the original type t. In other words, the analysis verifies that in the execution of the derivation for f (t) every call to s/p for some type s and pattern p always yields a type environment where variables used in recursive calls are bound to subtrees of t. This implies that the rule [F IL -C ALL - NEW ] will always memoize for a given X, types that are obtained from the arguments of the recursive calls of X by replacing their variables with a subtree of the original type t memoized by the rule [F IL -F IX ]. Since t is regular, then it has finitely many distinct subtrees, thus [F IL -C ALL -N EW ] can memoize only finitely many distinct types, and therefore the algorithm terminates. More precisely, the analysis proceeds in two passes. In the first pass the algorithm tracks all recursive filters and for each of them it (i) marks the variables that occur in the arguments of its recursive calls, (ii) assigns to each variable an abstract identifier representing the subtree of the input type to which the variable will be bound at the initial call of the filter, and (iii) it returns the set of all types obtained by replacing variables by the associated abstract identifier in each argument of a recursive call. The last set intuitively represents all the possible ways in which recursive calls can shuffle and recompose the subtrees forming the initial input type. The second phase of the analysis first abstractly reduces by one step each recursive filter by applying it on the set of types collected in the first phase of the analysis and then checks whether, after this reduction, all the variables marked in the first phase (ie, those that occur in arguments of recursive calls) are still bound to subtrees of the initial input type: if this checks fails, then the filter is rejected. Definition 12 (Item set). Let t ∈ Types such that t ≤ [any*]. The item set of t denoted by item(t) is defined by: item(empty) =∅ &( any,any))) item(t) item(t& _ 1 2 =[ item( ( ti , ti ) ) = ({t1i } ∪ item(t2i )) 1≤i≤rank(t) if t 6≤ ( any,any)) 1≤i≤rank(t) The first and second line in the definition ensure that item() returns the empty set for sequence types that are not products, namely for the empty sequence. The third line handles the case of non-empty sequence type. In this case t is a finite union of products, whose first components are the types of the “head” of the sequence and second components are recursively the types of the tails. Note also that this definition is well-founded. Since types are regular trees the number of distinct types accumulated by item() is finite. We can now defined typing rules for the orderby and groupby operators. orderby f : The orderby filter uses its argument filter f to compute a key from each element of the input sequence and then returns the same sequence of elements, sorted with respect to their key. Therefore, while the types of the elements in the result are still known, their order is lost. We use item() to compute the output type of an orderby application: _ OrderBy(t) = [( ti ) ∗ ] ti ∈item(t) groupby f : The typing of orderby can be used to give a rough approximation of the typing of groupby as stated by rule [F IL G RP B Y ]. In words, we obtain a list of pairs where the key component is the result type of f applied to the items of the sequence, and use OrderBy to shuffle the order of the list. A far more precise typing of groupby that keeps track of the relation between list elements and their images via f is given in Appendix E. 4.5 Soundness, termination, and complexity The soundness of the type inference system is given by the property of subject reduction for filter application Theorem 13 (subject reduction). If ∅ ;∅ ;∅ ⊢fil f (t) : s, then for all v : t, ∅;∅ ⊢eval f (v) r implies r : s. 9 2013/3/8 5. Jaql It is not difficult to see that the type inference algorithm converges if and only if for every input type there exists a integer n such that after n recursive calls the marked variables are bound only to subtrees of the initial input type (or to something that does not depend on it, of course). Since deciding whether such an n exists is not possible, our analysis checks whether for all possible input types a filter satisfies it for n=1, that is to say, that at every recursive call its marked variables satisfy the property; otherwise it rejects the filter. In this Section, we show how filters can be used to capture some popular languages for processing data on the Cloud. We consider Jaql [18], a query language for JSON developed by IBM. We give translation rules from a subset of Jaql into filters. Definition 15 (Jaql expressions). We use the following simplified grammar for Jaql (where we distinguish simple expressions, ranged over by e, from “core expressions” ranged over by k). Theorem 14 (Termination). If Check(f ), then for every type t the deduction of Γ ;∅ ;∅ ⊢fil f (t) : s is in 2-EXPTIME. Furthermore, if t is given as a non-deterministic tree automaton (NTA) then Γ ;∅ ;∅ ⊢fil f (t) : s is in EXPTIME, where the size of the problem is |f | × |t|. e ::= | | | | | | | k ::= | | | (for proofs see Appendix A for termination and Appendix D for complexity). This complexity result is in line with those of similar formalisms. For instance in [20], it is shown that type-checking non deterministic top-down tree transducers is in EXPTIME when the input and output types are given by a NTA. All filters defined in this paper (excepted those in Appendix B) pass the analysis. As an example consider the filter rotate that applied to a list returns the same list with the first element moved to the last position (and the empty list if applied to the empty list): µ X.. ( ( x,((y,z))) ⇒ ( y,X(( x,z))) | w ⇒ w ) The analysis succeeds on this filter. If we denote by ιx the abstract subtree bound to the variable x, then the recursive call will be executed on the abstract argument ( ιx ,ιz ) . So in the unfolding of the recursive call x is bound to ιx , whereas y and z are bound to two distinct subtrees of ιz . The variables in the recursive call, x and z, are thus bound to subtrees of the original tree (even though the argument of the recursive call is not a subtree of the original tree), therefore the filter is accepted . In order to appreciate the precision of the inference algorithm consider the type [int+ bool+], that is, the type of lists formed by some integers (at least one) followed by some booleans (at least one). For the application of rotate to an argument of this type our algorithm statically infers the most precise type, that is, [int* bool+ int]. If we apply it once more the inferred type is [int* bool+ int int]|[bool* int bool]. Generic filters are Turing complete. However, requiring that Check() holds —meaning that the filter is typeable by our system— restricts the expressive power of our filters by preventing them from recomposing a new value before doing a recursive call. For instance, it is not possible to typecheck a filter which reverses the elements of a sequence. Determining the exact class of transformations that typeable filters can express is challenging. However it is possible to show (cf. Appendix F) that typeable filters are strictly more expressive than top-down tree transducers with regular lookahead, a formalism for tree transformations introduced in [14]. The intuition about this result can be conveyed by and example. Consider the tree: a(u1 (. . . (un ()))v1 (. . . (vm ()))) that is, a tree whose root is labeled a with two children, each being a monadic tree of height n and m, respectively. Then it is not possible to write a top-down tree transducer with regular look-ahead that creates the tree a(u1 (. . . (un (v1 (. . . vm ()))))) which is just the concatenation of the two children of the root, seen as sequences, a transformation that can be easily programmed by typeable filters. The key difference in expressive power comes from the fact that filters are evaluated with an environment that binds capture variables to sub-trees of the input. This feature is essential to encode sequence concatenation and sequence flattening —two pervasive operations when dealing with sequences— that cannot be expressed by top-down tree transducers with regular look-ahead. c (constants) x (variables) $ (current value) [e,... , e] (arrays) { e:e,... , e:e } (records) e.l (field access) op(e,... ,e) (function call) e -> k (pipe) filter (each x )? e (filter) transform (each x)? e (transform) expand ((each x)? e)? (expand) group ((each x)? by x = e (as x)?)? into e (grouping) 5.1 Built-in filters In order to ease the presentation we extend our syntax by adding “filter definitions” (already informally used in the introduction) to filters and “filter calls” to expressions: e ::= let filter F [F1 , . . . , Fn ] = f in e f ::= F [f, . . . , f ] (filter defn.) (call) where F ranges over filter names. The mapping for most of the language we consider rely on the following built-in filters. let filter Filter [F ] = µ X.. ‘nil ⇒ ‘nil | (( x,, xs)), tl)) ⇒ ( X(x, xs),X(tl))) | ( x,,tl)) ⇒ F x ;(‘true ⇒ ( x, X(tl)))| ‘false ⇒ X(tl)) let filter Transform [F ] = µ X.. ‘nil ⇒ ‘nil | (( x,, xs)), tl)) ⇒ ( X(x, xs),X(tl))) | ( x,,tl)) ⇒ ( F x, X(tl))) let filter Expand = µ X.. ‘nil ⇒ ‘nil | ( ‘nil,,tl)) ⇒ X(tl) | (( x,, xs)), tl)) ⇒ ( x,X(xs, tl))) 5.2 Mapping Jaql expressions are mapped to our expressions as follows (where $ is a distinguished expression variable interpreting Jaql’s $ ): = c JcK JxK = x = $ J$ K J{e1 :e′1 ,...,en :e′n }K = { Je1 K :Je′1 K , ...,Jen K :Je′n K } Je.lK = JeK .l = op(Je1 K , ...,Jen K) Jop(e1 , ..., en )K J[e1 ,...,en ]K = (Je1 K , ...(Jen K , ‘nil)...) = JeK ;JkKF Je -> kK Jaql core expressions are mapped to filters as follows: 10 2013/3/8 Jfilter eKF = Jfilter each $ eKF Jfilter each x eKF = Filter [x ⇒ JeK ] = Jtransform each $ eKF Jtransform eKF Jtransform each x eKF = Transform [x ⇒ JeK ] = JexpandKF ;Jtransform each x eKF Jexpand each x eKF = Expand JexpandKF Jgroup into eKF = Jgroup by y=true into eKF Jgroup by y=e1 into e2 KF = Jgroup each $ by y=e1 into e2 KF Jgroup each x by y=e1 into e2 KF = Jgroup each x by y = e1 as $ into e2 KF Jgroup each x by y = e1 as g into e2 KF = groupby x ⇒ Je1 K ; Transform [((y,g)) ⇒ Je2 K ] This translation defines the (first, in our knowledge) formal semantics of Jaql. Such a translation is all that is needed to define the semantics of a NoSQL language and, as a bonus, endow it with the type inference system we described without requiring any modification of the original language. No further action is demanded since the machinery to exploit it is all developed in this work. As for typing, every Jaql expression is encoded into a filter for which type-checking is ensured to terminate: Check() holds for Filter[], Transform[], and Expand (provided it holds also for their arguments) since they only perform recursive calls on recombinations of subtrees of their input; by its definition, the encoding does not introduce any new recursion and, hence, it always yields a composition and application of filters for which Check() holds. Let us now illustrate how the above composition of filters is typed. Consider an instance where: • employees has type [ Remp* ], where Remp ≡ { dept: int, income:int, ..} • depts has type [ (Rdep | Rbranch)* ], where Rdep ≡ {depid:int, name: string, size: int} Rbranch ≡ {brid:int, name: string} (this type is a subtype of Dept as defined in the introduction) The global input type is therefore (line 1) [ [ Remp* ] [ (Rdep | Rbranch)* ] ] which becomes, after selection and filtering (line 2) [ [ Remp* ] [ Rdep* ] ] (note how all occurrences of Rbranch are ignored by Fil). Tagging with an integer (line 3) and flattening (line 4) yields [ (1,Remp)* (2,Rdep)* ] which illustrates the precise typing of products coupled with singleton types (ie, 1 instead of int). While the groupby (line 5) introduces an approximation the dependency between the tag and the corresponding type is kept [ (int, [ ((1,Remp) | (2,Rdep) )+ ]) * ] Lastly the transform is typed exactly, yielding the final type [ {dept:int, deptName:string|null, numEmps:int }* ] Note how null is retained in the output type (since there may be employees without a department, then Head may be applied to an empty list returning null, and the selection of name of null returns null). For instance suppose to pipe the Jaql grouping defined in the introduction into the following Jaql expression, in order to produce a printable representation of the records of the result 5.3 Examples To show how we use the encoding, let us encode the example of the introduction. For the sake of the concision we will use filter definitions (rather than expanding them in details). We use Fil and Sel defined in the introduction, Expand and Transform[] defined at the beginning of the section, the encoding of Jaql’s field selection as defined in Section 3.3, and finally Head that returns the first element of a sequence and a family of recursive filters Rgrpi with i ∈ N+ both defined below: transform each x ( (x.deptName)@":"@(to_string x.dep)@":"@(x.numEmps)) where @ denotes string concatenation and to_string is a conversion operator (from any type to string). The composition is ill-typed for three reasons: the field dept is misspelled as dep, x.numEmps is of type int (so it must be applied to to_string before concatenation), and the programmer did not account for the fact that the value stored in the field deptName may be null. The encoding produces the following lines to be appended to the previous code: let filter Head = ‘nil => null | (x,xs) => x let filter Rgrpi = ‘nil => ‘nil | ((i,x),tail) => (x , Rgrpi tail) | _ => Rgrpi tail Then, the query in the introduction is encoded as follows 1 2 3 4 5 6 7 8 9 10 11 [employees depts]; [Sel Fil]; [Transform[x =>(1,x)] Transform[x =>(2,x)]]; Expand; groupby ( (1,$)=>$.dept | (2,$)=>$.depid ); Transform[(g,l)=>( [(l; Rgrp1) (l; Rgrp2)]; [es ds] => { dept: g, deptName: (ds ; Head).name), numEmps: count(es) } )] 12 13 Transform[ x => (x.deptName)@":"@(to_string x.dep)@":"@(x.numEmps)] in which all the three errors are detected by our type system. A subtler example of error is given by the following alternative code Transform[ { dept : d, deptName: n&String, numEmps: e } => 14 n @ ":" @ (to_string d) @ ":" @ (to_string e) 15 | { deptName: null, .. } => "" 16 | _ => "Invalid department" ] 12 13 which corrects all the previous errors but adds a new one since, as detected by our type system, the last branch can be never selected. As we can see, our type-system ensures soundness, forcing the programmer to handle exceptional situations (as in the null example above) but is also precise enough to detect that some code paths can never be reached. In order to focus on our contributions we kept the language of types and filters simple. However there already exists several contributions on the types and expressions used here. Two in particular are worth mentioning in this context: recursive patterns and XML. Definition 3 defines patterns inductively but, alternatively, we can consider the (possibly infinite) regular trees coinductively generated by these productions and, on the lines of what is done in CDuce, use the recursive patterns so obtained to encode regular expressions patterns (see [4]). Although this does not enhance ex- In words, we perform the selection on employees and filter the departments (lines 1-2); we tag each element by 1 if it comes from employees, and by 2 if it comes from departments (line 3); we merge the two collections (line 4); we group the heterogeneous list according to the corresponding key (line 5); then for each element of the result of grouping we capture in g the key (line 6), split the group into employees and depts (line 7), capture each subgroup into the corresponding variable (ie, es and ds) (line 8) and return the expression specified in the query after the “into” (lines 8-10). The general definition of the encoding for the co-grouping is given in Appendix H. 11 2013/3/8 and this latter, with the syntactic sugar defined for CDuce, can be written as: pressiveness, it greatly improves the writing of programs since it makes it possible to capture distinct subsequences of a sequence by a single match. For instance, when a sequence is matched against a pattern such as [ (int as x | bool as y | _)* ], then x captures (the list of) all integer elements (capture variables in regular expression patterns are bound to lists), y captures all Boolean elements, while the remaining elements are ignored. By such patterns, co-grouping can be encoded without the Rgrp. For instance, the transform in lines 6-11 can be more compactly rendered as: 6 7 8 9 <product system="US-size">[ <number>[ 557 ] <name>[ Blouse ] ] Clearly in our system there are no restrictions in merging and nesting JSON and XML and no further extension is required to our system to define XML query and processing expressions. Just, the introduction of syntactic sugar to make the expressions readable, seems helpful: e ::= <e e>e f ::= <f f >f Transform[(g,[ ((1,es)|(2,ds))* ]) => { dept: g, deptName: (ds;Head).name, numEmps: count(es) }] For what concerns XML, the types used here were originally defined for XML, so it comes as a no surprise that they can seamlessly express XML types and values. For example CDuce uses the very same types used here to encode both XML types and elements as triples, the first element being the tag, the second a record representing attributes, and the third a heterogeneous sequence for the content of the element. Furthermore, we can adapt the results of [9] to encode forward XPath queries in filters. Therefore, it requires little effort to use the filters presented here to encode languages such as JSONiq [12] designed to integrate JSON and XML, or to precisely type regular expressions, the import/export of XML data, or XPath queries embedded in Jaql programs. This is shown in the section that follows. The system we introduced here is already able to reproduce (and type) the same transformations as in JSONiq, but without the restrictions and drawbacks of the latter (this is why we argue that it is better to extend NoSQL languages with XML primitives directly derived from our system rather than to use our system to encode JSONiq). For instance, the example given in the JSONiq draft to show how to render in Xhtml the following JSON data: { "col labels" : ["singular", "plural"], "row labels" : ["1p", "2p", "3p"], "data" : [ ["spinne", "spinnen"], ["spinnst", "spinnt"], ["spinnt", "spinnen"] ] 6. JSON, XML, Regex There exist various attempts to integrate JSON and XML. For instance JSONiq [12] is a query language designed to allow XML and JSON to be used in the same query. The motivation is that JSON and XML are both widely used for data interchange on the Internet. In many applications, JSON is replacing XML in Web Service APIs and data feeds, while more and more applications support both formats. More precisely, JSONiq embeds JSON into an XML query language (XQuery), but it does it in a stratified way: JSONiq does not allow XML nodes to contain JSON objects and arrays. The result is thus similar to OCamlDuce, the embedding of CDuce’s XML types and expressions into OCaml, with the same drawbacks. Our type system is derived from the type system of CDuce, whereas the theory of filters was originally designed to use CDuce as an host language. As a consequence XML types and expressions can be seamlessly integrated in the work presented here, without any particular restriction. To that end it suffices to use for XML elements and types the same encoding used in the implementation of CDuce, where an XML element is just a triple formed by a tag (here, an expression), a record (whose labels are the attributes of the element), and a sequence (of characters and or other XML elements) denoting its content. So for instance the following element } can be encoded in the filters presented in this work (with the new syntactic sugar) as: { "col labels" : cl , "row labels" : rl , "data" : dl } => <table border="1" cellpadding="1" cellspacing="2">[ <tr>[ <th>[ ] !(cl; Transform[ x -> <th>x ]) ] !(rl; Transform[ h -> <tr>[ <th>h !(dl; Transform[ x -> <td>x ]) ] ] ) ] (where ! expands a subsequence in the containing sequence). The resulting Xhtml document is rendered in a web browser as: <product system="US-size"> <number>557</number> <name>Blouse</name> </product> Similarly, Jaql built-in libraries include functions to convert and manipulate XML data. So for example as it is possible in Jaql to embed SQL queries, so it is possible to evaluate XPath expressions, by the function xpath() which takes two arguments, an XML document and a string containing an xpath expression—eg, xpath(read(seq(("conf/addrs.xml")) , "content/city") —. Filters can encode forward XPath expressions (see [23]) and precisely type them. So while in the current implementation there is no check of the type of the result of an external query (nor for is encoded by the following triple: ("product" , { system : "US-size" } , [ ("number" , {} , [ 557 ]) ("name", {}, "Blouse") ] ) 12 2013/3/8 tegers. An even greater precision can be obtained for grouping expressions when the generation of the key is performed by a filter that discriminates on types: the result type can keep a precise correspondence between keys and the corresponding groups. As an example consider the following (extended) Jaql grouping expression: XPath or for SQL) and the XML document is produced independently from Jaql, by encoding (forward) XPath into filters we can not only precisely type calls to Jaql’s xpath() function but also feed them with documents produced by Jaql expressions. Finally, the very same regular expressions types that are used to describe heterogeneous sequences and, in particular, the content of XML elements, can be used to type regular expressions. Functions working on regular expressions (regex for short) form, in practice, yet another domain specific language that is embedded in general purpose languages in an untyped or weakly typed (typically, every result is of type string) way. Recursive patterns can straightforwardly encode regexp matching. Therefore, by combining the pattern filter with other filters it is possible to encode any regexp library, with the important advantage that, as stated by Theorem 4, the set of values (respectively, strings) accepted by a pattern (respectively, by a regular expression), can be precisely computed and can be expressed by a type. So a function such as the built-in Jaql’s function regex_extract(), which extracts the substrings that match a given regex, can be easily implemented by filters and precisely typed by our typing rules. Typing will then amount to intersect the type of the string (which can be more precise than just string) with the type accepted by the pattern that encodes the regex at issue. group e by({town: ("Roma"|"Pisa"), ..} => "Italia" |{town: "Paris", ..} => "France" | _ => "?") if e has type [{town:string, addr:string}*], then the type inferred by our system for this groupby expression is [( ("Italia", [{town:"Roma"|"Pisa", addr:string}+]) |("France", [{town:"Paris", addr:string}+]) |("?", [{town:string/("Roma"|"Pisa"|"Paris"), addr:string}+]) )*] which precisely associates every key to the type of the elements it groups. Finally, in order to allow a modular usage of filters, adding just filter application to the expression of the foreign language does not suffice: parametric filter definitions are also needed. e ::= f e | let filter F [F1 , . . . , Fn ] = f in e 7. Programming with filters However, on the line of what we already said about the disruption of the execution model, recursive parametric filter definitions should be probably disallowed, since a compilation according to a mapreduce model would require to disentangle recursive calls. Up to now we have used the filters to encode operators hardcoded in some languages in order to type them. Of course, it is possible to embed the typing technology we introduced directly into the compilers of these language so as to obtain the flexible typing that characterizes our system. However, an important aspect of filters we have ignored so far is that they can be used directly by the programmer to define user-defined operators that are typed as precisely as the hard-coded ones. Therefore a possibility is extend existing NoSQL languages by adding to their expressions the filter application f e expression. The next problem is to decide how far to go in the definition of filters. A complete integration, that is taking for f all the definitions given so far, is conceivable but might disrupt the execution model of the host language, since the user could then define complex iterators that do not fit map-reduce or the chosen distributed compilation policy. A good compromise could be to add to the host language only filters which have “local” effects, thus avoiding to affect the map-reduce or distributed compilation execution model. The minimal solution consists in choosing just the filters for patterns, unions, and expressions: 8. Commentaries Finally, let us explain some subtler design choices for our system. Filter design: The reader may wonder whether products and record filters are really necessary since, at first sight, the filter ( f1 ,f2) could be encoded as (x, y) ⇒ (f1 x, f2 y) and similarly for records. The point is that f1 x and f2 y are expressions —and thus their pair is a filter— only if the fi ’s are closed (ie, wihtout free term recursion variables). Without an explicit product filter it would not be possible to program a filter as simple as the identity map, µ X.. ‘nil ⇒ ‘nil||(h, t) ⇒ ( h,Xt)) since Xt is not an expression (X is a free term recursion variable). Similarly, we need an explicit record filter to process recursively defined record types such as µ X..({{head:int, tail:X}}| ‘nil). Likewise, one can wonder why we put in filters only the “open” record variant that copy extra fields and not the closed one. The reason is that if we want a filter to be applied only to records with exactly the fields specified in the filter, then this can be simply obtained by a pattern matching. So the filter { ℓ1 :f1 , . . . , ℓn :fn} (ie, without the trailing “. .”) can be simply introduced as syntactic sugar for { ℓ1 :any, . . . , ℓn :any}} ⇒ { ℓ1 :f1 , . . . , ℓn :fn , ..}} f ::= e | p => f | f |f Adding such filters to Jaql (we use the “=>” arrow for patterns in order to avoid confusion with Jaql’s “->” pipe operator) would not allow the user to define powerful operators, but their use would already dramatically improve type precision. For instance we could define the following Jaql expression transform ( { a:x,..}} as y => { y.*, sum:x+x}} | y => y ) (with the convention that a filter occurring as an expression denotes its application to the current argument $ ). With this syntax, our inference system is able to deduce that feeding this expression } *] returns a result with an argument of type [{{a?:int, c:bool} } | { c:bool}} )*]. This of type [({{ a:int, c:bool, sum:int} precision comes from the capacity of our inference system to discriminate between the two branches of the filter and deduce that a sum field will be added only if the a field is present. Similarly by using pattern matching in a Jaql “filter” expression, we can deduce that filter ( int => true | _ => false ) fed with any sequence of elements always returns a (possibly empty) list of in- Constructors: The syntax for constructing records and pairs is exactly the same in patterns, types, expressions, and filters. The reader may wonder why we did not distinguish them by using, say, × for product types or = instead of : in record values. This, combined with the fact that values and singletons have the same syntax, is a critical design choice that greatly reduces the confusion in these languages, since it makes it possible to have a unique representation Syntactically we could write µ X..‘nil ⇒ ‘nil||(h, t) ⇒ ( h,(Xt)v)) where v is any value, but then this would not pass type-checking since the expression (Xt)v must be typeable without knowing the ∆ environment (cf. rule [F ILTER -A PP ] at the beginning of Section 4.3). We purposedly stratified the system in order to avoid mutual recursion between filters and expressions. 13 2013/3/8 9. Related Work for constructions that are semantically equivalent. Consider for instance the pattern ( x,,( 3,, ‘nil))) . With our syntax ( 3,, ‘nil)) denotes both the product type of two singletons 3 and ‘nil, or the value ( 3,, ‘nil)), or the singleton that contains this value. According to the interpretation we choose, the pattern can then be interpreted as a pattern that matches a product or a pattern that matches a value. If we had differentiated the syntax of singletons from that of values (eg, {v}) and that of pairs from products, then the pattern above could have been written in five different ways. The point is that they all would match exactly the same sets of values, which is why we chose to have the same syntax for all of them. In the (nested) relational (and SQL) context, many works have studied the integration of (nested)-relational algebra or SQL into general purpose programming languages. Among the first attempts was the integration of the relational model in Pascal [31] or in Smalltalk [11]. Also, monads or comprehensions [7, 33, 34] have been successfully used to design and implement query languages including a way to embed queries within host languages. Significant efforts have been done to equip those languages with type systems and type checking disciplines [8, 25, 26] and more recently [27] for integration and typing aspects. However, these approaches only support homogeneous sequences of records in the context of specific classes of queries (practically equivalent to a nested relational algebra or calculus), they do not account for records with computable labels, and therefore they are not easily transposable to a setting where sequences are heterogeneous, data are semi-structured, and queries are much more expressive. While the present work is inspired and stems from previous works on the XML iterators, targeting NoSQL languages made the filter calculus presented here substantially different from the one of [9, 23] (dubbed XML filters in what follows), as well in syntax as in dynamic and static semantics. In [9] XML filters behave as some kind of top-down tree transducers, termination is enforced by heavy syntactic restrictions, and a less constrained use of the composition makes type inference challenging and requires sometimes cumbersome type annotations. While XML filters are allowed to operate by composition on the result of a recursive call (and, thus, simulate bottom-up tree transformations), the absence of explicit arguments in recursive calls makes programs understandable only to well-trained programmers. In contrast, the main focus of the current work was to make programs immediately intelligible to any functional programmer and make filters effective for the typing of sequence transformations: sequence iteration, element filtering, one-level flattening. The last two are especially difficult to write with XML filters (and require type annotations). Also, the integration of filters with record types (absent in [9] and just sketched in [23]) is novel and much needed to encode JSON transformations. Record types: The definition of records is redundant (both for types and patterns). Instead of the current definition we could have used just { ℓ:t}}, {} , and { ..}}, since the rest can be encoded by intersections. For instance, { ℓ1 :t1 , . . . , ℓn :tn , .. ..}} = &{ ℓn :tn}&{ ..}} . We opted to use the redundant defini{ ℓ1 :t}}& ...& tion for the sake of clarity. In order to type records with computed labels we distinguished two cases according to whether the type of a record label is finite or not. Although such a distinction is simple, it is not unrealistic. Labels with singleton types cover the (most common) case of records with statically fixed labels. The dynamic choice of a label from a statically known list of labels is a usage pattern seen in JavaScript when building an object which must conform to some interface based on a run-time value. Labels with infinite types cover the fairly common usage scenario in which records are used as dictionaries: we deduce for the expression computing the label the type string, thus forcing the programmer to insert some code that checks that the label is present before accessing it. The rationale behind the typing of records was twofold. First and foremost, in this work we wanted to avoid type annotations at all costs (since there is not even a notion of schema for JSON records and collections —only the notion of basic type is defined— we cannot expect the Jaql programmer to put any kind of type information in the code). More sophisticated type systems, such as dependent types, would probably preclude type reconstruction: dependent types need a lot of annotations and this does not fit our requirements. Second, we wanted the type-system to be simple yet precise. Making the finite/infinite distinction increases typing precision at no cost (we do not need any extra machinery since we already have singleton types). Adding heuristics or complex analysis just to gain some precision on records would have blurred the main focus of our paper, which is not on typing records but on typing transformations on records. We leave such additions for future work. 10. Conclusion Our work addresses two very practical problems, namely the typing of NoSQL languages and a comprehensive definition of their semantics. These languages add to list comprehension and SQL operators the ability to work on heterogeneous data sets and are based on JSON (instead of tuples). Typing precisely each of these features using the best techniques of the literature would probably yield quite a complex type-system (mixing row polymorphism for records, parametric polymorphism, some form of dependent typing,...) and we are skeptical that this could be achieved without using any explicit type annotation. Therefore we explored the formalization of these languages from scratch, by defining a calculus and a type system. The thesis we defended is that all operations typical of current NoSQL languages, as long as they operate structurally (ie, without resorting on term equality or relations), amount to a combination of more basic bricks: our filters. On the structural side, the claim is that combining recursive records and pairs by unions, intersections, and negations suffices to capture all possible structuring of data, covering a palette ranging from comprehensions, to heterogeneous lists mixing typed and untyped data, through regular expressions types and XML schemas. Therefore, our calculus not only provides a simple way to give a formal semantics to, reciprocally compare, and combine operators of different NoSQL languages, but also offers a means to equip these languages, in they current definition (ie, without any type definition or annotation), with precise type inference. Record polymorphism: The type-oriented reader will have noticed that we do not use row variables to type records, and nevertheless we have a high degree of polymorphism. Row variables are useful to type functions or transformations since they can keep track of record fields that are not modified by the transformation. In this setting we do not need them since we do not type transformations (ie, filters) but just the application of transformations (filters are not first-class terms). We have polymorphic typing via filters (see how the first example given in Section 7 keeps track of the c field) and therefore open records suffice. Record selection: Some languages —typically, the dynamic ones such as Javascript, Ruby, Python— allow the label of a field selection to be computed by an expression. We considered the definition of a fine-grained rule to type expressions of the form e1. e2 : whenever e2 is typed by a finite unions of strings, the rule would give a finite approximation of the type of the selection. However, such an extension would complex the definition of the type system, just to handle few interesting cases in which a finite union type can be deduced. Therefore, we preferred to omit its study and leave it for future work. 14 2013/3/8 As such we accounted for both components that, according to Landin, constitute the design of a language: operators and data structures. But while Landin considers the design of terms and types as independent activities we, on the contrary, advocate an approach in which the design of former is driven by the form of latter. Although other approaches are possible, we tried to convey the idea that this approach is nevertheless the only one that yields a type system whose precision, that we demonstrated all the work long, is comparable only to the precision obtained with hard-coded (as opposed to user-defined) operators. As such, our type inference yields and surpasses in precision systems using parametric polymorphism and row variables. The price to pay is that transformations are not first class: we do not type filters but just their applications. However, this seems an advantageous deal in the world of NoSQL languages where “selects” are never passed around (at least, not explicitly), but early error detection is critical, especially in the view of the cost of code deployment. The result are filters, a set of untyped terms that can be easily included in a host language to complement in a typeful framework existing operators with user-defined ones. The requirements to include filters into a host language are so minimal that every modern typed programming language satisfies them. The interest resides not in the fact that we can add filter applications to any language, rather that filters can be used to define a smooth integration of calls to domain specific languages (eg, SQL, XPath, Pig, Regex) into general purpose ones (eg, Java, C#, Python, OCaml) so as both can share the same set of values and the same typing discipline. Likewise, even though filters provide an early prototyping platform for queries, they cannot currently be used as a final compilation stage for NoSQL languages: their operations rely on a Lisp-like encoding of sequences and this makes the correspondence with optimized bulk operations on lists awkward. Whether we can derive an efficient compilation from filters to map-reduce (recovering the bulk semantics of the high-level language) is a challenging question. Future plans include practical experimentation of our technique: we intend to benchmark our type analysis against existing collections of Jaql programs, gauge the amount of code that is ill typed and verify on this how frequently the programmer adopted defensive programming to cope with the potential type errors. [6] S. Boag, D. Chamberlain, M. F. Fernández, D. Florescu, J. Robie, and J. Siméon. XQuery 1.0: An XML query language, W3C recommendation, 2007. [7] P. Buneman, L. Libkin, D. Suciu, V. Tannen, and L. Wong. Comprehension syntax. SIGMOD Record, 23(1):87–96, 1994. [8] P. Buneman, R. Nikhil, and R. Frankel. A Practical Functional Programming System for Databases. In Proc. Conference on Functional Programming and Architecture. ACM, 1981. 1981. [9] G. Castagna and K. Nguyễn. Typed iterators for XML. In Proceeding of the 13th ACM SIGPLAN international conference on Functional programming, ICFP ’08, pages 15–26, New York, NY, USA, 2008. ACM. [10] H. Comon, M. Dauchet, R. Gilleron, F. Jacquemard, C. Löding, D. Lugiez, S. Tison, and M. Tommasi. Tree automata techniques and applications. http://www.grappa.univ-lille3.fr/tata, 2007. [11] G. Copeland and D. Maier. Making smalltalk a database system. In In Proceedings of the ACM SIGMOD International Conference on Management of Data, pages 316–325, 1984. [12] J. R. (editor). Jsoniq. http://jsoniq.org. [13] J. Engelfriet. Bottom-up and Top-down Tree Transformations – A comparison. Theory of Computing Systems, 9(2):198–231, 1975. [14] J. Engelfriet. Top-down tree transducers with regular look-ahead. Mathematical Systems Theory, 10(1):289–303, Dec. 1976. [15] A. Frisch. Théorie, conception et réalisation d’un langage de programmation fonctionnel adapté à XML. PhD thesis, Université Paris 7 Denis Diderot, 2004. [16] A. Frisch, G. Castagna, and V. Benzaken. Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types. Journal of the ACM, 55(4):1–64, 2008. [17] H. Hosoya. Foundations of XML Processing: The Tree Automata Approach. Cambridge University Press, 2010. [18] Jaql. http://code.google.com/p/jaql. [19] Javascript object notation (json). http://json.org/. [20] W. Martens and F. Neven. Typechecking top-down uniform unranked tree transducers. In Proceedings of the 9th International Conference on Database Theory, ICDT ’03, pages 64–78, London, UK, 2002. Springer-Verlag. [21] E. Meijer. The world according to LINQ. ACM Queue, 9(8):60, 2011. References [22] E. Meijer and G. Bierman. A co-relational model of data for large shared data banks. Communications of the ACM, 54(4):49–58, 2011. [1] N. Alon, T. Milo, F. Neven, D. Suciu, and V. Vianu. XML with data values: typechecking revisited. In Proceedings of the twentieth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, PODS ’01, pages 138–149, New York, NY, USA, 2001. ACM. [23] K. Nguyễn. Language of Combinators for XML: Conception, Typing, Implementation. PhD thesis, Université Paris-Sud 11, http://www.lri.fr/~kn/file 2008. [24] Odata. http://www.odata.org/. [2] N. Alon, T. Milo, F. Neven, D. Suciu, and V. Vianu. Typechecking XML views of relational databases. ACM Trans. Comput. Logic, 4:315–354, July 2003. [25] A. Ohori and P. Buneman. Type Inference in a Database Programming Language. In ACM Conference on LISP and Functional Programming, pages 174–183, 1988. [3] A. Behm, V. R. Borkar, M. J. Carey, R. Grover, C. Li, N. Onose, R. Vernica, A. Deutsch, Y. Papakonstantinou, and V. J. Tsotras. Asterix: towards a scalable, semistructured data platform for evolvingworld models. Distributed and Parallel Databases, 29(3):185–216, 2011. [26] A. Ohori, P. Buneman, and V. Tannen. Database Programming in Machiavelli -a Polymorphic Language with Static Type Inference. Proc. ACM SIGMOD Conference, pages 46–57, 1989. [27] A. Ohori and K. Ueno. Making standard ML a practical database programming language. In M. M. T. Chakravarty, Z. Hu, and O. Danvy, editors, ICFP, pages 307–319. ACM, 2011. [4] V. Benzaken, G. Castagna, and A. Frisch. CDuce: an XML-friendly general purpose language. In ICFP ’03, 8th ACM International Conference on Functional Programming, pages 51–63, Uppsala, Sweden, 2003. ACM Press. [28] C. Olston, B. Reed, U. Srivastava, R. Kumar, and A. Tomkins. Pig latin: a not-so-foreign language for data processing. In SIGMOD Conference, pages 1099–1110, 2008. [5] K. S. Beyer, V. Ercegovac, R. Gemulla, A. Balmin, M. Y. Eltabakh, C.-C. Kanne, F. Özcan, and E. J. Shekita. Jaql: A scripting language for large scale semistructured data analysis. PVLDB, 4(12):1272– 1283, 2011. [29] F. Özcan, D. Hoa, K. S. Beyer, A. Balmin, C. J. Liu, and Y. Li. Emerging trends in the enterprise data analytics: connecting Hadoop and DB2 warehouse. In Proceedings of the 2011 international conference on Management of data, SIGMOD ’11, pages 1161–1164, 2011. Only filter-encoded operators are not first class: if the host language provides, say, higher-order functions, then they stay higher-order and are typed by embedding the host type system, if any, via “foreign type calls”. [30] A. Sabry and P. Wadler. A reflection on call-by-value. In Proceedings of the first ACM SIGPLAN international conference on Functional 15 2013/3/8 programming, ICFP ’96, pages 13–24. ACM, 1996. [31] J. Schmidt and M. Mall. Pascal/R Report. Technical Report 66, Fachbereich Informatik, université de Hamburg, 1980. [32] Squeryl: A Scala ORM and DSL for talking with Databases with minimum verbosity and maximum type safety . http://squeryl.org/. [33] V. Tannen, P. Buneman, and L. Wong. Naturally embedded query languages. In ICDT, pages 140–154, 1992. [34] P. Trinder and P. Wadler. Improving list comprehension database queries. In Fourth IEEE Region 10 Conference (TENCON), pages 186–192, Nov. 1989. [35] Unql. http://www.unqlspec.org/. 16 2013/3/8 Appendix 17 2013/3/8 A. Termination analysis algorithm 1. It builds a substitution σ : Vars → Ids from expression variables to variables identifiers, thus associating each capture variable occurring in a pattern of the filter to a fresh identifier for the abstract subtree of the input type it will be bound to. In order to deduce the result type of the application of a filter to an expression, the type inference algorithm abstractly executes the filter on the type of the expression. As explained in Section 4, the algorithm essentially analyzes what may happen to the original input type (and to its subtrees) after a recursive call and checks that, in all possible cases, every subsequent recursive call will only be applied to subtrees of the original input type. In order to track the subtrees of the original input type, we use an infinite set Ids = {ι1 , ι2 , . . .} of variable identifiers (ranged over by, possible indexed, ι). These identifiers are used to identify the subtrees of the original input type that are bound to some variable after a recursive call. Consider for instance the recursive filter: 2. It uses the substitution σ to compute the set of symbolic arguments of recursive calls of X. In other words, if n recursive calls of X occur in the filter f , then TreesX (σ, f ) returns the set {A1 , ..., An } of the n symbolic arguments of these calls, obtained under the hypothesis that the free variables of f are associated to subtrees as specified by σ. The formal definition is as follows: TreesX (σ, e) = ∅ S TreesX (σ, p ⇒ f ) = TreesX (σ ∪ {xi 7→ ιi }, f ) (ιi fresh) µ X..( x1,( x2, x3)) ⇒ X((x1 ,x3) | _ ⇒ ‘nil. xi ∈vars(p) TreesX (σ, ( f1 ,f2) ) = TreesX (σ, f1 ) ∪ TreesX (σ, f2 ) TreesX (σ, f1| f2 ) = TreesX (σ, f1 ) ∪ TreesX (σ, f2 ) TreesX (σ, µ X.. f ) = ∅ TreesX (σ, µ Y . f ) = TreesX (σ, f ) (X 6= Y ) TreesX (σ, Xa) = {aσ} TreesX (σ, f1 ;f2 ) = TreesX (σ, f2 ) TreesX (σ, of ) = TreesXS (σ, f ) (o = groupby , orderby ) TreesX (σ, fi ) TreesX (σ, { ℓi :fi , ..}} i∈I ) = The algorithm records that at the first call of this filter each variable xi is bound to a subtree ιi of the input type. The recursive call X((x1 ,x3) is thus applied to the “abstract argument” ( ι1 ,ι3) . If we perform the substitutions for this call, then we see that x1 will be bound to ι1 and that x2 and x3 will be bound to two subtrees of the ι3 subtree. We do not care about x2 since it is not used in any recursive call. What is important is that both x1 and x3 are bound to subtrees of the original input type (respectively, to ι1 and to a subtree of ι3 ) and therefore, for this filter, the type inference algorithm will terminate for every possible input type. The previous example introduces the two important concepts that are still missing for the definition of our analysis: i∈I where aσ denotes the application of the substitution σ to a. The definition above is mostly straightforward. The two important cases are those for the pattern filter where the substitution σ is updated by associating every capture variable of the pattern with a fresh variable identifier, and the one for the recursive call where the symbolic argument is computed by applying σ to the actual argument. 1. Recursive calls are applied to symbolic arguments, such as ( ι1 ,ι3) , that are obtained from arguments by replacing variables by variable identifiers. Symbolic arguments are ranged over by A and are formally defined as follows: Symb Args A ::= | | | | Second phase. The second phase is implemented by the function Check(). The intuition is that Check(f ) must “compute” the application of f to all the symbolic arguments collected in the first phase and then check whether the variables occurring in the arguments of recursive calls (ie, the “marked” variables) are actually bound to subtrees of the original type (ie, they are bound either to variable identifiers or to subparts of variable identifiers). If we did not have filter composition, then this would be a relatively easy task: it would amount to compute substitutions (by matching symbolic arguments against patterns), apply them, and finally verify that the marked variables satisfy the sought property. Unfortunately, in the case of a composition filter f1 ;f2 the analysis is more complicated than that. Imagine that we want to check the property for the application of f1 ;f2 to a symbolic argument A. Then to check the property for the recursive calls occurring in f2 we must compute (or at least, approximate) the set of the symbolic arguments that will be produced by the application of f1 to A and that will be thus fed into f2 to compute the composition. Therefore Check(f ) will be a function that rather than returning just true or false, it will return a set of symbolic arguments that are the result of the execution of f , or it will fail if any recursive call does not satisfy the property for marked variables. More precisely, the function Check() will have the form ι (variable identifiers) c (constants) ( A,A)) (pairs) { ℓ:A, . . . , ℓ:A}} (records) ⊥ (indeterminate) 2. We said that we “care” for some variables and disregard others. When we analyze a recursive filter µ X..f the variables we care about are those that occur in arguments of recursive calls of X. Given a filter f and a filter recursion variable X the set of these variables is formally defined as follows MarkX (f ) = {x | Xa ⊑ f and x ∈ vars(a)} where ⊑ denotes the subtree containment relation and vars(e) is the set of expression variables that occur free in e. With an abuse of notation we will use vars(p) to denote the capture variables occurring in p (thus, vars(f e) = vars(f ) ∪ vars(e) and vars(p ⇒ f ) = vars(f ) \ vars(p), the rest of the definition being standard). As an aside notice that the fact that for a given filter f the type inference algorithm terminates on all possible input types does not imply that the execution of f terminates on all possible input values. For instance, our analysis correctly detects that for the filter µ X..( x1, x2) ⇒ X(( x1 ,x2)| _ ⇒ _ type inference terminates on all possible input types (by returning the very same input type) although the application of this same filter never terminates on arguments of the form ( v1 ,v2) . We can now formally define the two phases of our analysis algorithm. CheckV (σ, f, {A1 , ..., An }) where V ⊆ Vars stores the set of marked variables, f is a filter, σ is a substitution for (at least) the free variables of f into Ids, and Ai are symbolic arguments. It will either fail if the marked variables do not satisfy the property of being bound to (subcomponents of) variable identifiers or return an over-approximation of the result of applying f to all the Ai under the hypothesis σ. This approximation is either a set of new symbolic arguments, or ⊥. The latter simply indicates that Check() is not able to compute the result of the application, typically because it is the result of some expression First phase. The first phase is implemented by the function Trees_ (_, _). For every filter recursion variable X, this function explores a filter and does the following two things: 18 2013/3/8 • CheckV (σ, f, {A1 , ..., An }) = n S CheckV (σ, f, Ai ) i=1 • If (⌉⌉A⌈⌈& * f++ = ∅) then CheckV (σ, f, A) = ∅ otherwise: CheckV (σ, e, A) = ( CheckV (σ, f1 ;f2 , A) = CheckV (σ, f2 , CheckV (σ, f1 , A)) CheckV (σ, Xa, A) = CheckV (σ, µ X.. f, A) = ⊥ ( CheckV (σ, f1| f2 , A) CheckV (σ, ( f1 ,f2) , A) CheckV (σ, { ℓi :fi , ..}}1≤i≤n , A) CheckV (σ, p ⇒ f, A) = = = = {aσ} if e ≡ a ⊥ otherwise fail ⊥ if CheckMarkX (f ) (σ, f, A) = fail otherwise   if * f1 + &⌉ A⌈⌈ = ∅ CheckV (σ, f2 , A) CheckV (σ, f1 , A) if ⌉ A⌈⌈ \ * f1+ = ∅  Check (σ, f , A) ∪ Check (σ, f , A) otherwise V 1 V 2   CheckV (σ, f1 , A1 ) × CheckV (σ, f2 , A2 ) if A ≡ (A1 , A2 ) CheckV (σ, f1 , ι1 ) × CheckV (σ, f2 , ι2 ) if A ≡ ι (where ι1 and ι2 are fresh)  fail if A ≡ ⊥  S { ℓ1 :B1 , ..., ℓn :Bn , ..., ℓn+k :An+k , ..}} if A ≡ { ℓi :fi , ..}}1≤i≤n+k    Bi ∈CheckS V (σ,fi ,Ai ) { ℓ1 :B1 , ..., ℓn :Bn , ..., ℓn+k :An+k , ..}} if A ≡ ι (where all ιi are fresh)  Bi ∈CheckV (σ,fi ,ιi )    fail if A ≡ ⊥ ( fail CheckV (σ ∪ (A V/ p), f, A) if A V/ p = fail otherwise Figure 3. Definition of the second phase of the analysis belonging to the host language (eg, the application of a function) or because it is the result of a recursive filter or of a recursive call of some filter. The full definition of Check_ (_, _, _) is given in Figure 3. Let us comment the different cases in detail. CheckV (σ, f, {A1 , ..., An }) = n [ syntactic equivalence), in which case we return it after having applied the substitution σ to it; or it is some other expression, in which case the function says that it is not able to compute a result and returns ⊥. When the filter is a composition of two filters, f1 ;f2 , we first call CheckV (σ, f1 , A) to analyze f1 and compute the result of applying f1 to A, and then we feed this result to the analysis of f2 : CheckV (σ, f, Ai ) i=1 simply states that to compute the filter f on a set of symbolic arguments we have to compute f on each argument and return the union of the results. Of course, if any CheckV (σ, f, Ai ) fails, so does CheckV (σ, f, {A1 , ..., An }). The next case is straightforward: if we know that an argument of a given form makes the filter f fail, then we do not perform any check (the recursive call of f will never be called) and no result will be returned. For instance, if we apply the filter { ℓ:f , ..}} to the symbolic argument ( ι1 ,ι2) , then this will always fail so it is useless to continue checking this case. Formally, what we do is to consider ⌉ A⌈⌈, the set of all values that have the form of A (this is quite simply obtained from A by replacing any for every occurrence of a variable identifier or of ⊥) and check whether in it there is any value accepted by f , namely, whether the intersection ⌉ A⌈⌈& * f++ is empty. If it is so, we directly return the empty set of symbolic arguments, otherwise we have to perform a fine grained analysis according to the form of the filter. If the filter is an expression, then there are two possible cases: either the expression has the form of an argument (≡ denotes CheckV (σ, f1 ;f2 , A) = CheckV (σ, f2 , CheckV (σ, f1 , A)) When the filter is recursive or a recursive call, then we are not able to compute the symbolic result. However, in the case of a recursive filter we must check whether the type inference terminates on it. So we mark the variables of its recursive calls, check whether its definition passes our static analysis, and return ⊥ only if this analysis —ie, CheckMarkX (f ) (σ, f, A)— did not fail. Notice that ⊥ is quite different from failure since it allows us to compute the approximation as long as the filter after the composition does not bind (parts of) the result that are ⊥ to variables that occur in arguments of recursive calls. A key example is the case of the filter Filter[F ] defined in Section 5.1. If the parameter filter F is recursive, then without ⊥ Filter[F ] would be rejected by the static analysis. Precisely, this is due to the composition F x;(‘false ⇒ Xl|| · · · ). When F is recursive the analysis supposes that F x produces ⊥, which is then passed over to the pattern. The recursive call Xl is executed in the environment ⊥/‘true, which is empty. Therefore 19 2013/3/8 A/x = A/((p1, p2) = A/p1& p2 = A/p1| p2 = A/{{ℓ1 :p1 , ..., ℓn :pn} A/{{ℓ1 :p1 , ..., ℓn :pn , .. ..}} A/t = = = ( {x 7→ A} if A ≡ v or A ≡ ι or x ∈ /V fail otherwise   (A1 /p1 ) ∪ (A2 /p2 )   (ι /p ) ∪ (ι /p ) 1 1 2 2 fail   Ω if A ≡ ( A1, A2) if A ≡ ι (where ι1 , ι2 are fresh) if A ≡ ⊥ otherwise A/p1 ∪ A/p2 ( A/p1 if A/p1 6= Ω A/p2 otherwise  S Ai /pi    i≤i≤n   S ι /p i i i≤i≤n    fail    Ω  S Ai /pi    i≤i≤n   S  ιi /pi i≤i≤n    fail    Ω if A ≡ { ℓ1 :A1 , ..., ℓn :An} if A ≡ ι (where ιi are fresh) if A ≡ ⊥ otherwise if A ≡ { ℓ1 :A1 , ..., ℓn :An , ..., ℓn+k :An+k} if A ≡ ι (where ιi are fresh) if A ≡ ⊥ otherwise ∅ Figure 4. Pattern matching with respect to a set V of marked variables variables in p it also checks that all capture variables that are also marked are actually bound to a subtree of the initial input type. A V/ p is defined in Figure 4 (to enhance readability we omitted the V index since it matters only in the first case and it does not change along the definition). The check for marked variables is performed in the first case of the definition: when a symbolic argument A is matched against a variable x, if the variable is not marked (x 6∈ V), then the substitution {x 7→ A} is returned; if it is marked, then the matching (and thus the analysis) does not fail only if the symbolic argument is either a value (so it does not depend on the input type) or it is a variable identifier (so it will be exactly a subtree of the original input type). The other cases of the definition of A V/ p are standard. Just notice that in the product and record patterns when A is a variable identifier ι, the algorithm creates fresh new variable identifiers to denote the new subtrees in which ι will be decomposed by the pattern. Finally, the reader should not confound Ω and fail. The former indicates that the argument does not match the value, while the latter indicates that a marked variable is not bound to a value or to exactly a subtree of the initial input type (notice that the case Ω cannot happen in the definition of Check() since A V/ p is called only when ⌉ A⌈⌈ is contained in * p++). the result of the F x call, whatever it is, cannot affect the termination of the subsequent recursive calls. Even though the composition uses the result of F x, the form of this result cannot be such as to make typechecking of Filter[F ] diverge. For the union filter f1| f2 there are three possible cases: f1 will always fail on A, so we return the result of f2 ; or f2 will never be executed on A since f1 will never fail on A, so we return just the result of f1 ; or we cannot tell which one of f1 or f2 will be executed, and so we return the union of the two results. If the filter is a product filter ( f1 ,f2) , then its accepted type *( f1 ,f2)+ is a subtype of ( any,any)). Since we are in the case where ⌉ A⌈⌈&*( f1 ,f2)+ is not empty, then A can have just two forms: either it is a pair or it is a variable identifier ι. In the former case we check the filters component-wise and return as result the set-theoretic product of the results. In the latter case, recall that ι represents a subtree of the original input type. So if the application does not fail it means that each subfilter will be applied to a subtree of ι. We introduce two fresh variable identifiers to denote these subtrees of ι (which, of course are subtrees of the original input type, too) and, as in the previous case, apply the check component-wise and return the set-theoretic product of the results. The case for the record filter is similar to the case of the product filter. Finally, the case of pattern filter is where the algorithm checks that the marked variables are indeed bound to subtrees of the initial input type. What Check() does is to match the symbolic argument against the pattern and update the substitution σ so as to check the subfilter f in an environment with the corresponding assignments for the capture variables in p. Notice however that the pattern matching A V/ p receives as extra argument the set V of marked variables, so that while computing the substitutions for the capture The two phases together. Finally we put the two phases together. Given a recursive filter µ X..f we run the analysis by marking the variables in the recursive calls of X in f , running the first phase and then and feeding the result to the second phase: CheckMarkX (f ) (∅, f, TreesX (∅, f )). If this function does not fail then we say that µ X.. f passed the check: µX..f ) ⇐⇒ CheckMarkX (f ) (∅, f, TreesX (∅, f )) 6= fail Check(µ 20 2013/3/8 We are now able to prove Theorem 16. Let t be a type and f a filter define For filters that are not recursive at toplevel it suffices to add a def µX.. f ) with X fresh. dummy recursion: Check(f ) = Check(µ D(f, t) = {(X, t′ ) | X ⊑ f, t′ ∈ Support(f, t)} Theorem 16 (Termination). If Check(f ) then the type inference algorithm terminates for f on every input type t. Notice that since Support(f, t) is finite and there are finitely many different recursion variables occuring in a filter, then D(f, t) is finite, too. Now let f and t be the filter and type mentioned in the statement of Theorem 16 and consider the (possibly infinite) derivation of Γ ;∆ ;M ⊢fil f (t) : s. Assign to every judgment Γ′ ;∆′ ;M ′ ⊢fil f ′ (t′ ) : s′ the following weight In order to prove the theorem above we need some auxiliary definitions: Definition 17 (Plinth [15]). A plinth i ⊂ Types is a set of types with the following properties: Wgt(Γ′ ;∆′ ;M ′ ⊢fil f ′ (t′ ) : s′ ) = ( |D(f, t)\dom(M ′ )| , size(f ′ ))) • i is finite • i contains any, empty and is closed under Boolean connectives where |S| denotes the cardinality of the set S (notice that in the definition S is finite), dom(M ′ ) is the domain of M ′ , that is, the set of pairs (X, t) for which M ′ is defined, and size(f ′ ) is the depth of the syntax tree of f ′ . Notice that the set of all weights lexicographically ordered form a well-founded order. It is then not difficult to prove that every application of a rule in the derivation of Γ ;∆ ;M ⊢fil f (t) : s strictly decreases Wgt, and therefore that this derivation must be finite. This can be proved by case analysis on the applied rule, and we must distinguish only three cases: & ,||,¬ ¬) (& • for all types t = ( t1, t2) in i, t1 ∈ i and t2 ∈ i • for all types t = { ℓ1 :t1 , . . . , ℓn :tn , (.. .. ..)}} in i, ti ∈ i for all i ∈ [1..n]. We define the plinth of t, noted i(t), as the smallest plinth containing t. Intuitively, the plinth of t is the set of types that can be obtained by all possible boolean combination of the subtrees of t. Notice that i(t) is always defined since our types are regular: they have finitely many distinct subtrees, which (modulo type equivalence) can thus be combined in finitely many different ways. [F IL -F IX ] Notice that in this case the first component of Wgt either decreases or remains constant, and the second component strictly decreases. [F IL -C ALL -N EW ] In this case Lemma 19 ensures that the first component of the Wgt of the premise strictly decreases. Since this is the core of the proof let us expand the rule. Somewhere in the derivation of Γ ;∆ ;M ⊢fil f (t) : s we have the following rule: Definition 18 (Extended plinth and support). Let t be a type and f a filter.WThe extended plinth of t and f , noted î(f, t) is defined as i(t ∨ v⊑f v) (where v ranges over values). The support of t and f , noted as Support(f, t), is defined as [ def {Aσ | σ : Ids(A) → î(f, t)} Support(f, t) = î(f, t) ∪ [F IL -C ALL -N EW ] Γ′ ;∆′ ;M ′ , ((X, t′′ ) 7→ T ) ⊢fil ∆′ (X)(t′′ ) : t′ A∈Trees∅ (∅,f ) Γ′ ;∆′ ;M ′ ⊢fil (Xa)(s) : µ T..t′ The extended plinth of t and f is the set of types that can be obtained by all possible boolean combination of the subtrees of t and of values that occur in the filter f . The intuition underlying the definition of support of t and f is that it includes all the possible types of arguments of recursive calls occurring in f , when f is applied to an argument of type t. Lastly, let us prove the following technical lemma: and we want to prove that (D(f, t) \ dom(M ′ )) ) (D(f, t) \ (dom(M ′ ) ∪ (X, t′′ )) and the containment must be strict to ensure that the measure decreases. First of all notice that (X, t′′ ) 6∈ dom(M ′ ), since it is a side condition for the application of the rule. So in order to prove that containment is strict it suffices to prove that (X, t′′ ) ∈ D(t, f ). But this is a consequence of Lemma 19 which ensures that t′′ ∈ Support(f, t), whence the result. Lemma 19. Let f be a filter such that Check(f ) holds. Let t be a type. For every derivation D (finite or infinite) of Γ ;∆ ;M ⊢fil f (t) : s , for every occurrence of the rule [F IL -C ALL -N EW ] Γ′ ;∆′ ;M ′ , ((X, t′′ ) 7→ T ) ⊢fil ∆′ (X)(t′′ ) : t′ Γ′ ;∆′ ;M ′ ⊢fil (X a)(s) : µ T..t′ t′′ = type(Γ′ , a) (X, t′′ ) 6∈ dom(M ′ ) T fresh [F IL -*] With all other rules the first component of Wgt remains constant, and the second component strictly decreases. t′′ = type(Γ′ , a) (X, t′′ ) 6∈ dom(M ′ ) T fresh in D, for every x ∈ vars(a), Γ′ (x) ∈ î(f, t) (or equivalently, type(Γ′ , a) ∈ Support(f, t)) Proof. By contradiction. Suppose that there exists an instance of the rule for which x ∈ vars(a) ∧ x ∈ / î(f, t). This means that Γ′ (x) is neither a singleton type occurring in f nor a type obtained from t by applying left projection, right projection or label selection (⋆). But since Check(f ) holds, x must be bound to either an identifier or a value v (see Figure 4) during the computation of CheckMarkX (f ) (∅, f, TreesX (∅, f )). Since identifiers in Check(f ) are only introduced for the input parameter or when performing a left projection, right projection or label selection of another identifier, this ensure that x is never bound to the result of an expression whose type is not in î(f, t), which contradicts (⋆). A.1 Improvements Although the analysis performed by our algorithm is already fine grained, it can be further refined in two simple ways. As explained in Section 4, the algorithm checks that after one step of reduction the capture variables occurring in recursive calls are bound to subtrees of the initial input type. So a possible improvement consists to try to check this property for a higher number of steps, too. For instance consider the filter: µ X..( ‘nil,,x)) ⇒ X({{ ℓ:x}}) | ( y,,_)) ⇒ X(((‘nil,,( y,,y))) ) | _ ⇒ ‘nil This filter does not pass our analysis since if ιy is the identifier bound to the capture variable y, then when unfolding the recursive call in the second branch the x in the first recursive call will be bound to ( ιy , ιy ) . But if we had pursued our abstract execution one step further we would have seen that ( ιy , ιy ) is not used in a recursive call and, thus, that type inference terminates. Therefore, a first improvements is to modify Check() so that it does not stop 21 2013/3/8 type M = (K,V) | (V,V,K) type V = { var : string } | { lambda2 : (string, string, M) } type K = { var : string } | { lambda1 : (string, M) } let filter Eval = | ( { lambda2 : (x, k, m) }, v , h ) -> m ; Subst[x,v] ; Subst[k,h]; Eval | ( { lambda1 : (x, m) }, v ) -> m ; Subst[x,v] ; Eval | x -> x let filter Subst[c,F] = | ( Subst[c,F] , Subst[c,F] , Subst[c,F] ) | ( Subst[c,F] , Subst[c,F] ) | { var : c } -> F | { lambda2 : (x&¬c, k&¬c, m) } -> { lambda2 : (x, k, m;Subst[c,F]) } | { lambda1 : (x&¬c, m) } -> { lambda1 : (x, m;Subst[c,F]) } | x -> x Figure 5. Filter encoding of λcps just after one step of reduction but tries to go down n steps, with n determined by some heuristics based on sizes of the filter and of the input type. A second and, in our opinion, more promising improvement is to enhance the precision of the test ⌉ A⌈⌈& * f++ = ∅ in the definition of Check, that verifies whether the filter f fails on the given symbolic argument A. In the current definition the only information we collect about the type of symbolic arguments is their structure. But further type information, currently unexploited, is provided by patterns. For instance, in the following (admittedly stupid) filter with the following reduction rules (performed at top-level, without any reduction under context). (λx.λk.M )V K (λx.M )V −→ −→ M [x := V ][k := K] M [x := V ] In order to prove Turing completeness it suffices to show how to encode λcps terms and reductions in our calculus. For the sake of readability, we use mutually recursive types (rather than their encoding in µ-types), we use records (though pairs would have sufficed), we write just the recursion variable X for the filter x -> Xx, and use ¬t to denote the type any\t. Term productions are encoded by the recursive types given at the beginning of Figure 5. Next we define the evaluation filter Eval. In its body it calls the filter Subst[c,F] which implements the capture free substitution and, when c denotes a constant, is defined as right below. It is straightforward to see that the definitions in Figure 5 implement the reduction semantics of CPS terms. Of course the definition above would not pass our termination condition. Indeed while Subst would be accepted by our algorithm, Eval would fail since it is not possible to ensure that the recursive calls of Eval will receive from Subst subtrees of the original input type. This is expected: while substitution always terminate they may return trees that are not subtrees of the original term. µ X..( int,,x)) ⇒ x & int ⇒ X(((y,,y))) | y& | z⇒z if in the first pass we associate y with ιy , then we know that ( ιy , ιy ) has type ( int,, int)). If we record this information, then we know that in the second pass ( ιy , ιy ) will always match the first pattern, and so it will never be the argument of a further recursive call. In other words, there is at most one nested recursive call. The solution is conceptually simple (but yields a cumbersome formalization, which is why we chose the current formulation) and amounts to modify Trees(,) so that when it introduces fresh variables it records their type information with them. It then just suffices to modify the definition of ⌉ A⌈⌈ so as it is obtained from A by replacing every occurrence of a variable identifier by its type information (rather than by any) and the current definition of Check() will do the rest. C. Proof of subject reduction (Theorem 13) We first give the proof of Lemma 9, which we restate: Let f be a filter and v be a value such that v ∈ / *f +. Then for every γ, δ, if δ;γ ⊢eval f (v) r, r ≡ Ω. B. Proof of Turing completeness (Theorem 7) Proof. By induction on the derivation of δ;γ ⊢eval f (v) case analysis on the last rule of the derivation: In order to prove Turing completeness we show how to define by filters an evaluator for untyped (call-by-value) λ-calculus. If we allowed recursive calls to occur on the left-hand side of composition, then the encoding would be straightforward: just implement β and context reductions. The goal however is to show that the restriction on compositions does not affect expressiveness. To that end we have to avoid context reductions, since they require recursive calls before composition. To do so, we first translate λ-terms via Plotkin’s call-by-value CPS translation and apply Steele and Rabbit’s administrative reductions to them obtaining terms in λcps . The latter is isomorphic to cbv λ-calculus (see for instance [30]) and defined as follows. M V K ::= ::= ::= r, and (expr): here, *e+ = any for any expression e, therefore this rule cannot be applied (since ∀v, v ∈ any). (prod): assume v ∈ / *((f1 ,f2) + ≡ ( * f1 + , * f2 + ) . then either v ∈ / ( any,,any)), in which case only rule (error) applies and therefore r ≡ Ω. Or v ≡ (v1 , v2 ) and v1 ∈ / *f1 +. Then by induction hypothesis on the first premise, δ;γ ⊢eval f1 (v1 ) r1 and r1 ≡ Ω, which contradicts the side condition r1 6= Ω (and We were a little bit sloppy in the notation and used a filter parameter as a pattern. Strictly speaking this is not allowed in filters and, for instance, the branch { var : c } -> F in Subst should rather be written as { var : y } -> ( (y=c); (true -> F | false -> { var : y }) ). Similarly, for the other two cases. KV | V V K x | λx.λk.M k | λx.M 22 2013/3/8 (error): this rule can never occur. Indeed, if v : t and Γ ;∆ ;M ⊢fil f (t) : s, that means in particular that t ≤ *f + and therefore that all of the side conditions for the rules prod, pat and recd hold. similarly for the second premise). Therefore this rule cannot be applied to evaluate ( f1 ,f2) . & *f + (patt): Similarly to the previous case. If v ∈ / *p ⇒ f + = *p+& then either v ∈ / *p+ (which contradicts v/p 6= Ω) or v ∈ / *f + and by induction hypotheis, δ;γ, v/p ⊢eval f (v) Ω. (comp): If v ∈ / *f1 ;f2 + ≡ *f1 +, then by induction hypothesis on the first premise, r1 ≡ Ω, which contradicts the side condition r1 6= Ω. Therefore only rule (error) can be applied here. (recd): Similar to product type: either v is not a record and therefore only the rule (errro) can be applied, or one of the ri = Ω (by induction hypothesis) which contradicts the side condition. (union1) and (union2): since v ∈ / *f1| f2 +, this means that v ∈ / *f1 + and v ∈ / *f2 +. Therefore if rule (union1) is chosen, by induction hypothesis, r1 ≡ Ω which contradicts the side condition. If rule (union2) is chosen, then by induction hypothesis r2 ≡ Ω which gives r ≡ Ω. (rec-call) trivially true, since it cannot be that v ∈ / any (rec) we can apply straightfowardly the induction hypothesis on the premise and have that r ≡ Ω. (groupby) and (orderby): If v ∈ / f then the only rule that applies is (error) which gives r ≡ Ω. D. Complexity of the typing algorithm Proof. For clarity we restrict ourselves to types without record constructors but the proof can straihgtforwardly be extended to them. First remark that our types are isomorphic to alternating tree automata (ATA) with intersection, union and complement (such as those defined in [10, 17]). From such an ATA t it is possible to compute a non-deterministic tree automaton t′ of size O(2|t| ). When seeing t′ in our type formalism, it is a type generated by the following grammar: τ const atom ::= ::= ::= µX.τ | τ||const | const ( τ,,τ)) | atom X | b where b ranges over negation and intersections of basic types. Intuitively each recursion variable X is a state in the NTA, a finite union of products is a set of non-deterministict transitions whose right-hand-side are each of the products and atom productions are leaf-states. Then it is clear than if Check(f ) holds, the algorithm considers at most |f | × |t′ | distinct cases (thanks to the memoization set M ). Furthermore for each rule, we may test a subtyping problem (eg, t ≤ *f +), which itself is EXPTIME thus giving the bound We are now equipped to prove the subject reduction theorem which we restate in a more general manner: For every Γ, ∆, M , γ, δ such that ∀x ∈ dom(γ), x ∈ dom(Γ) ∧ γ(x) : Γ(x), if Γ ;∆ ;M ⊢fil f (t) : s, then for all v : t, δ;γ ⊢eval f (v) r implies r : s. The proof is by induction on the derivation of δ;γ ⊢eval f (v) r, and by case analysis on the rule. Beside the basic case, the only rules which are not a straightforward application of induction are the rules union1 and union2 that must be proved simulatneously. Other cases being proved by a direct application of the induction hypothesis, we only detail the case of the product constructor. E. Precise typing of groupby The process of inferring a precise type for groupby f (t) is decomposed in several steps. First we have to compute the set D(f ) of discriminant domains for the filter f . The idea is that these domains are the types on which we know that f may give results of different types. Typically this corresponds to all possible branchings that the filter f can do. For instance, if {t1 , ..., tn } are pairwise disjoint types and f is the filter t1 ⇒ e1| · · · | tn ⇒ en , then the set of discriminant domains for the filter f is {t1 , ..., tn }, since the various si obtained from ∅ ;∅ ;∅ ⊢fil f (ti ) : si may all be different, and we want to keep track of the relation between a result type si and the input type ti that produced it. Formally D(f ) is defined as follows: D(e) = {any} D(((f1 ,f2) ) = D(f1 ) × D(f2 ) D(p ⇒ f ) = {**p + & t | t ∈ D(f )} D(f1| f2 ) = D(f1 ) ∪ {t\**f1+ | t ∈ D(f2 )} µX.. f ) D(µ = D(f ) D(Xa) = {any} D(f1 ;f2 ) = D(f1 ) D(of ) = {[any*]} (o = groupby , orderby ) S D({{ℓi :fi , ..}}i∈I ) = { ℓi :ti , ..}}i∈I (expr): we suppose that the host languages enjoys subject reduction, hence e(v) = r : s. W (prod): Here, we know that t ≡ i≤rank(t) (ti1 , ti2 ). Since v is a value, and v : t, we obtain that v ≡ (v1 , v2 ). Since (v1 , v2 ) is a value, ∃i ≤ rank(t) such that (v1 , v2 ) : (ti1 , ti2 ). The observation that v is a value is W crucial here, since in general j j given a type t′ ≤ t with t′ ≡ j≤rank(t′ ) (t′1 , t′2 ) it is not j j true that ∃i, j s.t. (t′1 , t′2 ) ≤ (t1 i , t2 i ). However this property holds for singleton types and therefore for values. We have therefore that v1 : ti1 and v2 : ti1 . Furthermore, since we suppose that a typing derivation exists and the typing rules are syntax directed, then Γ ;∆ ;M ⊢fil f (ti1 ) : si1 must be a used to prove our typing judgement. We can apply the induction hypothesis and deduce that δ;γ ⊢eval f (v1 ) r1 and similarly for v2 . We have therefore that the filter evaluates to (r1 , r2 ) W which has type (si1 , si2 ) ≤ j≤rank(s) (s1 i , s2 i ) which proves this case. ti ∈D(fi ) Now in order to have a high precision in typing we want to compute the type of the intermediate list of the groupby on a set of disjoint types. For that we define a normal form of a set of types that given a set of types computes a new set formed of pairwise disjoint types whose union covers the union of all the original types. (union1) and (union2): both rules must be proved together. Indeed, given a filter f1| f2 for which we have a typing derivation &* for the judgement Γ ;∆ ;M ⊢fil f1| f2 (t) : s, either v : t& f1 + and we can apply the induction hypothesis and therefore, & * f1 +) : s1 and if δ;γ ⊢eval f (v1 ) Γ ;∆ ;M ⊢fil f1| (t& r1 & * f1 +. (case union1) r1 : s1 . However it might be that v ∈ / t& Then by Lemma 9 we have that δ;γ ⊢eval f (v1 ) Ω (case union2) and we can apply the induction hypothesis on the second premise, which gives us δ;γ ⊢eval f (v1 ) r2 which allows us to conclude. N ({ti | i ∈ S}) = [ ( \ ∅⊂I⊆S i∈I ti \ [ tj ) j∈S\I Recall that we are trying to deduce a type for groupby f (t), that is for the expression groupby f when applied to an argument of type t. Which types shall we use as input for our filter f to compute the type of the intermediate result? Surely we want to have all the 23 2013/3/8 where every rule rj ∈ R types that are in the item(t). This however is not enough since we would not use the information of the descriminant domains for the filter. For instance if the filter gives two different result types for positive and negative numbers and the input is a list of integers, we want to compute two different result types for positive and negatives and not just to compute the result of the filter application on generic integers (indeed item([int*]) = {int}). So the idea is to add to the set that must be normalized all the types of the set of discriminant types. This however is not precise enough, since these domains may be much larger than the item types of the input list. For this reason we just take the part of the domain types that intersects at least some possible value of the list. In other terms we consider the normal form of the following set _ ti | σi ∈ item(t)} item(t) ∪ {σi ∧ rj ≡ qi (aj (x1 , . . . , xn )), Dj → bj (qj1 (xjk1 ), . . . , qjm (xjkm )) is translated into: (‘aj , [ x1& JDj (x1 )K ... xn& JDj (xn )K ]) ⇒ ‘bj ,[] if bj ∈ ∆0 (‘aj , [ x1 &JDj (x1 )K ... xn& JDj (xn )K ]) ⇒ ( ‘bj ,((xjk1 ;TR(S ′ , qj1 ),(( . . . ,((xjkm ;TR(S ′ , qjm ),‘nil))))) whereS ′ = S ∪ {qi } otherwise The fact that ∀t ∈ dom(T ), JT (t)K ≡ TR(∅, q0 )JtK is proved by a straightforward induction on t. The only important point to remark is that since T is deterministic, there is exactly one branch of the alternate filter f1| . . . | fn that can be selected by pattern matching for a given input v. For as to why Check(fT ) holds, it is sufficient to remark that each recursive call is made on a strict subtree of the input which guarantees that Check(fT ) returns true. ti ∈D(f ) The idea is then that if {ti }i∈I is the normalized set of the set W above, then the type of grouby is the type [ i∈I ( f (ti ),,[ti +]))*] with the optimization that we can replace the * by a + if we know that the input list is not empty. Lemma 23 (TDTTR 6← filters). Filters are strictly more expressive than TDTTRs. F. Comparison with top-down tree transducers We first show that every Top-down tree transducers with regular look-ahead can be encoded by a filter. We use the definition of [14] for top-down tree transducers: Definition 20 (Top-down Tree transducer with regular look-ahead). A top-down tree transducer with regular look-ahead (TDTTR) is a 5-tuple < Σ, ∆, Q, Qd , R > where Σ is the input alphabet, ∆ is the output alphabet, Q is a set of states, Qd the set of initial states and R a set of rules of the form: q(a(x1 , . . . , xn )), D → b(q1 (xi1 ), . . . , qm (xim )) where a ∈ Σn , b ∈ ∆m , q, q1 ,. . . , qm ∈ Q, ∀j ∈ 1..m, ij ∈ 1..n and D is a mapping from {x1 , . . . , xn } to 2TΣ (TΣ being the set of regular tree languages over alphabet Σ). A TDTTR is deterministic if Qd is a singleton and the left-hand sides of the rules in R are pairwise disjoint. Since our filters encode programs, it only make sense to compare filters and deterministic TDTTR. We first show that given such a deterministic TDTTR we can write an equivalent filter f and, furthermore, that Check(f ) does not fail. First we recall the encoding of ranked labeled trees into the filter data-model: Definition 21 (Tree encoding). Let t ∈ TΣ . We define the treeencoding of t and we write JtK the value defined inductively by: JaK Ja(t1 , . . . , tn )K = = (‘a,[]) (‘a,[ Jt1 K ... Jtn K ]) ∀a ∈ Σ0 ∀a ∈ Σn In particular it is clear than when S is regular, JSK is a type. ∀t ∈ dom(T ), JT (t)K ≡ fT JtK Proof. The encoding is as follows. For every state qi ∈ Q, we will introduce a recursion variable Xi . Formally, the translation is performed by the function TR : 2Q × Q → Filters defined as: x ⇒ Xi x µXi .(f1| . . . | fn ) → → → → → → a(q1 (x)) a(a) a(b) b(q2 (x)) b(a) b(b) where Σ = ∆ = {a, b}, Q = {q0, q1, q2}, Qd = {q0 } and D = {x 7→ TΣ }. It is however impossible to write a TDTTR that replaces a leaf with a copy of the whole input, for inputs of arbitrary size. A similar example is used in [13] to show that TDTTR and bottom-up tree transducers are not comparable. Lemma 22 (TDTTR → filters). Let T =< Σ, ∆, Q, {q0 }, R > be a deterministic TDTTR. There exists a filter fT such that: = = This filter works on monadic trees of the form u1 (. . . un−1 (un ) . . .) where ui ∈ {a, b}, and essentially replaces the leaf un of a tree t by a copy of t itself. This cannot be done by a TDTTR. Indeed, TDTTR have only two ways to “remember” a subtree and copy it. One is of course by using variables; but their scope is restricted to a rule and therefore an arbitrary subtree can only be copied at a fixed distance of its original position. For instance in a rule of the form q(a(x)), D → a(q1 (x), b(b(q1 (x)))), assuming than q1 copies its input, the copy of the original subtree is two-levels down from its next sibling but it cannot be arbitrary far. A second way to copy a subtree is to remember it using the states. Indeed, states can encode the knowledge that the TDTTR has accumulated along a path. However, since the number of states is finite, the only thing that a TDTTR can do is copy a fixed path. For instance for any given n, there exists a TDTTR that performs the transformation above, for trees of height n (it has essentially 2n − 1 states which remember every possible path taken). For instance for n = 2, the TDTTR is: q0 (a(x)), D q1 (a()), D q1 (b()), D q0 (b(x)), D q2 (a()), D q2 (b()), D where the list notation [ v1 ... vn ] is a short-hand for (v1 , ..., (vn , ‘nil)). We generalize this encoding to tree languages and types. Let S ⊆ Tσ , we write JSK the set of values such that ∀t ∈ S, JtK ∈ JSK. TR(S, qi ) TR(S, qi ) Proof. Even if we restrict filters to have the same domain as TDTTRs (meaning, we used a fixed input alphabet Σ for atomic types) we can define a filter that cannot be expressed by a TDTTR. For instance consider the filter: y ⇒ (µX.((‘a,,‘nil)) ⇒ y |( ‘b,,‘nil)) ⇒ y |( ‘a,,[x])) ⇒ (‘a, [ X x ])) |( ‘b,,[x])) ⇒ (‘b, [ X x ])) G. Operators on record types. We use the theory of records defined for CDuce. We summarize here the main definitions. These are adapted from those given in Chapter 9 of Alain Frisch’s PhD thesis [15] where the interested if qi ∈ S if qi ∈ /S 24 2013/3/8 3. if r2 (ℓ) may be undefined (ie, r2 (ℓ) = t||⊥ for some type t), then we take the union of the two corresponding fields since it can results either in r1 (ℓ) or r2 (ℓ) according to whether the record typed by r2 is undefined in ℓ or not: (r1 + r2 )(ℓ) = r1 (ℓ)||(r2 (ℓ) \ ⊥). reader can also find detailed definitions of the semantic interpretation of record types and of the subtyping relation it induces, the modifications that must be done to the algorithm to decide it, finer details on pattern matching definition and compilation techniques for record types and expressions. Let Z denote some set, a function r : L → Z is quasi-constant if there exists z ∈ Z such that the set {ℓ∈L | r(ℓ) 6= z} is finite; in this case we denote this set by dom(r) and the element z by def(r). We use L _ Z to denote the set of quasi-constant functions from L to Z and the notation {ℓ1 = z1 , . . . , ℓn = zn , _ = z} to denote the quasi-constant function r : L _ Z defined by r(ℓi ) = zi for i = 1..n and r(ℓ) = z for ℓ ∈ L \ {ℓ1 , . . . , ℓn }. Although this notation is not univocal (unless we require zi 6= z), this is largely sufficient for the purposes of this section. Let ⊥ be a distinguished constant, then the sets string _ Types ∪ {⊥} and string _ Values ∪ {⊥} denote the set of all record types expressions and of all record values, respectively. The constant ⊥ represents the value of the fields of a record that are “undefined”. To ease the presentation we use the same notation both for a constant and the singleton type that contains it: so when ⊥ occurs in L _ Values ∪ {⊥} it denotes a value, while in string _ Types ∪ {⊥} it denotes the singleton type that contains only the value ⊥. Given the definitions above, it is clear that the record types in Definition 2 are nothing but specific notations for some quasiconstant functions in string _ Types ∪ {⊥}. More precisely, the open record type expression { ℓ1 :t1 , . . . , ℓn :tn , .. ..}} denotes the quasi-constant function {ℓ1 = t1 , . . . , ℓn = tn , _ = any} while the closed record type expression { ℓ1 :t1 , . . . , ℓn :tn} denotes the quasi-constant function {ℓ1 = t1 , . . . , ℓn = tn , _ = ⊥}. Similarly, the optional field notation { ..., ℓ?:t, ...}} denotes the record type expressions in which ℓ is mapped either to ⊥ or to the type t, that is, {..., ℓ = t | ⊥, ...}. Let t be a type and r1 , r2 two record type expressions, that is r1 , r2 : string _ Types ∪ {⊥}. The merge of r1 , and r2 with respect to t, noted ⊕t and used infix, is the record type expression defined as follows:  &t ≤ empty def r1 (ℓ) if r1 (ℓ)& (r1 ⊕t r2 )(ℓ) = (r1 (ℓ) \ t)||r2 (ℓ) otherwise This explains all the examples we gave in the main text. In particular, { a:int, b:int}} + { a?:bool}} = { a:int||bool, b:int}} since “a” may be undefined in the right hand-side record while “b” is undefined in it, and { a:int}} + { ..}} = { ..}}, since “a” in the right hand-side record is defined (with a 7→ any) and therefore has priority over the corresponding definition in the left hand-side record. H. Encoding of Co-grouping As shown in Section 5.2, our groupby operator can encode JaQL’s group each x = e as y by e′ , where e computes the grouping key, and for each distinct key, e′ is evaluated in the environment where x is bound to the key and y is bound to the sequence of elements in the input having that key. Co-grouping is expressed by: group l1 by x = e1 as y1 . . . ln by x = en as yn into e Co-grouping is encoded by the following composition of filters: [ Jl1 K ... Jln K ]; [ Transform[x ⇒ (1, x)] ... Transform[x ⇒ (n, x)] ]; Expand; groupby (((1,, $)) ⇒ Je1 K | . . . |( n,, $)) ⇒ Jen K); Transform[ ( x,,l)) ⇒ ([(l;Rgrp1)...(l; Rgrpn)]; [y1 , . . . , yn ] ⇒ JeK )] where let filter Rgrpi = ‘nil => ‘nil | ((i,x),tail) => (x , Rgrpi tail) | _ => Rgrpi tail Essentially, the co-grouping encoding takes as argument a sequence of sequences of values (the n sequences to co-group). Each of these n sequence, is tagged with an integer i. Then we flatten this sequences of tagged values. We can on this single sequence apply our groupby operator and modify each key selector ei so that it is only applied to a value tagged with integer i. Once this is done, we obtain a sequence of pairs (k, l) where k is the commen grouping key and l a sequence of tagged values. We only have to apply the auxiliary Regrp filter which extracts the n subsequences from l (tagged with 1..n) and removes the integer tag for each value. Lastly we can call the recombining expression e which has in scope x bound to the current grouping key and y1 ,. . . ,yn bound to each of the sequences of values from input l1 , . . . ,ln whose grouping key is x. Recall that by Lemma 11 a record type (ie, a subtype of {..}) is equivalent to a finite union of record type expressions (ie, quasiconstant functions in string _ Types ∪ {⊥}). So the definition of merge can be easily extended to all record types as follows _ _ ′ def _ ( r i ) ⊕t ( rj ) = (ri ⊕t rj′ ) i∈I j∈J i∈I,j∈J Finally, all the operators we used for the typing of records in the rules of Section 4.2 are defined in terms of the merge operator: t1 + t2 = def t2 ⊕⊥ t1 (1) t\ℓ def {ℓ = ⊥, _ = c0 } ⊕c0 t (2) = where c0 is any constant different from ⊥ (the semantics of the operator does not depend on the choice of c0 as long as it is different from ⊥). Notice in particular that the result of the concatenation of two record type expressions r1 + r2 may result for each field ℓ in three different outcomes: 1. if r2 (ℓ) does not contain ⊥ (ie, the field ℓ is surely defined), then we take the corresponding field of r2 : (r1 + r2 )(ℓ) = r2 (ℓ) 2. if r2 (ℓ) is undefined (ie, r2 (ℓ) = ⊥), then we take the corresponding field of r1 : (r1 + r2 )(ℓ) = r1 (ℓ) 25 2013/3/8 This figure "xhtml.png" is available in "png" format from: http://arxiv.org/ps/1303.1716v1
6cs.PL
1 Joint Source-Channel Secrecy Using Uncoded Schemes: Towards Secure Source Broadcast Lei Yu, Houqiang Li, Senior Member, IEEE, and Weiping Li, Fellow, IEEE arXiv:1607.07040v3 [cs.IT] 22 Jul 2017 Abstract This paper investigates a joint source-channel secrecy problem for the Shannon cipher broadcast system. We suppose list secrecy is applied, i.e., a wiretapper is allowed to produce a list of reconstruction sequences and the secrecy is measured by the minimum distortion over the entire list. For discrete communication cases, we propose a permutation-based uncoded scheme, which cascades a random permutation with a symbol-by-symbol mapping. Using this scheme, we derive an inner bound for the admissible region of secret key rate, list rate, wiretapper distortion, and distortions of legitimate users. For the converse part, we easily obtain an outer bound for the admissible region from an existing result. Comparing the outer bound with the inner bound shows that the proposed scheme is optimal under certain conditions. Besides, we extend the proposed scheme to the scalar and vector Gaussian communication scenarios, and characterize the corresponding performance as well. For these two cases, we also propose another uncoded scheme, orthogonal-transform-based scheme, which achieves the same performance as the permutationbased scheme. Interestingly, by introducing the random permutation or the random orthogonal transform into the traditional uncoded scheme, the proposed uncoded schemes, on one hand, provide a certain level of secrecy, and on the other hand, do not lose any performance in terms of the distortions for legitimate users. Index Terms Uncoded scheme, secrecy, permutation, orthogonal transform, Shannon cipher system. I. I NTRODUCTION Investigations on joint source-channel coding (JSCC) could trace back to Shannon’s pioneering work [1], where a geometric method was developed to design a communication system. For the JSCC of transmitting a Gaussian source over a Gaussian broadcast channel, Goblick observed [2] that when the source and channel bandwidths are matched (i.e., one channel use per source sample), directly sending a scaled version of the source samples on the channel (i.e., linear scheme) is in fact optimal; while for this case the separation scheme that cascades source coding with channel coding indeed suffers a performance loss [3]. For vector Gaussian communication cases, the optimal linear coding was studied in [4]. In general, the schemes that consist of symbol-by-symbol mappings (not limited to the linear one) are named uncoded schemes. The optimality of uncoded schemes for the general source-channel pair L. Yu is with the Department of Electrical and Computer Engineering, National University of Singapore, Singapore (e-mail: [email protected]). This work was done when he was at University of Science and Technology of China. H. Li and W. Li are with the Department of Electronic Engineering and Information Science, University of Science and Technology of China, Hefei, China (e-mail: {lihq,wpli}@ustc.edu.cn). 2 has been investigated in [3], which showed that the Shannon limit can be achieved by uncoded schemes only when the source and channel satisfy a certain probabilistic matching condition. To further improve the performance for mismatched source-channel pairs, the hybrid coding (or hybrid digital-analog coding) has been studied in [5]-[10], which combines the traditional digital coding and symbol-by-symbol mapping together. As for the converse part of JSCC problem, Reznic et al. [11] and Tian et al. [12] derived some nontrivial converse results for Gaussian source broadcast problem. Besides, Yu et al. [9], [10] generalized the achievability and converse results for the Gaussian communication to the general source-channel case. On information-theoretic security, the Shannon cipher system (the noisy broadcast version depicted in Fig. 1) was first investigated in Shannon’s pioneering work [13], where a sender A communicates with a legitimate receiver B secretly by exploiting a shared secret key. For lossy source communication, wiretapper might only want to decrypt a lossy version of the source. Schieler et al. [14] studied a distortion-based secrecy measure in the Shannon cipher system around the assumption that the wiretapper has ability to conduct list decoding with fixed list size, and the secrecy is measured by the minimum distortion over the entire list. Yu et al. [15] showed that the systems with this secrecy measure are equivalent to those with secrecy measured by a new quantity lossy-equivocation, which could be considered as a lossy extension of the traditional equivocation. Hence the list secrecy is closely related to the traditional equivocation as well. Furthermore, Yu et al. used this secrecy measure to study the problem of source-channel secrecy for the Shannon cipher system, and showed that for the source-channel pair satisfying certain conditions, an uncoded scheme could outperform the separate one. JSCC improves the robustness of communication or the performance of broadcast, while secrecy coding improves the security of communication by exploiting the secret key and/or the wiretap channel. Therefore, intuitively the robustness and the security could be obtained simultaneously if we combine JSCC and secrecy coding together. This joint source-channel secrecy (JSCS) problem has been considered in several works already. Yamamoto in [16] studied the secure lossy transmission over the noisy wiretap channel with secrecy measured by the wiretapper’s best reconstruction distortion. However, it is shown in [14] this secrecy measure is cheap and fragile, since only one bit of secret key suffices to achieve the optimality of secrecy, and meanwhile, only one bit of additional information for the wiretapper suffices to decrypt this optimal encryption scheme. A different formulation of the problem was considered in [17], where the authors assumed there is a fixed information leakage to the wiretapper and wish to minimize the distortion at the legitimate receiver, while at the same time providing a graceful distortion degradation when there is an SNR (Signal Noise Ratio) mismatch. They showed that, for a positive leakage, this can be achieved by a hybrid digital-analog coding. This scenario was extended to consider side information at the receiver in [18] or side information at the sender in [19]. Analog encryption (or analog scrambling) technologies, e.g., sign-change based scheme [20], permutation based scheme [20] and bandwidth-keeping scheme [21], can be seen as uncoded JSCS schemes as well, although they are not designed for a specified source-channel pair. Sign-change based scheme improves secrecy by changing the sign of each sample according to the secret key. But owing to at most one bit secret key used per sample, this scheme could not provide higher secrecy even with a higher key rate available. The permutation based scheme improves secrecy by shuffling the positions of samples. Unlike the sign-change based scheme, it supports any arbitrarily high 3 key rate. Furthermore, Kang and Liu [23] recently applied the permutation operation in a digital encryption scheme, and showed that the permutation is another powerful encryption technique (besides the one-time pad) to achieve the optimality of secrecy. A. Contributions In this paper, we consider the joint source-channel secrecy problem of secure source broadcast in the bandwidthmatched Shannon cipher system (see Fig. 1). The list secrecy [14] is used to measure secrecy, that is, the wiretapper is allowed to conduct list decoding with fixed list size, and the secrecy is measured by the minimum distortion over the entire list. We study an achievable region of secret key rate, list rate, wiretapper distortion, and distortions of all legitimate users and show optimality under certain conditions. Our contributions are as follows: 1) For the discrete source case, we propose a permutation-based uncoded scheme, which cascades a random permutation with a symbol-by-symbol mapping. Our scheme differs from the permutation based scheme proposed in [23] in two main aspects: 1) our scheme, coupling a permutation operation with a traditional uncoded scheme, is designed for the source-channel secrecy problem, however, the scheme in [23] couples a permutation operation with a digital scheme, and is designed for the source-secrecy coding problem; 2) in addition to the finite alphabet case, we also extend the scheme to source-channel pairs with countably infinite alphabets and Gaussian source-channel pairs, which require us to use some more powerful techniques, including unified typicality, d´tilted information, and geometric analysis. By analyzing the proposed scheme, we provide an inner bound for the admissible region. For the converse part, we give an outer bound by using our recent result [15]. Comparing the outer bound with the inner bound shows that the proposed scheme is optimal under certain conditions. 2) We extend the proposed scheme to scalar and vector bandwidth-matched Gaussian communication scenarios. For these two cases, we also propose another uncoded scheme, orthogonal-transform-based scheme, which achieves the same inner bounds as the one achieved by the permutation-based scheme. Interestingly, by introducing the random permutation or the random orthogonal transform into the traditional uncoded scheme, the proposed uncoded schemes, no matter for the discrete source case or the Gaussian source-channel case, on one hand, provide a certain level of secrecy, and on the other hand, do not lose any performance in terms of the distortions for legitimate users. Schieler and Cuff [14] studied the list secrecy problem for the noiseless point-to-point1 version of Shannon cipher system, and showed a digital scheme, in which the secret key is used to choose a source codebook to code the source sequence, is optimal. For this problem, a separate coding, cascading source coding and one-time pad, has been proven optimal as well [15]. Yu et al. [15] extended this problem to the noisy channel case, and showed that the separate strategy (cascading source coding, one-time pad, and channel coding) is suboptimal in general and a single-letter uncoded scheme could outperform the separate scheme. In this paper we extend 1 Here system. the word noiseless means the wiretap channel is noiseless, and the word point-to-point means there is only one legitimate user in the 4 Key K   2nRK  Y1n Sn A Xn B1 Sˆ1n n PY1Y2 Z | X Y2 Zn B2 Sˆ2n Eve Fig. 1. The Shannon cipher broadcast system. the problem to noisy broadcast scenarios, and propose two kind of uncoded schemes that adopt two different encryption strategies—random permutation and random orthogonal-transform (instead of the traditional one-time pad encryption). We show the proposed uncoded schemes could achieve the optimality under certain cases. The rest of the paper is organized as follows. Section II formulates the joint source-channel secrecy problem. Section III proposes a permutation-based uncoded scheme for the discrete communication, and analyzed the corresponding performance. Sections IV and V extend the proposed scheme to the scalar and vector Gaussian communications respectively, and another scheme, orthogonal-transform based scheme, is also proposed in these two sections. Finally, Section VI concludes the paper. II. P ROBLEM F ORMULATION A. Problem setup Consider a bandwidth-matched2 Shannon cipher broadcast system with two legitimate users3 shown in Fig. 1, where a sender A and two legitimate receivers B1 and B2 share a secret key K that is uniformly distributed over “ nR ‰4 2 K and independent of a source S n . The sender A observes the discrete memoryless (DM) source sequence S n with each element i.i.d. (independent and identically distributed) according to PS , and then transmits it to the legitimate users B1 and B2 over a DM wiretap broadcast channel PY1 Y2 Z|X confidentially by utilizing the secret key and the wiretap channel. Finally, the legitimate users B1 and B2 produce source reconstructions Sp1n and Sp2n , respectively. Definition 1. An pn, RK q block code consists of “ ‰ 1) Encoder: ϕ : S n ˆ 2nRK ÞÑ X n ; 2 Although here we consider a bandwidth-matched communication system, our results in this section are easy to be extended to any bandwidth- mismatched system since any system with source-channel bandwidth ratio ns nc can be converted into a bandwidth-matched system, by considering ns source symbols and nc channel symbols as a source supersymbol and a channel supersymbol, respectively. 3 Although we only consider the system with two legitimate users, our results derived in this paper can be easily extended to the cases with more legitimate users. 4 In this paper, the set t1, ..., mu is sometimes denoted by rms. 5 “ ‰ 2) Decoders: ψi : Yin ˆ 2nRK ÞÑ Spin , i “ 1, 2. The encoder and decoders can be stochastic. Another output Z n of the channel is accessed by a wiretapper Eve. Based on Z n , the wiretapper produces a list LpZ n q Ď Sqn and the induced distortion is set to the minimum one over the entire list, i.e., minsqn PLpZ n q dE pS n , sqn q, řn where dE psn , sqn q fi n1 t“1 dE pst , sqt q is a distortion measure for the wiretapper. For given distortion levels D0 , D1 , D2 , Nodes A and B1, B2 want to communicate the source within distortions D1 , D2 (for B1 and B2 respectively) by exploiting the secret key and the wiretap channel, while ensuring that the wiretapper’s strategy always suffers distortion above D0 with high probability. Definition 2. The tuple pRK , RL , D0 , D1 , D2 q is achievable if there exists a sequence of pn, RK q codes such that @ ą 0, 1) Distortion constraint: ” ı nÑ8 P dB pS n , Spin q ď Di `  ÝÝÝÑ 1, i “ 1, 2; where dB psn , spn q fi řn 1 n t“1 (1) dB pst , spt q5 is a distortion measure for the legitimate users; 2) Secrecy constraint: minn Ln pz q: 1 log |Ln |ďRL ´ lim supnÑ8 n ” P ı nÑ8 n n q d pS , s q ě D ´  ÝÝÝÑ 1. min E 0 n n sq PLpZ q (2) Definition 3. The admissible region R fi tAchievable pRK , RL , D0 , D1 , D2 qu. We assume that the wiretapper knows the pn, RK q code and the distributions PS and PY1 Y2 Z|X . B. Henchman problem The problem above is equivalent to the henchman problem [14], in which wiretapper reconstructs a single sequence with the help of a rate-limited henchman who can access to the source S n and the wiretapper’s observation Z n . As depicted in Fig. 2, the wiretapper receives the best possible nRn bits from the henchman to assist in producing a reconstruction sequence Sqn . Definition 4. The Rn henchman code (Hcode) of a pn, RK q block code consists of “ ‰ 1) Encoder: ϕH : S n ˆ Z n ÞÑ 2nRn ; “ ‰ 2) Decoder: ψH : 2nRn ˆ Z n ÞÑ Sqn . We assume that the wiretapper and henchman are aware of the pn, RK q block code adopted by Nodes A and B, and they cooperate to design a henchman code based on the pn, RK q block code. Definition 5. The tuple pRK , RL , D0 , D1 , D2 q is achievable in the henchman problem if there exists a sequence of pn, RK q codes such that @ ą 0, 5 For simplicity, we only consider the legitimate users have the same distortion measure. Note that our results derived in this paper still hold for the case with different distortion measures. 6 Key K   2nRK  Y1n Sn A B1 n PY1Y2 Z | X Y2 Xn B2  Zn S n Sˆ1n Eve ,Zn Henchman S Sˆ2n n M   2nRL  Fig. 2. Henchman problem. 1) Distortion constraint: (1); 2) Secrecy constraint: min Rn Hcodes: lim supnÑ8 Rn ďRL ´ ” ı nÑ8 P dE pS n , Sqn q ě D0 ´  ÝÝÝÑ 1. (3) The equivalence between the list secrecy problem and the henchman problem, shown in the following proposition, has been proven by Schieler and Cuff [14, Prop. 1]. Proposition 1. [14] The tuple pRK , RL , D0 , D1 , D2 q is achievable in the list reconstruction problem if and only if it is achievable in the henchman problem. Furthermore, the list secrecy problem and henchman problem are also equivalent to a lossy-equivocation secrecy problem; see [15]. In addition to the DM system, we also consider the Shannon cipher system with a Gaussian source S „ N p0, λq transmitted over a power-constrained Gaussian wiretap broadcast channel Yi “ X ` Vi , i “ 1, 2, (4) Z “ X ` V0 , (5) where Vi , i “ 0, 1, 2 are zero-mean additive Gaussian noises with variances Ni , i “ 0, 1, 2, independent of X. For this case, the constraint on channel input power “ ‰ nÑ8 P ρ pX n q ď P `  ÝÝÝÑ 1, @ ą 0, should be added to Definitions 2 and 5, where ρ pxn q “ 1 n řn i“1 (6) x2i . For the system involving the channel power constraint, Proposition 1 still holds. III. D ISCRETE C OMMUNICATION A. Permutation based Scheme (Finite Alphabets) In this section, we propose a secure uncoded scheme by coupling the permutation operation with the traditional uncoded JSCC scheme. The uncoded scheme for JSCC system (with two receivers) consists of three symbol-by- 7 symbol mappings: x psq , sp1 py1 q, sp2 py2 q. The induced distortions are Di “ EdB pS, spi pYi qq, i “ 1, 2. It is easy to show that we can benefit from replacing the encoder x psq with a stochastic one PX|S when secrecy is considered řn for the system. On the other hand, observe that dB psn , spni q “ n1 t“1 dB pst , spi,t q “ ETsn ,spn dB ps, spi q, where Tsn ,psni i denotes the joint type (empirical distribution) of psn , spni q. That is, the induced distortions only depend on the joint type of source and reconstruction sequences. Therefore, if we want to improve the secrecy of a scheme and at the same time retain the induced distortions unchanged, we only need to require the encryption and decryption operations does not change the joint type of source and reconstruction sequences. That is, for the encryption s1n psn , kq and s1n “ Tsn ,psni . To that end, here we consider a random permutation as the the decryption spni pp s1n i , kq, we require Ts1n ,p i encryption operation, and the inverse permutation as the decryption operation. Obviously, the permutation and its inverse operation do not change the joint type of the source sequence and its reconstructions. “ ‰( Codebook (Public Key) Generation: Generate a permutation set C “ Ψk , k P 2nRK with each element uniformly at random and independently selected from the set of permutations of rns (which is denoted as Sn ). As a public key, the codebook C is revealed to the sender and all the receivers (including the wiretapper). Encoding: Upon observing a source sequence sn and a key k , the encoder first generates s1n “ Ψk psn q , and then generates xn according to śn t“1 (7) PX|S pxt |s1t q. Here for a permutation sequence Ψk “ σ n , Ψk psn q fi psσ1 , sσ2 , ..., sσn q denotes the permutation operation on sn (more precisely, on the indices of sn ) respect to the permutation sequence Ψk .6 Decoding (for Legitimate Users): For the legitimate user Bi, i “ 1, 2, upon the received sequence yin and the key k, the decoder first reconstructs s1n as sp1i,t “ spi pyi,t q, t P rns, (8) by using the symbol-by-symbol mapping spi p¨q, and then produces spni “ Ψ´1 s1n i q, k pp (9) by using the inverse permutation operation Ψ´1 k p¨q of Ψk p¨q. The proposed scheme above cascades a random permutation operation with the traditional uncoded JSCC scheme. The uncoded JSCC part provide a graceful degradation of the source for legitimate users with different channel qualities. The random permutation operation part that shifts the sequence in the same type provides a certain level of secrecy. Next we will analyze the asymptotic performance of the proposed scheme as blocklength n goes to infinity. At first, we need introduce some basic properties of the random codebook C. Observe that for any permutation sequence Ψ, the mapping between Ψ p¨q and Ψ´1 p¨q is bijective, hence we have the following lemma. 6 In this paper, the permutation sequence is termed as permutation sequence, and to distinguish from it, the permutation mapping from one sequence to another sequence is termed as permutation operation. When there is no disambiguation, we call both of them permutation. 8 Lemma 1. Suppose Ψ is a permutation sequence uniformly at random selected from Sn , the set of permutations of rns. Then Ψ´1 is also uniformly distributed on Sn , and moreover for any permutation sequence ψ P Sn , both Ψ pψq and Ψ´1 pψq also have the uniform distribution on Sn . Utilizing Lemma 1, we can establish the following lemma. Lemma 2. Suppose Ψ is a permutation sequence uniformly at random selected from Sn . Then Ψ psn q transforms an arbitrary sequence sn P S n into a random sequence that is uniformly distributed on the set of sequences of type Tsn (the type class of Tsn ). Moreover, for finite S, the set of sequences of type Tsn has cardinality 2npHpTsn q´op1qq , and hence “ ‰ P Ψ psn q “ s1n “ 2´npHpTsn q´op1qq 1 tTs1n “ Tsn u , s1n P S n , (10) where op1q denotes a term tending zero as n Ñ 8. Proof: ÿ “ ‰ P Ψ psn q “ s1n “ P pΨ “ ψq (11) 1 n! (12) ψPSn :ψpsn q“s1n ÿ “ ψPSn :ψpsn q“s1n ś pnTsn psqq! 1 tTs1n “ Tsn u n! 1 tTsn “ Ts1n u , “ |ts1n P S n : Ts1n “ Tsn u| “ sPS where (14) follows from |ts1n P S n : Ts1n “ Tsn u| “ n! ś sPS pnTs n psqq! (13) (14) . This implies Ψ psn q transforms an arbitrary sequence sn P S n into a random sequence uniformly distributed on the set of sequences of type Tsn . From the type counting lemma [29, Lem. 2.3], we have that for finite S, pn ` 1q ´|S| ˇ (ˇ 2nHpTsn q ď ˇ s1n P S n : Ts1n “ Tsn ˇ ď 2nHpTsn q . (15) Hence |ts1n P S n : Ts1n “ Tsn u| “ 2npHpTsn q´op1qq . Combining it with (14) gives us “ ‰ P Ψ psn q “ s1n “ 2´npHpTsn q´op1qq 1 tTs1n “ Tsn u . (16) Lemma 2 shows a nice property of the random permutation operation: The resulting sequence will be uniformly distributed on the set of sequences of type Tsn for the input sequence sn , if the permutation is randomly and uniformly chosen from the set of permutations of rns. Utilizing this property, we can characterize the performance of the proposed scheme, as shown in the following theorem. The proof of this theorem is given in Appendix A. 9 Theorem 1 (Permutation based Scheme for Finite Alphabets). For DM communication with finite alphabets q X , Z, Yi , Spi , i “ 1, 2 are all finite), the permutation based scheme above achieves the region Rpiq Ď R, (S, S, where Rpiq $ ’ ’ ’ pRK , RL , D0 , D1 , D2 q : ď & fi D ě minspi EdB pS, spi pYi qq, i “ 1, 2, ’ i PX|S ’ ’ % R ď min R ` R pD q, R pD q( L K S|Z 0 S 0 , / / / . , (17) / / / - with pS, Y1 , Y2 , Zq „ ÿ PS PX|S PY1 Y2 Z|X , (18) x RS pDq “ min q IpS; Sq (19) q IpS; S|Zq (20) q PS|S q :EdE pS,SqďD denoting the rate-distortion function of S, and RS|Z pDq “ min q PS|SZ :EdE pS,SqďD q denoting the conditional rate-distortion function of S given two-sided information Z. Note that for the Rpiq above, the components pD1 , D2 q and the components pRK , RL , D0 q depend on each other through PX|S . Observe that for a given PX|S , minspi EdB pS, spi pYi qq, i “ 1, 2 are the minimal distortions that the legitimate users can achieve even for the non-secrecy communication case. On the other hand, min RK ` RS|Z pD0 q, RS pD0 q is larger than RS|Z pD0 q, the optimal RL can be achieved by uncoded schemes when there is no key. Hence compared with traditional uncoded schemes, the proposed scheme, on one hand, improves improve the performance of secrecy to a certain extent, and on the other hand, does not lose any performance in terms of the distortions of legitimate users. The first constraint of Rpiq is consistent with the performance of traditional uncoded schemes. The second constraint of Rpiq , roughly speaking, follows from the following argument. On one hand, the henchman and the wiretapper can ignore the signal Z n altogether and use a RS pD0 q-rate point-to-point source code to describe S n within distortion D0 . On the other hand, the proposed scheme forces the wiretapper’s optimal strategy to be an indirect guessing strategy: First, the wiretapper decrypts the secret key by using RK rate; then upon the observation Z n , the wiretapper reconstructs the sequence S 1n within distortion D0 by using rate RS|Z pD0 q (denote the reconstruction as Sq1n ); finally, upon the secret key and Sq1n , the wiretapper reconstructs the source S n as n 1n q1n qn Sqn “ Ψ´1 and Sq1n , since the k pS q. Obviously the distortion between S and S is the same as that between S average distortion only depends the joint type of the sequences. Hence the wiretapper needs rate RK ` RS|Z pD0 q to achieve the distortion D0 . Now we consider a special case: sending a binary source over a binary wiretap broadcast channel. For the binary ` ˘ communication, the source is a Bernoulli source S „ Bern 21 with the Hamming distortion measure dB ps, spq “ dE ps, spq fi 0, if s “ sp; 1, otherwise. The binary wiretap broadcast channel is Yi “ X ‘ Vi , i “ 1, 2, Z “ X ‘ V0 with Vi „ Bern ppi q , V0 „ Bern pp0 q , 0 ď p0 , p1 , p2 ď 12 . Set X “ S ‘ E with E „ Bernpp1 q. Then from Theorem 1, we get the following corollary. ( 10 Corollary 1 (Binary Communication). For the binary communication above, we have Rpiq Ď R, where $ , ’ / / ’ pR , R , D , D , D q : K L 0 1 2 ’ / . ď & piq 1 R fi , Di ě p ‹ pi , i “ 1, 2, ’ ! ) / / ’ 0ďp1 ď 21 ’ % RL ď min RK ` rH2 pp1 ‹ p0 q ´ H2 pD0 qs` , r1 ´ H2 pD0 qs` / ` with rxs fi max t0, xu, ‹ denoting the binary convolution, i.e., x ‹ y “ p1 ´ xqy ` xp1 ´ yq, (21) and H2 denoting the binary entropy function, i.e., H2 ppq “ ´p log p ´ p1 ´ pq logp1 ´ pq. (22) B. Permutation based Scheme (More General Alphabets) Theorem 1 can be extended to more general alphabets cases, as shown in the following theorem. The proof of this theorem is given in Appendix C. Theorem 2 (Permutation based Scheme for More General Alphabets). Assume S is countable, Sq is finite, and X , Z, Yi , Spi , i “ 1, 2 are general7 . Assume H pSq is finite, and PS satisfies ˆ ˙ ˆ ˙ n 1 “o , NPS n log n ˆ ˙ ˆ ˙ 1 1 “o , ΦPS n log n ˆ ˙ ˆ ˙ δ n rP “o , @0 ă δ ď 1, N S log n log2 n (23) (24) (25) where NPS pαq fi |ts : PS psq ě αu| denotes the number of probability values that are not smaller than α, ř rP pβq fi minα:Φ pαqďβ NP pαq ΦPS pαq fi s:PS psqăα PS psq denotes the sum of probability values that are smaller than α, N S S PS denotes the minimum number N such that the sum of the probability values except N largest ones is not larger than β. Then Theorem 1 still holds. Remark 1. The conditions (23)-(25) is equivalent to as x Ó 0,8 ˆ ˙ 1 , NPS pxq “ o x log x1 ˆ ˙ 1 ΦPS pxq “ o , log x1 ¯ ´ rP pxq “ o x2 e xδ , @0 ă δ ď 1. N S (26) (27) (28) Remark 2. The conditions (23)-(25) require that the sequence PS psq , s P S should vanish as fast as possible. Obviously, (23)-(25) hold for any finite S. Besides, for any countably infinite S, it is easy to verify that any distribution PS such that PS psq “ o ps´α q , s “ 1, 2, ...9 for some α ą 1 satisfies (23)-(25) as well. However, if 7 An alphabet is countable means that it is either finite or countably infinite. An alphabet is general means that it is either countable or uncountable (e.g., continuous). 8 This claim holds when we ignore n is an integer in (23)-(25). 9 Without loss of generality, any countably infinite S can be converted into t1, 2, 3, ...u by some bijective mapping. 11 PS psq converges slower than or as slow as 1 s, then ř sě1 PS psq does not converge, and hence PS cannot be a probability distribution. This implies Theorem 2 holds for almost all probability distributions. Note that for a countably infinite alphabet S, we need the conditions (23)-(25) to guarantee the existence of a high-probability set (unified typicality set), for each sequence of which, Lemma 2 still holds. This further makes Theorem 2 hold, just as done for the finite alphabets case. C. Outer Bound For the system with a single legitimate user (remove the legitimate user B2 from the system in Fig. 1), the following outer bound for the admissible region of pRK , RL , D0 , D1 q has been proven by us recently [15]. Lemma 3. [15] For the DM communication with only one legitimate user, $ ’ ’ pRK , RL , D0 , D1 q : C1 ě IpS; Sp1 q, ’ ’ ’ ’ ď & D1 ě EdB pS, Sp1 q, poq ! ´ ¯ R Ď R fi ’ RL ď min RK ` Γ IpS; Sp1 q, PY |X , PZ|X ` R p pD0 q, PSp |S ’ 1 S|S1 ’ 1 ’ ) ’ ’ % R pD q S 0 , / / / / / / . , / / / / / / - where C1 denotes the channel capacity for the legitimate user, and ˘ ` Γ R, PY |X , PZ|X fi min max QY Z|X :QY |X “PY |X , QX :IQ pX;Y qěR QZ|X “PZ|X IQ pX; Y |Zq (29) with IQ p¨q denoting the mutual information under distribution QX QY Z|X , is a function specified by the wiretap channel. The first two constraints of Rpoq follow from the source-channel coding theorem [30], and the last constraint follows from an indirect decryption strategy for the wiretapper: Roughly speaking, the wiretapper first reconstructs Sp1n using rate ΓpIpS; Sp1 q, PY1 |X , PZ|X q, next decrypts the secret key using rate RK , then upon Y1n and secret key, produces the legitimate user’s reconstruction Sp1n , and finally upon Sp1n produces a final reconstruction Sqn using rate RS|Sp1 pD0 q. The details can be seen in [15]. By applying this lemma to the system with two legitimate users (the system considered in this paper), the following outer bound is immediate. Theorem 3 (Outer Bound). For the DM communication (with two legitimate users), $ ’ ’ ’ pRK , RL , D0 , D1 , D2 q : Ci ě IpS; Spi q, ď & R Ď Rpoq fi Di ě EdB pS, Spi q, i “ 1, 2, ’ ’ PSp Sp |S ’ 1 2 % R ď min tR , R , R pD qu L 1 2 S 0 , / / / . , / / / - where Ci denotes the channel capacity for the legitimate user i, and ´ ¯ Ri “ RK ` Γ IpS; Spi q, PYi |X , PZ|X ` RS|Spi pD0 q, i “ 1, 2. When specialized to the binary communication, we have the following corollary. (30) 12 Corollary 2 (Binary Communication). For binary communication, $ ’ ’ pRK , RL , D0 , D1 , D2 q : ’ & poq R Ď R fi Di ě pi , i “ 1, 2, ’ ! ) ’ ’ % RL ď min R1 , R2 , r1 ´ H2 pD0 qs` , / / / . . / / / - where ` ` Ri “ RK ` rH2 pp0 q ´ H2 ppi qs ` rH2 pDi q ´ H2 pD0 qs , i “ 1, 2. (31) Comparing Theorem 1 and Corollary 2, we can identify the optimality of the proposed scheme for binary communication. Theorem 4 (Optimality of the Proposed Scheme). For the binary communication (with 2 legitimate users), the proposed uncoded scheme is optimal if p0 ď pi ď Di ď D0 or p0 ě pi “ Di ě D0 holds for i “ 1 or 2. Remark 3. Theorem 4 implies under conditions that compared with one of legitimate users, the wiretapper has a better channel and wants to produce a worse reconstruction, or the legitimate user’s distortion is restricted to be the Shannon limit and meanwhile the wiretapper has a worse channel and wants to produce a better reconstruction, the proposed uncoded scheme is optimal. It is worth noting that these optimality conditions do not include the practical scenario in which the wiretapper has a worse channel than the legitimate users and a higher distortion requirement. But it does not mean our scheme is not optimal for the practical scenario. We believe that for the binary broadcast communication without secrecy requirement, the proposed uncoded scheme with p1 “ 0 and with no permutation operation is the unique scheme to achieve the Shannon limits for both the legitimate users. If so, when the secrecy requirement is involved, the proposed scheme is optimal as well, no matter what the wiretapper’s channel condition is and what his desired distortion level is. This is because RK rate of secret key could increase RL at most by RK , and our scheme satisfies this point. Of course, we need a rigorous proof about this claim, but unfortunately, now we have no idea how to prove it. We know that when there is no secrecy constraint, the traditional uncoded scheme could outperform the separate scheme for broadcast communication scenarios. It is not surprising that when secrecy constraint is involved, the proposed uncoded scheme still could outperform the separate scheme. However, surprisingly, the example given in [15] shows the proposed uncoded scheme may strictly outperform the separate coding even for the secure point-to-point communication (with only one legitimate user). IV. S CALAR G AUSSIAN C OMMUNICATION In this section, we consider a Gaussian source S „ N p0, λq transmitted over a bandwidth-matched10 and powerconstrained Gaussian wiretap broadcast channel (the average input power is constrained by P ). The distortion 2 measures are set to dB ps, spq “ dE ps, spq “ d ps, spq fi ps ´ spq . 10 Although we can also convert a bandwidth-mismatched Gaussian system into a bandwidth-matched system, just as done in Remark 2, our results in this section cannot be easily extended to the bandwidth-mismatched system since the linear coding used in our schemes is specified for the bandwidth-matched one. 13 For this communication system, we provide two uncoded schemes. The first one is just the scheme proposed in previous section. Next we will show that the permutation based scheme also works in the Gaussian communication case. The other one is an orthogonal-transform based scheme, which cascades a random orthogonal transform (instead of random permutation operation) with a symbol-by-symbol mapping. A. Permutation based Scheme It has been shown that linear coding is optimal for the bandwidth-matched Gaussian broadcast communication when there is no secrecy requirement [2]. Hence we set PX|S and spi pyi q, i “ 1, 2 to the linear functions x “ b 1 αs, spi “ βi yi , i “ 1, 2 in the proposed scheme for DM communications, where α “ Pλ with 0 ď P 1 ď P and ? βi “ λP 1 P 1 `Ni . Then we apply this permutation based scheme to the Gaussian communication. The performance of this scheme is provided in the following theorem, the proof of which is given in Appendix E. Theorem 5 (Permutation based Scheme). For the Gaussian communication, the proposed permutation based scheme achieves the region Rpiq Ď R, where $ ’ ’ ’ pRK , RL , P, D0 , D1 , D2 q : ď & piq i R fi Di ě PλN 1 `N , i “ 1, 2, ’ !i ´ 0ďP 1 ďP ’ ’ % RL ď min RK ` 1 log` 2 , / / / . , λN0 D0 pP 1 `N0 q ¯ , 12 log` ´ λ D0 (32) ¯) / / / - with log` x fi max t0, log xu. Remark 4. The Rpiq here is just the one given in Theorem 1 with PX|S and spi pyi q, i “ 1, 2 set to x “ αs and spi “ βi yi , i “ 1, 2, respectively. This is because they are achieved by the same scheme. Remark 5. The first constraint of Rpiq is consistent with the performance of linear coding [2]. The second constraint of Rpiq follows from the similar argument to the DM case. Note that for Rpiq , P 1 is a variable. Moreover, the region of pD1 , D2 q and the region of pRK , RL , D0 q depend on each other through P 1 which satisfies 0 ď P 1 ď P . This finding is similar to the discrete communication case. Given pRK , D0 q, the minimum of achievable D1 (or D2 ) and the maximum of achievable RL are both decreasing in P 1 , which implies for the proposed scheme, transmitting the source using a larger power results in smaller distortions for legitimate users, but also leads to decrypting the source more easily for the wiretapper. The proposed scheme with P 1 “ P , on one hand, provides a certain level of secrecy, and on the other hand, it achieves the Shannon’s distortion limits for both legitimate users. The region in Theorem 5 with λ “ 1 and P 1 “ 1 is illustrated in Fig. 3. Given P 1 , pD1 , D2 q has no effect on the pRK , RL , D0 q tradeoff. B. Orthogonal-Transform based Scheme The proposed scheme above uses a random permutation operation (which shuffles the sequence within the same type class) to improve the level of secrecy. It works not only for the discrete communication but also for the continuous communication, such as the Gaussian communication. In this subsection we propose another secure uncoded scheme for the Gaussian communication case which is designed from a geometric point of view. 14 4 3.5 3 RL 2.5 2 1.5 1 0.5 0 0 1 0.2 0.5 0.4 0.6 0.8 1 0 N0 D0 Fig. 3. The region in Theorem 5 with λ “ 1 and P 1 “ 1. To give an interpretation for the motivation of our proposed scheme, we consider a special case where the wiretapper has a noiseless channel. Apply linear coding to the Gaussian communication, then we know that given the Euclidean norm, the sequence of a Gaussian source uniformly distributed on some sphere, and so are the sequences of channel input, outputs, and source reconstructions. Assume we generate a set of bijective transforms (as a codebook), and randomly choose one of them (according to the key) to transform the source sequence before applying linear coding on it. To keep the power unchanged, these transforms are required to map a sphere into itself. On the other hand, by using the secret key the legitimate users could transform it back. Hence the induced distortions of legitimate users do not change as well. Furthermore, without knowing the secret key but with knowing the norm of the source sequence and the codebook, in the view of the wiretapper, the source sequence is uniformly distributed over the vectors that are possible to generate the channel output (wiretapper’s observation) through some key values. To make the wiretapper guess the source as difficultly as possible, these vectors should be “uniformly” (at equal distance) located on the sphere. This is because if so, the wiretapper has to cover either all these vectors or the whole sphere to meet the decryption requirement. It can be shown the orthogonal transform is one of such transforms. Hence it is adopted in our second scheme. “ ‰ Codebook (Public Key) Generation: Generate random n ˆ n matrices Qk , k P 2nRK independently whose elements are generated i.i.d. according to N p0, 1q. Then apply Gram-Schmidt orthonormalization process to the columns of each matrix, hence all the resulting matrices are orthogonal and they constitute a subset of orthogonal “ ‰( matrices C “ Ψk , k P 2nRK . As a public key, the codebook C is revealed to the sender and all the receivers (including the wiretapper). Encoding: Upon observing a source sequence sn and a key k, the encoder generates xn as follows. xn “ αΨk sn , (33) 15 b where α “ P1 λ with 0 ď P 1 ď P . Decoding (for Legitimate Users): For legitimate user Bi, i “ 1, 2, upon the received sequence yin and the key k, the decoder reconstructs the source as follows. spni “ βi ΨTk yin , ? where βi “ λP 1 P 1 `Ni , (34) and ΨTk denotes the transpose of the matrix Ψk . Next we will analyze the asymptotic performance of this scheme. Similar to the case of permutation based scheme, we need first introduce some basic properties of the random codebook C. Lemma 4. [31] Suppose Q is a random n ˆ n matrix with each element independently distributed according to Gaussian distribution N p0, 1q. Let Q1 , Q2 , ¨ ¨ ¨ , Qn be the columns of Q and let Ψ be the random matrix whose columns are obtained by applying the Gram-Schmidt orthonormalization procedure to Q1 , Q2 , ¨ ¨ ¨ , Qn . Then both Ψ and ΨT have the uniform distribution (Haar measure under orthogonal transform) on the set of nˆn orthogonal matrices F pnq, and moreover for any orthogonal matrix A, both AΨ and ΨA also have the uniform distribution on F pnq. Utilizing Lemma 4, we can establish the following lemma. Lemma 5. Random orthogonal transform xn “ Ψsn with Ψ uniformly distributed on orthogonal matrices set F pnq, transforms an arbitrary vector sn P Rn into a random vector that is uniformly distributed on the pn ´ 1q-sphere with radius }sn }. Proof: From Lemma 4, without loss of generality we can assume Ψ is obtained in the manner described in Lemma 4. Let Ψ1 , Ψ2 , ¨ ¨ ¨ , Ψn be the columns of Ψ. From Gram-Schmidt orthonormalization, we know that Ψ1 “ Q1 }Q1 } , and for any rotation matrix (or more generally, orthogonal matrix) A, AΨ1 “ AQ1 }Q1 } “ AQ1 }AQ1 } . On the other hand, Q1 is a random vector with each element i.i.d. „ N p0, 1q, and it is easy to verify that for any rotation matrix A, AQ1 has the same distribution as Q1 , i.e., a normally distributed random vector is invariant to rotation. Therefore, AΨ1 has the same distribution as Ψ1 , i.e., Ψ1 is also invariant to rotation. This implies Ψ1 is T uniformly distributed on the unit pn ´ 1q-sphere. In addition, observe Ψ p1, 0, ¨ ¨ ¨ , 0q “ Ψ1 . Hence the random matrix Ψ transforms vector p1, 0, ¨ ¨ ¨ , 0q T to a random vector uniformly distributed on the pn ´ 1q-sphere. For arbitrary vector sn P Rn , we can easily find an orthogonal matrix B with the first column T sn }sn } . Hence sn can T be expressed as sn “ }sn } B p1, 0, ¨ ¨ ¨ , 0q . Then we have Ψsn “ }sn } ΨB p1, 0, ¨ ¨ ¨ , 0q . From Lemma 4, ΨB T has the same distribution as Ψ. Hence ΨB p1, 0, ¨ ¨ ¨ , 0q is also uniformly distributed on the unit pn ´ 1q-sphere, which implies Ψsn is uniformly distributed on the pn ´ 1q-sphere with radius }sn }. Lemma 5 implies the resulting vector will be uniformly distributed on the sphere where the input vector is, if the transform matrix is randomly and uniformly chosen from the set of orthogonal matrices. This is a nice property of the random orthogonal transform, similar to the property of the random permutation operation. Utilizing the properties, we can establish the following theorem, the proof of which is given in Appendix F. 16 Theorem 6 (Orthogonal-Transform based Scheme). For the Gaussian communication, the inner bound Rpiq given in Theorem 5 can be achieved by the scheme above as well. The inner bound Rpiq can be understood from a geometric point of view. The random orthogonal transform in the proposed scheme guarantees that given Z n , S n has a uniform distribution on 2nRK small pn ´ 2q ´spheres with b 0 whose centers are uniformly distributed on the pn ´ 1q ´sphere with center O (the origin) and radius r2 “ PnλN 1 b `N0 nλP 1 radius r1 “ P 1 `N0 . However, owing to the uniform conditional distribution of the source given Z n and the lack ? r2 qn balls with radius nD0 to cover these pn ´ 2q ´spheres. of secret key, the wiretapper needs at least 2nRK p ?nD 0 On the other hand, under the unconditional case, the source has a uniform distribution on the pn ´ 1q ´sphere with ? r0 center O and radius r0 “ nλ. Hence if ignoring Z n , the wiretapper needs at least p ?nD qn balls with radius 0 ? nD0 to cover the sphere. This results in the inner bound Rpiq . It seems somewhat counterintuitive that the permutation based scheme achieves the same performance as the orthogonal-transform based scheme, as shown by Theorems 5 and 6; it is easy to observe that for low-dimension cases, e.g., 2-dimension case (see Fig. 4), permutations cannot always transform a source sequence into vectors “uniformly” (at equal distance) distributed over a sphere, so why does this property hold (with high probability) when the dimension goes to infinity? Actually, it indeed does. This is because as the dimension increases, such “bad”11 source sequences will occur with vanishing probability. This can be seen from that12 P prSsn P Uδn prSsqq Ñ 1 as n Ñ 8 (i.e., besides on the sphere, the source sequence should also with high probability appear the neighborhoods of the vectors in Uδn prSsq), and moreover, Uδn prSsq consists of a set of “good” source sequences. Hence the “good” source sequences will occur with high probability as the dimension increases, that is, permutations will transform an arbitrary source sequence from a high probability set into vectors “uniformly” distributed over a sphere. C. Comparison with Sign-Change Based Scheme In previous two subsections, we give an analysis of the asymptotic performance of permutation based scheme or orthogonal-transform based scheme. However, is it necessary to let the blocklength n go to infinity? What if n is set to be a finite value? In this subsection, we study the simplest finite blocklength case: n “ 1 (single-letter codes). For this case, the permutation based scheme is obviously inferior to the asymptotic case, since for 1 dimension case no permutation exists except for the source sequence itself. Hence in the following, we mainly consider the orthogonal-transform based scheme. For n “ 1, the orthogonal-transform based scheme reduces to a sign-change based scheme [20], [15]. Next we compare the proposed schemes with this sign-change based scheme [20], [15]. Assume RK “ 1, and the secret key is uniformly distributed on t0, 1u. Encoding: Upon observing a source sequence s and a key k , the encoder generates x as follows. x “ αΨk s, 11 Here (35) a source sequence is said to be “good” if its permutations are “uniformly” distributed over a sphere; otherwise it is “bad”. Obviously, the permutations of a “good” source sequence are also “good”. ´ ¯ 12 Here rSs “ ∆ ¨ Round S and Uδn prSsq is the δ-unified typical set for PrSs ; see the proof in E. ∆ 17 O Fig. 4. Illustration of permutations of a source sequence for n “ 2 case. b where α “ P1 λ with 0 ď P 1 ď P , and Ψk “ $ ’ &´1, if k “ 0; ’ %1, (36) if k “ 1. Decoding (for Legitimate Receivers): For legitimate receiver Bi, i “ 1, 2, upon the received sequence yi and the key k, the decoder reconstructs the source as follows. spi “ βi Ψk yi , (37) ? where βi “ λP 1 P 1 `Ni . It is easy to verify that pSt , Kt , Xt , Y1,t , Y2,t , Zt , Sp1,t , Sp2,t q8 t“1 are i.i.d. and 1 rfV0 pz ´ αsq ` fV0 pz ` αsqs 2 ‰ 1“ fV01 ps ´ β0 zq ` fV01 ps ` β0 zq , “ fZ pzq ¨ 2 fS,Z ps, zq “ fS psq ¨ (38) (39) ? where β0 “ fV01 λP 1 P 1 `N0 , fV0 denotes the probability distribution function (pdf) of the wiretapper’s channel noise V0 , and ´ ¯ 0 denotes the pdf of V01 „ N 0, PλN . Given Z, S can be regarded as a Gaussian mixture with two components 1 `N 0 of equal weight and variance. For such single-letter scheme, in [15] we have shown the maximum achievable RL (or equivalently the minimum rate needed to code S within distortion D0 with two-sided information Z) equals the conditional rate-distortion function RS|Z pD0 q. The performance of the sign-change based scheme is given by the following theorem. Theorem 7 (Sign-Change based Scheme). [15] For the Gaussian communication with RK “ 1, the sign-change piq based scheme above achieves the region Rsign Ď R, where $ ’ ’ pRK , RL , P, D0 , D1 , D2 q : ’ & ď piq i Rsign fi Di ě PλN 1 `N , i “ 1, 2, i ’ 0ďP 1 ďP ’ ’ % R ď R pD q L S|Z 0 , / / / . , / / / - 18 with RS|Z pD0 q denoting the conditional rate-distortion function of S given two-sided information Z, defined in (20). Since it is hard (even if possible) to express RS|Z pD0 q in closed form, for ease of comparison, we will derive a closed-form upper bound for RS|Z pD0 q. The result is shown in the following lemma, and the proof is given in Appendix I. Lemma 6. If pS, Zq follows the distribution (38) or (39), then " ˆ ˙* 1 λ pUBq RS|Z pD0 q ď min RS|Z pD0 q, log` , 2 D0 where (40) $ 1 ’ 0 & pλ´D0 qpP1 `N0 q , ă D0 ď λ; if PλN 1 `N λP pUBq 0 RS|Z pD0 q fi ¯ ´ ’ λN0 λN0 %1 ` 1 log 2 D0 pP 1 `N0 q , if 0 ď D0 ď P 1 `N0 . (41) Since RS|Z pD0 q denotes the minimum rate needed to code S within distortion D0 when Z is available at both encoder and decoder, we can give an interpretation for the upper bound from the perspective of source coding. ´ ¯ ´ ¯ First, by ignoring the side information, we have RS|Z pD0 q ď 12 log` Dλ0 , where 21 log` Dλ0 is the minimum rate needed to code S without any side information. Second, if λN0 P 1 `N0 ď D0 ď λ, then consider the following timesharing coding strategy.13 If we code the secret key K (1 bit per symbol), then using a linear decoder (similar to those of legitimate users), we can reconstruct the source within distortion λN0 P 1 `N0 . On the other hand, if we do not code anything, then it results in rate 0 and distortion λ. By using a timesharing strategy between these two schemes, pλ´D0 qpP 1 `N0 q 0 we need rate to reconstruct the source within distortion D0 . Finally, if 0 ď D0 ď PλN 1 `N , then we λP 1 0 λN0 P 1 `N0 by using rate 1 to code the secret key, and upon the reconstruction, ¯ ´ λN0 we further code the residual error within distortion D0 by using rate 12 log D0 pP 1 `N q . 0 reconstruct the source within distortion Combining Theorem 7 and Lemma 6 gives us the following result. piq Theorem 8 (Outer Bound of Rsign ). For the Gaussian communication with RK “ 1, the region achieved by the piq poq sign-change based scheme satisfies Rsign Ď Rsign , where $ ’ ’ pRK , RL , P, D0 , D1 , D2 q : & ď ’ poq i Rsign fi Di ě PλN 1 `N , i “ 1, 2, ’ !i ´ 1 ’ 0ďP ďP ’ % RL ď min RpUBq pD0 q, 1 log` S|Z 2 , / / / . . λ D0 (42) ¯) / / / - Remark 6. Observe that only 1 bit/symbol of key can be exploited by the sign-change based scheme even when RK ą 1. Hence for that case, its performance is still that given by Theorem 7 and outer bounded by 42. ´ ¯ pUBq λN0 From Lemma 6, it can be observed that when RK “ 1, RS|Z pD0 q “ 1 ` 21 log` D0 pP for 0 ď D0 ď 1 `N q 0 ´ ¯ pUBq poq ` λN0 λN0 1 0 for PλN ă D0 ď λ. Hence Rsign Ř Rpiq , where Rpiq 1 `N P 1 `N0 , and RS|Z pD0 q ă 1 “ 1 ` 2 log D0 pP 1 `N0 q 0 13 Note that the argument here is only available for the inequality (40), and does not apply to the secrecy problem considered in this paper. For the secrecy problem the wiretapper and henchman cannot benefit from adopting a timesharing strategy since the constraint (2) or (3) is to restrict the excess-distortion probability, instead of the average distortion. 19 1 Proposed JSCS Sign change (upper bound) 0.9 0.8 0.7 RL 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.2 0.4 0.6 0.8 1 D0 Fig. 5. Comparison of the achievable RL by the proposed (infinite blocklength) schemes and that by the sign-change based scheme. λ “ 1, N0 “ 0 (noiseless wiretap channel) and RK “ 1. given in Theorem 5 denotes the achievable region by the permutation based scheme or orthogonal-transform based scheme. This implies for the same P 1 , the sign-change based scheme is strictly inferior to the proposed schemes under the condition λN0 P 1 `N0 ă D0 ď λ. That is, the single-letter version of orthogonal-transform based scheme is inferior to the corresponding infinite blocklength version. To see it clearer, the RL achieved by the proposed (infinite blocklength) schemes (given in Theorem 5) and the upper bound of RL achieved by the sign-change based scheme (given in Theorem 8) are illustrated in Fig. 5. D. Outer Bound For the Gaussian communication, the following outer bound has been proven for the system with only one legitimate user [15]. Lemma 7. [15] For the Gaussian communication with only one legitimate user, $ , ’ / ’ pRK , RL , P, D0 , D1 q : / ’ / & . poq λN1 R Ď R fi , D1 ě P `N1 , ’ ! ´ ¯) / ’ / ’ / % RL ď min R1 , 1 log` λ 2 (43) D0 where R1 “ RK ` 1 log` 2 ˆ 1 ` P{N1 1 ` P{N0 ˙ ` 1 log` 2 ˆ D1 D0 ˙ . (44) Using this result, we have the following outer bound for the system with 2 legitimate users (the system considered in this paper). 20 Theorem 9 (Outer Bound). For the Gaussian communication (with 2 legitimate users), , $ / ’ / ’ pRK , RL , P, D0 , D1 , D2 q : / ’ . & poq λNi R Ď R fi , Di ě P `Ni , i “ 1, 2, ’ ! ´ ¯) / / ’ / ’ % RL ď min R1 , R2 , 1 log` λ 2 (45) D0 where Ri “ RK ` 1 log` 2 ˆ 1 ` P{Ni 1 ` P{N0 ˙ ` 1 log` 2 ˆ Di D0 ˙ , i “ 1, 2. (46) Comparing Theorem 6 and Corollary 9, we can identify the optimality of the proposed schemes for the Gaussian communication. This result is similar to Theorem 4 for the binary communication. Theorem 10 (Optimality of the Proposed Schemes). For the Gaussian communication (with 2 legitimate users), the proposed scheme is optimal if N0 ď Ni , D0 ě Di or N0 ě Ni , D0 ď Di “ λNi P `Ni holds for i “ 1 or 2. A similar remark to Remark 3 applies to this theorem. V. V ECTOR G AUSSIAN C OMMUNICATION The proposed schemes are easily extended to vector Gaussian communication scenarios. Consider an m-vector Gaussian source S „ N p0, diag pλ1 , λ2 , ¨ ¨ ¨ , λm qq14 transmitted over an m-vector Gaussian broadcast channel Yi “ X ` Vi , i “ 1, 2, (47) where Yi is the channel output vector observed by the i-th legitimate user, and Vi „ N p0, diagpNi,1 , Ni,2 , ¨ ¨ ¨ , Ni,m qq is an additive Gaussian noise vector. A wiretapper Eve accesses to another channel output Z through a channel Z “ X ` V0 , (48) where V0 „ N p0, diag pN0,1 , N0,2 , ¨ ¨ ¨ , N0,m qq is an additive Gaussian noise vector as well. The distortion řm řm measures are set to dB ps, spq “ dE ps, spq “ j“1 psj ´p sj q2 , and the channel cost function is set to ρ pxq “ j“1 x2j . pi , S qi as super-symbols, then the proposed permutation based scheme can be Consider the vectors S, X, Yi , Z, S applied to the vector Gaussian case directly. The performance of this scheme can be proven by following similar steps to the proof for the scalar Gaussian case. Furthermore, we can apply the proposed orthogonal-transform based scheme to each subsource-subchannel pair, as shown in the following. ‰ “ Codebook (Public Key) Generation: Generate m¨2nRK random nˆn matrices Qj,k , j P rms , k P 2nRK independently whose elements are generated i.i.d. according to N p0, 1q. Then we apply Gram-Schmidt orthonormalization process on every matrix, hence all the resulting matrices are orthogonal, and constitute a subset of orthogonal “ ‰( matrices C “ Ψj,k , j P rms , k P 2nRK . As a public key, the codebook C is revealed to the sender and all the receivers (including the wiretapper). 14 In this paper, we use bold font to denote vector or matrix, e.g., pS1 , ¨ ¨ ¨ , Sm q and ps1 , ¨ ¨ ¨ , sm q are denoted by S and s, respectively. 21 Encoding: Upon observing a source sequence sn “ psn1 , sn2 , ¨ ¨ ¨ , snm q and a key k , the encoder generates xn “ pxn1 , xn2 , ¨ ¨ ¨ , xnm q as follows. xnj “ αj Ψj,k snj , j P rms , b where αj “ Pj λj with transmitting power P1 , P2 , ¨ ¨ ¨ , Pm such that 0 ď (49) řm j“1 Pj ď P . Decoding (for Legitimate Users): For the legitimate user Bi, i “ 1, 2, upon the received sequence yin and the key k, the decoder reconstructs the source as follows. n spni,j “ βi,j ΨTj,k yi,j , j P rms , (50) ? where βi,j “ λj Pj Pj `Ni . The achievable regions by the proposed schemes (permutation based scheme and orthogonal-transform based scheme) are given in the following theorem, the proof of which is given in Appendix J. Theorem 11 (Performance of the Proposed Schemes). For the vector Gaussian communication, the permutation based scheme or the orthogonal-transform based scheme above achieves the same region Rpiq Ď R, where , $ / ’ / ’ pR , R , P, D , D , D q : K L 0 1 2 / ’ . & ď řm λj Ni,j piq , R fi Di ě j“1 Pj `Ni,j , i “ 1, 2, ’ / ’ ( / / ’ % RL ď min RK ` RS|Z pD0 q, RS pD0 q P1 , P2 , ¨ ¨ ¨ , Pm ě 0, řm 0 ď j“1 Pj ď P with ˆ ˙ m ÿ 1 λj ` log RS pD0 q “ 2 µ j“1 ˆ ˙ m ÿ 1 λj N0,j log` RS|Z pD0 q “ 2 θ pPj ` N0,j q j“1 (51) (52) and with µ and θ such that D0 m ÿ min tµ, λj u , (53) " * λj N0,j “ min θ, . Pj ` N0,j j“1 (54) “ j“1 D0 m ÿ Remark 7. Actually, in Theorem 11, RS pD0 q denotes the rate-distortion function of the source S, and RS|Z pD0 q denotes the rate-distortion function of the source S with the side information Z available at both the encoder and b P decoder, where Zj “ λjj Sj ` V j , j P rms with V „ N p0, diag pN0,1 , N0,2 , ¨ ¨ ¨ , N0,m qq independent of S. VI. C ONCLUDING R EMARKS In this paper, we studied the joint source-channel secrecy problem for secure source broadcast in the Shannon cipher system, in which the list secrecy is used to measure the secrecy of communication. We proposed two secure uncoded schemes: a permutation based scheme for discrete, scalar Gaussian, and vector Gaussian communications, and an orthogonal-transform based scheme for the latter two communications. In these two uncoded schemes, a 22 random permutation or a random orthogonal transform is cascaded with the traditional uncoded JSCC scheme. The analysis showed that the proposed schemes outperform the sign-change based scheme. Interestingly, by adding the random permutation operation or the random orthogonal transform into the traditional uncoded scheme, the proposed uncoded schemes, on one hand, provide a certain level of secrecy, and on the other hand, do not lose any performance in terms of the distortions for legitimate users. Although the proposed schemes adopt two different random transforms, permutation operation and orthogonal transform, they are consistent in two aspects: First, actually the permutation operation is one kind of orthogonal transform; second, for the Gaussian communication, the orthogonal transform can be also considered as a shift operation that shifts a sequence to another in the same “type”, if we treat the Euclidean norm of the source sequence as its “type”15 . Furthermore, it is worth noting that different from the common construction of codebook in information theory (including spherical codes such as the one used in [27]), the codebooks in the proposed schemes are constructed by generating a sequence of i.i.d. random permutations or random matrices, instead of a sequence of i.i.d. random samples. In other words, the codebooks used here specify a sequence of bijective operations or transforms and hence they apply to uncoded schemes; while the common codebooks in information theory only specify a sequence of samples and hence can only be used in quantization operation (or digital schemes). Furthermore, such random-permutation or random-matrix based codebook construction can be also found in [22], [23], [24], [25], [26], where they were used to design digital schemes for communication, secrecy communication, and antijamming communication problems. But different from those works, in our case they were used to design uncoded schemes, instead of digital schemes. It is worth noting that the proofs used in this paper follow basic outline of the proofs in [14]. But different from [14], besides the finite alphabet case, we also considered the countably infinite alphabet and continuous (Gaussian) alphabet cases. Hence some powerful techniques, including unified typicality, d´tilted information, geometric analysis, and discretization, are used in our proofs. Furthermore, the unified typicality used in our proofs is different from the existing one defined in [34]. The unified typical set defined by us has a good property that the sequences in it only have (nearly) sub-exponential number of types. This property coincides with the finite alphabet case, and is of crucial importance to our proofs. We believe our definition of unified typicality could be used to further extend the method of types to countably infinite alphabet cases (besides the extension in [34]). A PPENDIX A P ROOF OF T HEOREM 1 Denote 15 This n Z 1n fi Ψ´1 K pZ q , (55) n X 1n fi Ψ´1 K pX q , (56) n Yi1n fi Ψ´1 K pYi q . (57) kind of type can be called “weak type”, since the relationship of it and the weak typicality is similar to that of the traditional type (empirical distribution) and strong typicality. 23 Then from the fact that the permutation operation is bijective, we have that PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn i i i i “ PK PC PS n PS 1n |S n ΨK PX n |S 1n PYin Z n |X n PSp1n |Y n ΨK PSpn |Sp1n PX 1n |X n ΨK PYi1n |Yin ΨK PZ 1n |Z n ΨK (58) i i i i “ PK PC PS n PS 1n |S n ΨK PX 1n |S 1n ΨK PYi1n Z 1n |X 1n ΨK PSp1n |Y 1n ΨK PSpn |Y 1n ΨK PX n |X 1n ΨK PYin |Yi1n ΨK PZ n |Z 1n ΨK (59) i i i i “ PK PC PS n PX 1n |S n PYi1n Z 1n |X 1n PSpn |Y 1n PS 1n |S n ΨK PSp1n |Y 1n ΨK PX n |X 1n ΨK PYin |Yi1n ΨK PZ n |Z 1n ΨK , i i i (60) i and similarly, PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn can be also expressed as i i i i PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn i i i i “ PK PC PS 1n PX n |S 1n PYin Z n |X n PSp1n |Y n PS n |S 1n ΨK PSpn |Sp1n PX 1n |X n ΨK PYi1n |Yin ΨK PZ 1n |Z n ΨK . i i i (61) i Hence pΨK , Z n q Ñ Z 1n Ñ S n forms a Markov chain. Furthermore, since the permutation operation does not change the joint distribution of the sequences, we have PS n PX 1n |S n PYi1n Z 1n |X 1n PSpn |Y 1n “ PS 1n PX n |S 1n PYin Z n |X n PSp1n |Y n “ i i i i ś PS PX|S PYi Z|X PSpi |Yi , where PSpi |Yi pp s|yq fi 1 tp s “ spi pyqu denotes the conditional distribution induced by the decoder i, and PS PX|S PYi Z|X PSpi |Yi is the distribution given in (18). ´ ¯ Since S n , Spin is an i.i.d. sequence, by the law of large numbers, ” ı nÑ8 P dB pS n , Spin q ď EdB pS, Spi q `  ÝÝÝÑ 1, (62) for any  ą 0. Hence the distortion constraints for legitimate users are satisfied. Next we prove the secrecy constraint is also satisfied, i.e., if ( lim sup Rn ă min RK ` RS|Z pD0 q, RS pD0 q , (63) nÑ8 ” “ ‰ı then lim ECZ n maxRn Hcodes P dE pS n , Sqn q ď D0 “ 0. To that end, we need the following lemma. nÑ8 Lemma 8. [15] For a sequence of random variables tXn u, and a sequence of events tAn u, limnÑ8 P pAn q “ 0, if and only if limnÑ8 P rP pAn |Xn q ą τn s “ 0 for some sequence tτn u with τn ą 0 and limnÑ8 τn “ 0. From Lemma 8, to prove the secrecy constraint we only need to show that if Rn satisfies (63), then ” ı “ ‰ lim PCZ n max P dE pS n , Sqn q ď D0 ą τn “ 0, nÑ8 Rn Hcodes (64) for some sequence tτn u with τn ą 0 and limnÑ8 τn “ 0. Next we prove this. Define event A fi ` n 1n ˘ ` ˘( S ,Z P Tδn S, Z 1 , for δ ą 0. The δ-typical set is defined according to the notion of strong typicality, see [30]: ÿ Tδn pSq fi tsn P S n : |Tsn psq ´ PS psq| ď δu, (65) (66) sPS where Tsn denotes the type (or empirical distribution) of sn . For simplicity, Tδn pSq is also shortly denoted as Tδn . Since pS n , Z 1n q is an i.i.d. sequence, from the fact that the typical set has total probability close to one [30], we have the following lemma. 24 Lemma 9. [30] For any δ ą 0, P rAs Ñ 1, as n Ñ 8. “ ‰ Consider that for each n, the optimal Rn -rate henchman code that maximizes P dE pS n , Sqn q ď D0 |CZ n is ” “ ı ‰ adopted, then we only need to show lim PCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn “ 0 for these codes. By utilizing nÑ8 Lemmas 8 and 9, we have ı ” “ ‰ PCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn ı ” “ ‰ ďPCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn , P rAc |CZ n s ď n ` P rP rAc |CZ n s ą n s ı ” “ ‰ ďPCZ n P dE pS n , Sqn q ď D0 , A|CZ n ` P rAc |CZ n s ą τn , P rAc |CZ n s ď n ` 1n ı ” “ ‰ ďPCZ n P dE pS n , Sqn q ď D0 , A|CZ n ą τn1 ` 1n , (67) (68) (69) for some n and 1n that both vanish as n Ñ 8, where τn1 “ τn ´ n . By choosing proper τn , τn1 can be set to some sequence that converges to zero sub-exponentially fast (i.e., τn1 “ 2´opnq ). Since n vanishes as n Ñ 8, this guarantees that τn also vanishes as n Ñ 8. Owing to the rate constraint, given pC, Z n q, the reconstruction Sqn cannot take more than Rn values. Denote the set of possible values as cpC, Z n q, then ” “ ‰ P dE pS n , Sqn q ď D0 , A|CZ n “ P min sqn PcpC,Z n q ı dE pS n , sqn q ď D0 , A|CZ n . (70) Now we apply a union bound to the right-hand side of (70) and write ı ” P n min n dE pS n , sqn q ď D0 , A|CZ n sq PcpC,Z q ” ı P dE pS n , sqn q ď D0 , A|CZ n (71) ” ı n n n s q P d pS , q ď D , A|CZ max E 0 n n (72) ÿ ď sqn PcpC,Z n q ď2nRn sq PcpC,Z q ” ı ď2nRn max P dE pS n , sqn q ď D0 , A|CZ n (73) sqn PSqn nRn max “2 nRK 2ÿ P rK “ k|CZ n s P rdE pS n , sqn q ď D0 , A|CZ n , K “ ks sqn PSqn k“1 “2npRn ´RK q max nRK 2ÿ sqn PSqn k“1 P rdE pS n , sqn q ď D0 , A|Ψk , Z n s , (74) (75) where (75) follows from the Markov chain CKZ n Ñ ΨK Z n Ñ S n Z n A and P rK “ k|C “ c, Z n “ z n s “ 2´nRK (see (61)). Combine (69), (70), and (75), then we have ı ” “ ‰ PCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn ” ďP CZ n max nRK 2ÿ sqn PSqn k“1 ı P rdE pS n , sqn q ď D0 , A|Ψk , Z n s ą τn1 2´npRn ´RK q ` 1n nRK ˇ ˇ ” 2ÿ ı ˇ qn ˇ ď ˇS ˇ max PCZ n ξk,zn pq sn q ą τn1 2´npRn ´RK q ` 1n , sqn PSqn k“1 (76) (77) 25 where sn q fi P rdE pS n , sqn q ď D0 , A|Ψk , Z n s , ξk,zn pq (78) Therefore, if we can show that the probability in (77) decays doubly exponentially fast with n, then the proof will be complete. “ ‰ sn q , k P 2nRK are i.i.d. random variables, with mean Consider that given sqn and z n , ξk,zn pq EC ξk,zn pq sn q “ EC P rdE pS n , sqn q ď D0 , A|Ψk , z n s “ EΨk P rdE pS n , sqn q ď D0 , A|Ψk , z n s (79) (80) To complete the proof, we need introduce the following lemmas. The proof of Lemma 10 is given in Appendix B. Lemma 10. Assume S n is i.i.d. according to PS , then for any type t of sequences in S n and any sqn , PrdE pS n , sqn q ď D, S n P Tδn |TS n “ ts ď 2´npRS pDq´op1qq , (81) where TS n denotes the type of S n , and op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Lemma 11. [14] Fix PS|Z and z n . If S n is distributed according to śn i“1 PS|Z“zi , then for any sqn , PrdE pS n , sqn q ď D, pS n , z n q P Tδn |z n s ď 2´npRS|Z pDq´op1qq , (82) where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Lemma 12. [14] If X m is a sequence of i.i.d. random variables on the interval r0, as with ErXi s “ p, then m ”ÿ ı ´ e¨m¨p ¯k{a . (83) P Xi ą k ď k i“1 From (60), we have P rS n “ sn |Ψk , z n s “ ź ` ˘ PS|Z si |zi1 . (84) Hence Lemma 11 implies “ ‰ n n 1n ξk,zn pq sn q “ P dE pS , sq q ď D0 , A|z ď 2´npRS|Z pD0 q´op1qq . (85) (86) On the other hand, n n n n n sn q ď EΨk PrdE pS , sq q ď D0 , S P Tδ |Ψk , z s EC ξk,zn pq ÿ “ PrS 1n “ s1n |z n sEΨk PrdE pS n , sqn q ď D0 , S n P Tδn |S 1n “ s1n , Ψk s (87) (88) s1n ÿ “ PrS 1n “ s1n |z n sPrdE pS n , sqn q ď D0 , S n P Tδn |S 1n “ s1n s (89) PrS 1n “ s1n |z n sPrdE pS n , sqn q ď D0 , S n P Tδn |TS n “ Ts1n s (90) s1n ÿ “ s1n ď 2´npRS pD0 q´op1qq . (91) 26 Using these bounds, we apply Lemma 12 to the probability in (77) by identifying m “ 2nRK , Then we have (92) a “ 2´npRS|Z pD0 q´op1qq , (93) p ď 2´npRS pD0 q´op1qq , (94) k “ τn1 2´npRn ´RK q . (95) nRK ” 2ÿ ı nβ sn q ą τn1 2´npRn ´RK q ď 2´nα2 , P ξk,zn pq (96) k“1 where α “ RS pD0 q ´ Rn ´ op1q (97) β “ RK ` RS|Z pD0 q ´ Rn ´ op1q. For small enough δ and large enough n, both α and β are positive and bounded away from zero, and (96) vanishes doubly exponentially fast. Therefore, the expression in (77) vanishes. This completes the proof of Theorem 1. A PPENDIX B P ROOF OF L EMMA 10 |t psq ´ PS psq| ą δ, then PrdE pS n , sqn q ď D, S n P Tδn |TS n “ ts “ 0. Hence we only need to consider ř the t’s such that sPS |t psq ´ PS psq| ď δ. If ř sPS Consider ˇ (ˇ PrTS n “ ts “ ˇ s1n P S n : Ts1n “ t ˇ 2´npDpt||PS q`Hptqq “ 2´npDpt||PS q`op1qq (98) (99) for any type t of sequences in S n , where D pt||PS q denotes the relative entropy between t and PS , and (99) follows from (15). Moreover, from [32, Thm. 25] we have ¸ ˜ ř ˙ ˆ 2 p s |t psq ´ PS psq|q δ2 ď log 1 ` Ñ 0, D pt||PS q ď log 1 ` 2PS,min 2PS,min (100) as δ Ñ 0, where PS,min “ minsPS PS psq. Therefore, PrTS n “ ts ě 2´nop1q . (101) Utilizing (101), we get PrdE pS n , sqn q ď D, S n P Tδn |TS n “ ts PrdE pS n , sqn q ď D, S n P Tδn , TS n “ ts PrTS n “ ts n n PrdE pS , sq q ď D, S n P Tδn s ď . 2´nop1q “ To complete the proof, we need the following lemma. (102) (103) 27 Lemma 13. [14] Assume S n is i.i.d. according to PS , then for any sqn , PrdE pS n , sqn q ď D, S n P Tδn s ď 2´npRS pDq´op1qq . (104) By the lemma above, (103) implies that PrdE pS n , sqn q ď D, S n P Tδn |TS n “ ts ď 2´npRS pDq´op1qq . (105) A PPENDIX C P ROOF OF T HEOREM 2 Define X 1n , Yi1n , Z 1n same as (55)-(57), then the distribution PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn also satisfies (60) i i i i and (61). Similar to the finite alphabet case, it is easy to show the distortion constraints for legitimate users are satisfied. Next following similar steps to the proof for the finite alphabet case, we prove the secrecy constraint is also satisfied for this case. Before proving that, we need introduce d´tilted information and conditional d´tilted information first. Let PSq‹ |S be a distribution that achieves the rate-distortion function RS pDq (which is not necessarily unique). Then d´tilted information is defined as follows. Definition 6 (d´tilted information [15]). For D ą Dmin fi inf tD : RS pDq ă 8u, the d´tilted information in s is defined as 1 S ps, Dq “ log “ ` ˘‰ , ‹ E exp λ D ´ λ‹ dps, Sq‹ q (106) where the expectation is with respect to PSq‹ , i.e. the unconditional distribution of the reproduction random variable that achieves RS pDq, and λ‹ “ ´RS1 pDq. (107) For pS, Zq that follow the distribution in (18), we define RS|Z“z pβq “ “min ‰ q “ zq. IpS; S|Z (108) q PS|S,Z“z :E dE pS,Sq|Z“z ďβ q Let PSq‹ |S,Z“z be a distribution that achieves RS|Z“z pβq. Define b‹ pzq fi ES,Sq‹ |Z“z dpS, Sq‹ q with the expectation taken with respect to PS|Z“z PSq‹ |S,Z“z . ( Definition 7 (Conditional d´tilted information [15]). For b‹ pzq ą βmin pzq fi inf β : RS|Z“z pβq ă 8 , the conditional d´tilted information in s under condition Z “ z is defined as S|Z“z ps, b‹ pzqq “ log 1 ” ´ ¯ı , ‹ ‹ ESq‹ |Z“z exp λ pzq b pzq ´ λ‹ pzq dps, Sq‹ q (109) where the expectation is with respect to PSq‹ |Z“z , i.e. the margin distribution of PS|Z“z PSq‹ |S,Z“z , and 1 λ‹ pzq “ ´RS|Z“z pb‹ pzqq. Next we prove the secrecy constraint. To that end, we need re-define (110) 28 n ! 1 ÿ A fi S n P Uδn , S pS i , D0 q ě RS pD0 q ´ δ, n i“1 n n ) 1 ÿ ‹ 1 1 ÿ S|Z“Zi1 pS i , b‹ pZi1 qq ě RS|Z pD0 q ´ δ, b pZi q ě D0 ´ δ n i“1 n i“1 (111) for δ ą 0. The δ-unified typical set is defined as16 Uδn pSq fi T nδ pSq X Wδn pSq, (112) log n where T nδ pSq defined in (66), denotes the log n δ log n -strongly ! Wδn pSq fi sn P S n typical set, and ˇ 1 ˇ ) ˇ ˇ : ˇ´ log PS n psn q ´ H pSqˇ ď δ , n (113) denotes the δ-weakly typical set [28]. For simplicity, Uδn pSq is also shortly denoted as Uδn . Since pS n , Z 1n q is an i.i.d. sequence, we have the following lemma. ´ rP Lemma 14. [15, Lem. 18] [34, Lem. 2] Assume PS satisfies N S δ1 log n ¯ ´ “o n log2 n ¯ , @0 ă δ 1 ď 1. Then for any δ ą 0, P rAs Ñ 1 as n Ñ 8. Then the derivation up to (77) still holds, i.e., ” “ ı ‰ PCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn nRK ˇ ˇ ” 2ÿ ı ˇ qn ˇ ξk,zn pq sn q ą τn1 2´npRn ´RK q ` 1n , ď ˇS ˇ max PCZ n sqn PSqn (114) k“1 Therefore, if we can show that the probability in (114) decays doubly exponentially fast with n, then the proof will be complete. To that end, we need introduce the following lemmas. The proof of Lemma 15 is given in Appendix D. Lemma 15. Assume PS satisfies NPS `1˘ n ´ “o n log n ¯ , ΦP S `1˘ n ´ “o 1 log n ¯ , and S n is i.i.d. according to PS , then for any type t of sequences in S n and any sqn P Sqn , n ‰ “ 1 ÿ P dE pS n , sqn q ď D, S n P Uδn , S pSi , Dq ě RS pDq ´ δ|TS n “ t ď 2´npRS pDq´op1qq , n i“1 (115) where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Lemma 16. [15] Fix PSZ and z n P Z n . Assume given Z n “ z n , S n is distributed according to śn i“1 PS|Z“zi , then for any sqn P Sqn , n n ” ı 1 ÿ 1 ÿ ‹ P dE pS n , sqn q ď D, S|Z“zi pS i , b‹ pzi qq ě RS|Z pDq ´ δ, b pzi q ě D ´ δ|Z n “ z n n i“1 n i“1 ď 2´npRS|Z pDq´op1qq , (116) 16 Here the δ-unified typical set is different from the one defined in [34]. Our definition has the benefit that it makes the following property ˇ (ˇ hold: For each sequence sn P Uδn pSq, ˇ s1n P Uδn pSq : Ts1n “ Tsn ˇ “ 2npHpSq´op1qq , or equivalently, PrTS n “ Tsn s “ 2´nop1q , where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. This property coincides with (101) for the finite alphabet case, and it is of crucial importance to our proof here (see (126)). 29 where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Apply Lemmas 12, 15 and 16, then we have that the probability in (114) decays doubly exponentially fast with n. This completes the proof of Theorem 2. A PPENDIX D P ROOF OF L EMMA 15 δ log n does not hold, then PrdE pS n , sqn q ď D, S n P Uδn |TS n “ ts “ 0. Hence we only ř need to consider the t’s satisfying sPS |t psq ´ PS psq| ď logδ n . If ř sPS |t psq ´ PS psq| ď The Lemma 2.6 of [29] says that for any type t of sequences in S n , PrTS n “ ts ě pn ` 1q ´|suppptq| 2´nDpt||PS q , (117) where supp ptq fi ts P S : t psq ą 0u denotes the suppose of t. n log n pδ ` n q holds, where n is a term that vanishes as n Ñ 8. ( ( To that end, we divide S into two parts: s : PS psq ě n1 and s : PS psq ă n1 . Then ˇ" *ˇ ˇ" *ˇ ˇ 1 ˇˇ ˇˇ 1 ˇˇ ˇ |supp ptq| “ ˇ s : t psq ą 0, PS psq ě ` s : t psq ą 0, PS psq ă (118) n ˇ ˇ n ˇ ˇ" *ˇ ˇ" *ˇ ˇ 1 ˇˇ ˇˇ 1 ˇˇ ď ˇˇ s : PS psq ě ` s : t psq ą 0, PS psq ă (119) n ˇ ˇ n ˇ ˆ ˙ ÿ 1 “ NPS ` 1 tt psq ą 0u (120) n 1 s:PS psqă n ˆ ˙ ÿ 1 `n t psq , (121) ď NPS n 1 Now we prove that for any δ ą 0, |supp ptq| ď s:PS psqă n where (120) follows from the definition of NPS `1˘ n , and (121) follows from the fact t psq ě 1 n for any s such that t psq ą 0. ř ř ř ř Since sPS |t psq ´ PS psq| ě s:PS psqă 1 |t psq ´ PS psq| ě s:PS psqă 1 pt psq ´ PS psqq and sPS |t psq ´ PS psq| ď n δ log n , n we have ÿ 1 s:PS psqă n t psq ď ÿ 1 s:PS psqă n PS psq ` δ log n ˆ ˙ 1 δ “ ΦPS ` . n log n (122) (123) Therefore, ˆ ˙ ˆ ˙ 1 1 δn |supp ptq| ď NPS ` nΦPS ` . (124) n n log n ´ ¯ ´ ¯ ` ˘ ` ˘ Since NPS n1 “ o logn n , ΦPS n1 “ o log1 n , we have |supp ptq| ď logn n pδ ` n q. Therefore, (117) implies PrTS n “ ts ě 2´npDpt||PS q`δ`n q . (125) 30 Furthermore, S n P Uδn implies D pt||PS q ď 2δ, which is obtained by following part of proof steps of [34, Thm. 3] (but with and δ replaced with δ and n log n , respectively). Hence it holds that PrTS n “ ts ě 2´nop1q , (126) where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Utilizing (126), we can get n 1 ÿ S pSi , Dq ě RS pDq ´ δ|TS n “ ts n i“1 řn PrdE pS n , sqn q ď D, S n P Uδn , n1 i“1 S pSi , Dq ě RS pDq ´ δ, TS n “ ts “ PrTS n “ ts řn 1 n n PrdE pS , sq q ď D, n i“1 S pSi , Dq ě RS pDq ´ δs . ď 2´nop1q PrdE pS n , sqn q ď D, S n P Uδn , (127) (128) To complete the proof, we need the following lemma. Lemma 17. [15] Assume S and Sq are general (not necessarily countable) alphabets, and S n is i.i.d. drawn from S n according to PS . Then for any D ą Dmin (Dmin is defined in Definition 6) and any sqn P Sqn , PrdE pS n , sqn q ď D, n 1 ÿ S pSi , Dq ě RS pDq ´ δs ď 2´npRS pDq´op1qq . n i“1 (129) Hence by the lemma above, (128) implies that PrdE pS n , sqn q ď D, S n P Uδn , n 1 ÿ S pSi , Dq ě RS pDq ´ δ|TS n “ ts ď 2´npRS pDq´op1qq . n i“1 (130) A PPENDIX E P ROOF OF T HEOREM 5 Similar to the DM cases, it is easy to show the distortion constraints for legitimate users are satisfied. Next by following similar steps to the proof for the DM cases, we prove the secrecy constraint is also satisfied. q Let To that end, we first need to discretize the source S and the reconstruction S. q P N fi t¨ ¨ ¨ , ´2∆, ´∆, 0, ∆, 2∆, ¨ ¨ ¨ u , rSs, rSs (131) q obtained by mapping S and Sq to the closest quantization point, i.e., rSs “ be quantized versions of S and S, ´ ¯ `S˘ q “ ∆ ¨ Round Sq . Then we have for any sn P Rn , ∆ ¨ Round ∆ , rSs ∆ 0ď n 1 ÿ ∆2 2 psi ´ rsi sq ď . n i“1 4 (132) Furthermore, it holds that a n n ndpsn , sqn q “ ||sn ´ rq ss ` rq ss ´ sqn || n (133) n ě ||sn ´ rq ss || ´ || rq ss ´ sqn || n n n (134) n ss || ´ ||sn ´ rss || ´ || rq ss ´ sqn || ě || rss ´ rq b n n ě ndprss , rq ss q ´ ∆ (135) (136) 31 where (134) follows from triangle inequality. Utilizing this inequality, we have  „ ¯2 ´a n n n n n n D0 ` ∆ , A|Ψk , Z P rdpS , sq q ď D0 , A|Ψk , Z s ď P d prSs , rq ss q ď ‰ “ n ss q ď D01 , A|Ψk , Z n , “ P d prSsn , rq where D01 fi `? (137) (138) ˘2 D0 ` ∆ . Reorder the probabilities PrSs prssq, rss P N in decreasing order, and denote the result as Pi , i “ 1, 2, .... Then P1 “ PrSs p0q, P2j “ P2j`1 “ PrSs pj∆q, j ě 1. Obviously, ∆fS ppj ` 1q∆q ď P2j “ P2j`1 ď ∆fS pj∆q , (139) 2 and hence for Gaussian sources, P2j “ P2j`1 “ ope´j q. From Remark 2, we have that PrSs satisfies the conditions (23)-(25). Define event n ! 1 ÿ A fi S n P Wδn , rSsn P Uδn prSsq, S prSsi , D0 q ě RrSs pD0 q ´ δ, n i“1 n n ) 1 ÿ 1 ÿ ‹ 1 rSs|Z“Zi1 prSsi , b‹ pZi1 qq ě RrSs|Z pD0 q ´ δ, b pZi q ě D0 ´ δ n i“1 n i“1 (140) for δ ą 0. Observe that the distribution PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn also satisfies (60) and (61), which implies i i i i pS n , Z 1n q is an i.i.d. sequence. Hence Lemma 14 still holds for this case. Following similar steps to the proof of Theorem 1, we can get ” “ ı ‰ PCZ n P dE pS n , Sqn q ď D0 |CZ n ą τn ” ď PCZ n max n n ss PN rq ” “ PCZ n max n n ss PB rq nRK 2ÿ (141) ı “ ‰ n ss q ď D01 , A|Ψk , Z n ą τn1 2´npRn ´RK q ` 1n P dprSsn , rq (142) k“1 nRK 2ÿ k“1 ď |B n | max PCZ n n n ss PB rq ı “ ‰ n ss q ď D01 , A|Ψk , Z n ą τn1 2´npRn ´RK q ` 1n P dprSsn , rq nRK ” 2ÿ ı n ss q ą τn1 2´npRn ´RK q ` 1n , ξk,zn prq (143) k“1 where ! ? ) ssn P N n : }rq ssn } ď nΓ B n fi rq with ? Γ fi (144) a ? a λ p1 ` δq ` ∆ ` D01 , ‰ “ n n ss q fi P d prSsn , rq ss q ď D01 , A|Ψk , Z n , ξk,zn prq (145) a and (142) follows that S n only appears in the ball with radius nλ p1 ` δq which implies rSsn only appears in a ? n ss P B n instead of the whole set the ball with radius λ p1 ` δq ` ∆ , hence it is sufficient to only consider rq N n. 32 Furthermore, observe that Volume of n´ball with radius |B | ď ∆n ´? ¯n ? n{2 π nΓ ` n∆2 ˘ ` “ ∆n Γ n2 ` 1 ? n n ď 22 n “ 22 nΓ ` log q p ∆2 ´ 12 log πn`op1q n∆2 (146) (147) ? ? log π`n logp nΓ` n∆2 q´n log ∆´ n 2 log ? ? 2 Γ` ∆2 2πe ? n 1 2e ´ 2 log πn`op1q (148) . (149) Therefore, if we can show that the probability in (143) decays doubly exponentially fast with n, then the proof will be complete. Apply Lemmas 12, 15 and 16, then we have the probability in (143) decays doubly exponentially fast with m. ” “ ‰ı Hence lim ECZ n maxRn Hcodes P dE pS n , Sqn q ď D0 “ 0 if nÑ8 ( lim sup Rn ă min RK ` RrSs|Z pD01 q, RrSs pD01 q . (150) nÑ8 To complete the proof, we need to show RrSs|Z pD01 q ě RS|Z pD0 q and RrSs pD01 q ě RS pD0 q as ∆ Ñ 0. 1 1 1 q˚ q˚ Suppose PrSs q ˚ |rSsZ achieves RrSs|Z pD0 q, then RrSs|Z pD0 q “ IprSs; rSs |Zq and EdprSs, rSs q ď D0 . Since for PrSsrSs q ˚ |SZ “ PrSs|S PrSs q ˚ |rSsZ , ´ ¯2 q ˚ q “ E S ´ rSs ` rSs ´ rSs q˚ EdpS, rSs ´ ¯2 ´ ¯ q ˚ ` E pS ´ rSsq2 ` 2E pS ´ rSsq rSs ´ rSs q˚ “ E rSs ´ rSs b q ˚ q ` ∆ EdprSs, rSs q ˚q ď EdprSs, rSs a ď D01 ` ∆ D01 , (151) (152) (153) (154) a ˘ ` where (153) follows from the Cauchy–Schwarz inequality. On the other hand, RS|Z D01 ` ∆ D01 is defined a ˘ a ` q ˚ |Zq “ q q ď D1 ` ∆ D1 . Hence RS|Z D1 ` ∆ D1 ď IpS; rSs as the minimum IpS; S|Zq such that EdpS, Sq 0 0 0 0 q ˚ |Zq “ RrSs|Z pD1 q. Let ∆ Ñ 0, then we have RS|Z pD0 q ď lim∆Ñ0 RrSs|Z pD1 q. Similarly, we can IprSs; rSs 0 0 prove RS pD0 q ď lim∆Ñ0 RrSs pD01 q. This completes the proof of Theorem 5. A PPENDIX F P ROOF OF T HEOREM 6 Denote X 1n , Yi1n , Z 1n as (55)-(57), where ΨK p¨q denotes the orthogonal transform, instead of the permutation operation. Then it can be verified that for Gaussian source-channel pair, the distribution PCS n KS 1n X n Y n Z n X 1n Y 1n Z 1n Sp1n Spn i i i also satisfies (60) and (61). Hence pΨK , Z n q Ñ Z 1n Ñ S n forms a Markov chain. Similar to the permutation-based scheme, it is easy to show the power constraint and the distortion constraints for legitimate users are satisfied. Next by following similar steps to the proof for the permutation-based scheme, we prove the secrecy constraint is also satisfied. But a slight difference is that here we use an argument from a geometric point of view, instead of the one from the view of rate-distortion theory (or method of types) used for Theorems i 33 1, 2, and 5. Here we do not need to discretize the source. But we still need to discretize the reconstruction Sq as (131), since it will enable us to take the maximizing operation out of the probability, just as done in (141)-(143). Define event A fi ( ` n 1n ˘ P Wδn pS, Zq , S ,Z (155) for δ ą 0. For jointly Gaussian variables X and Z, where Z “ X ` U and U is independent of X, the δ-weakly typical set and the δ-weakly jointly typical set become ˇ }xn }2 ˇ ! ) ˇ ˇ Wδn pXq fi xn P X n : ˇ ´ 1ˇ ď δ , nNX (156) and Wδn pX, Zq fi ˇ }xn }2 ˇ ˇ ˇ pxn , z n q P R2n : ˇ ´ 1ˇ ď δ, nNX ˇ }z n }2 ˇ ˇ ˇ ´ 1ˇ ď δ, ˇ nNZ 2 ˇ }xn }2 ˇ ) }z n ´ xn } ˇ ˇ ` ´ 2ˇ ď δ , ˇ nNX nNU ! (157) (158) (159) respectively, where NZ , NX and NU denote the variances of Z, X and U , respectively. Since pS n , Z 1n q is an i.i.d. sequence, from the fact that (weakly) typical set has total probability close to one [28], we have the following lemma. Lemma 18. [28] For any δ ą 0, P rAc s Ñ 0, as n Ñ 8. Following similar steps to the proof of Theorem 5, we can get ” “ ı ‰ PCZ n P dpS n , Sqn q ď D0 |CZ n ą τn ď |B n | max PCZ n n n ss PB rq nRK ” 2ÿ ı n ss q ą τn1 2´npRn ´RK q ` 1n , ξk,zn prq (160) k“1 where B n is given by (144), and “ ‰ n n ss q fi P d pS n , rq ss q ď D01 , A|Ψk , Z n . ξk,zn prq (161) Since as shown in (149), |B n | is upper bounded by an exponential function, we only need to show that the probability in (160) decays doubly exponentially fast with n. To that end, we need introduce the following lemmas. The proofs of Lemmas 20 and 19 are given in Appendixes G and H, respectively. Lemma 19. Assume S n “ Z n ` U n , where Z n „ N p0, NZ Iq and U n „ N p0, NU Iq17 are independent, then for any z n , s̄n P Rn , Prd pS n , s̄n q ď D, pS n , z n q P Wδn |z n s ď 2´npRS|Z pDq´op1qq , where RS|Z pDq “ 17 Here 1 2 log` `N ˘ U D , and op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. 0 denotes an all-zero vector and I denotes an identity matrix (162) 34 Lemma 20. Assume S n „ N p0, NS Iq and S 1n “ ΨS n , with Ψ uniformly distributed on orthogonal matrices set and independent of S n , then for any s1n , s̄n P Rn , Prd pS n , s̄n q ď D, S n P Wδn |s1n s ď 2´npRS pDq´op1qq , where RS pDq “ 1 2 log` `N ˘ S D (163) , and op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Then we have n n n ss q ď D01 , S n P Wδn |Ψk , z n s ss q ď EΨk Prd pS , rq EC ξk,zn prq ż ˘ ` n “ EΨk Prd pS n , rq ss q ď D01 , S n P Wδn |Ψk , z n , s1n sfS 1n |Z n s1n |Ψk , z n ds1n ż ˘ ` n ss q ď D01 , S n P Wδn |s1n sfS 1n |Z n s1n |z n ds1n “ PΨk rd pS n , rq 1 ď 2´npRS pD0 q´op1qq , (164) (165) (166) (167) where (167) follows from Lemma 20. Furthermore, Lemma 19 implies “ ‰ n n n ss q ď D01 , A|z 1n ξk,zn prq ss q “ P d pS , rq 1 ď 2´npRS|Z pD0 q´op1qq , (168) (169) where (167) follows from ΨK Z n Ñ Z 1n Ñ S n . Applying Lemmas 12, we have that the probability in (160) decays doubly exponentially fast with n. This completes the proof of Theorem 6. A PPENDIX G P ROOF OF L EMMA 19 Consider that Prd pS n , s̄n q ď D, pS n , z n q P Wδn |z n s 2 2 2 ď Prd pS n , s̄n q ď D, }z n } }S n ´ z n } }z n } P 1 ˘ δ, ` P 2 ˘ δ|z n s nNZ nNZ nNU ď Prd pS n , s̄n q ď D, }S n ´ z n } P 1 ˘ 2δ|z n s. nNU (170) 2 Denote R “ 1 n (171) 2 }S n ´ z n } , then Prd pS n , s̄n q ď D, pS n , z n q P Wδn |z n s ż NU p1`2δq ď fR|Z n pr|z n q Prd pS n , s̄n q ď D|R “ r, Z n “ z n sdr. (172) NU p1´2δq Given Z n “ z n , S n ´ z n „ N p0, NU Iq, and on the other hand, Gaussian distribution is isotropic (or invariant to rotation). Hence under condition of Z n “ z n and R “ r, S n is uniformly distributed over the sphere with center ? z n and radius nr. Prd pS n , s̄n q ď D|R “ r, Z n “ z n s ď Ω pθq , Ω pπq (173) 35 1 sin   O Fig. 6. Cap cut out by the cone on the unit sphere. where c θ “ arcsin D , r (174) and Ω pθq be solid angle in n space of a cone with half-angle θ, i.e., the area of a spherical cap on a unit sphere Ωpθq Ωpπq , (see Fig. 6). To approximate we need the following lemma. Lemma 21. [33] Let Ω pθq be solid angle in n space of a cone with half-angle θ, then it holds that ˆ ˆ ˙˙ Ω pθq sinn´1 θ 1 “? 1`O . Ω pπq n 2πn cos θ (175) Lemma 21 implies ? 1 1 1 Ω pθq “ 2nplog sin θ´ n logp 2πn sin θ cos θq` n logp1`Op n qqq Ω pπq “ 2nplog sin θ`op1qq . (176) (177) Combine (173), (174) and (177), then we have for any r P NU p1 ˘ 2δq, ´ ¯ ?D n log n n n n r `op1q Prd pS , s̄ q ď D|R “ r, Z “ z s ď 2 ´ b n log N ď2 U ´ ´n “2 1 2 log (178) ¯ D p1´2δq `op1q NU D (179) ¯ ´op1q , (180) where op1q is a term that vanishes as δ ѯ 0 and n Ñ 8. Combining (172) and (180) gives us Prd pS n , s̄n q ď ´ ´n D, pS n , z n q P Wδn |z n s ď 2 1 2 log NU D ´op1q . This completes the proof of Lemma 19. A PPENDIX H P ROOF OF L EMMA 20 Observe that Prd pS n , s̄n q ď D, S n P Wδn |s1n s 2 }S n } P 1 ˘ δ|s1n s nNS # + 1n 2 ` T 1n n ˘ }s } “ PΨ rd Ψ s , s̄ ď D|s1n s1 P1˘δ . nNS “ Prd pS n , s̄n q ď D, (181) (182) 36 Since Ψ is uniformly distributed on orthogonal matrices set (so is ΨT as stated in Lemma (4)), Lemma 5 implies that for any s1n , ΨT s1n is uniformly distributed over the sphere with center at the origin O and radius }s1n }. Hence ˘ ` Ω pθq PΨ rd ΨT s1n , s̄n ď D|s1n s ď , Ω pπq (183) where as described in the previous section, Ω pθq denotes solid angle in n space of a cone with half-angle θ, and d D . (184) θ “ arcsin 1 1n 2 n }s } 2 }s1n } From Lemma 21, we have for any s1n such that nNS P 1 ˘ δ, ˜ ¸ c n ˘ PΨ rd ΨT s1n , s̄n ď D|s1n s ď 2 ` log D 1 s1n }2 n} `op1q (185) ´ b n log N D `op1q S p1´δq ď2 ´ ´n ď2 1 2 log NS D ¯ (186) ¯ `op1q , (187) where op1q is a term that vanishes as δ Ñ 0 and n Ñ 8. Combining (182) and (187) gives us ´ n n n Prd pS , s̄ q ď D, S P Wδn |s1n s ď2 ´n 1 2 log NS D ¯ `op1q . (188) This completes the proof of Lemma 20. A PPENDIX I P ROOF OF L EMMA 6 q q “ By choosing Sq to be independent of Z, we have RS|Z pD0 q “ min IpS; S|Zq ď min IpS; Sq q q PS|SZ :EdpS,SqďD PS|S 0 q q :EdpS,SqďD0 ´ ¯ pUBq RS pD0 q “ 12 log` Dλ0 . Then we only need to prove RS|Z pD0 q ď RS|Z pD0 q. First consider the case of λN0 P 1 `N0 ď D0 ď λ. Assume $ ’ &1, with probability p; Q“ ’ %0, with probability 1 ´ p, independent of pS, Zq, denotes a timesharing random variable, and also assume $ ’ &β0 ΨK Z, if Q “ 1; SqQ “ ’ %0, if Q “ 0, where β0 “ ? λP 1 P 1 `N0 (189) (190) and ΨK is defined in (36). Then ” ı EdpS, SqQ q “ EQ E dpS, SqQ q|Q “p λN0 ` p1 ´ pq λ. ` N0 P1 (191) (192) 37 Therefore, to satisfy distortion constraint EdpS, SqQ q ď D0 , it is sufficient to set p “ pλ´D0 qpP 1 `N0 q . λP 1 Substituting SqQ into RS|Z pD0 q, we have RS|Z pD0 q ď IpS; SqQ |Zq (193) ď IpS; SqQ Q|Zq (194) “ IpS; SqQ |QZq (195) “ pIpS; SqQ |Z, Q “ 1q ` p1 ´ pq IpS; SqQ |Z, Q “ 0q (196) “ pIpS; SqQ |Z, Q “ 1q (197) ď pIpS; K|Z, Q “ 1q (198) ď pHpKq (199) “p (200) 1 “ pλ ´ D0 q pP ` N0 q , λP 1 (201) where (195) follows from Q is independent of pS, Zq. Next consider the case of 0 ď D0 ď λN0 P 1 `N0 . Observe that RS|Z pD0 q “ q IpS; S|Zq min (202) q PS|SZ :EdpS,SqďD 0 q min “ q IpS; S|Zq (203) q IpS; SK|Zq (204) q PS|SZK :EdpS,SqďD 0 q min ď q PS|SZK :EdpS,SqďD 0 q “ IpS; K|Zq ` min q IpS; S|ZKq (205) q PS|SZK :EdpS,SqďD 0 q ď HpKq ` min q IpS; S|ZKq, (206) q PS|SZK :EdpS,SqďD 0 q where (203) follows since, on one hand, by setting PS|SZK in (203) as PS|SZ we have (202)ě(203); on the other q q ř hand, given PSZK , both the constraint and the optimization objective only depend on PS|SZ “ k PS|SZK PK|SZ , q q hence it suffices to optimize (203) over PS|SZ . q The first term of (206) satisfies HpKq “ 1. (207) By (38) and (39), we have S and ΨK Z are jointly Gaussian, i.e., ? where β0 “ λP 1 P 1 `N0 , ΨK S “ β0 ΨK Z ` V01 (208) ´ ¯ 0 is defined in (36), and V01 „ N 0, PλN is independent of ΨK Z. Hence we can also 1 `N 0 write Sq˚ “ β0 ΨK Z ` V02 (209) 38 and S “ Sq˚ ` ∆V02 , where V02 (210) ¯ ´ 0 and ∆V02 „ N p0, D0 q are independent of each other and also independent of „ N 0, PλN 1 `N ´ D0 0 ΨK Z. Therefore, we can bound the second term in (206) as q IpS; S|ZKq ď IpS; Sq˚ |ZKq min (211) q PS|SZK :EdpS,SqďD 0 q “ hpS|ZKq ´ hpS|ZK Sq˚ q (212) “ hpS|Kq ` hpZ|SKq ´ hpZ|Kq ´ hpS ´ Sq˚ |ZK Sq˚ q (213) 1 1 1 log 2πeλ ` log 2πeN0 ´ log 2πepP 1 ` N0 q ´ hpS ´ Sq˚ q 2 2 2 ˆ ˙ λN0 1 , ď log 2 D0 pP 1 ` N0 q ď (214) (215) where (211) follows since PSq˚ |SZK satisfies the constraint EdpS, Sq˚ q ď D0 , and (214) follows since ΨK Z Ñ Sq˚ Ñ S forms a Markov chain and S ´ Sq˚ is independent of Sq˚ . pUBq Combining (206), (207) and (215) gives us RS|Z pD0 q ď RS|Z pD0 q. This completes the proof of Lemma 6. A PPENDIX J P ROOF OF T HEOREM 11 Following similar steps to the proof for the scalar Gaussian case, it is easy to prove Rpiq is achievable by the permutation based scheme. However, for the orthogonal-transform based scheme, the proof for the scalar Gaussian case cannot be applied to the vector Gaussian case directly, and some details need to be treated specially. Next we give a proof for this case. Following similar steps to the proof of Theorem 6, it can be shown that for vector Gaussian case, the distortion constraints and power constraint are satisfied for the tuples given in Theorem 11. Next we prove the secrecy constraint is also satisfied. Define events ( ` n 1n ˘ Sj , Z j P Wδn pSj , Zj q , ź A fi Aj , Aj fi (216) (217) jPrms “ ‰ for δ ą 0. Similar to Lemma 18, it can be shown that for any δ ą 0, P Acj Ñ 0, as n Ñ 8. The derivation up to (160) still holds for vector Gaussian case. Hence ” ı “ ‰ qn q ď D0 |CZ n ą τn PCZ n max P dpS n , S Rn Hcodes ” ď PCZ n where D01 fi `? max qn PRmn s nRK 2ÿ k“1 ˘2 D0 ` m∆ . “ n n ss q ď P dpS , rq D01 , A|Ψj,k , j P rms, Z n ‰ ą τn1 2´npRn ´RK q ff ı ` 1n , (218) 39 ˘ ` ş śm n Observe that P rdpS n , rq ss q ď D0 , A|Ψj,k , j P rms, Z n s “ řm dpsn ,rqsj sn qďD1 ,A j“1 f snj |Ψj,k , zjn dsnj . One j“1 j ‰ ş ś śm 0 “ n sj s q ď dj , Aj |Ψj,k , Zjn may expect to exchange with , in order to write the expression as j“1 P dpSjn , rq řm for some dj , j P rms such that j“1 dj ď D01 . However, obviously this is not feasible. To address this problem, we ş ř need to discretize the source, and then eliminate the operation since after discretization it becomes a operation with the number of summands polynomial in n. `S˘ Discretize S by rSs “ ∆ ¨ Round ∆ . Then we have ‰ “ n P dpS n , rq ss q ď D01 , A|Ψj,k , j P rms, Z n ‰ “ n n ď P d prSs , rq ss q ď D02 , A|Ψj,k , j P rms, Z n , where D02 fi (219) `a 1 ˘2 D0 ` m∆ . In addition, observe that ‰ “ n n P d prSs , rq ss q ď D01 , A|Ψj,k , j P rms, Z n m ”ÿ ı n n sj s q ď D01 , A|Ψj,k , j P rms, Z n “P dprSj s , rq (220) j“1 “ m ÿ ź “ ‰ n n sj s q “ dj , Aj |Ψj,k , Zjn P dprSj s , rq (221) dPD mn j“1 ď m ÿ ź “ ‰ n P dpSjn , rq sj s q ď d1j , Aj |Ψj,k , Zjn , (222) dPD mn j“1 where d1j fi `a ˘2 dj ` ∆ , and n n n n n n Dmn fi dprss , rq ss q : rss , rq ss P B mn , d prss , rq ss q ď D01 ! ) a n n B mn fi rq ss P N mn : }rq sj s } ď nΓj , 1 ď j ď m ( a a a n λj p1 ` δq ` ∆ ` mD01 . (221) follows from that Aj implies }rSj s } ď nλj p1 ` δq ` ∆, hence a n it is sufficient to only consider the case of }rq sj s } ď nΓj . (222) is obtained by using triangle inequality again. with a Γj fi Combining (218), (219) and (222) gives us ” ı “ ‰ qn q ď D0 |CZ n ą τn PCZ n max P dpS n , S Rn Hcodes ď |B mn | max PCZ n n mn ss PB rq nRK ” 2ÿ ı n ss q ą τn1 2´npRn ´RK q ` 1n , ξk,zn prq (223) k“1 where m ÿ ź “ ‰ n P dpSjn , rq sj s q ď d1j , Aj |Ψj,k , Zjn . n ξk,zn prq ss q fi (224) dPD mn j“1 “ ‰ n n Given rq ss and z n , ξk,zn prq ss q , k P 2nRK are i.i.d. with mean n EC ξk,zn prq ss q “ EC m ÿ ź ‰ “ n sj s q ď d1j , Aj |Ψj,k , Zjn P dpSjn , rq (225) dPD mn j“1 m ÿ ź “ dPD mn j“1 ‰ “ n sj s q ď d1j , Aj |Ψj,k , Zjn . EΨj,k P dpSjn , rq (226) 40 To bound (223), we need to bound |B mn | and |Dmn | first. Similar to (149), it can be shown |B n mn |ď2 n n 2 j“1 log ? Γj ` ∆2 2 q ∆2 `Oplog nq . (227) a a n sj s } ď nΓj , using triangle inequality we have nΓj , }rq n sj s such that }rsj s } ď In addition, for rsj s , rq n ? p 2πe řm n n 2 n dprsj s , rq sj s q “ }rsj s ´ rq sj s } ď 4nΓj . (228) Combine it with n n ¯2 ∆2 ÿ ´ 1 ÿ 2 prsi,j s ´ rq si,j sq “ li,j ´ q li,j , n i“1 n i“1 ´ ¯ ` si,j ˘ sqi,j fi Round ∆ and q li,j fi Round ∆ are both integers, then we have n n dprsj s , rq sj s q “ where li,j n ´ ÿ ¯2 li,j ´ q li,j ď i“1 In addition, řn i“1 4n2 Γj . ∆2 (229) (230) ¯2 ´ li,j ´ q li,j P N Y t0u, hence |D mn m ˆ ź 4n2 Γj |ď j“1 ∆2 ˙ `1 . (231) That is, |Dmn | is bounded by a polynomial term of n. If we can show that the probability in (223) decays doubly exponentially fast with n, then the proof will be complete. To that end, by using Lemma 19 we have řm n ξk,zn prq ss q ď |Dmn | 2´np j“1 RSj |Zj pd1j q´op1qq ř 1 ´np m j“1 RSj |Zj pdj q´op1qq (232) “2 (233) ď 2´nmpRS|Z pD0 `∆ q´op1qq , (234) where RS|Z pDq given in (52) denotes the conditional rate-distortion function for source S with side information Z at both encoder and decoder, op1q is a term that vanishes as δ Ñ 0 and n Ñ 8, and ∆ is a term that vanishes as ∆ Ñ 0. (233) follows from that |Dmn | grows only polynomially fast with n. From Lemma 20, we have for any z n , n EC ξk,zn prq ss q ď 2´nmpRS pD0 `∆ q´op1qq , (235) where RS pDq given in (51) denotes the point-to-point rate-distortion function for S. Using these bounds and applying Lemmas 12, we have that the probability in (223) decays doubly exponentially fast with n. This completes the proof of Theorem 11. R EFERENCES [1] C. E. Shannon, “Communication in the presence of noise,” Proc. IRE, vol. 37, no. 1, pp. 10-21, Jan. 1949. [2] T. J. Goblick, “Theoretical limitations on the transmission of data from analog sources,” IEEE Trans. Inf. Theory, vol. IT-11, no. 4, pp. 558-567, Oct. 1965. 41 [3] M. Gastpar, B. Rimoldi, and M. Vetterli, “To code, or not to code: lossy source-channel communication revisited,” IEEE Trans. Inf. Theory, vol. 49, no. 5, pp. 1147-1158, May 2003. [4] K. H. Lee, and D. P. Petersen, “Optimal linear coding for vector channels,” IEEE Trans. Commun., vol. 24, no. 12, pp. 1283-1290, Dec. 1976. [5] S. Shamai, S. Verdú, and R. Zamir, “Systematic lossy source/channel coding,” IEEE Trans. Inf. Theory, vol. 44, no. 3, pp. 564-579, Mar. 1998. [6] V. Prabhakaran, R. Puri, and K. Ramchandran, “Hybrid digital-analog codes for source-channel broadcast of Gaussian sources over Gaussian channels,” IEEE Trans. Inf. Theory, vol. 57, no. 7, pp.4573-4588, Aug. 2011. [7] L. Yu, H. Li, and W. Li, “Wireless scalable video coding using a hybrid digital-analog scheme,” IEEE Trans. Circuits Syst. Video Technol., vol. 24, no. 2, pp. 331-345, Feb. 2014. [8] L. Yu, H. Li, and W. Li, “Wireless cooperative video coding using a hybrid digital-analog scheme,” IEEE Trans. Circuits Syst. Video Technol., vol. 25, no. 3, pp. 436-450, Mar. 2015. [9] L. Yu, H. Li, and W. Li, “Distortion bounds for source broadcast over degraded channel,” IEEE Int. Symp. Inf. Theory (ISIT), 2016. [10] L. Yu, H. Li, and W. Li, “Distortion bounds for source broadcast problem,” Submitted to IEEE Trans. Inf. Theory, 2016. [11] Z. Reznic, M. Feder, and R. Zamir, “Distortion bounds for broadcasting with bandwidth expansion,” IEEE Trans. Inf. Theory, vol. 52, no. 8, pp. 3778-3788, Aug. 2006. [12] C. Tian, S. Diggavi, and S. Shamai, “Approximate characterizations for the Gaussian source broadcasting distortion region,” IEEE Trans. Inf. Theory, vol. 57, no. 1, pp. 124-136, Jan. 2011. [13] C. E. Shannon, “Communication theory of secrecy systems,” Bell Syst. Tech. J., vol. 28, no. 4, pp. 656–715, Oct. 1949. [14] C. Schieler, and P. Cuff, “The henchman problem: Measuring secrecy by the minimum distortion in a list,” IEEE Trans. Inf. Theory, vol. 62, no. 6, pp. 3436–3450, Jun. 2016. [15] L. Yu, H. Li, and W. Li, “Source-channel secrecy for Shannon cipher system,” IEEE Trans. Inf. Theory, vol. 63, no. 4, pp. 2596-2622, Apr. 2017. [16] H. Yamamoto, “Rate-distortion theory for the Shannon cipher system,” IEEE Trans. Inf. Theory, vol. 43, no. 3, pp. 827–835, May 1997. [17] M. P. Wilson, and K. Narayanan, “Transmitting an analog Gaussian source over a Gaussian wiretap channel under SNR mismatch,” IEEE International Conference on Telecommunications, pp.44-47, April 2010. [18] G. Bagherikaram and K. Plataniotis, “Secure hybrid digital-analog Wyner-Ziv coding,” in IEEE 22nd International Symposium on Personal Indoor and Mobile Radio Communications, pp. 1161 –1166, Sep. 2011. [19] G. Bagherikaram and K. Plataniotis, “Secure joint source-channel coding with interference known at the transmitter,” IET Communications, vol. 6, no. 17, pp. 2796 - 2808, Jan. 2013. [20] S. C. Kak and N. S. Jayant, “On speech encryption using waveform scrambling,” Bell Syst. Tech. J., vol. 56, pp. 781-808, May-Jun. 1977. [21] A. D. Wyner, “An analog scrambling scheme which does not expand bandwidth, Part I: Discrete time,” IEEE Trans. Inf. Theory, vol. IT-25, pp. 261-274, May 1979. [22] R. Ahlswede and G. Dueck, “Good codes can be produced by a few permutations,” IEEE Trans. Inf. Theory, vol. 28, no. 3, pp. 430–443, May 1982. [23] W. Kang and N. Liu “Compressing encrypted data: Achieving optimality and strong secrecy via permutations,” IEEE Trans. on Inf. Theory, vol. 62, no. 12, pp. 7153-7163, Dec. 2016. [24] D. Slepian, “Permutation modulation,” Proc. IEEE, vol. 53, pp. 228–236, Mar. 1965. [25] D. Slepian, “Group codes for the Gaussian channel,” Bell Syst. Tech. J., vol. 47, pp. 575–602, Apr. 1968. [26] T. Ericson, “A min-max theorem for antijamming group codes,” IEEE Trans. Inf. Theory, vol. IT-30, pp. 792–799, Nov. 1984. [27] A. Lapidoth and S. Tinguely, “Sending a bivariate Gaussian over a Gaussian MAC,” IEEE Trans. Inf. Theory, vol. 56, no. 6, pp. 2714–2752, Jun. 2010. [28] T. M. Cover and J. A. Thomas, Elements of Information Theory, Wiley, New York, 1991. [29] I. Csiszár, and J. Körner, Information theory: coding theorems for discrete memoryless systems. Cambridge University Press, 2011. [30] A. El Gamal and Y.-H. Kim, Network Information Theory. Cambridge University Press, 2011. [31] M. L. Eaton, Multivariate Statistics: A Vector Space Approach, Wiley and Sons, New York, NY, 1983. [32] I. Sason and S. Verdú “f -divergence inequalities,” IEEE Trans. on Inf. Theory, vol. 62, no. 11, pp. 5973–6006, Nov. 2016. [33] C. E. Shannon, “Probability of error for optimal codes in a Gaussian channel,” Bell Syst. Tech. J., vol. 38, pp. 611–656, 1959. 42 [34] S.-W. Ho and R. W. Yeung, “On information divergence measures and a unified typicality,” IEEE Trans. Inf. Theory, vol. 56, no. 12, pp. 5893–5905, Dec. 2010.
7cs.IT
Size-Independent Sample Complexity of Neural Networks arXiv:1712.06541v2 [cs.LG] 10 Jan 2018 Noah Golowich Harvard University Alexander Rakhlin University of Pennsylvania Ohad Shamir Weizmann Institute of Science and Microsoft Research Abstract We study the sample complexity of learning neural networks, by providing new bounds on their Rademacher complexity assuming norm constraints on the parameter matrix of each layer. Compared to previous work, these complexity bounds have improved dependence on the network depth, and under some additional assumptions, are fully independent of the network size (both depth and width). These results are derived using some novel techniques, which may be of independent interest. 1 Introduction One of the major challenges involving neural networks is explaining their ability to generalize well, even if they are very large and have the potential to overfit the training data [Neyshabur et al., 2014, Zhang et al., 2016]. Learning theory teaches us that this must be due to some inductive bias, which constrains one to learn networks of specific configurations (either explicitly, e.g., via regularization, or implicitly, via the algorithm used to train them). However, understanding the nature of this inductive bias is still largely an open problem. A useful starting point is to consider the much more restricted class of linear predictors (x 7→ w⊤ x). For this class, we have a very good understanding of how its generalization behavior is dictated by the norm of w . In particular, assuming that kwk ≤ M (where k · k signifies Euclidean norm), and the distribution is such that kxk ≤ B almost surely, it is well-known that the generalization error (w.r.t. Lipschitz losses) √ given m training examples scales as O(M B/ m), completely independent of the dimension of w. Thus, it is very natural to ask whether in the more general case of neural networks, one can obtain similar “sizeindependent” results (independent of the networks’ depth and width), under appropriate norm constraints on the parameters. This is also a natural question, considering that the size of modern neural networks is often much larger than the number of training examples. Classical results on the sample complexity of neural networks (see Anthony and Bartlett [2009]) do not satisfy this desideratum, and have a strong explicit dependence on the network size. In particular, they can be trivial once the number of parameters exceeds the number of training examples. More recently, there have been several works aiming at improving the sample complexity bounds, assuming various norm constraints on the parameter matrices. For example, Neyshabur et al. [2015] use Rademacher complexity tools to show that if the parameter matrices W1 , . . . , Wd in each of the d layers have Frobenius norms upperbounded by MF (1), . . . , MF (d) respectively, and under suitable assumptions on the activation functions, the generalization error scales (with high probability) as ! Q B2d dj=1 MF (j) √ . (1) O m 1 Although this bound has no explicit dependence on the network width (that is, the dimensions of W1 , . . . , Wd ), it has a very strong, exponential dependence on the network depth d, even if MF (j) ≤ 1 for all j. Neyshabur et al. [2015] also showed that this dependence can sometimes be avoided for anti-symmetric activations, but unfortunately this is a non-trivial assumption, which is not satisfied for common activations such as the ReLU. Bartlett et al. [2017] use a covering numbers argument to show a bound scaling as  2/3 !3/2   Q  P T kWj k2,1 d d B  j=1 j=1 kWj k kWj k     √ Õ  (2)  ,   m   P pP 2 where kW k denotes the spectral norm of W , kW T k2,1 := l k Wj (l, k) denotes the 1-norm of the 2-norms of the rows of W , and where we ignore factors logarithmic in m and the network width. Unlike Eq. (1), here there is no explicit exponential dependence on the depth. However, there is still a strong and √ unavoidable polynomial dependence: To see this, note that for any Wj , the bound above can never be smaller than r    d Y d3  kWj k . Õ B  m P l P 2 k Wj (l,k) kWj k ≥ kWj kF kWj k ≥ 1, so j=1 In particular, even if we assume that B Ω(m1/3 ). Q  d j=1 kWj k is a constant, the bound becomes trivial once d ≥ Finally, and using the same notation, Neyshabur et al. [2017] utilize a PAC-Bayesian analysis to prove a bound scaling as   v u  2 P kW k d j u F 2 d Y  t d h i=1 kWj k2   ,   kW k B Õ  (3) j   m j=1 kW k where h denotes the network width.1 Again, since kWjj kF ≥ 1 for any parameter matrix Wj , this bound   q  √ Qd d3 h can never be smaller than Õ B , and becomes trivial once d 3 h ≥ Ω(m1/3 ). To j=1 kWj k m summarize, although some of the bounds above have logarithmic or no dependence on the network width, we are not aware of a bound in the literature which avoids a strong dependence on the depth, even if various norms are controlled. Can this depth dependency be avoided, assuming the norms are sufficiently constrained? We argue that in some cases, it must be true. To see this, let us return to the well-understood case of linear predictors, and consider generalized linear predictors of the form n   o x 7→ σ w⊤ x : kwk ≤ M , where σ(z) = max{0, z} is the ReLU function. Like plain-vanilla linear predictors, the generalization √ error of this class is well-known to be O(M B/ m), assuming the inputs satisfy kxk ≤ B almost surely. 1 Bartlett et al. [2017] note that this PAC-Bayesian bound is never better than the bound in Eq. (2) derived from a covering numbers argument. 2 However, it is not difficult to show that this class can be equivalently written as a class of “ultra-thin” ReLU networks of the form   d   Y |wj | ≤ M , (4) x 7→ σ(wd · σ(. . . w2 · σ(w1⊤ x))) : kw1 k ·   j=2 (where w1 is a vector and w2 , . . . , wd are scalars), where the depth d is arbitrary. Therefore, the sample √ complexity of this class must also scale as O(M B/ m): This depends on the norm product M , but is completely independent of the network depth d as well as the dimension of w1 . We argue that a “satisfactory” sample complexity analysis should have similar independence properties when applied on this class. In more general neural networks, the vector w1 and scalars w2 , . . . , wd become matrices W1 , . . . , Wd , and the simple observation above no longer applies. Qd However, using the same intuition, it is natural to try and derive generalization bounds by controlling j=1 kWj k, where k · k is a suitable matrix norm. Perhaps the simplest choice is the spectral norm (and indeed, a product of spectral norms was utilized in some of the previous results mentioned earlier). However, as we formally show in Sec. 5, the spectral norm alone is too weak to get size-independent bounds, even if the network depth is small. Instead, we show that controlling other suitable norms can indeed lead to better depth dependence, or even fully size-independent bounds, improving on earlier works. Specifically, we make the following contributions: • In Sec. 3, we show that the exponential depth dependence in Rademacher complexity-based analysis (e.g. Neyshabur et al. [2015]) can be avoided by applying contraction to a slightly different object than what has become standard since the work of Bartlett and Mendelson [2002]. For example, for networks with parameter matrices of Frobenius norm at most MF (1), . . . , MF (d), the bound in Eq. (1) can be improved to ! √ Q B d dj=1 MF (j) √ O . (5) m The technique can also be applied to other types of norm constraints. For example, if we consider an ℓ1 /ℓ∞ setup, corresponding to the class of depth-d networks, where the 1-norm of each row of Wj is at most M (j), we attain a bound of ! p Q B d + log(n) · dj=1 M (j) √ , O m where n is the input dimension. Again, the dependence on d is polynomial and quite mild. In contrast, Neyshabur et al. [2015] studied a similar setup and only managed to obtain an exponential dependence on d. • In Sec. 4, we develop a generic technique to convert depth-dependent bounds to depth-independent bounds, assuming some control over any Schatten norm of the parameter matrices (which includes, for instance, the Frobenius norm and the trace norm as special cases). The key observation we utilize is that the prediction function computed by such networks can be approximated by the composition of a shallow network and univariate Lipschitz functions. For example, again assuming that the Frobenius norms of the layers are bounded by MF (1), . . . , MF (d), we can further improve Eq. (5) to  ( r ) d Y d  1 MF (j) · min Õ B , . (6) 1/4 m m j=1 3 Q ignoring logarithmic factors. Note that this can be upper bounded by Õ(B dj=1 MF (j)/m1/4 ), which to the best of our knowledge, is the first explicit bound for standard neural networks which is fully size-independent, assuming only suitable norm constraints. Moreover, it captures the depthindependent sample complexity behavior of the network class in Eq. (4) discussed earlier. We also apply this technique to get a depth-independent version of the bound in [Bartlett et al., 2017]: SpecifkW T k2,1 j ically, if we assume that kWj k ≤ M (j) for all j, and maxj kW jk provided by Bartlett et al. [2017] becomes  r  d Y d3  . M (j) · Õ BL m ≤ L, then the bound in Eq. (2) j=1 In contrast, we show the following bound for any p ≥ 1 (ignoring some lower-order logarithmic factors):     Q  21 d +p r   B d 3  log M (j) Y p j=1 Γ d3   M (j) · min Õ BL ,  , 1  m   m 2+3p j=1 where Mp (j) is a bound on the Schatten p-norm of Wj , and Γ is the largest possible Euclidean norm of the network’s output, over all input vectors of norm at most B. Again, by upper bounding the min by its first argument, we get a bound independent of the depth d, assuming the norms are suitably constrained. • In Sec. 5, we provide a lower bound, showing that for any p, the class of depth-d, width-h neural networks, where each parameter matrix Wj has Schatten p-norm at most Mp (j), can have Rademacher complexity of at least  o n Qd max 0, 12 − p1   B j=1 Mp (j) · h √ Ω  . m This somewhat improves on Bartlett et al. [2017, Theorem 3.6], which only showed such a result for p = ∞ (i.e. with spectral norm control), and without the h term. For p = 2, it matches the upper bound in Eq. (6) in terms of the norm dependencies and B. Moreover, it establishes that controlling the spectral norm alone (and indeed, any Schatten p-norm control with p > 2) cannot lead to bounds independent of the size of the network. Finally, the bound shows (similar to Bartlett et al. [2017]) that a dependence on products of norms across layers is generally inevitable. Besides the above, we provide some additional remarks and observations in Sec. 6. Most of our technical proofs are presented in Sec. 7. 2 Preliminaries Notation. We use bold-faced letters to denote vectors, and capital letters to denote matrices or fixed parameters (which should be clear from context). Given a vector w ∈ Rh , kwk will refer to the Euclidean norm, 1/p P h p and for p ≥ 1, kwkp = will refer to the ℓp norm. For a matrix W , we use kW kp , where |w | i i=1 p ∈ [1, ∞], to denote the Schatten p-norm (that is, the p-norm of the spectrum of W , written as a vector). 4 For example, p = ∞ refers to the spectral norm, p = 2 refers to the Frobenius norm, and p = 1 refers to the trace norm. For the case of the spectral norm, we will drop the ∞ subscript, and use just kW k. Also, in order to follow standard convention, we use kW kF to denote the Frobenius norm. Finally, given a matrix  q/p 1/q P P p denote the q-norm of the p-norms of W and reals p, q ≥ 1, we let kW kp,q := k j |Wj,k | the columns of W . Neural Networks. Given the domain X = {x : kxk ≤ B} in Euclidean space, we consider (scalar or vector-valued) standard neural networks, of the form x 7→ Wd σd−1 (Wd−1 σd−2 (. . . σ1 (W1 x))), where each Wj is a parameter matrix (with some fixed dimensions), and each σj is some fixed Lipschitz continuous function between Euclidean spaces, satisfying σj (0) = 0. In the above, we denote d as the depth of the network, and its width h is defined as the maximal row or column dimensions of W1 , . . . , Wd . Without loss of generality, we will assume that σj has a Lipschitz constant of at most 1 (otherwise, the Lipschitz constant can be absorbed into the norm constraint of the neighboring parameter matrix). We say that σ is element-wise if it can be written as an application of the same univariate function over each coordinate of its input (in which case, somewhat abusing notation, we will also use σ to denote that univariate function). We say that σ is positive-homogeneous if it is element-wise and satisfies σ(αz) = ασ(z) for all α ≥ 0 and z ∈ R. An important example of the above are ReLU networks, where every σj corresponds to applying the (positive-homogeneous) ReLU function σ(z) = max{0, z} on each element. To simplify notation, we let Wbr be shorthand for the matrix tuple {Wb , Wb+1 , . . . , Wr }, and NWbr denote the function computed by the sub-network composed of layers b through r, that is x 7→ Wr σr−1 (Wr−1 σr−2 (. . . σb (Wb x))) . Rademacher Complexity. The results in this paper focus on Rademacher complexity, which is a standard tool to control the uniform convergence (and hence the sample complexity) of given classes of predictors (see Bartlett and Mendelson [2002], Shalev-Shwartz and Ben-David [2014] for more details). Formally, given a real-valued function class H and some set of data points x1 , . . . , xm ∈ X , we define the (empirical) Rademacher complexity R̂m (H) as # " m 1 X εi h(xi ) , (7) R̂m (H) = Eǫ sup h∈H m i=1 where ε = (ε1 , . . . , εm ) is a vector uniformly distributed in {−1, +1}m . Our main results provide bounds on the Rademacher complexity (sometimes independent of x1 , . . . , xm , as long as they are assumed to have norm at most B), with respect to classes of neural networks with various norm constraints. Using standard arguments, such bounds can be converted to bounds on the generalization error, assuming access to a sample of m i.i.d. training examples. 3 From Exponential to Polynomial Depth Dependence To get bounds on the Rademacher complexity of deep neural networks, a reasonable approach (employed in Neyshabur et al. [2015]) is to use a “peeling” argument, where the complexity bound for depth d networks is reduced to a complexity bound for depth d − 1 networks, and then applying the reduction d times. For 5 example, consider the class Hd of depth-d ReLU real-valued neural networks, with each layer’s parameter matrix with Frobenius norm at most MF (j). Using some straightforward manipulations, it is possible to show that R̂m (Hd ), which by definition equals Eǫ sup h∈Hd m m i=1 i=1 1 X 1 X ǫi h(xi ) = Eǫ sup ǫi Wd σ(h(xi )), sup m h∈Hd−1 Wd :kWd kF ≤MF (d) m can be upper bounded by m MF (d) · Eǫ sup h∈Hd−1 1 X ǫi σ(h(xi )) m i=1 m ≤ 2MF (d) · Eǫ sup h∈Hd−1 1 X ǫi h(xi )) . m (8) i=1 Q Iterating this inequality d times, one ends up with a bound scaling as 2d dj=1 MF (j) (as in Neyshabur et al. [2015], see also Eq. (1)). The exponential 2d factor follows from the 2 factor in Eq. (8), which in turn follows from applying the Rademacher contraction principle to get rid of the σ function. Unfortunately, this 2 factor is generally unavoidable (see the discussion in Ledoux and Talagrand [1991] following Theorem 4.12). In this section, we point out a simple trick, which can be used to reduce such exponential depth dependencies to polynomial ones. In a nutshell, P using Jensen’s inequality, we can rewrite the (scaled) Rademacher complexity m · R̂m (H) = Eǫ suph∈H m i=1 ǫi h(xi ) as ! !! m m X X 1 1 ǫi h(xi ) ≤ log Eǫ sup exp λ ǫi h(xi ) , log exp λ · Eǫ sup λ λ h∈H h∈H i=1 i=1 where λ > 0 is an arbitrary parameter. We then perform a “peeling” argument similar to before, resulting in a multiplicative 2 factor after every peeling step. Crucially, these factors accumulate inside the log factor, so that the √ end result contains only a log(2d ) = d factor, which by appropriate tuning of λ, can be further reduced to d. The formalization of this argument depends on the matrix norm we are using, and we will begin with the case of the Frobenius norm. A key technical condition for the argument to work is that we can perform the “peeling” inside the exp function. This is captured by the following lemma: Lemma 1. Let σ be a 1-Lipschitz, positive-homogeneous activation function which is applied element-wise (such as the ReLU). Then for any vector-valued class F, and any convex and monotonically increasing function g : R → [0, ∞), ! ! m m X X . ≤ 2 · Eǫ sup g R · Eǫ sup g ǫi f (xi ) ǫi σ(W f (xi )) f ∈F ,W :kW kF ≤R f ∈F i=1 i=1 Proof. Letting w1 , w2 , . . . , wh be the rows of the matrix W , we have m X i=1 2 ǫi σ(W f (xi )) = h X j=1 kwj k2 6 m X i=1 ǫi σ wj⊤ kwj k !!2 f (xi ) . P The supremum of this over all w1 , . . . , wh such that kW k2F = hj=1 kwj k2 ≤ R2 must be attained when kwj k = R for some j, and kwi k = 0 for all i 6= j. Therefore, ! ! m m X X ⊤ ǫi σ(W f (xi )) Eǫ sup g = Eǫ sup g ǫi σ(w f (xi )) . f ∈F ,W :kW kF ≤R f ∈F ,w:kwk=R i=1 i=1 Since g(|z|) ≤ g(z) + g(−z), this can be upper bounded by ! ! ! m m m X X X ⊤ ⊤ ⊤ ǫi σ(w f (xi )) , ǫi σ(w f (xi )) = 2·Eǫ sup g ǫi σ(w f (xi )) +Eǫ sup g − Eǫ sup g i=1 i=1 i=1 where the equality follows from the symmetry in the distribution of the ǫi random variables. The right hand side in turn can be upper bounded by ! ! m m X X ⊤ ǫi f (xi ) ǫi w f (xi ) ≤ 2 · Eǫ sup g kwk 2 · Eǫ sup g f ∈F ,w:kwk=R f ∈F ,w:kwk=R i=1 = 2 · Eǫ sup g R · f ∈F i=1 m X ǫi f (xi ) i=1 ! . (see equation 4.20 in Ledoux and Talagrand [1991]). With this lemma in hand, we can provide a bound on the Rademacher complexity of Frobnius-norm√ bounded neural networks, which is as clean as Eq. (1), but where the 2d factor is replaced by d: Theorem 1. Let Hd be the class of real-valued networks of depth d over the domain X , where each parameter matrix Wj has Frobenius norm at most MF (j), and with activation functions satisfying Lemma 1. Then Q p v d um d   B 2 log(2)d + 1 X Y p u j=1 MF (j) 1 2 t √ kxi k ≤ MF (j) · . 2 log(2)d + 1 R̂m (Hd ) ≤ m m i=1 j=1 Proof. Fix λ > 0, to be chosen later. The Rademacher complexity can be upper bounded as mR̂m (Hd ) = Eǫ sup N W1d−1 m X ,Wd i=1 ǫi Wd σd−1 (NW d−1 (xi )) 1 ! m X 1 ≤ log Eǫ sup exp λ ǫi Wd σd−1 (NW d−1 (xi )) 1 λ i=1 m X 1 ≤ log Eǫ sup exp MF (d) · λ ǫi σd−1 (NW d−1 (xi )) 1 λ i=1 ! We write this last expression as m X 1 log Eǫ sup exp MF (d) · λ ǫi σd−1 (Wd−1 f (xi )) λ f,kWd−1 kF ≤MF (d−1) i=1 !! m X 1 ǫi f (xi ) ≤ log 2 · Eǫ sup exp MF (d) · MF (d − 1) · λ λ f i=1 7 ! where f ranges over all possible functions σd−2 ◦ NW d−2 (x). Here we applied Lemma 1 with g(α) = 1 exp{MF (d)λ · α}. Repeating the process, we arrive at !! m X 1 (9) ǫi xi mR̂m (Hd ) ≤ log 2d · Eǫ exp M λ λ i=1 where M = Qd j=1 MF (j). Define a random variable Z=M· m X ǫi xi , i=1 (random as a function of the random variables ǫ1 , . . . , ǫm ). Then n o d log(2) 1 1 log 2d · E exp λZ = + log {E exp λ(Z − EZ)} + EZ. λ λ λ (10) By Jensen’s inequality, E[Z] can be upper bounded by v  v  v   u u um 2 m m u u X X uX u  u ⊤ M tEǫ ǫi xi  = M tEǫ  kxi k2 . ǫi ǫi′ xi xi′  = M t i,i′ =1 i=1 i=1 To handle the log {E exp λ(Z − EZ)} term in Eq. (10), note that Z is a deterministic function of the i.i.d. random variables ǫ1 , . . . , ǫm , and satisfies Z(ǫ1 , . . . , ǫi , . . . , ǫm ) − Z(ǫ1 , . . . , −ǫi , . . . , ǫm ) ≤ 2M kxi k . This means that Z satisfies a bounded-difference condition, which by the proof of Theorem 6.2 in [Boucheron et al., 2013], implies that Z is sub-Gaussian, with variance factor m m i=1 i=1 X 1X kxi k2 , (2M kxi k)2 = M 2 v= 4 and satisfies Choosing λ = P P 2 2 1 1 λ2 M 2 m λM 2 m i=1 kxi k i=1 kxi k log {E exp λ(Z − EZ)} ≤ = . λ λ 2 2 √ 2 log(2)d √P and using the above, we get that Eq. (9) can be upper bounded as follows: m 2 M i=1 kxi k v v um um   n o X p p u uX 1 d 2 t 2 log(2)d + 1 t kxi k ≤ M kxi k2 , log 2 · E exp λZ ≤ EZ + 2 log(2)d · M λ i=1 i=1 from which the result follows. Remark 1. We note that for simplicity, the bound in Thm. 1 is stated for real-valued networks, but the argument easily carries over to vector-valued networks, composed with some real-valued Lipschitz loss function. In that case, one uses a variant of Lemma 1 to peel off the losses, and then proceed in the same manner as in the proof of Thm. 1. We omit the precise details for brevity. 8 A result similar to the above can also be derived for other entry-based matrix norms. For example, given a matrix W , let kW k1,∞ denote the maximal 1-norm of its rows, and consider the class Hd of depthd networks, where each parameter matrix Wj satisfies kWj k1,∞ ≤ M (j) for all j (this corresponds to a setting, also studied in Neyshabur et al. [2015], where the 1-norm of the weights of each neuron in the network is bounded). In this case, we can derive a variant of Lemma 1, which in fact does not require positive-homogeneity of the activation function: Lemma 2. Let σ be a 1-Lipschitz activation function with σ(0) = 0, applied element-wise. Then for any vector-valued class F, and any convex and monotonically increasing function g : R → [0, ∞), ! ! m m X X , (11) ≤ 2 · Eǫ sup g R · ǫi f (xi ) Eǫ sup g ǫi σ(W f (xi )) f ∈F ,W :kW k1,∞ ≤R i=1 f ∈F ∞ i=1 ∞ where k · k∞ denotes the vector infinity norm. Using the same technique as before, we can use this lemma to get a bound on the Rademacher complexity for Hd : Theorem 2. Let Hd be the class of real-valued networks of depth d over the domain X , where kWj k1,∞ ≤ M (j) for all j ∈ {1, . . . , d}, and with activation functions satisfying the condition of Lemma 2. Then v p Q u m d X Y p u 2B d + 1 + log(n) · dj=1 M (j) 2 2 √ xi,j ≤ M (j) · d + 1 + log(n) · t max , R̂m (Hd ) ≤ m m j∈{1,...,n} i=1 j=1 where xi,j is the j-th coordinate of the vector xi . The proofs of the theorem, as well as Lemma 2, appear in Sec. 7. The constructions used in the results of this section use the function g(z) = exp(λz) together with its inverse g−1 (z) = λ1 log(z), to get depth dependencies scaling as g−1 (2d ). Thus, it might be tempting to try and further improve the depth dependence, by using other functions gP for which g−1 increases sublogarithmically. Unfortunately, the argument still requires us to control Eǫ g (k m i=1 ǫi xi k), which is difficult if g increases more than exponentially. In the next section, we introduce a different idea, which under suitable assumptions, allows us to get rid of the depth dependence altogether. 4 From Depth Dependence to Depth Independence In this section, we develop a general result, which allows one to convert any depth-dependent bound on the Rademacher complexity of neural networks, to a depth-independent one, assuming that the Schatten p-norms of the parameter matrices (for any p ∈ [1, ∞)) is controlled. We develop and formalize the main result in Subsection 4.1, and provide applications in Subsection 4.2. The proofs the results in this section appear in Sec. 7. 4.1 A General Result To motivate our approach, let us consider a special case of depth-d networks, where • Each parameter matrix W1 , . . . , Wd−1 is constrained to be diagonal and of size h × h. 9 • The Frobenius norm of every W1 , . . . , Wd is at most 1. • All activation functions are the identity (so the network computes a linear function). Letting wi be the diagonal of Wi , such networks are equivalent to x 7→ (wd ◦ wd−1 ◦ . . . ◦ w1 )⊤ x , where ◦ denotes element-wise product. Therefore, if we would like the network to compute a non-trivial function, we clearly need that wd ◦ . . . ◦ w1 be bounded away from zero (e.g., not exponentially small in d), while still satisfying the constraint kwj k ≤ 1 for all j. In fact, the only way to satisfy both requirements simultaneously is if w1 , . . . , wd are all close to some 1-sparse unit vector, which implies that the matrices W1 , . . . , Wd must be close to being rank-1. It turns out that this intuition holds much more generally, even if we do not restrict ourselves to identity activations and diagonal parameter matrices as above. Essentially, what we can show is that if some network computes a non-trivial function, and the product of its Schatten p-norms (for any p < ∞) is bounded, then there must be at least one parameter matrix, which is not far from being rank-1. Therefore, if we replace that parameter matrix by an appropriate rank-1 matrix, the function computed by the network does not change much. This is captured by the following theorem: Q Theorem 3. For any p ∈ [1, ∞), any network NW d such that supx∈X kNW d (x)k ≥ Γ and dj=1 kWj kp ≤ 1 1 M , and for any r ∈ {1, . . . , d}, there exists another network NW̃ d (of the same depth and layer dimensions) 1 with the following properties: • W̃1d = {W̃1 , . . . , W̃d } is identical to W1d , except for the parameter matrix W̃r in the r-th layer, which is of rank at most 1, and equals suv⊤ where s, u, v are some leading singular value and singular vectors pairs of Wr . 1/p Q  2p log(M B/Γ) d . • supx∈X kNW d (x) − NW̃ d k ≤ B kW k j j=1 r 1 1 We now make the following crucial observation: A real-valued network with a rank-1 parameter matrix Wr = suv⊤ computes the function x 7→ Wd σd−1 (. . . σr (suv⊤ σr−1 (. . . σ1 (W1 x) . . .))) . This can be seen as the composition of the depth-r network x 7→ v⊤ σr−1 (. . . σ1 (W1 x) . . .), and the univariate function x 7→ Wd σd−1 (. . . σr (sux)) . Moreover, the norm constraints imply that the latter function is Lipschitz. Therefore, the class of networks we are considering is a subset of the class of depth-r networks composed with univariate Lipschitz functions. Fortunately, given any class with bounded complexity, one can effectively bound the Rademacher complexity of its composition with univariate Lipschitz functions, as formalized in the following theorem. 10 Theorem 4. Let H be a class of functions from Euclidean space to [−R, R]. Let FL,a be the class of of LLipschitz functions from [−R, R] to R, such that f (0) = a for some fixed a. Letting FL,a ◦ H := {f (h(·)) : f ∈ FL,a , h ∈ H}, its Rademacher complexity satisfies   R 3/2 R̂m (FL,a ◦ H) ≤ cL √ + log (m) · R̂m (H) , m where c > 0 is a universal constant. Remark 2. The log3/2 (m) · R̂m (H) can be replaced by log(m) · Ĝm (H), where Ĝm (H) is the empirical Gaussian complexity of H – see the proof in Sec. 7 for details. Combining these ideas, our plan of attack is the following: Given some class of depth-d networks, and an arbitrary parameter r ∈ {1, . . . , d}, we use Thm. 3 to relate their Rademacher complexity to the complexity of similar networks, but where one of the first r parameter matrices is of rank-1. We then use Thm. 4 to bound that complexity in turn using the Rademacher complexity of depth-r networks. Crucially, the resulting bound has no explicit dependence on the original depth d, only on the new parameter r. Formally, we have the following theorem, which is the main result of this section: Theorem 5. Consider the following hypothesis class of networks on X = {x : kxk ≤ B}: ( ) maxx∈X kNW d (x)k ≥ Γ 1 n o , H = NW d : kWj k kWj kp 1 ∀j ∈ {1 . . . d}, Wj ∈ Wj , max M (j) , Mp (j) ≤ 1 for some parameters p, Γ ≥ 1, {M (j), Mp (j), Wj }dj=1 . Also, for any r ∈ {1, . . . , d}, define   NW1r maps to R     ∀j ∈ {1 . . . r − 1}, W ∈ W j j r H r = NW 1 : . o n   kWj k kWj kp  , Mp (j) ≤ 1 ∀j ∈ {1 . . . r}, max M (j) Finally, for m > 1, let ℓ ◦ H = {(ℓ1 (h(x1 )), . . . , ℓm (h(xm ))) : h ∈ H}, where ℓ1 , . . . , ℓm are real-valued loss functions which are γ1 -Lipschitz and satisfy ℓ1 (0) = ℓ2 (0) = . . . = ℓm (0). Then the Rademacher complexity R̂m (ℓ ◦ H) is upper bounded by     1/p   Q  Qd d   B   log3/2 (m) · R̂ (H ) log Γ j=1 Mp (j) cB j=1 M (j)  1  m r  Qr + +√  ,  min   B j=1 M (j) γ r m r∈{1,...,d}   where c > 0 is a universal constant. In particular, one can upper bound this result by any choice of r in {1, . . . , d}. By tuning r appropriately, we can get bounds independent of the depth d. In the next subsection, we provide some concrete applications for specific choices of H. Remark 3. The parameters Γ and γ, which divide the norm terms in Thm. 5, are both closely related to the notion of a margin. Indeed, if we consider binary or multi-class classification, then bounds as above w.r.t. 1 γ -Lipschitz losses can be converted to a bound on the misclassification error rate in terms of the average γ-margin error on the training data (see Bartlett et al. [2017, Section 3.1] for a discussion). Also, Γ can be viewed as the “maximal” margin attainable over the input domain. 11 4.2 Applications of Thm. 5 In this section we exemplify how Thm. 5 can be used to obtain depth-independent bounds on the sample complexity of various classes of neural networks. The general technique is as follows: First, we prove a √ bound on R̂m (Hr ), which generally depends on the depth r, and scales as r α / m for some α > 0. Then, we plug it into Thm. 5, and utilize the following lemma to tune r appropriately: Lemma 3. For any α > 0, β ∈ (0, 1] and b, c, n ≥ 1, it holds that ) ( α   cr α dα b dα b α+β min min , . + β , ≤ min 3 · β r n n r∈{1,...,d} n (n/c) α+β We begin with proving a depth-independent version of Thm. 1. That theorem implies that for the class Hr of depth-r neural networks with Frobenius norm bounds MF (1), . . . , MF (r) (up to and including r = d),   r d Y r (12) R̂m (Hr ) ≤ O B MF (j) m j=1 Plugging this into Thm. 5, and using Lemma 3, it is straightforward to derive the following corollary (see Sec. 7 for a formal derivation): Corollary 1. Let H be the class of depth-d neural networks, where each parameter matrix Wj satisfies kWj kF ≤ MF (j), and with 1-Lipschitz, positive-homogeneous, element-wise activation functions. Assuming the loss function ℓ and H satisfy the conditions of Thm. 5 (with the sets Wj being unconstrained), it holds that r      Qd   3/4 B r Qd     log (m) log Γ j=1 MF (j)  B j=1 MF (j) d  . , · min R̂m (ℓ ◦ H) ≤ O     γ m m1/4     Ignoring logarithmic factors and replacing the min by its first argument, the bound in the corollary is at most ! Q B dj=1 MF (j) Õ . γm1/4 The bound is completely independent of either the width or the depth of the networks. In other words, it is possible to make this Qd bound smaller than any fixed ǫ, with a sample size m independent of the network’s size, as long as B j=1 MF (j) is bounded. On the other hand, the bound in Corollary 1 is also bounded by Γ O B Qd √ ! d j=1 MF (j) √ γ m , which is the bound one would get from an immediate application of Thm. 1, and implies that the asymptotic rate (as a function of m) is still maintained. Next, we apply Thm. 5 to the results in Bartlett et al. [2017], which as discussed in the introduction, provide a depth-dependent bound using a different set of norms. Specifically, they obtain the following intermediary result in deriving their generalization bound: 12 Theorem 6 (Bartlett et al. [2017]). Let H be the hypothesis class of depth-d, width-h real-valued networks on X = {x : kxk ≤ B}, using 1-Lipschitz activation functions, given by ) ( kWjT k2,1 ≤ L(j) , H = NW d : ∀j ∈ {1, . . . , d}, kWj k ≤ M (j), 1 kWj k for some fixed parameters {L(j), M (j)}dj=1 . Then the Rademacher complexity R̂m (H) is upper-bounded by   3/2  Qd d  B log(h) log(m) j=1 M (j) X  √ L(j)2/3   . R̂m (H) ≤ O  · m j=1 p As discussed in the introduction, L(j) can never be smaller than 1, hence the bound scales at least as d3 /m. However, using the bound above together with Thm. 5 and Lemma 3, we can get the following corollary (where for simplicity, we assume that L(j) for all j are uniformly bounded by some L): Corollary 2. Let H be the class of depth-d, width-h networks with 1-Lipschitz, positive-homogeneous, element-wise activation functions. Assuming the loss function ℓ and H satisfy the conditions of Thm. 5 (with   kWjT k2,1 Wj = Wj : kWj k ≤ L for all j), it holds that the Rademacher complexity R̂m (ℓ ◦ H) is at most   BL log(h) log(m) O γ    21   Q  13 d 1+ 2 p   3/2 B 3 +p  M (j) log log (m) 3/2 p j=1 Γ d  j=1 M (j) · min ,√  . 1  m   m 2+3p Qd As before, by replacing the min by its first argument, we get a bound which is fully independent of the network size, assuming the norms are suitably bounded. To give a concrete example, if we take p = 2 (so that the Mp (j) constraints correspond to the Frobenius norm), and ignore lower-order logarithmic factors, we get a bound scaling as  v   Q  u   r Qd d   3/2 B u 4 log 3   BL j=1 M (j) t j=1 Mp (j) Γ d .  · min R̂m (ℓ ◦ H) ≤ Õ  ,   γ m m1/2     In contrast, a direct application of Thm. 6 in the same setting leads to a bound of r ! Q BL dj=1 M (j) d3 R̂m (ℓ ◦ H) ≤ Õ . · γ m Finally, we note that since the Eq. (3), based on a PAC-Bayes analysis, is always weaker than Eq. (2) (as noted in Bartlett et al. [2017]), Corollary 2 also gives a size-independent version of Eq. (3). 5 A Lower Bound for Schatten Norms In this section, we present a lower bound on the Rademacher complexity, for the class of neural networks with parameter matrices of bounded Schatten norms. The formal result is the following: 13 Theorem 7. Let H be the class of depth-d, width-h neural networks, where each parameter matrix Wj satisfies kWj kp ≤ Mp (j) for some Schatten p-norm k · kp (and where we use the convention that p = ∞ refers to the spectral norm). Then there exists a choice of γ1 -Lipschitz loss ℓ and data points x1 , . . . , xm ∈ X , with respect to which  n o Qd max 0, 21 − p1  B j=1 Mp (j) · h  √ R̂m (ℓ ◦ H) ≥ Ω  . γ m This theorem strengthens Theorem 3.6 in Bartlett et al. [2017], which only considered the case p = ∞, and did not have a dependence on h (on the other hand, they consider bounds which hold for any choice of x1 , . . . , xm , while we consider bounds uniform over x1 , . . . , xm for simplicity). Furthermore, it has the following implications: • Like Bartlett et al. [2017], the theorem implies that by controlling just the norms of each parameter matrix, a dependence on the product of the norms is generally inevitable. • For p = ∞, we see that there is an inevitable h1/2 factor in the bound, which implies that controlling the spectral norm is insufficient to get size-independent bounds (at least, independent of the width h). More generally, any Schatten p-norm control with p > 2 will be insufficient to get such size independence. • For p = 2 (i.e. Frobenius norm bounds MF (1), . . . , MF (d)), the lower bound becomes size-independent, Q B d MF (j) j=1 √ . This matches our upper bound in Corollary 1 up to logarithmic facand on the order of m tors, except for the worse polynomial dependence on m. 6 Additional Remarks 6.1 Post-hoc Guarantees So far we have proved upper bounds on the empirical Rademacher complexity of a fixed class of neural networks, of the form HL = {h : compl(h) ≤ L}, for some complexity measure compl and a parameter L. These imply high-probability learning guarantees for algorithms which return predictors in HL . However, in the context of norm-based constraints, practical algorithms for neural networks usually perform unconstrained optimization, and therefore are not guaranteed a-priori to return a predictor in some fixed HL . Fortunately, it is straightforward to convert these bounds into probabilistic guarantees for any neural network h, with the bound scaling appropriately with the complexity compl(h) of the particular network. We note that such post-hoc guarantees have also been stated in the context of some previous sample complexity bounds for neural networks (e.g., Bartlett et al. [2017], Neyshabur et al. [2017]). It is achieved, for instance, by a union bound over, say, a doubling scale of the complexity. We refer to the proof of the margin bound of Koltchinskii and Panchenko [2002, Theorem 2] for an example of this technique. 14 6.2 Complexity of Lipschitz Networks In proving the results of Sec. 4, the key element has been the observation that under appropriate norm constraints, a neural network must have a layer with parameter matrix close to being rank-1, and therefore the network can be viewed as a composition of a shallower network and a univariate Lipschitz function. In fact, this can be generalized: Whenever we have a network with parameter matrix close to being rank-k, we can view it as a composition of a shallow network and a Lipschitz function on Rk . Although we do not develop this idea further in this paper, this observation might be useful in analyzing other types of neural network classes. Taking this to the extreme, we can also bound the complexity of neural networks computing Lipschitz functions, by studying the complexity of all Lipschitz functions over the domain X . It is easily verified that in our setting, if we consider the class H of depth-d networks, where each parameter matrix has spectral Q norm at most M (j), then the network must be dj=1 M (j)-Lipschitz. Using well-known estimates of the covering numbers of Lipschitz functions over X , we get that ! Q B dj=1 M (j) · , R̂m (ℓ ◦ H) ≤ O γm1/dim(X ) where the loss ℓ is assumed γ1 -Lipschitz, and where dim(X ) is the dimensionality of X . Of course, the bound has a very bad dependence on the input dimension (or equivalently, the width of the first layer in the network), but on the other hand, has no dependence on the network depth, nor on any matrix norm other than the spectral norm. Again, as discussed in the previous subsection, it is also possible to use this bound to get post-hoc guarantees, without constraining the Lipschitz parameter of the learned network in advance. 7 Proofs 7.1 Proofs of Lemma 2 and Thm. 2 We first prove Lemma 2. Letting wj denote the j-th row of a matrix W , we have ! ! m m X X ⊤ sup g ǫi σ(W f (xi )) = sup max g ǫi σ(wk f (xi )) f ∈F ,W :kW k1,∞ ≤R i=1 f ∈F ,W :kwj k1 ≤R ∞ = sup g f ∈F ,kwk1 ≤R k m X i=1 ǫi σ(w⊤ f (xi )) i=1 ! . Since g(|z|) ≤ g(z) + g(−z), the left-hand side of Eq. (11) is upper bounded by ! ! m m X X ǫi σ(w⊤ f (xi )) ǫi σ(w⊤ f (xi )) + Eǫ sup g − Eǫ sup g f ∈F ,kwk1 ≤R f ∈F ,kwk1 ≤R i=1 i=1 and the proof is concluded exactly as in Lemma 1 by appealing to Ledoux and Talagrand [1991]. We now turn to Thm. 2, whose proof is rather similar to that of Thm. 1. Fixing λ > 0 to be chosen later, 15 the Rademacher complexity can be upper bounded as mR̂m (Hd ) = Eǫ m X sup N ,Wd W d−1 1 ǫi Wd σd−1 (NW d−1 (xi )) 1 i=1 m X 1 ǫi Wd σd−1 (NW d−1 (xi )) log Eǫ sup exp λ 1 λ i=1 ( m X 1 ≤ log Eǫ sup exp MF (d) · λ ǫi σd−1 (NW d−1 (xi )) 1 λ ≤ i=1 ∞ ) Applying the same argument as in the proof of Thm. 1, and using Lemma 2, we can upper bound the above by !! m X 1 mR̂m (Hd ) ≤ log 2d · Eǫ exp M λ , (13) ǫi xi λ i=1 ∞ Qd where M = j=1 M (j). Letting xi,j denote the j-th coordinate of xi , and using symmetry, the expectation inside the log can be re-written as ! ! m n m X X X ǫi xi,j Eǫ exp M λ · ≤ ǫi xi,j Eǫ exp M λ · max j ≤ n X Eǫ exp M λ j=1 = 2 n X j=1 i=1 ǫi xi,j m X ǫi xi,j i=1 j=1 = 2 m X i=1 Eǫ exp M λ m n Y X i=1 j=1 i=1 " ! ! + exp −M λ = 2 n Y m X m X ǫi xi,j i=1 !# Eǫ exp (M λǫi xi,j ) j=1 i=1 n m j=1 i=1 X X exp (M λxi,j ) + exp (−M λxi,j ) x2i,j exp M 2 λ2 ≤ 2 2 ! , ≤ exp(z 2 /2). Further upper bounding this by where in the  last step we used  the fact that exp(z)+exp(−z) 2 P 2n maxj exp M 2 λ2 di=1 x2i,j and plugging back to Eq. (13), we get m X 1 x2i,j log 2d+1 n · max exp M 2 λ2 j λ i=1 Choosing λ = r d+1+log(n) P 2 , M 2 maxj m i=1 xi,j !! m X d + 1 + log(n) = x2i,j . + M 2 λ max j λ i=1 we can upper bound the above by v u m X u t x2i,j , 2M (d + 1 + log(n)) max j from which the result follows. 16 i=1 7.2 Proof of Thm. 3 The proof will build on the following few technical lemmas. Lemma 4. For any matrix W , and any Schatten p-norm k · kp such that p < ∞, there exists a rank-1 matrix W̃ of the same size such that kW̃ k ≤ kW k , kW̃ kp ≤ kW kp , kW − W̃ k ≤ kW kpp − kW kp 1/p . Proof. Let U SV ⊤ denote the SVD decomposition of W , where S = diag(s1 , s2 , . . . , sr ), and choose W̃ = u1 s1 v1⊤ , where u1 , v1 , s1 are top singular vectors and values of W . The first two inequalities in the lemma are easy to verify. As to the third inequality, using the unitarial invariance of the spectral norm, we have  1/p 1/p  r r X X spj  spj − sp1  , kW −W̃ k = kU SV ⊤ −u1 s1 v1⊤ k = kU diag(0, s2 , . . . , sr )V ⊤ k = s2 ≤  =  j=2 1/p which equals (kW kpp − kW kp ) j=1 . Lemma 5. Given network parameters W1d = {W1 , . . . , Wd }, let W̃1d = {W1 , . . . , Wr−1 , W̃r , Wr+1 , . . . , Wd } be the same parameters, where the parameter matrix Wr of the r-th layer (for some fixed r ∈ {1, . . . , d}) is changed to some other matrix W̃r . Then   d Y kWr − W̃r k . kWj k sup kNW d (x) − NW̃ d (x)k ≤ B  1 1 kWr k x∈X j=1 Proof. By a simple calculation, we have that the Lipschitz constant of the function NWbr is at most Assume for now that 2 ≤ r ≤ d − 1. By definition, we have Qr j=b kWj k. NW d (x) = NW d (σr (Wr σr−1 (NW r−1 (x)))) r+1 1 1 and NW̃ d (x) = NW d (σr (W̃r σr−1 (NW r−1 (x)))) . r+1 1 1 Qd r (x) is at most The Lipschitz constant of the function NW d is at most j=r+1 kWj k, and the norm of NW 1 r+1 17 kxk Qr j=1 kWj k. Therefore, for any x ∈ X , kNW d (x) − NW̃ d (x)k = kNW d (σr (Wr σr−1 (NW r−1 (x)))) − NW d (σr (W̃r σr−1 (NW r−1 (x)))) k 1 r+1 1 1 1   r+1 d Y kWj k · kσr (Wr σr−1 (NW r−1 (x))) − σr (W̃r σr−1 (NW r−1 (x)))k ≤  1 1 j=r+1  ≤  d Y j=r+1  ≤  d Y j=r+1  ≤  d Y j=r+1  kWj k · kWr σr−1 (NW r−1 (x)) − W̃r σr−1 (NW r−1 (x)))k 1 1  kWj k · kWr − W̃r k · kσr−1 (NW r−1 (x)k 1   kWj k · kWr − W̃r k ·  r−1 Y j=1  kWj k · kxk, from which the result follows after a simplification. The cases r = 1 and r = d are handled in exactly the same manner. Q Q Lemma 6. Suppose that NW d is such that dj=1 kWj k ≥ Γ and dj=1 kWj kp ≤ M . Then for any r ∈ 1 {1, . . . , d},  1/r kWj kp M ≤ . min Γ j∈{1,...,r} kWj k Proof. Fixing some r, and using the stated assumptions as well as the fact that kW kp ≥ kW k for any p, we have Qd   d r Y Y kWj kp kWj kp kWj kp r M j=1 kWj kp = ≥ Qd ≥ ≥ min . Γ kWj k kWj k j∈{1,...,r} kWj k j=1 kWj k j=1 j=1 Taking the r-th root from both sides, the result follows. With these lemmas in hand, we can now turn to prove Thm. 3. Combining Lemma 4 and Lemma 5, we have that there indeed exists a network NW̃ d with a rank-1 matrix in layer r, such that 1   d 1/p Y (kWr kpp − kWr kp ) sup kNW d (x) − NW̃ d (x)k ≤ B  kWj k · 1 1 kWr k x∈X j=1    1/p d Y kWr kpp   kWj k −1 . (14) = B kWr kp j=1 By the definition of NW d , we have that kNW d (x)k ≤ kxk 1 1 Qd j=1 kWj k. Since Q that dj=1 kWj k ≥ we assume there exists x (of norm at most B) such that kNW d (x)k ≥ Γ, it follows Γ/B. Using this and the 1 Qd assumption that j=1 kWj kp ≤ M , and plugging into Lemma 6, it follows that for any r ∈ {1, . . . , d}, kWj kp ≤ min j∈{1,...,r} kWj k 18  MB Γ 1/r . Substituting into Eq. (14), we get that  sup kNW d (x) − NW̃ d (x)k ≤ B  x∈X 1 1  = B d Y j=1 d Y j=1  kWj k    MB Γ kWj k exp  p/r !1/p −1 p log(M B/Γ) r  1/p . −1 Suppose for now that r is such that r ≥ p log(M B/Γ). Using the fact that exp(z) ≤ 1 + 2z for any z ∈ [0, 1], it follows that the above is at most   1/p  d Y 2p log(M B/Γ) . kWj k B r j=1 It remains to consider the case where r < p log(M B/Γ). However, in this regime the theorem trivially holds: Let W̃r in the network NW̃ r be the all-zeros matrix (which is rank zero and ensures that NW̃ r (x) = 0 1 1 for all x), and we have by definition that     d d Y Y 2p log(M B/Γ) 1/p   kWj k kWj k < B sup kNW d (x)−NW̃ d (x)k = sup kNW d (x)k ≤ B . 1 1 1 r x∈X x:kxk≤B j=1 j=1 7.3 Proof of Thm. 4 To prove the theorem, we use a straightforward covering number argument, beginning with a few definitions. Given any function class F, a metric d on the elements of F, and ǫ > 0, we let the covering number N (F, d, ǫ) denote the minimal number n of functions f1 , f2 , . . . , fn in F, such that for all f ∈ F, mini=1,...,n d(fi , f ) ≤ ǫ. In particular, fix some set of data points x1 , . . . , xm , and define the empirical L2 distance v u m u1 X ′ ˆ (f (xi ) − f ′ (xi ))2 . dm (f, f ) = t m i=1 Also, given a function class F and x1 , . . . , xm , we let " Ĝm (F) := Eη # m 1 X ηi f (xi ) sup f ∈F m i=1 denote the (empirical) Gaussian complexity of F, where η1 , . . . , ηn arep i.i.d. standard Gaussian random variables. It is well known that R̂m (H) and Ĝm (H) are equivalent up to a c log(m) factor [Ledoux and Talagrand, 1991, pg. 97]. By Sudakov’s minoration theorem (see theorem 3.18 in Ledoux and Talagrand [1991]), we have that for all α > 0 !2 √ m · Ĝ (H) m (15) log(N (H, dˆm , α)) ≤ c α for a universal constant c > 0. 19 With these definitions in hand, we turn to prove the theorem. We first note that FL ◦ H is equivalent to the class {Lg(·) + a : g ∈ F1,0 ◦ H}, and therefore " # # " m m 1 X 1 X sup ǫi g(xi ) = Eǫ ǫi (Lg(xi ) + a) sup R̂m (FL,a ◦ H) = Eǫ g∈F1,0 ◦H m i=1 g∈FL,a ◦H m i=1 " # ! m m 1 X a X = Eǫ L · sup ǫi g(xi ) + ǫi m g∈F1,0 ◦H m i=1 i=1 " # m 1 X sup = L · Eǫ ǫi g(xi ) = L · R̂m (F1,0 ◦ H). (16) g∈F1,0 ◦H m i=1 Therefore, it is enough to consider R̂m (F1,0 ◦ H). To simplify notation in what follows, we will drop the 1, 0 subscript from F. We first argue that   R log(N (F, dˆm , ǫ)) ≤ c′ 1 + , (17) ǫ again for some numerical constant c′ > 0. To prove this, we note that for any functions f, f ′ , it holds that dˆm (f, f ′ ) ≥ dˆ∞ (f, f ′ ) := supx |f (x) − f ′ (x′ )|, so it is enough to upper bound N (H, dˆ∞ , ǫ). To do so, we first notice that the range of any f ∈ F is in [−R, R]. Discretize [−R, R] × [−R, R] into a two-dimensional grid Ux × Uy , where Ux := {−R, −R + ǫ, −R + 2ǫ, . . . , −R + ⌊2R/ǫ⌋ ǫ, R} , Uy := {0, ±ǫ, ±2ǫ, . . . , ±⌊R/ǫ⌋ǫ, ±R}. Given any f ∈ F, construct the piecewise-linear function f ′ as follows: For any input x ∈ Ux , let f ′ (x) be the point in Uy nearest to f (x) (breaking ties arbitrarily), and let the rest of f ′ be constructed as a linear interpolation of these points on Ux . It is easily verified that supx∈[−R,R] |f (x) − f ′ (x)| ≤ ǫ. Moreover, note that for two neighboring points x, x′ in Ux , the points f ′ (x), f ′ (x′ ) on Uy must be neighboring or the same. Therefore, each such function f ′ can be parameterized by a vector of the form {−, 0, +}|Ux |−1 , which specifies whether (starting from the origin) f ′ goes up, down, or remains the same on each of its linear segments. The number of such functions is at most 3|Ux |−1 ≤ 32R/ǫ+1 , and therefore N (F, dˆ∞ , ǫ) ≤ 32R/ǫ+1 . Recalling that dˆm (f, f ′ ) majorizes dˆ∞ (f, f ′ ), we get Eq. (17). Next, we argue that   ǫ ǫ N (F ◦ H, dˆm , ǫ) ≤ N F, dˆm , · N H, dˆm , . (18) 2 2 To see this, pick any f ∈ F and h ∈ H, and let f ′ , h′ be the respective closest functions in the cover of F and H (at scale ǫ/2). By the triangle inequality and the easily verified fact that f ′ is 1-Lipschitz, we have dˆm (f h, f ′ h′ ) ≤ dˆm (f h, f ′ h) + dˆm (f ′ h, f ′ h′ ) ≤ dˆ∞ (f h, f ′ h) + dˆm (f ′ h, f ′ h′ ) v u m u1 X ′ (f ′ h(xi ) − f ′ h′ (xi ))2 ≤ sup |f (x) − f (x)| + t m x∈[−R,R] i=1 v u m ǫ u 1 X ≤ +t (h(xi ) − h′ (xi ))2 2 m i=1 ǫ ǫ ǫ = + dˆm (h, h′ ) ≤ + = ǫ . 2 2 2 20 Therefore, we can cover F ◦ H (at scale ǫ) by taking f ′ (h′ (·)) for all possible choices of f ′ , h′ from the covers of F, H (at scale ǫ/2), leading to Eq. (18). Combining Eq. (15),Eq. (17) and Eq. (18), we get that  !2  √ m · Ĝ (H) R m  , log(N (F ◦ H, dˆm , ǫ)) ≤ c′′ 1 + + ǫ ǫ for some numerical constant c′′ > 0. Finally, we use Dudley’s entropy integral, which together with the equation above, implies the following for some numerical constant c > 0 (possibly changing from row to row): ( ) Z supg∈F ◦H dˆm (g,0) q 1 log(N (F ◦ H, dˆm , ǫ))dǫ R̂m (F ◦ H) ≤ c inf α + √ α≥0 m α   Z Rq 1 ≤ c inf α + √ log(N (F ◦ H, dˆm , ǫ))dǫ α≥0 m α   v !2   √ Z Ru   u 1 m · Ĝm (H) t1 + R + ≤ c inf α + √ dǫ α≥0   ǫ ǫ m α   ( ! ) r √ Z R 1 R m · Ĝm (H) ≤ c inf α + √ 1+ + dǫ α≥0 m α ǫ ǫ ) ( r ! Z R Z R 1 R 1 dǫ + Ĝm (H) 1+ dǫ ≤ c inf α + √ α≥0 m 0 ǫ α ǫ    R R ≤ c inf α + √ + Ĝm (H) log . α≥0 α m √ Choosing in particular α = R/ m, we get the upper bound   R R̂m (F ◦ H) ≤ c √ + log(m) · Ĝm (H) m p for some c > 0. Plugging this into Eq. (16), and upper bounding Ĝm (H) by c log(m)R̂m (H) (see [Ledoux and Talagrand, 1991]), the result follows. 7.4 Proof of Thm. 5 It is enough to prove the bound for any fixed r ∈ {1, . . . , d}, and then take the infimum over any such r. Given H and r, construct a new hypothesis class H̃ by replacing each network h ∈ H by the network h̃ as defined in Thm. 3 (namely, where the parameter matrix in the r-th layer is replaced by a rank-1 matrix). We will use the notation h̃h to clarify the dependence of h̃ on h. According to that theorem, as well as the 21 definition of Rademacher complexity, we have # " m 1 X ǫi ℓ(h(xi )) R̂m (ℓ ◦ H) = Eǫ sup h∈H m i=1 " !# m m  1 X 1 X  = Eǫ sup ǫi ℓ(h̃h (xi )) + ǫi ℓ(h(xi )) − ℓ(h̃h (xi )) m h∈H m i=1 i=1 " !# m X 1 ≤ Eǫ sup ǫi ℓ(h̃h (xi )) + sup |ℓ(h(x)) − ℓ(h̃h (x))| x∈X h∈H m i=1 " !# m 1 X 1 ≤ Eǫ sup ǫi ℓ(h̃(xi )) + · sup |h(x) − h̃h (x)| γ x∈X h̃∈H̃ m i=1  1/p  Q Q  d d B M (j) 2p log B M (j) p j=1 j=1 Γ   . ≤ R̂m (ℓ ◦ H̃) + γ r (19) We now reach the crucial observation which lies at the heart of the proof. Consider any network NW̃ d in 1 H̃, and let suv⊤ be the SVD decomposition of its (rank-1) parameter matrix W̃r in layer r (where s, u, v are also leading singular value and vectors of Wr , by construction). By definition, we have that the composition of NW̃ d with any loss ℓj equals 1 x 7→ ℓj (Wd σd−1 (Wd−1 σd−2 (. . . σr (suv⊤ σr−1 (. . . σ1 (W1 x)))). This function is equivalent to the composition of the function x 7→ sv⊤ σr−1 (. . . σ1 (W1 x)) with the univariate function x 7→ ℓj (Wd σd−1 (Wd−1 σd−2 (. . . σr (ux)))) . Note that since ksv⊤ k = s = kWr k and ksv⊤ kp = s ≤ kWr kp , the former function is contained in Q Hr as defined in the theorem; whereas the latter function has Lipschitz constant at most γ1 dj=r+1 kWj k ≤ 1 Qd j=r+1 M (j), and maps the input 0 to the same fixed output (which we’ll denote as a) for all j. Therefore, γ we obtain Qr that ℓ ◦ H̃ is contained in the composition of Hr (with Qdfunctions whose output is bounded in Q ±B j=1 M (j)), and the class F 1 d j=r+1 M (j)-Lipschitz functions. As a M (j),a consisting of γ j=r+1 result, we can apply Thm. 4 and obtain that   Q R̂m (ℓ ◦ Ĥ) ≤ R̂m Hr ◦ F 1 d j=r+1 M (j),a γ    d r Y B c Y M (j)  √ M (j) + log3/2 (m) · R̂m (Hr ) ≤ γ m j=r+1 j=1   ! d 3/2 c Y B log (m) · R̂ (H ) m r Qr . = M (j) √ + γ m j=1 M (j) j=1 22 Plugging this back into Eq. (19) and simplifying a bit (also noting that p1/p can be upper bounded by a universal constant), we get that R̂m (ℓ ◦ H) is upper bounded by    Q  1/p  Q d B d log Γ j=1 Mp (j) c′ B j=1 M (j)  log3/2 (m) · R̂m (Hr )  + √1  Qr +   γ B j=1 M (j) r m for an appropriate constant c′ . As mentioned at the beginning of the proof, this upper bound holds for any fixed r ∈ {1, . . . , d}, from which the result follows. 7.5 Proof of Lemma 3 We will show that for any α, β, b, c, n as stated in the lemma, there always exists a choice of r ∈ {1, . . . , d} such that α  α  cr b dα b α+β . min + β , ≤ 3· β n r n (n/c) α+β α Since the left hand side is also trivially at most dn , the result follows. We prove this inequality by a case analysis: k j 1 1 • If (bn/c) α+β ∈ [1, d], pick r = (bn/c) α+β ∈ {1, 2, . . . , d}, in which case α  1 α α α α+β α c (bn/c) cr (b) α+β b α+β b α+β b b β +2 ≤ 3 . + β ≤ + β = β β β 1 n r n 1 α+β α+β α+β α+β (n/c) (n/c) (n/c) (bn/c) 2 1 • If (bn/c) α+β > d, it follows that α α  α  cr b dα (bn/c) α+β b α+β dα . min + β , < c = ≤ β n r n n n (n/c) α+β 7.6 Proof of Corollary 1 A direct application of Thm. 1, as well as the fact that the loss ℓ is 1/γ Lipschitz, implies that r ! Q B dj=1 MF (j) d . R̂m (ℓ ◦ H) ≤ O γ m (20) On the other hand, plugging Eq. (12) into Thm. 1, (using p = 2, letting each Wj be the space of all matrices, kWj k kW k and choosing M (j) = MF (j) for all j, noting that M (j) ≤ MFj(j)F ≤ 1), we get that     v  Q  u   Qd d   u B √  log3/2 (m) r t log Γ j=1 MF (j)   B j=1 MF (j)   .  min √ + R̂m (ℓ ◦ H) ≤ O   r∈{1,...,d}    γ m r     (21) Upper bounding R̂m (ℓ ◦ H) by the minimum of Eq. (20) and Eq. (21), and using Lemma 3 with α = β = 21 , r   Qd √ M (j) , c = log3/2 (m), and n = m, the result follows. b = log B F j=1 Γ 23 7.7 Proof of Corollary 2 Consider the class Hr =        NW1r maps to R NW1r : kW T k2,1     j ≤L ∀j ∈ {1 . . . r − 1}, kW . jk n o   kWj k kWj kp  ∀j ∈ {1 . . . r}, max M (j) , Mp (j) ≤ 1 Since NW1r in the definition of Hr maps to R, Wr is a vector, meaning that kWrT k2,1 = kWr k2 = kWr k. Therefore, we can use Thm. 6 to bound R̂m (Hr ); in particular, for r ≥ 1, ! Q B log(h) log(m)L rj=1 M (j)r 3/2 √ · . R̂m (Hr ) ≤ O m It therefore follows from Thm. 5 that R̂m (ℓ ◦ H) is at most O BL log(h) log(m) γ where c = log3/2 (m), n = Qd j=1 M (j) · min r∈{1,...,d} ( b cr 3/2 + 1/p n r )! ,  Q 1/p √ d m, and b = log B M (j) . p j=1 Γ On the other hand, a direct application of Thm. 6 also implies that R̂m (ℓ ◦ H) is at most ! Q B dj=1 M (j) log(h) log(m)Ld3/2 √ . · O γ m Combining the above two bounds, and applying Lemma 3, we get that R̂m (ℓ ◦ H) is at most   BL log(h) log(m) O γ 7.8 Proof of Thm. 7    21   Q  13 d 1+ 2 p   3/2 B 3 +p  M (j) log log (m) 3/2 p j=1 Γ d  j=1 M (j) · min ,√  . 1  m   m 2+3p Qd By definition of the Rademacher complexity, it is enough to lower bound the complexity of ℓ ◦ H′ where H′ is some subset of H. In particular, consider the class H′ of neural networks over Rh of the form x 7→ Mp (d) · Mp (d − 1) · · · Mp (2) · W x, where W = diag(kwk) is a diagonal matrix satisfying kwkp ≤ Mp (1) (here, k · kp refers to the vector p-norm). Furthermore, suppose that ℓ(z) = γ1 max{z1 , . . . , zh }. Finally, we will choose x1 , . . . , xm in Rh as xi = Be(i mod h) for all i, where et is the t-th standard basis vector.. Letting Ak = {i ∈ {1, . . . , m} : 24 i mod h = k}, it holds that   d m Y X 1 R̂m (ℓ ◦ H′ ) = Eǫ sup Mp (j)W xi  ǫi ℓ  m W :kW kp ≤Mp (1) j=2 i=1 = = B B Qd j=2 Mp (j) Qd γm j=1 Mp (j) γm In particular, by choosing wk = h−1/p · sign B Qd j=1 Mp (j) γm · h1/p · Eǫ · Eǫ P sup w:kwkp ≤Mp (1) k=1 h X sup w:kwkp ≤1 k=1 max{0, wk } · max{0, wk } · X X ǫi i∈Ak ǫi . i∈Ak  for all k, we can lower bound the above by ǫ i i∈Ak    h  X  X · Eǫ  ǫi  = Ω max 0,   k=1 h X i∈Ak B Qd j=1 Mp (j) γm · h1/p · h p X k=1 ! |Ak | and since |Ak | ≥ ⌊m/h⌋ by its definition, we get a lower bound of  Q  1 Q r ! − p1 d 2 B M (j) · h B dj=1 Mp (j) p m j=1  . √ ·h = Ω Ω 1/p h γ m γm · h , (22) An alternative bound (which is better when p < 2) can be obtained by considering the class H′ of real-valued neural networks over R, of the form x 7→ Mp (d) · Mp (d − 1) · · · Mp (2) · wx, where |w| ≤ Mp (1). Furthermore, supposing that ℓ is the identity function times γ1 , and xi = B for all i, it holds that m d 1 X Y Mp (j)Bw ǫi w:|w|≤Mp(1) γm i=1 j=2 ! Q Q m X B dj=1 Mp (j) B dj=1 Mp (j) √ ǫi = Ω · Eǫ = . γm m R̂m (ℓ ◦ H′ ) = Eǫ sup i=1 Taking the best of this lower bound and the lower bound in Eq. (22), the result follows. References Martin Anthony and Peter L Bartlett. Neural network learning: Theoretical foundations. cambridge university press, 2009. Peter Bartlett, Dylan J Foster, and Matus Telgarsky. Spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1706.08498, 2017. 25 Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. Journal of Machine Learning Research, 3(Nov):463–482, 2002. Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration inequalities: A nonasymptotic theory of independence. Oxford university press, 2013. Vladimir Koltchinskii and Dmitry Panchenko. Empirical margin distributions and bounding the generalization error of combined classifiers. Annals of Statistics, pages 1–50, 2002. Michel Ledoux and Michel Talagrand. Probability in Banach Spaces. Springer, 1991. Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014. Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. Norm-based capacity control in neural networks. In Conference on Learning Theory, pages 1376–1401, 2015. Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. A pac-bayesian approach to spectrally-normalized margin bounds for neural networks. arXiv preprint arXiv:1707.09564, 2017. Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014. Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. 26
9cs.NE
RoboCupSimData: A RoboCup soccer research dataset Olivia Michael1 , Oliver Obst∗1 , Falk Schmidsberger2 , Frieder Stolzenburg2 1 arXiv:1711.01703v1 [cs.AI] 6 Nov 2017 2 : Western Sydney University, Centre for Research in Mathematics : Harz University of Applied Sciences, Automation and Computer Sciences Department ∗ : Corresponding author: [email protected] Abstract RoboCup is an international scientific robot competition in which teams of multiple robots compete against each other. Its different leagues provide many sources of robotics data, that can be used for further analysis and application of machine learning. This paper describes a large dataset from games of some of the top teams (from 2016 and 2017) in RoboCup Soccer Simulation League (2D), where teams of 11 robots (agents) compete against each other. Overall, we used 10 different teams to play each other, resulting in 45 unique pairings. For each pairing, we ran 25 matches (of 10 mins), leading to 1125 matches or more than 180 hours of game play. The generated CSV files are 17 GB of data (zipped), or 229 GB (unzipped). The dataset is unique in the sense that it contains both the ground truth data (global, complete, noise-free information of all objects on the field), as well as the noisy, local and incomplete percepts of each robot. These data are made available as CSV files, as well as in the original soccer simulator formats. lator as an input, and, asynchronously to sensor input, also decides on a next action that is sent back to the simulator, several times a second. This complexity of the environment, with continuous state and action spaces, together with the opportunity to compete against each other, makes RoboCup soccer an interesting testbed for multi-robot learning among many other applications. 1 Introduction RoboCup is an international scientific robot competition in which teams of multiple robots compete against each other. The RoboCup soccer leagues provide platforms for a number of challenges in robotics research, including locomotion, vision, real-time decision making, dealing with partial information, multi-robot coordination and teamwork. In RoboCup, several different leagues exist to emphasize specific research problems by using different kinds of robots and rules. There are different soccer leagues in the RoboCup with different types and sizes of hardware and software: small size, middle size, standard platform league, humanoid, 2D and 3D simulation (Kitano et al., 1997). In the soccer simulation leagues (Akiyama et al., 2015), the emphasis is on multi-robot team work with partial and noisy information, in real-time. Each of the robots is controlled by a separate program that receives sensor information from the simu- To assist automated learning of team behavior, we provide a large dataset generated using 10 of the top participants in RoboCup 2016 or 2017. While it is possible to use the simulator for robot learning, we also generate additional data that is not normally available from playing other teams directly: We modified the simulator to record data from each robots local perspective, that is, with the restricted views that depend on each robots situation and actions, and also include the sensor noise. In addition, for every step of the game (100 ms), we recorded ground truth information (such as positions and velocities) of 1 receives additional status information, including energy levels, referee decisions, and the state of the game, every 100 ms. Each robot can issue parameterized actions every 100 ms, to control its locomotion, the direction of its view, and its field of view. A more detailed description of the information transmitted can be found in the simulator manual (Chen et al., 2003). all objects on the soccer field, as well as basic actions of each robot. This ground truth information is usually recorded in a logfile, but not available to teams during a match. To create our dataset, we ran all pairings of the selected teams with 25 repetitions of each game, that is, 1125 games in total. With 11 robots in each team, a single game dataset consists of 22 local views plus a global (ground-truth) view. These views are made available as CSV files (comma-separated values). We also provide the original logfiles that include additional sensors, actions of each robot recorded as text files, and the software we created to patch the simulator and to convert recordings into CSV. The provided data are useful for various different tasks including imitation learning (e.g., Ben Amor et al., 2013), learning or testing of self-localization (e.g., Olson, 2000), predictive modeling of behavior, transfer learning and reinforcement learning (e.g., Taylor and Stone, 2009), and representation learning for time series data (Michael et al., 2018). The next sections describe the environment, robots, and data in more detail. 3 Overview on the provided data In robotics, data collections often comprise lidar data recorded by laser scans. This is very useful in many applications, e.g., field robotics, simultaneous localization and mapping (SLAM) (Tong et al., 2013), or specific purposes such as agriculture (Chebrolu et al., 2017). However, in many contexts, there is not only one but several robots which may be observed. The data from RoboCup that we consider here includes information about other robots in the environment and hence about the whole multi-robot system. Data from multi-agent systems like the RoboCup or the multi-player real-time strategy video game StarCraft (Lin et al., 2017) provide information on (simulated) environments as in robotics. However, in addition, they contain data on other agents and thus lay the basis for machine learning research to analyze and predict agent behavior and strategies, which is important in applications such as service robotics and multi-robot systems in general. To provide a diverse dataset, we include several teams from the last two RoboCup competitions, allowing for different behaviors and strategies. Perception and behavior of each robot during a game depends on the behavior of all other robots on the field. Game logfiles, that is, files containing ground truth information obtained from recording games, can be produced from the simulator, and are recorded in a binary format. Access to individual player percepts, however, is only possible from within the player code. To learn from behavior of other teams, it is useful to use the exact information that individual players receive, rather than the global (and noisefree) information in recorded logfiles. We therefore modified the simulator to additionally also record all local and noisy information as received by the robots on the field, in individual files for 2 Description of the environment The RoboCup Soccer Simulation Server rcssserver (Noda et al., 1998) is the software used for the annual RoboCup competitions that have been held since 1997. It is hosted at github.com/rcsoccersim/. We used the rcssserver version 15.3.0 to create the data for this paper. The simulator implements the (2D) physics and rules of the game, and also handles the interface to the programs controlling each player. By default, players use a 90 degree field of view, and receive visual information every 150 ms. Throughout the game, this frequency can actively be changed by each player individually to 75 ms, 150 ms, or 300 ms, by changing the field of view to 45 degrees, 90 degrees, or 180 degrees, respectively. Visual information is transmitted in the form of (Lisp-like) lists of identified objects, with the level of detail of information depending on object distances. Potential objects include all other players on the field, the ball, and landmarks like goal posts, flags, and side lines. Each player also 2 2016 CSU Yunlu Gliders HELIOS Ri-one 2017 CYRUS Fra-UNIted HELIOS HfutEngine MT Oxsy tion of the robot players, the pitch is filled with several landmark objects as depicted in Fig. 2: flags (f), which are punctual objects, lines (l), the goal (g), and the penalty area (p). The origin of the coordinate system is the center point (c). The pitch is divided horizontally (x-direction) into a left (l) and right (r) half and vertically (ydirection) into a top (t) and a bottom (b) half. Additional numbers (10, 20, 30, 40, or 50) indiFigure 1: Teams from the RoboCup 2D soc- cate the distance to the origin in meters. Since cer simulation world championships every soccer game takes place on the same pitch, 2016 in Leipzig (Germany) and 2017 there is only one file with infomation about the in Nagoya (Japan) selected for the landmarks for all games that lists all these coordataset. dinates, given as a table in CSV format, with name landmarks.csv. For example, the row each player. This information is stored in the f r t,52.5,34 says that the right top flag of same format as it is sent to players. We also the pitch has the (x, y)-coordinates (52.5, 34). Further table files provide information about provide code to translate these individual logs the respective game. The names of all these into CSV files that contain relative positions and files – all naming conventions are summarized velocities. in Fig. 3 – contain the names of the competing We chose the top-ten teams from the RoboCup teams, the final scores for each team, possibly 2D soccer simulation world championships 2016 extended by the result of a penalty shootout, a in Leipzig (Germany) and 2017 in Nagoya time stamp (when the game was recorded), and (Japan) (see Figure 1). Team binaries includsome further identifier. ing further descriptions can be downloaded from: The central SoccerServer (Chen et al., 2003) archive.robocup.info/Soccer/Simulation/2D. controls every virtual game with built-in physics We played each team against each other team rules. When a game starts, the server may be for 25 times, resulting in about 17 GB of data configured by several parameters which are col(zipped CSV files). For each game, we record the lected in one file with the identifier parameters. original logfiles including message logs. We also For example, the row ball_decay,0.94 denotes generate files with ground truth data as well as that the ball speed decreases by the specified faclocal player data in human-readable format. Fitor (cf. Stolzenburg et al., 2002). However, from nally, we made our generating scripts available, a robotics point of view, most of the information so that they can be used to reproduce our results in this file is not very relevant, like the stamina of or to produce additional datasets using other the robots, the noise model, or the format of the robotic soccer teams. There is also a smaller coach instructions. We thus skip further details subset of 10 games where the top-five teams play here. against each other once (163 MB CSV files plus A soccer simulation game in the RoboCup 2D 217 MB original logfiles). Our data is available at simulation league lasts 10 mins in total, divided bitbucket.org/oliverobst/robocupsimdata/. into 6000 cycles where the length of each cycle is 100 ms. Logfiles comprise information about the game, in particular about the current posi4 Description of the ground truth data tions of all players and the ball including their According to rules of the world soccer association velocity and orientation for each cycle. This inFIFA, a soccer pitch has the size of 105 m×68 m. formation is collected for the whole game in a This is adopted for the RoboCup soccer simula- table with the identifier groundtruth. For each tion league. Nevertheless, the physical boundary time point, the play mode (e.g. kickoff), the curof the area that may be sensed by the robots has rent ball position coordinates and its velocity is an overall size of 120 m × 80 m. For the localiza- listed. Furthermore, the positions and velocities 3 Figure 2: Flags and lines in the robotic soccer simulation (cf. Chen et al., 2003). 1. landmarks: landmarks.csv (static information for all games, 1 file) 2. game data: <time>-<team left>_<score left>-vs-<team right>_<score right>-<id>.csv where <id> = • parameters (server configuration parameters, 1 file) • groundtruth (logfile information for each game, 1 file) • <team name>_<player number>-<suffix> where <suffix> = – landmarks (relative distances and angles to landmarks, 22 files) – moving (relative distances and angles to ball and other players, 22 files) Figure 3: Name conventions for the data files. 4 As described above, the frequency of these messages is dependent on the width of view that the player selects, one message every 150 ms by default. Every 100 ms, players also receive status information, so-called body messages. These individual messages are not recorded in the simulator logfiles. Developers of teams can implement recording of messages that their own agents receive, but in order to record messages sent to any team, the simulator software had to be modified instead. Our code contains patches to the simulator that allow recording of visual and body messages in individual files for each player. The messages are stored in their original format to keep the amount of additional processing during the game minimal. Playing a game with the modified simulator will result in a number of recorded files: of each player of the left (L) and the right (R) team including the goalkeeper (G) is stated. For example, the column with head LG1 vx contains the velocity of the left goalkeeper in x-direction. Finally, information about the robots body and head orientation and their view angle and quality is included. The absolute direction a player is facing (with respect to the pitch coordinate system) is the sum of the body and head direction of that player. 5 Description of local player data The visual sensor of the players reports the objects currently seen. The information is automatically sent to players every sense step with a frequency depending on the player view width and quality; by default it is set to 150 ms. Thus, in addition to the three files mentioned above, 44 more files are available for each game. For each of the altogether 22 robots (ten field players and one goalkeeper per team), two files with local player data is provided, hosting information about where the respective player sees the landmarks and moving objects, respectively. The file with final identifier landmarks provides the distances (in meters) and angles (in degrees) to the respective landmarks relative to the robot head orientation for each step. Analogously, the file with final identifier moving provides the actual relative distances and angles to the ball and all other players. Sometimes the player number or even the team name is not visible and hence unknown (u) to the robot. In this case, the respective piece of information is left out. If data is not available at all, then this is marked by NAN in the respective table element. The server also provides information about the velocity, stamina, (yellow and red) cards, and the commands (e.g. dash, turn, or kick) of the robots. In some cases there is also information about the observed state of other robots available, in particular, whether they are kicking (k), tackling (t), or are a goalkeeper (g). • the visual and body messages (two files for each player). The file names follow the same naming convention as the game data CSV files (cf. Fig. 3), but use the .rcv suffix for visual messages and .rcb for body messages. • a recording of the game (the ground truth in a binary format), using the suffix .rcg • the commands from players as received by the simulator (in plain text), using .rcl as a suffix To convert visual messages into CSV files, we provide a see2csv.py Python program that translates player visual messages into two files: a CSV file for moving objects (other players and the ball), and a CSV file with perceived landmarks. To convert the simulator logfile (ground truth) into a CSV file, we provide rcg2csv, a C++ program that is built using the open source librcsc library (see osdn.net/projects/rctools/releases/p3777). Logfiles are recorded at regular intervals of 100 ms. rcg2csv can optionally also store all simulation parameters in an additional CSV file. 6 Code 7 Conclusions The soccer simulator communicates with players We released a large and unique dataset using text messages in form of lists, via UDP. (RoboCupSimData), creating using a tourna- 5 ment of top RoboCup simulation league teams. 7.07 and Later. The RoboCup Federation. Creating this dataset required modification of URL https://sourceforge.net/projects/ the simulation software. We ran 25 repetitions of sserver/files/rcssmanual/manual-7.08. 45 matches that last 10 mins, each. The dataset 1/manual.pdf. will allow a number of problems to be investigated, from learning and testing approaches to Kitano H, Asada M, Kuniyoshi Y, Noda I, Osawa E and Matsubara H (1997) RoboCup: A self-localization, predictive world-models, reinchallenge problem for AI. AI Magazine 18(1): forcement learning. In this respect, the dataset 73–85. shall be useful for the whole robotics community. Lin Z, Gehring J, Khalidov V and Synnaeve G (2017) STARDATA: A StarCraft AI research Funding dataset. CoRR – Computing Research ReposThe research reported in this paper has itory abs/1708.02139, Cornell University Libeen supported by the German Academic Exbrary. URL http://arxiv.org/abs/1708. change Service (DAAD) by funds of the Ger02139. man Federal Ministry of Education and Research (BMBF) in the Programmes for Project- Michael O, Obst O, Schmidsberger F and Stolzenburg F (2018) Analysing soccer games Related Personal Exchange (PPP) under grant with clustering and conceptors. In: Akyama no. 57319564 and Universities Australia (UA) in H, Obst O, Sammut C and Tonidandel F (eds.) the Australia-Germany Joint Research CooperaRoboCup 2017: Robot Soccer World Cup XXI. tion Scheme within the project Deep Conceptors RoboCup International Symposium. Nagoya, for Temporal Data Mining (Decorating). Japan: Springer. To appear. References Noda I, Matsubara H, Hiraki K and Frank I (1998) Soccer server: A tool for research on Akiyama H, Dorer K and Lau N (2015) On multiagent systems. Applied Artificial Intellithe progress of soccer simulation leagues. In: gence 12(2–3): 233–250. Bianchi RAC, Akin HL, Ramamoorthy S and Sugiura K (eds.) RoboCup 2014: Robot World Olson CF (2000) Probabilistic self-localization for mobile robots. IEEE Transactions on Cup XVIII. RoboCup International SympoRobotics and Automation 16(1): 55–66. sium, Lecture Notes in Computer Science, volume 8992. Springer, pp. 599–610. Stolzenburg F, Obst O and Murray J (2002) Qualitative velocity and ball interception. In: Ben Amor H, Vogt D, Ewerton M, Berger E, Jarke M, Köhler J and Lakemeyer G (eds.) Jung B and Peters J (2013) Learning responKI-2002: Advances in Artificial Intelligence sive robot behavior by imitation. In: Inter– Proceedings of 25th Annual German Connational Conference on Intelligent Robots and ference on Artificial Intelligence, LNAI 2479. Systems (IROS-2013). pp. 3257–3264. Aachen: Springer, pp. 283–298. Chebrolu N, Lottes P, Schaefer A, Winterhalter W, Burgard W and Stachniss C (2017) Taylor ME and Stone P (2009) Transfer learning for reinforcement learning domains: A surAgricultural robot dataset for plant classificavey. Journal of Machine Learning Research tion, localization and mapping on sugar beet 10: 1633–1685. fields. The International Journal of Robotics Research 36(10): 1045–1052. Tong CH, Gingras D, Larose K, Barfoot TD and Dupuis É (2013) The Canadian Chen M, Dorer K, Foroughi E, Heintz F, Huang planetary emulation terrain 3D mapping Z, Kapetanakis S, Kostiadis K, Kummeneje J, dataset. International Journal of Robotics ReMurray J, Noda I, Obst O, Riley P, Steffens search URL http://asrl.utias.utoronto. T, Wang Y and Yin X (2003) RoboCup ca/datasets/3dmap/. Soccer Server — for Soccer Server Version 6
2cs.AI
Local Linearizability∗ Andreas Haas1 , Thomas A. Henzinger2 , Andreas Holzer3 , Christoph M. Kirsch4 , Michael Lippautz1 , Hannes Payer1 , Ali Sezgin5 , Ana Sokolova4 , and Helmut Veith6,7 arXiv:1502.07118v4 [cs.PL] 24 Jun 2016 1 2 3 4 5 6 7 Google Inc. IST Austria, Austria University of Toronto, Canada University of Salzburg, Austria University of Cambridge, UK Vienna University of Technology, Austria Forever in our hearts Abstract The semantics of concurrent data structures is usually given by a sequential specification and a consistency condition. Linearizability is the most popular consistency condition due to its simplicity and general applicability. Nevertheless, for applications that do not require all guarantees offered by linearizability, recent research has focused on improving performance and scalability of concurrent data structures by relaxing their semantics. In this paper, we present local linearizability, a relaxed consistency condition that is applicable to container-type concurrent data structures like pools, queues, and stacks. While linearizability requires that the effect of each operation is observed by all threads at the same time, local linearizability only requires that for each thread T, the effects of its local insertion operations and the effects of those removal operations that remove values inserted by T are observed by all threads at the same time. We investigate theoretical and practical properties of local linearizability and its relationship to many existing consistency conditions. We present a generic implementation method for locally linearizable data structures that uses existing linearizable data structures as building blocks. Our implementations show performance and scalability improvements over the original building blocks and outperform the fastest existing container-type implementations. 1998 ACM Subject Classification D.3.1 [Programming Languages]: Formal Definitions and Theory—Semantics; E.1 [Data Structures]: Lists, stacks, and queues; D.1.3 [Software]: Programming Techniques—Concurrent Programming Keywords and phrases (concurrent) data structures, relaxed semantics, linearizability 1 Introduction Concurrent data structures are pervasive all along the software stack, from operating system code to application software and beyond. Both correctness and performance are imperative for concurrent data structure implementations. Correctness is usually specified by relating concurrent executions, admitted by the implementation, with sequential executions, admitted by the sequential version of the data structure. The latter form the sequential specification of the data structure. This relationship is formally captured by consistency conditions, such as linearizability, sequential consistency, or quiescent consistency [25]. Linearizability [26] is the most accepted consistency condition for concurrent data structures due to its simplicity and general applicability. It guarantees that the effects of all ∗ This paper is an extended version of [17] licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany XX:2 Local Linearizability operations by all threads are observed consistently. This global visibility requirement imposes the need of extensive synchronization among threads which may in turn jeopardize performance and scalability. In order to enhance performance and scalability of implementations, recent research has explored relaxed sequential specifications [23, 40, 2], resulting in well-performing implementations of concurrent data structures [2, 18, 23, 28, 38, 6]. Except for [27], the space of alternative consistency conditions that relax linearizability has been left unexplored to a large extent. In this paper, we explore (part of) this gap by investigating local linearizability, a novel consistency condition that is applicable to a large class of concurrent data structures that we call container-type data structures, or containers for short. Containers include pools, queues, and stacks. A fine-grained spectrum of consistency conditions enables us to describe the semantics of concurrent implementations more precisely, e.g., we show in our appendix that work stealing queues [35] which could only be proven to be linearizable wrt pool are actually locally linearizable wrt double-ended queue. Local linearizability is a (thread-)local consistency condition that guarantees that insertions per thread are enq(1) deq(2) T1 observed consistently. While linearizability requires enq(2) deq(1) T2 a consistent view over all insertions, we only require that projections of the global history—so called thread- The thread-induced history of thread T1 induced histories—are linearizable. The induced his- is enclosed by a dashed line while the thread-induced history of thread T2 is tory of a thread T is a projection of a program exe- enclosed by a solid line. cution to the insert-operations in T combined with all remove-operations that remove values inserted by T irFigure 1 Local Linearizability respective of whether they happen in T or not. Then, the program execution is locally linearizable iff each thread-induced history is linearizable. Consider the example (sequential) history depicted in Figure 1. It is not linearizable wrt a queue since the values are not dequeued in the same order as they were enqueued. However, each thread-induced history is linearizable wrt a queue and, therefore, the overall execution is locally linearizable wrt a queue. In contrast to semantic relaxations based on relaxing sequential semantics such as [23, 2], local linearizability coincides with sequential correctness for single-threaded histories, i.e., a single-threaded and, therefore, sequential history is locally linearizable wrt a given sequential specification if and only if it is admitted by the sequential specification. Local linearizability is to linearizability what coherence is to sequential consistency. Coherence [22], which is almost universally accepted as the absolute minimum that a shared memory system should satisfy, is the requirement that there exists a unique global order per shared memory location. Thus, while all accesses by all threads to a given memory location have to conform to a unique order, consistent with program order, the relative ordering of accesses to multiple memory locations do not have to be the same. In other words, coherence is sequential consistency per memory location. Similarly, local linearizability is linearizability per local history. In our view, local linearizability offers enough consistency for the correctness of many applications as it is the local view of the client that often matters. For example, in a locally linearizable queue each client (thread) has the impression of using a perfect queue—no reordering will ever be observed among the values inserted by a single thread. Such guarantees suffice for many e-commerce and cloud applications. Implementations of locally linearizable data structures have been successfully applied for managing free lists in the design of the fast and scalable memory allocator scalloc [5]. Moreover, except for fairness, locally linearizable queues guarantee all properties required from Dispatch Queues [1], a common concurrency programming mechanism on mobile devices. A. Haas et al. In this paper, we study theoretical and practical properties of local linearizability. Local linearizability is compositional—a history over multiple concurrent objects is locally linearizable iff all per-object histories are locally linearizable (see Thm. 12) and locally linearizable container-type data structures, including queues and stacks, admit only “sane” behaviours— no duplicated values, no values returned from thin air, and no values lost (see Prop. 4). Local linearizability is a weakening of linearizability for a natural class of data structures including pools, queues, and stacks (see Sec. 4). We compare local linearizability to linearizability, sequential, and quiescent consistency, and to many shared-memory consistency conditions. Finally, local linearizability leads to new efficient implementations. We present a generic implementation scheme that, given a linearizable implementation of a sequential specification S, produces an implementation that is locally linearizable wrt S (see Sec. 6). Our implementations show dramatic improvements in performance and scalability. In most cases the locally linearizable implementations scale almost linearly and even outperform state-ofthe-art pool implementations. We produced locally linearizable variants of state-of-the-art concurrent queues and stacks, as well as of the relaxed data structures from [23, 28]. The latter are relaxed in two dimensions: they are locally linearizable (the consistency condition is relaxed) and are out-of-order-relaxed (the sequential specification is relaxed). The speedup of the locally linearizable implementation to the fastest linearizable queue (LCRQ) and stack (TS Stack) implementation at 80 threads is 2.77 and 2.64, respectively. Verification of local linearizability, i.e. proving correctness, for each of our new locally linearizable implementations is immediate, given that the starting implementations are linearizable. 2 Semantics of Concurrent Objects The common approach to define the semantics of an implementation of a concurrent data structure is (1) to specify a set of valid sequential behaviors—the sequential specification, and (2) to relate the admissible concurrent executions to sequential executions specified by the sequential specification—via the consistency condition. That means that an implementation of a concurrent data structure actually corresponds to several sequential data structures, and vice versa, depending on the consistency condition used. A (sequential) data structure D is an object with a set of method calls Σ. We assume that method calls include parameters, i.e., input and output values from a given set of values. The sequential specification S of D is a prefix-closed subset of Σ∗ . The elements of S are called D-valid sequences. For ease of presentation, we assume that each value in a data structure can be inserted and removed at most once. This is without loss of generality, as we may see the set of values as consisting of pairs of elements (core values) and version numbers, i.e. V = E × N. Note that this is a technical assumption that only makes the presentation and the proofs simpler, it is not needed and not done in locally linearizable implementations. While elements may be inserted and removed multiple times, the version numbers provide uniqueness of values. Our assumption ensures that whenever a sequence s is part of a sequential specification S, then, each method call in s appears exactly once. An additional core value, that is not an element, is empty. It is returned by remove method calls that do not find an element to return. We denote by Emp the set of values that are versions of empty, i.e., Emp = {empty} × N. I Definition 1 (Appears-before Order, Appears-in Relation). Given a sequence s ∈ Σ∗ in which each method call appears exactly once, we denote by ≺s the total appears-before order over method calls in s. Given a method call m ∈ Σ, we write m ∈ s for m appears in s.  Throughout the paper, we will use pool, queue, and stack as typical examples of containers. We specify their sequential specifications in an axiomatic way [24], i.e., as sets of XX:3 XX:4 Local Linearizability (1) (2) (3) (4) (5) ∀i, j ∈ {1, . . . , n}. s = m1 . . . mn ∧ mi = mj ⇒ i = j ∀x ∈ V. r(x) ∈ s ⇒ i(x) ∈ s ∧ i(x) ≺s r(x) ∀e ∈ Emp. ∀x ∈ V. i(x) ≺s r(e) ⇒ r(x) ≺s r(e) ∀x, y ∈ V. i(x) ≺s i(y) ∧ r(y) ∈ s ⇒ r(x) ∈ s ∧ r(x) ≺s r(y) ∀x, y ∈ V. i(x) ≺s i(y) ≺s r(x) ⇒ r(y) ∈ s ∧ r(y) ≺s r(x) Table 1 The pool axioms (1), (2), (3); the queue order axiom (4); the stack order axiom (5) axioms that exactly define the valid sequences. I Definition 2 (Pool, Queue, & Stack). A pool, queue, and stack with values in a set V have the sets of methods ΣP = {ins(x), rem(x) | x ∈ V } ∪ {rem(e) | e ∈ Emp}, ΣQ = {enq(x), deq(x) | x ∈ V } ∪ {deq(e) | e ∈ Emp}, and ΣS = {push(x), pop(x) | x ∈ V } ∪ {pop(e) | e ∈ Emp}, respectively. We denote the sequential specification of a pool by SP , the sequential specification of a queue by SQ , and the sequential specification of a stack by SS . A sequence s ∈ Σ∗P belongs to SP iff it satisfies axioms (1) - (3) in Table 1—the pool axioms—when instantiating i() with ins() and r() with rem(). We keep axiom (1) for completeness, although it is subsumed by our assumption that each value is inserted and removed at most once. Specification SQ contains all sequences s that satisfy the pool axioms and axiom (4)—the queue order axiom—after instantiating i() with enq() and r() with deq(). Finally, SS contains all sequences s that satisfy the pool axioms and axiom (5)—the stack order axiom—after instantiating i() with push() and r() with pop().  We represent concurrent executions via concurrent histories. An example history is shown in Figure 1. Each thread executes a sequence of method calls from Σ; method calls executed by different threads may overlap (which does not happen in Figure 1). The real-time duration of method calls is irrelevant for the semantics of concurrent objects; all that matters is whether method calls overlap. Given this abstraction, a concurrent history is fully determined by a sequence of invocation and response events of method calls. We distinguish method invocation and response events by augmenting the alphabet. Let Σi = {mi | m ∈ Σ} and Σr = {mr | m ∈ Σ} denote the sets of method-invocation events and method-response events, respectively, for the method calls in Σ. Moreover, let I be the set of thread identifiers. Let ΣIi = {mki | m ∈ Σ, k ∈ I} and ΣIr = {mkr | m ∈ Σ, k ∈ I} denote the sets of method-invocation and -response events augmented with identifiers of executing threads. For example, mki is the invocation of method call m by thread k. Before we proceed, we mention a standard notion that we will need in several occasions. I Definition 3 (Projection). Let s be a sequence over alphabet Σ and M ⊆ Σ. By s|M we denote the projection of s on the symbols in M , i.e., the sequence obtained from s by removing all symbols that are not in M .  I Definition 4 (History). A (concurrent) history h is a sequence in (ΣIi ∪ ΣIr )∗ where (1) no invocation or response event appears more than once, i.e., if h = m1 . . . mn and mh = mk∗ (x) and mj = ml∗ (x), for ∗ ∈ {i, r}, then h = j and k = l, and (2) if a response event mkr appears in h, then the corresponding invocation event mki also appears in h and mi ≺h mr .  I Example 5. A queue history (left) and its formal representation as a sequence (right): T1 T2 enq(2) deq(1) enq(1) enq(2)1i enq(1)2i enq(2)1r deq(1)1i enq(1)2r deq(1)1r A. Haas et al. A history is sequential if every response event is immediately preceded by its matching invocation event and vice versa. Hence, we may ignore thread identifiers and identify a sequential history with a sequence in Σ∗ , e.g., enq(1)enq(2)deq(2)deq(1) identifies the sequential history in Figure 1. A history h is well-formed if h|k is sequential for every thread identifier k ∈ I where h|k denotes the projection of h on the set {mki | m ∈ Σ} ∪ {mkr | m ∈ Σ} of events that are local to thread k. From now on we will use the term history for well-formed history. Also, we may omit thread identifiers if they are not essential in a discussion. A history h determines a partial order on its set of method calls, the precedence order: I Definition 6 (Appears-in Relation, Precedence Order). The set of method calls of a history h is M (h) = {m | mi ∈ h}. A method call m appears in h, notation m ∈ h, if m ∈ M (h). The precedence order for h is the partial order <h such that, for m, n ∈ h, we have that m <h n iff mr ≺h ni . By <kh we denote <h|k , the subset of the precedence order that relates pairs of method calls of thread k, i.e., the program order of thread k.  We can characterize a sequential history as a history whose precedence order is total. In particular, the precedence order <s of a sequential history s coincides with its appears-before order ≺s . The total order for history s in Fig. 1 is enq(1) <s enq(2) <s deq(2) <s deq(1). I Definition 7 (Projection to a set of method calls). Let h be a history, M ⊆ Σ, MiI = {mki | m ∈ M, k ∈ I}, and MrI = {mkr | m ∈ M, k ∈ I}. Then, we write h|M for h|(MiI ∪ MrI ).  Note that h|M inherits h’s precedence order: m <h|M n ⇔ m ∈ M ∧ n ∈ M ∧ m <h n A history h is complete if the response of every invocation event in h appears in h. Given a history h, Complete(h) denotes the set of all completions of h, i.e., the set of all complete histories that are obtained from h by appending missing response events and/or removing pending invocation events. Note that Complete(h) = {h} iff h is a complete history. A concurrent data structure D over a set of methods Σ is a (prefix-closed) set of concurrent histories over Σ. A history may involve several concurrent objects. Let O be a set of concurrent objects with individual sets of method calls Σq and sequential specifications Sq for each object q ∈ O. A history h over O is a history over the (disjoint) union of method S calls of all objects in O, i.e., it has a set of method calls q∈O {q.m | m ∈ Σq }. The added prefix q. ensures that the union is disjoint. The projection of h to an object q ∈ O, denoted by h|q, is the history with a set of method calls Σq obtained by removing the prefix q. in every method call in h|{q.m | m ∈ Σq }. I Definition 8 (Linearizability [26]). A history h is linearizable wrt the sequential specification S if there is a sequential history s ∈ S and a completion hc ∈ Complete(h) such that (1) s is a permutation of hc , and (2) s preserves the precedence order of hc , i.e., if m <hc n, then m <s n. We refer to s as a linearization of h. A concurrent data structure D is linearizable wrt S if every history h of D is linearizable wrt S. A history h over a set of concurrent objects O is linearizable wrt the sequential specifications Sq for q ∈ O if there exists a linearization s of h such that s|q ∈ Sq for each object q ∈ O.  3 Local Linearizability Local linearizability is applicable to containers whose set of method calls is a disjoint union Σ = Ins ∪ Rem ∪ DOb ∪ SOb of insertion method calls Ins, removal method calls Rem, dataobservation method calls DOb, and (global) shape-observation method calls SOb. Insertions (removals) insert (remove) a single value in the data set V or empty; data observations return XX:5 XX:6 Local Linearizability a single value in V ; shape observations return a value (not necessarily in V ) that provides information on the shape of the state, for example, the size of a data structure. Examples of data observations are head(x) (queue), top(x) (stack), and peek(x) (pool). Examples of shape observations are empty(b) that returns true if the data structure is empty and false otherwise, and size(n) that returns the number of elements in the data structure. Even though we refrain from formal definitions, we want to stress that a valid sequence of a container remains valid after deleting observer method calls: S | (Ins ∪ Rem) ⊆ S. (1) There are also containers with multiple insert/remove methods, e.g., a double-ended queue (deque) is a container with insert-left, insert-right, remove-left, and remove-right methods, to which local linearizability is also applicable. However, local linearizability requires that each method call is either an insertion, or a removal, or an observation. As a consequence, set is not a container according to our definition, as in a set ins(x) acts as a global observer first, checking whether (some version of) x is already in the set, and if not inserts x. Also hash tables are not containers for a similar reason. Note that the arity of each method call in a container being one excludes data structures like snapshot objects. It is possible to deal with higher arities in a fairly natural way, however, at the cost of complicated presentation. We chose to present local linearizability on simple containers only. We present the definition of local linearizability without shape observations here and discuss shape observations in Appendix A. I Definition 9 (In- and out-methods). Let h be a container history. For each thread T we define two subsets of the methods in h, called in-methods IT and out-methods OT of thread T , respectively: IT = {m | m ∈ M (h|T ) ∩ Ins} OT = {m(a) ∈ M (h) ∩ Rem | ins(a) ∈ IT } ∪ {m(e) ∈ M (h) ∩ Rem | e ∈ Emp} ∪ {m(a) ∈ M (h) ∩ DOb | ins(a) ∈ IT }.  Hence, the in-methods for thread T are all insertions performed by T . The out-methods are all removals and data observers that return values inserted by T . Removals that remove the value empty are also automatically added to the out-methods of T as any thread (and hence also T ) could be the cause of “inserting” empty. This way, removals of empty serve as means for global synchronization. Without them each thread could perform all its operations locally without ever communicating with the other threads. Note that the out-methods OT of thread T need not be performed by T , but they return values that are inserted by T . I Definition 10 (Thread-induced History). Let h be a history. The thread-induced history hT is the projection of h to the in- and out-methods of thread T , i.e., hT = h| (IT ∪ OT ).  I Definition 11 (Local Linearizability). A history h is locally linearizable wrt a sequential specification S if (1) each thread-induced history hT is linearizable wrt S, and (2) the thread-induced histories hT form a decomposition of h, i.e., m ∈ h ⇒ m ∈ hT for some thread T . A data structure D is locally linearizable wrt S if every history h of D is locally linearizable wrt S. A history h over a set of concurrent objects O is locally linearizable wrt the sequential specifications Sq for q ∈ O if each thread-induced history is linearizable over O and the thread-induced histories form a decomposition of h, i.e., q.m ∈ h ⇒ q.m ∈ hT for some thread T .  Local linearizability is sequentially correct, i.e., a single-threaded (necessarily sequential) history h is locally linearizable wrt a sequential specification S iff h ∈ S. Like linearizabil- A. Haas et al. XX:7 ity [25], local linearizability is compositional. The complete proof of the following theorem and missing or extended proofs of all following properties can be found in Appendix B. I Theorem 12 (Compositionality). A history h over a set of objects O with sequential specifications Sq for q ∈ O is locally linearizable iff h|q is locally linearizable wrt Sq for every q ∈ O. Proof (Sketch). The property follows from the compositionality of linearizability and the fact that (h|q)T = hT |q for every thread T and object q. J The Choices Made. Splitting a global history into subhistories and requiring consistency for each of them is central to local linearizability. While this is common in shared-memory consistency conditions [22, 31, 32, 3, 16, 4, 20], our study of local linearizability is a first step in exploring subhistory-based consistency conditions for concurrent objects. We chose thread-induced subhistories since thread-locality reduces contention in concurrent objects and is known to lead to high performance as confirmed by our experiments. To assign method calls to thread-induced histories, we took a data-centric point of view by (1) associating data values to threads, and (2) gathering all method calls that insert/return a data value into the subhistory of the associated thread (Def. 9). We associate data values to the thread that inserts them. One can think of alternative approaches, for example, associate with a thread the values that it removed. In our view, the advantages of our choice are clear: First, by assigning inserted values to threads, every value in the history is assigned to some thread. In contrast, in the alternative approach, it is not clear where to assign the values that are inserted but not removed. Second, assigning inserted values to the inserting thread enables eager removals and ensures progress in locally linearizable data structures. In the alternative approach, it seems like the semantics of removing empty should be local. An orthogonal issue is to assign values from shape observations to threads. In Appendix A, we discuss two meaningful approaches and show how local linearizability can be extended towards shape and data observations that appear in insertion operations of sets. Finally, we have to choose a consistency condition required for each of the subhistories. We chose linearizability as it is the best (strong) consistency condition for concurrent objects. 4 Local Linearizability vs. Linearizability We now investigate the connection between local linearizability and linearizability. I Proposition 1 (Lin 1). In general, linearizability does not imply local linearizability. Proof. We provide an example of a data structure that is linearizable but not locally linearizable. Consider a sequential specification SNearlyQ which behaves like a queue except when the first two insertions were performed without a removal in between—then the first two elements are removed out of order. Formally, s ∈ SNearlyQ iff (1) s = s1 enq(a)enq(b)s2 deq(b)s3 deq(a)s4 where s1 enq(a)enq(b)s2 deq(a)s3 deq(b)s4 ∈ SQ and s1 ∈ {deq(e) | e ∈ Emp}∗ for some a, b ∈ V , or (2) s ∈ SQ and s 6= s1 enq(a)enq(b)s2 for s1 ∈ {deq(e) | e ∈ Emp}∗ and a, b ∈ V . The example below is linearizable wrt SNearlyQ . However, T1 ’s induced history enq(1)enq(2)deq(1)deq(2) is not. T1 T2 enq(1) enq(2) deq(3) enq(3) deq(2) deq(1) J The following condition on a data structure specification is sufficient for linearizability to imply local linearizability and is satisfied, e.g., by pool, queue, and stack. XX:8 Local Linearizability T1 T2 i(1) r(empty) i(2) r(2) r(1) Figure 2 LL, not SC (Pool, Queue, Stack) T1 T2 i(1) r(1) r(empty) Figure 3 SC, not LL (Pool, Queue, Stack) I Definition 13 (Closure under Data-Projection). A seq. specification S over Σ is closed under data-projection 1 iff for all s ∈ S and all V 0 ⊆ V , s|{m(x) ∈ Σ | x ∈ V 0 ∪ Emp} ∈ S.  For s = enq(1)enq(3)enq(2)deq(3)deq(1)deq(2) we have s ∈ SNearlyQ , but s|{enq(x), deq(x) | x ∈ {1, 2} ∪ Emp} ∈ / SNearlyQ , i.e., SNearlyQ is not closed under data-projection. I Proposition 2 (Lin 2). Linearizability implies local linearizability for sequential specifications that are closed under data-projection. Proof (Sketch). The property follows from Definition 13 and Equation (1). J There exist corner cases where local linearizability coincides with linearizability, e.g., for S = ∅ or S = Σ∗ , or for single-producer/multiple-consumer histories. We now turn our attention to pool, queue, and stack. I Proposition 3. The seq. specifications SP , SQ , and SS are closed under data-projection. Proof (Sketch). Let s ∈ SP , V 0 ⊆ V , and let s0 = s| ({ins(x), rem(x) | x ∈ V 0 ∪ Emp}). Then, it suffices to check that all axioms for pool (Definition 2 and Table 1) hold for s0 . J I Theorem 14 (Pool & Queue & Stack, Lin). For pool, queue, and stack, local linearizability is (strictly) weaker than linearizability. Proof. Linearizability implies local linearizability for pool, queue, and stack as a consequence of Proposition 2 and Proposition 3. The history in Figure 2 is locally linearizable but not linearizable wrt pool, queue and stack (after suitable renaming of method calls). J Although local linearizability wrt a pool does not imply linearizability wrt a pool (Theorem 14), it still guarantees several properties that ensure sane behavior as stated next. I Proposition 4 (LocLin Pool). Let h be a locally linearizable history wrt a pool. Then: 1. No value is duplicated, i.e., every remove method appears in h at most once. 2. No out-of-thin-air values, i.e., ∀x ∈ V. rem(x) ∈ h ⇒ ins(x) ∈ h ∧ rem(x)6<h ins(x). 3. No value is lost, i.e., ∀x ∈ V. ∀e ∈ Emp. rem(e) <h rem(x) ⇒ ins(x) 6<h rem(e) and ∀x ∈ V. ∀e ∈ Emp. ins(x) <h rem(e) ⇒ rem(x) ∈ h ∧ rem(e)6<h rem(x). Proof. By direct unfolding of the definitions. J Note that if a history h is linearizable wrt a pool, then all of the three stated properties hold, as a consequence of linearizability and the definition of SP . 5 Local Linearizability vs. Other Relaxed Consistency Conditions We compare local linearizability with other classical consistency conditions to better understand its guarantees and implications. 1 The same notion has been used in [7] under the name closure under projection. A. Haas et al. XX:9 Sequential Consistency (SC). A history h is sequentially consistent [25, 30] wrt a sequential specification S, if there exists a sequential history s ∈ S and a completion hc ∈ Complete(h) such that (1) s is a permutation of hc , and (2) s preserves each thread’s program order, i.e., if m <Th n, for some thread T , then m <s n. We refer to s as a sequential witness of h. A data structure D is sequentially consistent wrt S if every history h of D is sequentially consistent wrt S. Sequential consistency is a useful consistency condition for shared memory but it is not really suitable for data structures as it allows for behavior that excludes any coordination between threads [39]: an implementation of a data structure in which every thread uses a dedicated copy of a sequential data structure without any synchronization is sequentially consistent. A sequentially consistent queue might always return empty in one (consumer) thread as the point in time of the operation can be moved, e.g., see Figure 3. In a producerconsumer scenario such a queue might end up with some threads not doing any work. I Theorem 15 (Pool, Queue & Stack, SC). For pool, queue, and stack, local linearizability is incomparable to sequential consistency. J Figures 2 and 3 give example histories that show the statement of Theorem 15. In contrast to local linearizability, sequential consistency is not compositional [25]. (Quantitative) Quiescent Consistency (QC & QQC). Like linearizability and sequential consistency, quiescent consistency [13, 25] also requires the existence of a sequential history, a quiescent witness, that satisfies the sequential specification. All three consistency conditions impose an order on the method calls of a concurrent history that a witness has to preserve. Quiescent consistency uses the concept of quiescent states to relax the requirement of preserving the precedence order imposed by linearizability. A quiescent state is a point in a history at which there are no pending invocation events (all invoked method calls have already responded). In a quiescent witness, a method call m has to appear before a method call n if and only if there is a quiescent state between m and n. Method calls between two consecutive quiescent states can be ordered arbitrarily. Quantitative quiescent consistency [27] refines quiescent consistency by bounding the number of reorderings of operations between two quiescent states based on the concurrent behavior between these two states. The next result about quiescent consistency for pool is needed to establish the connection between quiescent consistency and local linearizability. I Proposition 5. A pool history h satisfying 1.-3. of Prop. 4 is quiescently consistent. J From Prop. 4 and 5 follows that local linearizability implies quiescent consistency for pool. I Theorem 16 (Pool, Queue & Stack, QC). For pool, local linearizability is (strictly) stronger than quiescent consistency. For queue and stack, local linearizability is incomparable to quiescent consistency. J Local linearizability also does not imply the stronger condition of quantitative quiescent consistency. Like local linearizability, quiescent consistency and quantitative quiescent consistency are compositional [25, 27]. For details, please see Appendix D. Consistency Conditions for Distributed Shared Memory. There is extensive research on consistency conditions for distributed shared memory [3, 4, 8, 16, 20, 22, 30, 31, 32]. In Appendix E, we compare local linearizability against coherence, PRAM consistency, processor consistency, causal consistency, and local consistency. All these conditions split a history into subhistories and require consistency of the subhistories. For our comparison, XX:10 Local Linearizability T1 T2 ins(1) ins(2) head(2) head(1) head(2) head(1) Figure 4 Problematic shared-memory history. we first define a sequential specification SM for a single memory location. We assume that each memory location is preinitialized with a value vinit ∈ V . A read-operation returns the value of the last write-operation that was performed on the memory location or vinit if there was no write-operation. We denote write-operations by ins and read-operations by head. Formally, we define SM as SM = {head(vinit )}? · {ins(v)head(v)i | i ≥ 0, v ∈ V }? . Note that read-operations are data observations and the same value can be read multiple times. For brevity, we only consider histories that involve a single memory location. In the following, we summarize our comparison. For details, please see Appendix E. While local linearizability is well-suited for concurrent data structures, this is not necessarily true for the mentioned shared-memory consistency conditions. On the other hand, local linearizability appears to be problematic for shared memory. Consider the locally linearizable history in Figure 4. There, the read values oscillate between different values that were written by different threads. Therefore, local linearizability does not imply any of the shared-memory consistency conditions. In Appendix E, we further show that local linearizability is incomparable to all considered shared-memory conditions. 6 Locally Linearizable Implementations In this section, we focus on locally linearizable data structure implementations that are generic as follows: Choose a linearizable implementation of a data structure Φ wrt a sequential specification SΦ , and we turn it into a (distributed) data structure called LLD Φ that is locally linearizable wrt SΦ . An LLD implementation takes several copies of Φ (that we call backends) and assigns to each thread T a backend ΦT . Then, when thread T inserts an element into LLD Φ, the element is inserted into ΦT , and when an arbitrary thread removes an element from LLD Φ, the element is removed from some ΦT eagerly, i.e., if no element is found in the attempted backend ΦT the search for an element continues through all other backends. If no element is found in one round through the backends, then we return empty. I Proposition 6 (LLD correctness). Let Φ be a data structure implementation that is linearizable wrt a sequential specification SΦ . Then LLD Φ is locally linearizable wrt SΦ . Proof. Let h be a history of LLD Φ. The crucial observation is that each thread-induced history hT is a backend history of ΦT and hence linearizable wrt SΦ . J Any number of copies (backends) is allowed in this generic implementation of LLD Φ. If we take just one copy, we end up with a linearizable implementation. Also, any way of choosing a backend for removals is fine. However, both the number of backends and the backend selection strategy upon removals affect the performance significantly. In our LLD Φ implementations we use one backend per thread, resulting in no contention on insertions, and always attempt a local remove first. If this does not return an element, then we continue a search through all other backends starting from a randomly chosen backend. LLD Φ is an implementation closely related to Distributed Queues (DQs) [18]. A DQ is a (linearizable) pool that is organized as a single segment of length ` holding ` backends. DQs come in different flavours depending on how insert and remove methods are distributed A. Haas et al. across the segment when accessing backends. No DQ variant in [18] follows the LLD approach described above. Moreover, while DQ algorithms are implemented for a fixed number of backends, LLD Φ implementations manage a segment of variable size, one backend per (active) thread. Note that the strategy of selecting backends in the LLD Φ implementations is similar to other work in work stealing [35]. However, in contrast to this work our data structures neither duplicate nor lose elements. LLD (stack) implementations have been successfully applied for managing free lists in the fast and scalable memory allocator scalloc [5]. The guarantees provided by local linearizability are not needed for the correctness of scalloc, i.e., the free lists could also use a weak pool (pool without a linearizable emptiness check). However, the LLD stack implementations provide good caching behavior when threads operate on their local stacks whereas a weak pool would potentially negatively impact performance. We have implemented LLD variants of strict and relaxed queue and stack implementations. None of our implementations involves observation methods, but the LLD algorithm can easily be extended to support observation methods. For details, please see App. F.4. Finally, let us note that we have also experimented with other locally linearizable implementations that lacked the genericity of the LLD implementations, and whose performance evaluation did not show promising results (see App. G). As shown in Sec. 4, a locally linearizable pool is not a linearizable pool, i.e., it lacks a linearizable emptiness check. Indeed, LLD implementations do not provide a linearizable emptiness check, despite of eager removes. We provide LL+ D Φ, a variant of LLD Φ, that provides a linearizable emptiness check under mild conditions on the starting implementation Φ (see App. F.1 for details). Experimental Evaluation. All experiments ran on a uniform memory architecture (UMA) machine with four 10-core 2GHz Intel Xeon E7-4850 processors supporting two hardware threads (hyperthreads) per core, 128GB of main memory, and Linux kernel version 3.8.0. We also ran the experiments without hyper-threading resulting in no noticeable difference. The CPU governor has been disabled. All measurements were obtained from the artifactevaluated Scal benchmarking framework [12, 19, 11], where you can also find the code of all involved data structures. Scal uses preallocated memory (without freeing it) to avoid memory management artifacts. For all measurements we report the arithmetic mean and the 95% confidence interval (sample size=10, corrected sample standard deviation). In our experiments, we consider the linearizable queues Michael-Scott queue (MS) [34] and LCRQ [36] (improved version [37]), the linearizable stacks Treiber stack (Treiber) [42] and TS stack [14], the k-out-of-order relaxed k-FIFO queue [28] and k-Stack [23] and linearizable well-performing pools based on distributed queues using random balancing [18] (1-RA DQ for queue, and 1-RA DS for stack). For each of these implementations (but the pools) we provide LLD variants (LLD LCRQ, LLD TS stack, LLD k-FIFO, and LLD k-Stack) and, when possible, LL+ D variants (LL+ D MS queue and LL+ D Treiber stack). Making the pools locally linearizable is not promising as they are already distributed. Whenever LL+ D is achievable for a data structure implementation Φ we present only results for LL+ D Φ as, in our workloads, LLD Φ and LL+ D Φ implementations perform with no visible difference. We evaluate the data structures on a Scal producer-consumer benchmark where each producer and consumer is configured to execute 106 operations. To control contention, we add a busy wait of 5µs between operations. This is important as too high contention results in measuring hardware or operating system (e.g., scheduling) artifacts. The number of threads ranges between 2 and 80 (number of hardware threads) half of which are producers and half consumers. To relate performance and scalability we report the number of data XX:11 million operations per sec (more is better) Local Linearizability 26 24 22 20 18 16 14 12 10 8 6 4 2 0 MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ 2 10 20 30 40 50 60 70 80 number of threads “queue-like” data structures million operations per sec (more is better) XX:12 26 24 22 20 18 16 14 12 10 8 6 4 2 0 Treiber TS Stack k-Stack LL+D Treiber LLD TS Stack LLD k-Stack 1-RA DS 2 10 20 30 40 50 60 70 80 number of threads “stack-like” data structures Figure 5 Performance and scalability of producer-consumer microbenchmarks with an increasing number of threads on a 40-core (2 hyperthreads per core) machine structure operations per second. Data structures that require parameters to be set are configured to allow maximum parallelism for the producer-consumer workload with 80 threads. This results in k = 80 for all k-FIFO and k-Stack variants (40 producers and 40 consumers in parallel on a single segment), p = 80 for 1-RA-DQ and 1-RA-DS (40 producers and 40 consumers in parallel on different backends). The TS Stack algorithm also needs to be configured with a delay parameter. We use optimal delay (7µs) for the TS Stack and zero delay for the LLD TS Stack, as delays degrade the performance of the LLD implementation. Figure 5 shows the results of the producer-consumer benchmarks. Similar to experiments performed elsewhere [14, 23, 28, 36] the well-known algorithms MS and Treiber do not scale for 10 or more threads. The state-of-the-art linearizable queue and stack algorithms LCRQ and TS-interval Stack either perform competitively with their k-out-of-order relaxed counter parts k-FIFO and k-Stack or even outperform and outscale them. For any implementation Φ, LLD Φ and LL+ D Φ (when available) perform and scale significantly better than Φ does, even slightly better than the state-of-the-art pool that we compare to. The best improvement show LLD variants of MS queue and Treiber stack. The speedup of the locally linearizable implementation to the fastest linearizable queue (LCRQ) and stack (TS Stack) A. Haas et al. implementation at 80 threads is 2.77 and 2.64, respectively. The performance degradation for LCRQ between 30 and 70 threads aligns with the performance of fetch-and-inc—the CPU instruction that atomically retrieves and modifies the contents of a memory location— on the benchmarking machine, which is different on the original benchmarking machine [36]. LCRQ uses fetch-and-inc as its key atomic instruction. 7 Conclusion & Future Work Local linearizability splits a history into a set of thread-induced histories and requires consistency of all such. This yields an intuitive consistency condition for concurrent objects that enables new data structure implementations with superior performance and scalability. Local linearizability has desirable properties like compositionality and well-behavedness for container-type data structures. As future work, it is interesting to investigate the guarantees that local linearizability provides to client programs along the line of [15]. Acknowledgments This work has been supported by the National Research Network RiSE on Rigorous Systems Engineering (Austrian Science Fund (FWF): S11402-N23, S11403-N23, S11404-N23, S11411N23), a Google PhD Fellowship, an Erwin Schrödinger Fellowship (Austrian Science Fund (FWF): J3696-N26), EPSRC grants EP/H005633/1 and EP/K008528/1, the Vienna Science and Technology Fund (WWTF) trough grant PROSEED, the European Research Council (ERC) under grant 267989 (QUAREM) and by the Austrian Science Fund (FWF) under grant Z211-N23 (Wittgenstein Award). References 1 2 3 4 5 6 7 8 9 10 URL: https://developer.apple.com/library/ios/documentation/General/ Conceptual/ConcurrencyProgrammingGuide/OperationQueues/OperationQueues. html. Y. Afek, G. Korland, and E. Yanovsky. Quasi-Linearizability: Relaxed Consistency for Improved Concurrency. In OPODIS, pages 395–410, 2010. M. Ahamad, R.A. Bazzi, R. John, P. Kohli, and G. Neiger. The Power of Processor Consistency. In SPAA, pages 251–260, 1993. M. Ahamad, G. Neiger, J.E. Burns, P. Kohli, and P.W. Hutto. Causal memory: definitions, implementation, and programming. Distributed Computing, 9(1):37–49, 1995. M. Aigner, C. M. Kirsch, M. Lippautz, and A. Sokolova. Fast, multicore-scalable, lowfragmentation memory allocation through large virtual memory and global data structures. In OOPSLA, pages 451–469, 2015. D. Alistarh, J. Kopinsky, J. Li, and N. Shavit. The SprayList: A Scalable Relaxed Priority Queue. In PPoPP, pages 11–20, 2015. A. Bouajjani, M. Emmi, C. Enea, and J. Hamza. On Reducing Linearizability to State Reachability. In ICALP, pages 95–107, 2015. S. Burckhardt, A. Gotsman, H. Yang, and M. Zawirski. Replicated Data Types: Specification, Verification, Optimality. In POPL, pages 271–284, 2014. A. Cerone, A. Gotsman, and H. Yang. Parameterised Linearisability. In ICALP, pages 98–109, 2014. S. Chakraborty, T. A. Henzinger, A. Sezgin, and V. Vafeiadis. Aspect-Oriented Linearizability Proofs. Logical Methods in Computer Science, 11(1:20):1–33, 2015. XX:13 XX:14 Local Linearizability 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 POPL 2015 Artifact Evaluation Committee. POPL 2015 Artifact Evaluation. Accessed on 01/14/2015. URL: http://popl15-aec.cs.umass.edu/home/. Computational Systems Group, University of Salzburg. Scal: High-Performance MulticoreScalable Computing. URL: http://scal.cs.uni-salzburg.at. J. Derrick, B. Dongol, G. Schellhorn, B. Tofan, O. Travkin, and H. Wehrheim. Quiescent Consistency: Defining and Verifying Relaxed Linearizability. In FM, pages 200–214, 2014. M. Dodds, A. Haas, and C.M. Kirsch. A Scalable, Correct Time-Stamped Stack. In POPL, pages 233–246, 2015. I. Filipovic, P.W. O’Hearn, N. Rinetzky, and H. Yang. Abstraction for concurrent objects. Theor. Comput. Sci., 411(51-52):4379–4398, 2010. J.R. Goodman. Cache consistency and sequential consistency. University of WisconsinMadison, Computer Sciences Department, 1991. A. Haas, T.A. Henzinger, A. Holzer, C.M. Kirsch, M. Lippautz, H. Payer, A. Sezgin, A. Sokolova, and H. Veith. Local Linearizability for Concurrent Container-Type Data Structures. In CONCUR, 2016. A. Haas, T.A. Henzinger, C.M. Kirsch, M. Lippautz, H. Payer, A. Sezgin, and A. Sokolova. Distributed Queues in Shared Memory: Multicore Performance and Scalability through Quantitative Relaxation. In CF, 2013. A. Haas, T. Hütter, C.M. Kirsch, M. Lippautz, M. Preishuber, and A. Sokolova. Scal: A Benchmarking Suite for Concurrent Data Structures. In NETYS, pages 1–14, 2015. A. Heddaya and H. Sinha. Coherence, Non-coherence and Local Consistency in Distributed Shared Memory for Parallel Computing. Technical report, Computer Science Department, Boston University, 1992. S. Heller, M. Herlihy, V. Luchangco, M. Moir, W.N. Scherer, and N. Shavit. A Lazy Concurrent List-based Set Algorithm. In OPODIS, 2005. J.L. Hennessy and D.A. Patterson. Computer Architecture, Fifth Edition: A Quantitative Approach. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 5th edition, 2011. T.A. Henzinger, C.M. Kirsch, H. Payer, A. Sezgin, and A. Sokolova. Quantitative relaxation of concurrent data structures. In POPL, pages 317–328, 2013. T.A. Henzinger, A. Sezgin, and V. Vafeiadis. Aspect-Oriented Linearizability Proofs. In CONCUR, pages 242–256, 2013. M. Herlihy and N. Shavit. The Art of Multiprocessor Programming. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 2008. M. Herlihy and J.M. Wing. Linearizability: A Correctness Condition for Concurrent Objects. ACM Trans. Program. Lang. Syst., 12(3):463–492, 1990. R. Jagadeesan and J. Riely. Between Linearizability and Quiescent Consistency - Quantitative Quiescent Consistency. In ICALP, pages 220–231, 2014. C.M. Kirsch, M. Lippautz, and H. Payer. Fast and Scalable, Lock-free k-FIFO Queues. In PaCT, pages 208–223, 2013. A. Kogan and E. Petrank. Wait-free queues with multiple enqueuers and dequeuers. In PPoPP, pages 223–234, 2011. L. Lamport. How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs. IEEE Trans. Comput., 28(9):690–691, September 1979. R.J. Lipton and J.S. Sandberg. PRAM: A Scalable Shared Memory. Technical Report Nr. 180, Princeton University, Department of Computer Science, 1988. R.J. Lipton and J.S. Sandberg. Oblivious memory computer networking, September 28 1993. CA Patent 1,322,609. M.M. Michael. Hazard Pointers: Safe Memory Reclamation for Lock-Free Objects. IEEE Trans. Parallel Distrib. Syst., 15(6):491–504, 2004. A. Haas et al. 34 35 36 37 38 39 40 41 42 M.M. Michael and M.L. Scott. Simple, fast, and practical non-blocking and blocking concurrent queue algorithms. In PODC, pages 267–275, 1996. M.M. Michael, M.T. Vechev, and V.A. Saraswat. Idempotent Work Stealing. In PPoPP, pages 45–54, 2009. A. Morrison and Y. Afek. Fast Concurrent Queues for x86 Processors. In PPoPP, pages 103–112, 2013. Multicore Computing Group, Tel Aviv University. Fast Concurrent Queues for x86 Processors. Accessed on 01/28/2015. URL: http://mcg.cs.tau.ac.il/projects/lcrq/. H. Rihani, P. Sanders, and R. Dementiev. MultiQueues: Simpler, Faster, and Better Relaxed Concurrent Priority Queues. CoRR, 2014. arXiv:1411.1209. A. Sezgin. Sequential Consistency and Concurrent Data Structures. CoRR, abs/1506.04910, 2015. N. Shavit. Data Structures in the Multicore Age. CACM, 54(3):76–84, March 2011. R.C. Steinke and J.G. Nutt. A Unified Theory of Shared Memory Consistency. J. ACM, 51(5):800–849, September 2004. R.K. Treiber. Systems Programming: Coping with Parallelism. Technical Report RJ-5118, IBM Research Center, 1986. XX:15 XX:16 Local Linearizability A Local Linearizability with Shape Observers There are two possible ways to deal with shape observers: treat them locally, in the threadinduced history of the performing thread, or treat them globally. While a local treatment is immediate and natural to a local consistency condition, a global treatment requires care. We present both solutions next. I Definition 17 (Local Linearizability LSO). A history h is locally linearizable with local shape observers (LSO) wrt a sequential specification S if it is locally linearizable according to Definition 11 with the difference that the in-methods (Definition 9) also contain all shape observers performed by thread T , i.e., IT = {m | m ∈ M (h|T ) ∩ (Ins ∪ SOb)}.  Global observations require more notation and auxiliary notions. Let sj for j ∈ J be a collection of sequences over alphabet Σ with pairwise disjoint sets of symbols M (sj ). A S sequence s is an interleaving of sj for j ∈ J if M (s) = j M (sj ) and s|M (sj ) = sj for all Q j ∈ J. We write j sj for the set of all interleavings of sj with j ∈ J. Given a history h and a method call m ∈ h, we write h≤m for the (incomplete) history that is the prefix of h up to and without mr , the response event of m. Hence, h≤m contains all invocation and response events of h that appear before mr . I Definition 18. Let S denote the sequential specification of a container D. A shape observer m in a history h has a witness if there exists a sequence s ∈ Σ∗ such that sm ∈ S Q and s ∈ T sT for some sT that is a linearization of the thread-induced history (h≤m )T .  Informally, the above definition states that a global shape observer m must be justified by a (global) witness. Such a global witness is a sequence that (1) when extended by m belongs to the sequential specification, and (2) is an interleaving of linearizations of the thread-induced histories up to m. I Definition 19 (Local Linearizability GSO). A history h is locally linearizable with global shape observers (GSO) wrt a sequential specification S if it is locally linearizable and each shape observer m ∈ SOb has a witness.  We illustrate the difference in the local vs. the global approach for shape observers with the following example. I Example 20. Consider the following queue history with global observer size() T1 T2 enq(1) enq(2) deq(1) size(n) where n is just a placeholder for a concrete natural number. For n = 0, the history h is locally linearizable LSO, but not locally linearizable GSO. For n = 1, the history h is locally linearizable GSO, but not locally linearizable LSO. Global observers and non-disjoint operations are expected to have negative impact on performance. If one cares for global consistency, local linearizability is not the consistency condition to be used. The restriction to containers and disjoint operations specifies, in an informal way, the minimal requirements for local consistency to be acceptable. Neither sets nor maps are containers according to our definition. However, it is possible to extend our treatment to sets and maps similar to our treatment of global observers. Locally A. Haas et al. XX:17 linearizable sets and maps will be weaker than their linearizable counterparts, but, due to the tight coupling between mutator and observer effects, the gain in performance is unlikely to be as substantial as the one observed in other data structures. The technicalities needed to extend local linearizability to sets and maps would complicate the theoretical development without considerable benefits and we, therefore, excluded such data structures. B Additional Results and Proofs Theorem 12 (Compositionality). A history h over a set of objects O with sequential specifications Sq for q ∈ O is locally linearizable if and only if h|q is locally linearizable with respect to Sq for every q ∈ O. Proof. The property follows from the compositionality of linearizability and the fact that (h|q)T = hT |q for every thread T and object q. Assume that h over O is locally linearizable. This means that all thread-induced histories hT over O are linearizable. Hence, since linearizability is compositional, for each object q ∈ O the history hT |q is linearizable with respect to Sq . Now from (h|q)T = hT |q we have that for every object q the history (h|q)T is linearizable for every thread T . Similarly, assume that for every object q ∈ O the history h|q is locally linearizable. Then, for every q, (h|q)T = hT |q is linearizable for every thread T . From the compositionality of linearizability, hT is linearizable for every thread T . This proves that h is locally linearizable. J Proposition 2 (Lin vs. LocLin 2). Linearizability implies local linearizability for sequential specifications that are closed under data-projection. Proof. Assume we are given a history h which is linearizable with respect to a sequential specification S that is closed under data-projection. Further assume that, without loss of generality, h is complete. Then there exists a sequential history s ∈ S such that (1) s is a permutation of h, and (2) if m <h n, then also m <s n. Given a thread T , consider the thread-induced history hT and let sT = s| (IT ∪ OT ). Then, sT is a permutation of hT since hT and sT consist of the same events. Furthermore, sT ∈ S since S is closed under dataprojection and since Equation (1) holds for containers. Finally, we have for each m ∈ hT and n ∈ hT that, if m <hT n, then also m <sT n since m <h n and therefore m <s n which implies m <sT n. Thereby, we have shown that hT is linearizable with respect to S, for an arbitrary thread T . Hence h is locally linearizable with respect to S. J Proposition 3 (Data-Projection Closedness). queue, and stack are closed under data-projection. The sequential specifications of pool, Proof. Let s ∈ SP , V 0 ⊆ V , and let s0 = s| ({ins(x), rem(x) | x ∈ V 0 ∪ Emp}) . Then, it suffices to check that all axioms for pool (Definition 2 and Table 1) hold for s0 . Clearly, all methods in s0 appear at most once, as they do so in s. If rem(x) ∈ s0 , then rem(x) ∈ s and, since s ∈ SP , ins(x) ≺s rem(x). But then also rem(x) ∈ s0 and hence ins(x) ≺s0 rem(x). Finally, if ins(x) ≺s0 rem(e) for e ∈ Emp, then ins(x) ≺s rem(e) implying that rem(x) ∈ s and rem(x) ≺s rem(e). But then rem(x) ∈ s0 as well and rem(x) ≺s0 rem(e). This shows that SP is closed under data-projection. XX:18 Local Linearizability Assume now that s ∈ SQ and s0 is as before (with enq() and deq() for ins() and rem(), respectively). Then, as SP is closed under data-projection, s0 satisfies the pool axioms. Moreover, the queue-order axiom (Definition 2 and Table 1) also holds: Assume enq(x) ≺s0 enq(y) and deq(y) ∈ s0 . Then enq(x) ≺s enq(y) and deq(y) ∈ s. Since s ∈ SQ we get deq(x) ∈ s and deq(x) ≺s deq(y). But this means deq(x) ∈ s0 and deq(x) ≺s0 deq(y). Hence, SQ is closed under data-projection. Finally, if s ∈ SS and s0 is as before (with push() and pop() for ins() and rem(), respectively), we need to check that the stack-order axiom (Definition 2 and Table 1) holds. Assume push(x) ≺s0 push(y) ≺s0 pop(x). This implies push(x) ≺s push(y) ≺s pop(x) and since s ∈ SS we get pop(y) ∈ s and pop(y) ≺s pop(x). But then pop(y) ∈ s0 and pop(y) ≺s0 pop(x). So, SS is closed under data-projection. J Proposition 4 (LocLin Pool). Let h be a locally linearizable history wrt a pool. Then: 1. No value is duplicated, i.e., every remove method appears in h at most once. 2. There are no out-of-thin-air values, i.e., ∀x ∈ V. rem(x) ∈ h ⇒ ins(x) ∈ h ∧ rem(x)6<h ins(x). 3. No value is lost, i.e., ∀x ∈ V. ∀e ∈ Emp. ins(x) <h rem(e) ⇒ rem(x) ∈ h ∧ rem(e)6<h rem(x) and ∀x ∈ V. ∀e ∈ Emp. rem(e) <h rem(x) ⇒ ins(x) 6<h rem(e). Proof. Note that if a history h is linearizable wrt a pool, then all of the three stated properties hold, as a consequence of linearizability and the definition of SP . Now assume that h is locally linearizable wrt a pool. If rem(x) appears twice in h, then it also appears twice in some thread-induced history hT contradicting that hT is linearizable with respect to a pool. This shows that no value is duplicated. If rem(x) ∈ h, then rem(x) ∈ hT for some T and, since hT is linearizable with respect to a pool, ins(x) ∈ hT and rem(x)6<hT ins(x). This yields ins(x) ∈ h and rem(x)6<h ins(x). Hence, there are no thin-air values. Finally, if rem(e) ∈ h for e ∈ Emp then rem(e) ∈ hT for all T . Let ins(x) <h rem(e) and let T 0 be such that ins(x) ∈ hT 0 . Then ins(x) <hT 0 rem(e) and since hT 0 is linearizable with respect to a pool, rem(x) ∈ hT 0 and rem(e)6<hT 0 rem(x). This yields rem(x) ∈ h and rem(e)6<h rem(x). Similarly, the other condition holds. Hence, no value is lost. J Theorem 25 (Queue Local Linearizability). A queue concurrent history h is locally linearizable with respect to the queue sequential specification SQ if and only if 1. h is locally linearizable with respect to the pool sequential specification SP , and 2. ∀x, y ∈ V. ∀i. enq(x) <ih enq(y) ∧ deq(y) ∈ h ⇒ deq(x) ∈ h ∧ deq(y) 6<h deq(x). Proof. Assume h is locally linearizable with respect to SQ . Since SQ ⊆ SP (with suitably renamed method calls), h is locally linearizable with respect to SP . Moreover, since all hi are linearizable with respect to SQ , by Theorem 24, for all i we have ∀x, y ∈ V. enq(x) <hi enq(y) ∧ deq(y) ∈ hi ⇒ deq(x) ∈ hi ∧ deq(y) 6<hi deq(x). Assume x, y ∈ V are such that enq(x) <ih enq(y) and deq(y) ∈ h. Then enq(x) <hi enq(y) and deq(y) ∈ hi so deq(x) ∈ hi and deq(y) 6<hi deq(x). This implies deq(x) ∈ h and deq(y) 6<h deq(x). For the opposite, assume that conditions 1. and 2. hold for a history h. We need to show that (1) hi form a decomposition of h, which is clear for a queue, and (2) each hi is linearizable with respect to SQ . A. Haas et al. XX:19 By 1., each hi is linearizable with respect to a pool. Assume enq(x) <hi enq(y) and deq(y) ∈ hi . Then enq(x) <ih enq(y) ∧ deq(y) ∈ h and hence by 2., deq(x) ∈ h ∧ deq(y) 6<h deq(x). Again, as enq(x), deq(x) ∈ hi we get deq(x) ∈ hi ∧ deq(y) 6<hi deq(x). According to Theorem 24 this is enough to conclude that each hi is linearizable with respect to SQ . J Theorem 15 (Pool, Queue, & Stack, SC). For pool, queue, and stack, local linearizability is incomparable to sequential consistency. Proof. The following histories, when instantiating i() with ins(), enq(), and push(), respectively, and instantiating r() with rem(), deq(), and pop(), respectively, are sequentially consistent but not locally linearizable wrt pool, queue and stack: (a) Pool: T1 i(1) r(1) r(empty) T2 (b) Queue: r(2) T1 T2 i(1) i(2) i(1) i(2) r(1) (c) Stack: T1 r(1) T2 r(2) History (a) is already not locally linearizable wrt pool, queue, and stack, respectively, histories (b) and (c) provide interesting examples. The history in Figure 2 is locally linearizable but not sequentially consistent wrt a pool. The following histories are locally linearizable but not sequentially consistent wrt a queue and a stack, respectively: (d) Queue: T1 T2 i(1) i(2) i(3) r(1) r(2) i(4) r(4) r(3) The two thread-induced histories i(1)i(2)i(3)r(1)r(2)r(3) and i(4)r(4) are both linearizable with respect to a queue. However, the overall history has no sequential witness and is therefore not sequentially consistent: To maintain the queue behavior, the order of operations r(1) and r(2) cannot be changed. However, this implies that the value 3 instead of the value 4 would have to be removed directly after i(4). (e) Stack: XX:20 Local Linearizability qi = ins(xi,1 )rem(xi,1 ) . . . ins(xi,p )rem(xi,p )rem(xi,p+1 )rem(xi,q )rem(empty)ri ins(xi,q+1 ) . . . ins(xi,m ). Figure 6 Sequential history qi . T1 i(1) i(2) r(2) T2 i(3) r(1) r(3) The two thread-induced histories i(1)i(2)r(2)r(1) and i(3)r(3) are both linearizable with respect to a stack. The operations i(2) and r(2) prevent the reordering of operations i(1) and i(3). Therefore, the overall history has no sequential witness and hence it is not sequentially consistent. J Proposition 5 (Pool, QC). Let h be a pool history in which no data is duplicated, no thin-air values are returned, and no data is lost, i.e., h satisfies 1.-3. of Proposition 4. Then h is quiescently consistent. Proof. Assume h is a pool history that satisfies 1.-3. of Proposition 4. Let h1 , . . . , hn be histories that form a sequential decomposition of h. That is h = h1 · · · hn and the only quiescent states in any hi are at the beginning and at the end of it. Note that this decomposition has nothing to do with a thread-local decomposition. Let Mi = Mhi be the set of methods of hi , for i ∈ {1, . . . , n}. Note that the sanity conditions 1.-3. ensure that none of the following two situations can happen: rem(x) ∈ Mi , ins(x) ∈ Mj , j > i, ins(x) ∈ Mi , rem(empty) ∈ Mj , rem(x) ∈ Mk , k > j > i, Let Vi = {xi,1 , . . . , xi,m } denote the set of values in Mi ordered in a way that there is a p and q such that ins(xi,j ), rem(xi,j ) ∈ Mi for j ≤ p; rem(xi,j ) ∈ Mi for j > p, j ≤ q; and ins(xi,j ) ∈ Mi for j > q. Moreover, let ri be the number of occurrences of rem(empty) in hi . We now construct a sequential history for h, which has the form q = q1 · · · qn where each sequential history qi is a permutation of Mi shown in Figure 6. Using the observations above, it is easy to check that q is indeed a quiescent witness for h. J Theorem 16 (Pool, Queue, & Stack, QC). For pool, local linearizability is stronger than quiescent consistency. For queue and stack, local linearizability is incomparable to quiescent consistency. Proof. The following histories are quiescently consistent but not locally linearizable wrt pool, queue, and stack, respectively: (a) Pool: rem(empty) T1 T2 ins(1) rem(empty) rem(1) A. Haas et al. XX:21 (b) Queue: enq(1) T1 T2 enq(2) enq(3) deq(3) deq(2) (c) Stack: push(1) T1 T2 push(2) push(3) pop(2) pop(3) In all three histories, the only quiescent states are before and after the longest operation. Therefore, all operations in thread T2 can be reordered arbitrarily, in particular in a way such that they satisfy the sequential specification of the respective concurrent data structure. However, each of the thread-induced histories for thread T2 are not linearizable with respect to pool, queue, and stack, respectively. Therefore, none of these histories is locally linearizable. Also here history (a) suffices. On the other hand, the following histories are not quiescently consistent but locally linearizable wrt queue, and stack, respectively: (d) Queue: T1 enq(1) deq(2) enq(2) T2 deq(1) (e) Stack: T1 T2 push(1) pop(1) push(2) pop(2) In histories (d) and (e), between each two operations, the concurrent data structure is in a quiescent state. Therefore, none of the operations can be reordered and, hence, no sequential witness exists. However, all thread-induced histories are linearable and, therefore, the overall histories are locally linearizable. In particular, on a history where each pair of operations is separated by a quiescent state, i.e., there is no overlap of operations, a quiescent consistent data structure behaves as it would be linearizable with respect to its sequential specification and we see the same semantic differences to local linearizability as we see between linearizability and local linearizability. J C Case Study: Work Stealing Queues Consider a data structure D which admits two operation types: ins(x), which inserts the element x into the container, and rem(), which returns and removes an element from the container. Now imagine that the implementation uses a Work Stealing Queue (WSQ) [35]. Every thread T that uses D has its unique designated buffer QT in the WSQ. Whenever thread T calls ins(x), x is appended to the tail of QT . When T calls rem(), WSQ first XX:22 Local Linearizability T1 T2 enq(3) enq(2) enq(1) deq(1) deq(2) deq(3) Figure 7 History that is QQC but not LL. checks whether QT is non-empty; if it is, then it returns the element at the tail of QT (LIFO semantics) and removes it. Otherwise, it chooses some other QT 0 and tries to return an element from that buffer. But any time a different thread’s buffer is checked, the element to be removed is taken from the head (FIFO semantics). If T and T 0 are both trying to access the same buffer at the same time, then usual synchronization measures are taken to ensure that exactly one thread removes one element. Given this implementation, the developer of D wants to write a specification for the potential users of D. Since D is essentially a collection of deques, the developer is tempted to state that D is a deque with a particular consistency condition. However, D is not a linearizable deque because ins(x) by T followed by ins(y) by T 0 followed by rem() returns either x or y depending on whether T or T 0 calls it; i.e. rem() has ambiguous semantics. D can be seen as a sequentially consistent (SC) deque but then D does not allow many behaviors that an SC deque would allow; i.e. SC does not capture the behaviors of D tightly. Relaxed sequential specifications will not work either since D does converge to sequential semantics (of a LIFO stack) when a single thread uses it. In short, the developer will fail to capture the semantics of D in a satisfactory manner. D on the other hand is a locally linearizable deque in which rem() by T from QT 0 is treated as FIFO removal whenever T 6= T 0 and as LIFO removal whenever T = T 0 . In other words, local linearizability provides a succinct and clean representation of a well-known implementation framework (WSQ) hiding away implementation details. Compare this with the fact that even though WSQ has a queue in it, to argue its correctness it is proved to be a linearizable pool even though it has stronger semantics than a pool; i.e. linearizable pool semantics is too weak for D. Observe also that since what we have described in the example is essentially providing the illusion of using a monolithic structure which is implemented in terms of distributed components (shared memory is typically implemented on message passing), we expect local linearizability to be widely applicable. D Quiescent Consistency & Quantitative Quiescent Consistency Without going into the details of the definition of quantitative quiescent consistency we give a history in Figure 7 that is quantitatively quiescently consistent but not locally linearizable wrt a queue. Quantitative quiescent consistency allows to reorder the two insert-operations in thread T2 and thereby violates local linearizability. E Consistency Conditions for Distributed Shared Memory Decomposition per LL thread Coherence PRAM #SHs Write-Operations Ih (i) Read-Operations Oh (i) CCfSH LoD n {ins(v) ∈ h|Ti | v ∈ V } {head(vinit ) ∈ h} ∪ {head(v) ∈ h | ins(v) ∈ Ih (i)} Lin. no memory location k {ins(v) ∈ h | v ∈ V } {head(v) ∈ h | v ∈ V } SC yes thread n {ins(v) ∈ h | v ∈ V } {head(v) ∈ h|Ti | v ∈ V } SC yes a yes PC thread n {ins(v) ∈ h | v ∈ V } {head(v) ∈ h|Ti | v ∈ V } SC CC thread n {ins(v) ∈ h | v ∈ V } {head(v) ∈ h|Ti | v ∈ V } SCb yes {head(v) ∈ h|Ti | v ∈ V } c yes LC thread & memory location n·k {ins(v) ∈ h|Ti | v ∈ V } ∪ {ins(v) ∈ h | head(v) ∈ h|Ti } SC A. Haas et al. Consistency Condition SCa : SC and ins-operations are in the same order for each witness. SCb : SC and ins-operations are ordered by the transitive closure of the thread program orders and write-read pairs. SCc : SC and ins-operations from threads other than Ti can be reordered even if they are from the same thread and only logical contradictions in the local history are considered for consistency. n: number of threads, k: number of memory locations, #SHs: number of subhistories, CCfSH: consistency condition for subhistories, LoD: loss of data Table 2 Comparison of consistency conditions for a single distributed shared memory location, i.e., k = 1 XX:23 XX:24 Local Linearizability In Table 2 we compare local linearizability (LL) against the consistency conditions coherence [3], pipelined RAM (PRAM) consistency [31, 32, 41, 4], processor consistency (PC) [3, 16], causal consistency (CC) [4], and local consistency (LC) [20]. Local linearizability shares with all these consistency conditions the idea of decomposing a concurrent history into several subhistories. Coherence projects a concurrent history to the operations on a single memory location and each resulting history has to be sequentially consistent. Since sequential consistency is not compositional, coherence does not imply sequential consistency for the overall history [3] whereas local linearizability for each single memory location implies local linearizability for the overall history. In contrast to coherence and local consistency, local linearizability, PRAM consistency, PC, and CC all decompose the history into per-thread subhistories, i.e., if there are n threads then these conditions consider n subhistories and need n sequential witnesses. Coherence requires one witness per memory location and local consistency requires one witness per thread and memory location. For determining the subhistory for a thread Ti , coherence, PRAM consistency, PC, and CC consider all write-operations in a given history, i.e., Ih (i) = {ins(v) ∈ h | v ∈ V }. In contrast, local linearizability only considers the write-operations in thread Ti , i.e., Ih (i) = {ins(v) ∈ h|Ti | v ∈ V } and local consistency considers all write-operations in thread Ti as well as all write-operations whose values are read in thread Ti , i.e., Ih (i) = {ins(v) ∈ h|Ti | v ∈ V } ∪ {ins(v) ∈ h | head(v) ∈ h|Ti }. Regarding read-operations, PRAM consistency, PC, CC, and LC consider only the read-operations in thread Ti . Coherence considers all read-operations in a given history and local linearizability only considers read-operations that read the initial value vinit and read-operations that read values that were written by a write-operation in thread Ti . Reading the initial value is analogous to returning empty in a data structure. Local linearizability requires that each subhistory, i.e., thread-induced history, is linearizable with respect to the sequential specification under consideration. In contrast, coherence, PRAM consistency, PC, CC, and LC require that each subhistory is sequentially consistent (or a variant thereof) with respect to the sequential specification. However, the variants of sequential consistency that are used by these consistency conditions are vulnerable to a loss of data as discussed in Section 5 and, therefore, make these consistency conditions unsuitable for concurrent data structures. When considering PRAM consistency, the sequentialization of the write-operations of different threads might be observed differently by different threads, e.g., a thread T1 might observe all write operations of thread T2 before the write operations of thread T3 but a thread T4 might observe all write operations of T3 before the write operations of T2 . In contrast, threadinduced histories as defined by local linearizability do not involve write-operations from other threads but involve (some) read-operations performed by other threads. Like PRAM consistency, processor consistency requires for each thread Ti that the read- and write-operations performed by Ti are seen in Ti ’s program order and that the write-operations performed by other threads are seen in their respective program order. Furthermore, processor consistency also requires that two write-operations to the same memory location appear in the same order in each sequential witness of each thread even if they are from different threads [3, 16]. This additional condition makes processor consistency strictly stronger than PRAM consistency [3]. This condition also creates a similar effect as the consideration of read-operations in different threads when forming the thread-induced history in local linearizability. Causal consistency considers a causal order instead of the thread program orders alone. Like local A. Haas et al. XX:25 ` = 4, v = 4 0 `−1 0 backend ` = 5, v = 5 `−1 s: s: n: ` = 4, v = 4 max `−1 0 s: ni : ni : (b) Add new node ni (c) Adjust `, then v alive (a) Initial state Figure 8 Segment modifications throughout announce_thread(). linearizability, causal consistency matches write-read pairs across different threads. In particular, the causal order is the transitive closure of the thread program orders and write-read pairs. By considering the causal order, writes from different threads can become ordered which is not the case for local linearizability. F LLD and LL+ D Implementation Details As already mentioned, each thread inserts elements into a local backend and removes elements either from its local backend (preferred) or from other backends (fall-back) accessed through a single segment (thread-indexed array), effectively managing single-producer/multipleconsumer backends for a varying number of threads. The segment is dynamic in length (with a predefined maximum). A slot in this segment refers to a node that consists of a backend and a flag indicating whether the corresponding thread is alive or has terminated. Similar to other work [2, 21] the flag is used for logically removing the node from the segment (it stays in the segment until its backend is empty). Additionally, a (global) version number keeps track of all changes in the segment. The algorithm is divided into two parts: (1) maintaining the segment, and (2) adding and removing elements to backends. In the following we refer to the segment as s, a thread’s Ti local node as ni , the version number of the segment as v and the current length of the segment as `. The range of indices r is then defined as 0 ≤ r < `. For maintaining the segment we provide two methods announce_thread() and cleanup_thread(node) that are used to add and remove nodes to the segment. Upon removal of a node the segment is also compacted, i.e., the hole that is created by removing a node pointer is filled with the last node pointer in the segment. As nodes are added and removed the length of the segment ` and thus the range of valid indices i of the segment, 0 ≤ i < `, is updated. All changes to the segment involve incrementing the version number. More detailed, the operations for maintaining the segment and compacting it as nodes are cleaned up are: announce_thread(): Allocates a node for the thread as follows: searches for an existing node of a terminated thread and reuses it if it finds one; otherwise it creates a new node, adds the node to s, and adjusts `. In both cases it then increments v and returns the node. The creation of new node is illustrated in Figure 8. cleanup_thread(Node n): Searches for the node n in s using linear search. If it finds n at slot j, it copies the pointer of s[` − 1] to s[j], decrements `, increments v, and resets s[`] to null using the new `. If n is not found, then a concurrent thread has already performed the cleanup and the operation just returns. Figure 9 illustrates an example XX:26 Local Linearizability ` = 5, v = 5 0 ` = 5, v = 5 `−1 s: ` = 4, v = 6 `−1 0 0 s: `−1 s: backend n: dead n: backend m: m: dead (a) n at s[0] is empty and dead (b) Write s[` − 1] into s[0] Adjust ` then v Figure 9 Segment modifications throughout cleanup_thread(Node n). where initially ` = 5, the thread owning the node at s[0] is dead and the corresponding backend is empty. Note that updating the segment state is only needed when threads are joining or when backends of terminated threads become empty. We consider both scenarios as infrequent and implement the corresponding operations using locks. Alternatively those operations can be implemented using helping approaches, similar to wait-free algorithms [29]. Also note that although operations on segments are protected by locks, partial changes can be observed, e.g., a remove operation (as defined below) can observe a segment in an intermediate state with two pointers pointing to a node during cleanup. The invariant is that no change can destroy the integrity of the segment within the valid range, i.e., all slots within the range either point to a valid node or nothing (null). The actual algorithm for adding and removing elements is then defined as follows: ins(): Upon first insertion, a thread Ti gets assigned a node ni (containing backend bi ) using announce_thread(). The element is then inserted into bi . Subsequent insertions from this thread will use ni throughout the lifetime of the thread. rem(): The remove operation consists of two parts: (a) finding and removing an element and (b) cleaning up nodes of terminated threads. For (a) a thread Ti tries to get an element from its own backend in ni . If ni does not exist (because the thread has not yet performed a single ins() operation) or the corresponding backend is empty, then a different node n is selected randomly within the valid range. If the backend contained in n is empty, the operation scans all other nodes’ backends in linear fashion. However, if the version number changed during the round of scanning through all backends, the operation is restarted immediately. Note that since ` is dynamic a remove operation may operate on a range that is no longer valid. Checking the version number ensures that the operation is restarted in such a case. For (b) a thread calls cleanup_thread(n) upon encountering a node n that has its alive-flag set to false (dead) and contains an empty backend. A cleanup also triggers a restart of the remove operation. terminate(): Upon termination a thread Ti changes the alive flag of ni to false (dead). Dynamic memory used for nodes is susceptible to the ABA problem and requires proper handling to free memory. Our implementations use 16-bit ABA counters to avoid the ABA problem and refrain from freeing memory. Hazard pointers [33] can be used for solving the ABA problem as well as for freeing memory. F.1 LL+D: LLD with Linearizable Emptiness Check We call a data structure implementation Φ stateful if the remove methods of Φ can be modified to return a so-called state that changes upon an insert or a remove of an element, A. Haas et al. but does not change between two removes that return empty unless an element has been inserted in the data structure in the meantime. For stateful implementations Φ we can create the locally linearizable version with linearizable emptiness check LL+ D Φ. Michael-Scott queue [34] and Treiber stack [42] are stateful implementations, whereas LCRQ [36] is not. Also TS stack [14], and k-FIFO [28] and k-Stack [23] are stateful implementations, but the notion of a state in these data structures is huge making it unsuitable for LL+ D. For LL+ D implementations, linearizable emptiness checks are achieved via an atomic snapshot [25], just like for DQs. A detailed description of the LLD and LL+ D implementations, as well as the pseudo code, can be found in the appendix. Here, we only present the results of the experimental performance evaluation. F.2 Correctness of LL+ D I Proposition 7 (LLD and LL+ D). Let Φ be a stateful data structure implementation that is linearizable with respect to a sequential specification SΦ . Then LL+ D Φ is linearizable with respect to a pool. Proof. Proving that LL+ D Φ is linearizable with respect to pool, in particular that it has a linearizable emptiness check, follows the proof for DQ in general, see [18]: The emptiness check is performed by creating an atomic snapshot [25] of the states of all backends (stored in the states array) using the first loop (lines 28-43). If the atomic snapshot is valid (checked via the second loop, lines 46-52, in particular line 48) and all backends are empty in this atomic snapshot, then there existed a point in time during the creation of the atomic snapshot where all backends were indeed empty. Notice that since the segment is dynamic in length it can happen that some backends are not contained in the atomic snapshot. To guarantee that no elements are missed in the emptiness check the atomic snapshot is extended by the version number v of the segment. If a new backend is added to the segment during the generation of the atomic snapshot, then the version number is increased and the atomic snapshot becomes invalid (line 45). The linearization point of the remove operation that returns empty is inbetween the two loops (the last remove attempt of the first loop) if the version check and second loop go through. J F.3 LLD Pseudo Code All implementations use the interfaces depicted in Listing 1. For simplicity, the interface only mentions pool, queue, and stack. The highlighted code refers to linearizable emptiness check, i.e., it is only part of the LL+ D implementations: Methods retrieving elements (e.g. rem) are assumed (or modified when possible) to also return a State object that uniquely identifies the state of the data structure with respect to methods inserting elements (e.g. ins). The same state can be accessed via the get_state() observer method. Listing 2 illustrates the pseudo-code for maintaining the segment. The backend on line 2 can either be declared as Stack or Queue as defined in Listing 1 (or any other linearizable data structure). Listing 3 shows the pseudo-code for LL+ D. When removing the highlighted code, we obtain the code for LLD. Each thread maintains its own backend, enclosed in a thread-local node (line 3), for insertion. The local backend is always accessed through get_local_node (line 5). This method also makes sure that a thread is announced (line 7) upon first insertion and acquires a node. An ins() operation then always uses a thread’s local backend XX:27 XX:28 Local Linearizability 1 2 3 4 5 Pool { < Element , State > rem () ; v o i d ins ( Element e ) ; State get_state(); } 6 7 8 9 10 11 12 Queue : Pool { < Element , State > dequeue () ; v o i d enqueue ( Element e ) ; v o i d ins ( Element e ) = > enqueue ( e ) ; < Element , State > rem () = > dequeue () ; } 13 14 15 16 17 18 19 Stack : Pool { < Element , State > pop () ; v o i d push ( Element e ) ; v o i d ins ( Element e ) = > push ( e ) ; < Element , State > rem () = > pop () ; } Listing 1 Pool, queue, and stack interfaces (line 13 and 14) for insertion. For removing an element in rem(), a thread tries to remove an element from its local backend first (line 19-23). If no element can be found, all backends in the valid range are searched in a linear fashion, starting from a random index. The highlighted code (lines 46-52) illustrates checking the atomic snapshot for LL+ D. F.4 LLD with Observer Methods We have implemented LLD variants of (strict and relaxed) queue and stack implementations. None of our LLD implementations involves observer methods, but the LLD algorithm can easily be extended to support observer methods: A data observer on LLD Φ (independently of which thread performs it) amounts to a data observer on any ΦT . A local shape observer on LLD Φ performed by thread T executes the shape observer on ΦT . A global shape observer on LLD Φ executes the shape observer on each backend ΦT and produces an aggregate value. G Additional Implementations We now present and evaluate additional algorithms that provide locally linearizable variants of queues and stacks, obtained by modifying relaxed k-out of order queues and stacks [23, 28] in a way that makes them sequentially correct. We have also tried another generic implementation, related to the construction in [9], that implements a flat-combining wrapper with sequential (to be precise, single-producer multiple-consumer) backends. In our initial experiments the performance of such an implementation was not particularly promising. G.1 Locally Linearizable k-FIFO Queue and k-Stack k-FIFO queues [28] and k-Stacks [23] are relaxed queues and stacks based on lists of segments where each segment holds k slots for elements, effectively allowing reorderings of elements of up to k − 1. The list of segments is implemented by a variant of Michael-Scott queue [34] for A. Haas et al. 1 2 3 4 Node { Pool backend ; Bool alive ; } XX:29 // Any linearizable data structure . 5 6 7 8 9 Segment { Node nodes [ MAX_THREADS ]; Int l = 0; Int version = 0; 10 // Returns all indexes between 0 and l ( exclusive ) in random order . [ Int ] range () ; 11 12 13 // Announces a node in the buffer , effectively adding it to nodes_ , // adjusting l , and changing the version . Node a nn ou nc e _t hr ea d () { segment_lock () ; // Protecting against concurrent announce or cleanup operations . Node n = find_ dead_nod e () ; i f n == null { n = Node ( b : Backend () ) ; nodes [ l ] = n ; l ++; } n . alive = true ; version ++; segme nt_unloc k () ; r e t u r n n; } 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 // Removes a node from the buffer , effectively removing it from nodes_ , // adjusting l , and changing the version . v o i d clea nup_thre ad ( Node n , Int old_version ) { segment_lock () ; // Protecting against concurrent announce or cleanup operations . <j , error > = f i n d _ n o d e _ i n _ s e g m e n t ( n ) ; i f error || n . alive || old_version != version { segm ent_unlo ck () ; return ; } nodes [ j ] = nodes [l -1]; l - -; version ++; nodes [ l ] = null ; segme nt_unloc k () ; } 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 } Listing 2 Node and segment structure for LLD and LL+ D (queue or stack) k-FIFO and a variant of Treiber stack [42] for k-Stack. Insert and remove methods operate on the segments ignoring any order of elements within the same segment. Segments used for insertion and removal are identified by insertion and removal pointers, respectively. For queues, elements are removed from the oldest segment and inserted into the mostrecent not-full segment. Upon trying to remove an element from an empty segment the segment is removed and the removal pointer advanced to the next segment. Upon trying to insert an element into a full segment a new segment is appended and the insertion pointer is advanced to this new segment. Similarly (but different) for a stack, removal and insertion operate on the most-recent segment, i.e., removal and insertion pointer are synonyms and identify the same segment at all times. Again, upon trying to remove an element from an empty segment the segment is removed and the removal pointer advanced to the next segment. Upon trying to insert an element into a full segment a new segment is prepended and the insertion pointer is set to this new segment. k-FIFO queues and k-Stacks are relaxed queues and stacks that are: (1) linearizable with respect to k-out-of-order queue and stack [23], respectively; (2) linearizable with respect to a pool [23, 28]; (3) not locally linearizable with respect to queue and stack, respectively, for k ≥ 1 since reordering elements that are inserted in the same segment (even sequentially by XX:30 Local Linearizability 1 2 3 DynamicLocallyLinearizableDQ { Segment s ; thread_local Node local_node ; 4 Node get_loca l_node ( Bool c r e a t e _ i f_ a b s e n t ) { i f ( c r e a t e _ i f _ a b s e n t ) && ( local_node == null ) { local_node = s . an n ou nc e_ t hr ea d () ; } r e t u r n local_node ; } 5 6 7 8 9 10 11 v o i d ins ( Element e ) { n = get_loca l_node ( cr e a t e _ i f _ a b s e n t : true ) ; n . backend . ins ( e ) ; } 12 13 14 15 16 Element rem () { // Fast path of retrieving an element from the thread - local backend . n = get_loca l_node ( cr e a t e _ i f _ a b s e n t : false ) ; i f n != null { <e , state > = n . backend . rem () ; i f e != null { r e t u r n e ; } } w h i l e true { retry = false ; old_version = s . version ; range = s . range () ; f o r i in range { n = s . nodes [ i ]; i f old_version != s . version { retry = true ; b r e a k ; } Bool alive = n . alive ; <e , state > = n . backend . rem () ; i f e == null { states[i] = state; i f ! alive { s . c leanup_ thread (n , old_version ) ; retry = true ; b r e a k ; } } else { r e t u r n e; } } i f retry { c o n t i n u e ; } i f old_version != s . version { c o n t i n u e ; } f o r i in range { n = s . nodes [ i ]; i f n == null || n . backend . get_state () != states [ i ] { retry = true ; break ; } } i f retry { c o n t i n u e ; } 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 r e t u r n null ; // Empty case . 55 } 56 } 57 58 // Called upon thread termination . v o i d terminate () { n = get_loca l_node ( c r e a t e _ i f _ a b s e n t : false ) ; i f n != null { n . alive = false ; } } 59 60 61 62 63 64 } Listing 3 LLD and LL+ D (queue and stack) a single thread) is allowed, see the histories (b) and (c) in the proof of Theorem 15; and (4) not sequentially consistent with respect to queue and stack, as shown by the histories (d) and (e) in the proof of Theorem 15 that are k-FIFO and k-Stack histories, respectively, for k ≥ 1. A. Haas et al. XX:31 We now present LL k-FIFO and LL k-Stack, modifications of k-FIFO and k-Stack, that enforce local linearizability by ensuring that no thread inserts more than once in a single segment. Assuming that segments are unique (by tagging pointers), LL k-FIFO remembers the last used insertion pointer per thread. For LL k-Stack the situation is more subtle as (due to the stack semantics) segments can be reached multiple times for insertion and removal. Figure 10 illustrates an example where the top segment of a k-Stack is reached multiple times by the same thread (T1 ). Since in the general case all segments could be reached multiple times by a single thread it is required to maintain the full history of each thread’s insertions. Assuming the maximum number of threads is known in advance, a bitmap is used to maintain the information in which segment a thread has already pushed a value. One can similarly implement a locally linearizable version of the Segment Queue [2]. T1 ins(1) ins(3) ins(4) ins(2) T2 rem(3) rem(2) 2 ⊥ 1 1 T1 segment state insert/remove ⊥ ⊥ 2 ⊥ 2 ⊥ 4 ⊥ 1 1 3 1 1 ⊥ Figure 10 LL k-Stack run (k = 2). T1 can only insert in uncolored segments and needs to prepend a new segment (for insertion) otherwise. G.1.1 k-FIFO Queue and LL k-FIFO Queue Pseudo Code. Listing 4 shows the pseudo code for LL k-FIFO queue. Again we highlight the code we added to the original pseudo code [28]. Similar to the locally linearizable k-Stack each thread inserts at most one element into a segment. However, in the k-FIFO queue we do not need flags in each segment to achieve this property. It is sufficient to remember the last segment used for insertion for each thread (set_last_tail; line 15). For each enqueue the algorithm checks whether the executing thread has already used this segment for enqueueing an element (get_last_tail; line 5). If the segment has already been used, the thread tries to append a new segment (effectively adding a new tail). G.1.2 Correctness Proof of LL k-FIFO Queue. Having Theorem 25, the proof of correctness of LL k-FIFO queue is easy. I Theorem 21 (Correctness of LL k-FIFO). LL k-FIFO queue presented in Listing 5 is locally linearizable. Proof. Using Theorem 25, as a first proof obligation we have to show that any history h of the LL k-FIFO queue is locally linearizable with respect to the pool sequential specification SP . This proof is analogous to the proof that any history of the LL k-Stack is locally linearizable with respect to the pool sequential specification SP , and is therefore postponed until the corresponding LL k-Stack theorem. What remains to show is that ∀x, y ∈ V. ∀i. enq(x) <ih enq(y) ∧ deq(y) ∈ h ⇒ deq(x) ∈ h ∧ deq(y) 6<h deq(x) XX:32 Local Linearizability 1 2 3 4 5 6 7 LocallyLinearizableKFIFOQueue { enqueue ( item ) : w h i l e true : tail_old = get_tail () ; i f get_last_tail ( thread_id ) == tail_old : advance_tail ( tail_old , k ) ; c o n t i n u e ; // Restart while loop . head_old = get_head () ; item_old , index = f in d _e mp ty _ sl ot ( tail_old , k ) ; i f tail_old == get_tail () : i f item_old . value == EMPTY : item_new = atomic_value ( item , item_old . version + 1) ; i f CAS (& tail_old - > segment [ index ] , item_old , item_new ) : i f committed ( tail_old , item_new , index ) : 8 9 10 11 12 13 14 set_last_tail ( thread_id , tail_old ) ; 15 r e t u r n true ; else: advance_tail ( tail_old , k ) ; 16 17 18 19 bool committed ( tail_old , item_new , index ) : i f tail_old - > segment [ index ] != item_new : r e t u r n true ; head_current = get_head () ; tail_current = get_tail () ; item_empty = atomic_value ( EMPTY , item_new . version + 1) ; i f i n _ q u e u e _ a f t e r _ h e a d ( tail_old , tail_current , head_current ) : r e t u r n true ; e l s e i f not_in_queue ( tail_old , tail_current , head_current ) : i f ! CAS (& tail_old - > segment [ index ] , item_new , item_empty ) : r e t u r n true ; e l s e : // in queue at head head_new = atomic_value ( head_current . value , head_current . version + 1) ; i f CAS (& head , head_current , head_new ) : r e t u r n true ; i f ! CAS (& tail_old - > segment [ index ] , item_new , item_empty ) : r e t u r n true ; r e t u r n false ; 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 item dequeue () : w h i l e true : head_old = get_head () ; item_old , index = find_item ( head_old , k ) ; tail_old = get_tail () ; i f head_old == get_head () : i f item_old . value != EMPTY : i f head_old . value == tail_old . value : advance_tail ( tail_old , k ) ; item_empty = atomic_value ( EMPTY , item_old . version + 1) ; i f CAS (& head_old [ index ] , item_old , item_empty ) : r e t u r n item_old . value ; else: i f head_old . value == tail_old . value && tail_old . value == get_tail () : r e t u r n null ; advance_head ( head_old , k ) ; 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 } Listing 4 Locally Linearizable k-FIFO Queue Assume enq(x) <ih enq(y). This means that x and y were enqueued by the same thread i and therefore inserted into different segments. Moreover, the segment of x is closer to the head of the list than the segment of y. A deq(y) method call can remove y only if the segment of y is the head segment. The segment of y can only become the head segment if all segments closer to the head of the list get empty. This means that also the segment of x has to become empty. Therefore there has to exist a deq(x) method call which removes x from the segment, and deq(x) 6<h deq(y). J A. Haas et al. G.1.3 k-Stack and LL k-Stack Pseudo Code. Listing 5 shows the pseudo code for LL k-Stack. The highlighted code is the code we added to the original pseudo code [23] to achieve local linearizability. The difference to the original algorithm is that a thread inserts at most one element into a segment. To achieve this property each segment in the k-stack contains a flag per thread which is set when an element is inserted into the segment (mark_segment_as_used; line 14 and line 60). If a thread encounters a segment where its flag is already set, the thread does not insert its element into that segment but tries to prepend a new segment (is_segment_marked; line 50). Otherwise the element is inserted into the existing segment and the flag of the thread in that segment is set. 1 2 LocallyLinearizableKStack { SegmentPtr top ; 3 4 5 6 v o i d init () : new_ksegment = calloc ( s i z e o f ( ksegment ) ) ; top = atomic_value ( new_ksegment , 0) ; 7 8 9 10 11 12 13 14 15 16 17 bool t r y _ a d d _ n e w _ k s e g m e n t ( top_old , item ) : i f top_old == top : new_ksegment = calloc ( s i z e o f ( ksegment ) ) ; new_ksegment - > next = top_old ; new_ksegment - > s [0] = atomic_value ( item , 0) ; // Use first slot for item . top_new = atomic_value ( new_ksegment , top_old . ver +1) ; m a r k _ s e g m e n t _ a s _ u s e d ( top_new ) ; i f CAS (& top , top_old , top_new ) : r e t u r n true ; r e t u r n false ; 18 19 20 21 22 23 24 25 26 27 v o i d t r y _ r e m o v e _ k s e g m e n t ( top_old ) : i f top_old == top : i f top_old - > next != null : a t o m i c _ i n c r e me n t (& top_old - > remove ) ; i f empty ( top_old ) : top_new = atomic_value ( top_old - > next , top_old . ver +1) ; i f CAS (& top , top_old , top_new ) : return ; a t o m i c _ d e c r e me n t (& top_old - > remove ) ; 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 bool committed ( top_old , item_new , index ) : i f top_old - > s [ index ] != item_new : r e t u r n true ; e l s e i f top_old - > remove == 0: r e t u r n true ; e l s e : // top_old - > remove >= 1 item_empty = atomic_value ( EMPTY , item_new . ver +1) ; i f top_old != top : i f ! CAS (& top_old - > s [ index ] , item_new , item_empty ) : r e t u r n true ; else: top_new = atomic_value ( top_old . val , top_old . ver +1) ; i f CAS (& top , top_old , top_new ) : r e t u r n true ; i f ! CAS (& top_old - > s [ index ] , item_new , item_empty ) : r e t u r n true ; r e t u r n false ; 46 47 48 49 50 51 52 53 54 55 56 57 58 59 v o i d push ( item ) : w h i l e true : top_old = top ; i f s e g m e n t _ i s _ m a r k e d ( top_old ) : i f t r y _ a d d _ n e w _ k s e g m e n t ( top_old , item ) ; r e t u r n true ; c o n t i n u e ; // Restart while loop . item_old , index = f i nd _e mp t y_ sl ot ( top_old ) ; i f top_old == top : i f item_old . val == EMPTY : item_new = atomic_value ( item , item_old . ver +1) ; i f CAS (& top_old - > s [ index ] , item_old , item_new ) : i f committed ( top_old , item_new , index ) : XX:33 XX:34 Local Linearizability m a r k _ s e g m e n t _ a s _ u s e d ( old_top ) ; 60 r e t u r n true ; 61 else: i f t r y _ a d d _ n e w _ k s e g m e n t ( top_old , item ) : r e t u r n true ; 62 63 64 65 item pop () : w h i l e true : top_old = top ; item_old , index = find_item ( top_old ) ; i f top_old == top : i f item_old . val != EMPTY : item_empty = atomic_value ( EMPTY , item_old . ver +1) ; i f CAS (& top_old - > s [ index ] , item_old , item_empty ) : r e t u r n item_old . val ; else: i f only_ksegment ( top_old ) : i f empty ( top_old ) : i f top_old == top : r e t u r n null ; else: t r y _ r e m o v e _ k s e g m e n t ( top_old ) ; 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 } Listing 5 Locally Linearizable k-Stack G.1.4 Correctness Proof of LL k-Stack. The local linearizability proof of LL k-Stack is more involved, but very interesting. We use a theorem from the published artifact of [14], which has been mechanically proved in the Isabelle HOL theorem prover. I Theorem 22 (Empty Returns for Stack). Let h be a history, and let h0 be the projection of h to Σ \ pop(empty). If h is linearizable with respect to the sequential specification SP of a pool (see Definition 2), and h0 is linearizable with respect to the sequential specification SS of a stack (see Definition 2), then h is linearizable with respect to SS . Proof. Here we repeat the key insights of the proof and leave out technical details. A complete and mechanized version of the proof is available in the published artifact of [14]. As h is linearizable with respect to SP , and h0 is linearizable with respect to SS , there exists a sequential history s ∈ SP such that s is a linearization of h, and there exists a sequential history s0 ∈ SS such that s0 is a linearization of h0 . We show that we can construct a sequential history t ∈ SS such that t is a linearization of h. The linearization t is constructed as follows: the position of pop(empty) in s is preserved in t. This means for any method call m ∈ s that if pop(empty) ≺s m, then also pop(empty) ≺t m, and if m ≺s pop(empty), then also m ≺t pop(empty). Moreover, if two method calls m, n ∈ s are ordered as m ≺s pop(empty) ≺s n and therefore by transitivity it holds that m ≺s n, then also m ≺t n. For all other method calls the order of s0 is preserved. This means for any two method calls m, n ∈ s with m ≺s0 n, that if for all pop(empty) it holds that pop(empty) ≺s m if and only if pop(empty) ≺s n, then m ≺t n. By construction, the history t is sequential and a permutation of h. Next we show that t is a linearization of h by showing that t preserves the precedence order of h. Also by construction, it holds that if m ≺t n for any two method calls m, n ∈ t, then also either m ≺s n or m ≺s0 n. Both s and s0 are linearizations of h and h0 , respectively. Therefore it cannot be for any m, n with m <h n that n ≺s m or n ≺s0 m, it can also not be that n ≺t m. Since t is sequential, this means that t preserves the precedence order of h. Next we show that t ∈ SP according to Definition 2: A. Haas et al. (1) Every method call, but pop(empty), appears in s at most once: This is guaranteed since t is a permutation of s, and s ∈ SP . (2) If pop(x) appears in t, then also push(x) does and push(x) ≺t pop(x): again, since t is a permutation of s and s ∈ SP , if pop(x) ∈ t, then also push(x) ∈ t. Since push(x) ≺s pop(x) and push(x) ≺s0 pop(x) (because both s and s0 are in SP ) it also holds that push(x) ≺t pop(x), as we argued already above. (3) ∀x ∈ V. push(x) ≺t pop(empty) ⇒ pop(x) ≺t pop(empty): this property is satisfied trivially as all pop(empty) operations are ordered the same in t as in s, and s ∈ SP . It only remains to check that all elements are removed in a stack fashion. We have to show the following: ∀x, y ∈ V. push(x) ≺t push(y) ≺t pop(x) ⇒ pop(y) ∈ t ∧ pop(y) ≺t pop(x) First we show that if push(x) ≺t push(y) ≺t pop(x), then also push(x) ≺s0 push(y) ≺s0 pop(x). We do this by showing that there cannot exist a pop(empty) such that push(x) ≺t pop(empty) ≺t push(y) or push(y) ≺t pop(empty) ≺t pop(x). Assume, towards a contradiction, push(x) ≺t pop(empty) ≺t push(y). By the transitivity of ≺t this implies that push(x) ≺t pop(empty) ≺t pop(x), which contradicts our observation above that t ∈ SP . Therefore push(x) ≺t pop(empty) ≺t push(y) is not possible, and for the same reason also push(y) ≺t pop(empty) ≺t pop(x) is not possible. Now, as s0 ∈ SS and push(x) ≺s0 push(y) ≺s0 pop(x), there has to exist a pop(y) ∈ s0 with pop(y) ≺s0 pop(x). For the same reason as above it cannot be that pop(x) ≺s pop(empty) ≺s pop(y). Therefore pop(y) and pop(x) are ordered in t the same as in s0 , i.e. pop(y) ≺t pop(x), and therefore t ∈ SS . J I Theorem 23 (Correctness of LL k-Stack). The LL k-Stack algorithm presented in Listing 5 is locally linearizable. Proof. We have to show that every history h of LL k-Stack is locally linearizable with respect to the sequential specification SS defined in Definition 2. This means that we have to show that every thread-induced history hi of h is linearizable with respect to SS for any thread i. Having Theorem 22 we only have to show that hi is linearizable with respect to the sequential specification SP of a pool (defined in Definition 2), and that h0 i , the projection of hi to Σ \ pop(empty), is linearizable with respect to the sequential specification SS of a stack. We start with the proof that hi is linearizable with respect to SP . We construct a sequential history si from hi by identifying the linearization points of the push and pop method calls of the LL k-Stack. This means that two method calls m, n are ordered in si , m ≺si n if the linearization point of m is executed before the linearization point of n in hi . The linearization point of push method calls is either the successful insertion of a new segment in line 15, or the last successful CAS which writes the element into a segment slot in line 58. The linearization point of pop method calls is the successful CAS which removes an element from its segment slot in line 73. For the linearization point of pop(empty) we take the linearization point of the call to empty in line 77. The empty method creates an atomic snapshot [25] of the top segment. This atomic snapshot is the state of the top segment at some point (i.e. linearization point of empty) within the execution of empty. If empty returns true, then there exists no element in the atomic snapshot of the segment. XX:35 XX:36 Local Linearizability Next we show that si is in SP as defined in Definition 2. (1) Since there exists exactly one linearization point per method call, every method call, but rem(empty), appears in si at most once. (2) If pop(x) appears in si , then it reads x in a slot of the top segment before its linearization point. Since only push method calls write their elements into segment slots, there has to exist a push(x) which wrote x into that slot. Therefore the linearization point of push(x) is always before the linearization point of pop(x), and therefore push(x) ≺si pop(x). (3) Segments are only removed from the list of segments when they become empty. The call to committed guarantees that elements are not inserted into segments which are about to be removed. A pop method calls empty only if there is a single segment left in the LL k-Stack and no element was found in that segment in find_item. Now assume a push(x) method call inserts an element x which is missed by find_item. If push(x) wrote x into a segment before the linearization point of pop(empty) and the segment was not the last segment, then the top segment changed since pop(empty) searched for an element and therefore the check in line 70 would fail. If push(x) wrote x into the last segment of the LL k-Stack, then a pop(x) method call removed x from the segment because otherwise x would be in the atomic snapshot of empty and therefore empty would return false. Therefore, if push(x) ≺si pop(empty), then also pop(x) ≺si pop(empty). Therefore si is in the sequential specification SP of a pool. Next we show that h0 i is linearizable with respect to SS . We construct again a sequential history s0 i from h0 i by identifying the linearization points of the push and pop method calls of LL k-Stack. The linearization point of the push operations is the successful insertion of a new segment in line 15 if it is executed, or the reading of the empty slot (line 54) in the last (and therefore successful) iteration of the main loop. The linearization point of a pop operation is the reading of a non-empty slot (line 69) in the last (and therefore successful) iteration of the main loop. There do not exist any pop(empty) method calls in s0 i . Since we assume a sequentially consistent memory model, these read operations define a total order on the LL k-Stack method calls in h0 i . First we show that s0 i is in the sequential specification SP of a pool as defined in Definition 2. (1) Since there exists exactly one linearization point per method call, every method call appears in s0 i at most once. (2) If pop(x) appears in s0 i , then it read x in a slot of the top segment at its linearization point. Since only push operations write their elements into segment slots, there has to exist a push(x) which wrote x into that slot. The linearization point of push(x) is always before x is written into a segment slot. Therefore push(x) ≺s0 i pop(x). (3) Since there exist no pop(empty) operations in s0 i the third pool condition is trivially correct. Next we show that s0 i also provides a stack order, which means that we have to show that ∀x, y ∈ V. push(x) ≺s0 i push(y) ≺s0 i pop(x) ⇒ pop(y) ∈ s0 i ∧ pop(y) ≺s0 i pop(x). We start by observing some invariants. A. Haas et al. 1. A thread never inserts elements into the same segment twice. This is guaranteed by the call to segment_is_marked. 2. Between the linearization point of a push and the time it writes its element into a segment the segment the element gets written into is not removed: if the push operation inserts a new segment this is trivially correct. If the push operation writes the element into an existing segment, then the call to committed in line 59 guarantees that the segment was not removed. 3. At the time of the linearization point of the pop, which is the time when the pop reads the non-empty slot (line 69) in the last (and therefore successful) iteration, the pop reads the non-empty slot from the top segment. This is guaranteed by the check in line 70. Now assume there exist the operations push(x), push(y) and pop(x) in s0 i and push(x) ≺s0 i push(y) ≺s0 i pop(x). Since push(x) and push(y) are both in s0 i , this means that both operations are executed by the same thread. Therefore, according to Invariant 1., x and y get inserted into different segments, with the segment y on top of the segment of x. The linearization point of pop(x) cannot be before y is written into its segment because according to Invariant 2. the segment y gets inserted into does not get removed between the linearization point of push(y) and the time y is written into the segment. With Invariant 3. this means that x is unaccessible for pop(x) before y gets written into a segment. Also because of the third invariant the top segment changes between the insertion of y and the linearization point of pop(x). Next we observe that as long as y is not removed, no segment below the segment of y can become the top segment. Therefore for the segment of x to become the top segment so that pop(x) can remove it, y has to be removed first. Only a pop(y) can remove y, and therefore there exists a pop(y) and the linearization point of pop(y) is before the linearization point of pop(x). Hence s0i is in the sequential specification of a stack. Using Theorem 22 this means that LL k-Stack in listing 5 is locally-linearizable with respect to the sequential specification of a stack. J H Additional Experiments We also evaluate the implementations on another Scal workload, the sequential alternating workload. However, we note that in this workload in the locally linearizable implementations threads only access their local backends, so no wonder they perform perfectly well. Mixed Workload. In order to evaluate the performance and scalability of mixed workloads, i.e., workloads where threads produce and consume values, we exercise the so-called sequential alternating workload in Scal. Each thread is configured to execute 106 pairs of insert and remove operations, i.e., each insert operation is followed by a remove operation. As in the producer-consumer workload, the contention is controlled by adding a busy wait of 5µs. The number of threads is configured to range between 1 and 80. Again we report the number of data structure operations per second. Data structures that require parameters to be set are configured like in the producerconsumer benchmark. Figure 11 shows the results of the mixed workload benchmark for all considered data structures. The MS queue and Treiber stack do not perform and scale for more than 10 threads. As in the producer-consumer benchmark, LCRQ and TS Stack either perform competitively XX:37 32 28 24 20 16 12 8 4 0 1 10 20 30 40 50 60 70 80 million operations per sec (more is better) Local Linearizability million operations per sec (more is better) XX:38 32 28 24 20 16 12 8 4 0 1 10 20 30 40 50 60 70 80 number of threads number of threads MS LCRQ k-FIFO LL+D MS LLD LCRQ LLD k-FIFO 1-RA DQ Queues, LL queues, and “queue-like” pools Treiber TS Stack k-Stack LL+D Treiber LLD TS Stack LLD k-Stack 1-RA DS Stacks, LL stacks, and “stack-like” pools Figure 11 Performance and scalability of sequential alternating microbenchmarks with an increasing number of threads on a 40-core (2 hyperthreads per core) machine with their k-out-of-order relaxed counter parts k-FIFO and k-Stack or even outperform and outscale them (in the case of LCRQ, that even outperforms the pool). LL+ D MS queue, LLD LCRQ, and LL+ D Treiber stack perform very well and scale (nearly) linearly in the number of threads. A surprising result is that LLD k-FIFO performs poorly in this experiment. The reason is that k-FIFO performs poorly when it is almost empty, and in this experiment each backend instance of LLD k-FIFO contains at most one element at any point in time. The k-Stack performs better on a nearly-empty state. The benefit of trying to perform a local operation first in the LLD algorithms is visible when comparing to 1-RA DQ and DS that do not utilize a local fast path. I Verifying Local Linearizability In general, verifying local linearizability amounts to verifying linearizability for a set of smaller histories. This might enable verification in a modular/compositional way. Aside from this, it is important to mention (again) that for our locally linearizable data structures in Section 6 built from linearizable building blocks, the correctness proofs are straightforward assuming the building blocks are proven to be linearizable. In addition, for queue we can state an “axiomatic" verification theorem for local linearizability in the style of [24, 10], whose main theorem we recall next (with a slight reformulation). I Theorem 24 (Queue Linearizability). A queue concurrent history h is linearizable wrt the queue sequential specification SQ if and only if 1. h is linearizable wrt the pool sequential specification SP (with suitable renaming of method calls), and 2. ∀x, y ∈ V. enq(x) <h enq(y) ∧ deq(y) ∈ h ⇒ deq(x) ∈ h ∧ deq(y) 6<h deq(x). J We note that an analogous change to the axioms in the sequential specification of a pool and a stack does not lead to a characterisation of linearizability for pools and stacks, cf. [14]. An axiomatic characterisation of linearizability for pools and stacks would involve an infinite number of axioms/infinite axioms, due to the need to prohibit infinitely many problematic shapes, cf. [7]. We are now able to state the queue-local-linearizability-verification result. A. Haas et al. I Theorem 25 (Queue Local Linearizability). A queue concurrent history h is locally linearizable wrt the queue sequential specification SQ if and only if 1. h is locally linearizable wrt the pool sequential specification SP (after suitable renaming of method calls), and 2. ∀x, y ∈ V. ∀T. enq(x) <Th enq(y) ∧ deq(y) ∈ h ⇒ deq(x) ∈ h ∧ deq(y) 6<h deq(x). J XX:39
6cs.PL
Simulating the Dynamics of T Cell Subsets Throughout the Lifetime Stephanie Foan, Andrew Jackson, Ian Spendlove, Uwe Aickelin Academic Unit of Clinical Oncology and Intelligent Modelling and Analysis Research Group, University of Nottingham Abstract. It is widely accepted that the immune system undergoes age-related changes correlating with increased disease in the elderly. T cell subsets have been implicated. The aim of this work is firstly to implement and validate a simulation of T regulatory cell (Treg) dynamics throughout the lifetime, based on a model by Baltcheva. We show that our initial simulation produces an inversion between precursor and mature Treys at around 20 years of age, though the output differs significantly from the original laboratory dataset. Secondly, this report discusses development of the model to incorporate new data from a cross-sectional study of healthy blood donors addressing balance between Treys and Th17 cells with novel markers for Treg. The potential for simulation to add insight into immune aging is discussed. 1 Introduction to System Dynamics Modelling of Immunity Simulation has been defined as methods and applications mimicking the behaviour of a real system [1]. The benefits of simulation to immunology include time- and costeffectiveness as well as less labour- and resource-intensiveness resulting from removal from the biological environment. In vitro experimentation is useful for investigating individual interactions but is far removed from the whole picture, and in vivo experimentation is useful for the whole picture but is unlikely to answer specific questions [2]. Using simulation, flexibility is available for systematically generating hypotheses and conducting experiments impossible to do practically, yet informed by robust data and literature. System dynamics simulations are useful for looking at complex systems over time. They are characterised by stocks of an entity and flows between stocks [3]. Immune system examples of stocks include precursor and mature T cell pools and flows might represent transition of cells from precursor to mature. This technique is useful for modelling relationships defined by differential equations. An example of a differential equation describing T cell dynamics is the change in number of precursor cells equated to proliferation of precursors minus death and maturation rates. This ongoing work will apply system dynamics simulation technique to complement in vitro studies of Th 17s and Treg s throughout the lifetime. 2 The Need for Balance: Th 17s and Treys Throughout the Lifetime The immune system maintains a balance between mounting an adequate immune response to protect from infection and restricting the size of the immune response to 2 prevent damage to self. There is evidence to suggest an age-related tendency to a proinflammatory environment [4] contributing to more collateral damage and autoimmune diseases. This work addresses the hypothesis that important contributors to this state of imbalance are Th17 cells (amplifying immune responses) and Tregs (dampening down immune responses). Although some studies have shown an age-related increase in the number of Tregs in human peripheral blood [5][6], it has also been shown that homeostasis is maintained [7]. One study concluded upon the oscillatory nature of Treg numbers through life, with peaks in adolescence and in over 60 year olds [8]. A recent study in Th17 cells with age showed a small decrease in the frequency of Th17 cells in the CD4+ memory population in elderly donors relative to young [9]. However, for the balance between Tregs and Th17 cells, there is currently no published literature. There is evidence that the balance between Tregs and Th 17s is altered in agerelated diseases such as acute coronary syndrome [10]. Thus it is intuitive that this balance should be examined with a cross sectional study in healthy donors of different ages. Laboratory experimentation will begin by using flow cytometry to enumerate peripheral blood cells expressing CD4, CD25 and signature transcription factors of these subsets: Foxp3 and Helios for Tregs and RORC for Th17 cells. 3 Method: Simulation of Treg Dynamics Ultimately we wish to build a model of the dynamics of Tregs and Th17 cells throughout life from data currently being collected. Preliminary work for this has involved building a system dynamics simulation in AnyLogic 6.5.0 University Edition, based on a mathematical model by Baltcheva [11]. This model was selected as it comprehensively incorporates the functional dynamics of Tregs in terms of homeostasis and during an acute immune response. It characterises the changing precursor and mature Treg populations throughout the human lifetime. Key assumptions include that there is no change in function or responsiveness throughout the lifetime, nor a change to other influential factors on their dynamics such as dendritic cell number and function [11]. Also, the immune response considered includes an expansion and contraction phase, and only one response can occur at a given timepoint [11]. The original model was based on numbers of CD4+CD25±CD45R0— (precursor) and CD4+CD25±CD45R0+ (mature) populations in 119 peripheral blood samples of donors aged 19 to 81 [11]. Although total numbers of CD4+CD25+ cells remained constant, the ratio of precursor to mature was inverted in early adulthood. This represents an important dimension to the observed homeostasis in Treg numbers throughout the lifespan, especially when considering thymic involution from adolescence, reducing the number of new cells entering the system. Ordinary differential equations describe the dynamics of the above mentioned cells, and stochastic processes control the frequency, duration and antigen-specific nature of primary and secondary immune responses on the different cell compartments [11]. In this work, a simple scenario was chosen in order to test the hypothesis that the model could be implemented in AnyLogic. The scenario assumes a lack of antigen-induced proliferation and death of both precursor and mature Tregs, no density-dependent proliferation and death and thymic output as the only external input into the various Treg 3 subsets [11]. The parameter values used correspond to means of the distributions for scenario 2iiia given in Baltcheva's work [11]. The simulation is shown below: 0 immuneResponse [..] Day OF Year gPt Oh o„ , YdoneP ) Pp [=] gQt .gp,, sigm aQ a [01. _________ [o] hQ gQt1 sigmaP 3 piN hP QuiescentReactivation PreoursorActivaton C. alpha YdoneR .Ez1- -- • YdoneQ dP PreoursorDeath [0] [Yr Rh PreoursorProlf ation ActlyeProlf eration aP [ aR [_] [2:] ActiveDeath ActivetoQuescent QuiescentDeath e, dQ g dR Figure 1: Main View. Events are shown with for time in days (t) and years (y). Flow variables given by [z] involve a rate of conversion multiplied by the number of cells in the stocks named Y cloneP, —R and —Q. P corresponds to precursors, R to active matures and Q to quiescent matures. These stocks are prefixed by Y clone as they represent total and antigen-specific Tregs determined by an array. Homeostatic parameters apply to the total Treg population, whereas immune response parameters are applied to a proportion given by piN. For example, flow of specific precursors into the active mature stock is given by specific precursor stock multiplied by the maturation rate. Each time point, AnyLogic recalculates each stock using the flows defined. An additional class (immuneResponse) controls the immune system functional status using IRstatechart: qt IRstatechart _ NoPesponse Day K2 Year e,th °t 0Y gr K1 Figure 2: immuneResponse View. At the beginning of a run the immune system is in the N °Response state. Every 100.95 time steps, the immune system mounts a primary immune response with probability qt or defaults to a secondary response. Primaryl and Secondaryl, represent the expansion phase. PrimaryI I and SecondaryI I, represent the contraction phase which continues until a new response is instigated. During Primaryl, parameter b is applied. During Primaryll, b is set to zero and parame- 4 ters c, dR and dQ are applied. In Secondary) parameters b and f are applied and in SecondaryI I these are set to zero and c, dR and dQ are applied. 25 2 5 Total Precursors Total Quiescent Matures fl h l d 1 1 1 1 0 1 1 1 1 1 - 0 1 1 1 0 1 1 I 1 1 0 20 GO BO 100 120 GO Ag e ( Ye a rs) Age (Years) 80 100 Figure 3 (generated using MATLAB 122010a): Output data from AnyLogic over a complete run. a) Total precursor and quiescent mature Trey stocks. b) Total active Tregs. Each peak corresponds to antigen-specific clones experiencing either primary or secondary immune responses. Figure 4 shows simulation output compared to the original dataset. Data has been collected for each stock over 3 complete replications. The maximum standard deviation between three runs for the total precursors was 2.753x10 -7. The maximum standard deviation for total quiescent matures was 9411. 08 09 08 06 0 5 01 20 40 GO Age (Years) 80 100 120 0 4 0 3 0 2 20 40 GO 80 100 120 Age (Years) Figure 4: Output data compared to Baltcheva's dataset. a) The proportion of total Tregs in the precursor stock. b) The proportion of total Tregs in the quiescent stock. In order to quantify how similar the simulation output was to the laboratory data, both datasets were split into 10-year age groups. The median was calculated for these groups, and the difference between medians for simulation output data and laboratory data have been documented below. A Mann Whitney test was then performed for the null hypothesis of no difference between laboratory and output data and the p values are given below: 5 Age (Years) 10-19 20-29 30-39 40-49 50-59 60-69 70-79 80-89 Median Difference Mann Whitney Test Proportion of Proportion of Proportion of Proportion of Precursors Matures Precursors Matures 0.3101 0.0207 p=0.083 p=0.658 0.0525 0.1092 p<0.001 p<0.001 0.1227 0.0290 p=0.034 p<0.001 0.1182 0.0690 p=0.001 p<0.001 0.0587 0.1007 p<0.001 p<0.001 0.1230 p=0.127 0.0072 p<0.001 0.0011 0.1204 p=0.808 p<0.001 p=0.014 0.0805 0.0775 p=0.014 Table 1: Comparison of median output and laboratory data for each 10-year age group. 4 Discussion and Concluding Remarks The implementation of Baltcheva's model as a system dynamics simulation has been documented here and compared to experimental evidence. It has been shown that the simulation mimics the key feature of inversion of precursor and memory cells in early adulthood. The lack of statistical similarity between simulation output and laboratory data indicates that further validation of this model is necessary and will involve a comparison of other scenarios proposed in Baltcheva's work. Ultimately we will develop and validate a simulation of our novel dataset of Treg and Th17 cells using this sort of approach. CD4+CD25±Foxp3+ and CD4±Foxp3±Helios+ cell numbers instead of CD4+CD25+ s for Treg s will also be collected as they are arguably more specific markers [12][13]. In terms of improving the simulation, alternatives to continually reactivating a single Treg clone are required, as is simulation of more than one immune stimulus at a time. Baltcheva discloses various assumptions including no difference in Treg function [11]. It may be possible to improve this model by considering functional as well as numerical changes to Treg subsets with age. A more abstract research question is whether a simplistic model of immunosenescence can lend useful insight into the biological problem. It can be argued that the process of simulation alone might allow researchers to address assumptions and allow for systematic generation of hypotheses. Also, hypotheses which are difficult to test in the laboratory might be testable with a simulation. For example, we might introduce an intervention to mimic ablative chemotherapy by depleting each stock at a single time point. Total values of each stock might then be compared for simulation runs with or without intervention to make hypotheses about Treg recovery. Simulating the dynamics of Th17 cells in parallel to Treg s may also allow us to make predictions about the maintenance of their balance throughout life, would allow for extreme parameter values to be tested and may indicate a maximum length of time for homeostasis to be maintained. Our primary hypothesis is that age alters Treg and Th17 cells with consequences for health in older age and we aim to conduct a cross sectional study to obtain the distribution of particular changes. We anticipate that a strategy of both laboratory investigation 6 and system dynamics simulation as exemplified by Baltcheva's work will be useful to address relationships between T cell subsets over time. The model might also be developed to consider new questions about response to interventions and the length of time the immune system might be able to maintain Treg and Th17 cell homeostasis. With thanks to Irina Baltcheva for providing her raw data. References 1. Kelton, W.D., Sadowski, R.P., Swets, N.B.: Simulation with Arena: 5th Edition. McGraw-Hill International Edition (2010) 2. Kim, P.S., Levy, D., Lee, P.P.: Modeling and Simulation of the Immune System as a Self-Regulating Network. Volume 467 of Methods in Enzymology. Academic Press (2009) 79 —109 3. Figueredo, G.P., Aickelin, U.: Investigating immune system aging: System dynamics and agent-based modelling. In: Proceedings of the Summer Computer Simulation Conference 2010. (2010) 4. Boren, E., Gershwin, M.E.: Inflamm-aging: Autoimmunity, and the Immune-Risk Phenotype. Autoimmunity Reviews 3 (2004) 401-406 5. Rosenkranz, D., Weyer, S., Tolosa, E., Gaenslen, A., Berg, D., Leyhe, T., Gasser, T., Stoltze, L.: Higher Frequency of Regulatory T Cells in the Elderly and Increased Suppressive Activity in Neurodegeneration. Journal of Neuroimmunology 188 (2007) 117-127 6. Gregg, R., Smith, C.M., Clark, EJ., Dunnion, D., Khan, N., Chakraverty, R., Nayak, L., Moss, P.A.: The Number of Human Peripheral Blood CD4+ CD251"gh Regulatory T Cells Increases with Age. Clinical and Experimental Immunology 140 (2005) 540-546 7. Hwang, K.A., Kim, H.R., Kang, I.: Aging and Human CD4+ Regulatory T Cells. Clinical Immunology 130 (2009) 509-517 8. Faria, A.M., de Moraes, S.M., de Freitas, L.H., Speziali, E., Soares, T.F., FigueiredoNeves, S.P., Vitelli-Avelar, D.M., Martins, M.A., Barbosa, K.V., Soares, E.B., SathlerAvelar, R., Peruhype-Magalhaes, V., Cardoso, G.M., Comin, E, Teixeira, R., Eloi-Santos, S.M., Queiroz, D.M., Correa-Oliveira, R., Bauer, M.E., Teixeira-Carvalho, A., MartinsFilho, 0.A.: Variation Rhythms of Lymphocyte Subsets During Healthy Aging. Neuroimmunomodulation 15 (2008) 365-379 9. Lee, J.S., Lee, W.W., Kim, S.H., Kang, Y., Lee, N., Shin, M.S., Kang, S.W., Kang, I.: Ageassociated alteration in naive and memory th17 cell response in humans. Clinical Immunology In Press, Corrected Proof (2011) — 10. Li, Q., Wang, Y., Chen, K., Zhou, Q., Wei, W., Wang, Y., Wang, Y.: The Role of Oxidized Low-Density Lipoprotein in Breaking Peripheral Th17/Treg Balance in Patients with Acute Coronary Syndrome. Biochemical and Biophysical Research Communications 394 (2010) 836-842 11. Baltcheva, I., Codarri, L., Pantaleo, G., Boudec, J.Y.L.: Lifelong Dynamics of Human CD4+CD25+ Regulatory T Cells: Insights from in vivo Data and Mathematical Modeling. Journal of Theoretical Biology 266 (2010) 307-322 12. Thornton, A.M., Korty, P.E., Tran, D.Q., Wohlfert, E.A., Murray, P.E., Belkaid, Y., Shevach, E.M.: Expression of Helios, an Ikaros Transcription Factor Family Member, Differentiates Thymic-Derived from Peripherally Induced Foxp3+ T Regulatory Cells. The Journal of Immunology 184 (2010) 3433-3441 13. Ziegler, S.F., Buckner, J.H.: Foxp3 and the Regulation of Treg/Th17 Differentiation. Microbes and Infection 11 (2009) 594-598
5cs.CE
UNIFORM NULL CONTROLLABILITY FOR A DEGENERATING REACTION-DIFFUSION SYSTEM APPROXIMATING A SIMPLIFIED CARDIAC MODEL arXiv:1106.1788v6 [math.OC] 25 Sep 2015 FELIPE WALLISON CHAVES-SILVA∗ AND MOSTAFA BENDAHMANE Abstract. This paper is devoted to the analysis of the uniform null controllability for a family of nonlinear reaction-diffusion systems approximating a parabolic-elliptic system which models the electrical activity of the heart. The uniform, with respect to the degenerating parameter, null controllability of the approximating system by means of a single control is shown. The proof is based on the combination of Carleman estimates and weighted energy inequalities. 1. Introduction Let Ω ⊂ RN (N = 2, 3) be a bounded connected open set whose boundary, ∂Ω, is sufficiently regular. Let T > 0, and let ω and O be two (small) nonempty subsets of Ω, which we will refer to as control domains. We will use the notation Q = Ω × (0, T ) and Σ = ∂Ω × (0, T ). The main objective of this paper is to study the properties of controllability and observability for a family of nonlinear reaction-diffusion systems which degenerates into a nonlinear parabolic-elliptic system which models the electrical activity in the cardiac tissue. To state the model, we let ui = ui (t, x) and ue = ue (t, x) represent the intracellular and extracellular electric potentials, respectively. Their difference, v = ui − ue , is called the transmembrane potential. The anisotropic properties of the media are modeled by intracellular and extracellular conductivity tensors Mi (x) and Me (x). The widely accepted model (see [11, 22, 35]) describing the electrical activity in the cardiac tissue reads as follows:  cm ∂t v − div (Mi (x)∇ui ) + h(v) = f 1ω in Q, (1.1) cm ∂t v + div (Me (x)∇ue ) + h(v) = g1O in Q, where cm > 0 is the surface capacitance of the membrane, the nonlinear function h : R → R is the transmembrane ionic current (the most interesting case being when h is a cubic polynomial), and f and g are stimulation currents applied, respectively, to ω and O. System (1.1) is known as the bidomain model and is completed with Dirichlet boundary conditions for the intra- and extracellular electric potentials ui = ue = 0 on Σ (1.2) 2010 Mathematics Subject Classification. 35K57, 93B05, 93B07, 93C10. Key words and phrases. reaction-diffusion system, monodomain model, Carleman estimates, uniform null controllability, observability. ∗ F. W. Chaves-Silva has been supported by the ERC project Semi Classical Analysis of Partial Differential Equations, ERC-2012-ADG, project number 320845; the Grant BFI-2011-424 of the Basque Government and partially supported by the Grant MTM2011-29306-C02-00 of the MICINN, Spain, the ERC Advanced Grant FP7-246775 NUMERIWAVES, ESF Research Networking Programme OPTPDE and the Grant PI2010-04 of the Basque Government. 1 2 F. W. CHAVES-SILVA AND M. BENDAHMANE and initial data for the transmembrane potential v(0, x) = v0 (x), x ∈ Ω. (1.3) We point out that realistic models describing electrical activities in the heart also include a system of ODE’s for computing the ionic current as a function of the transmembrane potential and a series of additional “gating variables” which aim to model the ionic transfer across the cell membrane (see [23, 25, 31, 32]). In the case where f 1ω = g1O and Mi = µMe , for some constant µ ∈ R, the bidomain model is simplified into the following parabolic-elliptic system:   µ in Q,  cm ∂t v − µ+1 div  Me (x)∇v + h(v) = f 1ω  −div M(x)∇u = div M (x)∇v in Q, e i (1.4)  v = ue = 0 on Σ,    v(0) = v0 in Ω, where M = Mi + Me . System (1.4) is known as monodomain model and is a very interesting model from the implementation point of view, since it conserves some of the essential features of the bidomain model as excitability phenomena (see [11, 27, 36]). The main difference between the bidomain model (1.1) and the monodomain model (1.4) is the fact that the first model is a system of two coupled parabolic equations, while the second one is a system of parabolic-elliptic type. Therefore, from the control point of view, one could expect these two systems to have, at least a priori, different control properties. In this work we show that the properties of controllability and observability for the monodomain model can be seen as a limit process of the controllability properties of a family of coupled parabolic systems. Indeed, given ε ∈ R such that 0 < ε ≤ 1, we approximate the monodomain model by the following family of parabolic systems:   µ ε ε + h(v ε ) = f ε 1ω in Q,  cm ∂t v − µ+1 div Me (x)∇v   ε∂ uε − div M(x)∇uε = div M (x)∇v ε  in Q, t e i e (1.5) ε ε  on Σ, v = ue = 0    ε in Ω. v (0) = v0 , uεe (0) = ue,0 In this paper we give a positive answer to the following question: Question 1.1. If, for each ε > 0, there exists a control f ε that drives the solution (v ε , uεe ) of (1.5) to zero at time t = T , i.e., v ε (T ) = uεe (T ) = 0, is it true that, when ε → 0+ , the control sequence {f ε }ε>0 converges to a function f which drives the associated solution (v, ue ) of (1.4) to zero at time t = T ? This question of approximating an equation by another having different physical properties has been used several times in the case of parabolic equations degenerating into hyperbolic ones (see, for example, [12, 16, 21]) and hyperbolic equations degenerating into parabolic ones (see, for example, [29, 30]). However, as far as we know, this is the first time that controllability of parabolic systems degenerating into parabolic-elliptic systems is studied. It is also important to mention that families of parabolic systems which degenerate into parabolic-elliptic ones arise in many areas, such as biology, chemistry and astrophysics (see [9, 10, 26]). UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 3 As usual, in control theory, when dealing with the controllability of a nonlinear problem, we first consider the linearized version of (1.5):   µ div Me (x)∇v ε + a(t, x)v ε = f ε 1ω in Q, cm ∂t v ε − µ+1     ε∂ uε − div M(x)∇uε = div M (x)∇v ε  in Q, t e i e (1.6) ε ε  v = u = 0 on Σ,  e   ε v (0) = v0 , uεe (0) = ue,0 in Ω, where a is a bounded function. Given ε > 0, the first obstacle to answering, positively, Question 1.1, will be to drive (v ε , uεe ), solution of (1.6), to zero at time T by means of a control f ε in such a way that the sequence of controls {f ε }ε>0 converges when ε → 0+ . Once it is shown that such a convergent sequence of control, {f ε }ε>0 , for the linear system (1.6), exists, we employ a fixed point argument and conclude that the same is true for the nonlinear system (1.5). Thus, we introduce the adjoint system of (1.6):  µ div (Me (x)∇ϕε ) + a(t, x)ϕε = div (Mi (x)∇ϕεe ) in Q, −cm ∂t ϕε − µ+1    −ε∂ ϕε − div (M (x)∇ϕε ) = 0 in Q, t e e (1.7) ε ε  ϕ = ϕ = 0 on Σ,  e   ε in Ω. ϕ (T ) = ϕT , ϕεe (T ) = ϕe,T Using duality arguments, it is very easy to prove that the task of building such a convergent sequence of controls, {f ε }ε>0 , for (1.6) is equivalent to prove the following (uniform) observability inequality for the solutions of (1.7): ZZ ||ϕε (0)||2L2 (Ω) + ε||ϕεe (0)||2L2 (Ω) ≤ C |ϕε |2 dxdt, Qω := ω × (0, T ), (1.8) Qω where (ϕT , ϕe,T ) ∈ L2 (Ω)2 and the constant C = C(ε, Ω, ω, ||a||L∞ , T ) remains bounded when ε → 0+ . We prove inequality (1.8) as a consequence of an appropriate Carleman inequality for the solution (ϕε , ϕεe ) of (1.7) (see section 3). We notice that, due to the fact the control is acting on the first equation of (1.6), in our Carleman inequality, we need to bound global integrals of ϕε and ϕεe in terms of a local integral of ϕε , uniformly with respect to ε. Two main difficulties appear: first, the coupling in the first equation of (1.7) is in div (Mi (x)∇ϕεe ) and not in ϕεe ; second, we must show that the constant we get in our Carleman inequality does not blow up when ε → 0+ . The first difficulty is not so hard to overcome. Indeed, for each ε > 0 fixed, inequality (1.8) is known to be true for system (1.7) (see [20]). However, the main novelty here is the fact that we obtain the boundedness of the observability constant C with respect to ε. As we will see, Carleman inequalities alone are not enough for this task, and we need to combine sharp Carleman estimates, with respect to ε, and weighted energy inequalities. As far as the controllability of non degenerate coupled parabolic systems is concerned, the situation is, by now, fairly well understood. For instance, in [20], the controllability of a quite general linear coupled parabolic system is studied and a null controllability result is obtained by means of Carleman inequalities. In [2], using a different strategy, the controllability of a nonlinear reaction-diffusion system of two coupled parabolic equations is analyzed, and the authors prove the null controllability for the linear system and the local null controllability of the nonlinear one. Another relevant work concerning the controllability of coupled systems is [15], in which the authors analyze the null controllability of a cascade system of m (m > 1) coupled parabolic equations and the authors are able to obtain null controllability for the 4 F. W. CHAVES-SILVA AND M. BENDAHMANE cascade system, whenever they have a good coupling structure. It is also worth mentioning the works [3], [4] and [18], where local and global controllability results for phase field systems were studied. For a general discussion about the controllability of coupled parabolic systems, see the survey paper [1]. Concerning controllability results for the bidomain model, since in both equations the couplings are given by the time derivatives of the electrical potentials, it seems very difficult to study controllability properties for such a model. To the best of our knowledge, for the bidomain model (1.1), the problems of null and approximate controllability are still open (even with two controls). Regarding the null controllability of the monodomain model (1.4), since the solution of the parabolic equation enters as a source term in the elliptic one, the following controllability result holds. Theorem 1.2. (1) If h is C 1 (R), globally Lipschitz and h(0) = 0, then, for every v0 ∈ L2 (Ω), there exists a control f ∈ L2 (ω × (0, T )) such that the solution (v, ue ) of (1.4) satisfies: v(T ) = ue (T ) = 0. Moreover, the control f satisfies the following estimate: 2 2 kf 1ω kL2 (Q) ≤ C kv0 kL2 (Ω) , (1.9) for a constant C = C(Ω, ω, T ) > 0. (2) If h is C 1 (R) and h(0) = 0, there exists γ > 0 such that, for every v0 ∈ W 2/3,6 (Ω) ∩ H01 (Ω) with ||v0 ||W 2/3,6 (Ω)∩H01 (Ω) ≤ γ, there exists a control f ∈ L6 (ω × (0, T )) such that the solution (v, ue ) of (1.4) satisfies: v(T ) = ue (T ) = 0. Moreover, the control f satisfies the following estimate: kf 1ω kL6 (Q) ≤ C kv0 kL2 (Ω) , (1.10) for a constant C = C(Ω, ω, T ) > 0. Theorem 1.2, case 1, follows from [14, Theorem 3.1] and case 2 follows from [19, Theorem 3.5] (see also [14, Theorem 4.2]). This paper is organized as follows. In section 2, we state our main results. In section 3, we prove a uniform Carleman inequality for the adjoint system (1.7). Next, we show, in section 4, the uniform null controllability of (1.6). In section 5, we deal with the uniform null controllability of the nonlinear system (1.5). 2. Main results Throughout this paper we will assume that the matrices Mj , j = i, e are C ∞ , bounded, symmetric and positive semidefinite. Our first main result is a uniform Carleman estimate for the adjoint system (1.7). Theorem 2.1. Given any 0 <  ≤ 1, there exist positive constants C = C(Ω, ω), λ0 = λ0 (Ω, ω) ≥ 1 and s0 = s0 (Ω, ω) ≥ 1 such that, for any (ϕT , ϕe,T ) ∈ L2 (Ω)2 and any a ∈ L∞ (Q), the solution (ϕε , ϕεe ) of (1.7) satisfies: ZZ ZZ e3sα |ρε |2 dxdt + s3 λ4 φ3 e3sα |ϕε |2 dxdt Q Q ZZ ≤ Ce6λ||ψ|| s8 λ4 φ8 e2sα |ϕε |2 dxdt, (2.1) Qω UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 5 2/3 for every s ≥ (T + (1 + ||a||L∞ )T 2 )s0 and λ ≥ λ0 , where ρε (x, t) = div (M (x)∇ϕεe (x, t)) and the weight functions φ and α are defined in (3.3) and (3.4), respectively. The proof of Theorem 2.1 follows from a combination of Carleman inequalities, for the heat equation, with a precise dependence on the degenerating parameter, and an energy inequality for the adjoint system (1.7). We prove Theorem 2.1 in section 3. Remark 2.2. As a direct consequence of the Carleman inequality (2.1), we have the unique continuation property for the solutions (ϕε , ϕεe ) of (1.7): “Given ε > 0, if ϕε = 0 in ω × (0, T ), then (ϕε , ϕεe ) ≡ (0, 0) in Q”. This unique continuation property for the adjoint system (1.7) implies, for each ε > 0, the approximate controllability at time T of system (1.6), with a control acting only on the first equation. The second main result of this paper gives the global null controllability of the linear system (1.6). Theorem 2.3. For any 0 < ε ≤ 1 and any (v0 , ue,0 ) ∈ L2 (Ω)2 , there exists a control f ε ∈ L2 (ω × (0, T )) such that the associated solution, (v ε , uεe ), to (1.6) is driven to zero at time T . That is to say, the associated solution satisfies: v ε (T ) = 0, uεe (T ) = 0. Moreover, the control f ε satisfies the estimate:  2 2 2 kf ε 1ω kL2 (Q) ≤ C kv0 kL2 (Ω) + ε kue,0 kL2 (Ω) , (2.2) for a constant C = C(Ω, ω, ||a||L∞ , T ) > 0. From Theorem 2.1, the proof of Theorem 2.3 is standard. However, for the sake of completeness, we prove Theorem 2.3 in section 4. The third main result of this paper is concerned with the uniform null controllability of the nonlinear parabolic system (1.5). Theorem 2.4. Given any 0 < ε ≤ 1, we have: (1) If h is C 1 (R), globally Lipschitz and h(0) = 0, then, for every (v0 , ue,0 ) ∈ L2 (Ω)2 , there exists a control f ε ∈ L2 (ω × (0, T )) such that the solution (v ε , uεe ) of (1.5) satisfies: v ε (T ) = uεe (T ) = 0. Moreover, the control f ε satisfies the estimate:  2 2 2 kf ε 1ω kL2 (Q) ≤ C kv0 kL2 (Ω) + ε kue,0 kL2 (Ω) , (2.3) for a constant C = C(Ω, ω, T ) > 0. (2) If h is C 1 (R) and h(0) = 0, there exists γ > 0, does not depending on ε, such that, for every 2 (v0 , ue,0 ) ∈ W 2/3,6 (Ω) ∩ H01 (Ω) with ||(v0 , ue,0 )||W 2/3,6 (Ω) ≤ γ, there exists a control f ε ∈ L6 (ω × (0, T )) such that the solution (v ε , uεe ) of (1.5) satisfies: v ε (T ) = uεe (T ) = 0. Moreover, the control f ε satisfies the estimate:  2 2 2 kf ε 1ω kL6 (Q) ≤ C kv0 kL2 (Ω) + ε kue,0 kL2 (Ω) , (2.4) for a constant C = C(Ω, ω, T ) > 0. The proof of Theorem 2.4 is achieved through fixed point arguments, and it will be done in section 5. 6 F. W. CHAVES-SILVA AND M. BENDAHMANE Remark 2.5. In this paper we restrict the dimension to N = 2, 3, because the bidomain model makes sense only in such dimensions. Nevertheless, from the mathematical point of view, systems (1.4), (1.5) and (1.6) make sense for any N ∈ N (the 1-d case corresponding to the cable equation) and, taking the initial data in the appropriate space, all the results of this paper can be extended to higher dimensions. 3. Carleman inequality In this section we prove Theorem 2.1. To simplify the notation, we neglect the index ε and, since the only constant which matters in the analysis is ε, we assume that all the other constants are normalized to be the unity. In this case, the adjoint system (1.7) reads:  −∂t ϕ − div (Me (x)∇ϕ) + a(x, t)ϕ = div (Mi (x)∇ϕe )    −ε∂ ϕ − div (M (x)∇ϕ ) = 0 t e e  ϕ = ϕ = 0 e    ϕ(T ) = ϕT , ϕe (T ) = ϕe,T in Q, in Q, on Σ, in Ω. (3.1) We notice that, if ϕT and ϕe,T are regular enough, taking ρ(x, t) = div (Mi (x)∇ϕe (x, t)), the pair (ϕ, ρ) satisfies:  −∂t ϕ − div (Me (x)∇ϕ) + a(x, t)ϕ = ρ in Q,    −ε∂ ρ − div (M (x)∇ρ) = 0 in Q, t (3.2) ϕ = ρ = 0 on Σ,    ϕ(T ) = ϕT , ρ(T ) = ρT in Ω. We prove the Carleman inequality (2.1) using system (3.2). Before starting the proof of the Carleman inequality, let us first define several weight functions which will be usefull in the sequel. Lemma 3.1. Let ω0 be an arbitrary nonempty open set such that ω0 ⊂ ω ⊂ Ω. There exists a function ψ ∈ C 2 (Ω) such that ψ(x) > 0, ∀x ∈ Ω, ψ ≡ 0 on ∂Ω, |∇ψ(x)| > 0 ∀x ∈ Ω\ω0 . Proof. See [14].  Using Lemma 3.1, we introduce the weight functions φ(x, t) = eλ(ψ(x)+m||ψ||) eλm||ψ|| ; φ∗ (t) = min φ(x, t) = ; t(T − t) t(T − t) x∈Ω eλ(ψ(x)+m||ψ||) − e2λmkψk eλ(m+1)kψk − e2λmkψk ; α∗ (t) = max α(x, t) = , t(T − t) t(T − t) x∈Ω for a parameter λ > 0 and a constant m > 1. Here, α(x, t) = (3.3) (3.4) kψ(x)k = max |ψ(x)| . x∈Ω ∗ Remark 3.2. From the definition of α and α it follows that, for λ large enough, 3α∗ ≤ 2α. Moreover, φ∗ (t) ≤ φ(x, t) ≤ eλkψk φ∗ (x, t) and |∂t α∗ | ≤ e2λkψk T φ2 . UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 7 Proof of Theorem 2.1 . For a better comprehension, we divide the proof into several steps. Step 1. First estimate for the parabolic system. In this step we obtain a first Carleman estimate for the adjoint system (1.7). For that, we will apply sharp Carleman inequalities, with respect to ε, to the system and get a global estimate of ϕ and ρ in terms of a local integral of ϕ and another in ρ. We consider a set ω1 such that ω0 ⊂⊂ ω1 ⊂⊂ ω and apply the sharp Carleman inequality (6.2), with ε = 1, and (6.15) to ϕ and ρ, respectively. We get ZZ ZZ N X 2 2 ∂x2i xj ϕ dxdt s−1 φ−1 e2sα |ϕt | dxdt + s−1 φ−1 e2sα Q Q + s3 λ4 ZZ i,j=1 ZZ 2 2 φ3 e2sα |ϕ| dxdt + sλ2 φe2sα |∇ϕ| dxdt Q Q Z Z  ZZ 2 2 2 2sα 3 4 3 2sα ≤C e (|ρ| + |ϕ| )dxdt + s λ φ e |ϕ| dxdt Q (3.5) Qω1 and ZZ 2 e2sα |∂t ρ| dxdt + ε−2 ZZ Q N X e2sα Q 2 ∂x2i xj ρ dxdt i,j=1 ZZ 2 2 φ4 e2sα |ρ| dxdt + s2 λ2 ε−2 φ2 e2sα |∇ρ| dxdt Q Q ZZ 2 λkψk 4 4 −2 4 2sα ≤ Ce s λ ε φ e |ρ| dxdt, + s4 λ4 ε−2 ZZ (3.6) Qω1 2/3 kakL∞ )T 2 )s0 for s ≥ (T + (1 + and λ ≥ λ0 . Adding (3.5) and (3.6), and absorbing the lower order terms in the right-hand side, we get ZZ ZZ N X 2 2 −1 2sα −1 2sα φ e |ϕt | dxdt + φ e ∂x2i xj ϕ dxdt Q Q 4 4 ZZ +s λ 3 2sα φ e 2 i,j=1 2 2 ZZ Q + ε2 ZZ Q 2 e2sα |∂t ρ| dxdt + ZZ Q + s4 λ4 e2sα Q ZZ 2 φ4 e2sα |ρ| dxdt + s2 λ2 Q  ≤C e 2 φe2sα |∇ϕ| dxdt |ϕ| dxdt + s λ N X 2 (3.7) ∂x2i xj ρ dxdt i,j=1 ZZ 2 φ2 e2sα |∇ρ| dxdt Q λ||ψ|| 4 4 ZZ s λ 4 2sα φ e Qω1 2 4 4 ZZ 3 2sα |ρ| dxdt + s λ φ e  |ϕ| dxdt , 2 Qω1 2/3 for s ≥ (T + (1 + kakL∞ )T 2 )s0 and λ ≥ λ0 . Remark 3.3. If we were trying to drive the solution of (1.6) to zero by means of controls on both equations, inequality (3.7) would be sufficient. Step 2. Estimate of the local integral of ρ. 8 F. W. CHAVES-SILVA AND M. BENDAHMANE In this step we estimate the local integral on ρ in the right-hand side of (3.7). This will be done using equation (3.2)1 . Indeed, we consider a function ξ satisfying ξ ∈ C0∞ (ω), 0 ≤ ξ ≤ 1, ξ(x) = 1 ∀x ∈ ω1 and write Ceλ||ψ|| s4 λ4 ZZ ZZ e2sα φ4 |ρ|2 ξdxdt = Ceλ||ψ|| s4 λ4 Qω e2sα φ4 ρ(−ϕt − div (Me ∇ϕ) + aϕ)ξdxdt Qω (3.8) := E + F + G. In the sequel, we estimate each parcel in the expression above. First, we have ZZ E = Ceλ||ψ|| s4 λ4 s∂t αe2sα φ4 ρϕξdxdt Qω ZZ ZZ + Ceλ||ψ|| s4 λ4 e2sα φ3 φt ρϕξdxdt + Ceλ||ψ|| s4 λ4 e2sα φ4 ∂t ρϕξdxdt Qω Qω := E1 + E2 + E3 , and it is not difficult to see that E1 + E2 ≤ 1 4 4 s λ 10 ZZ e2sα φ4 |ρ|2 dxdt + Ce2λ||ψ|| s8 λ4 ZZ Qω e2sα φ8 |ϕ|2 dxdt Qω and ε2 E3 ≤ 2 ZZ e 2sα 2λ||ψ|| −2 8 8 2 |∂t ρ| dxdt + Ce ε Qω ZZ s λ e2sα φ8 |ϕ|2 dxdt. Qω Next, integrating by parts, we get e−λ||ψ|| s−4 λ−4 F = N ZZ X i,j=1 + s∂xi α e2sα φ4 ρ(Meij ∂xj ϕ)ξdxdt Qω N ZZ X i,j=1 + N ZZ X i,j=1 + e2sα φ3 ∂xi φ ρ(Meij ∂xj ϕ)ξdxdt Qω e2sα φ4 ∂xi ρ (Meij ∂xj ϕ)ξdxdt Qω N ZZ X i,j=1 e2sα φ4 ρ(Meij ∂xj ϕ)∂xi ξdxdt Qω and we can show that F ≤ ZZ 1 e2sα φ4 |ρ|2 dxdt + s2 λ2 e2sα φ2 |∇ρ|2 dxdt 6 Qω Qω ZZ ZZ N X 2 1 e2sα + Ce2λ||ψ|| s8 λ8 e2sα φ8 |ϕ|2 dxdt + ∂x2i xj ρ dxdt. 2 Qω Qω i,j=1 1 4 4 s λ 10 ZZ (3.9) UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 9 Finally, we have 1 G ≤ s4 λ4 10 ZZ e2sα φ4 |ρ|2 dxdt Qω 2λ||ψ|| 4 4 + Ce s λ ||a||2L∞ ZZ e2sα φ4 |ϕ|2 dxdt. Qω Putting E, F and G together in (3.7), we obtain ZZ ZZ N X 2 e2sα |ϕt |2 dxdt + e2sα ∂x2i xj ϕ dxdt Q Q 4 4 ZZ 4 2sα +s λ φ e i,j=1 2 2 2 ZZ 2 2sα |ϕ| dxdt + s λ Q φ e 2 |∇ϕ| dxdtε Q N X e2sα + ZZ Q 2 ∂x2i xj ρ dxdt + s4 λ4 i,j=1 2 ZZ e2sα |∂t ρ|2 dxdt Q ZZ φ4 e2sα |ρ|2 dxdt (3.10) Q ZZ + s2 λ2 φ2 e2sα |∇ρ|2 dxdt Q ZZ e2sα φ8 |ϕ|2 dxdt, ≤ Ce2λ||ψ|| ε−2 s8 λ8 Qω 2/3 kakL∞ )T 2 )s0 for s ≥ (T + (1 + and λ ≥ λ0 . Using (3.10), we can prove that, for every ε > 0, system (1.6) is null controllable. However, the sequence of controls obtained in this way will not be bounded when ε → 0+ . Therefore, we need to go a step further and improve estimate (3.10). This is the goal of the next step. Step 3. Weighted energy inequality. The reason why we do not get a bounded sequence of controls out of step 2 is because of the term ε−2 in the right-hand side of (3.10). In this step we prove a weighted energy inequality for equation (3.2)2 , which will be used to compensate this ε−2 term. Let us introduce the function ∗ 3 y = e 2 sα ρ. This new function satisfies  ∗ 3 ε∂t y − div (M (x)∇y) = ε 32 s∂t α∗ e 2 sα ρ in Q,  (3.11) y=0 on Σ,   y(0) = y(T ) = 0 in Ω. Multiplying (3.11) by y and integrating over Ω, we get Z ∗ 3 ε d 3 2 2 ||y(t)||L2 (Ω) + C||∇y(t)||L2 (Ω) ≤ ε s∂t α∗ (t)e 2 sα (t) ρ(t)y(t)dx. 2 dt 2 Ω Integrating this last inequality form 0 to T and using Poincaré’s and Young’s inequalities, it is not difficult to see that ZZ ZZ 3sα∗ 2 2 4λ||ψ|| e |ρ| dxdt ≤ Cε e s4 φ4 e2sα |ρ|2 dxdt. (3.12) Q Q Finally, from (3.10) and (3.12), we obtain ZZ ZZ ∗ e3sα |ρ|2 dxdt ≤ Ce6λ||ψ|| s8 λ4 Q Qω φ8 e2sα |ϕ|2 dxdt. (3.13) 10 F. W. CHAVES-SILVA AND M. BENDAHMANE This last estimate gives a global estimate of ρ in terms of a local integral of φ, with a constant C which is bounded with respect to ε. Step 4. Last estimates and conclusion. In order to finish the proof of Theorem 2.1, we combine inequality (3.13) and a slightly different Carleman inequality to the equation (3.2)1 . Indeed, the following Carleman inequality holds: ZZ ZZ N X 2 ∂x2i xj ϕ dxdt s−1 φ−1 e3sα |ϕt |2 dxdt + s−1 φ−1 e3sα Q Q i,j=1 ZZ ZZ + s3 λ4 φ3 e3sα |ϕ|2 dxdt + sλ2 φe3sα |∇ϕ|2 dxdt Q Q Z Z  ZZ 3sα 2 3 4 3 3sα 2 ≤C e |ρ| dxdt + s λ φ e |ϕ| dxdt , Q (3.14) Qω 2/3 kakL∞ )T 2 )s0 for s ≥ (T + (1 + and λ ≥ λ0 , where ϕ is, together with ρ, solution of (3.2). Notice that here we have just changed the weight e2sα by e3sα . The proof of (3.14) is exactly the same as the proof of Theorem 6.1, just taking the appropriate change of variable in (6.3). ∗ Next, since e3sα ≤ e3sα , we have ZZ ZZ ∗ e3sα |ρ|2 dxdt ≤ e3sα |ρ|2 dxdt and by (3.13), we have that ZZ e 3sα Q Q 2 6λ||ψ|| 8 4 |ρ| dxdt ≤ Ce Q ZZ φ8 e2sα |ϕ|2 dxdt. s λ Qω From (3.13) and (3.14), it follows that ZZ ZZ ZZ 3sα 2 3 4 3 3sα 2 6λ||ψ|| 8 4 e |ρ| dxdt + s λ φ e |ϕ| dxdt ≤ Ce s λ Q Q φ8 e2sα |ϕ|2 dxdt, (3.15) Qω which is exactly (2.1). By density, we can show that (3.15) remains true when we consider initial data in L2 (Ω). Therefore, the proof of Theorem 2.1 is finished.  4. Null controllability for the linearized system This section is devoted to proving the null controllability of linearized equation (1.6). It will be done by showing the observability inequality (1.8) for the adjoint system (1.7), and solving a minimization problem. The arguments used here are classical in control theory for linear PDE’s. Hence, we just give a sketch of the proof. Proof of Theorem 2.3. Combining the standard energy inequalities for system (3.2) and the Carleman inequality given by Theorem 2.1, we can show the following observability inequality for the solutions of (3.2): ZZ 2/3 ||ϕ(0)||2L2 (Ω) + ε||ρ(0)||2L2 (Ω) ≤ eC(1+1/T +||a||L∞ +||a||L∞ T ) |ϕ|2 dxdt, Qω where C = C(Ω, ω) is a positive constant. Next, since ρ(x, t) = div (M (x)∇ϕe (x, t)) and ϕe = 0 on ∂Ω, we have that ||ϕe (t)||H 2 (Ω) ≤ C||ρ(t)||L2 (Ω) , (4.1) UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 11 for all t ∈ [0, T ]. Therefore, it follows from (4.1) that 2/3 ||ϕ(0)||2L2 (Ω) + ε||ϕe (0)||2L2 (Ω) ≤ eC(1+1/T +||a||L∞ +||a||L∞ T ) ZZ |ϕ|2 dxdt, (4.2) Qω which is the observability inequality (1.8). From (4.2) and the density of smooth solutions in the space of solutions of (3.1) with initial data in L2 (Ω), we see that the above observability inequality is satisfied by all solutions of (1.7) with initial data in L2 (Ω). Now, in order to obtain the null controllability for linear system (1.6), we solve, for any δ > 0, the following minimization problem: Minimize Jδ (ϕT , ϕe,T ), with ( Z Z 1 T 2 |ϕε | dx dt + ε(ue,0 , ϕεe (0)) Jδ (ϕT , ϕe,T ) = 2 0 ω (4.3) ) + (v0 , ϕε (0)) + δ(kϕT kL2 (Ω) + ε1/2 kϕe,T kL2 (Ω) ) , where (ϕ, ϕe ) is the solution of the adjoint problem (1.7) with initital data (ϕT , ϕe,T ) ∈ L2 (Ω)2 . It is an easy matter to check that Jδ is strictly convex and continuous. So, in order to guarantee the existence of a minimizer, the only thing remaining to prove is the coercivity of Jδ . Using the observability inequality (1.8) for the adjoint system (1.7), the coercivity of Jδ is straightfoward. Therefore, for each δ > 0, there exists a unique minimizer (ϕδe,T , ϕδT ) of Jδ . Let us denote by ϕε,δ the corresponding solution to (1.7) associated to this minimizer. Taking f ε,δ = ϕε,δ 1ω as a control for (1.6), the duality between (1.6) and (1.7) gives ||v ε,δ (T )||L2 (Ω) + ε1/2 ||uε,δ e (T )||L2 (Ω) ≤ δ, ε,δ where (v ε,δ , uε,δ . It also gives e ) is the solution of (1.6) associated to the control f  ||f ε,δ 1ω ||2L2 (Q) ≤ C ||v0 ||2L2 (Ω) + ε||ue,0 ||2L2 (Ω) . (4.4) (4.5) From (4.4) and (4.5), we get a control f ε (the weak limit of a subsequence of f ε,δ 1ω in L2 (ω × (0, T ))) that drives the solution of (1.6) to zero at time T . From (4.5), we have the following estimate on the control f ε ,  ||f ε 1ω ||2L2 (Q) ≤ C ||v0ε ||2L2 (Ω) + ε||uεe,0 ||2L2 (Ω) . (4.6) This finishes the proof of Theorem 2.3.  5. The nonlinear system In this section we prove Theorem 2.4. The proof is achieved through fixed point arguments. Proof of Theorem 2.4 (case 1): We consider the following linearization of system (1.5):   µ ε ε + g(z)v ε = f ε 1ω in Q,  cm ∂t v − µ+1 div Me (x)∇v   ε∂ uε − div M(x)∇uε = div M (x)∇v ε  in Q, t e i e ε ε v = ue = 0 on Σ,    ε ε v (0) = v0 , ue (0) = ue,0 in Ω, (5.1) 12 F. W. CHAVES-SILVA AND M. BENDAHMANE where   h(s) , if |s| > 0, g(s) = s h0 (0), if s = 0. (5.2) It follows from Theorem 2.3 that, for each (v0 , ue,0 ) ∈ L2 (Ω)2 and z ∈ L2 (Q), there exists a control function f ε ∈ L2 (Q) such that the solution of (5.1) satisfies: v ε (T ) = uεe (T ) = 0. As we said before, the idea is to use a fixed point argument. For that, we need the following generalized version of Kakutani’s fixed point Theorem, due to Glicksberg [17]. Theorem 5.1. Let B be a non-empty convex, compact subset of a locally convex topological vector space X. If Λ : B −→ B is a convex set-valued mapping with closed graph and Λ(B) is closed, then Λ has a fixed point. In order to apply Glicksberg‘s Theorem, we define a mapping Λ : B −→ X as follows Λ(z) = {v ε ; (v ε , uεe ) is a solution of (5.1), such that v ε (T ) = uεe (T ) = 0, for a control f ε satisfying (2.2)}. Here, X = L2 (Q) and B is the ball B = {z ∈ L2 (0, T, H01 (Ω)), ∂t z ∈ L2 (0, T, H −1 (Ω)); ||z||2L2 (0,T ;H 1 (Ω)) + ||∂t z||2L2 (0,T ;H −1 (Ω)) ≤ M }. 0 It is easy to see that Λ is well defined and that B is a convex and compact subset of L2 (Q). Let us now prove that Λ is convex, compact and has closed graph. • Λ(B) ⊂ B. Let z ∈ B and v ε ∈ Λ(z). Since v ε satisfies (5.1)1 , the following inequality holds ||v ε ||2L2 (0,T ;H 1 (Ω)) + ||∂t v ε ||2L2 (0,T ;H −1 (Ω)) ≤ K1 . 0 (5.3) In this way, if z ∈ B then Λ(z) ⊂ B, if we take M = K1 . • Λ(z) is closed in L2 (Q). Let z ∈ B fixed, and vnε ∈ Λ(z), such that vnε → v ε . Let us prove that v ε ∈ Λ(z). In fact, by definition we have that vnε is, together with a function uεe,n , and a control fnε , the solution of  (5.1), with ||fnε 1ω ||2L2 (Q) ≤ C ||v0 ||2L2 (Ω) + ε||ue,0 ||2L2 (Ω) . Therefore, we can extract a subsequence of fnε , denoted by the same index, such that fnε 1ω → f ε 1ω weakly in L2 (Q). Since fnε is bounded, we can argue as in the previous section and show that ||vnε ||2L2 (0,T ;H 1 (Ω)) + ||∂t vnε ||2L2 (0,T ;H −1 (Ω)) ≤ M. 0 Hence, vnε → v ε weakly in L2 (0, T ; H01 (Ω)), vnε → v ε strongly in L2 (Q), ∂t vnε → ∂t v ε weakly in L2 (0, T ; H −1 (Ω)). (5.4) UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 13 Using the converges above and (5.1)2 , we see that there exists a function uεe such that uεe,n → uεe weakly in L2 (0, T ; H01 (Ω)), uεe,n → uεe strongly in L2 (Q), ∂t uεe,n → ∂t uεe weakly in L2 (0, T ; H −1 (Ω)). It follows that (v ε , uεe ) is a controlled solution of (5.1) associated to the control f ε . Hence, v ε ∈ Λ(z) and Λ(z) is closed and compact in L2 (Q). • Λ has closed graph in L2 (Q) × L2 (Q). We need to prove that if zn → z, vnε → v ε strongly in L2 (Q) and vnε ∈ Λ(zn ), then v ε ∈ Λ(z). Using the two previous steps, it is easy to show that v ε ∈ Λ(z). Therefore, we can apply Glicksberg’s Theorem to conclude that Λ has a fixed point. This proves Theorem 2.4 in the case where the nonlinearity is a C 1 globally Lipschitz function. Proof of Theorem 2.4 (case 2): We consider the linear system:   µ div Me (x)∇v ε + a(z)v ε = f ε 1ω cm ∂t v ε − µ+1    ε∂ uε − div M(x)∇uε  = div M (x)∇v ε  i t e e ε ε  v = u = 0  e   ε v (0) = v0 , uεe (0) = ue,0 2 with (v0 , ue,0 ) ∈ W 2/3,6 (Ω) ∩ H01 (Ω) , z ∈ L∞ (Q) and Z 1 dh a(z) = (sz)ds. 0 dz in Q, in Q, on Σ, in Ω, (5.5) Arguing as in the proof Theorem 2.3, we can show the null controllability of (5.5) with controls in L2 (ω × (0, T )). However, these L2 controls are not sufficient to apply fixed point arguments and obtain the null controllability of the nonlinear system (1.5). For this reason, we modify a little the functional (4.3), obtaining controls which will allow us to employ Schauder’s fixed point Theorem. Indeed, for any δ > 0, we consider the problem: Minimize Jδ (ϕT , ϕeT ), with ( Z Z 1 T 2 Jδ (ϕT , ϕeT ) = e2sα φ8 |ϕε | dx dt + ε(ue,0 , ϕεe (0)) 2 0 ω (5.6) )   ε 1/2 + (v0 , ϕ (0)) + δ kϕT kL2 (Ω) +  kϕe,T kL2 (Ω) , where (ϕε , ϕεe ) is the solution of the adjoint system (1.7) with initital data (ϕT , ϕe,T ) ∈ L2 (Ω)2 . ε,δ As in section 4, we show that problem (5.6) has a unique minimizer (ϕε,δ , ϕε,δ = e ). Defining f ε,δ 2sα 8 ε,δ ε,δ ε,δ e φ ϕ and using the fact that ϕ is, together with a ϕe , the solution of (1.7), we see that f is a solution of a parabolic equation, with homogeneous Dirichlet boundary conditions, null initial data and a right-hand side in L2 (Q). Hence, f ε,δ ∈ L2 (0, T ; H 2 (Ω)) ∩ H 1 (0, T ; L2 (Ω)) and in particular we have that f ε,δ ∈ L6 (Q). Arguing as in [2, Lemma 5], we can easily show that  2 2 ||f ε,δ 1ω ||2L6 (Q) ≤ C kv0 kL2 (Ω) + ε kue,0 kL2 (Ω) , (5.7) where C > 0 is independent of  and δ. 14 F. W. CHAVES-SILVA AND M. BENDAHMANE ε,δ Moreover, the solution (v ε,δ , uε,δ , satisfies e ) of (5.5), associated to f ||v ε,δ (T )||L2 (Ω) + ε1/2 ||uε,δ e (T )||L2 (Ω) ≤ δ. + ε (5.8) 6 Taking the limit when δ → 0 , we get a control f ∈ L (Q) (the weak limit of a subsequence of f ε,δ ) such that the associated solution (v ε , uεe ) to (5.5) satisfies v ε (T ) = uεe (T ) = 0. Next, we define a map F : L∞ (Q) −→ L∞ (Q) which, to each z ∈ L∞ (Q), associates v ε the solution, together with uεe , of (5.5) corresponding to z and to the control f ε built above. Note that this application is well defined since, from the regularity theory for parabolic equations (see, for instance, [28]), we have that v ε ∈ X := L6 (0, T ; W 2,6 (Ω)) ∩ W 1,6 (0, T ; L6 (Ω)) ∩ C([0, T ]; W 2/3,6 (Ω) ∩ H01 (Ω)). Let us now consider the set A defined as  A := z ∈ L∞ (Q); ||z||L∞ (Q) ≤ 1 . It is clear that A is a convex closed subset of L∞ (Q). From (5.7), which still holds for f ε , and the smallness assumption on the initial data, we can easily show that F is continuous and that F (A) ⊂ A. Finally, since the space X is compactly embedded in L∞ (Q), we have that F (A) is compact in L∞ (Q). Therefore, F has a fixed point and the the proof of case 2 of Theorem 2.4 is finished. 6. Appendix: Some technical results In this section we prove the two sharp Carleman inequalities used in the proof of Theorem 2.1. We consider the parabolic equation  N X    ∂xi (aij (x)∂xi v(t, x)) = g(x, t) in Q,  −∂t v(x, t) − i,j=1  v=0     v(T ) = vT (6.1) on Σ, in Ω, where vT ∈ L2 (Ω) and g ∈ L2 (Q). We assume that the matrix aij has the form aij = Mij , ε and (Mij )ij is an elliptic matrix, i.e., there exists β > 0 such that PN i,j Mij ξj ξi ≥ β|ξ|2 for all ξ ∈ RN . 6.1. A degenerating Carleman inequality. The first sharp Carleman inequality we prove is the following. Theorem 6.1. For any 0 <  ≤ 1, there exist λ0 = λ0 (Ω, ω) ≥ 1 and s0 = s0 (Ω, ω) ≥ 1 such that, for every λ ≥ λ0 and s ≥ s0 (T + T 2 ), the solution v of (6.1) satisfies ZZ ZZ N X 2 s−1 φ−1 e2sα |∂t v|2 dxdt + s−1 ε−2 φ−1 e2sα ∂x2i xj v dxdt Q Q i,j=1 ZZ ZZ + s3 λ4 ε−2 φ3 e2sα |v|2 dxdt + sλ2 ε−2 φe2sα |∇v|2 dxdt Q Q Z Z  ZZ 2sα 2 3 4 −2 3 2sα 2 ≤C e |g| dxdt + s λ ε φ e |v| dxdt , Q with C > 0 depending only on Ω, ω0 , ψ and β. Qω (6.2) UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 15 Proof. For s > 0 and λ > 0, we consider the change of variable w(t, w) = esα v(t, w), (6.3) which implies w(T, x) = w(0, x) = 0. Using the fact that v is the solution of (6.1), we write L1 w + L2 w = gs , (6.4) where N X L1 w = −∂t w + 2sλ 2 φaij ∂xj ψ ∂xi w + 2sλ i,j=1 L2 w = − N X N X φaij ∂xi ψ ∂xj ψw, (6.5) i,j=1 ∂xi (aij ∂xj w) − s2 λ2 i,j=1 N X φ2 aij ∂xi ψ ∂xj ψ w + s∂t α w (6.6) i,j=1 and gs = esα g + sλ2 N X φaij ∂xi ψ ∂xj ψ w − sλ i,j=1 N X φ∂xi (aij ∂xj ψ) w. (6.7) i,j=1 From (6.4), we have that ||L1 w||2L2 (Q) + ||L2 w||2L2 (Q) + 2(L1 w, L2 w)L2 (Q) = ||gs ||2L2 (Q) . (6.8) The rest of the proof is devoted to analyze the terms appearing in (L1 w, L2 w)L2 (Q) . First, we write N X (L1 w, L2 w)L2 (Q) = Iij , i,j=1 where Iij is the inner product in L2 (Q) of the ith term in the expression of L1 w and the jth term in L2 w. After a long, but straightforward, calculation, we can show that the following estimate holds ZZ ZZ 2(L1 w, L2 w)L2 (Q) ≥ 2s3 λ4 β 2 ε−2 φ3 |∇ψ|4 |w|2 dxdt + 2sλ2 β 2 ε−2 φ|∇ψ|2 |∇w|2 dxdt Q Q  Z Z −2 2 2 4 2 2 2 3 3 2 − Cε T s λ + Ts λ + T s + s λ + Ts λ φ3 |w|2 dxdt Q ZZ −2 2 2 − Cε (sλ + λ ) φ|∇w| dxdt. (6.9) Q We take λ ≥ λ0 and s ≥ s0 (T + T 2 ), and it follows, from Remark 6.2 below, that 2(L1 w, L2 w) L2 (Q) 3 4 2 −2 ZZ φ3 |w|2 dxdt + 2s λ β ε Qω0 2 2 −2 ZZ φ|∇w|2 dxdt + 2sλ β ε Qω0 ≥ 2s3 λ4 β 2 ε−2 ZZ φ3 |w|2 dxdt + 2sλ2 β 2 ε−2 Q ZZ φ|∇w|2 dxdt. Q (6.10) 16 F. W. CHAVES-SILVA AND M. BENDAHMANE Remark 6.2. Since Ω\ω0 is compact and |∇ψ| > 0 on Ω\ω0 , there exists δ > 0 such that β|∇ψ| ≥ δ on Ω\ω0 . Putting (6.10) in (6.8), we get ZZ φ3 |w|2 dxdt ||L1 w||2L2 (Q) + ||L2 w||2L2 (Q) + 2β −2 s3 λ4 δ 4 ε−2 Q ZZ + 2sλ2 δ 2 ε−2 φ|∇w|2 dxdt Q ZZ ≤ ||gs ||2L2 (Q) + 2β −2 s3 λ4 δ 4 ε−2 φ3 |w|2 dxdt (6.11) Qω0 + 2sλ2 δ 2 ε−2 ZZ φ|∇w|2 dxdt. Qω0 Now we deal with the local integral involving ∇w on the right-hand side of (6.11). To this end, we introduce a cutt-off function ξ such that ξ ∈ C0∞ (ω), 0 ≤ ξ ≤ 1, ξ(x) = 1 ∀x ∈ ω0 . Using the ellipticity condition on aij , we can prove that ZZ βε−1 φξ 2 |∇w|2 dxdt Qω Z Z ZZ ≤C L2 wφξ 2 wdxdt + (sT + ε−1 s2 λ2 ) φ3 |w|2 dxdt Q Qω  ZZ φ1/2 |∇w|ξφ1/2 wdxdt . + λε−1 Qω Therefore, by Young’s inequality, we have that ZZ sλ2 δ 2 ε−2 φξ 2 |∇w|2 dxdt Q ZZ ω ZZ 1 ≤ |L2 w|2 dxdt + Cβ −2 s3 λ4 (δ 4 + δ 2 )ε−2 φ3 |w|2 dxdt. 4 Q Qω Thus, inequality (6.11) gives ||L1 w||2L2 (Q) −2 3 4 −2 ZZ φ3 |w|2 dxdt ZZ 2 −2 + sλ ε φ|∇w|2 dxdt Q   ZZ sα 2 −2 3 4 −2 3 2 ≤ C ||e g||L2 (Q) + β s λ ε φ |w| dxdt . + ||L2 w||2L2 (QT ) +β s λ ε Q (6.12) Qω Let us now we use the first two terms in left-hand side of (6.12) in order to add the integrals of |∆w|2 and |wt |2 to the left-hand side of (6.12). This is done using the expressions of L1 w and L2 w. Indeed, from (6.5) and (6.6), we have UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM ZZ s−1 φ−1 |∂t w|2 dxdt + ε−2 Q ZZ s−1 φ−1 Q N X 17 2 ∂xi (Mij ∂xj w) dxdt i,j=1 ZZ ZZ (6.13) + s3 λ4 ε−2 φ3 |w|2 dxdt + sλ2 ε−2 φ|∇w|2 dxdt Q Q   ZZ ≤ C ||esα g||2L2 (Q) + s3 λ4 ε−2 φ3 |w|2 dxdt . Qω Using the term in |∂xi (Mij ∂xj w)|2 on the lef-hand side of (6.13) and elliptic regularity, it is easy to show that s−1 ε−2 ZZ φ−1 Q N X 2 ∂x2i xj w dxdt  ZZ ≤ C ||esα g||2L2 (Q) + s3 λ4 ε−2  φ3 |w|2 dxdt . Qω i,j=1 Estimate (6.13) then gives ZZ s−1 φ−1 |∂t w|2 dxdt + s−1 ε−2 ZZ Q φ−1 Q ZZ N X 2 ∂x2i xj w dxdt i,j=1 ZZ +s3 λ4 ε−2 φ3 |w|2 dxdt + sλ2 ε−2 φ|∇w|2 dxdt Q Q   ZZ ≤ C ||esα g||2L2 (Q) + s3 λ4 ε−2 φ3 |w|2 dxdt . (6.14) Qω From (6.14) and the fact that w = esα v, we finish the proof of Theorem 6.1.  6.2. A Slightly changed Carleman inequality. Our second sharp Carleman inequality is the following. Theorem 6.3. For any 0 <  ≤ 1, there exist λ0 = λ0 (Ω, ω) ≥ 1 and s0 = s0 (Ω, ω) ≥ 1 such that, for every λ ≥ λ0 and s ≥ s0 (T + T 2 ), the solution v of (6.1) satisfies ZZ e2sα |∂t v|2 dxdt + ε−2 Q ZZ e2sα Q N X 2 ∂x2i xj v dxdt i,j=1 ZZ ZZ + s4 λ4 ε−2 φ4 e2sα |v|2 dxdt + s2 λ2 ε−2 φ2 e2sα |∇ρ|2 dxdt Q Q ZZ ZZ ≤ Ceλ||ψ|| (s φe2sα |g|2 dxdt + s4 λ4 ε−2 φ4 e2sα |v|2 dxdt), Q (6.15) Qω with C > 0 depending only on Ω, ω0 , ψ and β. Proof. The starting point is the application of the Carleman inequality given in Theorem 6.1 to the equation (6.1). Indeed, we have 18 F. W. CHAVES-SILVA AND M. BENDAHMANE ε 2 ZZ −1 −1 2sα s φ e ZZ 2 Q Q + s3 λ4 N X s−1 φ−1 e2sα |vt | dxdt + 2 ∂x2i xj v dxdt i,j=1 ZZ ZZ φ3 e2sα |v|2 dxdt + sλ2 φe2sα |∇v|2 dxdt Q ZZ ZZ 2sα 2 3 4 ≤ C( e |g| dxdt + s λ φ3 e2sα |v|2 dxdt). (6.16) Q Q Qω 1 Next, we introduce the function y(x, t) = v(x, t)(φ∗ (t)) 2 . This new function satisfies  1 ε∂t y − div (M (x)∇y) = −ε (T −2t) in Q, φ∗ y + ε(φ∗ (t)) 2 g 2 y=0 on Σ. (6.17) Applying again the Carleman inequality given by Theorem 6.1, this time for y, we obtain, for s large enough, that ZZ s−1 φ−1 e2sα |∂t y|2 dxdt + ε−2 ZZ Q s−1 φ−1 e2sα Q + s3 λ4 ε−2 N X 2 ∂x2i xj y dxdt i,j=1 ZZ ZZ φ3 e2sα |y|2 dxdt + sλ2 ε−2 φe2sα |∇y|2 dxdt Q ZZ ZZ ∗ 2sα 2 3 4 −2 ≤ C( φ e |g| dxdt + s λ ε φ3 e2sα |y|2 dxdt). (6.18) Q Q Qω From the definition of y, it is easy to show that ZZ ZZ ZZ 1 s−1 φ−1 e2sα |vt (φ∗ ) 2 |2 dxdt ≤ s−1 φ−1 e2sα |∂t y|2 dxdt + e2sα φ|y|2 dxdt. Q Q (6.19) Q Using (6.19), inequality (6.18) becomes ZZ s−1 φ−1 φ∗ e2sα |vt |2 dxdt + ε−2 Q ZZ s−1 φ∗ φ−1 e2sα Q + s3 λ4 ε−2 N X 2 ∂x2i xj v dxdt i,j=1 ZZ ZZ φ3 φ∗ e2sα |v|2 dxdt + sλ2 ε−2 φφ∗ e2sα |∇v|2 dxdt Q Q ZZ ZZ ∗ 2sα 2 3 4 −2 3 ∗ 2sα 2 ≤ C( φ e |g| dxdt + s λ ε φ φ e |v| dxdt). Q (6.20) Qω From Remark 3.2, the result follows.  Acknowledgments This paper has been partially established during the visit of M. Bendahmane to the Basque Center for Applied Mathematics. The authors thank professor Enrique Zuazua for various fruitful discussions about this work and Erich Foster for a careful reading of this paper. UNIFORM CONTROLLABILITY FOR A DEGENERATING SYSTEM 19 References [1] F. Ammar-Khodja, A. Benabdallah, M. González-Burgos, L. de Teresa, Recents results on the controllability of linear coupled parabolic problems: a survey, Mathematical Control and Related Fields, 1 (3)(2011), 267–306. [2] F. Ammar-Khodja, A. Benabdallah, C. Dupaix, Null-controllability of some reaction-diffusion systems with one control force, J. Math. Anal. Appl., 320 (2006), 928–943. [3] F. Ammar-Khodja, A. Benabdallah, C. Dupaix, I. Kostine, Controllability to the trajectories of phase-field models by one control force, SIAM J. Control Optim., 42 (5)(2003), 1661–1680. [4] V. Barbu, Local controllability of the phase field system, Nonlinear Anal. Ser. A Theory Methods, 50 (2002), 363–372. [5] M. Bendahmane, R. Bürger, R. Ruiz-Baier, A finite volume scheme for cardiac propagation in media with isotropic conductivities, Math. Comp. Simul., 80 (2010), 1821–1840. [6] M. Bendahmane, F. W. Chaves-Silva, Null controllability of a degenerated reaction-diffusion system in cardiac electrophysiology, C. R. Math. Acad. Sci. Paris, 350 (11-12)(2012), 587–590. [7] M. Bendahmane, K. H. Karlsen, Analysis of a class of degenerate reaction-diffusion systems and the bidomain model of cardiac tissue, Netw. Heterog. Media, 1 (2006), 185–218. [8] M. Bendahmane, K. H. Karlsen, Convergence of a finite volume scheme for the bidomain model of cardiac tissue, Appl. Numer. Math., 59 (2009), 2266–2284. [9] P. Biler, Existence and asymptotics of solutions for a parabolic-elliptic system nonlinear non-flux boundary conditions, Nonilinear Analysis T. M. A., 19 (1992), 1121–1136. [10] P. Biler, W. Hebisch, T. Nadzieja, The Debye system: Existence and long time behavior of solutions, Nonlinear Analysis T. M. A., 23 (1994), 1189–1209. [11] P. Colli Franzone, G. Savaré, Degenerate evolution systems modeling the cardiac electric field at micro- and macroscopic level, in Evolution equations, semigroups and functional analysis (Milano, 2000), Progr. Nonlinear Differential Equations Appl. 50, Birkhäuser, Basel, 2002, 49–78. [12] J.-M. Coron, S. Guerrero, A singular optimal control: A linear 1-D parabolic hyperbolic example, Asymptot. Analisys, 44 (2005), 237–257. [13] E. Fernández-Cara, E. Zuazua, Null and approximate controllability for weakly blowing up semilinear heat equations, Ann. Inst. Henri Poincaré, Analise Non Linéaire, 17 (2000), 583–616. [14] A. V. Fursikov, O. Yu. Imanuvilov, Controllability of Evolution Equations, Lecture Notes Series 34, Research Institute of Mathematics, Seoul National University, Seoul, 1996. [15] M. González-Burgos, L. de Teresa, Controllability results for cascade systems of m coupled parabolic PDEs by one control force, Port. Math., 67 (2010), 91–113. [16] O. Glass, A complex-analytic approach to the problem of uniform controllability of a transport equation in the vanishing viscosity limit, J. Funct. Analysis, 358 (2010), 852–868. [17] I. L. Glicksberg, A further Generalization of the Kakutani fixed point theorem, with applications to Nash equilibrium points, Proc. Amer. Math. Soc., 3 (1952), 170–174. [18] M. González-Burgos, R. Pérez-Garcı́a, Controllability results for some nonlinear coupled parabolic systems by one control force, Asymptot. Anal., 46 (2)(2006), 123–162. [19] S. Guerrero, Introduction to the Controllability of Partial Differential Equations, Lectures at the Pan-American Advances Studies Institute, Santiago, Chile, 2012. [20] S. Guerrero, Null Controllability of some systems of two parabolic equations with one control force, SIAM J. Control Optim., 46 (2007), 379–394. [21] S. Guerrero, G. Lebeau, Singular Optimal Control for a Transport-Diffusion equation, Comm. Partial Diff. Equations, 32 (2007), 1813–1836. [22] C. S. Henriquez, Simulating the electrical behavior of cardiac tissue using the bidomain model, Crit. Rev. Biomed. Engr., 21 (1993), 1–77. [23] A. L. Hodgkin, A. F. Huxley, A quantitative description of membrane current and its application to conduction and excitation in nerve, J. Physiol., 117 (1952), 500–544. [24] O. Yu. Imanuvilov, M. Yamamoto, Carleman estimate for a parabolic equation in a Sobolev space of negative order and its applications, in Control of Nonlinear Distributed Parameter Systems (College Station, Tex, 1999), Lectures Notes in Pure and Appl. Math. 218, Marcel Dekker, New York, 2001, 113-137. [25] J. Keener, J. Sneyd, Mathematical physiology, Interdisciplinary Applied Mathematics 8, Springer-Verlag, New York, 1998. [26] E. F. Keller, L. A. Segel, Initiation of slime mold aggregation viewed as an instability, J. Theor. Biol., 26 (1970), 399–415. [27] K. Kunisch, M. Wagner, Optimal control of the bidomain system (I): The monodomain approximation with the RogersMcCulloch model, Nonlinear Analysis: Real World applications, 13 (2012), 1525–1550. 20 F. W. CHAVES-SILVA AND M. BENDAHMANE [28] O. A. Ladyzhenskaja, V. A. Solonnikov, N. N. Ural’ceva, Linear and Quasilinear equations of Parabolic type, 23 (Translated from the Russian by S. Smith), Translations of Mathematical Monographs, American Mathematical Society, Providence), 1967. [29] A. Lopez, X. Zhang, E. Zuazua, Null Controllability of the heat equation as singular limit of the exact controllability of dissipative wave equations, J. Math. Pures Appl., 79 (2000), 741–808. [30] A. Lopez, E. Zuazua, Null controllability of the 1 − d heat equation as a singular limit of the controllability of damped wave equations, C. R. Acad. Sci. Paris, 327 (1998), 753–758. [31] C.-H. Luo, Y. Rudy, A model of the ventricular cardiac action potential: Depolarization, repolarization, and their interaction, Circ Res., 68 (1991), 1501–1526. [32] D. Noble, A modification of the Hodgkin-Huxley equation applicable to Purkinje fibre action and pacemaker potentials, J. Physiol., 160 (1962), 317–352. [33] J.-P. Puel, Controllability of Partial Differential Equations, Lectures in the Universidade Federal do Rio de Janeiro, Rio de Janeiro, Brazil, 2002. [34] S. Sanfelici, Convergence of the Galerkin approximation of a degenerate evolution problem in electro-cardiology, Numer. Methods Partial Differential Equations, 18 (2002), 218–240. [35] L. Tung, A bidomain model for describing ischemic myocardial D-C potentials, PhD thesis, MIT, 1978. [36] M.Veneroni, Reaction-diffusion systems for the microscopic cellular model of the cardiac electric field, Math. Methods Appl.Sci., 29 (2006),1631–1661. [37] E. Zuazua, Exact boundary controllability of the semilinear wave equation, in Nonlinear Partial Differential Equations and their applications, Vol. 10, Pitman Res. Notes Math. Ser., 220, Longman, Harlow, UK, 357-391, 1991. (F. W. Chaves-Silva) Université de Nice Sophia-Antipolis, Laboratoire Jean Dieudonné, UMR CNRS 6621, Parc Valrose, 06108 Nice Cedex 02, France. E-mail address: [email protected] (M. Bendahmane) Institut Mathématiques de Bordeaux, Université Victor Segalen Bordeaux 2, 3 ter Place de la Victoire, 33076 Bordeaux, France. E-mail address: [email protected]
3cs.SY
State of the Art Review for Applying Computational Intelligence and Machine Learning Techniques to Portfolio Optimisation Evan Hurwitz School of Electrical and Information Engineering University of the Johannesburg Johannesburg, Gauteng, South Africa [email protected] Tshilidzi Marwala Faculty of Engineering University of Johannesburg Johannesburg, Gauteng, South Africa [email protected] Abstract Computational techniques have shown much promise in the field of Finance, owing to their ability to extract sense out of dauntingly complex systems. This paper reviews the most promising of these techniques, from traditional computational intelligence methods to their machine learning siblings, with particular view to their application in optimising the management of a portfolio of financial instruments. The current state of the art is assessed, and prospective further work is assessed and recommended. Keywords: reinforcement, learning, temporal, difference, neural, network, portfolio optimisation, genetic algorithm, genetic programming, markowitz portfolio theory, black-scholes, investment theory. 1 Introduction This paper is to serve as a literature review for a Phd thesis to be carried out at the University of Johannesburg. This paper is to examine the state of the art of machine learning and computational intelligence techniques to the task of portfolio optimisation. First the background of what precisely what constitutes computational intelligence and machine learning techniques will be explored, in addition to the successful implementations and applications of these techniques, and the facets that make them so promising. Following on that, the problem of portfolio optimisation will be defined, including current objections to the standard model . Current applications and research will then be evaluated, after which limitations will be examined, both technical limitations and industry limitations. Finally, further research will be recommended based on the findings detailed in the paper. 2 Background The field of portfolio optimisation is a field of immense importance to the economy of a country and indeed the global economy in general. Like it or not, the majority of stored money in the world, ranging from money in funds, in banks, in insurance schemes and more, is stored in portfolios of some sort or another, and therefore subject to all of the risks that financial markets pose. The management of these portfolios has therefore been a critical area of research ever since the inception of the marketplace, and the importance of this research is only increasing as financial instruments become ever more complex. The recent sub-prime crisis only further illustrates that our understanding of the systems we have created need further examination and understanding if we are to navigate these waters without bouncing from reef to reef. The fields of computational intelligence and machine learning are concerned with the modelling of systems, and in particular with modelling systems that prove difficult, if not impossible to model by conventional mathematical means. In the case of computational intelligence, this is done by observing and optimising hueristics based upon gathered data. Conversely, the field of machine learning relies on learning from observation, oftentimes involving online learning, ie learning while the process to be modelled is in action / operation. Both of these disciplines require relatively intensive computing power, and as such are only coming into their prime now, owing to the advances that have been made in the past two decades in computing power, and in particular said computing power’s ready availability to researchers. 3 Computational Intelligence A number of computational intelligence techniques will be examined in this section, including their strengths, weaknesses and typical applications. The broad purpose of these techniques is to solve either classification or regression problems in order to model a given system. These models can be used for prediction purposes, or further than that for system control purposes. 3.1 Genetic Algorithms (GA) Genetic algorithms attempt to imitate the evolutionary process of genetic evolution in order to optimise a given problem [1]. The problem is formalised by defining a fitness function, which determines a given value for the set of parameters to be optimised in such a way that maximising the value of this fitness function returns the optimal set of parameters [1]. The Algorithm derives its name from the manner in which it optimises its parameters. This is done by generating an initial population of possible solutions, and evaluating the fitness function for each possible solution [2]. These solutions are then used to generate a new population (each new population termed a generation), new individual solutions being generated by inheriting properties from its specific parents (choosing of parents can be done in many ways, as can the inheriting of features, but invariably the individuals with better fitness values are favoured by the chosen process) [2]. The precise choices of parent-selection-criteria and feature inheritance, as well as type of mutation (a random changing of a given value, used to explore further into the search-space) are all optimisation parameters that can be fine-tuned to optimise the process itself [2]. Genetic algorithms have found much success in optimising large searching systems that are difficult to quantify, and have in particular been very successful in the solving of Scheduling and Routing problems, in addition to financial applications [3]. A relatively recent offshoot of genetic algorithms is genetic programming [4], in which a problem-solving method, or policy, is evaluated and optimised by means of a genetic algorithm [4]. This in particular shows much promise in the Portfolio Optimisation realm for being able to combine multiple portfolio optimisation strategies into one coherent, optimised strategy. 3.2 Particle-Swarm Optimisation (PSO) Particle-swarm optimisation is another method of solving the same types of problems as genetic algorithms, based on the paths of swarms rather than on the workings of genetics [5]. A fitness function is defined in the same way as with a GA, but the optimisation instead follows the following formulae for the velocity and position of each particle (solution) [5]: vi , j = c 0 vi + c1r1 (GB j − x i , j ) + c 2 r2 (LBi , j − xi , j ) + c3 r3 (LBi , j − x1, j ) (1) xi , j = x i , j + v i , j (2) Where Ci are learning constants, and Ri being random vectors, typically between 0 and 1, and GB and LB represent Global Best and Local Best respectively [5]. Owing to its similarity to GAs in terms of function, PSOs have typically been applied to similar problems as GAs [6]. Both have also been applied to Portfolio Optimisation problems in various forms [7]. 3.3 Neural Networks (NN) The fundamental building-blocks of neural networks are neurons [8]. These neurons are simply a multiple-input, singleoutput mathematical function [8]. Each neuron has a number of weights connecting inputs from another layer to itself, which are then added together, possibly with a bias, the result of which is then passed into the neuron’s activation function [8]. The activation function is a function that represents the way in which the neural network “thinks”. Different activation functions lend themselves to different problem types, ranging from yes-or-no decisions to linear and nonlinear mathematical relationships. Each layer of a neural network is comprised of a finite number of neurons. A network may consist of any number of layers, and each layer may contain any number of neurons [8]. When a neural network is run, each neuron in each consecutive layer sums its inputs and multiplies each input by its respective weight, and then treats the weighted sum as an input to its activation function. The output will then be passed on as an input to the next layer, and so on until the final output layer is reached. Hence the input data is passed through a network of neurons in order to arrive at an output. Figure 1 illustrates an interconnected network, with 2 input neurons, three hidden layer neurons, and two output neurons. The hidden layer and output layer neurons can all have any of the possible activation functions. This type of neural network is referred to as a multi-layer perceptron [8], and while not the only configuration of neural network, it is the most widely used configuration for regression-type problems [8]. Figure 1. Sample Connectionist network Neural networks have a number of characteristic properties that mark them as ideal for modelling. Specifically, these characteristics are [9]: • Universal approximators • Generalisation • Pattern Recognition Neural Networks have been applied in a multitude of differing topologies, and to a wide variety of problems [10]. Many attempts have been made to apply Neural Networks to the problem of predicting stock-market prices, although with very limited success [11]. One problem that is often overlooked when applying neural networks is the implicit assumptions that data structuring has on the underlying problem – for example, many NN stock-market attempts have assumed a simple time-series approach, making the implicit assumption that the historical prices of a single equity are sufficient to predict its future value [12]. 4 Machine Learning Machine learning is a subset of computational intelligence [13]. It is a field specifically focusing on allowing a system to maximise some reward signal, and thereby learn to operate within its environment [13]. The complexity of the modelling system can vary greatly, allowing the researcher a high degree of customisable freedom, with appropriate trade-offs inherent to each specific choice [13]. 4.1 Reinforcement Learning Reinforcement learning is a specific form of machine learning, in which the system can only react to the reward signal it is given, and is not told by the engineer how to react given a specific result [13]. A typical reinforcement learning problem will have the following topology: Figure 2. Reinforcement Learning Topology. The reward signal R indicates the success / failure of the attempted policy’s action within the environment, as well as the degree thereof. The learning algorithm L defines how either the policy parameters are updated based on the reward signal R, or the environment model E is updated with respect to R. In this way, the policy P learns to exploit the environment with which it interacts, in fact bypassing the act of modelling the system and instead directly modelling its own control system for working within the system [13]. 4.2 On-Policy Versus Off-Policy Learning Depending on the level of generalisation built into the model, a reinforcement learning system may learn either on-policy or off-policy – that is, the learning may be specific to the policy tested in order to acquire a given reward signal, or alternatively the learning may generalise to situations beyond the specific policy that has been used. The advantage of offpolicy learning is that one can achieve far swifter learning, since every single scenario need not be encountered in order to learn to handle it [14]. The downside of off-policy learning is that learning can have unintended consequences since it applies to scenarios beyond that which has been observed [14]. In addition, models and learning algorithms both require greater complexity in order to successfully learn off-policy [14]. 4.3 Tabular Learning / Dynamic Programming This form of reinforcement learning is the simplest form. Each scenario is evaluated, and iteratively updated using an appropriate equation (such as the Bellman Equation) [14], in order to create a perfect model of the environment [14]. From this, a policy can be constructed to take advantage of the environment, picking the choice with the highest expected return. 4.4 Temporal Difference Learning Reinforcement learning involves the training of an artificial intelligence system by means of trial-and-error, reflecting the same manner of learning that living beings exhibit [14]. Reinforcement learning is very well suited to episodic tasks [14]. In reference to figure 2, Policy P would be represented by some appropriate function approximator, which would then be updated according to the chosen learning algorithm [14]. This methodology allows for real-time learning, and also eliminates the need for expert knowledge [14]. Recent work by Sutton, Svepesvari and Maei [15] has proven an algorithm for off-policy learning with a linear function approximator using temporal difference learning and allows for linear complexity in memory and per-time-step computation [15]. Current learning algorithms still struggle to remain stable when dealing with nonlinear function approximators [16] [17]. 5 Portfolio Theory Portfolio theory deals with the problem of allocating funds within a portfolio [18]. This problem is generalised to include any defined universe of financial instruments [18]. The goal of the portfolio optimisation problem is to achieve maximum return on investment for the minimum amount of risk [18]. Optimising this risk-reward trade-off forms the heart of portfolio theory, which is quite appropriate as this is the key question in the portfolio management industry, namely managing clients’ funds in such a way as to keep an appropriate level or risk while maximising the clients’ return on investment. 5.1 Modern Portfolio Theory (MPT) Centered around Markowitz’ theories [18], this forms the central tenet of modern investment theory [18]. Price moves within the market are assumed to be independent, stochastic events [18] and are then treated as random-walk problems [18] (in some literature referred to instead as Markov Decision Processes) following typical Brownian Motion. With this model, portfolios are then examined through a statistical framework, modelled only by two parameters, namely their mean return and their standard deviation, the latter of which is interpreted as the inherent riskiness of the examined asset [18]. By quantifying assets according to these two parameters, assets and strategies can be compared on a risk-adjusted reward basis, with efficient strategies being the highest reward for a given amount of risk [18]. Alternatively, fund managers of a targeted-return fund will attempt to achieve a specific return, striving for the lowest possible risk in a given portfolio. These optimal (efficient) strategies lie along the efficient horizon [18] as indicated in Figure 3. Figure 3. The Efficient Horizon, with strategies plotted according to return (R) and risk (σ) Unfortunately, the assumptions within the Markowitz framework have been seen to be invalid within the investment arena [19] [20] [21]. In particular, assumptions of independence, both to internal historical moves, and to external moves, have been seen to be false [21]. Similarly, the assumption of Brownian Motion in price moves does not hold up to scrutiny and in most cases grossly underestimates the extent of possible price swings [21], with the industry standard approach being to discard such events as outliers [21], even though they occur with too high a frequency to be validly treated as such [21]. 5.2 Post-Modern Portfolio Theory If one accepts the premise, as do many investors and investment houses, that returns above the expected return are not risky (or an indication of risk in the underlying instrument) then the use of variance as a measure of risk is in fact inappropriate [22]. Markowitz in fact recommended the use of semivariance as a measure of risk, but was of the opinion that the computational difficulties were too formidable [24]. This, unsurprisingly, is certainly no longer the case. Semivariance is a measure of the downside variance of a dataset, excluding values that are above the mean from the risk calculation [22]. With a different measure of risk formulated, one can then apply MPT as before, but now designed to only treat losses as risks, not gains [23]. 5.3 Quantifying Risk The task of quantifying risk is one of extreme importance to the financial industry, yet also extremely difficult [25]. In the field of portfolio management risk is specific to the amount of money one can expect to lose should the market not act favourably [25]. The traditional measure of risk, as has been mentioned in previous sections, is the statistically measurable standard deviation of a portfolio [22]. Application of this risk measure, however, uses the assumption of a normally distributed price moves [21], which has been shown historically to be an inaccurate and insufficient method of measuring risk [21]. One suggested method, recommended by Mandelbrot, is to use a fractal index as a measurement of risk, which is conceivably more reasonable due to it possessing a scaling property more indicative of real price moves than the static Gaussian distribution [21]. Note that this only applies to volatility risk, which does not encompass the entirety of the risk involved in investing [21]. 6 Portfolio Optimisation Portfolio optimisation is typically done by choosing a specific strategy (i.e. a mid cap fund, targeted return, etc) and then optimising the risk-reward ratio within the limitations of the particular strategy [26]. The strategy chosen will constrain the available instruments for the portfolio, while thereafter the optimisation will select from those available to create a portfolio [26]. As an example, consider a fund investing money on behalf of a pension fund. The money is required to grow, but is legally prohibited from selling short, and is mandated by the clients to have a relatively low level of risk, on the grounds that preserving capital is more important than superior growth. Lastly, if we assume the fund is a large fund, it will also have a liquidity limitation, on the grounds that if the fund manager should decide an asset needs to be sold, that buyers can be found for the amounts being held. (Small penny stocks are unlikely to be traded in the quantities required, and hence would be disqualified from the fund’s universe of stocks). The Manager would then plot the remaining instruments and strategies on a graph of risk versus reward (as in Figure 3) and then compile a portfolio based upon his research in order to comply with his given mandate [26]. This process will need to be re-done on a regular basis as the various instruments’ performance changes (changing their ratings) and as profits and losses change the composition of the portfolio, affecting its overall risk-reward ratio. 7 Applied Combinations Owing to the promising properties of machine learning and computational intelligence techniques, numerous attempts have been made to apply these techniques in the investment arena, with widely varying rates of success. Predictive methods have been attempted in numerous different formats, using genetic algorithms [27], neural networks [12] [28] and others. Attempts have also been made to utilise these techniques for option pricing [29], as an alternative to the BlackScholes and Monte-Carlo modelling approaches that are the current industry norm. Recently, Rosen and Saunders [30] have examined using analytical techniques for pricing collaterolised debt obligations (CDOs), although they also fall into the old trap assuming a normally distributed data set (in this case the creditworthiness of the constituents of the portfolio). The need for utilising systems that include the dependant nature of the market that the initial assumptions of Markowitz denies has been brought up again by Comte [31], looking specifically at long-term memory in volatility models. Neural network applications within finance have even been attempted as far afield as in marketing campaigns, such as the work done in [33] where notably a neural network-based approach was used to assign discounts in a marketing campaign in order to maximise its effectiveness. Notably, the researchers utilised machine learning to optimise the policy, but still kept the neural network model static once it had been trained [32]. Neely [33] used a genetic programming approach to find optimum trading rules, working with a technical analaysis (TA) basis, but found that their results were inferior to a simple buy-and-hold strategy. Allen and Karjalienen attempted a similar approach [34], using a genetic programming to tune technical trading rules, but in this case found that their approach actually lost money when backtested. It is notable that both approaches utilise only historical data of the actual to-be-traded security as inputs, and thus adhere to the assumption that individual price moves are independent events (an assumption quite vigorously challenged, as indicated earlier). Lin et al [37] attempted a similar approach, using genetic algorithms to fine-tune the parameters in TA-based trading strategies and Filter Rules. This research was evaluated using simulated trading in the Australian Stock Market [37]. The method was compared with a greedy algorithm providing optimal returns for efficiency comparison. The GA proved to be far more efficient than the greedy algorithm, accomplishing in 10 seconds what the greedy algorithm achieved in 10 hours [37]. The testing appears to also have been on a limited selection of stocks, and thus somewhat suspect. Cura [38] in turn investigated using a particle swarm optimisation approach, and compared it to GA, tabular search and simulated annealing aproaches, using the Markowitzmean model. While the PSO results were promising, no testing was done on real-world data [38]. More recently, Freitas et al [35] investigated using auto-regressive moving reference neural networks (AR-MRNNs) in order to predict price moves for short-term trading. They worked within the Markowitz framework, aiming to create an efficiently diversified portfolio, trading using the predictor based on the AR-MRNN. Not only did they manage to beat the mean-variance model, but also in fact beat the market (something that traditional portfolio theory states is impossible, based on the challenged assumptions detailed earlier) [35]. It is worth noting that even this highly promising result still used a relatively simple input-output structure, which limits the ability of the network. The necessity of adapting to changing market condition was explored by Nagayama and Yoshii [36] as they explored forgetting appropriate data in a binary classifier, in order adapt the classifier to changing conditions by forgetting data that was no longer relevant. The explored both active and passive agent forgetting in their trials, with promising results. It should be noted, however, that the test data used is very limited, and the results could very well be a feature of the data. 8 Application Limitations In the field of machine learning, it is still remarkably difficult to implement reinforcement learning when using nonlinear function approximators, such as neural networks [16]. This limitation makes application to nonstationary systems (as financial markets have shown themselves to be) a challenging endeavour. Sutton has recently managed to develop an algorithm for off-policy learning using temporal difference learning with a linear function approximator that allows for linear complexity in memory and per-time-step computation, almost but not quite enough to handle the nonlinear case of neural networks. A further limitation that has become apparent is the inadequacy of traditional risk measurement benchmarks, as their unrealistic assumptions taint the underlying analysis [21] [39]. The assumptions implicit in the Markowitz model are in fact no longer convenient, but now actually a hindrance to meaningful work. Much of the research is also out of touch with the realities of the investment world, concentrating on arbitrary measures of reward and only paying superficial attention to the issue of risk, which in reality dominates the 9 Recommended Research In this field, there is much scope for meaningful work that, if current tumbling financial markets are any indication, is desperately needed. The potential for machine-learning and computational intelligence techniques to perform predictionbased and classification-based portfolio optimisation is readily apparent owing to their various properties, and the various niches are beckoning. The development of an algorithm to perform temporal difference updates that remains stable for nonlinear function approximators would be an invaluable advance. For the tasks of predicting; modelling and classifying the markets, the space is open for research with far greater input space, in turn making fewer inherent assumptions about the market that are unlikely to hold up to scrutiny. In particular, the astonishingly common assumption that historical prices / price moves of a given financial instrument or index is sufficient to model its behaviour is ludicrous – the assumption that all information necessary is contained within is a rigid interpretation of the efficient market hypothesis, and one that does not bear up to scrutiny. While all information may be reflected in a price, it is obfuscated by overlying effects, and does not account at all for longer-term dynamics in the system, which cannot be ignored if a meaningful / useful model is to be developed. Further research into risk measurement is required, with fractal indexing being a particularly promising field currently. Modifying traditional risk measures to make fewer assumptions about the market also promises to be a fruitful area of research. Lastly, using computational intelligence and machine learning approaches, an adaptive portfolio optimiser is theoretically feasible, combining multiple trading strategies to create and maintain an optimised portfolio according to modern portfolio theory measures, while utilising objective measures of risk without unrealistic assumptions. References [1] Beasley, D., Bull, D.R., Martin, R.R., 1993. An overview of genetic algorithms: part I, fundamentals. University Computing 15, 58-69. [2] Beasley, D., Bull, D.R., Martin, R.R., 1993. An overview of genetic algorithms: part I, fundamentals. University Computing 15, 58-69. (GA Func Dets) [3] Chen, S. H. Genetic Algorithms and Genetic Programming in Computational Finance. Boston, MA: Kluwer. 2002 [4] Koza, J.R., 1992. Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, Cambridge. [5] J. Kennedy, R.C. Eberhart, Particle Swarm Optimization, in: Proc. IEEE Int’l Conf. on Neural Networks, vol. IV, 1995, pp. 1942–1948. [6] Margarita R; C Carlos. Multi-Objective Particle Swarm Optimizers: A survery of the State of the Art. International Journal of Computational Intelligence Research. 2006. Vol 2. Issue 3. [7] Tunchan Cura, Particle Swarm Optimization Approach to Portfolio Optimization. Nonlinear Analysis: Real World Applications. Elsevier. April 2008. [8] Wesley Hines J. Matlab supplement to Fuzzy and Neural Approaches in Engineering. John Wiley & Sons Inc. New York. 1997 [9] Miller, Sutton and Werbos. Neural Networks for Control. MIT Press. Cambridge, Massecheussettes. 1990 [10] Guoqiang Zhang, B. Eddy Patuwo, Michael Y. Hu. Forecasting with artificial neural networks: The state of the art. Elsevier 1998. International Journal of Forecasting. Vol 1. [11] Fernando Fernández-Rodríguez, Christian González-Martel and Simón Sosvilla-Rivero. On the profitability of Technical Trading Rules based on Artificial Neural Networks: Evidence from the Madrid Stock Market. Elsevier 2000. [12] Leke Betechuoh B, Marwala T. Optimization of the stock market input time-window using Bayesian neural networks. 2005 IEEE International Conference on Service Operations and Logistics, and Informatics , Beijing , Peoples Republic of China , August 10-12 2005, pp 883 to 888.. [13] Sutton, R. S. Learning to predict by the methods of temporal differences. Mach. Learning 3, (1988), 9-44 [14] Sutton, R. S, Barto A. G. Reinforcement learning: An Introduction, MIT press, 1998. [15] Sutton, R. S., Szepesvari, Cs., Maei, H. R. (2009). A Convergent O(n) Algorithm for Off-policy Temporal-difference Learning with Linear Function Approximation. In Advances in Neural Information Processing Systems 21, Vancouver, BC. December 2008. MIT Press.. [16] Hurwitz, Marwala. Optimising Reinforcement Learning for Neural Networks. Game-On 2005, Eurosis. (pp 13-18) [17] G. Tessauro. Temporal Difference Learning and TD-Gammon. Communications of the ACM. March 1995. Vol 38. No. 3. [18] H. Markowitz. Portfolio Selection: Efficient diversification of investments. B. Blackwell, Cambridge, MA, second edition edition, 1991. [19] B. G. Malkiel, The efficient market hypothesis and its critics, The Journal of Economic Perspectives 17 (1) (2003) 59–82. [20] E. F. Fama, Efficient capital markets II, Journal of Finance 46 (5) (1991) 1575–1617 [21] Benoit B Mandlebrot. The (Mis)behaviour of Markets: A Fractal view of Risk, Ruin and Reward. 2004. [22] Investment Analysis and Portfolio Management, Eighth Edition, by Frank K. Reilly, CFA and Keith C. Brown, CF. [23] H. Konno, H. Yamazaki, Mean-absolute deviation portfolio optimization model and its application to Tokyo stock market, Management Science 37 (1991) 519–531. [24] Balzer, L. A. (1994). Measuring Investment Risk: A Review. Journal of Investing [25] M. Fritelli, E. Rosazza Gianin, Putting order in risk measures, Journal of Banking and Finance 26 (2002) 1473– 1486 [26] E. J. Elton, M. J. Gruber, S. J. Brown, W. N. Goetzmann, Modern Portfolio Theory and Investment Analysis, 7th Edition, JohnWiley & Sons, Inc., 2007. [27] Bauer, R.J. Jr., 1994. Genetic Algorithms and Investment Strategies. Wiley, New York. [28] Kimoto, T. Asakawa, K. Yoda, M. Takeoka, M. Stock market prediction system with modular neural networks. International Joint Conference on Neural Networks. Vol 1. June 1990. [29] Pires M, Marwala T. American option pricing using Bayesian multi-layer perceptrons and Bayesian support vector machines. IEEE 3 rd International Conference on Computational Cybernetics , Mauritius , April 13-16 2005, pp 219 to 224. [30] Dan Rosen. David Saunders. Analytical Methods for Hedging Systematic Credit Risk with Linear Factor Portfolios. Journal of Economic Dynamics and Control. Elsevier. 2008 [31] Fabienne Comte Long MemoryIn Continuous-Time Stochastic Volatility Models.. Mathematical Finance. 1998 [32] Gabriel Gómez-Pérez a, José D. Martín-Guerrero a,*, Emilio Soria-Olivas a, Emili Balaguer-Ballester b, Alberto Palomares b, Nicolás Casariego Assigning Discounts in a Marketing Campaign Using Reinforcement Learning and Neural Nets. c. Expert Systems With Applications. Elsevier. 2009. [33] Neely, Christopher J.,Using Genetic Algorithms to Find Technical Trading Rules: A Comment on Risk Adjustment (October 27, 1999). Federal Reserve Bank of St. Louis Working Paper No. 99-015A. Available at SSRN: http://ssrn.com/abstract=189488 or DOI: 10.2139/ssrn.189488. [34] Franklin Allen; Risto Karjalainen Using genetic algorithms to Find technical trading rules.. Journal of Financial Economics 51. 1999. 245-271. [35] Fabio. D. Freitas; Alberto. F. de Souza; Ailson. R. de Almeida. Prediction-Based Portfolio Optimisation Using Neural Networks. Neurocomputing. Accepted August 2008. Elsevier. [36] Hirotaka Nagayama, Kengo Yoshii. Active Forgetting in Machine Learning and its Application to Financial Problems. 2000. IEEE [37] Li Lin, Longbing Cao, Jiaqi Wang, Chengqi Zhang. The Applications of Genetic Algorithms in Stock Market Data Mining Optimisation. Faculty of Information Technology, University of Technology, Sydney,NSW 2007, Australia Capital Market CRC, Sydney NSW 2000, Australia [38] Tunchan Cura. Particle Swarm Optimization Approach to Portfolio Optimization. Nonlinear Analysis: Real World Applications. Elsevier 2009. [39] Naomi Miller. Andrej Ruszcynski. Risk-adjusted probability measures in portfolio optimization with coherent measures of risk. European Journal of Operational Research. Elsevier 2008.
5cs.CE
1 Robust Large Margin Deep Neural Networks Jure Sokolić, Student Member, IEEE, Raja Giryes, Member, IEEE, arXiv:1605.08254v3 [stat.ML] 23 May 2017 Guillermo Sapiro, Fellow, IEEE, and Miguel R. D. Rodrigues, Senior Member, IEEE Abstract The generalization error of deep neural networks via their classification margin is studied in this work. Our approach is based on the Jacobian matrix of a deep neural network and can be applied to networks with arbitrary non-linearities and pooling layers, and to networks with different architectures such as feed forward networks and residual networks. Our analysis leads to the conclusion that a bounded spectral norm of the network’s Jacobian matrix in the neighbourhood of the training samples is crucial for a deep neural network of arbitrary depth and width to generalize well. This is a significant improvement over the current bounds in the literature, which imply that the generalization error grows with either the width or the depth of the network. Moreover, it shows that the recently proposed batch normalization and weight normalization re-parametrizations enjoy good generalization properties, and leads to a novel network regularizer based on the network’s Jacobian matrix. The analysis is supported with experimental results on the MNIST, CIFAR-10, LaRED and ImageNet datasets. Index Terms Deep learning, deep neural networks, generalization error, robustness. I. I NTRODUCTION In recent years, deep neural networks (DNNs) achieved state-of-the-art results in image recognition, speech recognition and many other applications [1]–[4]. DNNs are constructed as a series of non-linear J. Sokolić and M. R. D. Rodrigues are with the Department of Electronic and Electrical Engineering, Univeristy College London, London, UK (e-mail: {jure.sokolic.13, m.rodrigues}@ucl.ac.uk). R. Giryes is with the School of Electrical Engineering, Faculty of Engineering, Tel-Aviv University, Tel Aviv, Israel (e-mail: [email protected]). G. Sapiro is with the Department of Electrical and Computer Engineering, Duke University, NC, USA (e-mail: [email protected]). The work of Jure Sokolić and Miguel R. D. Rodrigues was supported in part by EPSRC under grant EP/K033166/1. The work of Raja Giryes was supported in part by GIF, the German-Israeli Foundation for Scientific Research and Development. The work of Guillermo Sapiro was supported in part by NSF, ONR, ARO, and NGA. May 24, 2017 DRAFT 2 signal transformations that are applied sequentially, where the parameters of each layer are estimated from the data [3]. Typically, each layer applies on its input a linear (or affine) transformation followed by a point-wise non-linearity such as the sigmoid function, the hyperbolic tangent function or the Rectified Linear Unit (ReLU) [5]. Many DNNs also include pooling layers, which act as down-sampling operators and may also provide invariance to various input transformations such as translation [6], [7]. They may be linear, as in average pooling, or non-linear, as in max-pooling. There were various attempts to provide a theoretical foundation for the representation power, optimization and generalization of DNNs. For example, the works in [8], [9] showed that neural networks with a single hidden layer – shallow networks – can approximate any measurable Borel function. On the other hand, it was shown in [10] that a deep network can divide the space into an exponential number of sets, which can not be achieved by shallow networks that use the same number of parameters. Similarly, the authors in [11] conclude that functions implemented by DNNs are exponentially more expressive than functions implemented by shallow networks. The work in [12] shows that for a given number of parameters and a given depth, there always exists a DNN that can be approximated by a shallower network only if the number of parameters in the shallow network is exponential in the number of layers of the deep network. Scattering transform - a convolutional DNN like transform, which is based on the wavelet transform and pointwise non-linearities - provides insights into translation invariance and stability to deformations of convolutional DNNs [13]–[15]. DNNs with random weights are studied in [16], where it is shown that such networks perform distance preserving embedding of low-dimensional data manifolds. The authors in [17] model a loss function of DNN with a spin-glass model and show that for large networks the local optima of the loss function are close to the global optima. Optimization aspects of DNNs are studied from the perspective of tensor factorization in [18] where it is shown that if a network is large, then it is possible to find the global minima from any initialization with a gradient descent algorithm. The role of DNNs in improving convergence speed of various iterative algorithms is studied in [19]. Optimization dynamics of a deep linear network is studied in [20], where it is shown that the learning speed of deep networks may be independent of their depth. Reparametrization of DNN for more efficient learning is studied in depth in [21]. A modified version of stochastic gradient descent for optimization of DNNs that are invariant to weight rescaling in different layers is proposed in [22], where it is shown that such an optimization may lead to a smaller generalization error (GE) - the difference between the empirical error and the expected error, than the one achieved with the classical stochastic gradient descent. The authors in [23] propose the batch normalization – a technique that normalizes the output of each layer and leads to faster training and also a smaller GE. A similar technique based on normalization of May 24, 2017 DRAFT 3 the weight matrix rows is proposed in [24]. It is shown empirically that such reparametrization leads to a faster training and a smaller GE. Learning of DNN by bounding the spectral norm of the weight matrices is proposed in [25]. Other methods for DNN regularization include weight decay, dropout [26], constraining the Jacobian matrix of encoder for regularization of auto-encoders [27], and enforcing a DNN to be a partial isometry [28]. An important theoretical aspect of DNNs is the effect of their architecture, e.g. depth and width, on their GE. Various measures such as the VC-dimension [29], [30], the Rademacher or Gaussian complexities [31] and algorithmic robustness [32] have been used to bound the GE in the context of DNNs. For example, the VC-dimension of DNN with the hard-threshold non-linearity is equal to the number of parameters in the network, which implies that the sample complexity is linear in the number of parameters of the network. The GE can also be bounded independently of the number of parameters, provided that the norms of the weight matrices (the network’s linear components) are constrained appropriately. Such constraints are usually enforced by training networks with weight decay regularization, which is simply the `1 - or `2 -norm of all the weights in the network. For example, the work [33] studies the GE of DNN with ReLUs and constraints on the norms of the weight matrices. However, it provides GE bounds that scale exponentially with the network depth. Similar behaviour is also depicted in [34]. The authors in [32] show that DNNs are robust provided that the `1 -norm of the weights in each layer is bounded. The bounds are exponential in the `1 -norm of the weights if the norm is greater than 1. The GE bounds in [30], [32], [33] suggest that the GE of a DNN is bounded only if the number of training samples grows with the DNN depth or size. However, in practice increasing network’s depth or size often leads to a lower GE [4], [35]. Moreover, recent work in [36] shows that a 2 layer DNN with ReLUs may fit any function of n samples in d dimensions provided that it has 2n + d parameters, which is often the case in practice. They show that the nature of the GE depends more on the nature of the data than on the architecture of the network as the same network is able to fit both structured data and random data, where for the first the GE is very low and for the latter it is very large. The authors conclude that data agnostic measures such as the Rademacher complexity or VC-dimension are not adequate to explain the good generalization properties of modern DNN. Our work complements the previous works on the GE of DNNs by bounding the GE in terms of the DNN classification margin, which is independent of the DNN depth and size, but takes into account the structure of the data (considering its covering number) and therefore avoids the issues presented above. The extension of our results to invariant DNN is provided in [37]. May 24, 2017 DRAFT 4 A. Contributions In this work we focus on the GE of a multi-class DNN classifier with general non-linearities. We establish new GE bounds of DNN classifiers via their classification margin, i.e. the distance between the training sample and the non-linear decision boundary induced by the DNN classifier in the sample space. The work capitalizes on the algorithmic robustness framework in [32] to cast insight onto the generalization properties of DNNs. In particular, the use of this framework to understand the operation of DNNs involves various innovations, which include: • We derive bounds for the GE of DNNs by lower bounding their classification margin. The lower bound of the classification margin is expressed as a function of the network’s Jacobian matrix. • Our approach includes a large class of DNNs. For example, we consider DNNs with the softmax layer at the network output; DNNs with various non-linearities such as the Rectified Linear Unit (ReLU), the sigmoid and the hyperbolic tangent; DNNs with pooling, such as down-sampling, average pooling and max-pooling; and networks with shortcut connections such as Residual Networks [4]. • Our analysis shows that the GE of a DNN can be bounded independently of its depth or width provided that the spectral norm of the Jacobian matrix in the neighbourhood of the training samples is bounded. We argue that this result gives a justification for a low GE of DNNs in practice. Moreover, it also provides an explanation for why training with the recently proposed weight normalization or batch normalization can lead to a small GE. In such networks the `2 -norm of the weight matrices is fixed and `2 -norm regularization does not apply. The analysis also leads to a novel Jacobian matrix-based regularizer, which can be applied to weight normalized or batch normalized networks. • We provide a series of examples on the MNIST, CIFAR-10, LaRED and ImageNet datasets that validate our analysis and demonstrate the effectiveness of the Jacobian regularizer. Our contributions differ from the existing works in many ways. In particular, the GE of DNNs has been studied via the algorithmic robustness framework in [32]. Their bounds are based on the per-unit `1 -norm of the weight matrices, and the studied loss is not relevant for classification. Our analysis is much broader, as it aims at bounding the GE of 0-1 loss directly and also considers DNNs with pooling. Moreover, our bounds are a function of the network’s Jacobian matrix and are tighter than the bounds based on the norms of the weight matrices. The work in [28] shows that learning transformations that are locally isometric is robust and leads to a small GE. Though they apply the proposed technique to DNNs they do not show how the DNN architecture affects the GE as our work does. The authors in [25] have observed that contractive DNNs with ReLUs trained with the hinge loss lead May 24, 2017 DRAFT 5 to a large classification margin. However, they do not provide any GE bounds. Moreover, their results are limited to DNNs with ReLUs, whereas our analysis holds for arbitrary non-linearities, DNNs with pooling and DNNs with the softmax layer. The work in [27] is related to ours in the sense that it proposes to regularize auto-encoders by constraining the Frobenious norm of the encoder’s Jacobian matrix. However, their work is more empirical and is less concerned with the classification margin or GE bounds. They use the Jacobian matrix to regularize the encoder whereas we use the Jacobian matrix to regularize the entire DNN. Finally, our DNN analysis, which is based on the network’s Jacobian matrix, is also related to the concept of sensitivity analysis that has been applied to feature selection for SVM and neural networks [38], [39], and for the construction of radial basis function networks [40], since the spectral norm of the Jacobian matrix quantifies the sensitivity of DNN output with respect to the input perturbation. B. Paper organization Section II introduces the problem of generalization error, including elements of the algorithmic robustness framework, and introduces DNN classifiers. Properties of DNNs are described in Section III. The bounds on the classification margin of DNNs and their implication for the GE of DNNs are discussed in Section IV. Generalizations of our results are discussed in Section V. Section VI presents experimental results. The paper is concluded in Section VII. The proofs are deferred to the Appendix. C. Notation We use the following notation in the sequel: matrices, column vectors, scalars and sets are denoted by boldface upper-case letters (X), boldface lower-case letters (x), italic letters (x) and calligraphic upper-case letters (X ), respectively. The convex hull of X is denoted by conv(X ). IN ∈ RN ×N denotes the identity matrix, 0M ×N ∈ RM ×N denotes the zero matrix and 1N ∈ RN denotes the vector of ones. The subscripts are omitted when the dimensions are clear from the context. ek denotes the k -th basis vector of the standard basis in RN . kxk2 denotes the Euclidean norm of x, kXk2 denotes the spectral norm of X, and kXkF denotes the Frobenious norm of X. The i-th element of the vector x is denoted by (x)i , and the element of the i-th row and j -th column of X is denoted by (X)ij . The covering number of X with d-metric balls of radius ρ is denoted by N (X ; d, ρ). II. P ROBLEM S TATEMENT We start by describing the GE in the framework of statistical learning. Then, we dwell on the GE bounds based on the robustness framework by Xu and Manor [32]. Finally, we present the DNN architectures studied in this paper. May 24, 2017 DRAFT 6 A. The Classification Problem and Its GE We consider a classification problem, where we observe a vector x ∈ X ⊆ RN that has a corresponding class label y ∈ Y . The set X is called the input space, Y = {1, 2, . . . , NY } is called the label space and NY denotes the number of classes. The samples space is denoted by S = X × Y and an element of S is denoted by s = (x, y). We assume that samples from S are drawn according to a probability distribution m P defined on S . A training set of m samples drawn from P is denoted by Sm = {si }m i=1 = {(xi , yi )}i=1 . The goal of learning is to leverage the training set Sm to find a classifier g(x) that provides a label estimate ŷ given the input vector x. In this work the classifier is a DNN, which is described in detail in Section II-C. The quality of the classifier output is measured by the loss function `(g(x), y), which measures the discrepancy between the true label y and the estimated label ŷ = g(x) provided by the classifier. Here we take the loss to be the 0-1 indicator function. Other losses such as the hinge loss or the categorical cross entropy loss are possible. The empirical loss of the classifier g(x) associated with the training set and the expected loss of the classifier g(x) are defined as `emp (g) = 1/m X ` (g(xi ), yi ) (1) si ∈Sm and `exp (g) = Es∼P [` (g(x), y)] , (2) respectively. An important question, which occupies us throughout this work, is how well lemp (g) predicts lexp (g). The measure we use for quantifying the prediction quality is the difference between lexp (g) and lemp (g), which is called the generalization error: GE(g) = |`exp (g) − `emp (g)| . (3) B. The Algorithmic Robustness Framework In order to provide bounds to the GE for DNN classifiers we leverage the robustness framework [32], which is described next. The algorithmic robustness framework provides bounds for the GE based on the robustness of a learning algorithm that learns a classifier g leveraging the training set Sm : May 24, 2017 DRAFT 7 Definition 1 ( [32]). Let Sm be a training set and S the sample space. A learning algorithm is (K, (Sm ))robust if the sample space S can be partitioned into K disjoint sets denoted by Kk , k = 1, . . . , K , Kk ⊆ S, k = 1, . . . , K, (4) S = ∪K k=1 Kk , Kk ∩ Kk0 = ∅, (5) ∀k 6= k 0 , (6) such that for all si ∈ Sm and all s ∈ S si = (xi , yi ) ∈ Kk ∧ s = (x, y) ∈ Kk =⇒ |`(g(xi ), yi ) − `(g(x), y)| ≤ (Sm ) . (7) Note that si is an element of the training set and s is an arbitrary element of the sample space S . Therefore, a robust learning algorithm chooses a classifier g for which the losses of any s and si in the same partition Kk are close. The following theorem provides the GE bound for robust algorithms.1 Theorem 1 (Theorem 3 in [32]). If a learning algorithm is (K, (Sm ))-robust and `(g(x), y) ≤ M for all s = (x, y) ∈ S , then for any δ > 0, with probability at least 1 − δ , r 2K log(2) + 2 log(1/δ) . GE(g) ≤ (Sm ) + M m (8) The first term in the GE bound in (8) is constant and depends on the training set Sm . The second term √ behaves as O(1/ m) and vanishes as the size of the training set Sm approaches infinity. M = 1 in the case of 0-1 loss, and K corresponds to the number of partitions of the samples space S . A bound on the number of partitions K can be found by the covering number of the samples space S . The covering number is the smallest number of (pseudo-)metric balls of radius ρ needed to cover S , and it is denoted by N (S; d, ρ), where d denotes the (pseudo-)metric.2 The space S is the Cartesian product of a continuous input space X and a discrete label space Y , and we can write N (S; d, ρ) ≤ NY · N (X ; d, ρ), where NY corresponds to the number of classes. The choice of metric d determines how efficiently one may cover X . A common choice is the Euclidean metric d(x, x0 ) = kx − x0 k2 , , x, x0 ∈ X , (9) which we also use in this paper. The covering number of many structured low-dimensional data models can be bounded in terms of their “intrinsic” properties, for example: 1 Additional variants of this theorem are provided in [32]. 2 Note that we can always obtain a set of disjoint partitions from the set of metric balls used to construct the covering. May 24, 2017 DRAFT 8 • a Gaussian mixture model (GMM) with L Gaussians and covariance matrices of rank at most k leads to a covering number N (X ; d, ρ) = L(1 + 2/ρ)k [41]; • k -sparse signals in a dictionary with L atoms have a covering number N (X ; d, ρ) = L k  (1 + 2/ρ)k [16]; • CM regular k -dimensional manifold, where CM is a constant that captures its “intrinsic” properties,  k [42]. has a covering number N (X ; d, ρ) = CρM 1) Large Margin Classifier: An example of a robust learning algorithm is the large margin classifiers, which we consider in this work. The classification margin is defined as follows: Definition 2 (Classification margin). The classification margin of a training sample si = (xi , yi ) measured by a metric d is defined as γ d (si ) = sup{a : d(xi , x) ≤ a =⇒ g(x) = yi ∀x} . (10) The classification margin of a training sample si is the radius of the largest metric ball (induced by d) in X centered at xi that is contained in the decision region associated with class label yi . The robustness of large margin classifiers is given by the following Theorem. Theorem 2 (Adapted from Example 9 in [32]). If there exists γ such that γ d (si ) > γ > 0 ∀si ∈ Sm , (11) then the classifier g(x) is (NY · N (X ; d, γ/2), 0)-robust. Theorems 1 and 2 imply that the GE of a classifier with margin γ is upper bounded by (neglecting the log(1/δ) term in (8)) 1 p 2 log(2) · NY · N (X ; d, γ/2) . GE(g) . √ m (12) Note that in case of a large margin classifier the constant (Sm ) in (8) is equal to 0, and the GE approaches √ zero at a rate m as the number of training samples grows. The GE also increases sub-linearly with the number of classes NY . Finally, the GE depends on the complexity of the input space X and the classification margin via the covering number N (X ; d, γ/2). For example, if we take X to be a CM regular k -dimensional manifold then the upper bound to the GE behaves as: May 24, 2017 DRAFT 9 x φ1 (x, θ1 ) z1 φ2 (z1 , θ2 ) φL (zL−1 , θL ) z Fig. 1. DNN transforms the input vector x to the feature vector z by a series of (non-linear) transforms. Corollary 1. Assume that X is a (subset of) CM regular k -dimensional manifold, where N (X ; d, ρ) ≤  k CM . Assume also that classifier g(x) achieves a classification margin γ and take `(g(xi ), yi ) to be ρ the 0-1 loss. Then for any δ > 0, with probability at least 1 − δ , s r log(2) · NY · 2k+1 · (CM )k 2 log(1/δ) + GE(g) ≤ . k m γ m (13) Proof: The proof follows directly from Theorems 1 and 2. Note that the role of the classifier is captured via the achieved classification margin γ . If we can always ensure a classification margin γ = 1, then the GE bound only depends on the dimension of the manifold k and the manifold constant CM . We relate this bound, in the context of DNNs, to other bounds in the literature in Section IV. C. Deep Neural Network Classifier The DNN classifier is defined as g(x) = arg max(f (x))i , (14) i∈[NY ] where (f (x))i is the i-th element of the NY dimensional output of a DNN f : RN → RNY . We assume that f (x) is composed of L layers: f (x) = φL (φL−1 (· · · φ1 (x, θ1 ), · · · θL−1 ), θL ) , (15) where φl (·, θl ) represents the l-th layer with parameters θl , l = 1, . . . , L. The output of the l-th layer is denoted by zl , i.e. zl = φl (zl−1 , θl ), zl ∈ RMl ; the input layer corresponds to z0 = x; and the output of the last layer is denoted by z = f (x). Such a DNN is visualized in Fig. 1. Next, we define various layers φl (·, θl ) that are used in the modern state-of-the-art DNNs. 1) Linear and Softmax Layers: We start by describing the last layer of a DNN that maps the output of previous layer into RNY , where NY corresponds to the number of classes.3 This layer can be linear: z = ẑ, 3 ẑ = WL zL−1 + bL , (16) Assuming that there are NY one-vs.-all classifiers. May 24, 2017 DRAFT 10 TABLE I P OINT- WISE NON - LINEARITIES Name Function: σ(x) ReLU max(x, 0) Sigmoid 1 1+e−x Hyperbolic tangent tanh(x) = Derivative: d dx σ(x) Derivative bound: supx {1 if x > 0; 0 if x ≤ 0} σ(x)(1 − σ(x)) = ex −e−x ex +e−x e−x (1+e−x )2 1 − σ(x)2 d dx σ(x) ≤1 ≤ 1 4 ≤1 where WL ∈ RNY ×ML−1 is the weight matrix associated with the last layer and b ∈ RNY is the bias vector associated with the last layer. Note that according to (14), the i-th row of WL can be interpreted as a normal to the hyperplane that separates class i from the others. If the last layer is linear the usual choice of learning objective is the hinge loss. A more common choice for the last layer is the softmax layer:   z = ζ(ẑ) = eẑ / 1T eẑ , ẑ = WL zL−1 + bL , (17) where ζ(·) is the softmax function and WL and bL are the same as in (16). Note that the exponential is applied element-wise. The elements of z are in range (0, 1) and are often interpreted as “probabilites” associated with the corresponding class labels. The decision boundary between class y1 and class y2 corresponds to the hyperplane {z : (z)y1 = (z)y2 }. The softmax layer is usually coupled with categorical cross-entropy training objective. For the remainder of this work we will take the softmax layer as the last layer of DNN, but note that all results still apply if the linear layer is used. 2) Non-linear layers: A non-linear layer is defined as zl = [ẑl ]σ = [Wl zl−1 + bl ]σ , (18) where [ẑl ]σ represents the element-wise non-linearity applied to each element of ẑl ∈ RMl , and ẑl represents the linear transformation of the layer input: ẑl = Wl zl−1 + bl . Wl ∈ RMl ×Ml−1 is the weight matrix and bl ∈ RMl is the bias vector. The typical non-linearities are the ReLU, the sigmoid and the hyperbolic tangent. They are listed in Table I. The choice of non-linearity σ is usually the same for all the layers in the network. Note that the non-linear layer in (18) includes the convolutional layers which are used in the convolutional neural networks. In that case the weight matrix is block-cyclic. May 24, 2017 DRAFT 11 Class 1 Class 2 0.6 Class 1 Class 2 0.7 0.4 0.6 0.2 γ d (si ) 0.5 (z) 2 (x) 2 0.0 0.2 0.3 0.4 0.2 0.6 0.1 0.8 1.0 0.8 0.4 0.0 0.6 0.4 0.2 0.0 0.2 (x) 1 0.4 0.6 0.8 1.0 0.0 (a) Input space. 0.1 0.2 0.3 (z) 1 0.4 0.5 0.6 (b) Output space. Fig. 2. Decision boundaries in the input space and in the output space. Plot (a) shows samples of class 1 and 2 and the decision regions produced by a two-layer network projected into the input space. Plot (b) shows the samples transformed by the network and the corresponding decision boundary at the network output. 3) Pooling layers: A pooling layer reduces the dimension of intermediate representation and is defined as zl = Pl (zl−1 )zl−1 , (19) where Pl (zl−1 ) is the pooling matrix. The usual choices of pooling are down-sampling, max-pooling and average pooling. We denote by pli (zl−1 ) the i-th row of Pl (zl−1 ) and assume that there are Ml pooling regions Pi , i = 1, . . . , Ml . In the case of down-sampling pli (zl−1 ) = ePi (1) , where Pi (1) is the first element of the pooling region Pi ; in the case of max-pooling pli (zl−1 ) = ej ? , where j ? = arg maxj 0 ∈Pi |(zl−1 )j 0 |; P and in the case of average pooling pli (zl−1 ) = |P1i | j∈Pi ej . III. T HE G EOMETRICAL P ROPERTIES OF D EEP N EURAL N ETWORKS The classification margin introduced in Section II-A is a function of the decision boundary in the input space. This is visualized in Fig. 2 (a). However, a training algorithm usually optimizes the decision boundary at the network output (Fig. 2 (b)), which does not necessarily imply a large classification margin. In this section we introduce a general approach that allows us to bound the expansion of distances between the network input and its output. In Section IV we use this to establish bounds of the classification margin and the GE bounds that are independent of the network depth or width. We start by defining the Jacobian matrix (JM) of the DNN f (x): L J(x) = df (x) Y dφl (zl−1 ) dφ1 (x) = · . dx dx dzl−1 (20) l=1 May 24, 2017 DRAFT 12 Note that by the properties of the chain rule, the JM is computed as the product of the JMs of the individual network layers, evaluated at the appropriate values of the layer inputs x, z1 , . . . , zL−1 . We use the JM to establish a relation between a pair of vectors in the input space and the output space. Theorem 3. For any x, x0 ∈ X and a DNN f (·), we have Z 1 0 f (x ) − f (x) = J(x + t(x0 − x)) dt (x0 − x) (21) 0 = Jx,x0 (x0 − x), (22) where 1 Z Jx,x0 = J(x + t(x0 − x)) dt (23) 0 is the average Jacobian on the line segment between x and x0 . Proof: The proof appears in Appendix A. As a direct consequence of Theorem 3 we can bound the distance expansion between x and x0 at the output of the network f (·): Corollary 2. For any x, x0 ∈ X and a DNN f (·), we have kf (x0 ) − f (x)k2 = kJx,x0 (x0 − x)k2 ≤ sup kJ(x00 )k2 kx0 − xk2 . (24) x00 ∈conv(X ) Proof: The proof appears in Appendix B. Note that we have established that Jx,x0 corresponds to a linear operator that maps the vector x0 − x to the vector f (x0 ) − f (x). This implies that the maximum distance expansion of the network f (x) is bounded by the maximum spectral norm of the network’s JM. Moreover, the JM of f (x) corresponds to the product of JMs of all the layers of f (x) as shown in (20). It is possible to calculate the JMs of all the layers defined in Section II-C: 1) Jacobian Matrix of Linear and Softmax Layers: The JM of the linear layer defined in (16) is equal to the weight matrix dz = WL . dzL−1 (25) Similarly, in the case of softmax layer defined in (17) the JM is dz dz dẑ = · L−1 L−1 dz dẑ dz  = −ζ(ẑ)ζ(ẑ)T + diag(ζ(ẑ) · WL . (26)  Note that −ζ(ẑ)ζ(ẑ)T + diag(ζ(ẑ) corresponds to the JM of the softmax function ζ(ẑ). May 24, 2017 DRAFT 13 2) Jacobian Matrix of Non-Linear Layers: The JM of the non-linear layer (18) can be derived in the same way as the JM of the softmax layer. We first define the JM of the point-wise non-linearity, which is a diagonal matrix4  dzl dẑl  ii  dσ (ẑl )i = , d(ẑl )i i = 1, . . . , Ml . (27) The derivatives associated with various non-linearities are provided in Table I. The JM of the non-linear layer can be expressed as dzl dzl = · Wl . dẑl−1 dẑl (28) 3) Jacobian Matrix of Pooling Layers: The pooling operator defined in (19) is linear or a piece-wise linear operator. The corresponding JM is therefore also linear or piece-wise linear and is equal to: Pl (zl−1 ) . (29) The following Lemma collects the bounds on the spectral norm of the JMs for all the layers defined in Section II-C. Lemma 1. The following statements hold: 1) The spectral norm of JMs of the linear layer in (16), the softmax layer in (17) and non-linear layer in (18) with the ReLU, Sigmoid or Hyperbolic tangent non-linearities is upper bounded by dzl dẑl−1 ≤ kWl k2 ≤ kWl kF . (30) 2 2) Assume that the pooling regions of the down-sampling, max-pooling and average pooling operators are non-overlapping. Then the spectral norm of their JMs can be upper bounded by dzl dẑl−1 ≤ 1. (31) 2 Proof: The proof appears in Appendix C. Lemma 1 shows that the spectral norms of all layers can be bounded in terms of their weight matrices. As a consequence, the spectral norm of the JM is bounded by the product of the spectral norms of the weight matrices. We leverage this facts to provide GE bounds in the next section. 4 Note that in case of ReLU the derivative of max(x, 0) is not defined for x = 0, and we need to use subderivatives (or subgradients) to define the JM. We avoid this technical complication and simply take the derivative of max(x, 0) to be 0 when x = 0. Note that this does not change the results in any way because the subset of X for which the derivatives are not defined has zero measure. May 24, 2017 DRAFT 14 We also briefly explore a relationship between the Jacobian matrix and the Fisher information matrix. To simplify the derivations we assume M = 1, N = 1, x0 = x + θn and n ∼ N (0, 1), where θ is the model parameter and x is deterministic. The Fisher information F (θ) measures how much information about the parameter θ is contained in the random variable y = f (x0 ), where f represents a DNN. In this particular case the Fisher information is given as "  # d log f (x0 ) 2 F (θ) = En dθ "  # d log f (x0 ) df (x0 ) dx0 2 = En df (x0 ) dx0 θ " 2 # d log f (x0 ) 0 . = En J(x )n df (x0 ) (32) In our setup the parameter θ can be interpreted as a magnitude of the input perturbation. It is clear from (32) that a small norm of the Jacobian matrix leads to a small Fisher information, which indicates that the distribution of y is not very informative about the parameters θ. By ensuring that the norm of the Jacobian is small we then naturally endow the network with robustness against perturbations of the input. IV. G ENERALIZATION ERROR OF A D EEP N EURAL N ETWORK C LASSIFIER In this section we provide the classification margin bounds for DNN classifiers that allow us to bound the GE. We follow the common practice and assume that the networks are trained by a loss that promotes separation of different classes at the network output, e.g. categorical cross entropy loss or the hinge loss. In other words, the training aims at maximizing the score of each training sample, where the score is defined as follows. Definition 3 (Score). Take score of a training sample si = (xi , yi ) √ o(si ) = min 2(δ yi − δ j )T f (xi ) , j6=yi (33) where δ i ∈ RNY is the Kronecker delta vector with (δ i )i = 1. Recall the definition of the classifier g(x) in (14) and note that the decision boundary between class i and class j in the feature space Z is given by the hyperplane {z : (z)i = (zj )}. A positive score indicates that at the network output, classes are separated by a margin that corresponds to the score. However, a large score o(si ) does not necessarily imply a large classification margin γ d (si ). Theorem 4 provides classification margin bounds expressed as a function of the score and the properties of the network. May 24, 2017 DRAFT 15 Theorem 4. Assume that a DNN classifier g(x), as defined in (14), classifies a training sample xi with the score o(si ) > 0. Then the classification margin can be bounded as γ d (si ) ≥ ≥ o(si ) supx:kx−xi k2 ≤γ d (si ) kJ(x)k2 , γ1d (si ) (34) o(si ) , γ2d (si ) supx∈conv(X ) kJ(x)k2 (35) ≥Q o(si ) , γ3d (si ) kW k l 2 Wl ∈W (36) ≥Q o(si ) , γ4d (si ) , kW k l F Wl ∈W (37) where W is the set of all weight matrices of f (x). Proof: The proof appears in Appendix D. Given the bounds of the classification margin we can specialize Corollary 1 to DNN classifiers. Corollary 3. Assume that X is a (subset of) CM regular k -dimensional manifold, where N (X ; d, ρ) ≤  k CM . Assume also that DNN classifier g(x) achieves a lower bound to the classification margin ρ γbd (si ) > γb for b ∈ {1, 2, 3, 4}, ∀si ∈ Sm and take `(g(xi ), yi ) to be the 0-1 loss. Then for any δ > 0, with probability at least 1 − δ , s GE(g) ≤ log(2) · NY · 2k+1 · (CM )k + γbk m r 2 log(1/δ) . m (38) Proof: The proof follows from Theorems 1, 2 and 4. Corollary 3 suggests that the GE will be bounded by C √1m γ −k/2 , where C = p log(2) · NY 2k+1 (CM )k , provided that the classification margin bounds satisfy γbd (si ) > γ for some b ∈ {1, 2, 3, 4}, ∀si ∈ Sm . We now leverage the classification margin bounds in Theorem 4 to construct constraint sets Wb = {Wl ∈ W : γbd (si ) > γ∀si }, b ∈ 1, 2, 3, 4 such that W ∈ Wb ensures that the GE is bounded by May 24, 2017 DRAFT 16 C √1m γ −k/2 . Using (34)-(37) we obtain  W1 = Wl ∈ W : sup x:kx−xi k2 ≤γ d (si ) kJ(x)k2 < γ · o(si ) ∀si = (xi , yi ) ,  W2 = Wl ∈ W : sup x∈conv(X ) (39) kJ(x)k2 < γ · o(si ) ∀si = (xi , yi ) , (40) Y  W3 = Wl ∈ W : kWl k2 < γ · o(si ) Wl ∈W ∀si = (xi , yi ) , (41) Y  kWl kF < γ · o(si ) W4 = Wl ∈ W : Wl ∈W ∀si = (xi , yi ) . (42) Note that while we want to maximize the score o(si ), we also need to constrain the network’s Jacobian matrix J(x) (following W1 and W2 ) or the weight matrices Wl ∈ W (following W3 and W4 ). This stands in line with the common training rationale of DNN in which we do not only aim at maximizing the score of the training samples to ensure a correct classification of the training set, but also have a regularization that constrains the network parameters, where this combination eventually leads to a lower GE. The constraint sets in (39)-(42) impose different regularization techniques: • The term supx:kx−xi k2 ≤γ d (si ) kJ(x)k2 < γ · o(si ) in (39) considers only the supremum of the spectral norm of the Jacobian matrix evaluated at the points within Ni = {x : kx − xi k2 ≤ γ d (si )}, where γ d (si ) is the classification margin of training sample si (see Definition 2). We can not compute the margin γ d (si ), but can still obtain a rationale for regularization: as long as the spectral norm of the Jacobian matrix is bounded in the neighbourhood of a training sample xi given by Ni we will have the GE guarantees. • The constraint on the Jacobian matrix supx∈conv(X ) kJ(x)k2 < γ · o(si ) in (40) is more restrictive as • it requires bounded spectral norm for all samples x in the convex hull of the input space X . Q Q The constraints in (41) and (42) are of similar form, Wl ∈W kWl k2 < γ·o(si ) and Wl ∈W kWl kF < γ · o(si ), respectively. Note that the weight decay, which aims at bounding the Frobenious norms of the weight matrices might be used to satisfy the constrains in (42). However, note also that the bound based on the spectral norm in (41) is tighter than one based on the Frobenious norm in (42). For example, take Wl ∈ W to have orthonormal rows and be of dimension M × M . Then the constraint in (41), which is based on the spectral norm, is of the form 1 < γo(si ) and the constraint in (42), which is based on the Frobenious norm, is M L/2 < γo(si ). In the former case we have May 24, 2017 DRAFT 17 a constraint on the score, which is independent of the network width or depth. In the latter the constraint on the output score is exponential in network depth and polynomial in network width. The difference is that the Frobenious norm does not take into account the correlation (angles) between the rows of the weight matrix Wl , while the spectral norm does. Therefore, the bound based on the Frobenious norm corresponds to the worst case when all the rows of Wl are aligned. In that case √ √ kWl kF = kWl k2 = M . On the other hand, if the rows of Wl are orthonormal kWl kF = M , but kWl k2 = 1. Remark 1. To put results into perspective we compare our GE bounds to the GE bounds based on the Rademacher complexity in [33], which hold for DNNs with ReLUs. The work in [33] shows that if W ∈ WF = {Wi ∈ W : L Y kWi kF < CF } (43) i=1 and the energy of training samples is bounded then: 1 GE(g) / √ 2L−1 CF . m (44) Although the bounds (38) and (44) are not directly comparable, since the bounds based on the robustness framework rely on an underlying assumption on the data (covering number), there is still a remarkable difference between them. The behaviour in (44) suggests that the GE grows exponentially with the network depth even if the product of the Frobenious norms of all the weight matrices is fixed, which is due to the term 2L . The bound in (34) and the constraint sets in (39)-(42), on the other hand, imply that the GE does not increase with the number of layers provided that the spectral/Frobenious norms of the weight matrices are bounded. Moreover, if we take the DNN to have weight matrices with orthonormal rows then the GE behaves as √1 (CM )k/2 m (assuming o(si ) ≥ 1, i = 1, . . . , m), and therefore relies only on the complexity of the underlying data manifold and not on the network depth. This provides a possible answer to the open question of [33] that depth independent capacity control is possible in DNNs with ReLUs. Remark 2. An important value of our bounds is that they provide an additional explanation to the success of state-of-the-art DNN training techniques such as batch normalization [23] and eight normalization [24]. Weight normalized DNNs have weight matrices with normalized rows, i.e. Wl = diag(ŴlT Ŵl )−1 Ŵl , (45) where diag(·) denotes the diagonal part of the matrix. While the main motivation for this method is a faster training, the authors also show empirically that such networks achieve good generalization. √ Note that for row-normalized weight matrices kWl kF = Ml and therefore the bounds based on the May 24, 2017 DRAFT 18 Frobenious norm can not explain the good generalization of such networks as adding layers or making Wl larger will lead to a larger GE bound. However, our bound in (34) and the constraint sets in (39)-(41) show that a small Frobenious norm of the weight matrices is not crucial for a small GE. A supporting experiment is presented in Section VI-A2. We also note that batch normalization also leads to row-normalized weight matrices in DNNs with ReLUs:5 Theorem 5. Assume that the non-linear layers of a DNN with ReLUs are batch normalized as:   ˆl ẑl = Wl zl , zl+1 = [N {zli }m , W l z ]σ , i=1 (46) where σ denotes the ReLU non-linearity and N ({zi }m i=1 , W) m X = diag !− 1 2 Wzi zTi WT (47) i=1 is the normalization matrix. Then all the weight matrices are row normalized. The exception is the weight matrix of the last layer, which is of the form N({zL−1 }m i=1 , WL )WL . i Proof: The proof appears in Appendix E. A. Jacobian Regularizer The constraint set (39) suggests that we can regularize the DNN by bounding the norm of the network’s JM for the inputs close to xi . Therefore, we propose to penalize the norm of the network’s JM evaluated at each training sample xi , m 1 X RJ (W) = kJ(xi )k22 . m (48) i=1 The implementation of such regularizer requires computation of its gradients or subgradients. In this case the computation of the subgradient of the spectral norm requires the calculation of a SVD decomposition [44], which makes the proposed regularizer inefficient. To circumvent this, we propose a surrogate regularizer based on the Frobenious norm of the Jacobian matrix: m RF (W) = 1 X kJ(xi )k2F . m (49) i=1 5 To simplify the derivation we omit the bias vectors and therefore also the centering applied by the batch normalization. This does not affect the generality of the result. We also follow [43] and omit the batch normalization scaling, as it can be included into the weight matrix of the layer following the batch normalization. We also omit the regularization term and assume that the matrices are invertible. May 24, 2017 DRAFT 19 Note that the Frobenious norm and the spectral norm are related as follows: 1/rank(J(xi ))kJ(xi )k2F ≤ kJ(xi )k22 ≤ kJ(xi )k2F , which justifies using the surrogate regularizer. We will refer to RF (W) as the Jacobian regularizer. 1) Computation of Gradients and Efficient Implementation: Note that the k -th row of J(xi ) corresponds to the gradient of (f (x))k with respect to the input x evaluated at xi . It is denoted by gk (xi ) = d(f (x))k |x=xi . dx Now we can write m RF (W) = M 1 XX gk (xi )gk (xi )T . m (50) i=1 k=1 As the regularizer will be minimized by a gradient descent algorithm we need to compute its gradient with respect to the DNN parameters. First, we express gk (xi ) as gk (xi ) = gkl (xi )Wl Jl−1 (xi ) where gkl (xi ) = Jl−1 (xi ) = d(f (x))k dẑl |x=xi dzl−1 dx |x=xi (51) is the gradient of (f (x))k with respect to ẑl evaluated at the input xi and is the JM of l − 1-th layer output zl−1 evaluated at the input xi . The gradient of gk (xi )gk (xi )T with respcet to Wl is then given as [45]  ∇Wl gk (xi )gk (xi )T = 2gkl (xi )T gkl (xi )Wl Jl−1 (xi ). The computation of the gradient of the regularizer at layer l requires the computation of gradients gkl (xi ), k = 1, . . . , M , i = 1, . . . , m and the computation of the Jacobian matrices Jl−1 (xi ), i = 1, . . . , m. The computation of the gradient of a typical loss used for training DNN usually involves a computation of m gradients with computational complexity similar to the computational complexity of gkl (xi ). Therefore, the computation of gradients required for an implementation of the Jacobian regularizer can be very expensive. To avoid excessive computational complexity we propose a simplified version of the regularizer (49), which we name per-layer Jacobian regularizer. The per-layer Jacobian regularizer at layer l is defined as m 1 X l−1 l−1 RFl (Wl ) = g̃π(i) (xi )(g̃π(i) (xi ))T , (52) m i=1 l−1 where g̃π(i) (xi ) = d(f (x))π(i) dzl−1 |x=xi , and π(i) ∈ {1, . . . , M } is a random index. Compared to (49) we have made two simplifications. First, we assumed that input of layer l is fixed. This way we do not need to compute the JM Jl−1 (xi ) between the output of the layer l − 1 and the input. Second, by choosing only one index π(i) per training sample we have to compute only one additional gradient per training sample. l−1 l−1 This significantly reduces the computational complexity. The gradient of g̃π(i) (xi )(g̃π(i) (xi ))T is simply   l−1 l−1 l l ∇Wl g̃π(i) (xi )(g̃π(i) (xi ))T = 2gπ(i) (xi )T gπ(i) (xi )Wl . We demonstrate the effectiveness of this regularizers in Section VI. May 24, 2017 DRAFT 20 V. D ISCUSSION In the preceding sections we analysed the standard feed-forward DNNs and their classification margin measured in the Euclidean norm. We now briefly discuss how our results extend to other DNN architectures and different margin metrics. A. Beyond Feed Forward DNN There are various DNN architectures such as Residual Networks (ResNets) [4], [46], Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks [47], and Auto-encoders [48] that are used frequently in practice. It turns out that our analysis – which is based on the network’s JM – can also be easily extended to such DNN architectures. In fact, the proposed framework encompasses all DNN architectures for which the JM can be computed.Below we compute the JM of a ResNet. The ResNets introduce shortcut connection between layers. In particular, let φ(·, θl ) denote a concatenation of several non-linear layers (see (18)). The l-th block of a Residual Network is then given as zl = zl−1 + φ(zl−1 , θl ) . (53) We denote by Jl (zl−1 ) the JM of φ(zl−1 , θl ). Then the JM of the l-th block is dzl = I + Jl (zl−1 ) , dzl−1 (54) and the JM of a ResNet is of the form JSM (zL−1 ) · I+ L X !! l−1 Y Jl (zl−1 ) (I + Jl−i (zl−2 )) , l=1 i=1 (55) where JSM (zL−1 ) denotes the JM of the soft-max layer. In particular, the right element of the product in (55) can be expanded as I + J1 (x) +J2 (z1 ) + J2 (z1 )J1 (x) +J3 (z2 ) + J3 (z2 )J2 (z1 )J1 (x) + J3 (z2 )J2 (x) + J3 (x)J1 (x) +... This is a sum of JMs of all the possible sub-networks of a ResNet. In particular, there are L elements of the sum consiting only of one 1-layer sub-networks and there is only one element of the sum consisting of L-layer sub-network. This observation is consistent with the claims in [49], which states that ResNets resemble an ensemble of relatively shallow networks. May 24, 2017 DRAFT 21 B. Beyond the Euclidean Metric Moreover, we can also consider the geodesic distance on a manifold as a measure for margin instead of the Euclidean distance. The geodesic distance can be more appropriate than the Euclidean distance since it is a natural metric on the manifold. Moreover, the covering number of the manifold X may be smaller if we use the covering based on the geodesic metric balls, which will lead to tighter GE bounds. We outline the approach below. Assume that X is a Riemannian manifold and x, x0 ∈ X . Take a continuous, piecewise continuously differentiable curve c(t), t = [0, 1] such that c(0) = x, c(1) = x0 and c(t) ∈ X ∀t ∈ [0, 1]. The set of all such curves c(·) is denoted by C . Then the geodesic distance between x and x0 is defined as Z 1 dc(t) 0 dG (x, x ) = inf dt . dt 2 c(t)∈C 0 (56) Similarly as in Section III, we can show that the JM of DNN is central to bounding the distance expansion between the signals at the DNN input and the signals at the DNN output. Theorem 6. Take x, x0 ∈ X , where X is the Riemmanian manifold and take c(t), t = [0, 1] to be a continuous, piecewise continuously differentiable curve connecting x and x0 such that dG (x, x0 ) = R 1 dc(t) dt. Then dt 0 2 kf (x0 ) − f (x)k2 ≤ sup kJ(c(t))k2 dG (x0 , x) (57) t∈[0,1] Proof: The proof appears in Appendix F. Note that we have established a relationship between the Euclidean distance of two points in the output space and the corresponding geodesic distance in the input space. This is important because it implies that promoting a large Euclidean distance between points can lead to a large geodesic distance between the points in the input space. Moreover, the ratio between kf (x0 ) − f (x)k2 and dG (x, x0 ) is upper bounded by the maximum value of the spectral norm of the network’s JM evaluated on the line c(t). This result is analogous to the results of Theorem 3 and Corollary 2. It also implies that regularizing the network’s JM as proposed in Section IV is beneficial also in the case when the classification margin is not measured in the Euclidean metric. Finally, note that in practice the training data may not be balanced. The provided GE bounds are still valid in such cases. However, the classification error may not the best measure of performance in such cases as it is dominated by the classification error of the class with the highest prior probability. Therefore, alternative performance measures need to be considered. We leave a detailed study of training DNN with unbalanced training sets for possible future work. May 24, 2017 DRAFT 22 99 Accuracy [%] Accuracy [%] 98 97 96 95 94 93 2 3 Number of Layers (a) MNIST 4 64 62 60 58 56 54 52 50 48 46 44 2 3 Number of Layers 4 (b) CIFAR-10 Fig. 3. Classification accuracy of DNNs trained with the Jacobian regularization (solid lines) and the weight decay (dashed lines). Different numbers of training samples are used: 5000 (red), 20000 (blue) and 50000 (black). VI. E XPERIMENTS We now validate the theory with a series of experiments on the MNIST [50], CIFAR-10 [51], LaRED [52] and ImageNet (ILSVRC2012) [53] datasets. The Jacobian regularizer is applied to various DNN architectures such as DNN with fully connected layers, convolutional DNN and ResNet [4]. We use the ReLUs in all considered DNNs as this is currently the most popular non-linearity. A. Fully Connected DNN In this section we compare the performance of fully connected DNNs regularized with Jacobian Regularization or with the weight decay. Then we analyse the behaviour of the JM of a fully connected DNNs of various depth and width. 1) Comparison of Jacobian Regularization and Weight Decay: First, we compare standard DNN with fully connected layers trained with the weight decay and the Jacobian regularization (49) on the MNIST and CIFAR-10 datasets. Different number of training samples are used (5000, 20000, 50000). We consider DNNs with 2, 3 and 4 fully connected layers where all layers, except the last one, have dimension equal to the input signal dimension, which is 784 in case of MNIST and 3072 in case of CIFAR-10. The last layer is always the softmax layer and the objective is the CEE loss. The networks were trained using the stochastic gradient descent (SGD) with momentum, which was set to 0.9. Batch size was set to 128 and learning rate was set to 0.01 and reduced by factor 10 after every 40 epochs. The networks were trained for 120 epochs in total. The weight decay and the Jacobian regularization factors were chosen on a separate validation set. The experiments were repeated with the same regularization parameters on 5 random draws of training sets and weight matrix initializations. Classification accuracies averaged over different experimental runs are shown in Fig. 3. We observe that the proposed Jacobian regularization always outperforms the weight decay. This validates our theoretical results in Section IV, which predict May 24, 2017 DRAFT 23 that the Jacobian matrix is crucial for the control of (the bound to) the GE. Interestingly, in the case of MNIST, a 4 layer DNN trained with 20000 training samples and Jacobian regularization (solid blue line if Fig. 3 (a)) performs on par with DNN trained with 50000 training samples and weight decay (dashed black line Fig. 3 (a)), which means that the Jacobian regularization can lead to the same performance with significantly less training samples. 2) Analysis of Weight Normalized Deep Neural Networks: Next, we explore weight normalized DNNs, which are described in Section IV. We use the MNIST dataset and train DNNs with a different number of fully connected layers (L = 2, 3, 4, 5) and different sizes of weight matrices (Ml = 784, 2 · 784, 3 · 784, 4 · 784, 5 · 784, 6 · 784, l = 1, . . . , L − 1). The last layer is always the softmax layer and the objective is the CCE loss. The networks were trained using the stochastic gradient descent (SGD) with momentum, which was set to 0.9. Batch size was set to 128 and learning rate was set to 0.1 and reduced by factor 10 after every 40 epochs. The networks were trained for 120 epochs in total. All experiments are repeated 5 times with different random draws of a training set and different random weight initializations. We did not employ any additional regularization as our goal here is to explore the effects of the weight normalization on the DNN behaviour. We always use 5000 training samples. The classification accuracies are shown in Fig. 4 (a) and the smallest classification score obtained on the training set is shown in Fig. 4 (b). We have observed for all configurations that the training accuracies were 100% (only exception is the case L = 2, Ml = 784 where the training accuracy was 99.6%). Therefore, the (testing set) classification accuracies increasing with the network depth and the weight matrix size directly imply that the GE is smaller for deeper and wider DNNs. Note also that the score increases with the network depth and width. This is most obvious for the 2 and 3 layer DNNs, √ whereas for the 3 and 4 layer DNNs the score is close to 2 for all network widths. Since the DNNs are weight normalized, the Frobenious norms of the weight matrices are equal to the square root of the weight matrix dimension, and the product of Frobenious norms of the weight matrices grows with the network depth and the weight matrix size. The increase of score with the network depth and network width does not offset the product of Frobenious norms, and clearly, the bound in (38) based on the margin bound in (37) and the bound in (44), which leverage the Frobenious norms of the weight matrices, predict that the GE will increase with the network depth and weight matrix size in this scenario. Therefore, the experiment indicates that these bounds are too pessimistic. We have also inspected the spectral norms of the weight matrices of the trained networks. In all cases the spectral norms were greater than one. We can argue that the bound in (38) based on the margin bound in (36) predicts that the GE will increase with network depth, as the product of the spectral norms grows with the network depth in a similar way than in previous paragraph. We note however, that the spectral May 24, 2017 DRAFT 24 norms of the weight matrices are much smaller than the Frobenious norms of the weight matrices. Finally, we look for a possible explanation for the success of the weight normalization in the bounds in (38) based on the margin bounds in (34) and (35), which are a function on the JM. The largest value of the spectral norm of the network’s JM evaluated on the training set is shown in Fig. 4 (c) and the largest value of the spectral norm of the network’s JM evaluated on the testing set is shown in Fig. 4 (d). We can observe an interesting phenomena. The maximum value of the JM’s spectral norm on the training set decreases with the network depth and width. On the other hand, the maximum value of the JM’s spectral norm on the testing set increases with network depth (and slightly with network width). From the perspective of the constraint sets in (39) and (40) we note that in the case of the latter we have to take into account the worst case spectral norm of the JM for inputs in conv(X ). The maximum value of the spectral norm on the testing set indicates that this value increases with the network depth and implies that the bound based on (35) is still loose. On the other hand, the bound in (34) implies that we have to consider the JM in the neighbourhood of the training samples. As an approximation, we can take the spectral norms of the JMs evaluated at the training set. As it is shown in Fig. 4 (c) this values decrease with the network depth and width. We argue that this provides a reasonable explanation for the good generalization of deeper and wider weight normalized DNNs. B. Convolutional DNN In this section we compare the performance of convolutional DNNs regularized with the Jacobian regularizer or with the weight decay. We also show that Jacobian Regularization can be applied to batch normalized DNNs. We will use the standard MNIST and CIFAR-10 dataset and the LaRED dateset which is briefly described below. The LaRED dataset contains depth images of 81 distinct hand gestures performed by 10 subjects with approximately 300 images of each gesture per subject. We extracted the depth images of the hands using the masks provided in [52] and resized the images to 32 × 32. The images of the first 6 subjects were used to create non-overlapping training and testing sets. In addition we also constructed a testing set composed from the images of the last 4 subjects in the dataset in order to test generalization across different subjects. The goal is classification of gestures based on the depth image. 1) Comparison of Jacobian Regularization and Weight Decay: We use a 4 layer convolutional DNN with the following architecture: (32, 5, 5)-conv, (2, 2)-max-pool, (32, 5, 5)-conv, (2, 2)-max-pool followed by a softmax layer, where (k, u, v)-conv denotes the convolutional layer with k filters of size u × v and (p, p)-max-pool denotes max-pooling with pooling regions of size p × p. The training procedure follows the one described in the previous paragraphs. The results are reported in Table II. May 24, 2017 DRAFT L=2 L=3 L=4 L=5 784 1568 2352 3136 3920 4704 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.0 2.5 max i |J(xi )|2 (train set) 96.0 95.8 95.6 95.4 95.2 95.0 94.8 94.6 mini o(si ) Accuracy [%] 25 2.0 1.0 0.5 0.0 784 1568 2352 3136 3920 4704 Layer width (a) Classification accuracy. L=2 L=3 L=4 L=5 1.5 Layer width 784 1568 2352 3136 3920 4704 Layer width (b) Smallest o(si ) (training set). (c) Largest kJ(xi )k2 (training set). max i |J(xi )|2 (test set) 10 9 8 7 6 5 4 3 2 784 1568 2352 3136 3920 4704 Layer width (d) Largest kJ(xi )k2 (test set). Fig. 4. Weight normalized DNN with L = 2, 3, 4, 5 layers and different sizes of weight matrices (layer width). Plot (a) shows classification accuracy, plot (b) shows the smallest score of training samples, plot (c) shows the largest spectral norm of the network’s JM evaluated on the training set and plot (d) shows the largest spectral norm of the network’s JM evaluated on the testing set. TABLE II C LASSIFICATION ACC . [%] OF CONVOLUTIONAL DNN MNIST ON LaRED (same subject) MINST AND L A RED. LaRED (different subject) # train samples Weight dec. Jac. reg. # train samples Weight dec. Jac. reg. # train samples Weight dec. Jac. reg. 1000 94.00 96.03 2000 61.40 63.56 2000 31.53 32.62 5000 97.59 98.20 5000 76.59 79.14 5000 38.11 39.62 20000 98.60 99.00 10000 87.01 88.24 10000 41.18 42.85 50000 99.10 99.35 50000 97.18 97.54 50000 45.12 46.78 We observe that training with the Jacobian regularization outperforms the weight decay in all cases. This is most obvious at smaller training set sizes. For example, on the MNIST dataset, the DNN trained using 1000 training samples and regularized with the weight decay achieves classification accuracy of 94% and the DNN trained with the Jacobian regularization achieves classification accuracy of 96.3%. Similarly, on the LaRED dataset the Jacobian regularization outperforms the weight decay with the difference most obvious at the smallest number of training samples. Note also that the generalization of May 24, 2017 DRAFT 26 TABLE III C LASSIFICATION ACC . [%] OF CONVOLUTIONAL DNN ON CIFAR-10. # train samples Batch norm. Batch norm. + Jac. reg. 2500 60.86 66.15 10000 76.35 80.57 50000 87.44 88.95 the network to the subjects outside the training set is not very good; i.e., using 50000 training samples the classification accuracy on the testing set containing the same subjects is higher than 97% whereas the classification accuracy on the testing set containing different subjects is only 46%. Nevertheless, the Jacobian regularization outperforms the weight decay also on this testing set by a small margin. 2) Batch Normalization and Jacobian Regularization: Now we show that the Jacobian regularization (49) can also be applied to a batch normalized DNN. Note that we have shown in Section IV that the batch normalization has an effect of normalizing the rows of the weight matrices. We us the CIFAR-10 dataset and use the All-convolutional-DNN proposed in [54] (All-CNN-C) with 9 convolutional layers, an average pooling layer and a softmax layer. All the convolutional layers are batch normalized and the softmax layer is weight normalized. The networks were trained using the stochastic gradient descent (SGD) with momentum, which was set to 0.9. Batch size was set to 64 and the learning rate was set to 0.1 and reduced by a factor 10 after every 25 epochs. The networks were trained for 75 epochs in total. The classification accuracy results are presented in Table III for different sizes of training sets (2500, 10000, 50000). We can observe that the Jacobian regularization also leads to a smaller GE in this case. C. Residual Networks Now we demonstrate that the Jacobian regularizer is also effective when applied to ResNets. We use the CIFAR-10 and ImageNet datasets. We use the per-layer Jacobian regularization (52) for experiments in this section. 1) CIFAR-10: The Wide ResNet architecture proposed in [35], which follows [46], but proposes wider and shallower networks which leads to the same or better performance than deeper and thinner networks is used here. In particular, we use the ResNet with 22 layers of width 5. We follow the data normalization process of [35]. We also follow the training procedure of [35] except for the learning rate and use the learning rate sequence: (0.01, 5), (0.05, 20), (0.005, 40), (0.0005, 40), (0.00005, 20), where the first number in parenthesis corresponds to the learning rate and the second May 24, 2017 DRAFT 27 TABLE IV C LASSIFICATION ACC . [%] OF R ES N ET CIFAR-10 # train samples ResNet ResNet + Jac. reg. 2500 55.69 62.79 10000 71.79 78.70 50000 + aug. 93.34 94.32 number corresponds to the number of epochs. We train ResNet on small training sets (2500 and 10000 training samples) without augmentation and on the full training set with the data augmentation as in [35]. The regularization factor were set to 1 and 0.1 for the smaller training sets (2500 and 10000) and the full augmented training set, respectively. The results are presented in Table IV. In all cases the ResNet with Jacobian regularization outperforms the standard ResNet. The effect of regularization is the strongest with the smaller number of training samples, as expected. 2) ImageNet: We use the 18 layer ResNet [4] with identity connection [46]. The training procedure follows [4] with the learning rate sequence: (0.1, 30), (0.01, 30), (0.001, 30). The Jacobian regularization factor is set to 1. The images in the dataset are resized to 128 × 128. We run an experiment without data augmentation and with data augmentation following [1], which includes random cropping of images of size 112 × 112 from the original image and color augmentation. The classification accuracies during training are shown in Fig. 5 and the final results are reported in Table V. We first focus on training without data augmentation. The ResNet trained using the Jacobian regularization has a much smaller GE (23.83%) compared to the baseline ResNet (61.53%). This again demonstrates that the Jacobian regularization decreases the GE, as our theory predicts. Note that the smaller GE of Jacobian regularized ResNet partially transfers to a higher classification accuracy on the testing set. However, in practice DNNs are often trained with data augmentation. In this case the GE of a baseline ResNet is much lower (13.14%) and is very close to the GE of the ResNet with the Jacobian regularization (12.03%). It is clear that data augmentation reduces the need for strong regularization. Nevertheless, note that the ResNet trained with the Jacobian regularization achieves a slightly higher testing set accuracy (47.51%) compared to the baseline ResNet (46.75%). May 24, 2017 DRAFT 28 TABLE V Train Test GE Baseline 89.82 28.29 61.53 Baseline + Jac. reg. 59.52 35.69 23.83 Baseline + aug. 59.89 46.75 13.14 Baseline + aug + Jac. reg. 59.54 47.51 12.03 0 10 20 30 40 50 60 70 80 90 100 90 80 70 60 50 40 30 Epoch 60 Top-1 accuracy [%] 90 80 70 60 50 40 30 20 10 Setup Top-5 accuracy [%] Top-1 accuracy [%] C LASSIFICATION ACC . [%] AND GE [%] OF R ES N ET ON I MAGENET. 0 10 20 30 40 50 60 70 80 90 Epoch (b) No data augmentation. Top-5 accuracy [%] (a) No data augmentation. 90 80 70 60 50 40 30 20 50 40 30 20 10 0 10 20 30 40 50 60 70 80 90 Epoch (c) Data augmentation. Train (baseline) Test (baseline) Train (Jac. reg.) Test (Jac. reg.) 0 10 20 30 40 50 60 70 80 90 Epoch (d) Data augmentation. Fig. 5. Training set (dashed) and testing set (solid) classification accuracies during training. Blue curves correspond to the ResNet with Jacobian regularization and red curves correspond to the baseline ResNet. Top-1 and top-5 classification accuracies are reported for training without data augmentation (a,b) and for training with data augmentation (c,d). D. Computational Time Finally, we measure how the use of Jacobian regularization affects training time of DNNs. We have implemented DNNs in Theano [55], which includes automatic differentiation and computation graph optimization. The experiments are run on the Titan X GPU. The average computational time per batch for the convolutional DNN on the MNIST dataset in Section VI-B1 and for the ResNet on the ImageNet dataset in Section VI-C2 are reported in Table VI. Note that in the case of MNIST the regularizer in (49) is used and in the case of ImageNet the per-layer regularizer in (52) is used. These results are also representative of the other datasets and network architectures. May 24, 2017 DRAFT 29 TABLE VI AVERAGE COMPUTATION TIME [s/ BATCH ] Experiment no reg. Jac. reg. Increase factor MNIST (Sec.VI-B1) 0.003 0.030 10.00 ImageNet (Sec. VI-C2) 0.120 0.190 1.580 We can observe that using the Jacobian regularizer in (49) introduces additional computational time. This may not be critical if the number of training samples is small and training computational time is not too critical. On the other hand, the per-layer Jacobian regularizer in (52) has a much smaller cost. As shown in the experiments this regularizer is still effective and leads to only 58% increase in computation time on the ImageNet dataset. Due to its efficiency the per-layer Jacobian regularizer might be more appropriate for large scale experiments where computational time is important. VII. C ONCLUSION This paper studies the GE of DNNs based on their classification margin. In particular, our bounds express the generalization error as a function of the classification margin, which is bounded in terms of the achieved separation between the training samples at the network output and the network’s JM. One of the hallmarks of our bounds relates to the fact that the characterization of the behaviour of the generalization error is tighter than that associated with other bounds in the literature. Our bounds predict that the generalization error of deep neural networks can be independent of their depth and size whereas other bounds say that the generalization error is exponential in the network width or size. Our bounds also suggest new regularization strategies such as the regularization of the network’s Jacobian matrix, which can be applied on top of other modern DNN training strategies such as the weight normalization and the batch normalization, where the standard weight decay can not be applied. These regularization strategies are especially effective in the limited training data regime in comparison to other approaches, with moderate increase in computational complexity. A PPENDIX A. Proof of Theorem 3 We first note that the line between x and x0 is given by x + t(x0 − x), t ∈ [0, 1] . We define the function F (t) = f (x + t(x0 − x)), and observe that May 24, 2017 dF (t) dt = J(x + t(x0 − x))(x0 − x). By the generalized DRAFT 30 fundamental theorem of calculus or the Lebesgue differentiation theorem we write Z 1 dF (t) 0 f (x ) − f (x) = F (1) − F (0) = dt dt 0 Z 1 = J(x + t(x0 − x)) dt (x0 − x) . (58) 0 This concludes the proof. B. Proof of Corollary 2 First note that kJx,x0 (x0 − x)k2 ≤ kJx,x0 k2 kx0 − xk2 and that Jx,x0 is an integral of J(x + t(x0 − x)). In addition, notice that we may always apply the following upper bound: kJx,x0 k2 ≤ sup kJ(x + t(x0 − x))k2 . (59) x,x0 ∈X ,t∈[0,1] Since x + t(x0 − x) ∈ conv(X ) ∀t ∈ [0, 1], we get (24). C. Proof of Lemma 1 In all proofs we leverage the fact that for any two matrices A, B of appropriate dimensions it holds kABk2 ≤ kAk2 kBk2 . We also leverage the bound kAk2 ≤ kAkF . We start with the proof of statement 1). For the non-linear layer (18), we note that the JM is a product of a diagonal matrix (27) and the weight matrix Wl . Note that for all the considered non-linearities the diagonal elements of (27) are bounded by 1 (see derivatives in Table I), which implies that the spectral norm of this matrix is bounded by 1. Therefore the spectral norm of the JM is upper bounded by kWl k2 . The proof for the linear layer is trivial. In the case of the softmax layer (17) we have to show that the  spectral norm of the softmax function −ζ(ẑ)ζ(ẑ)T + diag(ζ(ẑ) is bounded by 1. We use the Gershgorin  disc theorem, which states that the eigenvalues of −ζ(ẑ)ζ(ẑ)T + diag(ζ(ẑ) are bounded by max(ζ(ẑ))i (1 − (ζ(ẑ))i ) + (ζ(ẑ))i i Noticing that P j6=i (ζ(ẑ))j X (ζ(ẑ))j . (60) j6=i ≤ 1 leads to the upper bound maxi (ζ(ẑ))i (2 − (ζ(ẑ))i ) . (61) Since (ζ(ẑ))i ∈ [0, 1] it is trivial to show that (61) is upper bounded by 1. The proof of statement 2) is straightforward. Because the pooling regions are non-overlapping it is straightforward to verify that the rows of all the defined pooling operators Pl (zl−1 ) are orthonormal. Therefore, the spectral norm of the JM is equal to 1. May 24, 2017 DRAFT 31 D. Proof of Theorem 4 Throughout the proof we will use the notation o(si ) = o(xi , yi ) and vij = √ 2(δ i − δ j ). We start by proving the inequality in (34). Assume that the classification margin γ d (si ) of training sample (xi , yi ) is given and take j ? = arg minj6=yi min vyTi j f (xi ). We then take a point x? that lies on the decision boundary between yi and j ? such that o(x? , yi ) = 0. Then o(xi , yi ) = o(x, yi ) − o(x? , yi ) = vyTi j ? (f (xi ) − f (x? )) = vyTi j ? Jxi ,x? (xi − x? ) ≤ kJxi ,x? k2 kxi − x? k2 . Note that by the choice of x? , kxi −x? k2 = γ d (si ) and similarly kJxi ,x? k2 ≤ supx:kx−xi k2 ≤γ d (si ) kJ(x)k2 . Therefore, we can write o(si ) ≤ sup x:kx−xi k2 ≤γ d (si ) kJ(x)k2 γ d (si ), (62) which leads to (34). Next, we prove (35). Recall the definition of the classification margin in (10): γ d (si ) = sup{a : kxi − xk2 ≤ a =⇒ g(x) = yi ∀x} = sup{a : kxi − xk2 ≤ a =⇒ o(x, yi ) > 0 ∀x} , where we leverage the definition in (33). We observe o(x, yi ) > 0 ⇐⇒ minj6=yi vyTi j f (x) > 0 and  min vyTi j f (x) = min vyTi j f (xi ) + vyTi j (f (x) − f (xi )) . j6=yi j6=yi Note that  min vyTi j f (xi ) + vyTi j (f (x) − f (xi )) j6=yi (63) ≥ min vyTi j f (xi ) + min vyTi j (f (x) − f (xi )) j6=yi j6=yi = o(xi , yi ) + min vyTi j (f (x) − f (xi )) . j6=yi (64) Therefore, o(xi , yi ) + min vyTi j (f (x) − f (xi )) > 0 =⇒ o(x, yi ) > 0 . j6=yi This leads to the bound of the classification margin γ d (si ) ≥ sup{a : kxi − xk2 ≤ a =⇒ o(xi , yi ) + min vyTi j (f (x) − f (xi )) > 0 ∀x} . j6=yi May 24, 2017 DRAFT 32 Note now that o(xi , yi ) + min vyTi j (f (x) − f (xi )) > 0 j6=yi (65) ⇐⇒ o(xi , yi ) − max vyTi j (f (xi ) − f (x)) > 0 j6=yi (66) ⇐⇒ o(xi , yi ) > max vyTi j (f (xi ) − f (x)) . j6=yi (67) Moreover, max vyTi j (f (xi ) − f (x)) ≤ j6=yi kJ(x)k2 kxi − xk2 , sup x∈conv(X ) where we have leveraged the fact that kvij k2 = 1 and the inequality (24) in Corollary 2. We may write γ d (si ) ≥ sup{a :kxi − xk2 ≤ a =⇒ o(xi , yi ) > sup kJ(x)k2 kxi − xk2 ∀x}. x∈conv(X ) a that attains the supremum can be obtain easily and we get: γ d (si ) ≥ o(xi , yi ) , supx∈conv(X ) kJ(x)k2 (68) which proves (35). The bounds in (36) and (37) follow from the bounds provided in Lemma 1 and the fact that the spectral norm of a matrix product is upper bounded by the product of the spectral norms. This concludes the proof. E. Proof of Theorem 5 We denote by WlN the row normalized matrix obtained from Wl (in the same way as (45)). By noting that the ReLU and diagonal non-negative matrices commute, it is straight forward to verify that   l l m N [WN zl ] . [N {zli }m σ i=1 , Wl Wl z ]σ = N {zi }i=1 , Wl l N Note now that we can consider N({zli }m i=1 , Wl ) as the part of the weight matrix Wl+1 . Therefore, we can conclude that layer l has row normalized weight matrix. When the batch normalization is applied to layers, all the weight matrices will be row normalized. The exception is the weight matrix of the last layer, which will be of the form N({zL−1 }m i=1 , WL )WL . i May 24, 2017 DRAFT 33 F. Proof of Theorem 6 We begin by noting that f (x0 ) − f (x) = f (c(1)) − f (c(0)) and f (c(1)) − f (c(0)) = R1 0 df (c(t)) dt dt = R1 0 df (c(t)) dc(t) dt dc(t) dt , where the first equality follows from the generalized fundamental theorem of calculus, following the idea presented in the proof of Theorem 3. The second equality follows from the chain rule of differentiation. Finally, we note that df (c(t)) c(t) = J(c(t)) and that the norm of the integral is always smaller or equal to the integral of the norm and obtain kf (x0 ) Z 1 − f (x)k2 = J(c(t)) Z ≤ 0 1 dc(t) dt dt kJ(c(t))k2 0 dc(t) dt Z 1 ≤ sup kJ(c(t))k2 t∈[0,1] 0 2 dt 2 dc(t) dt dt 2 = sup kJ(c(t))k2 dG (x, x0 ) , (69) t∈[0,1] where we have noted that R1 0 dc(t) dt 2 = dG (x, x0 ). R EFERENCES [1] A. Krizhevsky, I. Sutskever, and G. E. Hinton, “Imagenet classification with deep convolutional neural networks,” Advances in Neural Information Processing Systems (NIPS), pp. 1097–1105, 2012. [2] G. Hinton, L. Deng, D. Yu, G. E. Dahl, A.-r. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. N. Sainath, and B. Kingsbury, “Deep neural networks for acoustic modeling in speech recognition: the shared views of four research groups,” IEEE Signal Processing Magazine, vol. 29, no. 6, pp. 82–97, Oct. 2012. [3] Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, May 2015. [4] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Dec. 2016. [5] V. Nair and G. E. Hinton, “Rectified linear units improve restricted Boltzmann machines,” Proceedings of the 27th International Conference on Machine Learning (ICML), pp. 807–814, 2010. [6] J. Bruna, A. Szlam, and Y. LeCun, “Learning stable group invariant representations with convolutional networks,” International Conference on Learning Representations (ICLR), 2013. [7] Y.-L. Boureau, J. Ponce, and Y. LeCun, “A theoretical analysis of feature pooling in visual recognition,” Proceedings of the 27th International Conference on Machine Learning (ICML), pp. 111–118, 2010. [8] G. Cybenko, “Approximation by superpositions of a sigmoidal function,” Mathematics of Control Signals and Systems, vol. 2, no. 4, pp. 303–314, 1989. [9] K. Hornik, “Approximation capabilities of multilayer feedforward networks,” Neural Networks, vol. 4, no. 2, pp. 251–257, 1991. [10] G. Montúfar, R. Pascanu, K. Cho, and Y. Bengio, “On the number of linear regions of deep neural networks,” Advances in Neural Information Processing Systems (NIPS), pp. 2924–2932, 2014. May 24, 2017 DRAFT 34 [11] N. Cohen, O. Sharir, and A. Shashua, “On the expressive power of deep learning: a tensor analysis,” 29th Annual Conference on Learning Theory (COLT), pp. 698–728, 2016. [12] M. Telgarsky, “Benefits of depth in neural networks,” 29th Annual Conference on Learning Theory (COLT), pp. 1517–1539, 2016. [13] S. Mallat, “Group invariant scattering,” Communications on Pure and Applied Mathematics, vol. 65, no. 10, pp. 1331–1398, 2012. [14] J. Bruna and S. Mallat, “Invariant scattering convolution networks,” IEEE Transactions on Pattern Analysis and Machine Intellignce, vol. 35, no. 8, pp. 1872–1886, Mar. 2012. [15] T. Wiatowski and H. Bölcskei, “A mathematical theory of deep convolutional neural networks for feature extraction,” arXiv:1512.06293, 2015. [16] R. Giryes, G. Sapiro, and A. M. Bronstein, “Deep neural networks with random Gaussian weights: a universal classification strategy?” IEEE Transactions on Signal Processing, vol. 64, no. 13, pp. 3444–3457, Jul. 2016. [17] A. Choromanska, M. Henaff, M. Mathieu, G. B. Arous, and Y. LeCun, “The loss surfaces of multilayer networks,” International Conference on Artificial Intelligence and Statistics (AISTATS), 2015. [18] B. D. Haeffele and R. Vidal, “Global optimality in tensor factorization, deep learning, and beyond,” arXiv:1506.07540, 2015. [19] R. Giryes, Y. C. Eldar, A. M. Bronstein, and G. Sapiro, “Tradeoffs between convergence speed and reconstruction accuracy in inverse problems,” arXiv:1605.09232, 2016. [20] A. M. Saxe, J. L. McClelland, and S. Ganguli, “Exact solutions to the nonlinear dynamics of learning in deep linear neural networks,” International Conference on Learning Representations (ICLR), 2014. [21] Y. Ollivier, “Riemannian metrics for neural networks I: feedforward networks,” Information and Inference, vol. 4, no. 2, pp. 108–153, Jun. 2015. [22] B. Neyshabur and R. Salakhutdinov, “Path-sgd: Path-normalized optimization in deep neural networks,” Advances in Neural Information Processing Systems (NIPS), pp. 2422–2430, 2015. [23] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing internal covariate shift,” Proceedings of the 32nd International Conference on Machine Learning (ICML), pp. 448–456, 2015. [24] T. Salimans and D. P. Kingma, “Weight normalization: A simple reparameterization to accelerate training of deep neural networks,” Advances in Neural Information Processing Systems (NIPS), pp. 901–909, 2016. [25] S. An, M. Hayat, S. H. Khan, M. Bennamoun, F. Boussaid, and F. Sohel, “Contractive rectifier networks for nonlinear maximum margin classification,” Proceedings of the IEEE International Conference on Computer Vision, pp. 2515–2523, 2015. [26] N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: A simple way to prevent neural networks from overfitting,” Journal of Machine Learning Research (JMLR), vol. 15, no. 1, pp. 1929–1958, Jun. 2014. [27] S. Rifai, P. Vincent, X. Muller, X. Glorot, and Y. Bengio, “Contractive auto-encoders: explicit invariance during feature extraction,” Proceedings of the 28th International Conference on Machine Learning (ICML), pp. 833–840, 2011. [28] J. Huang, Q. Qiu, G. Sapiro, and R. Calderbank, “Discriminative robust transformation learning,” Advances in Neural Information Processing Systems (NIPS), pp. 1333–1341, 2015. [29] V. N. Vapnik, “An overview of statistical learning theory,” IEEE Transactions on Neural Networks, vol. 10, no. 5, pp. 988–999, Sep. 1999. [30] S. Shalev-Shwartz and S. Ben-David, Understanding machine learning: from theory to algorithms. Cambridge University Press, 2014. May 24, 2017 DRAFT 35 [31] P. L. Bartlett and S. Mendelson, “Rademacher and Gaussian complexities: risk bounds and structural results,” Journal of Machine Learning Research (JMLR), vol. 3, pp. 463–482, 2002. [32] H. Xu and S. Mannor, “Robustness and generalization,” Machine Learning, vol. 86, no. 3, pp. 391–423, 2012. [33] B. Neyshabur, R. Tomioka, and N. Srebro, “Norm-based capacity control in neural networks,” Proceedings of The 28th Conference on Learning Theory (COLT), pp. 1376–1401, 2015. [34] S. Sun, W. Chen, L. Wang, and T.-Y. Liu, “Large margin deep neural networks: theory and algorithms,” arXiv:1506.05232, 2015. [35] S. Zagoruyko and N. Komodakis, “Wide residual networks,” arXiv:1605.07146, 2016. [36] C. Zhang, S. Bengio, M. Hardt, and B. Recht, “Understanding deep learning requires rethinking generalization,” arXiv:1611.03530, 2016. [37] J. Sokolić, R. Giryes, G. Sapiro, and M. R. D. Rodrigues, “Generalization error of invariant classifiers,” in International Conference on Artificial Intelligence and Statistics (AISTATS), 2017. [38] K. Q. Shen, C. J. Ong, X. P. Li, and E. P. V. Wilder-Smith, “Feature selection via sensitivity analysis of SVM probabilistic outputs,” Machine Learning, vol. 70, no. 1, pp. 1–20, Jan. 2008. [39] J. B. Yang, K. Q. Shen, C. J. Ong, and X. P. Li, “Feature selection via sensitivity analysis of MLP probabilistic outputs,” IEEE International Conference on Systems, Man and Cybernetics, pp. 774–779, 2008. [40] D. Shi, D. S. Yeung, and J. Gao, “Sensitivity analysis applied to the construction of radial basis function networks,” Neural networks, vol. 18, no. 7, pp. 951–957, Mar. 2005. [41] S. Mendelson, A. Pajor, and N. Tomczak-Jaegermann, “Uniform uncertainty principle for Bernoulli and subgaussian ensembles,” Constructive Approximation, vol. 28, no. 3, pp. 277–289, Dec. 2008. [42] N. Verma, “Distance preserving embeddings for general n-dimensional manifolds.” Journal of Machine Learning Research (JMLR), vol. 14, no. 1, pp. 2415–2448, Aug. 2013. [43] B. Neyshabur, R. Tomioka, R. Salakhutdinov, and N. Srebro, “Data-dependent path normalization in neural networks,” International Conference on Learning Representations (ICLR), 2015. [44] G. Watson, “Characterization of the subdifferential of some matrix norms,” Linear Algebra and its Applications, vol. 170, pp. 33–45, Jun. 1992. [45] K. B. Petersen and M. S. Pedersen, “The matrix cookbook,” Technical University of Denmark, 2012. [46] K. He, X. Zhang, S. Ren, and J. Sun, “Identity mappings in deep residual networks,” arXiv:1603.05027, 2016. [47] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735–1780, Nov. 1997. [48] Y. Bengio, “Learning deep architectures for AI,” Foundations and trends® in Machine Learning, vol. 2, no. 1, pp. 1–127, 2009. [49] A. Veit, M. Wilber, and S. Belongie, “Residual networks are exponential ensembles of relatively shallow networks,” arXiv:1605.06431, 2016. [50] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, Nov. 1998. [51] A. Krizhevsky and G. Hinton, “Learning multiple layers of features from tiny images,” Computer Science Department, University of Toronto, Tech. Rep, Apr. 2009. [52] Y. S. Hsiao, J. Sanchez-Riera, T. Lim, K. L. Hua, and W. H. Cheng, “LaRED: a large RGB-D extensible hand gesture dataset,” Proceedings of the 5th ACM Multimedia Systems Conference, pp. 53–58, 2014. [53] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. May 24, 2017 DRAFT 36 Berg, and L. Fei-Fei, “ImageNet large scale visual recognition challenge,” International Journal of Computer Vision (IJCV), vol. 115, no. 3, pp. 211–252, 2015. [54] J. T. Springenberg, A. Dosovitskiy, T. Brox, and M. Riedmiller, “Striving for simplicity: the all convolutional net,” International Conference on Learning Representations (ICLR - workshop track), Dec. 2015. [55] Theano Development Team, “Theano: A Python framework for fast computation of mathematical expressions,” arXiv:1605.02688, 2016. May 24, 2017 DRAFT
9cs.NE
arXiv:1704.02191v2 [cs.NE] 19 Jun 2017 The (1+λ) Evolutionary Algorithm with Self-Adjusting Mutation Rate∗ Benjamin Doerr Laboratoire d’Informatique (LIX) École Polytechnique Palaiseau, France Christian Gießen DTU Compute Technical University of Denmark Kgs. Lyngby, Denmark Carsten Witt DTU Compute Technical University of Denmark Kgs. Lyngby, Denmark Jing Yang Laboratoire d’Informatique (LIX) École Polytechnique Palaiseau, France June 20, 2017 Abstract We propose a new way to self-adjust the mutation rate in population-based evolutionary algorithms in discrete search spaces. Roughly speaking, it consists of creating half the offspring with a mutation rate that is twice the current mutation rate and the other half with half the current rate. The mutation rate is then updated to the rate used in that subpopulation which contains the best offspring. We analyze how the (1+λ) evolutionary algorithm with this self-adjusting mutation rate optimizes the OneMax test function. We prove that this dynamic version of the (1+λ) EA finds the optimum in an expected optimization time (number of fitness evaluations) of O(nλ/log λ + n log n). This time is asymptotically smaller than the optimization time of the classic (1 + λ) EA. Previous work shows that this performance is best-possible among all λ-parallel mutation-based unbiased black-box algorithms. This result shows that the new way of adjusting the mutation rate can find optimal dynamic parameter values on the fly. Since our adjustment mechanism is simpler than the ones previously used for adjusting the mutation rate and does not have parameters itself, we are optimistic that it will find other applications. 1 Introduction Evolutionary algorithms (EAs) have shown a remarkable performance in a broad range of applications. However, it has often been observed that this performance depends crucially on the use of the right parameter settings. Parameter optimization and parameter ∗ An extended abstract of this report will appear in the proceedings of the 2017 Genetic and Evolutionary Computation Conference (GECCO 2017). 1 control are therefore key topics in EA research. Since these have very different characteristics in discrete and continuous search spaces, we discuss in this work only evolutionary algorithms for discrete search spaces. Theoretical research has contributed to our understanding of these algorithms with mathematically founded runtime analyses, many of which show how the runtime of an EA is determined by its parameters. The majority of these works investigate static parameter settings, i. e., the parameters are fixed before the start of the algorithm and are not changed during its execution. More recently, a number of results were shown which prove an advantage of dynamic parameter settings, that is, the parameters of the algorithm are changed during its execution. Many of these rely on making the parameters functionally dependent on the current state of the search process, e.g., on the fitness of the current-best individual. While this provably can lead to better performances, it leaves the algorithm designer with an even greater parameter setting task, namely inventing a suitable functional dependence instead of fixing numerical values for the parameters. This problem has been solved by theoretical means for a small number of easy benchmark problems, but it is highly unclear how to find such functional relations in the general case. A more designer-friendly way to work with dynamic parameters is to modify the parameters based on simple rules taking into account the recent performance. A number of recent results shows that such on the fly or self-adjusting parameter settings can give an equally good performance as the optimal fitness-dependent parameter setting, however, with much less input from the algorithm designer. For example, good results have been obtained by increasing or decreasing a parameter depending on whether the current iteration improved the best-so-far solution or not, e.g., in a way resembling the 1/5-th rule from continuous optimization. Such success-based self-adjusting parameter settings can work well when there is a simple monotonic relation between success and parameter value, e.g., when one speculates that increasing the size of the population in an EA helps when no progress was made. For parameters like the mutation rate, it is not clear what a success-based rule can look like, since a low success rate can either stem from a too small mutation rate (regenerating the parent with high probability) or a destructive too high mutation rate. In [17], a relatively complicated learning mechanism was presented that tries to learn the right mutation strength by computing a time-discounted average of the past performance stemming from different parameter values. This learning mechanism needed a careful trade-off between exploiting the currently most profitably mutation strength and experimenting with other parameter values and a careful choice of the parameter controlling by how much older experience is taken less into account than more recent observations. 1.1 A New Self-Adjusting Mechanism for Population-Based EAs In this work, we propose an alternative way to adjust the mutation rate on the fly for algorithms using larger offspring populations. It aims at overcoming some of the difficulties of the learning mechanism just described. The simple idea is to create half 2 the offspring with twice the current mutation rate and the other half using half the current rate. The mutation rate is then modified to the rate which was used to create the best of these offspring (choosing the winning offspring randomly among all best in case of ambiguity). We do not allow the mutation rate to leave the interval [2/n, 1/4], so that the rates used in the subpopulations are always in the interval [1/n, 1/2]. We add one modification to the very basic idea described in the first paragraph of this section. Instead of always modifying the mutation rate to the rate of the best offspring, we shall take this winner’s rate only with probability a half and else modify the mutation rate to a random one of the two possible values (twice and half the current rate). Our motivation for this modification is that we feel that the additional random noise will not prevent the algorithm from adjusting the mutation rate into a direction that is more profitable. However, the increased amount of randomness may allow the algorithm to leave a possible basin of attraction of a locally optimal mutation rate. Observe that with probability Θ(1/n2 ), a sequence of log2 n random modification all in the same direction appears. Hence with this inverse-polynomial rate, the algorithm can jump from any mutation rate to any other (with the restriction that only a discrete set of mutation rates can appear). We note that the existence of random modifications is also exploited in our runtime analysis, which will show that the new self-adjusting mechanism selects mutation rates good enough to lead to the asymptotically optimal runtime among all dynamic choices of the mutation rate for the (1+λ) EA. In this first work proposing this mechanism, we shall not spend much effort finetuning it, but rather show in a proof-of-concept manner that it can find very good mutation rates. In a real application, it is likely that better results are obtained by working with three subpopulations, namely an additional one using (that is, exploiting) the current mutation rate. Also, it seems natural that more modest adjustments of the mutation rate, that is, multiplying and dividing the rate by a number F that is smaller than the value F = 2 used by our mechanism, is profitable. We conduct some elementary experiments supporting this intuition in Section 8. 1.2 Runtime Analysis for the Self-Adjusting (1+λ) EA on OneMax To prove that the self-adjusting mechanism just presented can indeed find good dynamic mutation rates, we analyse it in the purest possible setting, namely in the optimization of the classic test function OneMax : {0, 1}n → R; (x1 , . . . , xn ) 7→ n X xi i=1 via the (1+λ) EA (see Algorithm 1). The runtime of the (1+λ) EA with fixed mutation rates on OneMax is well understood [11, 22]. In particular, Gießen show that the expected runtime  and Witt [22] ln λ er n ln n (number of generations) is (1 ± o(1)) 12 · n ln + · when a mutation rate of ln λ r λ r/n, r a constant, is used. Thus for λ not too large, the mutation rate determines the leading constant of the runtime, and a rate of 1/n gives the asymptotically best runtime. 3 As a consequence of their work on parallel black-box complexities, Badkobeh, Lehre, and Sudholt [1] showed that the (1+λ) EA with a suitable fitness-dependent mutation rate finds the optimum of OneMax in an asymptotically better runtime of O( logn λ + n log n λ ), where the improvement is by a factor of Θ(log log λ). This runtime is bestpossible among all λ-parallel unary unbiased black-box optimization algorithms. In particular, no other dynamic choice of the mutation rate in the (1+λ) EA can achieve an asymptotically better runtime. The way how the mutation rate depends on the fitness in the above result, however, is not trivial. When the parent individual has ln λ fitness distance d, then mutation rate employed is p = max{ n ln(en/d) , n1 }. Our main technical result is that the (1+λ) EA adjusting the mutation rate according to the mechanism described above has the same (optimal) asymptotic runtime. Consequently, the self-adjusting mechanism is able find on the fly a mutation rate that is sufficiently close to the one proposed in [1] to achieve asymptotically the same expected runtime. Theorem 1. Let λ ≥ 45 and λ = nO(1) . Let T denote the number of generations of the (1+λ) EA with self-adjusting mutation rate on OneMax. Then,  E(T ) = Θ n n log n + . log λ λ  λn This corresponds to an expected number of functions evaluations of Θ( log λ + n log n). To the best of our knowledge, this is the first time that a simple mutation-based EA achieves a super-constant speed-up via a self-adjusting choice of the mutation rate. As an interesting side remark, our proofs reveal that a quite non-standard but fixed mutation rate of r = ln(λ)/2 also achieves the Θ(log log λ) improvement as it implies the bound of Θ(n/log λ) generations if λ is not too small. Hence, the constant choice r = O(1) as studied in [22] does not yield the asymptotically optimal number of generations unless λ is so small that the n log n-term dominates. Lemma 1. Let λ ≥ 45 and λ = nO(1) , Let T denote the number of generations of the (1+λ) EA with fixed mutation rate r = ln(λ)/2. Then,  E(T ) = O n n log n + √ . log λ λ  √ λn This corresponds to an expected number of functions evaluations of O( log λ + λn log n). The paper is structured as follows: In Section 2 we give a overview over previous analyses of the (1+λ) EA and of self-adjusting parameter control mechanism in EAs from a theoretical perspective. In Section 3 we give the algorithm and the mutation scheme. For convenience, we also state some key theorems that we will frequently use in the rest of the paper. The next three sections deal with the runtime analysis of the expected time spent by the (1+λ) EA on OneMax in each of three regions of the fitness distance d. We label these regions the far region, middle region and near region, each of which will be dealt with in a separate section. The proof of the main theorem and of Lemma 1 is then given in Section 7. Finally, we conclude in Section 9. 4 2 Related Work Since this is a theoretically oriented work on how a dynamic parameter choice speeds up the runtime of the (1+λ) EA on the test function OneMax, let us briefly review what is known about the theory of this EA and dynamic parameter choices in general. 2.1 The (1+λ) EA The first to conduct a rigorous runtime analysis of the (1+λ) EA were Jansen, De Jong, and Wegener [24]. They proved, among other results, that when optimizing OneMax a linear speed-up exists up to a population size of Θ(log(n) log log(n)/log log log(n)), that is, for λ = O(log(n) log log(n)/log log log(n)), finding the optimal solution takes an expected number of Θ(n log(n)/λ) generations, whereas for larger λ at least ω(n log(n)/λ) generations are necessary. This picture was completed in [11] with a proof that the exn n log log λ pected number of generations taken to find the optimum is Θ( n log λ + log λ ). The imln λ er n ln n plicit constants were determined in [22], giving the bound of (1±o(1))( 12 n ln ln λ + r λ ), for any constant r, as mentioned in the introduction. Aside from the optimization behavior on OneMax, not too much is known for the (1+λ) EA, or is at least not made explicit (it is easy to see that waiting times for an improvement which are larger than λ reduce by a factor of Θ(λ) compared to one-individual offspring populations). Results made explicit are the Θ(n2 / log(n) + n) expected runtime (number of generations) on LeadingOnes [24], the worst-case Θ(n + n log(n)/λ) expected runtime on linear functions [11], and the O(m2 (log n + log wmax )/λ) runtime estimate for minimum spanning trees valid for λ ≤ m2 /n [31]. 2.2 Dynamic Parameter Choices While it is clear the EAs with parameters changing during the run of the algorithm (dynamic parameter settings) can be more powerful than those only using static parameter settings, only recently considerable advantages of dynamic choices could be demonstrated by mathematical means (for discrete optimization problems; in continuous optimization, step size adaptation is obviously necessary to approach arbitrarily closely a target point). To describe the different ways to dynamically control parameters, we use in the following the language proposed in Eiben, Hinterding, and Michalewicz [21] and its extension from [10]. 2.2.1 Deterministic Parameter Control In this language, deterministic parameter control means that the dynamic choice of a parameter does not depend on the fitness landscape. The first to rigorously analyze a deterministic parameter control scheme are Jansen and Wegener [23]. They regard the performance of the (1+1) EA which uses in iteration t the mutation rate 2k /n, where k ∈ {1, 2, . . . , 2dlog2 ne−2 } is chosen such that log2 (k) ≡ t − 1 (mod dlog2 ne − 1). In other words, they cyclically use the mutation rates 1/n, 2/n, . . . , K/n, where K is the largest 5 power of two that is less than n/2. Jansen and Wegener demonstrate that there exists an example function where this dynamic EA significantly outperforms the (1+1) EA with any static mutation rate. However, they also observe that for many classic problems, this EA is slower by a factor of Θ(log n). In [32], a rank-based mutation rate was analyzed for the (µ+1) EA. A previous experimental study [5] suggested that this is a profitable approach, but the mathematical runtime analysis in [32] rather indicates the opposite. While there are artificial examples where a huge runtime gain could be shown and also the worst-case runtime of the (µ+1) EA reduces from essentially nn to O(3n ), a rigorous analysis on the OneMax function rather suggests that the high rate of offspring generated with a mutation rate much higher than 1/n brings a significant risk of slowing down the optimization process. For two non-standard settings in evolutionary computation, deterministic parameter control mechanisms also gave interesting results. For problems where the solution length is not known [4], more precisely, where the number or the set of bits relevant for the solution quality is unknown, again random mutation rates gave good results [14, 19]. Here however, not a power-law scheme was used, but rather one based on very slowly decreasing summable sequences. For problems where the discrete variables take many values, e.g., the search space is {0, . . . , r − 1}n for some large r, the question is how to change the value of an individual variable. The results in [15] suggest that a harmonic mutation strength, that is, changing a variable value by ±i with i chosen randomly with probability proportional to 1/i, can be beneficial. This distribution was analyzed earlier in [7] for the one-dimensional case, where it was also shown to give the asymptotically best performance on a OneMax type problem. For randomized search heuristics outside evolutionary computation, Wegener [33] showed that simulated annealing (using a time-dependent temperature) can beat the Metropolis algorithm (using a static temperature). 2.2.2 Adaptive Parameter Control A parameter control scheme is called adaptive if it used some kind of feedback from the optimization process. This can be functionally dependent (e.g., the mutation rate depends on the fitness of the parent) or success-based (e.g., a 1/5th rule). The first to conduct a runtime analysis for an adaptive parameter control mechanism (and show a small advantage over static choices) were Böttcher, Doerr, and Neumann [2]. They proposed to use the fitness-dependent mutation rate of 1/(LeadingOnes(x) + 1) for the optimization of the LeadingOnes test function. They proved that with this choice, the runtime of the (1+1) EA improves to roughly 0.68n2 compared to a time of 0.86n2 stemming from the classic mutation rate 1/n or a runtime of 0.77n2 stemming from the asymptotically optimal static rate of approximately 1.59/n. For the (1p+ (λ, λ)) GA, a fitness-dependent offspring population size of order λ = Θ( n/d(x) ) was suggested in [13], where d(x) is the fitness-distance of the parent individual to the optimum. This choice improves the optimization timep(number of fitness evaluations until the optimum is found) on OneMax from Θ(n log(n) log log log(n)/log log(n) ) stemming from the optimal static parameter 6 choice [9] to O(n). Since in this adaptive algorithm the mutation rate p is functionally dependent on the offspring population size, namely via pp = λ/n, the dynamic choice of λ is equivalent to a fitness-dependent mutation rate of 1/ nd(x). In the aforementioned work by Badkobeh et al. [1], a fitness-dependent mutation rate  log λ n ln λ of max n ln(en/d(x)) , n1 was shown to improve the classic runtime of O n log + n log log λ λ n to O logn λ + n log . In [17], the (1+1) EA using a k-bit flip mutation operator together λ with a fitness-dependent choice of k was shown to give a performance on OneMax that is very close to the theoretical optimum (among all unary unbiased black-box algorithms), however, this differs only by lower order terms from the performance of the simple randomized local search heuristic (RLS). For nature-inspired algorithms other than evolutionary ones, Zarges [34, 35] proved that fitness-dependent mutation rates can be beneficial in artificial immune systems.  2.3 Self-adjusting and Self-adaptive Parameter Control While all these results show an advantage of an adaptive parameter setting, it remains questionable if an algorithm user would be able to find such a functional dependence of the parameter on the fitness. This difficulty can be overcome via self-adjusting parameter choices, where the parameter is modified according to a simple rule often based on the success or progress of previous iterations, or via self-adaptation, where the parameter is encoded in the genome and thus subject to variation and selection. The understanding of self-adaptation is still very limited. The only theoretical work on this topic [6], however, is promising and shows examples where self-adaptation can lead to significant speed-ups for non-elitist evolutionary algorithms. In contrast to this, the last years have produced a profound understanding of selfadjusting parameter choices. The first to perform a mathematical analysis were Lässig and Sudholt [28], who considered the (1+λ) EA and a simple parallel island model together with two self-adjusting mechanisms for population size or island number, including halving or doubling it depending on whether the current iteration led to an improvement or not. These mechanisms were proven to give significant improvements of the “parallel” runtime (number of generations) on various test functions without increasing significantly the “sequential” runtime (number of fitness evaluations). In [10] it was shown that the fitness-dependent choice of λ for the (1 + (λ, λ)) GA described above can also be found in a self-adjusting way. To this aim, another successbased mechanism was proposed, which imitates the 1/5-th rule from evolution strategies. With some modifications, this mechanism also works on random satisfiability problems [3]. For the problem of optimizing an r-valued OneMax function, a self-adjustment of the step size inspired by the 1/5-th rule was found to find the asymptotically best possible runtime in [16]. These results indicate that success-based dynamics work well for adjusting parameters when a monotonic relation like “if progress is difficult, then increase the population size” holds. For adjusting a parameter like the mutation rate, it is less obvious how to do this. For example, in the search space {0, 1}n both a too large mutation rate (creating 7 a stronger drift towards a Hamming distance of n/2 from the optimum) and a too small mutation rate (giving a too small radius of exploration) can be detrimental. For this reason, to obtain a self-adjusting version of their result on the optimal number k to optimize OneMax via k-bit flips [17], in [18] a learning mechanism was proposed that from the medium-term past estimates the efficiency of different parameter values. As shown there, this does find the optimal mutation strength sufficiently well to obtain essentially the runtime stemming from the fitness-dependent mutation strength exhibited before. In the light of these works, our result from the methodological perspective shows that some of the difficulties of the learning mechanism of [18], e.g., the whole bookkeeping being part of it and also the setting of the parameters regulating how to discount information over time, can be overcome by the mechanism proposed in this work. In a sense, the use of larger populations enables us to adjust the mutation rate solely on information learned in the current iteration. However, we do also use the idea of [18] to intentionally use parameter settings which appear to be slightly off the current optimum to gain additional insight. 3 3.1 Preliminaries Algorithm We consider the (1+λ) EA with self-adjusting mutation rate for the minimization of pseudo-boolean functions f : {0, 1}n → R, defined as Algorithm 1. The general idea of the mutation scheme is to adjust the mutation strength according to its success in the population. We perform mutation by applying standard bit mutation with two different mutation probabilities r/(2n) and 2r/n and we call r the mutation rate. More precisely, for an even number λ ≥ 2 the algorithm creates λ/2 offspring with mutation rate r/2 and with 2r each. The mutation rate is adjusted after each selection. With probability a half, the new rate is taken as the mutation rate that the best individual (i. e. the one with the lowest fitness, ties broken uniformly at random) was created with (success-based adjustment). With the other 50% probability, the mutation rate is adjusted to a random value in {r/2, 2r} (random adjustment). Note that the mutation rate is adjusted in each iteration, that is, also when all offspring are worse than the parent and thus the parent is kept for the next iteration. If an adjustment of the rate results in a new rate r outside the interval [2, n/4], we replace this rate with the corresponding boundary value. Note that in the case of r < 2, a subpopulation with rate less than 1 would be generated, which means flipping less than one bit in expectation. At a rate r > n/4, a subpopulation with rate larger than n/2 would be created, which again is not a very useful choice. We formulate the algorithm to start with an initial mutation rate rinit . The only assumption on rinit is to be greater than or equal to 2. The (1+λ) EA with this selfadjusting choice of the mutation rate is given as pseudocode in Algorithm 1. 8 Algorithm 1 (1+λ) EA with two-rate standard bit mutation Select x uniformly at random from {0, 1}n and set r ← rinit . for t ← 1, 2, . . . do for i ← 1, . . . , λ do Create xi by flipping each bit in a copy of x independently with probability rt /(2n) if i ≤ λ/2 and with probability 2rt /n otherwise. x∗ ← arg minxi f (xi ) (breaking ties randomly). if f (x∗ ) ≤ f (x) then x ← x∗ . Perform one of the following two actions with prob. 1/2: • Replace rt with the mutation rate that x∗ has been created with. • Replace rt with either rt /2 or 2rt , each with probability 1/2. Replace rt with min{max{2, rt }, n/4}. Let us explain the motivation for the random adjustments of the rate. Without such random adjustments, the rate can only be changed into some direction if a winning offspring is generated with this rate. For simple functions like OneMax, this is most likely sufficient. However, when the fitness of the best of λ/2 offspring, viewed as a function of the rate, is not unimodal, then several adjustments into a direction at first not yielding good offspring might be needed to reach good values of the rate. Here, our random adjustments enable the algorithm to cross such a valley of unfavorable rate values. We note that such ideas are not uncommon in evolutionary computation, with standard-bit mutation being the most prominent example (allowing to perform several local-search steps in one iteration to cross fitness valleys). A different way to implement a mechanism allowing larger changes of the rate to cross unfavorable regions would have been to not only generate offspring with rates r/2 and 2r, but to allow larger deviations from the current rate with some small probability. One idea could be choosing for each offspring independently the rate r2−i with probability 2−|i|−1 for all i ∈ Z, i 6= 0. This should give similar results, but to us the process appears more chaotic (e.g., with not the same number of individuals produced with rates r/2 and 2r). The runtime, also called the optimization time, of the (1+λ) EA is the smallest t such that an individual of minimum f -value has been found. Note that t corresponds to a number of iterations (also called generations), where each generation creates λ offspring. Since each of these offspring has to be evaluated, the number of function evaluations, which is a classical cost measure, is by a factor of λ larger than the runtime as defined here. However, assuming a massively parallel architecture that allows for parallel evaluation of the offspring, counting the number of generations seems also a valid cost measure. In particular, a speed-up on the function OneMax(x1 , . . . , xn ) := x1 +· · ·+xn by increasing λ can only be observed in terms of the number of generations. Note that 9 for reasons of symmetry, it makes no difference whether OneMax is minimized (as in the present paper) or maximized (as in several previous research papers). Throughout the paper, all asymptotic notation will be with respect to the problem size n. 3.2 Drift Theorems Our results are obtained by drift analysis, which is also used in previous analyses of the (1+λ) EA without self-adaptation on OneMax and other linear functions [11, 22]. The first theorems stating upper bounds on the hitting time using variable drift go back to [25, 30]. We take a formulation from [29] but simplify it to Markov processes for notational convenience. Theorem 2 (Variable Drift, Upper Bound). Let (Xt )t≥0 , be random variables describing a Markov process over a finite state space S ⊆ {0} ∪ [xmin , xmax ], where xmin > 0. Let T be the random variable that denotes the earliest point in time t ≥ 0 such that Xt = 0. If there exists a monotone increasing function h(x) : [xmin , xmax ] → R+ , where 1/h(x) is integrable on [xmin , xmax ], such that for all x ∈ S with Pr(Xt = x) > 0 we have E(Xt − Xt+1 | Xt = x) ≥ h(x) then for all x0 ∈ S with Pr(X0 = x0 ) > 0 E(T | X0 = x0 ) ≤ xmin + h(xmin ) Z x0 xmin 1 dx. h(x) The variable drift theorem is often applied in the special case of additive drift in discrete spaces: assuming E(Xt − Xt+1 | Xt = x; Xt > 0) ≥  for some constant , one obtains E(T | X0 = x0 ) ≤ x0 /. Since we will make frequent use of it in the following sections as well, we will also give the version of the Multiplicative Drift Theorem for upper bounds, due to [12]. Again, this is implied by the previous variable drift theorem. Theorem 3 (Multiplicative Drift [12]). Let (Xt )t≥0 be random variables describing a Markov process over a finite state space S ⊆ R+ 0 and let xmin := min{x ∈ S | x > 0}. Let T be the random variable that denotes the earliest point in time t ≥ 0 such that Xt = 0. If there exist δ > 0 such that for all x ∈ S with Pr(Xt = x) > 0 we have E(Xt − Xt+1 | Xt = x) ≥ δx , then for all x0 ∈ S with Pr(X0 = x0 ) > 0, E(T | X0 = x0 ) ≤ 10 1 + ln  δ x0 xmin  . 3.3 Chernoff Bounds For reasons of self-containedness and as a courtesy to the reader, we state two wellknown multiplicative Chernoff bounds and a lesser known additive Chernoff bound that is also known in the literature as Bennett’s inequality. Theorem 4 (Bennett’s inequality, Chernoff Bounds [8, Theorem 1.12, Theorem 1.10]). P Let X1 , . . . , Xn be independent random variables and let X = ni=1 Xi . Furthermore, let P b such that Xi ≤ E(Xi ) + b for all i = 1, . . . , n and σ 2 = n1 ni=1 Var(Xi ). Then, for all γ>0 !! !   nσ 2 bγ γ −1 . 1+ ln 1 + Pr(X ≥ E(X) + γ) ≤ − b bγ nσ 2 Moreover, if the Xi for all i = 1, . . . , n take values in [0, 1] then • Pr(X ≤ (1 − δ)E(X)) ≤ exp(−δ 2 E(X)/2) for all 0 ≤ δ ≤ 1. • Pr(X ≥ (1 + δ)E(X)) ≤ exp(−δ 2 E(X)/(2 + δ)) for all δ > 0. 3.4 Occupation Probabilities As mentioned above, we will be analyzing two depending stochastic processes: the random decrease of fitness and the random change of the mutation rate. Often, we will prove by drift analysis that the rate is drifting towards values that yield an almost-optimal fitness decrease. However, once the rate has drifted towards such values, we would also like the rates to stay in the vicinity of these values in subsequent steps. To this end, we apply the following theorem from [27]. Note that in the paper a slightly more general version including a self-loop probability is stated, which we do not need here. Theorem 5 (Theorem 7 in [27]). Let a Markov process (Xt )t≥0 on R+ 0 , where |Xt − Xt+1 | ≤ c, with additive drift of at least d towards 0 be given (i. e., E(Xt − Xt+1 | Xt ; Xt > 0) ≥ d), starting at 0 (i.e. X0 = 0). Then we have, for all t ∈ N and b ∈ R+ 0, 2d Pr(Xt ≥ b) ≤ 2e 3c (1−b/c) . We can readily apply this theorem in the following lemma that will be used throughout the paper to bound the rate rt . Lemma 2. If there is a point c ≥ 4 such that Pr(rt+1 < rt | rt > c) ≥ 1/2 +  for some constant  > 0, then for all t0 ≥ min{t | rt ≤ c} and all b ≥ 4 it holds Pr(rt0 ≥ c + 2b ) ≤ 2e−2b/3 . Proof. Apply Theorem 5 on the process Xt := max{0, dlog2 (rt /c)e}. Note that this process is on N0 , moves by an absolute value of at most 1 and has drift E(Xt − Xt+1 | Xt ; Xt > 0) = 2. We use c := 1 and d := 2 in the theorem and estimate 1 − b ≤ −b/2. 11 4 Far Region In this first of three technical sections, we analyze the optimization behavior of our selfadjusting (1+λ) EA in the regime where the fitness distance k is at least n/ln λ. Since we are relatively far from the optimum, it is relatively easy to make progress. On the other hand, this regime spans the largest number of fitness levels (namely Θ(n)), so we need to exhibit a sufficient progress in each iteration. Also, this is the regime where the optimal mutation rate varies most we remark that the √ drastically. Without proof, √ optimal rate is n for k ≥ n/2 + ω( n log λ), n/2 for k = n/2 ± o( n log λ), and then quickly drops to r = Θ(log λ) for k ≤ n/2 − εn. Despite these difficulties, our (1+λ) EA manages to find sufficiently good mutation rates to be able to reach a fitness distance of k = n/ln λ in an expected number of O(n/ log λ) iterations. Lemma 3. Let n be sufficiently large and 0 < k < n/2. We define c1 (k) = (2 ln(en/k))−1 and c2 (k) = 4n2 /(n − 2k)2 . • If n/ln λ ≤ k and r ≤ c1 (k) ln λ, then the probability that a best offspring has been created with rate 2r is at least 0.5005. • Let λ ≥ 50. If n/2 ≥ r ≥ c2 (k) ln λ, then the probability that all best offspring have been created with rate r/2 is at least 0.58. • If r ≥ 2(1 + γ)c2 (k) ln λ, then the probability that all best offspring are worse than the parent is at least 1 − λ−γ . Proof. Let Q(k, i, r) be the probability that standard bit mutation with mutation rate p = r/n creates from a parent with fitness distance k an offspring with fitness distance at most k − i. Then Q(k, i, r) = x−i k X X x=i y=0 k x ! ! n − k x+y p (1 − p)n−x−y . y By comparing each component in Q(k, i, r/2) and Q(k, i, 2r) we obtain Q(k, i, 2r)/Q(k, i, r/2) ≥ 4i  i −1.5r (1 − 2r/n)n ≥ 1 − o(1) 4e . (1 − r/(2n))n Here we notice that ln(1 − x) ≥ −x − x2 for all 0 ≤ x ≤ 1/2. Then 1 − 2r n r 1 − 2n !n 1.5r = 1− n − 0.5r  n −1.5rn 2(1.5r)2 n ≥ exp − n − 0.5r (n − 0.5r)2 ! ≥ (1 − o(1))e−1.5r . The above inequality applies λ = nO(1) . Therefore r < ln λ = O(ln n). Since Q(k, i, r) is monotone decreasing in i, let i∗ be the largest i such that Q(k, i, 2r) ≥ 4/λ. We will then have i∗ ≥ 2r because ! Q(k, 2r, 2r) ≥ k (2p)2r (1 − 2p)n 2r 12 2r · 2r (k − 1)(k − 2) k 2r 2r ≥ · · 1·2 k2 2r n  2r  2c1 (k) ln λ k k 4 > 2r ≥ ≥ . en en λ    2r · (1 − o(1))e−2r The second inequality which involves (1−2p)n again uses the fact that r < ln λ = O(ln n). √ This means p = o(1/ n) and then we have (1 − 2p)n ≥ exp(−2pn − 4p2 n) ≥ (1 − o(1)) exp(−2r). The (1 − o(1)) factor and (k − 1)(k − 2)/k 2 is compensated by decreasing (2r/2) to 1 if n is large enough. We notice that when r = 2 we have i∗ ≥ ln(λ)/(2 ln ln λ) since  i  i 4k 1 4i e−4 ln λ Q(k, i, 4/n) ≥ e−4 ≥ 4i e−4 ≥ for i = . in i ln λ λ 2 ln ln λ Let î = ln(λ)/(2 ln ln λ). We notice that np − x − y ∂px+y (1 − p)n−x−y = px+y−1 (1 − p)n−x−y ≥ 0 when x + y ≥ i ≥ np, ∂p p−1 Q(k, i, r) is increasing in r when r ≤ i. We obtain i∗ ≥ î for all r ≥ 2 which results in ∗ 4i e−1.5r ≥ exp(i∗ (ln 4 − 1.5/2)) ≥ Θ(λ1/ ln ln λ ). We also need an upper bound on i∗ . Since r ≤ ln(λ)/2 and k ≤ n/2 implies kr/n ≤ ln(λ)/4, then Chernoff Bounds shows that the probability that 1.65 ln λ ≥ 6.6kr/n bits being flipped from k bits is less than exp(−(5.6/7.6)1.4 ln λ) < 1/λ. This means i∗ < 1.65 ln λ. We use this to compute the upper bound on Q(k, i∗ , 2r). Let q(k, i, r) = Q(k, i, r) − Q(k, i + 1, r) be the probability of that the fitness distance is decreased by i. We regard the terms in q(k, i, r) where x − y = i. If x and y both increase by 1, the terms change by a factor of k−x n−k−y p2 kp (n − k)p r2 · · ≤ (1 + o(1)) · ≤ x+1 y+1 (1 − p)2 x+1 y+1 4xy If we consider y ≥ r then xy > r2 and the factor r2 /(4xy) ≤ 1/4. The sum of these factors for all y ≥ r is less than the geometric series with ratio 1/4. Therefore, the sum from 0 ≤ y < r contributes to at least 2/3 of the total sum q(k, i, r). Consequently, if we look at the first 2r terms in q(k, i∗ , 2r) and q(k, i∗ + 1, 2r) we have q(k, i∗ + 1, 2r) 2 (k − 2r − i∗ + 1)2p 4kp 2rk ≥ · ≥ = ∗ . ∗ ∗ ∗ q(k, i , 2r) 3 (2r + i )(1 − 2p) 3(2/2 + 1)i 3i n Since q(k, i∗ + 1, 2r) ≤ Q(k, i∗ + 1, 2r) and k ≥ n/ ln λ we further more have q(k, i∗ , 2r) 3i∗ ln λ Q(k, i∗ , 2r) 3i∗ ln λ ≤ and ≤ 1 + . Q(k, i∗ + 1, 2r) 2r Q(k, i∗ + 1, 2r) 2r So finally Q(k, i∗ , 2r) ≤ 4(1 + 1.5i∗ ln λ/r)/λ and ∗ 4(1 + 1.5i r ln λ ) 1 Q(k, i∗ , 2r) Q(k, i , r/2) ≤ i∗ −1.5r ≤ · . 4 e 4i∗ e−1.5r λ ∗ 13 If λ = ω(1) then the factor before 1/λ is Θ(ln2 (λ)/λ1/ ln ln(λ) ) = o(1). Otherwise if ln λ ≥ 130 or r ≥ 8 or r < 8 but i∗ ≥ 16 we prove Q(k, i∗ , r/2) < 0.8/λ so that with probability less than 0.4 at least one offspring of r/2 achieve i∗ . Then with probability at least (1 − (1 − 4/λ)λ/2 ) · (1 − 0.4) > 0.86 ∗ 0.6 > 0.51 all the best offspring have been created with 2r. We first regard large λ. If ln λ ≥ 130, we define t = i∗ /r then 2 ≤ t ≤ (1.65 ln λ)/2 and the factor Q(k, i∗ , r/2)/λ becomes 4(1 + 1.5t ln λ) 4(1 + 1.5t ln λ) . ≤ ∗ exp(i (ln 4 − 1.5/t)) exp(î(ln 4 − 1.5/t)) If t ≤ 3 it is 4(1 + 1.5t ln λ) 4(1 + 4.5 ln λ) ≤ < 0.8 exp(î(ln 4 − 1.5/t)) exp(î(ln 4 − 1.5/2)) otherwise it is 4(1 + 1.5t ln λ) 4(1 + 1.5 ln2 λ) ≤ < 0.8. exp(î(ln 4 − 1.5/t)) exp(î(ln 4 − 1.5/3)) If ln λ < 130 and r ≥ 8 we can bound 4(1 + 1.5 · 1.65 ln2 (λ)/r) 4(1 + 41828/r) 4(1 + 1.5i∗ ln(λ)/r) ≤ < < 0.8. ∗ 4i e−1.5r exp(2r ln(4) − 1.5r) exp(2r ln(4) − 1.5r) If ln λ < 130, r < 8 but i∗ ≥ 16, then 4(1 + 1.5 · 130 · 16/2) 4(1 + 1.5i∗ ln(λ)/r) ≤ < 0.3. 4i∗ e−1.5r 416 e−12 For ln λ < 130 and r < 8, we prove that the probability that the best progress i attains 1.5r is at least 1 − 3 · 10−5 . Conditioning on 1.5r ≤ i ≤ i∗ it is obvious that i obtained from 2r with probability at least 0.5 since q(k, i, 2r)/(q, i, r/2) = (1 − o(1))4i e−1.5r > 1. For the remaining i ≥ i∗ + 1 which has probability no less than 1.2 · 10−3 , its very likely that a best offspring is from 2r. This can cancel 3 · 10−5 . We first compute Q(k, 1.5r, 2r) > 21/λ in the following way. Since 1.5r < 12 then for n large enough we have k Q(k, 1.5r, 2r) ≥ (1 − o(1)) 1.5r ! 2r n 1.5r e −2r (2r)1.5r ≥ (1 − o(1)) (1.5r)!  0.5r  n k k en 2r , with (k/(en))2r ≥ (k/(en))2c1 (k) ln λ = 1/λ, (2r)1.5r /((1.5r)!) ≥ 43 /6 and (n/k)0.5r ≥ 2. This means the best progress among λ/2 offspring attains 1.5r is at least 1 − (1 − 21/λ)λ/2 > 1 − 3 · 10−5 . For i ≥ i∗ + 1 according to the definition of i∗ and Q(k, i∗ , 2r)/Q(k, i∗ + 1, 2r) ≤ 1 + 1.5i∗ ln λ/r 4> Q(k, i∗ + 1, 2r) 4 4 1 ≥ ≥ > . ∗ λ 1 + 1.5i ln λ/r 1 + 1.5 · 16 · 130/2 391 14 Then for λ/2 offspring we have 1 − (1 − Q(k, i∗ + 1, 2r))λ/2 ≥ 1.2 · 10−3 . Moreover, use the fact that i∗ + 1 ≥ 2r + 1 we also have Q(k, i∗ + 1, 2r) 42r+1 45 ≥ > > 50. Q(k, i∗ + 1, r/2) e1.5r e3 Therefore it is easy to bound 1 − (1 − Q(k, i∗ + 1, 2r))λ/2 1 − (1 − Q(k, i∗ + 1, 2r))λ/2 1 − (1 − Q(k, i∗ + 1, 2r))λ/2 > > . Q(k, i∗ + 1, r/2) · λ/2 Q(k, i∗ + 1, 2r)/50 · λ/2 1 − (1 − Q(k, i∗ + 1, r/2))λ/2 We look at function fα (x) := (1 − (1 − x)α )/(αx) and gα (x) := (1 − x)α (1 + αx). Since gα0 (x) < 0 for all α > 1 and 0 < x < 1, we have gα (x) < gα (0) = 1 when 0 < x < 1. Therefore fα0 (x) = (gα−1 (x) − 1)/(αx2 ) < 0 and fλ/2 (4/λ) 1 − (1 − Q(k, i∗ + 1, 2r))λ/2 1 − (1 − 4/λ)λ/2 1 − 1/e2 > = ≥ > 21. Q(k, i∗ + 1, 2r)/50 · λ/2 50 (4/λ)/50 · λ/2 1/25 This means that if the best offspring made a progress of i∗ + 1 or more, then the conditional probability that it is from the 2r-subpopulation is at least 21/22. Finally we can bound the probability that a best offspring is from the 2r-subpopulation by (1 − 3 · 10−5 − 1.2 · 10−3 ) · 0.5 + 1.2 · 10−3 · 21 > 0.5005. 22 For the second statement, let X(k, r) denote the random decrease of the fitness distance when apply standard bit mutation with probability p = r/n to an individual with k ones. Then E(X) = kp − (n − k)p = (2k − n)p. According to Bennett’s inequality (Theorem 4), for any ∆ > 0 we have  Pr(X ≥ E(X) + ∆) ≤ exp −Var(X) · h  ∆ Var(X)  where h(u) = (1 + u) ln(1 + u) − u. We compare h(u) with τ u2 for any constant factor τ . Let g(u) = h(u) − τ u2 be the difference, then g(0) = g 0 (0) = 0 while g 00 (u) = 1/(1 + u) − 2τ ≥ 0 when 1/(1 + u) ≥ 2τ . This means h(u) ≥ u2 /(2u + 2). We now apply this bound with X = X(k, 2r) and ∆ = E(X(k, r/2)) − E(X(k, 2r)) = (n − 2k)1.5r/n > 0. We have Var(X(k, 2r)) = n(2p)(1 − 2p) = 2r(1 − 2r/n) and ∆/Var = (3/4)(n − 2k)/(n − 2r). Then, ∆2 Pr(X(k, 2r) ≥ E(X(k, r/2))) ≤ exp − (2 + 2u)Var(X(k, 2r)) 9(n − 2k)2 r = exp − 4n(7n − 8r − 6k) ! 9(n − 2k)2 c2 (k) ln λ ≤ exp − 28n2 ! ! = 1 λ9/7 . We notice that we have 7n − 8r − 6k > 7n − 4n − 3n = 0 in the second inequality. Therefore, with probability less than λ−9/7 (λ/2) < 50−2/7 /2 < 0.2 the best offspring 15 of rate 2r is better than the expectation of rate r/2. For rate r/2, let X + and X − be the number of one-bits flipped and zero-bits flipped, respectively. Both X + and X − follow a binomial distribution and X = X + − X − . We know E(X + ) = kr/(2n) and E(X − ) = (n − k)r/(2n) ≥ ln λ. The median of X + is between bE(X + )c to dE(X + )e by [26]. This means Pr(X + ≥ E(X + ) − 1) ≥ Pr(X + ≥ bE(X + )c) ≥ 1/2. For ln λ large enough, we can use a normal distribution to approximate X − and have Pr(X − ≤ E(X − ) − 1) = 1/2 − o(1). Otherwise we notice that ln λ ≥ ln 50 > 3 and r/(2n) ≤ 1/4. Let real number t denote E(X − ) and m denote n − k. It is clear that Pr(X − ≤ t − 1) = Pr(X − ≤ bt − 1c) ≥ Pr(X − ≤ dte − 2) = Pr(X − ≤ dte) − Pr(X − = dte) − Pr(X − = dte − 1). We see that Pr(X − ≤ dte) ≥ 1/2 and Pr(X − = dte) (m − t + 1)t t 1 4 = < < < Pr(X − = dte − 1) dte · m · (1 − r/(2n)) dte(1 − r/(2n)) 1 − r/(2n) 3 and (m − t + 2)t t 16 Pr(X − = dte − 1) = < < . Pr(X − = dte − 2) (dte − 1) · m · (1 − r/(2n)) (dte − 1)(1 − r/(2n)) 9 Then we obtain Pr(X − ≤ E(X − ) − 1) > 1 1 · > 0.097 2 1 + 16/9 + (16/9)(4/3) Therefore Pr(X(k, r/2) ≥ E(X(k, r/2))) ≥ 0.048, with probability at least 1 − (1 − 0.048)λ/2 > 0.7 one offspring beats E(X(k, r/2)). Therefore all best offspring are from r/2 with probability at least 0.7 · (1 − 0.2) > 0.56, this proves the second statement of the lemma. An offspring of mutation rate r/n is not worse than the parent if and only if X(k, r) ≥ 0 and, again by using Bennett’s inequality, we have −E(X) Pr(X ≥ 0) ≤ exp −Var(X) · h Var(X)   (n − 2k)2 r ≤ exp − 2n(2n − 2k − r) !  (n − 2k)2 r ≤ exp − 4n2 ! . Therefore if r = 2(1 + γ)c2 (k) ln λ, then the probability above for r/2 is 1/λ1+γ and for 2α is 1/λ4+4γ . This proves the third statement. The lemma above shows that the rate r is attracted to the interval [c1 (k) ln n, c2 (k) ln n]. Unfortunately, we cannot show that we obtain a sufficient progress in the fitness for exactly this range of r-values. However, we can do so for a range smaller only by constant factors. This is what we do now (for large values of k) and in Lemma 5 (for smaller values of k). This case distinction is motivated by the fact that c2 (k) becomes very large 16 when k approaches n/2. Having a good drift only for such a smaller range of r-values is not a problem since the random movements of r let us enter the smaller range with constant probability, see Theorem 6 and its proof. Let ∆ := ∆(λ/2, k, r) denote the fitness gain after selection among the best of λ/2 offspring generated with rate r from a parent with fitness distance k := OneMax(x). Let x(i) , i ∈ {1, . . . , λ/2}, be independent offspring generated from x by flipping each bit independently with probability r/n. Then the random variable ∆ is defined by ∆ := max{0, k − min{OneMax(x(i) ) | i ∈ {1, . . . , λ/2}}}. We next show that a narrow region contained in c1 (k) ln λ and c2 (k) ln λ provides at least logarithmic drift on fitness. We first do the proof for large k because c2 (k) will be ω(1) when k is close to n/2. Lemma 4. Let 2n/5 ≤ k < n/2 and n be large enough. Let c be such that c ≤ min{n2 /(50(n − 2k)2 ), n/(4 ln λ)} and c ≥ 1/2. Let r = c ln λ ≥ 1 and λ ≥ 2, then E(∆) ≥ 10−3 ln λ. Proof. Note that if k ≥ 2n/5 then n2 /(50(n − 2k)2 ) ≥ 1/(50 · 0.22 ) = 1/2. We look at the number X of flips in k ones. This random variable follows a binomial distribution  Bin(k, p) where p = r/n. Assume u = kp ≥ 1, B(x) = xk px (1 − p)k−x and F (x) = Pk i≥x B(i). If we use a normal distribution to approximate X, it’s not hard to see that the probability of hitting the mean satisfies F (u) ≥ Ω(1). More specifically, if u < 1 then F (u) = 1 − B(0) = 1 − (1 − p)n ≥ 1 − 1/e > 1/2. Otherwise if u ≥ 1 then the worst case for F (u) is u = 1+o(1) and F (u) ≥ 1−(1−1/n)n −(1−1/n)n−1 > 1/4. We now estimate F (u + δ). If F (u + δ) < F (u)/2 then F (u) − F (u + δ) ≥ F (u)/2 = 1/8. When comparing p F (u + δ) − F (u + 2δ) to F (u) − F (u + δ) we first notice that B(x + 1)/B(x) = k−x x+1 · 1−p which means B(0) < B(1) < · · · < B(u) > B(u + 1) > · · · > B(k). Comparing B(u) to B(u + 2δ) we see that B(u + 2δ) (k − u) · · · (k − u − 2δ + 1) p2δ = · B(u) (u + 1) · · · (u + 2δ) (1 − p)2δ  ≥ We take δ ≤ √ k − u − 2δ k(1 − p) 2δ u2δ (u + 1) · · · (u + 2δ) u/10 for u = Θ(k) and δ ≤ 1.4u otherwise for u = o(k) and then bound  k − u − 2δ k(1 − p) 2δ 2δ = 1− k−u  2δ ≥ 0.98. Using Stirling’s approximation for (u + 1) · · · (u + 2δ) we have (u + 2δ)! ≤ u + 2δ 2π(u + 2δ) e  q and u! ≥ √ u+2δ  u 2πu u e  exp 17 1 exp , 12(u + 2δ)  1 . 12u + 1   Then u! ≥ (1 − o(1)) (u + 2δ)! r u uu e2δ , u + 2δ (u + 2δ)u+2δ and therefore B(u + 2δ) ≥ 0.98 B(u) r uu+2δ e2δ u u + 2δ (u + 2δ)u+2δ u+2δ 2δ u 1− e2δ u + 2.8u u + 2δ     1 u ≥ exp ln (u + 2δ) + 2δ 2 u + 2δ  2 ! 1 2δ u . ≥ exp − 2 u r   ≥ 0.98 √ √ For u = Θ(k) we take δ = u/10, otherwise let δ = 0.49u/ c satisfying δ ≤ 1.4u for c > 0.5 which is required by assumption. Then (2δ/u)2 u ≤ 0.98 ln λ and B(u + 2δ)/B(u) ≥ 1/(2λ0.98 ). Then F (u + δ) > δB(u + 2δ) > δB(u)/(2λ0.98 ). Notice that δB(u) ≥ F (u) − F (u + δ) therefore F (u + δ) ≥ 1/(16λ0.98 ). With probability at least γ = 1 − (1 − 1/(16λ0.98 ))λ/2 > 1/32 > 0.03 we have that one offspring flips at least u + δ ones which shows that E(∆) ≥ γ(u + δ − (n − k)p) ≥ γ(δ − (n − 2k)p). We compare δ √ √ 2 2 to (n − 2k)p. If u = o(k) then p δ = 0.49kp/ c ≥ 0.19np/ c. If c ≤ n /(50(n − 2k) ) we have δ/((n−2k)p) ≥ 0.19/ 1/50 ≥ 1.34 and δ −(n−2k)p ≥ 0.25δ. Notice that γ ≥ 0.03 √ then E(∆) ≥ 0.03 · 0.25δ ≥ 0.03 · 0.25 · 0.19 c ln λ ≥ 10−3 ln λ. Otherwise, ifp u = Θ(k) 2 2 then r = Θ(n) will require n /(n − 2k) ≥ r/ln λ. This means n − 2k = O( n/log λ) p √ and (n − 2k)r/n = O( n/log λ) which is of lower order compared to δ = u/10. Hence, E(∆) ≥ ln λ. We now extend the lemma to the whole region of n/ln λ ≤ k < n/2. If k < 2n/5 the situation becomes easier because 4 ≤ c2 (k) < 100 and every r in the smaller range [c1 (k) ln λ, ln(λ)/2] provides at least an expected logarithmic fitness increase. Together with the previous lemma, we obtain the following statement for the drift in the whole region n/ln λ ≤ k < n/2. Lemma 5. Let n/ln λ ≤ k < n/2 and n be large enough. Assume λ ≥ 2. If r ∈ [c1 (k) ln λ, c2 (k) ln(λ)/200] for k ≥ 2n/5 and r ∈ [c1 (k) ln λ, ln(λ)/2] for k < 2n/5 with c1 (k), c2 (k) defined as in Lemma 3, then E(∆) ≥ 10−3 ln(λ)/ln(en/k). Proof. For r ≤ ln(λ)/2 we consider the probability Q(k, i, r) of creating from a parent with distance k an offspring with fitness distance at least k − i and i := c1 (k) ln λ = 0.5 ln(λ)/ln(en/k), via standard bit mutation with probability r/n. ! Q(k, i, r) ≥ k (p)i (1 − p)n ≥ i  k r · i n i e −r 18  ≥ k en i e−r ≥ e− ln(λ)/2 e−r ≥ e− ln λ = 1 . λ In the second greater or equal symbol we apply (1 − p)n ≥ exp(−pn − p2 n) ≥ (1 − o(1)) exp(−r) for p satisfying p2 n = o(1). The (1 − o(1)) factor will be compensated by  k i using (k/i) to estimate i . Hence, Pr ∆ ≥ c1 (k) ln λ ≥ 1 − (1 − 1/λ)λ/2 ≥ 1 − e−1/2 > 0.3 and consequently E(∆) > 0.15 ln(λ)/ln(en/k). For r > ln(λ)/2, note that this occurs only for k > 2n/5. In this case we apply Lemma 4 and obtain E(∆) > 10−3 ln λ ≥ 10−3 ln(λ)/ln(en/k). If we only consider generations that use a rate within the right region, we can bound the expected runtime to reach k ≤ n/ ln λ by O(n/log λ) since the drift on the fitness is of order log λ. The following theorem shows that the additional time spent with adjusting the rate towards the right region does not change this bound on the expected runtime. Theorem 6. The (1+λ) EA needs O(n/log λ) generations in expectation to reach a OneMax-value of k ≤ n/ln λ after initialization. √ Proof. We first argue quickly that it takes an expected number of at most O( n) iterations to reach a fitness distance of k < n/2. To this end, we note that if k ≥ n/2, then the probability for an offspring to have a strictly better fitness than the parent is at least Θ(1) for any 2 ≤ r ≤ n/4. Consequently, the expected fitness gain in one iteration is at √ least constant. The initial fitness distance k deviates from n/2 by Ω( n) in expectation. √ Hence, it takes O( n) generations to obtain k < n/2. Without loss of generality we assume k < n/2 for the initial state. Our intuition is that once we begin to use rate r bounded by c1 (k) ln λ and c2 (k) ln λ at some distance level k, we will have a considerable drift on the OneMax-value and the strong drift on the rate keeps r within or not far away from the bounds. After we make progress and k decreases to a new level, the corresponding c1 and c2 decrease, and the algorithm takes some time to readjust r into new bounds. We consider the stochastic process Xt = log2 (rt ) and the current OneMax-value Yt . According to Lemma 3 we have E(Xt − Xt+1 | Xt ; Xt > log2 (c2 (Yt ) ln λ)) ≥  = Ω(1) and E(Xt+1 − Xt | Xt ; Xt < log2 (c1 (Yt ) ln λ)) ≥  = Ω(1). We pessimistically assume that all the iterations adjusting rt make no progress. Let k0 > k1 > · · · > kN be the OneMax-values taken by Yt until kN hits n/ln λ. According to the additive drift analysis from Theorem 2 it takes at most O(log n) iterations to bound rt /ln λ by c1 (k0 ) and c2 (k0 ), no matter how we set the initial rate. Consider ti to be the last time that Yt = ki . This means rt makes a progress of ki − ki+1 > 0. Referring to Lemma 3 we know that rt ≤ 2(1 + γ)c2 (ki ) ln λ with probability at least 1 − λ−γ . For rt ≤ 2(1 + γ)c2 (ki ) ln λ, according to the additive drift theorem, it takes an expected number of at most O(log(2(1 + γ)c2 (ki )/c2 (ki+1 )) iterations to reach rt+1 ≤ c2 (Yt ) ln λ. When we sum up the different expectation on γ = 1, 2, . . . , the increase of log(1 + γ) can be neglect comparing to the probability decrease on (1 − λ−γ )0 . Thus we can bound this runtime by O(log(4c2 (ki )/c2 (ki+1 )). The total number of iterations of the readjustment process for rt to satisfy the upper bound is N −1 X i=0  O log  4c2 (ki ) c2 (ki+1 )    = O log 4N 19 c2 (k0 ) c2 (kN )  = O(N + log n). We then consider the iterations of the readjustment process for rt to satisfy the lower bound. Since c1 (ki ) decreases along with ki , once c1 (k0 ) is hit, the lower bound condition is obtained for all the following ki . Now we compute the expected number of generations for k0 to decrease to kN . We choose b large enough such that 2e−2b/3 ≤ 1/2 − δ/2 holds for some positive constant δ > 0 and note that b is constant. Applying Lemma 2 we obtain Pr(rt ≥ c2 (k) ln λ+2b ) ≤ 2e−2b/3 and Pr(rt ≤ c1 (k) ln λ − 2b ) ≤ 2e−2b/3 . Once rt is between c1 (k) ln λ and c2 (k) ln λ, before k decreases to another bound level, we have that c1 (k) ln λ − 2b ≤ rt ≤ c2 (k) ln λ + 2b happens with probability at least δ. We see that there are at most log200 steps between range c1 (k) ln λ ≤ r ≤ c2 (k) ln λ and an even smaller range 2 c1 (k) ln λ ≤ r ≤ c2 (k) ln(λ)/200 which is described in Lemma 5. If rt reaches the wider region, it takes at most a constant number of iterations α in expectation to reach the narrow region because our mutation scheme employs a 50% chance to perform a random step of the mutation rate. Based on Lemma 5 the narrow region for the rate ensures 0.05 ln(λ)/ln(en/k) drift on the fitness at distance k. This contributes to an average drift of at least 0.05 ln(λ)/ln(en/k) · δ/(1 + α) = Ω(log(λ)/log(en/k) for all random rates at distance k. Applying Theorem 2, we can estimate the runtime as O 1 + log(λ)/log(e log λ) Z n/2 n/log λ dk log(λ)/log(en/k) ! n . =O log λ   Details about how to compute the above integral can be found in the proof of Theorem 4 of [1]. We notice that N is the number of different k values and N must be bounded by the above runtime. Combining the expected number of O(N + log n) iterations to √ adjust rt and the expected number of O( n) iterations to hit k < n/2, the total runtime is O(n/log λ) in expectation. 5 Middle Region In this section we estimate the expected number of generations until the number of onebits has decreased from k ≤ n/ln λ to k ≤ n/λ. We first claim that the right region for r is 1 ≤ r ≤ ln(λ)/2. Hence, the (1+λ) EA is not very sensitive to the choice of r here. Intuitively, this is due to the fact that a total fitness improvement of only O(n/log λ) suffices to cross the middle region, whereas an improvement of Ω(n) is needed for the far region. We estimate the drift of the fitness in Lemma 6 and apply that result afterwards to estimate the number of generations to cross the region. Lemma 6. Let n/λ ≤ k ≤ n/ln λ, λ ≥ 26 and 1 ≤ r ≤ ln(λ)/2. Then ( √ ) 1 λk E(∆) ≥ min , . 8 32n n−k ≥ Proof. The √ probability that no zero-bit flipped in a single mutation is (1 − r/n) −r e ≥ 1/ λ. We regard the number Z of offspring that have no flipped zeros. The 20 √ √ expectation E(Z) is at least 1/ λ·λ/2 = λ/2. Applying Chernoff bounds√(Theorem 4), √ we observe that Z exceeds λ0 := λ/4 with probability at least 1 − exp(− λ/16) > 1/4 since λ ≥ 26. Assuming this to happen, we look at the first λ0 offspring without flipped zeros. For i ∈ {1, . . . , λ0 } let Xi be the number of flipped ones in the i-th offspring. Then Xi are i.i.d. with Xi ∼ Bin(k, r/n). Let X ∗ = max{Xi }. By applying a result on order statistics for binomially distributed random variables by Gießen and Witt [22, Lemma 4] we obtain the following: If λ0 kr/n ≥ α then E(X ∗ ) ≥ α/(1 + α). Therefore, λ0 kr/n ≥ 1 implies E(X ∗ ) ≥ 1/2, otherwise 1 + α < 2 implies E(X ∗ ) ≥ λ0 kr/(2n). Thus, √ E(X ∗ ) ≥ min{1/2, λk/(8n)}. Hence, using the law of total probability, we obtain the lower bound on the drift for the middle region. We now use our result on the drift to estimate the time spent in this region. We notice that c2 (k) = 4 + o(1) when k = o(n). This means we will have frequently often rt ∈ [1, ln(λ)/2] which provides the drift we need. Theorem 7. Let λ ≥ 26. Assume k ≤ n/ln λ for the current OneMax-value of the self-adjusting (1+λ) EA. Then the expected number of generations until k ≤ n/λ is O(n/log λ). Proof. For k ≤ n/ ln λ the upper bound from Lemma 3 is c2 (k) = 4/(1 − 2/ ln λ) < 11. According to the lemma we have for Xt := dlog2 rt e that E(Xt − Xt+1 | Xt ; Xt > log2 (c2 (k) ln λ)) ≥  = Ω(1). The additive drift theorem yields that in O(log n) time we have rt ≤ c2 (k) ln λ. We choose b large enough such that 2e−2b/3 ≤ 1 − δ holds for some positive constant δ > 0 and note that b is constant. Applying Lemma 2 we obtain Pr(rt ≥ c2 (k) ln λ + 2b ) ≤ 2e−2b/3 and rt ≤ c2 (k) ln λ + 2b happens with probability at least δ. Once rt < c2 (k) ln λ + 2b < 11 ln λ + 2b it takes at most a constant number of iterations α in expectation to draw √ rt to ln(λ)/2 or less. According to Lemma 6 this ensures a√drift of (1/4) min{1/2, λk/(8n)}, which implies an average drift of at least c min{1, λk/n} over all random rates at distance √ k, where c > 0 is a constant.√The minimum is taken on the first argument if k > n/ λ, and on the second if k < n/ λ. We are interested in the expected time to reduce the OneMax-value to a most n/λ. To ease the application of drift analysis, we artificially modify the process and make it create the optimum when the state (OneMax-value) is strictly less than n/λ. Clearly, the first hitting time of state at most n/λ does not change by this modification. Applying the variable √ drift theorem (Theorem 2) with xmin = n/λ, X0 = k ≤ n/ln λ and h(x) = c min{1, λk/n}, the expected number of generations to reach state at most n/λ is bounded from above by n/λ √ + c λ(n/λ)/n Z n/√λ n/λ n √ dx + c λx Z n/ln λ 1 √ n/ λ n dx = O √ c λ 21   n log λ √ +O λ   n +O , log λ   which is O(n/log λ). The overall expected number of generations spent is O(log n + n/log λ) = O(n/log λ) since λ = nO(1) by assumption. 6 Near region In the near region, we have k ≤ n/λ. Hence, the fitness is so low that we can expect only a constant number of offspring to flip at least one of the remaining one-bits. This assumes constant rate. However, higher rates are detrimental since they are more likely to destroy the zero-bits of the few individuals flipping one-bits. Hence, we expect the rate to drift towards constant values, as shown in the following lemma. Lemma 7. Let k ≤ n/λ, λ ≥ 45 and 4 ≤ rt ≤ ln(λ)/4. Then the probability that rt+1 = rt /2 is at least 0.5099. Proof. To prove the claim we exploit the fact that only few one-bits are flipped in both subpopulations. Using r := rt , we shall argue as follows. With sufficiently high (constant) probability, (i) the 2r-subpopulation contains no individual strictly better than the parent, that is, with fitness less than k, and (ii) all 2r-offspring with fitness r are identical to the parent. Conditional on this, either the r/2-population contains individuals with fitness less than k and the winning individual surely stems from this subpopulation, or the r/2-population contains no better offspring. In the latter case, we argue that there are many more individuals with fitness exactly k in the r/2-population than in the 2r-population, which gives a sufficiently high probability for taking the winning individual from this side (as it is chose uniformly at random from all offspring with fitness k). Let Nr/2 and N2r be the number of offspring that did not flip any zero-bits using rate r/2 and 2r, respectively. Then E(Nr/2 ) = (λ/2)(1 − r/(2n))n−k ≥ (1 − o(1))λe−r/2 /2, since k ≥ 1 and  r 1− 2n n−1 ≥e − r2  r 1− 2n  r −1 2 − r2  ≥e c ln n 1− 8n  c ln n −1 4 r = (1 − o(1))e− 2 , where we used that r ≤ ln λ/4 and λ = nO(1) , i. e. ln λ ≤ c ln n for some constant c. Using k ≤ n/λ we get E(N2r ) = (λ/2)(1 − 2r/n)n−k ≤ (λ/2)e−2r(1−1/λ) . In fact, we can discriminate N1 and N2 by using Theorem 4 in the following way: we have  Pr Nr/2 λ r ≤ e− 2 4  λ −r e 2 ≤ exp −(1 − o(1)) 16   1 7/8 ≤ exp −(1 − o(1)) λ 16 < 0.175,   3 for sufficiently large n, since r ≤ (ln λ)/4 and λ ≥ 45. Similarly, we obtain   1 1 1 1 Pr N2r ≥ λe−2r(1− λ ) ≤ exp − λ1− 2 (1− λ ) < 0.312. 6  22  Note that e−2r(1−1/λ) < e−r/2 /4 holds for all r ≥ 4 and λ ≥ 45. Since the offspring 1 are generated independently, the events Nr/2 > λe−r/2 /4 and N2r < λe−2r(1− λ ) happen together with probability at least (1−0.175)·(1−0.312) ≥ 0.567 =: 1−perr1 . Conditioning on this and by using a union bound the probability perr2 that at least one of the N2r offspring that do not flip any zero-bits flips at least one one-bit can be upper bounded by 1 2kr perr2 := N2r · ≤ 2re−2r(1− λ ) ≤ 0.004 n using k/n ≤ 1/λ in the first and r ≥ 4 and λ ≥ 45 in the last inequality. By using a union bound, we find the probability perr3 that at least one 2r-offspring flips exactly one one-bit and exactly one zero-bit to be at most λ 2rk 2r k−1 2r(n − k) 2r n−k−1 := 1− 1− 2 n n n n  n−2 6 2r ≤ 2r2 1 − ≤ (1 + o(1))2e2(ln(r)−r) < (2 + o(1))e− 5 r < 0.017, n  perr3    for sufficiently large n, using k/n ≤ 1/λ for the first inequality. The third inequality is due to ln x − x ≤ −(1 − e−1 )x < −(3/5)x for all x > 0 and the last inequality stems from r ≥ 4. The second inequality follows from  1− 2r n n−2 2 2r ≤ e− n (n−2) = e−2r(1− n ) = (1 + o(1))e−2r , using again r ≤ ln λ ≤ c ln n for some constant c. Let Mr be the number of such offspring. Any other fitness-decreasing flip-combinations of zeroes and ones in the 2rsubpopulation require an offspring to flip at least two one-bits. The probability that such an offspring is created is at most perr4 λ k := 2 2 ! 2r n 2 ≤ ln2 λ < 0.021, 16λ using k ≤ n/λ and r ≤ ln λ/4 and the fact that (ln2 x)/x is decreasing for x ≥ e2 and λ ≥ 45 > e2 . 1 The events Nr/2 > λe−r/2 /4, N2r < λe−2r(1− λ ) , Mr = 0, and the event that no fitness-decreasing offspring is created in the 2r-subpopulation are sufficient to ensure that the best individual is either surely from the r/2-population or chosen uniformly at random from the Nr/2 + N2r offspring. Conditioning on these events, we have that the probability that the best offspring is chosen from the r/2-population is at least Nr/2 1 ≥ > 0.988. 1 −r(2(1− λ )− 12 ) Nr/2 + N2r 1 + 4e Hence, using a union bound for the error probabilities, the unconditional probability is at least (1 − perr1 − perr2 − perr3 − perr4 ) · 0.988 + 12 > 0.5099. 2 23 We note that the restriction rt ≥ 4 in the lemma above is not strictly necessary. Also for smaller rt , the probability that the winning individual is chosen from the rt /2population is by an additive constant larger than 1/2. Showing this, however, would need additional proof arguments as for smaller rt , the event that both subpopulations contain individuals with fitness k − 1 becomes more likely. We avoid this additional technicality by only arguing for rt ≥ 4, which is enough since any constant rt is sufficient for the fitness drift we need (since we do not aim at making the leading constant precise). In the following proof of the analysis of the near region, we use the above lemma (with quite some additional arguments) to argue that the r-value quickly reaches 4 or less and from then on regularly returns to this region. This allows to argue that in the near region we have a speed-up of a factor of Θ(λ) compared to the (1+1) EA, since every offspring only has a probability of O(1/λ) of making progress (see also [11, 22]). Theorem 8. Assume k ≤ n/λ for the current OneMax-value of the self-adjusting (1+λ) EA. Then the expected number of generations until the optimum is reached is O(n log(n)/λ + log n). Proof. The aim is to estimate the OneMax-drift at the points in time (generations) t where rt = O(1). To bound the expected number of generations until the mutation rate has entered this region, we basically consider the stochastic process Zt := max{0, dlog2 (rt /c)e}, where c := 4, which is the lower bound on rt from Lemma 7. However, as we do not have proved a drift of Zt towards smaller values in the region L := (ln λ)/4 ≤ rt ≤ 16 ln λ =: U (where 16 is an upper bound on c2 (k) from Lemma 5), we use the potential function    Z t if c ≤ rt ≤ L P 2 (rt /L)e −i Xt (Zt ) := log2 (L/c) + dlog 4 i=1   Plog2 (U/L) −i  log2 (L/c) + i=1 4 + if L < rt < U 4− log2 (U/L) dlog 2 (rt /U )e otherwise. assuming that L and U have been rounded down and up to the closest power of 2, respectively. The potential function has a slope of 1 for c ≤ rt ≤ L. Lemma 7 gives us the drift E(Xt − Xt+1 | Xt ; c ≤ rt ≤ L) ≥ 0.5099 − 0.4901 = 0.0198. The function satisfies Xt (Zt ) − Xt (Zt − 1) ≥ 4(Xt (Zt ) − Xt (Zt + 1)) if L < rt < U , which corresponds to the region where the probability of decreasing Zt by 1 has only be bounded from below by 1/4 due to the random steps. Still, E(Xt − Xt+1 | Xt ; L < rt < U ) ≥ (1/4)4log2 (U/L)+1 − (3/4)4log2 (U/L) = Ω(1) in this region due to the concavity of the potential function. Finally, E(Xt − Xt+1 | Xt ; rt ≥ U ) = 4− log2 (U/L) Ω(1) = Ω(1) by Lemma 5. Hence, altogether E(Xt − Xt+1 | Xt ; rt ≥ c) ≥ κ for some constant κ > 0. As X0 = O(log n), additive drift analysis yields an expected number of O(log n) generations until for the first time Xt = 0 holds, corresponding to rt ≤ c. We denote this hitting time by T . We now consider an arbitrary point of time t ≥ T . The aim is to show a drift on the OneMax-value, depending on the current OneMax-value Yt , which satisfies Yt ≤ n/λ 24 with probability 1. To this end, we will use Lemma 2. We choose b large enough such that 2e−2b·κ/4 ≤ 1 − δ holds for some positive constant δ > 0 and note that b is constant. We consider two cases for rt . If rt ≤ c + 2b , which happens with probability at least δ, we have rt = O(1) and obtain a probability of at least Yt 1− 1− 1 ! rt n rt 1− n  n−1 !λ   ≥1− 1−Θ Yt n λ = Ω(λYt /n) to improve the OneMax-value by 1, using that Yt = O(n/λ). If rt > c + 2b , we bound the improvement from below by 0. Using the law of total probability, we obtain E(Yt − Yt+1 | Yt ; Yt ≤ n/λ) = δΩ(λYt /n) = Ω(λYt /n). Now a straightforward multiplicative drift analysis (Theorem 3 using δ = Θ(λ/n)) gives an expected number of O((n/λ) log Y0 ) = O(n log(n)/λ) generations until the optimum is found. Together with the expected number O(log n) until the r-value becomes at most c, this proves the theorem. 7 Putting Everything Together In this section, we put together the analyses of the different regimes to prove our main result. Proof of Theorem 1. The lower bound actually holds for all unbiased parallel black-box algorithms, as shown in [1]. We add up the bounds on the expected number of generations spent in the three regimes, more precisely we add up the bounds from Theorem 6, Theorem 7 and Theorem 8, which gives us O(n/log λ+n log(n)/λ+log n) generations. Due to our assumption λ = nO(1) the bound is dominated by O(n/log λ + n log(n)/λ) as suggested. Proof of Lemma 1. We basically revisit the regions of different OneMax-values analyzed in this paper and bound the time spent in these regions under the assumption r = ln(λ)/2. In the far region, Lemmas 4 and 5, applied with this value of r, imply a fitness drift of Ω(log(λ)/log(en/k)) per generation, so the expected number of generations spent in the far region is O(n/log λ) as computed by variable drift analysis in the proof of Theorem 6. √ The middle region is shortened at the lower end. For k ≥ n/ λ, Lemma 6 gives a fitness drift of Ω(1), implying √ by additive drift analysis O(n/log λ) generations to reduce the fitness to at most n/ λ. √ In the near region, which now starts at n/ λ, we have to argue slightly differently. n − ln(λ)/2+O(1) = Ω(λ−1/2 ) Note that every offspring has a probability of at least √ (1−r) ≥ e of not flipping a zero-bit. Hence, we expect Ω( λ) such offspring. We pessimistically assume that the other individuals√do not yield a fitness improvement; conceptually, this reduces the population size to Ω( λ) offspring, all of which are guaranteed not to flip a 25 3000 2500 2000 1500 1000 Average runtime over 10000 runs Self-adj. (1+λ) EA Self-adj. (1+λ) EA (no random steps, F = 1.2) Static (1+λ) EA (p = ln(λ)/(2n)) Static (1+λ) EA (p = 1/n) (1+λ) EA using p = max(1/n, ln(λ)/(ln(en/d(x)))) 200 400 600 800 1000 λ Figure 1: Static and Self-adjusting (1+λ) EA average runtime comparison (n = 5000) on OneMax zero-bit. Adapting the arguments from the proof of Theorem 8, the probability that at least of one of these individuals flips at least a one-bit is at least Yt 1− 1− 1 ! rt n √ !Ω( λ) Yt ≥1− 1−Θ n   Ω(√λ) √ = Ω( λYt /n), which is a lower bound on the fitness drift. Using the multiplicative drift analysis, the √ expected number of generations in the near region is O(n log(n)/ λ). Putting the times for the regions together, we obtain the lemma. 8 Experiments Since our analysis is asymptotic in nature we performed some elementary experiments in order to see whether besides the asymptotic runtime improvement (showing an improvement for an unspecified large problem size n) we also see an improvement for realistic problem sizes. For this purpose we implemented the (1+λ) EA in C using the GNU Scientific Library (GSL) for the generation of pseudo-random numbers. The plot in Figure 1 displays the average runtime over 10000 runs of the self-adjusting (1+λ) EA on OneMax for n = 5000 as given in Algorithm 1 over λ = 100, 200, . . . , 1000. We set the initial mutation rate to 2, i. e., the minimum mutation rate the algorithm can 26 attain. Moreover, the plot displays the average runtime of the classic (1+λ) EA using a static mutation probability of 1/n. The average runtimes of both algorithms profit from higher offspring population sizes λ leading to lower average runtimes as λ increases. Interestingly, the classic (1+λ) EA outperforms the self-adjusting (1+λ) EA for small values of λ up to λ = 400. For higher offspring population sizes the self-adjusting (1+λ) EA outperforms the classic one, indicating that the theoretical performance gain of ln ln λ can in fact be relevant in practice. Furthermore, we implemented the self-adjusting (1+λ) EA without the random steps, that is, when the rate is always adjusted according to how the best offspring are distributed over the two subpopulations. The experiments show that this variant of the self-adjusting (1+λ) EA performs generally slightly better on OneMax. Since the OneMax fitness landscape is structurally very simple, this result is not totally surprising. It seems very natural that the fitness of the best of λ/2 individuals, viewed as a function in the rate, is a unimodal function. In this case, the advantage of random steps to be able to leave local optima of this function is not needed. On the other hand, of course, this observation suggests to try to prove our performance bound rigorously also for the case without random rate adjustments. We currently do not see how to do this. Lastly, we implemented the (1+λ) EA using the fitness-depending mutation rate ln λ p = max{ n ln(en/d) , n1 } as presented in [1]. The experiments suggest that this scheme outperforms all other variants considered. Additionally we implemented another variant of the self-adjusting (1+λ) EA using three equally-sized subpopulations i. e. the additional one is using (that is, exploiting) the current mutation rate. We compared this variant with the self-adjusting (1+λ) EA, both with and without using random steps. The results are shown in Figure 2. The experiments suggest that the variant using three subpopulations outperforms the selfadjusting (1+λ) EA slightly for small population sizes. For very high population sizes, using just two subpopulations seems to be a better choice. To gain some understanding on how the parameters influence the runtime, we implemented the self-adjusting (1+λ) EA using different mutation rate update factors, that is, we consider the self-adjusting (1+λ) EA as given in Algorithm 1 where the mutation rate rt is increased or decreased by some factor F (instead of the choice F = 2 made in Algorithm 1). Note that we do not change the rule that we use the rates r/2 and 2r to create the subpopulations. Furthermore, after initialization, the algorithm starts with rate F and the rate is capped below by F and above by 1/(2F ) during the run, accordingly. The results are shown in Figure 3. The plot displays the average runtime over 10000 runs of the self-adjusting (1+λ) EA on OneMax for n = 5000 over λ = 100, 200, . . . , 1000 using the update factors F = 2.0, 1.5, 1.01. The plot suggests that lower values of F yield a better performance. This result is not immediately obvious. Clearly, a large factor F implies that the rate changes a lot from generation to generation (namely by a factor of F ). These changes prevent the algorithm from using a very good rate for several iterations in a row. On the other hand, a small value for F implies that it takes longer to adjust the rate to value that is far from the current one. 27 3000 EA EA, 3 subpop. EA (no random steps) EA, 3 subpop. (no random steps)) 2000 (1+λ) (1+λ) (1+λ) (1+λ) 1000 Average runtime over 10000 runs Self-adj. Self-adj. Self-adj. Self-adj. 200 400 600 800 1000 1200 1400 λ 3000 2500 F = 2.0 F = 1.5 F = 1.2 1000 1500 2000 Average runtime over 10000 runs Figure 2: Average runtime of the self-adjusting (1+λ) EA with two and three subpopulations each with and without random steps on OneMax (n = 5000) 200 400 600 800 1000 λ Figure 3: Average runtime of the self-adjusting (1+λ) EA with different mutation rate update factors F on OneMax (n = 5000) 28 600 300 0 100 200 rate 400 500 F = 1.1 F = 1.05 F = 1.01 0 10000 20000 30000 40000 50000 fitness Figure 4: Development of the rate over the fitness of three example runs of the selfadjusting (1+λ) EA on OneMax (n = 100000, λ = (TODO, I forgot and have to check at home)) using different factors F 29 Finally, to illustrate the nontrivial development of the rate during a run of the algorithm we plotted the rate of three single runs of the self-adjusting (1+λ) EA using different factors F over the fitness in Figure 4. Since the algorithm initialized with the rate F , the rate increases after initialization decreases again with decreasing fitnessdistance to the optimum. The plot suggests that for higher values of F the rate is more unsteady due to the greater impact of the rate adjustments while smaller rate updates yield a more stable development of the rate. Interestingly, for all three values of F , the rates seem to correspond to the same rate after the initial increasing phase from F . Note that this illustration does not indicate the actual runtime. In fact, the specific runtimes are 19766 for F = 1.01, 19085 for F = 1.05 and 19857 for F = 1.1. A similar, more pronounced behaviour can be seen for F = 2.0; we chose these particular values of F for illustrative purposes since for F = 2.0 the variance in the rate can be visually confusing for the reasons given above. While we would draw from this experiment the conclusion that a smaller choice of F is preferable in a practical application of our algorithm, the influence of the parameter on the runtime is not very large. So it might not be worth optimizing it and rather view Algorithm 1 as a parameter-less algorithm. 9 Conclusions We proposed and analyzed a new simple self-adjusting mutation scheme for the (1+λ) EA. It consists of creating half the offspring with a slightly larger and the rest with a slightly smaller mutation rate. Based on the success of the subpopulations, the mutation rate is adjusted. This simple scheme overcomes difficulties of previous self-adjusting choices, e.g., the careful choice of the exploration-exploitation balance and the forgetting rate in the learning scheme of [18]. We proved rigorously that this self-adjusting (1+λ) EA optimizes the OneMax test function in an expected number of O(nλ/ log λ + n log n) fitness evaluations. This matches the runtime shown in [1] for a careful fitness-dependent choice of the mutation rate, which was also shown to be asymptotically optimal among all λ-parallel blackbox optimization algorithms. Hence our runtime result indicates that the self-adjusting mechanism developed in this work is able to find very good mutation rates. To the best of our knowledge, this is the first time that a self-adjusting choice of the mutation rate speeds up a mutation-based algorithm on the OneMax test function by more than a constant factor. The main technical challenge in this work is to analyze the quality of the best offspring. In contrast to most previous runtime analyses, where only the asymptotic order of the fitness gain was relevant, we needed a much higher degree of precision as we needed to make statements about in which sub-population the best offspring is, or, in case of multiple best offspring, how they are distributed over the two subpopulations. Note that the quality of the best offspring is not as strongly concentrated around its expectation as, e.g., the average quality. 30 As a side-result of our analyses, we have observed that using a fixed rate of r = ln(λ)/2 gives the bound O(n/log λ+n log(n)/λ1/2 ), which is also asymptotically optimal unless λ is small. However, this setting is far off the usual constant choice of r. It is the first time that a significantly larger mutation rate was shown to be useful in a simple mutation-based algorithm for a simple fitness landscape. Previously, it was only observed that larger mutation rates can be helpful to leave local optima [20]. From this work, a number of open problems arise. A technical challenge is to prove that our algorithm also without the random rate adjustments performs well. This requires an even more precise analysis of the qualities of the offspring in the two subpopulations, for which we currently do not have the methods. From the view-point of understanding the mutation rate for population-based algorithms, two interesting question are (i) to what extent our observation that larger mutation rates are beneficial for the (1+λ) EA on OneMax generalizes to other algorithms and problems, and (ii) for which other problems our self-adjusting choice of the mutation rate gives an improvement over the classic choice of 1/n or other static choices. Acknowledgments This work was supported by a public grant as part of the Investissement d’avenir project, reference ANR-11-LABX-0056-LMH, LabEx LMH, and by a grant by the Danish Council for Independent Research (DFF-FNU 4002–00542). References [1] Golnaz Badkobeh, Per Kristian Lehre, and Dirk Sudholt. Unbiased black-box complexity of parallel search. In Proc. of PPSN ’14, pages 892–901. Springer, 2014. [2] Süntje Böttcher, Benjamin Doerr, and Frank Neumann. Optimal fixed and adaptive mutation rates for the LeadingOnes problem. In Proc. of PPSN ’10, pages 1–10. Springer, 2010. [3] Maxim Buzdalov and Benjamin Doerr. Runtime analysis of the (1 + (λ, λ)) genetic algorithm on random satisfiable 3-CNF formulas. In Proc. of GECCO ’17. ACM, 2017. To appear. Full version available at http://arxiv.org/abs/1704.04366. [4] Stephan Cathabard, Per Kristian Lehre, and Xin Yao. Non-uniform mutation rates for problems with unknown solution lengths. In Proc. of FOGA ’11, pages 173–180. ACM, 2011. [5] Jorge Cervantes and Christopher R. Stephens. Rank based variation operators for genetic algorithms. In Proc. of GECCO ’08, pages 905–912. ACM, 2008. [6] Duc-Cuong Dang and Per Kristian Lehre. Self-adaptation of mutation rates in non-elitist populations. In Proc. of PPSN ’16, pages 803–813. Springer, 2016. [7] Martin Dietzfelbinger, Jonathan E. Rowe, Ingo Wegener, and Philipp Woelfel. Tight bounds for blind search on the integers and the reals. Combinatorics, Probability & Computing, 19:711–728, 2010. 31 [8] Benjamin Doerr. Analyzing randomized search heuristics: tools from probability theory. In Anne Auger and Benjamin Doerr, editors, Theory of Randomized Search Heuristics, pages 1–20. World Scientific Publishing, 2011. [9] Benjamin Doerr. Optimal parameter settings for the (1 + (λ, λ)) genetic algorithm. In Proc. of GECCO ’16, pages 1107–1114. ACM, 2016. [10] Benjamin Doerr and Carola Doerr. Optimal parameter choices through selfadjustment: applying the 1/5-th rule in discrete settings. In Proc. of GECCO ’15, pages 1335–1342. ACM, 2015. [11] Benjamin Doerr and Marvin Künnemann. Optimizing linear functions with the (1+λ) evolutionary algorithm – different asymptotic runtimes for different instances. Theoretical Computer Science, 561:3–23, 2015. [12] Benjamin Doerr, Daniel Johannsen, and Carola Winzen. Multiplicative drift analysis. Algorithmica, 64:673–697, 2012. [13] Benjamin Doerr, Carola Doerr, and Franziska Ebel. From black-box complexity to designing new genetic algorithms. Theoretical Computer Science, 567:87–104, 2015. [14] Benjamin Doerr, Carola Doerr, and Timo Kötzing. Solving problems with unknown solution length at (almost) no extra cost. In Proc. of GECCO ’15, pages 831–838. ACM, 2015. [15] Benjamin Doerr, Carola Doerr, and Timo Kötzing. The right mutation strength for multi-valued decision variables. In Proc. of GECCO ’16, pages 1115–1122. ACM, 2016. [16] Benjamin Doerr, Carola Doerr, and Timo Kötzing. Provably optimal self-adjusting step sizes for multi-valued decision variables. In Proc. of PPSN ’16, pages 782–791. Springer, 2016. [17] Benjamin Doerr, Carola Doerr, and Jing Yang. Optimal parameter choices via precise black-box analysis. In Proc. of GECCO ’16, pages 1123–1130. ACM, 2016. [18] Benjamin Doerr, Carola Doerr, and Jing Yang. k-bit mutation with self-adjusting k outperforms standard bit mutation. In Proc. of PPSN ’16, pages 824–834. Springer, 2016. [19] Benjamin Doerr, Carola Doerr, and Timo Kötzing. Unknown solution length problems with no asymptotically optimal run time. In Proc. of GECCO ’17. ACM, 2017. To appear. [20] Benjamin Doerr, Huu Phuoc Le, Régis Makhmara, and Ta Duy Nguyen. Fast genetic algorithms. In Proc. of GECCO ’17. ACM, 2017. To appear. Full version available at http://arxiv.org/abs/1703.03334. 32 [21] Agoston Endre Eiben, Robert Hinterding, and Zbigniew Michalewicz. Parameter control in evolutionary algorithms. IEEE Transactions on Evolutionary Computation, 3:124–141, 1999. [22] Christian Gießen and Carsten Witt. The interplay of population size and mutation probability in the (1+λ) EA on OneMax. Algorithmica, 2017. In press, available online at http://dx.doi.org/10.1007/s00453-016-0214-z. [23] Thomas Jansen and Ingo Wegener. On the analysis of a dynamic evolutionary algorithm. Journal of Discrete Algorithms, 4:181–199, 2006. [24] Thomas Jansen, Kenneth A. De Jong, and Ingo Wegener. On the choice of the offspring population size in evolutionary algorithms. Evolutionary Computation, 13:413–440, 2005. [25] Daniel Johannsen. Random combinatorial structures and randomized search heuristics. PhD thesis, Saarland University, 2010. [26] Rob Kaas and Jan M. Buhrman. Mean, median and mode in binomial distributions. Statistica Neerlandica, 34:13–18, 1980. [27] Timo Kötzing, Andrei Lissovoi, and Carsten Witt. (1+1) EA on generalized dynamic OneMax. In Proc. of FOGA ’15, pages 40–51. ACM, 2015. [28] Jörg Lässig and Dirk Sudholt. Adaptive population models for offspring populations and parallel evolutionary algorithms. In Proc. of FOGA ’11, pages 181–192. ACM, 2011. [29] Per Kristian Lehre and Carsten Witt. Concentrated hitting times of randomized search heuristics with variable drift. In Proc. of ISAAC ’14, pages 686–697. Springer, 2014. [30] Boris Mitavskiy, Jonathan E. Rowe, and Chris Cannings. Theoretical analysis of local search strategies to optimize network communication subject to preserving the total number of links. International Journal of Intelligent Computing and Cybernetics, 2:243–284, 2009. [31] Frank Neumann and Ingo Wegener. Randomized local search, evolutionary algorithms, and the minimum spanning tree problem. Theoretical Computer Science, 378:32–40, 2007. [32] Pietro Simone Oliveto, Per Kristian Lehre, and Frank Neumann. Theoretical analysis of rank-based mutation - combining exploration and exploitation. In Proc. of CEC ’09, pages 1455–1462. IEEE, 2009. [33] Ingo Wegener. Simulated annealing beats Metropolis in combinatorial optimization. In Proc. of ICALP ’05, pages 589–601. Springer, 2005. 33 [34] Christine Zarges. Rigorous runtime analysis of inversely fitness proportional mutation rates. In Proc. of PPSN ’08, pages 112–122. Springer, 2008. [35] Christine Zarges. On the utility of the population size for inversely fitness proportional mutation rates. In Proc. of FOGA ’09, pages 39–46. ACM, 2009. 34
9cs.NE
arXiv:1705.08413v3 [math.ST] 17 Jul 2017 S TABLE L IMIT T HEOREMS FOR E MPIRICAL P ROCESSES C ONDITIONAL N EIGHBORHOOD D EPENDENCE UNDER Ji Hyung Lee and Kyungchul Song University of Illinois and University of British Columbia A BSTRACT. This paper introduces a new concept of stochastic dependence among many random variables which we call conditional neighborhood dependence (CND). Suppose that there are a set of random variables and a set of sigma algebras where both sets are indexed by the same set endowed with a neighborhood system. When the set of random variables satisfies CND, any two non-adjacent sets of random variables are conditionally independent given sigma algebras having indices in one of the two sets’ neighborhood. Random variables with CND include those with conditional dependency graphs and a class of Markov random fields with a global Markov property. The CND property is useful for modeling cross-sectional dependence governed by a complex, large network. This paper provides two main results. The first result is a stable central limit theorem for a sum of random variables with CND. The second result is a Donsker-type result of stable convergence of empirical processes indexed by a class of functions satisfying a certain bracketing entropy condition when the random variables satisfy CND. K EY WORDS . Conditional Neighborhood Dependence; Dependency Graphs; Markov Random Fields; Empirical Processes; Maximal Inequalities; Stable Central Limit Theorem AMS MSC 2010: 60B10; 60F05; 60G57 JEL C LASSIFICATION: C12, C21, C31 Date: July 19, 2017. We thank Denis Kojevnikov for his valuable comments. All errors are ours. Corresponding address: Kyungchul Song, Vancouver School of Economics, University of British Columbia, 6000 Iona Drive, Vancouver, BC, Canada, V6T 1L4. Email address: [email protected]. Co-author address: Ji Hyung Lee, Department of Economics, University of Illinois, 1407 W. Gregory Dr., 214 David Kinley Hall, Urbana, IL 61801. Email address: [email protected]. 1 2 1. Introduction Empirical processes indexed by a class of functions arise in many applications, in particular in developing asymptotic inference for nonparametric or semiparametric models and for goodness-of-fit specification tests. (See, e.g., Andrews (1994) and Chapter 3 of van der Vaart and Wellner (1996) for a review of applications of empirical process theory in statistics and econometrics.) While a predominant body of the literature on empirical process theory focuses on independent observations or time series observations, there is relatively little research on empirical processes with spatial or cross-sectional dependence. This paper aims to contribute to the literature by providing limit theorems for empirical processes which consist of random variables with a flexible, complex (crosssectional) dependence structure. In this paper, we introduce a new notion of stochastic dependence among a set of random variables. Suppose that we are given a set of random variables {Yi }i∈Nn indexed by a set Nn , where the set Nn is endowed with a neighborhood system so that each i ∈ Nn is associated with a subset νn (i) ⊂ Nn \{i} called the neighborhood of i. In this paper, we call the map νn : Nn → 2Nn a neighborhood system. Given a neighborhood system νn and a set of σ-fields M ≡ (Mi )i∈Nn , we say that {Yi }i∈Nn is conditionally neighborhood dependent(CND) with respect to (νn , M) if for any two non-adjacent subsets A and B of Nn , ((Yi )i∈A , (Mi )i∈A ) and ((Yi )i∈B , (Mi )i∈B ) are conditionally independent given (Mi )i∈νn (A) , where νn (A) is the union of the neighborhoods of i ∈ A with the set A itself removed. Our CND property is a generalization of both dependency graphs and Markov random fields with a global Markov property (Lauritzen, Dawid, Larsen, and Leimer (1990).) Dependency graphs were introduced by Stein (1972) in his study of normal approximation. (See Chen and Shao (2004) and Rinott and Rotar (1996) for a general local dependence notion that is different from ours.) A set of random variables have a graph as a dependency graph, if two sets of random variables are allowed to be dependent only when the two sets are adjacent in the graph. This dependence can be viewed as restrictive in many applications, as it requires that any random variables be independent even if their indices are indirectly connected in the graph. In contrast, CND random variables are allowed to be dependent even if they are not adjacent in a graph. The CND property captures the notion that “any two random variables are independent once we condition on the source of their joint dependence”. In this sense, the CND property is closely related to a Markov property in the literature of random fields. However, in contrast to the Markov property, the CND property does not require that the σ-fields Mi be generated by Yi itself. 3 This paper provides two main results. The first main result is a Berry-Esseen bound for a sum of CND random variables. Our bound is comparable to Berry-Esseen bounds established for a sum of random variables with a dependency graph in some generic situations in the literature. (Baldi and Rinott (1989), Chen and Shao (2004), and Penrose (2003) to name but a few.) This latter literature typically uses Stein’s method to establish the bound, but to the best of our knowledge, the existing proofs using Stein’s method for dependency graphs do not seem immediately extendable to a sum of CND random variables, due to a more flexible form of conditioning σ-fields involved in the CND property. In this paper, we use a traditional characteristic function-based method to derive a Berry-Esseen bound. A typical form of a Berry-Esseen bound in these set-ups, including ours, involves the maximum degree of the neighborhood system, so that when the maximum degree is high, the bound is of little use. However, in many social networks observed, removing a small number of high-degree vertices tends to reduce the maximum degree of the neighborhood system substantially. Exploiting this insight, we provide a general version of a BerryEsseen bound which uses conditioning on random variables associated with high degrees. The second main result in this paper is a stable limit theorem for an empirical process indexed by a class of functions, where the empirical process is constituted by CND random variables. Stable convergence is a stronger notion of convergence than weak convergence, and is useful for asymptotic theory of statistics whose normalizing sequence has a random limit. To obtain a stable limit theorem, we first extend the exponential inequality of Janson (2004) for dependency graphs to our set-up of CND random variables, and using this, we obtain a maximal inequality for an empirical process with a bracketing-entropy type bound. This maximal inequality is useful for various purposes, especially when one needs to obtain limit theorems that are uniform over a given class of functions indexing the empirical process. Using this maximal inequality, we establish the asymptotic equicontinuity of the empirical process which, in combination with the central limit theorem that comes from our previously established Berry-Esseen bound, gives a stable limit theorem. This enables stable convergence of the empirical process to a mixture Gaussian process. As it turns out, our stable limit theorem for an empirical process requires that the maximum degree of the neighborhood system be bounded. However, in many real-life networks, the maximum degree can be substantial, especially when the networks behave like a preferential attachment network of Barabási-Albert.(Barabási and Albert (1999)) Thus, following the same spirit of extending the Berry-Esseen bound to the case conditional on high degree vertices, we extend the stable limit theory to a set-up where it relies only on those observations with relatively low degrees by conditioning on the random variables 4 associated with high degree vertices. This extension enables us to obtain a stable limit theorem for empirical processes when the maximum degree of the neighborhood system increases to infinity as the size of the system increases. Stable convergence has been extensively studied in the context of martingale central limit theorems. (See, e.g. Hall and Heyde (1980).) See Häusler and Luschgy (2010) for stable limit theorems for Markov kernels and related topics. Recent studies by Kuersteiner and Prucha (2013) and Hahn, Kuersteiner, and Mazzocco (2016) established a stable central limit theorem for a sum of random variables having both cross-sectional dependence and time series dependence by utilizing a martingale difference array formulation of the random variables. Markov-type cross-sectional dependence on a graph has received attention in the literature (Lauritzen (1996).) In particular, the pairwise Markov property of random variables says that two non-adjacent random variables are conditionally independent given all the other variables, and is captured by a precision matrix in a high dimensional Gaussian model. (See Meinshausen and Bühlmann (2008) and Cai, Liu, and Zhou (2016) for references.) This paper’s CND property is stronger than the pairwise Markov property when the conditioning σ-fields, Mi ’s, are those that are generated by the random variables. However, the CND property encompasses the case where the latter condition does not hold, and thus includes dependency graphs as a special case, unlike Markov-type dependence mentioned before. To the best of our knowledge, stable convergence of empirical processes indexed by a class of functions has not been studied under either dependency graphs or Markov random fields on a graph. The remainder of the paper proceeds as follows. In Section 2, we formally introduce the notion of conditional neighborhood dependence (CND) and study its basic properties. In Section 3, we provide stable central limit theorems for a sum of CND random variables. We also present the stable convergence of an empirical process to a mixture Gaussian process. The mathematical proofs of the results are found in the appendix. 2. Conditional Neighborhood Dependence 2.1. Definition Let N be an infinite countable set. For each n = 1, 2, ..., let Nn ⊂ N be a finite set such that |Nn | = n and let 2Nn be the collection of all the subsets of Nn . We assume that Nn is a proper subset of Nn+1 for each n ≥ 1. We will call each element of Nn a vertex, and 5 call any map νn : Nn → 2Nn a neighborhood system, if for each i ∈ Nn , i ∈ / νn (i).1 Let us define for each A ⊂ Nn , ! [ ν̄n (A) ≡ νn (i) ∪ A and νn (A) ≡ ν̄n (A) \ A. i∈A For {i1 , ..., im } ⊂ Nn , we simply write νn (i1 , ..., im ) = νn ({i1 , ..., im }) and ν̄n (i1 , ..., im ) = ν̄n ({i1 , ..., im }), suppressing the curly brackets. Let us call ν̄n (A) the νn -closure of A and νn (A) the νn -boundary of A. The νn -closure of A includes the vertices in A but the νn boundary around A excludes them. If for each i, j ∈ Nn , i ∈ νn (j) implies j ∈ νn (i), we say that neighborhood system νn is undirected. If there exists a pair i, j ∈ Nn such that i ∈ νn (j) but j ∈ / νn (i), we say that neighborhood system νn is directed. It is often useful to compare different dependence structures governed by different neighborhood systems. When we have two neighborhood systems νn and νn0 such that νn (i) ⊂ νn0 (i) for each i ∈ Nn and νn (j) 6= νn0 (j) for some j ∈ Nn , we say that νn is strictly finer than νn0 and νn0 is strictly coarser than νn . When νn (i) ⊂ νn0 (i) for each i ∈ Nn , we say that νn is weakly finer than νn0 and νn0 is weakly coarser than νn . Let us introduce the notion of dependence among a triangular array of σ-fields. Let (Ω, F, P ) be a given probability space, and let {Fi }i∈Nn be a given triangular array of subσ-fields of F, indexed by i ∈ Nn . (Proper notation for the sub-σ-field in the triangular array should be Fin , but we suppress the n subscript for simplicity.) For any A ⊂ Nn , we let FA be the smallest σ-field that contains Fi , i ∈ A, and F−A be the smallest σ-field that contains all the σ-fields Fi such that i ∈ Nn \A. When A = ∅, we simply take FA to be the trivial σ-field. We apply this notation to other triangular arrays of σ-fields, so that if {Mi }i∈Nn is a triangular array of sub-σ-fields of F, we similarly define MA and M−A for any A ⊂ Nn . For given two σ-fields, say, G1 and G2 , we write G1 ∨ G2 to represent the smallest σ-field that contains both G1 and G2 . Given a triangular array of σ-fields, {Mi }∞ i=1 , let us introduce a sub σ-field G defined by \ \ (2.1) G≡ Mi . n≥1 i∈Nn In many applications, G is used to accommodate random variables with a common shock. For example, suppose that each Mi is generated by a random vector (εi , U ) from a set of random variables {εi }i∈Nn that are conditionally independent given a common random 1 Equivalently, one might view the neighborhood system as a graph by identifying each neighborhood of i as the neighborhood of i in the graph. However, it seems more natural to think of a stochastic dependence structure among random variables in terms of neighborhoods rather than in terms of edges in a graph. 6 variable U . Then we can take G to be the σ-field generated by U . We will discuss examples of CND random vectors in a later section, after we study their properties. Let us introduce the notion of dependence of an array of σ-fields that is of central focus in this paper. Definition 2.1. (i) Given neighborhood system νn on Nn and an array of σ-fields, M ≡ {Mi }i∈Nn , we say that σ-fields {Fi }i∈Nn0 for a given subset Nn0 ⊂ Nn are conditionally neighborhood dependent (CND) with respect to (νn , M), if for any A, B ⊂ Nn0 such that A ⊂ Nn0 \ ν̄n (B) and B ⊂ Nn0 \ ν̄n (A), FA ∨MA and FB ∨MB are conditionally independent given Mνn (A) . (ii) If σ-fields generated by random vectors in {Yi }i∈Nn0 for a subset Nn0 ⊂ Nn are CND with respect to (νn , M), we simply say that random vectors in {Yi }i∈Nn are CND with respect to (νn , M). Conditional neighborhood dependence specifies only how conditional independence arises, not how conditional dependence arises. Conditional neighborhood dependence does not specify independence or dependence between Yi and Yj if j ∈ νn (i) or i ∈ νn (j). Furthermore, conditional neighborhood dependence can accommodate the situation where the neighborhoods in the system νn are generated by some random graph on Nn , as long as the random graph is G-measurable. In such a situation, the results of this paper continue to hold with only minor modifications that take care of the randomness of νn . 2.2. Monotonicity and Invariance to Conditioning In general, a conditional independence property is not monotone in conditioning σfields. In other words, when X and Y are conditionally independent given a σ-field F 0 , this does not imply conditional independence between X and Y given any sub-σ-field of F 0 or given any σ-field that contains F 0 . However, CND partially obeys monotonicity in neighborhood systems. More specifically, the CND property with a finer neighborhood system implies more conditional independence restrictions than what the CND property with a coarser neighborhood system implies. We introduce a lemma which makes precise this monotonicity property of CND. Suppose that we are given two neighborhood systems νn and νn0 where νn is weakly finer than νn0 . The following lemma shows that the CND property of a triangular array with respect to a given neighborhood system νn0 carries over to that with respect to νn if νn is undirected. Lemma 2.1. Given two neighborhood systems νn and νn0 , suppose that νn is weakly finer than νn0 and that a triangular array of σ-fields {Fi }i∈Nn is CND with respect to (νn , M) for 7 F IGURE 1. Conditional Neighborhood Dependence Notes: Suppose we are given random variables (Y1 , ..., Y13 ) and (M1 , ..., M13 ), where Mi = σ(Mi ). The figure depicts the neighborhood system on Nn = {1, 2, ..., 13}. If Y1 , ..., Y13 are CND with respect to the neighborhood system as illustrated above and (M1 , ..., M13 ), it implies that Y1 , ..., Y6 and Y10 , ..., Y13 are conditionally independent given M7 , M8 , M9 . some σ-fields M ≡ {Mi }i∈Nn . Suppose further that νn is undirected. Then {Fi }i∈Nn is CND with respect to (νn0 , M). Proof: Take any A, B ⊂ Nn such that A ⊂ Nn \ ν̄n0 (B) and B ⊂ Nn \ ν̄n0 (A), so that A ⊂ Nn \ ν̄n (B) and B ⊂ Nn \ ν̄n (A) as well. Let D ≡ νn0 (A) \ ν̄n (A), which, by the undirectedness of νn , implies that A ⊂ Nn \ ν̄n (D). Therefore, A ⊂ Nn \ ν̄n (B ∪ D) and B ∪ D ⊂ Nn \ ν̄n (A). By the CND property, FA ∨ MA and FB∪D ∨ MB∪D are conditionally independent given Mνn (A) . By Lemma 4.2 of Dawid (1979), this implies that FA ∨ MA and FB ∨ MB are conditionally independent given Mνn (A)∪D . This proves the lemma, because νn (A) ∪ D = νn0 (A), which follows due to νn (A) ⊂ νn0 (A), νn (A) ⊂ ν̄n (A), and ν̄n (A) \ νn (A) = A.  In the above lemma, the requirement that νn be undirected cannot be eliminated. To see this, consider the following counterexample of the lemma when νn is taken to be a directed neighborhood system. 8 Example 1: Let us take Nn = {1, 2, 3, 4} with n = 4. Let (εi )i∈Nn be i.i.d. standard normal random variables. Let us take Y1 = ε1 , Y2 = ε2 , Y3 = ε1 + ε3 + ε4 , and Y4 = ε4 . Let a neighborhood system νn be given as νn (i) = ∅ for all i = 1, 2, 4, and νn (3) = {1, 4}. Hence νn is directed. Then we take M = F = (Fi )i∈Nn , where each Fi denotes the σ-field generated by Yi . Then it is not hard to see that (Yi )i∈Nn is CND with respect to (νn , M). Now let us introduce another neighborhood system νn0 that is weakly coarser than νn . Let νn0 (1) = {3}, νn0 (2) = {1}, νn0 (3) = {1, 4}, and νn0 (4) = {3}. Then we take A = {1} and B = {4} so that A ⊂ Nn \ ν̄n0 (B) and B ⊂ Nn \ ν̄n0 (A). Note that νn0 (A) = νn0 (1) = {3}. Certainly Y1 and Y4 are not conditionally independent given Y3 , because Y3 involves both ε1 and ε4 .  As we shall see later, using further conditioning in the CND property, one may obtain a better normal approximation for a sum of CND random variables in some situations. Here we give a preliminary result which addresses the question of whether the CND property still holds after we increase the σ-fields in M in a certain way. More precisely, suppose that Y ≡ {Yi }i∈Nn is CND with respect to (νn , M). Then let us choose Nn∗ ⊂ Nn , and define a neighborhood system νn∗ on Nn such that for all A ⊂ Nn , νn∗ (A) ≡ νn (A) ∩ Nn∗ . (2.2) Let M∗ ≡ {M∗i }i∈Nn , where (2.3) M∗i ≡ Mi ∨ MNn \Nn∗ . Then we obtain the following result. Lemma 2.2. Suppose that Y ≡ {Yi }i∈Nn is CND with respect to (νn , M). Fix Nn∗ ⊂ Nn and define νn∗ as in (2.2) and M∗ ≡ {M∗i }i∈Nn as in (2.3). Then Y ∗ ≡ {Yi }i∈Nn∗ is CND with respect to (νn∗ , M∗ ). Proof: Take A, B ⊂ Nn∗ such that A ⊂ Nn∗ \ν̄n (B) and B ⊂ Nn∗ \ν̄n (A). Note that for any A0 ⊂ Nn∗ , Nn∗ \ν̄n (A0 ) = Nn∗ \ν̄n∗ (A0 ). Let B ∗ ≡ B ∪ ((Nn \Nn∗ )\ν̄n (A)). By the CND of Y , we have that σ(YA ) ∨ MA and σ(YB ∗ ) ∨ MB ∗ are conditionally independent given Mνn (A) . Hence σ(YA ) ∨ MA and σ(YB ) ∨ MB ∗ are conditionally independent given Mνn (A) . From (2.2), we have νn∗ (A)c ∩ νn (A) = νn (A) ∩ (Nn \Nn∗ ). 9 Hence we can write νn (A) = νn∗ (A) ∪ (νn∗ (A)c ∩ νn (A)) = νn∗ (A) ∪ (νn (A) ∩ (Nn \Nn∗ )), so that σ(YA ) ∨ MA and σ(YB ) ∨ MB ∗ are conditionally independent when we condition on Mνn∗ (A)∪(νn (A)∩(Nn \Nn∗ )) . This implies that σ(YA )∨MA and σ(YB )∨MB are conditionally independent given Mνn∗ (A)∪(Nn \Nn∗ ) by the definition of B ∗ , and by the choice of A ⊂ Nn∗ .  2.3. Examples 2.3.1. Conditional Dependency Graphs. Let Gn = (Nn , En ) be an undirected graph on Nn , where En denotes the set of edges. Define νn (i) = {j ∈ Nn : ij ∈ En }. Suppose that {Yi } has Gn as a conditional dependency graph, i.e., for each A ⊂ Nn , YA and YNn \ν̄n (A) are conditionally independent given a σ-field C. Dependency graphs were introduced by Stein (1972) and have received attention in the literature. (See, for example, Janson (1988), Baldi and Rinott (1989) and Rinott and Rotar (1996) for Berry-Esseen bounds for the sum of random variables with a dependency graph, and Janson (2004) for an exponential inequality. See Song (2015) for an application to permutation inference.) Then {Yi } is CND with respect to (νn , M), where Mi is taken to be C for each i ∈ Nn .  2.3.2. Functional Local Dependence. Let Gn = (Nn , En ) be a given directed graph, so that ij ∈ En represents an edge from i to j. The neighborhood NnO (i) = {j ∈ Nn : ij ∈ En } is the out-neighborhood of i, the set of vertices j that there is an edge from vertex i to vertex j. Similarly, NnI (i) = {j ∈ Nn : ji ∈ En } is the in-neighborhood of i. We I O define N¯n (i) = NnO (i) ∪ {i} and N¯n (i) = NnI (i) ∪ {i}. Suppose that Yi is generated in the following way: (2.4) Yi = γi (εN̄nI (i) , ηi ), where εN̄nI (i) = (εj )j∈N̄nI (i) and εi ’s and ηi ’s are independent across i’s and (εi )i∈Nn and (ηi )i∈Nn are independent from each other. Here the functions, γi ’s, are nonstochastic. This way of modeling local dependence among Yi ’s through base random variables, εi ’s, is useful in many contexts of applications. In particular, each outcome Yi may arise as a consequence of local interactions among individual variables, where locality is determined by a given graph Gn . (See Leung (2016) and Canen, Schwartz, and Song (2017) for applications in economics.) Let us define a new (undirected) graph G0n = (Nn , En0 ) such that ij ∈ En0 if and only if N̄nI (i) ∩ N̄nI (j) 6= ∅. In other words, i and j are adjacent in G0n , if their in-neighborhoods overlap. Define Nn0 (i) = {j ∈ Nn : ij ∈ En0 } for each i ∈ Nn . Then it is not hard to see that 10 {Yi }i∈Nn is CND with respect to (Nn0 , M0 ), for any triangular arrays of σ-fields M0i , as long as each M0i is the σ-fields generated by fi ((εj , ηj )j∈Nn ) for any nonstochastic measurable map fi . Note that we can take M0i to be trivial σ-fields in which case the functional local dependence is essentially equivalent to the dependency graph assumption. However, functional local dependence has much richer implications than the dependency graph assumption alone, because it generates lots of conditional independence restrictions that are not implied by the dependency graph assumption alone. Using such restrictions, we can obtain conditional neighborhood dependence as follows: for each i ∈ Nn , let Mi be the σ-field generated by (εi , ηi ). It is not hard to see that the triangular array {Yi }i∈Nn is CND with respect to (NnI , M). Note that the neighborhood system NnI is weakly finer than Nn0 , and hence when the graph Gn is undirected, by Lemma 2.1, the CND with respect to (NnI , M) expresses richer conditional independence restrictions than the CND with respect to (Nn0 , M). The notion of functional local dependence is related to physical dependence of Wu (2005). The main difference is that physical dependence in Wu (2005) is mainly intended for time series dependence, where Yi involves only the past and present values of εi ’s through a common function, whereas the functional local dependence captures local dependence through a system of neighborhoods of random variables.  2.3.3. Markov Random Fields on a Neighborhood System. Suppose that we have a triangular array of random vectors {Yi }i∈Nn , Yi ∈ Rd , where there is an undirected neighborhood system νn on Nn . A path in νn between two vertices i and j is defined to be a sequence of distinct vertices i1 , i2 , ..., im such that i1 = i and im = j and it ∈ νn (it+1 ) for each t = 1, ..., m − 1. Let us say that a set S ⊂ Nn separates sets A, B ⊂ Nn , if for any i ∈ A and any j ∈ B, every path between a vertex in A and a vertex in B intersects set S. Let us consider the following two notions of Markov properties (see Lauritzen (1996), p.32). Definition 2.2. (i) We say that {Yi }i∈Nn satisfies the the local Markov property if for any vertex i ∈ Nn and any B ⊂ Nn \ν̄n (i), Yi and YB are conditionally independent given Yνn (i) . (ii) We say that {Yi }i∈Nn satisfies the the global Markov property if for any two subsets A and B of Nn which are separated by set S ⊂ Nn , YA and YB are conditionally independent given YS . Suppose that Mi is the σ-field generated by Yi for each i ∈ Nn . It is not hard to see that if {Yi }i∈Nn satisfies the global Markov property, it is CND with respect to (νn , M). And if {Yi }i∈Nn is CND with respect to (νn , M), it satisfies the local Markov property. Hence 11 our notion of CND is an intermediate concept between the local and the global Markov properties.2 3. Stable Limit Theorems 3.1. Stable Central Limit Theorems 3.1.1. The Basic Result. In this section, we give a Berry-Esseen bound conditional on G for a triangular array of random variables that are CND with respect to (νn , M). Given a neighborhood system νn on Nn , we define 1 X dmx ≡ max |νn (i)| and dav ≡ |νn (i)|, i∈Nn n i∈N n where |νn (i)| denotes the cardinality of set νn (i). We call dmx the maximum degree and dav the average degree of neighborhood system νn . We use dmx and dav to express the conditions for the neighborhood system νn . For p = 1, ..., 4, define 1/p   p Xi , µp ≡ max E |G i∈Nn σn P where σn2 ≡ V ar( i∈Nn Xi |G). Let  2  X X 1 rn2 ≡ 4 E  ξij  |G  , σn i∈N n j∈ν̄n (i) where ξij ≡ E[Xi Xj |Mνn (i,j) ] − E[Xi Xj |G]. Theorem 3.1. Suppose that a triangular array {Xi }i∈Nn is CND with respect to (νn , M). Furthermore assume that E[Xi |Mνn (i) ] = 0, a.e. for each i ∈ Nn , and that ndmx dav µ33 ≤ 1, a.e., for all n ≥ 1. Then there exists an absolute constant C > 0 such that for each t ∈ R and each n ≥ 1,  q q 3 4 3 2 2 ndmx dav µ3 − log(ndmx dav µ3 ) ndmx dav µ4 + rn , a.e., ∆n (t; G) ≤ C where ( ∆n (t; G) ≡ P 1 X Xi ≤ t|G σn i∈N ) − Φ(t) n and Φ is the distribution function of the standard normal distribution. 2 Lauritzen, Dawid, Larsen, and Leimer (1990) proposed Markov fields over directed acyclic graphs. They defined local Markov property and global Markov property and provided a sufficient condition under which both are equivalent. 12 The use of the bound requires a good bound for rn . Observe that E[ξij |G] = 0. Therefore, when ξij ’s are locally dependent in a proper sense, we can expect that rn2 is at most of the same order as the term nd2mx dav µ44 . The following corollary gives a set of conditions under which this is true. Lemma 3.1. Suppose that the conditions of Theorem 3.1 hold. Furthermore, Mi ’s are conditionally independent given G. Then rn2 ≤ 8nd2mx dav µ44 . Focusing on a special case satisfying an additional condition below, we can obtain an improved version of Theorem 3.1. Condition A: For any A, B ⊂ Nn such that A ⊂ Nn \ ν̄n (B), Mνn (A) and FB are conditionally independent given G. Condition A accommodates conditional dependency graphs but excludes Markov random fields. Corollary 3.1. Suppose that a triangular array {Xi }i∈Nn is CND with respect to (νn , M), and that Condition A holds. Suppose further that E[Xi |G] = 0, a.e. for each i ∈ Nn , and that ndmx dav µ33 ≤ 1, a.e., for all n ≥ 1. Then there exists an absolute constant C > 0 such that for each t ∈ R and each n ≥ 1,  q q 3 3 4 2 ndmx dav µ3 − log(ndmx dav µ3 ) ndmx dav µ4 , a.e., ∆n (t; G) ≤ C where we define µp and ∆n (t; G) as in Theorem 3.1. The improvement of the result due to Condition A is two fold. First, the condition E[Xi |Mνn (i,j) ] = 0 is weakened to E[Xi |G] = 0. Second, the bound does not involve rn2 . When it is cumbersome to compute a reliable bound for rn2 , the above corollary can be useful.3 In the case of dependency graphs, there has been much research establishing a Berry√ Esseen bound. When we confine our attention to the special case of |Xi | ≤ 1/ n, i ∈ Nn , and dmx < D for all n ≥ 1 for some constant D > 0, our bound in Corollary 3.1 has the same n−1/2 rate as in Baldi and Rinott (1989) (Corollary 2), Chen and Shao (2004) (Theorem 2.7) and Penrose (2003) (Theorem 2.3), among others. These papers adopted Stein’s method to obtain the bound. However, to the best of our knowledge, it is not 3 In the special case of conditional dependency graphs, one can follow the proof of Theorem 2.4 of Penrose (2003) to obtain a slightly improved bound that does not have the logarithmic p factor. It appears that this improvement is marginal in many applications. For example, the quantity nd2mx dav µ44 is asymptotically p dominated by ndmx dav µ33 , when µpp = OP (n−p/2 ) and dmx increases with n slower than the rate n1/2 . 13 straightforward to extend their results to our set-up of CND variables. The main reason is that the conditioning σ-field conditional on which two sets of random variables XA and XB are independent varies depending on the set A. Thus, for example, we cannot apply Equation (2.4) in Penrose (2003), p.31, in our context. In this paper, we resort to a more traditional Fourier analytic method in combination with Esseen’s inequality. The Berry-Esseen bound gives stable convergence of a sum of random vectors to a mixture normal distribution. More specifically, suppose that {Xi }i∈Nn is a triangular array of random variables such that E[Xi |Mνn (i) ] = 0, a.e., for each i ∈ Nn , and for each t ∈ R, ∆n (t; G) →P 0, as n → ∞. Then for each U ∈ G, and for each uniformly continuous and bounded map f on R, we have " ! # 1 X E f Xi 1U → E[f (Z)1U ], as n → ∞, σn i∈N n where Z is a standard normal random variable that is independent of U and 1U denotes the indicator of event U . 3.1.2. Conditional Neighborhood Dependence Conditional on High-Degree Vertices. Let us extend Theorem 3.1 by considering normal approximation conditioning on random variables associated with high degree vertices. Let Nn∗ ⊂ Nn be a given subset, and νn∗ the neighborhood system on Nn given as in (2.2). Let 1 X ∗ (3.1) d∗mx ≡ max∗ |νn∗ (i)|, and d∗av ≡ ∗ |ν (i)|, i∈Nn n j∈N ∗ n n where n∗ ≡ |Nn∗ |. Hence, d∗mx and d∗av are the maximum and average degrees of the restriction of νn to Nn∗ . Moreover, define M∗ = (M∗i )i∈Nn , where M∗i = Mi ∨ MNn \Nn∗ , and write M∗νn∗ (i) = Mνn∗ (i) ∨MNn \Nn∗ . We have in mind choosing Nn∗ so that the set Nn \Nn∗ consists only of high-degree vertices in the neighborhood system νn . Then by Lemma 2.2, if (Xi )i∈Nn is CND with respect to (νn , M), then (Xi )i∈Nn∗ is CND with respect to (νn∗ , M∗ ). The main idea is that if the difference between the two sums X X (3.2) (Xi − E[Xi |Mνn (i) ]) (Xi − E[Xi |M∗νn∗ (i) ]) and i∈Nn∗ i∈Nn is asymptotically negligible, we can use the Berry-Esseen bound for the first sum using Theorem 3.1 and deal with the remainder term that comes from the difference. Now let 14 us present an extended version of Theorem 3.1. Let     1/p p Xi Xi ∗ ∗ ∗ µp ≡ max∗ E |Gn , and µ̃p ≡ max ∗ E ∗ i∈Nn i∈Nn \Nn σn σn∗ P where σn∗2 ≡ V ar( i∈Nn∗ Xi |Gn∗ ), and p |Gn∗ 1/p , Gn∗ ≡ G ∨ MNn \Nn∗ . (3.3) Note that the supremum in the definition of µ∗p is Nn∗ whereas that of µ̃∗p is Nn \Nn∗ . We also define for i, j ∈ Nn∗ , 2   X X 1 rn∗2 ≡ ∗4 E  ξij  |Gn∗  . σn ∗ i∈N ∗ n j∈ν̄n (i)∩Nn Theorem 3.2. Suppose that a triangular array {Xi }i∈Nn is CND with respect to (νn , M) and E[Xi |Mνn (i) ] = 0, a.e. for each i ∈ Nn as in Theorem 3.1, and n∗ d∗mx d∗av µ∗3 3 ≤ 1, a.e., for all n∗ ≥ 1. Then there exists an absolute constant C > 0 such that for each t ∈ R, n ≥ 1, and for each 1 ≤ r ≤ 4, q q ∗ ∗ ∗ ∗ ∗ ∗3 ∗3 ∗4 ∗ ∗ ∗ ∗ ∗2 ∆ (t; Gn ) ≤ C n dmx dav µ3 − C log(n dmx dav µ3 ) n∗ d∗2 mx dav µ4 + rn + C((n − n∗ )µ̃∗r + ρ∗r )r/(r+1) , a.e., where ( ∆∗ (t; Gn∗ ) ≡ P 1 X Xi ≤ t|Gn∗ σn∗ i∈N ) − Φ(t) , n and r 1/r X 1 ρ∗r ≡ E  ∗ E[Xi |M∗νn∗ (i) ]  . σn i∈N ∗   n Compared to Theorem 3.1, the bound involves an additional term. This additional term arises because the sum may not be centered around zero when we condition on √ M∗νn∗ (i) . If |Xi | ≤ 1/ n and (σn∗ )2 ≥ c for some c > 0, the third term in the bound is of √ order O(((n − n∗ )/ n + ρ∗r )r/(r+1) ). If X has νn as a conditional dependency graph, we have ρ∗r = 0 (because Mi = G for all i ∈ Nn in this case) and hence as long as √ (n − n∗ )/ n → 0, 15 as n → ∞, the third term in the bound vanishes, and the same CLT as in Theorem 3.1 √ √ is restored. In this case, if (n∗ /n)1/2 (((n − n∗ )/ n)4/5 + (d∗mx / n∗ )1/2 ) converges to zero √ faster than (dmx / n)1/2 , Theorem 3.2 has an improved rate over Theorem 3.1. Such an approximation captures the situation where the neighborhood system νn has a very small fraction of very high degree vertices. Such an improvement can still arise generally, even if X does not have νn as a conditional dependency graph. To see this, note that for each i ∈ Nn \ν̄n (Nn \Nn∗ ), Xi is conditionally independent of MNn \Nn∗ given Mνn (i) , we have E[Xi |M∗νn∗ (i) ] = E[Xi |M(νn (i)∩Nn∗ )∪(Nn \Nn∗ ) ] = E[Xi |Mνn (i)∪(Nn \Nn∗ ) ] = E[Xi |Mνn (i) ] = 0. Hence r 1/r   ρ∗r = E  1 σn∗ X E[Xi |M∗νn∗ (i) ]  . i∈ν̄n (Nn \Nn∗ )∩Nn∗ √ Suppose that |Xi | ≤ 1/ n, (σn∗ )2 ≥ c for some c > 0, n − n∗ = O(1), and dav = O(1) and d∗av = O(1). Then we have √ √ ρ∗r = O(|ν̄n (Nn \Nn∗ )|/ n) = O(dmx / n). (3.4) The rate in Theorem 3.2 improves on that in Theorem 3.1 because with p > 1, (ρ∗p )4/5 = √ √ O((dmx / n)4/5 ) = o((dmx / n)1/2 ). As we shall see later in Section 3.2.5, the approach of CND conditional on high-degree vertices is useful for obtaining stable central limit theorem for empirical processes when the random variables are CND with respect to a neighborhood system having a maximum degree increasing with to infinity as n → ∞. 3.2. Empirical Processes and Stable Convergence 3.2.1. Stable Convergence in Metric Spaces. Let us first introduce some preliminary results about stable convergence in metric spaces. Let (D, d) be a given metric space and define B(D) to be the Borel σ-field of D. Let (Ω, F, P ) be the given probability space, where G is a sub σ-field of F. Recall that a map L : B(D) × Ω → [0, 1] called a Markov kernel if for each ω ∈ Ω, L(·, ω) is a Borel probability measure on B(D) and for each B ∈ B(D), L(B, ·) is F-measurable. Following the notation in Häusler and Luschgy (2010), let us define the marginal of L on B(D) as Z P L(B) ≡ L(B, ω)dP (ω). 16 For a given finite collection {h1 , ..., hk } ⊂ H, the finite dimensional projection of a Markov kernel L is defined to be a Markov kernel Lh1 ,...,hk : B(Rk ) × Ω → [0, 1] such that for any B ∈ B(Rk ), Lh1 ,...,hk (B, ω) ≡ L({y ∈ D : (y(h1 ), ..., y(hk )) ∈ B}, ω). In the spirit of the Hoffman-Jorgensen approach, we consider the following definition of stable convergence for empirical processes. (See Berti, Pratelli, and Rigo (2012), p.2., for a similar definition.) Definition 3.1. Suppose that we are given a sub σ-field G, a sequence of D-valued stochastic processes ζn , a Markov kernel L on B(D) × Ω, and a D-valued Borel measurable random element ζ that has a Markov kernel L. Suppose that for each U ∈ G, and each bounded Lipschitz functional f on D, Z Z ∗ f (y)L(dy, ω)dP (ω), E [f (ζn )1U ] → U D ∗ as n → ∞, where E denotes the outer-expectation and 1U is the indicator function of the event U . Then we say that ζn converges to L, G-stably, (or equivalently, ζn converges to ζ, G-stably), and write ζn → L, G-stably (or equivalently, ζn → ζ, G-stably.) Stable convergence according to Definition 3.1 implies weak convergence (in the sense of Hoffman-Jorgensen). When ζn is Borel measurable, the above definition is equivalent to the weak convergence of Markov kernels and many of the existing results on stable convergence carry over. However, this equivalence does not extend to the case of ζn being non-measurable, because there is no proper definition of Markov kernels for nonmeasurable stochastic processes. Nevertheless the above definition can still be useful when one needs to deal with random norming, as shown in the following lemma which generalizes Theorem 1’ in Aldous and Eagleson (1978) and part of Theorem 3.18 of Häusler and Luschgy (2010). Lemma 3.2. Suppose that ζn , ζ, ξn , ξ are D-valued random variables, and that ζn → ζ, Gstably, where ζ and ξ are Borel measurable, and let Pζ denote the distribution of ζ. Then the following holds. (i) If P ∗ {d(ξn , ξ) > ε} → 0 as n → ∞ for each ε > 0, and ξ is G-measurable, then (ζn , ξn ) → (ζ, ξ), G-stably, where P ∗ denotes the outer probability. (ii) If f : D → D is Pζ -a.e. continuous, then f (ζn ) → f (ζ), G-stably. 17 The first result is a stable-convergence analogue of Cramér-Slutsky lemma. The second result is a continuous mapping theorem. 3.2.2. Stable Convergence of an Empirical Process. Suppose that {Yi }i∈Nn is a given triangular array of R-valued random variables which is CND with respect to (νn , M). Let H be a given class of real measurable functions on R. Then, we consider the following empirical process: {Gn (h) : h ∈ H}, where, for each h ∈ H, 1 X Gn (h) ≡ √ (h(Yi ) − E[h(Yi )|Mνn (i) ]). n i∈N n The empirical process νn takes a value in l∞ (H), the collection of bounded functions on H which is endowed with the sup norm so that (l∞ (H), k · k∞ ) forms the metric space (D, d) with khk∞ ≡ supy∈R |h(y)|. In this section, we explore conditions for the class H and the joint distribution of the triangular array {Yi }i∈Nn which delivers the stable convergence of the empirical process. Stable convergence in complete separable metric spaces can be defined as a weak convergence of Markov kernels. (See Häusler and Luschgy (2010).) However, this definition does not extend to the case of empirical processes taking values in D that is endowed with the sup norm, due to non-measurability. Weak convergence of an empirical process to a Gaussian process is often established in three steps. First, we show that the class of functions is totally bounded with respect to a certain pseudo-metric ρ. Second, we show that each finite dimensional projection of the empirical process converges in distribution to a multivariate normal random vector. Third, we establish the asymptotic ρ-equicontinuity of the empirical process. Let ρ be a given pseudo-metric on H such that (H, ρ) is a totally bounded metric space. Then we define Uρ (H) ≡ {y ∈ D : y is uniformly ρ-continuous on H}. The following theorem shows that we can take a similar strategy in proving the stable convergence of an empirical process to a Markov kernel. The structure and the proof of the theorem is adapted from Theorem 10.2 of Pollard (1990). Theorem 3.3. Suppose that the stochastic process ζn ∈ D is given, where (H, ρ) is a totally bounded metric space. Suppose that the following conditions hold. (i) For each finite set {h1 , ..., hk } ⊂ H, (ζn (h1 ), ..., ζn (hk )) → Lh1 ,...,hk , G-stably, where Lh1 ,...,hk is a Markov kernel on B(Rk ) × Ω. 18 (ii) ζn is asymptotically ρ-equicontinuous on H, i.e., for each ε > 0, η > 0, there exists δ > 0 such that ( ) limsupn→∞ P ∗ sup |ζn (h) − ζn (h0 )| > η < ε, h,h0 ∈H:ρ(h,h0 )<δ where P ∗ denotes the outer probability. Then there exists a Markov kernel L on B(D) × Ω such that the following properties are satisfied. (a) The finite dimensional projections of L are given by Markov kernels Lh1 ,...,hk . (b) P L(Uρ (H)) = 1. (c) ζn → L, G-stably. Conversely, if ζn converges to Markov kernel L on B(D)×Ω, G-stably, where P L(Uρ (H)) = 1, then (i) and (ii) are satisfied. It is worth noting that for stable convergence of empirical processes, the conditions for the asymptotic equicontinuity and the totally boundedness of the function class with respect to a pseudo-norm are as in the standard literature on weak convergence of empirical processes. The only difference here is that the convergence of finite dimensional distributions is now replaced by the stable convergence of finite dimensional projections. 3.2.3. Maximal Inequality. This subsection presents a maximal inequality in terms of bracketing entropy bounds. The maximal inequality is useful primarily for establishing asymptotic ρ-equicontinuity of the empirical process but also for many other purposes. First, we begin with a tail bound for a sum of CND random variables. Janson (2004) established an exponential bound for a sum of random variables that have a dependency graph. The following exponential tail bound is crucial for our maximal inequality. The result below is obtained by slightly modifying the proof of Theorem 2.3 of Janson (2004). Lemma 3.3. Suppose that {Xi }i∈Nn is a triangular array of random variables that take  values in [−M, M ] and are CND with respect to (νn , M), and let σi2 ≡ V ar Xi |Mνn (i) and P Vn ≡ i∈Nn E[σi2 |G] with G as defined in (2.1). Then, for any η > 0, ( )   X η2 P Xi ≥ η|G (3.5) ≤ 2 exp − , a.e. 2(dmx + 1)(2(dmx + 1)Vn + M η/3) i∈N n for all n ≥ 1. Furthermore, if Condition A holds and the condition E[Xi |Mνn (i) ] = 0 is replaced by E[Xi |G] = 0 and the σ-fields Mνn (i) in σi ’s are replaced by G, then the following holds: for 19 any η > 0, ( (3.6) P ) X i∈Nn Xi ≥ η|G  ≤ 2 exp − 8η 2 25(dmx + 1)(Vn + M η/3)  , a.e. for all n ≥ 1. The bound in (3.6) is the one obtained by Janson (2004) for the case of dependency graphs. From this, the following form of maximal inequality for a finite set immediately follows from Lemma A.1 of van der Vaart (1996). Corollary 3.2. Suppose that {Yi }i∈Nn is a triangular array of random variables that are P CND with respect to (νn , M). Let for each h ∈ H, Vn (h) ≡ n−1 i∈Nn E[σi2 (h)|G] and σi2 (h) ≡ V ar(h(Yi )|Mνn (i) ) with G as defined in (2.1). Then there exists an absolute constant C > 0 such that   E max |Gn (hs )||G 1≤s≤m   q J ≤ C(dmx + 1) √ log(1 + m) + log(1 + m) max Vn (hs ) , a.e., 1≤s≤m n for any n ≥ 1 and any m ≥ 1 with a finite subset {h1 , ..., hm } of H such that for some constant J > 0, max1≤s≤m supx∈R |hs (x)| ≤ J. Let us now elevate the above inequality to a maximal inequality over function class H. Recall that we allow the random variables Yi ’s to be idiosyncratically distributed across i’s. We define the following semi-norm on H: s 1 X E[h2 (Yi )]. ρ̄n (h) ≡ n i∈N n We denote N[] (ε, H, ρ̄n ) to be the ε-bracketing number of H with respect to ρ̄n , i.e., the smallest number J of the brackets [hL,j , hU,j ], j = 1, ..., J, such that ρ̄n (hU,j − hL,j ) ≤ ε. The following lemma establishes the maximal inequality in terms of a bracketing entropy bound. Lemma 3.4 (Maximal Inequality). Suppose that {Yi }i∈Nn is a triangular array of random variables that are CND with respect to (νn , M). Suppose further that the class H of functions have an envelope H such that ρ̄n (H) < ∞. Then, there exists an absolute constant C > 0 such that for each n ≥ 1,   Z ρ̄n (H) q ∗ 1 + log N[] (ε, H, ρ̄n )dε. E sup |Gn (h)| ≤ C(1 + dmx ) h∈H 0 20 The bracketing entropy bound in Lemma 3.4 involves the maximum degree dmx . Hence the bound is useful only when the neighborhood system νn does not have a maximum degree increasing with n. 3.2.4. Stable Central Limit Theorem. First, let us say that a stochastic process {G(h) : h ∈ H} is a G-mixture Gaussian process if for any finite collection {h1 , ..., hm } ⊂ H, the distribution of random vector [G(h1 ), G(h2 ), ..., G(hm )] conditional on G is a multivariate normal distribution. Also, we call a Markov kernel K a G-mixture Gaussian Markov kernel associated with a given G-mixture Gaussian process G if for any h1 , ..., hm ∈ H, the conditional distribution of [G(h1 ), G(h2 ), ..., G(hm )] given G is given by the finite dimensional projection Kh1 ,...,hm of K. Let us summarize the conditions for the neighborhood system as follows. Assumption 3.1. (a) There exists C > 0 such that for all n ≥ 1, Z ρ̄n (H) q (1 + dmx ) 1 + log N[] (ε, H, ρ̄n )dε < C. 0 (b) For any h1 , h2 ∈ H, E[Gn (h1 )Gn (h2 )|G] →P K(h1 , h2 |G), for some K(·, ·|G)(ω) : H × H → R, ω ∈ Ω, which is positive semidefinite a.e. (c) dmx = O(1), and for each h ∈ H, −n−1/4 rn (h) log(n−1/2 dmx dav ) →P 0, as n → ∞, where  2  X X 1 rn2 (h) ≡ E  √ ξij (h) |G  , n i∈N n j∈ν̄n (i) with ξij (h) ≡ E[(h(Xi ) − E[h(Xi )|Mνn (i) ])(h(Xj ) − E[h(Xj )|Mνn (j) ])|Mνn (i,j) ] −E[(h(Xi ) − E[h(Xi )|Mνn (i) ])(h(Xj ) − E[h(Xj )|Mνn (j) ])|G]. (d) For each h ∈ H, ρ(h) ≡ limn→∞ ρ̄n (h) exists and satisfies that whenever ρ(hn ) → 0 as n → ∞, ρ̄n (hn ) → 0 as n → ∞ as well. The following result gives a Donsker-type stable convergence of empirical processes. 21 Theorem 3.4. Suppose that {Yi }i∈Nn is a triangular array of random variables that are CND with respect to (νn , M), satisfying Assumption 3.1. Suppose further that there exists C > 0 such that for each n ≥ 1, maxi∈Nn E[H(Yi )4 ] < C, where H is an envelope of H. Then νn converges to a G-mixture Gaussian process G in l∞ (H), G-stably, such that for any h1 , h2 ∈ H, E[G(h1 )G(h2 )|G] = K(h1 , h2 |G), a.e.. Furthermore, we have P K(Uρ (H)) = 1, where K is the G-mixture Gaussian Markov kernel associated with G. The fourth moment condition maxi∈Nn E[H(Yi )4 ] < ∞ is used to ensure the convergence of finite dimensional distributions using Theorem 3.1. It is worth noting that Assumption 3.1(a) essentially requires that the maximum degree dmx to be bounded. It is interesting that this condition was not required for the CLT in Theorem 3.1. This stronger condition for the maximum degree is used to establish the asymptotic equicontinuity of the process {Gn (h) : h ∈ H}. When the neighborhood system νn is generated according to a model of stochastic graph formation, this condition is violated for many existing models of graph formation used, for example, for social network modeling. In the next section, we utilize the approach of conditioning on high-degree vertices to weaken this condition. 3.2.5. Conditional Neighborhood Dependence Conditional on High-Degree Vertices. As mentioned before, Assumption 3.1(a) requires that dmx be bounded. Following the idea of conditioning on high degree vertices as in Theorem 3.2, let us explore a stable convergence theorem that relaxes this requirement. As we did prior to Theorem 3.2, we choose Nn∗ ⊂ Nn to be a given subset and let d∗mx and d∗av be as defined in (3.1). First, write Gn (h) = G∗n (h) + Rn∗ (h) + ρ∗n (h), (3.7) where  1 X G∗n (h) ≡ √ h(Yi ) − E[h(Yi )|M∗νn∗ (i) ] n i∈N ∗ n 1 Rn∗ (h) ≡ √ n X  h(Yi ) − E[h(Yi )|Mνn (i) ] , and i∈Nn \Nn∗  1 X ρ∗n (h) ≡ √ E[h(Yi )|Mνn (i) ] − E[h(Yi )|M∗νn∗ (i) ] . n i∈N ∗ n Note that E ∗   sup |Rn∗ (h)| h∈H ≤ p 2(n − n∗ ) √ max E[H 2 (Yi )]. i∈Nn n 22 Since {Yi }i∈Nn∗ is CND with respect to (νn∗ , M∗ ) as defined in (2.2) and (2.3), we can apply the previous results to G∗n (h). This gives the following extension of the maximal inequality in Lemma 3.4. Since the maximal inequality is often of independent interest, let us state it formally. Lemma 3.5 (Maximal Inequality). Suppose that {Yi }i∈Nn is a triangular array of random variables that are CND with respect to (νn , M). Suppose further that the class H of functions have an envelope H such that ρ̄n (H) < ∞. Then, there exists an absolute constant C > 0 such that for all n ≥ 1, √   Z C n∗ (1 + d∗mx ) ρ̄n (H) q ∗ √ E sup |Gn (h)| ≤ 1 + log N[] (ε, H, ρ̄n )dε n h∈H 0    p n − n∗ ∗ ∗ √ + C max E[H 2 (Yi )] + E sup ρn (h) . n i∈Nn h∈H √ If kHk∞ < C and n − n∗ = O(1), the second term in the bound is O(dmx / n) similarly as we derived in (3.4). Thus this bound is an improvement over Lemma 3.4, whenever O(d∗mx ) = o(dmx ) as n → ∞. Let us turn to the Donsker-type stable convergence of an empirical process. We modify Assumption 3.1 as follows. Assumption 3.2. (a) There exists C > 0 such that for all n ≥ 1, Z ρ̄n (H) q ∗ 1 + log N[] (ε, H, ρ̄n )dε < C. (1 + dmx ) 0 (b) For any h1 , h2 ∈ H, E[Gn (h1 )Gn (h2 )|Gn∗ ] →P K(h1 , h2 |G ∗ ), for some K(·, ·|G ∗ )(ω) : H × H → R, ω ∈ Ω, which is positive semidefinite a.e, and non-constant at zero, and for some sub σ-field G ∗ of F, where Gn∗ is as defined in (3.3). (c) d∗mx = O(1), and for each h ∈ H, −n∗−1/4 rn∗ (h) log(n∗−1/2 d∗mx d∗av ) →P 0, as n → ∞, where 2   X X 1 ξij (h) |Gn∗  . rn∗2 (h) ≡ E  √ n i∈N ∗ ∗ n j∈ν̄n (i)∩Nn (d) For each h ∈ H, ρ(h) ≡ limn→∞ ρ̄n (h) exists and satisfies that whenever ρ(hn ) → 0 as n → ∞, ρ̄n (hn ) → 0 as n → ∞ as well. (e) E∗ [suph∈H ρ∗n (h)] → 0, as n → ∞. 23 While Condition (a) essentially requires that d∗mx be bounded, Condition (c) allows dmx √ to increase to infinity as n. The condition in (b) that K(·, ·|G ∗ ) be non-constant at zero requires that n − n∗ → λ, as n → ∞, for some λ ∈ [0, ∞). Thus the number of the high degree vertices (n − n∗ ) selected when we set Nn∗ ⊂ Nn should be bounded as n → ∞. In combination with (e), this implies that √ we have (n − n∗ )/ n + E∗ [suph∈H ρ∗n (h)] → 0 as n → ∞, which makes it suffice to focus on G∗n (h) in (3.7) for a stable limit theorem. We obtain the following extended version of Theorem 3.4. Theorem 3.5. Suppose that {Yi }i∈Nn is a triangular array of random variables that are CND with respect to (νn , M), satisfying Assumption 3.2. Suppose further that there exists C > 0 such that for each n ≥ 1, maxi∈Nn E[H(Yi )4 ] < C, where H is an envelope of H. Then νn converges to a G ∗ -mixture Gaussian process G∗ in l∞ (H), G ∗ -stably, such that for any h1 , h2 ∈ H, E[G∗ (h1 )G∗ (h2 )|G ∗ ] = K(h1 , h2 |G ∗ ), a.e.. Furthermore, we have P K(Uρ (H)) = 1, where K is the G ∗ -mixture Gaussian Markov kernel associated with G∗ . If we take Nn∗ to be identical to Nn , Theorem 3.5 is reduced to Theorem 3.4. However, Theorem 3.5 shows that approximation of the distribution of an empirical process by a mixture Gaussian process is possible even if dmx → ∞ as n → ∞. 4. Appendix: Mathematical Proofs To simplify the notation, we follow van der Vaart (1996) and write an . bn for any sequence of numbers, whenever an ≤ Cbn for all n ≥ 1 with some absolute constant C > 0. The absolute constant can differ across different instances of .. For any positive integer k and i ≡ (i1 , ..., ik ) ∈ Nnk and a triangular array of random variables {Xi }i∈Nn , we define (4.1) X(i) ≡ k Y Xi r . r=1 The following lemma is useful for the proofs of various results. Lemma 4.1. Suppose that νn is a neighborhood system on Nn and {Xi }i∈Nn is a triangular array of random variables that are CND with respect to (νn , M), where M = {Mi }i∈Nn . Furthermore, for given positive integer k, let i = (i1 , ..., ik ) ∈ Nnk be such that it has two 24 partitioning subvectors Ik,1 (i) and Ik,2 (i) of i such that the entries of Ik,1 (i) are from Nn \ ν̄n (Ik,2 (i)) and the entries of Ik,2 (i) are from Nn \ ν̄n (Ik,1 (i)). Then, E[X(i)|Mνn (i) ] = E[X(Ik,1 (i))|Mνn (Ik,1 (i)) ]E[X(Ik,2 (i))|Mνn (Ik,2 (i)) ]. Suppose further that Condition A holds. Then, E[X(i)|G] = E[X(Ik,1 (i))|G]E[X(Ik,2 (i))|G]. Proof: By the choice of i, we have (4.2) νn (i) = νn (Ik,1 (i)) ∪ νn (Ik,2 (i)), νn (Ik,1 (i)) ⊂ νn (i), and νn (Ik,2 (i)) ⊂ νn (i). To see the second statement, note that whenever i ∈ νn (Ik,1 (i)), we have i ∈ / Ik,1 (i) and i∈ / Ik,2 (i), and there must exist j ∈ Ik,1 such that i ∈ νn (j). Since Ik,1 ⊂ i, we find that i ∈ νn (i). As for the first statement of the lemma, we write E[X(i)|Mνn (i) ] = E[E[X(Ik,1 (i))|Mνn (i) , X(Ik,2 (i))]X(Ik,2 (i))|Mνn (i) ] = E[E[X(Ik,1 (i))|Mνn (Ik,1 (i))∪νn (Ik,2 (i)) , X(Ik,2 (i))]X(Ik,2 (i))|Mνn (i) ] = E[E[X(Ik,1 (i))|Mνn (Ik,1 (i)) ]X(Ik,2 (i))|Mνn (i) ] = E[X(Ik,1 (i))|Mνn (Ik,1 (i)) ]E[X(Ik,2 (i))|Mνn (i) ] = E[X(Ik,1 (i))|Mνn (Ik,1 (i)) ]E[X(Ik,2 (i))|Mνn (Ik,2 (i)) ]. The second equality follows by (4.2). The third equality follows because νn (Ik,2 (i)) \ ν̄n (Ik,1 (i)) and Ik,2 (i) are outside ν̄n (Ik,1 (i)) and X(Ik,1 (i)) is conditionally independent of (Mνn (Ik,2 (i))\ν̄n (Ik,1 (i)) , X(Ik,2 (i))) given Mνn (Ik,1 (i)) by the CND property of {Xi }. The fourth equality follows because νn (Ik,1 (i)) ⊂ νn (i) . The fifth equality uses the fact that νn (Ik,1 (i)) \ ν̄n (Ik,2 (i)) is outside of ν̄n (Ik,2 (i)) and the CND property of {Xi }i∈Nn . Let us turn to the second statement of the lemma and now assume that Condition A holds. We write E[X(i)|G] = E[E[X(Ik,1 (i))|Mνn (Ik,1 (i)) , X(Ik,2 (i))]X(Ik,2 (i))|G] = E[E[X(Ik,1 (i))|Mνn (Ik,1 (i)) ]X(Ik,2 (i))|G] = E[X(Ik,1 (i))|G]E[X(Ik,2 (i))|G]. The second equality follows because Ik,2 (i) is outside ν̄n (Ik,1 (i)) and by the CND property. The third equality follows by Condition A, i.e., Mνn (Ik,1 (i)) and X(Ik,2 (i)) are conditionally independent given G.  25 Let us present the proof of Theorem 3.1. Recall the notation in the theorem, and define P P ≡ Xi /σn , W σ ≡ i∈Nn Xiσ , and Wiσ ≡ j∈ν̄n (i) Xjσ . Let us define for t ∈ R and ω ∈ Ω, Xiσ ϕn (t)(ω) ≡ E[exp(itW σ )|G](ω), √ where i ≡ −1. Note that ϕn is uniformly continuous on R almost surely, and since E[(W σ )2 |G] = 1, a.e., ϕn is twice continuously differentiable almost surely. (See Yuan and Mei (2016).) Lemma 4.2. Suppose that the conditions of Theorem 3.1 hold. Then for each t ∈ R,   q 0 2 3 4 2 2 |ϕn (t) + tϕn (t)| . nt dmx dav µ3 + t ndmx dav µ4 + rn , a.e. Proof: First, as in the proof of Theorem 1 in Jenish and Prucha (2009), we decompose (it − W σ ) exp(itW σ ) = h1,t (W σ ) − h2,t (W σ ) − h3,t (W σ ), where ! itW σ h1,t (W σ ) ≡ ite 1− X Xjσ Wjσ , j∈Nn h2,t (W σ ) ≡ e itW σ X σ Xjσ (1 − itWjσ − e−itWj ), and j∈Nn h3,t (W σ ) ≡ eitW σ X σ Xjσ e−itWj . j∈Nn Now, let us consider   !2 E[h1,t (W σ )2 |G] ≤ t2 E  1 − X Xiσ Wiσ |G  i∈Nn 2  = t2 E  X X Xiσ Xjσ  |G  − t2 , i∈Nn j∈ν̄n (i) because X X i∈Nn j∈ν̄n (i) by the definition of σn2 .    E Xiσ Xjσ |G = 1, 26 Define σij ≡ E[Xiσ Xjσ |G] and σij∗ ≡ E[Xiσ Xjσ |Mνn (i,j) ]. Note that for {i, j}, {k, l} ⊂ Nn such that {k, l} ⊂ Nn \ ν̄n (i, j) and {i, j} ⊂ Nn \ ν̄n (k, l), we have by Lemma 4.1, (4.3) E[Xiσ Xjσ Xkσ Xlσ |Mνn (i,j,k,l) ] = E[Xiσ Xjσ |Mνn (i,j) ]E[Xkσ Xlσ |Mνn (k,l) ] ∗ = σij∗ σkl . Let 2  ˜n ≡  ∆ X X 2  σij  −  X X σij∗  . i∈Nn j∈ν̄n (i) i∈Nn j∈ν̄n (i) Then we can write 2  (4.4) 1 =  X X σij  i∈Nn j∈ν̄n (i) 2  =  X X σij∗  ˜n = +∆ 0 X ∗ σij∗ σkl + 00 X ∗ ˜ n, σij∗ σkl +∆ i∈Nn j∈ν̄n (i) P where the sum 0 is over (i, j, k, l) such that i ∈ Nn , j ∈ ν̄n (i), k ∈ Nn , l ∈ ν̄n (k) and P either {k, l} ∩ ν̄n (i, j) 6= ∅ or {i, j} ∩ ν̄n (k, l) 6= ∅, and the sum 00 is over (i, j, k, l) such that i ∈ Nn , j ∈ ν̄n (i), k ∈ Nn , l ∈ ν̄n (k) and {k, l} ⊂ Nn \ ν̄n (i, j) and {i, j} ⊂ Nn \ ν̄n (k, l). This implies that  2  X X E  Xiσ Xjσ  |G  − 1 i∈Nn j∈ν̄n (i) = = = 0 X 0 X 0 X E[Xiσ Xjσ Xkσ Xlσ |G] E[Xiσ Xjσ Xkσ Xlσ |G] + + 00 X 00 X E[Xiσ Xjσ Xkσ Xlσ |G] − 1 ∗ E[σij∗ σkl |G] − 1  ∗ ˜ n |G]. |G] − E[∆ E[Xiσ Xjσ Xkσ Xlσ |G] − E[σij∗ σkl The second equality is by (4.3) and the third equality is by (4.4). The leading sum is P bounded by Cnd2mx dav µ44 , because the number of the terms in the sum 0 is bounded by C1 nd2mx dav for some constant C1 > 0. ˜ n . We write ∆ ˜ n = Rn (2 − Rn ), by using (4.4), where Let us focus on ∆ X X Rn ≡ (σij − σij∗ ). i∈Nn j∈ν̄n (i) 27 Since E[Rn |G] = 0, we have ˜ n |G] = −E[R2 |G] = −r2 . E[∆ n n Hence,  E[h1,t (W σ )2 |G] . t2 nd2mx dav µ44 + rn2 . Let us turn to h2,t (W σ ). Using series expansion of exp(−itx) (e.g. see (3.2) of Tikhomirov (1980)), we bound t2 X t2 X X E[h2,t (W σ )|G] ≤ E[|Xiσ |(Wiσ )2 |G] = E[|Xiσ Xjσ Xkσ ||G]. 2 i∈N 2 i∈N n n j,k∈ν̄n (i) Using arithmetic-geometric mean inequality, we can bound the last term by Ct2 ndmx dav µ33 . Finally, let us turn to h3,t (W σ ). We write E[h3,t (W σ )|G] as     X X X E[Xiσ exp(it(W σ − Wiσ ))|G] = E Xiσ exp it Xjσ  |G  . i∈Nn i∈Nn j∈Nn \ν̄n (i) The last conditional expectation is equal to       X E E Xiσ exp it Xjσ  |Mνn (i)  |G  j∈Nn \ν̄n (i)      = E E Xiσ |Mνn (i) E exp it  X   Xjσ  |Mνn (i)  |G  = 0. j∈Nn \ν̄n (i)   The first equality follows by CND and the second equality follows because E Xiσ |Mνn (i) = 0. Hence, it follows that E[h3,t (W σ )|G] = 0. Since we have ϕ0n (t) + tϕn (t) = −i (E[(it − W σ ) exp(itW σ )|G]) , by collecting the results for h1,t (W σ ), h2,t (W σ ), and h3,t (W σ ), we obtain the desired result.  Proof of Theorem 3.1: For each t ∈ R, ϕ0n (t) = −tϕn (t) − iE[(it − W σ ) exp(itW σ )|G] ≡ −tϕn (t) + γn (t), say. 28 Taking integral of both sides, we obtain the following expression:  2   2 Z t u t γn (u) exp ϕn (t) = exp − 1+ du 2 2 0 or  2  2  2Z t u t t |γn (u)| exp (4.5) ϕn (t) − exp − ≤ exp − du. 2 2 2 0 Note that for all t ≥ 0, t Z u2 exp(u2 /2)du ≤ exp(t2 /2)t, 0 Rt and 0 u exp(u2 /2)du = exp(t2 /2) − 1. Applying Lemma 4.2, the last term in (4.5) for t > 0 is bounded by tan + (1 − exp(−t2 /2))bn , where q 3 an ≡ Cndmx dav µ3 , and bn ≡ C nd2mx dav µ44 + rn2 , for some absolute constant C > 0. Hence for any T ≥ 1, Z Z Z 2 2 1 − e−t /2 ϕn (t) − e−t /2 dt ≤ an dt + bn dt ≤ 2T an + 2 log(T )bn . t t [−T,T ] [−T,T ] [−T,T ] Therefore, by Esseen’s inequality (see e.g. Theorem 1.5.2 of Ibragimov and Linnik (1971), p.27), we obtain the following bound:  ∆n (t; G) . T an + log(T )bn + T −1 . (an1/2 − log(an )bn ), −1/2 by taking T = an . Proof of Lemma 3.1: For (i, j) and (i0 , j 0 ) such that either {i, j} ∩ ν̄n (i0 , j 0 ) = ∅ or {i0 , j 0 } ∩ ν̄n (i, j) = ∅, E[ξij ξi0 j 0 |G] = E[ξij |G]E[ξi0 j 0 |G] = 0. Let A be the set of ((i, j), (i0 , j 0 )) such that i ∈ Nn , j ∈ ν̄n (i), i0 ∈ Nn and j 0 ∈ ν̄n (i0 ). Then  2  4 X X X 4 4     E ξij |G ≤ σ µ4 Aj , i∈Nn j∈ν̄n (i) j=1 where A1 is the number of ((i, j), (i0 , j 0 )) ∈ A such that either i ∈ ν̄n (i0 ) or i0 ∈ ν̄n (i); A2 is the number of ((i, j), (i0 , j 0 )) ∈ A such that either i ∈ ν̄n (j 0 ) or j 0 ∈ ν̄n (i); A3 is the number of ((i, j), (i0 , j 0 )) ∈ A such that either j ∈ ν̄n (i0 ) or i0 ∈ ν̄n (j); A4 is the number of ((i, j), (i0 , j 0 )) ∈ A such that either j ∈ ν̄n (j 0 ) or j 0 ∈ ν̄n (j). Thus, it is not hard to see that 4 X j=1 completing the proof.  Aj ≤ 8nd2mx dav , 29 Proof of Corollary 3.1: Similarly as in the proof of Lemma 4.2, we decompose (it − W σ ) exp(itW σ ) = h1,t (W σ ) − h2,t (W σ ) − h3,t (W σ ). The treatment of h2,t (W σ ) and h3,t (W σ ) is the same as that of the proof of Lemma 4.2. The difference lies in the treatment of h1,t (W σ ). Using Condition A and Lemma 4.1, we note that for {i, j}, {k, l} ⊂ Nn such that {k, l} ⊂ Nn \ ν̄n (i, j) and {i, j} ⊂ Nn \ ν̄n (k, l), (4.6) E[Xiσ Xjσ Xkσ Xlσ |G] = E[Xiσ Xjσ |G]E[Xkσ Xlσ |G] = σij σkl . Following the same argument in the proof of Lemma 4.2, we find that  2  0 X X X  σ σ    E Xi Xj |G − 1 = E[Xiσ Xjσ Xkσ Xlσ |G] − σij σkl , i∈Nn j∈ν̄n (i) which is bounded by Cnd2mx dav µ44 . Hence in the proof of Lemma 4.2, we do not need to ˜ n . Following the proofs of Lemma 4.2 and Theorem 3.1 for the rest of the deal with ∆ terms, we obtain the desired result.  Lemma 4.3. Suppose that X and Y are random variables such that E[Y ] = 0, and F is the CDF on R with density function f . Then for any r > 0 and t ∈ R,  1/(r+1) r r |P {X + Y ≤ t} − F (t)| ≤ |P {X ≤ t} − F (t)| + 3 sup f (z) E[|Y | ] . z∈R Proof: First, note that for any ε > 0, (4.7) |P {X + Y ≤ t} − F (t)| ≤ |P {X + Y ≤ t, |Y | ≤ ε} − F (t)| + P {|Y | > ε}. As for the probability inside the absolute value above, we note that P {X + Y ≤ t, |Y | ≤ ε} ≥ P {X + ε ≤ t, |Y | ≤ ε} ≥ P {X + ε ≤ t} − P {|Y | > ε}. Also, observe that P {X + Y ≤ t, |Y | ≤ ε} ≤ P {X − ε ≤ t}. Hence |P {X + Y ≤ t, |Y | ≤ ε} − F (t)| ≤ max {|P {X + ε ≤ t} − P {|Y | > ε} − F (t)|, |P {X − ε ≤ t} − F (t)|} ≤ |P {X ≤ t} − F (t)| + sup f (z)ε + P {|Y | > ε}. z∈R 30 From (4.7), |P {X + Y ≤ t} − F (t)| ≤ |P {X ≤ t} − F (t)| + sup f (z)ε + 2P {|Y | > ε} z∈R ≤ |P {X ≤ t} − F (t)| + sup f (z)ε + 2ε−r E[|Y |r ]. z∈R By taking ε = (E[|Y |r ]/ supz∈R f (z))1/(1+r) , we obtain the desired result.  Proof of Theorem 3.2: We write ∆∗ (t; G) as    1 X ∗ (4.8) ≤ t|G − Φ(t) , P X + R i n   σn∗ ∗ i∈N n where Rn∗ ≡ 1 ∗ σn P Xi . By Lemma 4.3, the term (4.8) is bounded by (for any r > 0)   1 X  ∗ P (X − E[X |M ]) ≤ t|G − Φ(t) ∗ i i νn (i)  σn∗  ∗ i∈Nn \Nn∗ (4.9) i∈Nn + 3 φ(0)(E[|Rn∗ |r |G])1/r + ρ∗r r/(r+1) , where φ denotes the density of N (0, 1). By Lemma 2.2, {Xi }i∈Nn∗ is CND with respect to (νn∗ , M∗ ), we apply Theorem 3.1 to the leading term to obtain its bound as q q ∗ ∗ ∗ ∗3 ∗3 ∗4 ∗ ∗ ∗ ∗ ∗2 C n dmx dav µ3 − C log(n dmx dav µ3 ) n∗ d∗2 mx dav µ4 + rn for some constant C > 0. Now let us seek a desired bound for the second term on the right hand side of (4.9). We write X Xi X Rn∗ = = ξi , say. σn∗ ∗ ∗ i∈Nn \Nn i∈Nn \Nn Now, choose 1 ≤ r ≤ 4 and write    r r X X E ξi |G  ≤  (E[|ξi |r |G])1/r  ≤ (|Nn \ Nn∗ |µ̃∗r )r . i∈Nn \Nn∗ i∈Nn \Nn∗ Hence the last term in (4.9) is bounded by C(|Nn \ Nn∗ |µ̃∗r )r/(r+1) , delivering the desired result.  Lemma 4.4. Suppose that (D, d) is a given metric space and for each n ≥ 1, ξn , ζn , ζ are D-valued random variables. If for each ε > 0, P ∗ {d(ξn , ζn ) > ε} → 0 and ζn → ζ, G-stably, as n → ∞, then ξn → ζ, G-stably. 31 Proof: First note that ζn → ζ, G-stably if and only if for all event U ∈ G and any closed set F ∈ B(D), (4.10) limsupn→∞ P ∗ {ζn ∈ F } ∩ U ≤ P {ζ ∈ F } ∩ U. (This can be shown following the proof of Theorem 1.3.4 (iii) of van der Vaart and Wellner (1996).) Using this and following the same arguments in the proof of Lemma 1.10.2 of van der Vaart and Wellner (1996), we deduce the lemma.  ˜ n , ξn ), (ζn , ξ)) > Proof of Lemma 3.2: (i) Since P ∗ {d(ξn , ξ) > ε} → 0, we have P ∗ {d((ζ ˜ 1 , f2 ), (g1 , g2 )) = d(f1 , g1 ) + d(f2 , g2 ) ε} → 0, where d˜ is a metric on D × D defined as d((f for f1 , f2 , g1 , g2 ∈ D. Furthermore, note that (ζn , ξ) → (ζ, ξ), G-stably, because ζn → ζ, G-stably, and ξ is G-measurable. Now the desired result follows by Lemma 4.4. (ii) Note that ζn0 → ζ 0 , G-stably, if and only if for any event U ∈ G and any open set G ∈ B(D), (4.11) liminfn→∞ P∗ {ζn0 ∈ G} ∩ U ≥ P {ζ 0 ∈ G} ∩ U, where P∗ denotes the inner probability. Using this and following the same arguments in the proof of Theorem 3.27 of Kallenberg (1997) for the continuous mapping theorem for weak convergence, we can complete the proof of (ii).  For the proof of Theorem 3.3, we use the following lemma. Lemma 4.5. If f : D 7→ R is bounded and continuous, and K ⊂ D is compact, then for every  > 0 there exists τ > 0 such that, if x ∈ K and y ∈ D with kx − yk < τ , then |f (x) − f (y)| < . Proof of Theorem 3.3: First, let us suppose that (i) and (ii) hold. To see that the marginal P L of L is a tight Borel law, note that the stable finite dimensional convergence of ζn implies the convergence of the finite dimensional distributions of ζn . Combining this with the asymptotic ρ-equicontinuity and using Theorems 1.5.4 and 1.5.7 of van der Vaart and Wellner (1996), we obtain that P L is a tight Borel law. The fact that P L is concentrated on Uρ (H) follows from Theorem 10.2 of Pollard (1990). Now let us show the G-stable convergence of ζn . We follow the arguments in the proof of Theorem 2.1 of Wellner (2005). Let ζ ∈ Uρ (H) be a random element whose distribution is the same as P L. Since (H, ρ) is totally bounded, for every δ > 0 there exists a finite set of points Hδ that is δ-dense in H i.e. H ⊂ ∪h∈Hδ B (h, δ) where B (h, δ) is the open ball with center h and radius δ. Thus, for each h ∈ H, we can choose πδ (h) ∈ Hδ 32 such that ρ(πδ (h), h) < δ. Define ζn,δ (h) = ζn (πδ (h)) , and ζδ (h) = ζ(πδ (h)) for h ∈ H. By the G-stable convergence of the finite dimensional projection of ζn , we have for each U ∈ G and for each bounded and continuous functional f : `∞ (H) 7→ R, (4.12) E∗ [f (ζn,δ )1U ] → E [f (ζδ )1U ] . Furthermore, the a.e. uniform continuity of the sample paths of ζ implies that   (4.13) P lim sup |ζ(h) − ζδ (h)| = 0 = 1. δ→0 h∈H For each bounded and continuous functional f : `∞ (H) 7→ R, and for each U ∈ G such that P (U ) > 0, |E∗ [f (ζn )1U ] − E [f (ζ)1U ] | ≤ |E∗ [(f (ζn ) − f (ζn,δ ))1U ] | + |E [(f (ζn,δ ) − f (ζδ ))1U ] | + |E [(f (ζδ ) − f (ζ))1U ] |. The last two absolute values vanish as n → ∞ and then δ → 0 by (4.12) and by (4.13) combined with the Dominated Convergence Theorem. We use the asymptotic ρ-equicontinuity of ζn and Lemma 4.5 and the fact that P L is a tight law, and follow standard arguments to show that the leading difference vanishes as n → ∞ and then δ → 0. (See the proof of Theorem 2.1 of Wellner (2005) for details.) Since the G-stable convergence of ζn implies that of its finite dimensional distributions, and the weak convergence of ζn , the converse can be shown using the standard arguments. (Again, see the proof of Theorem 2.1 of Wellner (2005).)  Proof of Lemma 3.3: The proof follows that of Theorems 2.3 and 3.4 of Janson (2004). In particular (3.6) follows from Theorem 2.3. However, for (3.5), we need to modify the proof of Theorem 3.4 because σi2 ’s are not necessarily G-measurable, and hence the equations (3.9) and (3.10) on page 241 do not necessarily follow. First, without loss of generality, we set M = 1. Following the proof of Theorem 3.4 in Janson (2004) (see (3.7) there), we obtain that for any c ≥ 0, (4.14) E[exp(cXi )|Mνn (i) ] ≤ exp(σi2 g(c)), where g(c) = ec − 1 − c. Let Nj∗ ⊂ Nn , j = 1, ..., J be disjoint subsets which partition Nn such that for any i1 , i2 ∈ Nj∗ , i1 6= i2 , i1 ∈ / νn (i2 ) and i2 ∈ / νn (i1 ). Fix u ≥ 0, pj ≥ 0, j = PJ P 1, ..., J such that j=1 pj = 1 and wj ∈ [0, 1], j = 1, ..., J such that j∈Nn :i∈N ∗ wj = 1 for j all i ∈ Nn . Then using Lemma 4.1 and (4.14) and following the same argument in (3.8) 33 of Janson (2004), " E exp u ! X i∈Nn Xi # |G      Y wj u ≤ Xi |Mνn (i) |G  pj E  E exp p j ∗ j=1 i∈Nj       J X X wj u   |G ≤ pj E exp  σi2 g pj j=1 i∈Nj∗ " ! #  J X X w u j |G , ≤ pj E exp σi2 g p j j=1 i∈N J X  n because g(·) ≥ 0. The last term above is bounded by      J X wj u pj E exp (κn + Vn )g (4.15) |G pj j=1 where " ! κn = log E exp X σi2 − Vn # |G . i∈Nn As for κn , note that κn ≤ log E [exp (|Vn |) |G] = Vn , P because Vn is G-measurable. Let W = Jj=1 wj and take pj = wj /W to rewrite (4.15) as (4.16) E [exp ((κn + Vn )g (uW )) |G] . Hence we have for each t ≥ 0, ( ) X P Xi > t|G ≤ E [exp ((κn + Vn )g (uW ) − ut) |G] . i∈Nn If we take 1 u= log W  1 +1 (κn + Vn )W  and let ϕ(x) ≡ (1 + x) log(1 + x) − x, the last bound becomes      t t2 exp −(κn + Vn )ϕ ≤ exp − (κn + Vn )W 2W (W (κn + Vn ) + t/3)   t2 ≤ exp − , 2W (2W Vn + t/3) where the first inequality follows by the inequality: ϕ(x) ≥ x2 /(2(1+x/3)), x ≥ 0, and the last inequality follows by (4.16). Now, as in the proof of Theorem 2.3 of Janson (2004), 34 the rest of the proof can be proceeded by taking {(Nj∗ , wj )}Jj=1 as a minimal fractional proper cover of Nn .  Proof of Lemma 3.4: We adapt the proof of Theorem A.2 of van der Vaart (1996) to accommodate the CND property of {Yi }i∈Nn . Fix q0 so that 2−q0 ≤ ρ̄n (H) ≤ 2−q0 +1 N q Hqi such that and for each q ≥ q0 , construct a nested sequence of partitions H = ∪i=1 ! 1 X ∗ (4.17) E sup |h (Yj ) − g (Yj )|2 < 2−2q for every i = 1, ..., Nq . n j∈N h,g∈Hqi n By the definition of ρ̄n (h) and the bracketing entropy, Nq can be taken to satisfy log Nq ≤ q X  log 1 + N[] (2−r , H, ρ̄n ) . r=q0 Choose for each q a fixed element hqi from each Hqi and set πq h = hqi and 4q h = (suph,g∈Hqi |h − g|)∗ , whenever h ∈ Hqi , where (h)∗ defines the minimal measurable cover of h (Dudley (1985).) Then (ρ̄n (4q h))2 < 2−2q from (4.17), and πq h and 4q h run through a set of Nq functions as h runs through H. Define for each fixed n and q ≥ q0 , the following numbers and indicator functions: p αq = 2−q / log Nq+1 ,  √ √ Aq−1 h = 1 4q0 h ≤ nαq0 , ..., 4q−1 h ≤ nαq−1 ,  √ √ √ Bq h = 1 4q0 h ≤ nαq0 , ..., 4q−1 h ≤ nαq−1 , 4q h > nαq ,  √ Bq0 h = 1 4q0 h > nαq0 . Because the partitions are nested, Aq h and Bq h are constant in h on each of the partitioning sets Hqi at level q. Now decompose h = (h − πq0 h) + πq0 h ≡ I + II, say, with I ≡ h − πq0 h = (h − πq0 h). Then we can write I = (h − πq0 h) Bq0 h + ∞ X q=q0 +1 (h − πq h) Bq h + ∞ X q=q0 +1 ≡ Ia + Ib + Ic , say . We analyze the empirical process at each of Ia , Ib and Ic . (πq h − πq−1 h) Aq−1 h 35 Control of Ia : Let us bound E∗ [suph∈H |Gn ((h − πq0 h)Bq0 h)|] by E∗ 1 X (|h − πq0 h|Bq0 h)(Xi ) sup √ n i∈N h∈H n ! 1 X + sup √ E[(|h − πq0 h|Bq0 h)(Xi )|Mν(i) ] . n i∈N h∈H n √ √ Since |h − πq0 h|Bq0 h ≤ 2H1{2H > nαq0 } ≤ 4H 2 /( nαq0 ), we bound the last expression by  −1 p p 2 −q0 / ρ̄ (H) ≤ 8 2 8αq−1 log N 2−2q0 +2 ≤ 32 · 2−q0 log Nq0 +1 , n q0 +1 0 due to our choice of q0 satisfying that ρ̄n (H)2 ≤ 2−2q0 +2 . P Control of Ic : For Ic = ∞ q=q0 +1 (πq h − πq−1 h) Aq−1 h, there are at most Nq − 1 functions πq h − πq−1 h and at most Nq−1 − 1 functions Aq−1 h. Since the partitions are nested, the √ function |πq h − πq−1 h| Aq−1 h is bounded by 4q−1 hAq−1 h ≤ nαq−1 . Applying Corollary √ 3.2 (with J = nαq−1 and m = Nq − 1) to Gn (πq h − πq−1 h)Aq−1 h,   E max |Gn (πq h − πq−1 h) Aq−1 h||G h∈H ! r . (dmx + 1) αq−1 log Nq + (log Nq ) max Vn (hs ) 1≤s≤Nq −1 where {hs : s = 1, ..., Nq−1 } ≡ {(πq − πq−1 )hAq−1 h : h ∈ H}. From the law of the iterated conditional expectations and Jensen’s inequality, s !     ∞ X p E∗ sup |Gn Ic | . (dmx + 1) (log Nq )E∗ max Vn (hs ) + 2−q log Nq h∈H 1≤s≤Nq −1 q=q0 +1 . 2(dmx + 1) ∞ X 2−q p log Nq , q=q0 +1 where for the last inequality, we used (4.17) so that !!   X   1 (4.18) E∗ max Vn (hs ) ≤ E∗ max . 2−q+1 . E E[h2s (Yi ) |Mi ]|G 1≤s≤Nq −1 1≤s≤Nq −1 n i∈N n Control of Ib and II: The proof of these parts are the same as that of Theorem A.2 of van der Vaart (1996) except that we use ρ̄n (·) instead of k·kP,2 so that we have E∗ kGn Ib kH . p p P∞ −q log Nq and E∗ kGn IIkH . 2−q0 log Nq0 . q=q0 +1 2 36 Now collecting the results for Ia , Ib , Ic and II, we have   ∞ X p ∗ 2−q log Nq E sup |Gn (h)| . (dmx + 1) h∈H q=q0 +1 Z . (dmx + 1) ρ̄n (H) q 1 + log N[] (ε, H, ρ̄n )dε, 0 giving the required result.  Proof of Theorem 3.4: We prove conditions for Theorem 3.3. Let us first consider the convergence of finite dimensional distributions. Without loss of generality, we consider the CLT for Gn (h) for some h ∈ H such that V ar(Gn (h)|G) > 0, a.e.. Assumption 3.1 (a) together with the moment condition for the envelope H implies that dmx < C for all n ≥ 1 for some C > 0. We apply Theorem 3.1 to obtain the convergence of finite dimensional distributions. By the CND property of (Yi )i∈Nn and Assumption 3.1(b), Condition (i) in Theorem 3.3 is satisfied. Let us prove asymptotic ρ-equicontinuity (with ρ(h, h) ≡ ρ(h) ≡ limn→∞ ρ̄n (h).) Define Hn,δ ≡ {h − g : ρ̄n (h − g) ≤ δ, h, g ∈ H}. Then, by Lemma 3.4, # " Z δq ∗ E sup |Gn (h)| . (1 + dmx ) 1 + log N[] (ε, Hn,δ , ρ̄n )dε. h∈Hn,δ 0 By noting that Hn,δ is contained in H − H and by Assumption 3.1(a), the last bound vanishes as δ → 0 for each n ≥ 1. Thus the asymptotic ρ-equicontinuity follows, by the condition for ρ(h).  Proof of Theorem 3.5: By Assumption 3.2, we have   p n − n∗ ∗ ∗ 2 √ max E[H (Yi )] + E sup ρn (h) → 0, n i∈Nn h∈H as n → ∞. Hence the desired result follows applying Theorem 3.4 to G∗n in (3.7). References A LDOUS , D. J., AND G. K. E AGLESON (1978): “On Mixing and Stability of Limit Theorems,” Annals of Probability, 6, 325–331. A NDREWS , D. W. K. (1994): “Empirical Process Methods in Econometrics,” in Handbook of Econometrics, pp. 2247–2294. Elsevier. B ALDI , P., AND Y. R INOTT (1989): “On Normal Approximations of Distributions in Terms of Dependency Graphs,” Annals of Probability, 17, 1646–1650. 37 B ARAB ÁSI , A.-L., AND R. A LBERT (1999): “Emergence of Scaling in Random Networks,” Science, 286, 509–512. B ERTI , P., L. P RATELLI , AND P. R IGO (2012): “Limit Theorems for Empirical Processes Based on Dependent Data,” Electronic Journal of Probability, 9, 1–18. C AI , T. T., W. L IU , AND H. H. Z HOU (2016): “Estimating Sparse Precision Matrix: Optimal Rates of Convergence and Adaptive Estimation,” Annals of Statistics, 44, 455–488. C ANEN , N., J. S CHWARTZ , AND K. S ONG (2017): “Estimating Local Interactions Among Many Agents Who Observe Their Neighbors,” Working Paper. C HEN , L. H. Y., AND Q.-M. S HAO (2004): “Normal Approximation Under Local Dependence,” Annals of Probability, 32, 1985–2028. D AWID , P. A. (1979): “Conditional Independence in Statistical Theory,” Journal of the Royal Statistical Society, B, 41, 1–31. D UDLEY, R. M. (1985): “An Extended Wichura Theorem, Definitions of Donsker Class, and Weighted Empirical Distributions,” in Probability in Banach Spaces V, ed. by A. Beck, R. Dudley, M. Hahn, J. Kuelbs, and M. Marcus, pp. 141–178. Springer. H AHN , J., G. KUERSTEINER , AND M. M AZZOCCO (2016): “Central Limit Theory for Combined Cross-Section and Time Series,” arXiv:1610.01697 [stat.ME]. H ALL , P., AND C. C. H EYDE (1980): Martingale Limit Theory and Its Application. Academic Press, New York, USA. H ÄUSLER , E., AND H. L USCHGY (2010): Stable Convergence and Stable Limit Theorems. Springer Science+Business Media, New York, USA. I BRAGIMOV, L. A., AND Y. V. L INNIK (1971): Independent and Stationary Sequences of Random Variables. Wolters-Noordhoff, Groningen. JANSON , S. (1988): “Normal Convergence by Higher Semiinvariants With Applications to Sums of Dependent Random Variables and Random Graphs,” Annals of Probability, 16, 305–312. (2004): “Large Deviations for Sums of Partly Dependent Random Variables,” Random Structures and Algorithms, 24, 234–248. J ENISH , N., AND I. R. P RUCHA (2009): “Central Limit Theorems and Uniform Laws of Large Numbers for Arrays of Random Fields,” Journal of Econometrics, 150, 86–98. KALLENBERG, O. (1997): Foundations of Modern Probability. Springer, New York. KUERSTEINER , G. M., AND I. R. P RUCHA (2013): “Limit Theory for Panel Data Models with Cross Sectional Dependence and Sequential Exogeneity,” Journal of Econometrics, 174, 107–126. L AURITZEN , S. L. (1996): Graphical Models. Springer, New York. L AURITZEN , S. L., A. P. D AWID , B. N. L ARSEN , AND H.-G. L EIMER (1990): “Independence Properties of Directed Markov Fields,” Networks, 20, 491 – 505. 38 L EUNG, M. P. (2016): “Treatment and Spillover Effects under Network Interference,” Working Paper. M EINSHAUSEN , N., AND P. B ÜHLMANN (2008): “High-Dimensional Graphs and Variable Selection With the LASSO,” Annals of Statistics, 34(3), 1436–1462. P ENROSE , M. (2003): Random Geometric Graphs. Oxford University Press, Oxford, UK. P OLLARD , D. (1990): Empirical Processes: Theorey and Applications. NSF-CBMS Regional Conference Series in Probability and Statistics, Volume 2, Institute of Mathematical Statistics, Hayward, USA. R INOTT, Y., AND V. R OTAR (1996): “A Multivariate CLT for Local Dependence with n1/2 log n Rate and Applications to Multivariate Graph Related Statistics,” Journal of Multivariate Analysis, 56, 333–350. S ONG, K. (2015): “Measuring the Graph Concordance of Locally Dependent Observations,” arXiv:1504.03712v2 [stat.ME]. S TEIN , C. (1972): “A Bound for the Error in the Normal Approximation to the Distribution of a Sum of Dependent Random variables,” Proceedings in the Sixth Berkeley Symposium on Mathematical Statistics and Probability, 2, 583–602. T IKHOMIROV, A. N. (1980): “On the Convergence Rate in the Central Limit Theorem for Weakly Dependent Random Variables,” Theory of Probability and Its Applications, 25, 790–809. VAN DER VAART, A. W. (1996): “New Donsker Classes,” Annals of Statistics, 24, 2128– 2140. VAN DER VAART , A. W., AND J. A. W ELLNER (1996): Weak Convergence and Empirical Processes. Springer, New York, USA. W ELLNER , J. A. (2005): Empirical Processes: Theory and Applications. Special Topics Course Notes at Delft Technical University. W U, W. B. (2005): “Nonlinear System Theory: Another Look at Dependence,” Proceedings of National Academy of Science USA, 102, 14150–14154. Y UAN , D., AND L. M EI (2016): “Some Results Following from Conditional Characteristic functions,” Communications in Statistics - Theory and Methods, 45, 3706–3720.
10math.ST
Tight Lower Bounds for Planted Clique in the Degree-4 SOS Program arXiv:1507.05136v3 [cs.DS] 11 Mar 2016 Prasad Raghavendra ∗ Tselil Schramm† Abstract √ We give a lower bound of Ω̃( n) for the degree-4 Sum-of-Squares SDP relaxation for the planted clique problem. Specifically, we show that on an Erdös-Rényi graph G(n, 12 ), with high probability there is a feasible point for the degree-4 SOS relaxation of the clique problem with √ an objective value of Ω̃( n), so that the program cannot distinguish between a random graph √ and a random graph with a planted clique of size Õ( n). This bound is tight. We build on the works of Deshpande and Montanari and Meka et al., who give lower bounds of Ω̃(n1/3 ) and Ω̃(n1/4 ) respectively. We improve on their results by making a perturbation to the SDP solution proposed in their work, then showing that this perturbation remains PSD as the objective value approaches Ω̃(n1/2 ). In an independent work, Hopkins, Kothari and Potechin [HKP15] have obtained a similar lower bound for the degree-4 SOS relaxation. ∗ UC Berkeley, [email protected]. Supported by NSF Career Award, NSF CCF-1407779 and the Alfred. P. Sloan Fellowship. † UC Berkeley, [email protected]. Supported by an NSF Graduate Research Fellowship (NSF award no 1106400). 1 Introduction In the Maximum Clique problem, the input consists of a graph G = (V, E) and the goal is to find the largest subset S of vertices all of which are connected to each other. The Maximum Clique problem is NP-hard to approximate within a n1−ε -factor for all ε > 0 [Hås96, Kho01]. Karp [Kar76] suggested an average case version of the Maximum Clique problem on random graphs drawn from the Erdös-Rényi distribution G(n, 12 ). A heuristic argument shows that an Erdös-Rényi graph G ∼ G(n, 12 ) has a clique of size (1 − o(1)) log n with high probability: given such a graph, choose a random vertex, then choose one of its neighbors, then choose a vertex adjacent to both, and continue this process until there is no vertex adjacent to the clique. After log n steps, the probability that another vertex can be added is n1 , and so after about log n steps this process terminates. This heuristic argument can be made precise, and one can show that this greedy algorithm can find a clique of size (1 + o(1)) log n in an instance of G(n, 12 ) in polynomial time. Indeed, with some work it can be shown that the largest clique in an instance of G(n, 21 ) actually has size (2 ± o(1)) log n with high probability [GM75, Mat76, BE76]. But while some clique of size (1 ± o(1)) log n can easily be found in polynomial time (using the heuristic from the previous paragraph), an efficient algorithm for finding the clique of size 2 log n has been much more elusive. In his seminal paper on the probabilistic analysis of combinatorial algorithms, Karp asked whether there exists a polynomial-time algorithm for finding a clique of size (1 + ε) log n for any fixed constant ε > 0 [Kar76]. Despite extensive efforts, there has been no algorithmic progress on this question since. The planted clique problem is a natural variant of this problem wherein the input is promised to be either a graph drawn from G ∼ G(n, 12 ) or a graph G ∼ G(n, 12 ) with a clique of size k planted within its vertices. The goal of the algorithm is to distinguish between the two distributions. For k > (2 + ε) log n, there is a simple quasi-polynomial time algorithm that distinguishes the two distributions. The algorithm simply tries all subsets of (2 + ε) log n vertices, looking for a clique. For a random graph G(n, 21 ), there are no cliques of size (2 + ε) log n, but there is one in the planted distribution. Clearly, the planted clique problem becomes easier as the planted clique’s size √ k increases. Yet there are no polynomial-time algorithms known for this problem for any k < o( n). √ For k = Ω( n), a result of Alon et al. uses random matrix theory to argue that looking at the spectrum of the adjacency matrix suffices to solve the decision problem [AKS98]. The works of [FK08, BV09] show that, if one were able to efficiently calculate the injective tensor norm of a certain random order-m tensor, then by extending the spectral algorithm of [AKS98] one would have a polynomial-time algorithm for k > n1/m . However, there is no known algorithm that efficiently computes the injective tensor norm of an order-m tensor; in fact computing the inective tensor norm is hard to approximate in the general case [HM13]. While algorithmic progress has been slow, there has been success in proving strong lower bounds for the planted clique problem within specific algorithmic frameworks. The first such bound was given by Jerrum, who showed that a class of Markov Chain Monte Carlo algorithms require a superpolynomial number of steps to find a clique of size (1+ ε) log n, for any fixed ε > 0, in an instance of G(n, 21 ) [Jer92]. Feige and Krauthgamer showed that r-levels of the Lovász-Schriver SDP hierarchy √ are needed to find a hidden clique of size k ≥ Ω̃( n/2r ) [FK00, FK03]. Feldman et al. show (for the planted bipartite clique problem) that any “statistical algorithm” cannot distinguish in a √ polynomial number of queries between the random and planted cases for k < Õ( n) [FGR+ 12]. More recently, there has been an effort to replicate the results of [FK00, FK03] for the Sumof-Squares (or SOS) hierarchy, a more powerful SDP hierarchy. The recent work of [MPW15] achieves a Ω̃(n1/2r )-lower bound for r-rounds of the SOS hierarchy, by demonstrating a feasible 1 solution for the level-r SDP relaxation with a large enough objective value in the random case. The work of [DM15a] achieves a sharper Ω̃(n1/3 ) lower bound for the Meka-Potechin-Wigderson SDP solution, but only for r = 2 rounds; a counterexample of Kelner (which may be found in [Bar14]) demonstrates that the analysis of [DM15a] is tight for the integrality gap instance of [DM15a, MPW15] within logarithmic factors. This line of work brings to the fore the question: can a d = O(1)-degree SOS relaxation solve √ the planted clique problem for some k < n? While lower bounds are known for Lovász-Schrijver SDP relaxations for planted clique [FK00, FK03], SOS relaxations can in general be much more powerful than Lovász-Schrijver relaxations. For example, while there are instances of unique games that are hard for poly(log log n)-rounds of the Lovász-Schrijver SDP hierarchy [KS09, RS09], recent work has shown that these instances are solved by degree-8 SOS hierarchy [BBH+ 12]. Moreover, even the degree-4 SOS relaxation proves to be surprisingly powerful in a few applications: • First, the work of Barak et al. [BBH+ 12] shows that a degree 4 SOS relaxation can certify 2 − to − 4 hypercontractivity of low degree polynomials over the hypercube. This argument is the reason that hard instances for Lovász-Schriver and other SDP hierarchies constructed via the noisy hypercube gadgets are easily refuted by the SOS hierarchy. • Second, a degree-4 SOS relaxation can certify that the 2-to-4 norm of a random subspace of √ dimension at most o( n) is bounded by a constant (with high probability over the choice of the subspace) [BBH+ 12]. This average-case problem has superficial similarities to the planted clique problem. In this work, we make modest progress towards a lower bound for SOS relaxations of planted clique by obtaining a nearly tight lower bound for the degree-4 SOS relaxation (corresponding to two rounds, r = 2). More precisely, our main result is the following. Theorem 1.1. Suppose that G ∼ G(n, 21 ). Then with probability 1 − O(n−4 ), there exists a feasible solution to the SOS-SDP of degree d = 4 (r = 2) with objective value √ n 1 polylog n . Note that by the work of [AKS98], this result is tight up to logarithmic factors. In an independent work, Hopkins, Kothari and Potechin [HKP15] have obtained a similar result. Our work builds heavily on previous work by Meka, Potechin and Wigderson [MPW15] and Deshpande and Montanari [DM15a]. Since the SDP solution constructed in these works is infeasible √ for k > n1/3 , we introduce a modified SDP solution with objective value Ω̃( n), and prove that for a random graph G the solution is feasible with high probability. At the parameter setting for which the objective value becomes Ω(n1/3 ), the SDP solutions of [DM15a, MPW15] violate the PSDness constraint, or equivalently, there exists a set of test vectors X such that xT M x < 0 for all x ∈ X. Our feasible SDP solution is a perturbation of their solution–we add spectral mass to the solution along the vectors from the set X, then enforce the linear constraints of the SDP program. 1.1 Notation We use the symbol  to denote the PSD ordering on matrices, saying that A  0 if A is PSD and that A  B if A − B  0. When we wish to hide constant factors for clarity, we use a . b to denote that a ≤ C · b for some constant C. 1 We have made no effort to optimize logarithmic factors in this work; a more delicate analysis of the required logarithmic factors is certainly possible. 2 = 1 ∀i ∈ [n], or the all-1’s vector. We denote 1n ∈ Rn the vector such that 1n (i) def def def def the normalized version of this vector by 1̃n = 1n /k1n k. Further, we use Jn = 11⊤ and Qn = 1̃1̃⊤ . We denote by We will drop the subscript when n is clear from context. In our notation, we at times closely follow the notation of [DM15a], as our paper builds on their results and we recycle many of their bounds. n For convenience, we will use the shorthand n = n log n. We will abuse notation by using 2  to refer to both the binomial coefficient and to the set n2 = {(a, b) | a, b ∈ [n], a 6= b}. We will  S n also use the notation ≤k to refer to the union of sets ki=0 ni . Further, when we give a vector n v ∈ R( 2 ) , we will identify the entries of v by unordered pairs of elements of [n]. Throughout the paper, we will (unless otherwise stated) work with some fixed instance G of G(n, 21 ), and denote by Ai ∈ Rn the “centered” ith row of the adjacency matrix of G, with jth entry equal to 1 if the edge (i, j) ∈ E, equal to −1 if the edge (i, j) 6∈ E, and equal to 0 for j = i. We will use Aij to denote the jth index of Ai . 1.2 Organization In Section 2, we give background material on the degree-4 SOS relaxation for the max-clique problem, describe the integrality gap of Deshpande and Montanari for the planted clique problem, and √ explain the obstacle they face to reach an integrality gap value of Ω̃( n). We then describe our integrality gap instance, motivating our construction using the obstacle for the Deshpande-Montanari and Meka-Potechin-Wigderson witness, and give an overview of our proof that our integrality gap instance is feasible. In Section 3, we prove that our witness is PSD, completing the proof of feasibility. Section 4 contains our concentration bounds for random matrices that arise within our proofs. In our proof, we reuse several bounds proved by Deshpande and Montanari. As far as possible, we restate the claims from [DM15a] as they are used; for convenience, in Appendix A, we list a few other claims from Deshpande and Montanari that we use in this paper. 2 Preliminaries and Proof Overview In this section, we describe the degree-4 SOS relaxation for the max-clique SDP and give background on the Deshpande-Montanari witness. We then describe our own modified witness, and give an overview of the proof that our witness is feasible (the difficult part being showing that our witness is PSD). The full proof of feasibility is deferred to Section 3. 2.1 Degree-4 SOS Relaxation for Max Clique The degree d = 4 SOS relaxation for the maximum clique problem is a semidefinite program whose n × n variables are X ∈ R(≤2) (≤2) . For a subset S ⊆ V with |S| ≤ 2, the variable XS indicates whether S is contained in the maximum clique. For a graph G on n vertices, the program can be described as follows. X Maximize X{i},{i} (2.1) i∈[n]   n ≤2 whenever S1 ∪ S2 = S3 ∪ S4 subject to XS1 ,S2 ∈ [0, 1] ∀S1 , S2 ∈ XS1 ,S2 = XS3 ,S4 if S1 ∪ S2 is not a clique in G XS1 ,S2 = 0 3 X∅,∅ = 1 X0 It is instructive to think of the variable XS as a pseudoexpectation of the product of indicator variables, or a pseudomoment: # " Y I(i ∈ clique) . XS = Ẽ i∈S Intuitively, the constraints of the SDP force the solution to behave somewhat like the moments of a probability distribution over integral solutions, although they needn’t correspond to the moments of a true distribution, hence the term pseudomoment. For more background, see e.g. [Bar14]. The pseudmoment interpretation of the SDP solution motivates the choice of the witness in the prior work. For example, we may notice that the objective function in this view is simply the P pseudoexpectation of the size of the planted clique, Ẽ[ i∈[n] I(i ∈ clique)]. If sdpval(G, 4) denotes the optimum value of the SDP relaxation on graph G, then clearly sdpval(G) is at least the size of the maximum clique in G. In order to prove a lower bound for degree 4 SOS relaxation on G(n, 12 ), it is sufficient to argue that with overwhelming probability, sdpval(G) is significantly larger than the maximum clique on a random graph. This amounts to exhibiting a feasible SDP solution with large objective value, for an overwhelming fraction of graphs sampled from G(n, 12 ). Formally, we will show the following: Theorem 2.1 (Formal version of Theorem 1.1). There exists an absolute constant c ∈ N such that  √  n P ≥ 1 − O(n−4 ) sdpval(G) ≥ c 1 log n G∼G(n, 2 ) We obtain Theorem 2.1 by constructing a point, or witness, for each G ∼ G(n, 12 ), then proving that the point is feasible with high probability. We defer the description of our witness to Definition 2.8 and Definition 2.9, as we spend Section 2.2 and Section 2.3 motivating our construction; however the curious reader may skip ahead to Definition 2.9 which does not require the knowledge of additional notation. 2.2 Deshpande-Montanari Witness Henceforth, fix a graph G that is sampled from G(n, 21 ). Both the work of Meka, Potechin and Wigderson [MPW15] and that of Deshpande and Montanari [DM15a] construct essentially the same SDP solution for the degree-4 SOS relaxation. This SDP solution assigns to each clique of size 1, . . . , d, a value that depends only on its size (in our case, d = 4). In essence, their solution takes advantage of the independence of the G(n, p) instance. The motivating observation is that the variable XS can be thought of as a pseudoexpectation of the indicator that S is a subclique of the planted clique. The idea is then to make this pseudoexpectation of the indicator consistent with the true expectation under the distribution where a clique of size k is planted uniformly at random within the instance of G(n, p). Thus, every vertex is in the clique “with uniform probability:” k . n Then, the same principle is applied to edges, traingles, and 4-cliques, so that  k Ẽ[X{i} ] ≈ E[I(i is in planted clique)] = Ẽ[XS ] ≈ I(S is clique) · E[I(S is in planted clique)] = 4 |S| n |S| · 1 2 (|S|) 2 . This is the general idea of the SDP solution of [DM15a]. More formally, the SDP solution in [DM15a] is specified by four parameters α = {αi }4i=1 as, M (G, α) = α|A∪B| · GA∪B , where for a set of vertices A ⊆ V , GA is the indicator that the subgraph induced on A is a clique. The parameters {αi }i∈[4] determine the value of the objective function, and the feasibility of the solution. As a convention, we will define α0 = 1. It is easy to check that the solution M (G, α) satisfies all the linear constraints of the SOS program (2.1), since it assigns non-zero values only to cliques in G. The key difficulty is in showing that the matrix M is PSD for an appropriate choice of parameters α. In order to show that M (G, α)  0, it is sufficient to show that N (G, α)  0 where, Y NA,B = α|A∪B| · Gij , i∈A\B,j∈B\A where Gij is the indicator for the presence of the edge (i, j). In words, N is the matrix where the entry {a, b, c, d} is proportional not to the indicator of whether {a, b, c, d} is a clique, but to the indicator of whether G has as a subgraph the bipartite clique with bipartitions {a, b} and {c, d}. It is easy to see that  the matrix M is obtained by dropping from N the rows and columns corresponding {a, b} ∈ n2 where (a, b) ∈ / E(G). Hence N  0 =⇒ M  0. Notice that N is a random matrix whose entries depend on the edges in the random graph G. At the risk of over-simplification, the approach of both the previous works [MPW15] and [DM15a] can be broadly summarized as follows: 1. (Expectation) Show that the expected matrix E[N ] has sufficiently large positive eigenvalues. 2. (Concentration) Show that with high probability over the choice of G, the noise matrix N − E[N ] has bounded eigenvalues, so as to ensure that N = E[N ] + (N − E[N ])  0 n n Here we will sketch a few key details of the argument in [DM15a]. The matrix N ∈ R(≤2)×(≤2) n n can be decomposed into blocks {Nab }a,b∈{0,1,2} where Na,b ∈ R( a)×( b ) . Deshpande and Montanari use the Schur complements to reduce the problem of proving that N  0 to facts about the blocks {Nab }a,b∈{0,1,2} . Specifically, they show the following lemma: n × n Lemma 2.2. Let A ∈ R(≤2) (≤2) be the matrix defined so that AA,B = α|A| α|B| . For a, b ∈ {0, 1, 2}, let Ha,b be the submatrix of N (G, α) − A corresponding to monomials XS with |S| = a + b. Then N (G, α) is PSD if and only if H22 − H11 −1 T H12 H11 H12  0, 0 (2.2) (2.3) The most significant challenge is to argue that (2.3) holds with high probability. In fact, the inequality only holds for the Deshpande-Montanari SDP solution with high probability for parameters α for which the objective value is o(n1/3 ). Expected matrix. The expected matrix E[H22 ] is symmetric with respect to permutations of the vertices. It forms an association scheme (see [MPW15, DM15a]), by virtue of which its eigenvalues and eigenspaces are well understood. In particular, the following proposition in [DM15a] is an immediate consequence of the theory of association schemes. 5 Proposition 2.3 (Proposition 4.16 in [DM15a]). E[H22 ] has three eigenspaces, V0 , V1 , V2 such that E[H22 ] = λ0 Π0 + λ1 Π1 + λ2 Π2 , where Π0 , Π1 , Π2 are the projections to the spaces V0 , V1 , V2 respectively. The eigenvalues are given by, (n − 2)(n − 3) n(n − 1) 2 · α4 − α2 32 2 (n − 4) (n − 3) def λ1 (α) = α2 + α3 − α4 2 16 α4 def λ2 (α) = α2 − α3 + 16 def λ0 (α) = α2 + (n − 2)α3 + (2.4) (2.5) (2.6) Further the eigenspaces are given by, V0 = span{1}, and V1 = span{u | hu, 1i = 0, ui,j = xi + xj for x ∈ Rn }, n V = R(≤2) \ (V ∪ V ) , 2 0 1 n where we have used R(≤2) to denote the space of vectors of real numbers indexed by subsets of n of size at most 2. Deviation from Expectation. Given the lower bound on eigenvalues of the expected matrix E[H22 ], the next step would be to bound the spectral norm of the noise H22 − E[H22 ]. However, since the eigenspaces of E[H22 ] are stratified (for the given α), with one large eigenvalue and several much smaller eigenvalues, standard matrix concentration does not suffice to give tight bounds. To T H −1 H along the eigenspaces of E[H ]. overcome this, Deshpande and Montanari split H22 and H12 12 22 11 More precisely, let us split H22 − E[H22 ] as H22 − E[H22 ] = Q + K where Q includes all multilinear entries, and K includes all non-multilinear entries, i.e., entries K(A, B) where A ∩ B 6= ∅. Formally, ( H22 (A, B) − E[H22 ](A, B) if A ∩ B = ∅ . Q(A, B) = 0 otherwise The spectral norm of the matrix Q over the eigenspaces V0 , V1 , V2 is carefully bounded in [DM15a]. Lemma 2.4. (Proposition 4.20, 4.25 in [DM15a]) With probability at least 1 − O(n−4 ), all of the following bounds hold: kΠa QΠb k . α4 n3/2 ∀(a, b) ∈ {0, 1, 2}2 kΠ2 QΠ2 k . α4 n 1/2 kKk . α3 n (2.7) (2.8) (2.9) 6 Proposition 2.3 and Lemma 2.4 are sufficient to conclude that H22  0 for parameter choices of α that correspond to planted clique of size up to ω(n1/3 ). More precisely, to argue that with high probability H22  0, it is sufficient to argue that, E[H22 ]  E[H22 ] − H22 , i.e.,     λ0 0 0 kΠ0 QΠ0 k kΠ0 QΠ1 k kΠ0 QΠ2 k  0 λ1 0   kΠ1 QΠ0 k kΠ1 QΠ1 k kΠ1 QΠ2 k + α3 n1/2 · Id .2 0 0 λ2 kΠ2 QΠ0 k kΠ2 QΠ1 k kΠ2 QΠ2 k Deshpande and Montanari fix α1 = κ, α2 = 4κ2 , α3 = 8κ3 and α4 = 512κ4 for a parameter κ. Using Proposition 2.3 and Lemma 2.4, the above matrix inequality becomes,  2 4   3/2  n n3/2 n3/2 n κ 0 0  0 nκ3 0   κ4 n3/2 n3/2 n3/2  , (2.10) 2 3/2 3/2 0 0 κ n n n which can be shown to hold for κ ≪ n−2/3 . Eventually, it is necessary to show (2.3), which is −1 stronger than H22  0. This is again achieved by showing bounds on the spectra of H11 and H12 . We refer the reader to [DM15a] for more details of the arguments. 2.3 Problematic Subspace The SDP solution described above ceases to be PSD at κ ≃ n−2/3 which corresponds to an objective value of O(n1/3 ). The specific obstruction to H22  0 arises out of (2.10). More precisely, the bottom 2 × 2 principal minor which yields the constraint,     λ1 kΠ1 QΠ2 k nκ3 −n3/2 κ4 0 ≈ kΠ2 QΠ1 k λ2 −n3/2 κ4 κ2 n forcing κ ≪ n−2/3 . It is clear that the problematic vectors x ∈ R( 2 ) for which xT H22 x < 0 are precisely those for which xT Π2 QΠ1 x < 0 and |xT Π2 QΠ1 x| is large, i.e., Π2 x aligns with the subspace Q(V1 ⊕ V0 ). In fact, we identify a specific subspace W that is problematic for the [DM15a] solution. To describe the subspace, let us fix some notation. Define the random variable Aij to be −1 if (i, j) 6∈ E, and +1 otherwise. We follow the convention that Aii = 0. n def Lemma 2.5. Let the vectors a1 , . . . , an ∈ R( 2 ) be defined so that ai (k, ℓ) = Aik Aiℓ , and let def W = span{a1 , . . . , an }. Then with probability at least 1 − O(n−4 ), kΠ2 Q − Π2 ΠW Qk . α4 n Proof. This is an immediate observation from the various matrix norm bounds in [DM15a] (specifically Lemma A.2, Lemma A.3 and Observation A.5). We defer the detailed proof to Appendix A.1. Since kΠ2 QΠ1 k ≫ α4 n, the above lemma implies that all the vectors with large singular values for Q are within the subspace W . Furthermore, we will show the following lemma which clearly articulates that W is the sole obstruction to H22  0. n Here, we have identified the matrices E[H22 ] and E[H22 ] − H22 , which are matrices in R(≤2) , with the 3 × 3 matrices corresponding to diagonalizing E[H22 ] according to the three eigenspaces V0 , V1 , V2 of the expectation E[H22 ]. This is analagous to decomposing any quadratic form v ⊤ H22 v into v ⊤ (Π0 + Π1 + Π2 )H22 (Π0 + Π1 + Π2 )v. 2 7 Lemma 2.6. Suppose α ∈ R4+ satisfies min(λ0 (α), λ1 (α), λ2 (α)) ≫ α3 n1/2 , λ0 (α) > λ1 (α) ≫ α4 n 3/2 , λ2 (α) ≫ α4 n (2.11) (2.12) (2.13) then with probability 1 − O(n−4 ), H22  Proof. Fix θ = 16kQk2 λ1 . 16kQk2 1 · E[H22 ] − · Π2 ΠW Π2 . 4 λ1 Recall that H22 − E[H22 ] = Q + K. We can write the matrix H22 + θ · Π2 ΠW Π2 = BW ⊥ + BW + BK + 1 E[H22 ] , 4 where BW ⊥ and   Π0 QΠ0 Π0 QΠ1 Π0 Q(I − ΠW )Π2 1 = E[H22 ] +  Π1 QΠ0 Π1 QΠ1 Π1 Q(I − ΠW )Π2  3 4 Π2 (I − ΠW )QΠ0 Π2 (I − ΠW )QΠ1 Π2 QΠ2 BW  1 = E[H22 ] +  4 0 0 0 0 Π2 ΠW QΠ0 Π2 ΠW QΠ1  Π0 QΠW Π2 Π1 QΠW Π2  θ · Π2 ΠW Π2 and BK = K + 41 E[H22 ]. It is sufficient to show that BW ⊥ , BW and BK  0. Using Proposition 2.3 and (2.9), BK  (λ0 − α3 n1/2 )Π0 + (λ1 − α3 n1/2 )Π1 + (λ2 − α3 n1/2 )Π2  0 when condidition (2.11) holds. Using Proposition 2.3, Lemma 2.4 and Lemma 2.5 we can write, BW ⊥   3/2   λ 0 0 n n3/2 n 1  0  · 0 λ1 0  − α4 · n3/2 n3/2 n 4 0 0 λ2 n n n which is PSD given the bounds on λ1 , λ2 , λ3 in conditions (2.12) and (2.13). To see this, one shows that all the 2 × 2 principal minors are PSD. n On the other hand, for any x ∈ R( 2 ) , we can write θ xT BW x ≥ λ0 kΠ0 xk2 + kΠW Π2 xk2 − 2kQkkΠW Π2 xkkΠ0 xk 2 θ + λ1 kΠ1 xk2 + kΠW Π2 xk2 − 2kQkkΠW Π2 xkkΠ1 xk 2 Now we will appeal to the fact that a quadratic r(p, q) = ap2 + 2bpq + cq 2 ≥ 0 for all p, q ∈ R if b2 < 4ac and a > 0. Since θλ1 , θλ0 ≥ 16kQk2 by condition (2.12), it is easily seen that the above quadratic form is always non-negative, implying that BW  0. 3 Here again we diagonalize according to the subspaces V0 , V1 , V2 , as in (2.10) 8 An immediate corollary of the proof of the above lemma is the following. Corollary 2.7. Under the hypothesis of Lemma 2.6, with probability 1 − O(n−4 ), H22 − K  1 16kQk2 · E[H22 ] − · Π2 ΠW Π2 . 2 λ1 The above corollary is a consequence of the fact that H22 − K = BW + BW ⊥ + 12 E[H22 ]. 2.4 The Corrected Witness Suppose we have an unconstrained matrix M that we wish to modify as little as possible so as to ensure M  0. Given a test vector w so that wT M w < 0, the natural update to make is to take M ′ = M + β · wwT forPa suitably chosen β. This would suggest creating a new SDP solution by T ′ =H +β setting H22 22 i∈[n] ai ai . Unfortunately, the SOS SDP relaxation has certain hard constraints, namely that the non-clique entries are fixed at zero. Moreover, the entry XS1 ,S2 must depend only on S1 ∪ S2 . Setting the SDP P solution matrix to H22 + β i∈[n] ai aTi would almost certainly violate both these constraints. It is thus natural to consider multiplicative updates to the entries of the matrix which clearly preserve the zero entries of the matrix. Specifically, the idea would be to consider an update of the form M ′ = M + βDw M Dw where Dw is the diagonal matrix with entries given by the vector w. If the matrix M has a significantly large eigenvalue along 1, i.e., M  λ0 · 1̃1̃⊤ + ∆, for some matrix ∆ with k∆k ≪ λ1 , then this multiplicative update has a similar effect as an additive update, M ′  M + β · λ0 · wwT + βDw ∆Dw , where the norm of the final “error” term βDw ∆Dw is relatively small. Recall that, in our setting, the Deshpande Montanari SDP solution matrix N does have a large eigenvalue along 1̃. We now formally describe our SDP solution, first as a matrix according to the intuition given above, and then as a set of pseudomoments. n Definition 2.8 (Corrected SDP Witness, matrix view). Let â1 , . . . , ân ∈ R(≤2) be defined so that ( 0 |A| < 2 âi (A) = ai (A) |A| = 2. n Define D̂i ∈ R(≤2) to be the diagonal matrix with âi on the diagonal. Define K̂ to be the restriction of N (G, α) to the non-multilinear entries. Also let   X N ′ (G, α) = N (G, α) + β · D̂i N (G, α) − K̂ D̂i , i∈[n] where β = √1 . 100 n log n Then our SDP witness is the matrix M ′ , defined so that   M ′ (G, α) = P N ′ (G, α) , where P is the projection that zeros out rows and columns corresponding to pairs (i, j) 6∈ E. 9 Definition 2.9 (Corrected SDP Witness, pseudomoments view). Let β = √1 , 100 n log n and let R4+ α ∈ be a set of parameters, to be fixed later. For a subset S ⊆ [n], let G[S] be the graph induced on G by S. For any subset of at most 4 vertices S ⊂ [n], |S| ≤ 4, we define   n P κ #{edges from v to S in G} |S| = 4 and G[S] = clique,  v∈[n] (−1) 4 +β c4 (α) · 4   κ n Ẽ[XS ](G, α) = c|S| (α) · |S| |S| ≤ 3 and G[S] = clique, |S|   0 otherwise , where c|S| (α) is some factor chosen for each |S| ∈ {0, . . . , 4} depending on the choice of α, which we will set later to ensure that the final moments matrix is PSD. Proposition 2.10. For β = 100√1n log n , and α4 ≤ 21 , with probability at least 1 − O(n−5 ), the solution N ′ (G, α) does not violate any of the linear constraints of the planted clique SDP. Proof. First, M ′ (S1 , S2 ) = M (S1 , S2 ) whenever |S1 ∪ S2 | < 4 so these entries satisfy the constraints of the SDP. If |S1 ∪ S2 | = 4 then M ′ (S1 , S2 ) is given by,   X Y Aij  . M ′ (S1 , S2 ) = α4 · I[S1 ∪ S2 is a clique] · 1 + β i∈[n] j∈S1 ∪S2 M ′ (S Notice P that Q 1 , S2 ) is non-zero only if S1 ∪ S2 is a clique, and it depends only on S1 ∪ S2 . Moreover, i∈[n] j∈S1 ∪S2 Aij is a sum over iid mean 0 random variables and therefore satisfies,     X Y √ Aij ≤ 100 n log n ≥ 1 − O(n−10 ) . P   i∈[n] j∈S1 ∪S2 A simple union bound over all subsets S1 ∪ S2 ∈ with probability at least 1 − O(n−5 ). n 4  shows that M ′ (S1 , S2 ) ∈ [0, 1] for all of them It now remains to verify that N ′ (G, α)  0. We will do this by verifying the Schur complement conditions, as in [DM15a]. Analogous to the submatrix H22 , one can consider the corresponding ′ of N ′ . The expression for H ′ is as follows: submatrix H22 X ′ def 1 2 H22 = H22 + Di (H22 + 16 α2 J(n) − K)Di , 2 i∈[n] Here Di is the matrix with ai on the diagonal, and K is the matrix corresponding to the nonmultilinear entries (entries corresponding to monomials like x2a xb xc ), and J(n) is the all-1s matrix. 2 ′  H ⊤ H −1 H The matrices H12 and H11 are unchanged, and so we must simply verify that H22 12 12 11 ′  0. and that H22 This concludes our proof overview. In Section 3, we verify the Schur complement conditions and prove our main result, and in Section 4 we give the random matrix concentration results upon which we rely throughout the proof. 3 Proof of the Main Result ′  0, and that H ′  H ⊤ H −1 H . This will allow us In this section, we will demonstrate that H22 12 22 12 11 to conclude that our solution matrix is PSD, and therefore is a feasible point for the degree-4 SOS relaxation. 10 Parameters. Before we proceed further, it will be convenient to parametrize the choice of α1 , α2 , α3 and α4 . In particular, it will be useful to fix, def α1 = ρ def n1/2 α2 = γρ2 n def α3 = γ 3 ρ3 n3/2 def α4 = γ 6 ρ4 . n2 (3.1) for two parameters γ, ρ, which we will finally fix to γ = log4 n and ρ = log−20 n. For this setting of parameters, the eigenvalues λ0 , λ1 , λ2 from Proposition 2.3 are bounded by, λ0 ≥ α4 n2 γ 6 ρ4 = 64 64 λ1 ≥ α3 n γ 3 ρ3 = 1/2 4 4n λ2 ≥ def α2 γρ2 = 2 2n def (3.2) def When convenient, we will also use the shorthand c1 = n1/2 α1 , c2 = nα2 , c3 = n3/2 α3 , and def c4 = n2 α4 . 3.1 ′ Proving that H22 0 Here we will make a first step towards verifying the Schur complement conditions of Lemma 2.2 by ′  0. Specifically, we will show the following stronger claim. showing that H22 Theorem 3.1. For β = at least 1 − O(n−4 ), √1 100 n log n and γ = log4 n, ρ < log−20 n, the following holds with probability ′ H22  Proof. Fix θ = kQk2 λ1 . βλ0 1 E[H22 ] + · ΠW 8 16 ′ , we have By definition of H22 X ′ H22 = H22 + β · Di (H22 + i∈[n] − K)Di . T i∈[n] ai ai . We can apply Lemma 2.6 to the H22 term and Corollary 2.7 for H22 − K,   X 1 1 2 1  E[H22 ] − θ · Π2 ΠW Π2 + β · Di E[H22 ] − θΠ2 ΠW Π2 + α2 J Di . 4 2 16 i∈[n]   X 1 λ0  E[H22 ] − θ · Π2 ΠW Π2 + β · (dropping Π1 , Π2 , J) Di Π0 − θΠ2 ΠW Π2 Di . 4 2 i∈[n]   X n λ0 1 T Di Π2 ΠW Π2 Di (usingDi Π0 Di = ai ai / )  E[H22 ] − θ · Π2 ΠW Π2 + β 2 PW − βθ 2 4 4n Define PW = ′ H22 P 1 2 16 α2 J i∈[n] Now we will appeal to a few matrix concentration bounds that we show in Section 4. First, with probability 1 − O(n−5 ), the vectors {a⊗2 i } are nearly orthogonal, and therefore form a wellconditioned basis for the subspace W . PW  n2 · ΠW . 2 (see Lemma 4.3) . Also, the vectors {a⊗2 i } have negligible projection on to the eigenspaces V0 , V1 which implies that with overwhelming probability, kΠ2 ΠW Π2 − ΠW k ≤ log2 n · Id , n 11 (see Lemma 4.5) . Finally, W is an n dimensional space. Each Di Π2 ΠW Π2 Di has only n non-zero singular values each of which is O(1). Moreover, multiplying on the left and right by DP i acts as a random linear transformation/ random change of basis. Intuitively, this suggests that i Di Π2 ΠW Π2 Di has n2 eigenvalues all of which are roughly O(1). In fact, with probability 1 − O(n−5 ), X Di Π2 ΠW Π2 Di  O(n) · Π0 + log2 n · Id (see Lemma 4.6) i Substituting these bounds we get,     βλ0 θ log2 n 1 2 ′ − θ · ΠW − + βθ log n · Id − βθ · O(n) · Π0 H  E[H22 ] + 4 8 n By Lemma 2.4, with probability at least 1 − O(n−4 ), kQk . α4 n3/2 . Substituting this bound for 2 θ = kQk λ1 along with (3.2), finishes the proof for our choice of parameters. The details are presented below for completeness. √ α24 n3 n log n θ . · = log4 n · γ 3 ρ ≪ 1 , βλ0 α3 n α4 n2 βθn 1 1 α2 n3 .√ . log2 n · γ 3 ρ ≪ 1 · 4 ·n· λ0 α4 n2 n log n α3 n Clearly λ0 > λ1 > λ2 and because 3.2 log2 n λ2 ≫ 100θ β log n + n  2  , θβ log2 n α2 n3 1 log2 n . 4 ·√ = log4 n · γ 8 ρ3 ≪ 1 . · λ2 α3 n α2 n log n Bounding singular values of H12 T H −1 H , Deshpande and Montanari [DM15a] observe the Towards bounding the eigenvalues of H21 12 11 following properties of H21 with regards to the spaces V0 , V1 and V2 . Lemma 3.2 (Consequence of Propositions 4.18 and 4.27 in [DM15a]). Let Qn ∈ Rn×n be the orthogonal projector to the space spanned by 1n . Let p = 21 . For the matrix H21 , we have that for sufficiently large n, with probability 1 − O(n−5 ), k E[H21 ] − H21 k ≤ α3 n , and kΠ0 E[H21 ]Qn k ≤ 14 n3/2 α3 + 2α2 n1/2 Π1 E[H21 ]Qn = 0 Π0 E[H21 ]Q⊥ n =0 1/2 kΠ1 E[H21 ]Q⊥ n k ≤ α2 n Π2 E[H21 ]Q⊥ n = 0. Π2 E[H21 ]Qn = 0 Unfortunately, the bound of [DM15a] on kE[H21 ] − H21 k is insufficient for our purposes, and we require a more fine-grained bound on the deviation from expectation. In fact, outside the problematic subspace W , we show that H21 − E[H21 ] is much better behaved. 12 Proposition 3.3. Let W = spani∈[n] {ai }, and let ΠW be the projector to that space. With proban bility at least 1 − O(n−4 ), the following holds for every x ∈ R( 2 )   log2 n 2 2 T 2 2 2 kxk kx Π2 (H21 − E[H21 ])k . α3 n kΠW xk + n Proof. From Lemma 3.2, we have that Π2 E[H21 ] = 0. Thus we may work exclusively with the difference from the expectation; for convenience, we let U = H21 − E[H21 ]. Fix A = {a, b} and c, so that |{a, b}| = 2. By inspection, the entry (A, c) of U is given by the polynomial α3 UA,c = (Aac Abc + (Aac + Abc )). 4 Thus, the columns of U are in W ∪ V1 . So we have that Π2 U = Π2 (ΠW + ΠV1 \W + Π⊥ W ∪V1 )U = Π2 ΠW U + Π2 ΠV1 \W U + Π⊥ W ∪V1 U = Π2 ΠW U, where the latter two terms were eliminated because V1 ⊥ V2 and W ∪ V1 ⊥ span{col(U )}. 2 In Lemma 4.5, we bound kΠ01 ΠW Π01 k ≤ O( logn n ). So we have that kxT Π2 ΠW k2 ≤ xT (Id − Π01 )ΠW (Id − Π01 )x = kΠW xk2 − 2xT Π01 ΠW x + xT Π01 ΠW Π01 x ≤ kΠW xk2 + 2kΠW xkkΠ01 ΠW xk + kxk2 kΠ01 ΠW Π01 k . 2kΠW xk2 + 2 log2 n · kxk2 , n where we have applied the inequality a2 + b2 ≥ 2ab. The conclusion follows by noting that kxT Π2 H21 k = kxT Π2 ΠW U k ≤ kxT Π2 ΠW k · kU k, and that by Lemma 3.2 kU k . α3 n. 3.3 −1 T Bounding singluar values of H12 H11 H12 −1 ′ , by splitting the matrix up according to the We will bound H21 H11 H12 , as in our bounds on H22 eigenspaces Π0 , Π1 , Π2 . Theorem 3.4. Let c1 , . . . , c4 be as defined in (3.1). For the choice of α in (3.1), we have that with probability 1 − O(n−5 ), T −1 H12 H11 H12  c2 + c23 log2 n c23 c3 log4 n c23 log2 n · Π0 + 2 · Π + Π + · ΠW 1 2 c2 c1 n1/2 c1 n3/2 c1 n1/2 Proof. For each a, b ∈ {0, 12}, define the matrix Uab = Πa (E[H21 ] − H21 )Πb . We can verify that for our choice of α the conditions of Lemma A.7 are met, and so we conclude that with probability 1 − O(n−5 ), 1 1 −1 H11  · Q⊥ · Qn + n 2 α1 n(α2 − 2α1 ) n For x ∈ R( 2 ) , let yU = (E[H12 ] − H12 )Π2 x, zU = (E[H12 ] − H12 )(Π0 + Π1 )x, xA = E[H12 ]Π0 x, xB = E[H12 ]Π1 x and xC = E[H12 ]Π2 x. In order to simplify our computations, we will use the following observation. 13 Observation 3.5. Given A ∈ Rm×m with A  0 and vectors x1 , . . . , xt ∈ Rm ,  T   X X X  xi  A  xi  ≤ t · xTi Axi i∈[t] i∈[t] i∈[t] Proof. If we set yi = A1/2 xi then the inequality reduces to, X X k yi k2 ≤ t kyi k2 , i∈[t] i∈[t] which is an immediate consequence of triangle inequality for k·k and Cauchy-Schwartz inequality. Using Observation 3.5,  −1 −1 −1 −1 −1 −1 T xT H12 H11 H12 x ≤ 5 xTA H11 xA + xTB H11 xB + xTC H11 xC + yUT H11 yU + zUT H11 zU . √ To simplify the calculations and make the dominant terms apparent, let us fix α1 = c1 / n, α2 = c2 /n, α3 = c3 /n3/2 and α4 = c4 /n wherein each ci ∈ [1/ log 200 n, 1]. First, observe that 1 1 α1 ≫ n(α −2α2 ) for this setting of parameters. 2 1 −1 −1 −1 For the terms xTA H11 xA , xTB H11 xB and xTC H11 xC we can write,   1 1 ⊥ 2 2 T −1 2 · kΠ0 E[H21 ]Qn k · kΠ0 E[H21 ]Qn k + xA H11 xA . kΠ0 xk α1 n(α2 − 2α21 ) c2 (α2 + α3 n)2 · kΠ0 xk2 . 3 kΠ0 xk2 . 2 c2 (α2 − 2α1 )   1 1 2 ⊥ 2 T −1 2 · kΠ1 E[H21 ]Qn k + · kΠ1 E[H21 ]Qn k xB H11 xB . kΠ1 xk α1 n(α2 − 2α21 ) c22 α22 n kΠ1 xk2 . · kΠ1 xk2 α1 c1 n1/2   1 1 −1 2 T 2 ⊥ 2 · kΠ2 E[H21 ]Qn k + xC H11 xC . kΠ2 xk · kΠ2 E[H21 ]Qn k α1 n(α2 − 2α21 ) . =0  1 1 2 · kH21 − E[H21 ]k2 kQ⊥ · kH21 − E[H21 ]k2 kQn k2 + nk α1 n(α2 − 2α21 )     c23 log2 n α23 n2 α23 n2 2 2 2 2 . kΠ0 xk + kΠ1 xk . kΠ xk + kΠ xk · + 0 1 α1 n(α2 − 2α21 ) c1 n1/2 −1 zUT H11 zU . k(Π0 + Π1 )xk2 Finally, we have  1 1 + n(α2 − 2α21 ) α1   2 2   α3 n log2 n α23 n2 α23 n2 α23 n2 log2 n 2 · kΠ xk + · kxk2 . + + W α1 nα1 n(α2 − 2α21 ) n2 (α2 − 2α21 ) −1 yUT H11 yU . k(H12 − E[H12 ])Π2 xk2 · .  c23 log2 n c23 log4 n 2 · kΠ xk + · kxk2 W c1 n1/2 c1 n3/2 The conclusion follows by grouping the projections, and taking the dominating terms as n grows. 14  3.4 −1 ′ T Proof of H22  H12 H11 H12 ′  H T H −1 H Theorem 3.6. For the choice of α given in (3.1), we have that H22 12 with probability 12 11 −4 1 − O(n ). Proof. Recall that by Theorem 3.1 with probability at least 1 − O(n−4 ), ′ H22  λ0 λ1 λ2 βλ0 · Π0 + · Π1 + · Π2 + ΠW . 4 4 4 16 By our choice of the parameters α1 , α2 , α3 , α4 , the conclusion of Theorem 3.4 implies that     1 1 c23 c22 + c23 log2 n ′ T −1 H22 − H12 H11 H12  λ0 − λ1 − Π0 + Π1 4 c2 4 c1 n1/2     1 c3 log4 n c23 log2 n 1 Π2 + ΠW λ2 − βλ0 − + 4 16 c1 n3/2 c1 n1/2  0, as desired. The details of the calculation are spelled out below for the sake of completeness; we verify that the coefficient of each projector is non-negative. For the space Π0 , c2 c23 1 · = 3 = γ −1 ≪ 1 c2 λ0 c2 c4 For Π1 , c22 + c23 log2 n 1 c22 + c23 log2 n 1 · . = + γ 3 ρ2 log2 n ≪ 1 . λ1 c3 c1 γ c1 n1/2 For Π2 , c3 log4 n 1 1 c3 log4 n · ≤ ≪ 1. c1 n3/2 λ2 n1/2 c1 c2 Finally for ΠW , 1 c23 log3 n c23 log2 n · = = ρ log3 n ≪ 1 . c1 c4 c1 n1/2 βλ0 This concludes the proof. 3.5 Proof of Main Theorem We finally have the components needed to prove Theorem 2.1. Proof of Theorem 2.1. First, we recall that independent of our choice of α, the SDP solution defined in Definition 2.8 does not violate any of the linear constraints of (2.1), as shown in Proposition 2.10. To meet the program constraints, it remains to show that for the choice of α given in (3.1), our solution is PSD. The solution matrix M ′ (G, α) is a principal submatrix of N ′ (G, α), and so N ′  0 implies ′ M  0. We prove that N ′ satisfies the Schur complement conditions from Lemma 2.2 with high ′ ′ = H probability. Observing that H11 11 and H12 = H12 , we apply Theorem 3.6, which states that 15 ′  H T H −1 H . For the H for our choice of α, H22 21 11 term, we apply the lower bound on the 12 11 eigenvalues of H11 given by [DM15a] (Lemma A.7), which state that so long as α1 − α2 ≫ α2 n−1/2 and α2 − 2α21 ≥ 0, we have H11  0 with probability 1 − O(n−5 ). For our choice of α1 , α2 , we have α2 γρ2 ρ γρ2 = ≪ − = α1 − α2 , n n1/2 n3/2 n1/2 and γρ2 − 2ρ2 ≫ 0, n and so we may conclude that H11  0. Therefore by a union bound, the conditions of Lemma 2.2 are satisfied with probability 1−O(n−4 ), and N ′ (G, α)  0 and so our solution satisfies the PSDness constraint. √ P It remains only to1/2prove that the objective value is Ω̃( n). The objective value is simply , concluding our proof. i∈[n] α1 = nα1 = ρn α2 − 2α21 = 4 Concentration of Projected Matrices In this section, we give bounds on the spectra of random matrices that are part of the correction term. Though we are able to recycle many of the spectral bounds of Deshpande and Montanari [DM15a], in our modification to their witness, we introduce new matrices which also require description and norm bounds. We obtain our bounds by employing the trace power method. The trace power P method uses the n×n k fact that if X ∈ R is a symmetric matrix, then for even powers k, Tr(X ) = i∈[n] λi (X)k ≥ λmax (X)k . By bounding E[Tr(X k )]1/k for a sufficiently large k, we essentially obtain bounds on the infinity norm of the vector of eigenvalues, i.e., a bound on the spectral norm of the matrix X. A formal statement follows, and the proof is given in Appendix A.1 for completeness. Lemma 4.1. Suppose an n × n random matrix M satisfies E[Tr(M k )] ≤ nαk+β · (γk)! for any even integer k, where α, β, γ are constants. Then   P kM k . η −1/ log n · nα · log n ≥ 1 − η . Our concentration proofs consist of, for each matrix in question, obtaining a bound on E[Tr(X k )]. The expression E[Tr(X k )] is a sum over products along closed paths of length k in the entries of X. In our case, the entries of the random matrix X are themselves low degree polynomials in random variables {Aij }i∈[n],j∈[n] where Aij is the centered random variable that indicates whether the edge (i, j) is part of the random graph G. Thus Tr(X k ) can be written out as a polynomial in the random variables {Aij }i,j∈[n]. Since the random variables {Aij }i,j∈[n] are centered (i.e., E[Aij ] = 0), almost all of the terms in E[Tr(X k )] vanish to zero. The nonzero terms are precisely those monomials in which every variable appears with even multiplicity. For the purpose of moment calculations, we borrow much of our terminology from the work of Deshpande and Montanari [DM15a]. Every monomial in random variables {Aij }i,j∈[n] corresponds to a labelled graph (F = (V, E), ℓ) that consists of a graph F = (V, E) and a labelling ℓ : V → [n] that maps its vertices to [n]. A labelling of F contributes (is nonzero in expectation), if and only if every pair {i, j} appears an even number of times as a label of an edge in F . The problem of bounding E[Tr(X k )] reduces to counting the number of the number of contributing labeled graphs. For example, for a given matrix X, we may have a bound on the number of “vertices” and “edges” in a term of E[Tr(X k )] as a function of k. In that case, we may use the following proposition, which 16 allows us to bound the number of such graphs in which every variable Aij , corresponding to an edge between vertices i and j, appears at least twice. Proposition 4.2. Let F = (V, E) be a multigraph and let ℓ : V → [n] be a labelling such that each pair (i, j) appears an even number of times as the label of an edge in E. Then, |{ℓ(v)|v ∈ V }| ≤ |E| + (# connected components of F) 2 Proof. From F , we form a new graph F ′ by identifying all the nodes with the same label; thus, the number of nodes in F ′ is the number of labels in F . We then collapse the parallel edges in F ′ to form the graph H; since each labelled edge appears at least twice, the number of edges in H is at most half that in F . The number of nodes in H (and thus labels in F ) is at most the number of edges in H plus the number of connected components; this is tight when H is a forest. Thus the number of distinct labels in F is at most |E|/2 + c, where c is the number of components in F . We apply this lemma, as well as simple inductive arguments, to bound the number of contributing terms in E[X k ] for the matrices X in question, and this allows us to bound their norms. We give the concentration proofs the following subsection. 4.1 Proofs of Concentration Let G be an instance of G(n, 12 ). As in the preceeding sections, define the vector Ai ∈ Rn so that Ai (j) = 1 if (i, j) ∈ E(G), Ai (j) = −1 if (i, j) 6∈ E(G), and Ai (i) = 0. Again as in the n preceeding sections, define a1 , . . . , an ∈ R( 2 ) by setting ai to be the restriction of A⊗2 i to coordinates corresponding to unordered pairs, i.e., ai ({c, d}) = Aic Aid for all {c, d} ∈ n2 . We will continue to use the notation W = spani∈[n] (ai ), and the notation Di = diag(ai ). We begin with a lemma that shows that the ai are close to an orthogonal basis for W . def P Lemma 4.3. If PW = i ai aTi then with probability at least 1 − O(n−5 ), 1 n2 (1 + o(1)) · PW  ΠW  (1 − o(1)) n12 · PW Proof. By definition, the vectors a1 , . . . , an form a basis for the subspace W . Let R be the matrix whose ith row is ai . We will use matrix concentration to analyze the eigenvalues of RRT , which are identical to the nonzero eigenvalues of PW = RT R. ⊗2 1 2 The (i, j)th entry of RRT is hai , aj i = 21 hA⊗2 i , Aj i = 2 hAi , Aj i . When i = j, this is precisely 1 2 T 2 2 (n − 1) , and so 2RR = (n − 1) · Idn + B, where B is a matrix that is 0 on the diagonal and ⊗2 ⊗2 equal to hAi , Aj i in the (i, j)th entry for i 6= j. Let M = B − E[B] = B − (n − 2)(Jn − Idn ). We will use the trace power method to prove that kM k = O(n3/2 ). The (i, j)th entry of M is given by 0 for i = j, and when i 6= j ! X X Aip Aiq Ajp Ajq . Aip Aiq Ajp Ajq − (n − 2) = M (i, j) = hAi , Aj i2 − (n − 2) = p,q p6=q The expression Tr(M k ) is a sum over monomial products over variables {Aip }i,p∈[n] , where each monomial product corresponds to a labelling L : F → [n] of a graph F . Each entry in Mij corresponds to a sum over links, where each link is a cycle of length 4, with the vertices i, j on opposite ends of the cycle, and the necessarily distinct vertices p, q are on the other opposite ends of a cycle. We will refer to i, j as the center vertices and p, q as the peripheral vertices of the link. 17 Each edge (u, v) of the link is weighted by Auv . Since Aii = 0 for all i ∈ [n], for every contributing labelling, it can never be the case that one of p, q = i. Each monomial product in the summation Tr(M k ) corresponds to a labelling (F, L) of the graph F , where F is a cycle with k links. F has 4k edges, and in total it has 3k vertices. q ′′ j i p′′ q′ q p p′ The quantity Tr(M k ) is equal to the sum over all labellings of F . Taking the expectation, terms in E[Tr(M k )] which contain a variable Auv with multiplicity 1 have expectation 0. Thus, E[Tr(M k )] is equal to the number of labellings of F in which every edge appears an even number of times. We prove that any such contributing labelling L : F → [n] has at most 3k/2 + 1 unique vertex labels. We proceed by induction on k, the length of the cycle. In the base case, we have a cycle on two links; by inspection no such cycle can have more than 5 labels, and the base case holds. Now, consider a cycle of length k. If every label appears twice, then we are done, since there are 3k vertices in F . Thus there must be a vertex that appears only once. There can be no peripheral vertex whose label does not repeat, since the two center vertices neighboring a single peripheral vertex cannot have the same label in a contributing term, as M (i, i) = 0. Now, if there exists a center vertex i whose label does not repeat, it must be that there is a matching between its p, q neighbors so that every vertex is matched to a vertex of the same label; we identify these same-label vertices and remove i and two of its neighbors from the graph, leaving us with a cycle of length k − 1, having removed at most one label from the graph. The induction hypothesis now applies, and we have a total of at most 3(k − 1)/2 + 2 ≤ 3k/2 + 1 labels, as desired. Thus, there are at most 3k/2 + 1 unique labels in any contributing term of E[Tr(M k )]. We may thus conclude that E[Tr(M k )] ≤ n3k/2+1 · (3k/2 + 1)3k , and applying Lemma 4.1, we have that kM k . n3/2 with probability at least 1 − O(n−5 ). Therefore, 2RRT = ((n − 1)2 − n + 2)Idn + (n − 2)Jn + M , and we may conclude that all eigenvalues of RRT are (1 ± o(1)) · n2 , which implies the same of PW = RT R. Since the range of PW and ΠW is the same, we finally have that with probability 1 − o(1) (1 + o(1))/n2 · PW  ΠW  (1 − o(1))/n2 · PW , as desired. The following lemma allows us to approximate the projector to V0 ∪ V1 by a matrix that is easy to describe; we will use this matrix as an approximation to the projector in later proofs. n n Lemma 4.4. Let Π01 be the projection to the vector space V0 ∪ V1 . Let P01 ∈ R( 2 ),( 2 ) be a matrix defined as follows:  2   n−1 |{a, b, c, d}| = 2 1 P01 (ab, cd) = n−1 |{a, b, c, d}| = 3   0 |{a, b, c, d}| = 4. Then n−2 Π01  P01  ( n−1 ) · Π01 , 18 Proof. We will write down a basis for V0 ∪ V1 , take a summation over its outer products, and then n argue that this summation approximates Π01 . The vectors v1 , . . . , vn ∈ R( 2 ) are a basis for V1 ∪ V0 : ( √1 {a, b} = {i, ·} n−1 vi (a, b) = 0 otherwise. 2 1 . Let U ∈ Rn ×n be the matrix whose ith column is given For any two vi , vj , we have hvi , vj i = n−1 P by vi . Notice that the eigenvalues of i vi viT = U U T are equal to the eigenvalues of U T U , and n−2 1 Jn + n−1 Idn . Therefore, as both matrices have the same column and row spaces, that U T U = n−1 X n−2 Π01  vi viT  n−1 Π01 , i Now, let P01 = P T i vi vi ; The conclusion follows. we can explicitly calculate  2   n−1 1 P01 (ab, cd) = n−1   0 the entries of P01 , |{a, b, c, d}| = 2 |{a, b, c, d}| = 3 |{a, b, c, d}| = 4. We will require the fact that W lies mostly outside of V0 ∪ V1 , which we prove in the following lemma. Lemma 4.5. With probability at least 1 − O(n−ω(log n) ),  2  log n kΠ01 ΠW Π01 k ≤ O . n Proof. Call M = Π01 ΠW Π01 . We will apply the trace power method to M . By Lemma 4.4 (1+o(1)) P T ′k = and Lemma 4.3, we may exchange ΠW for i ai ai and Π01 for P01 . Letting M n2 P01 PW )k , we have by the cyclic property of the trace that E[Tr(M k )] ≤ Tr(M ′k ). ( (1+o(1)) n2 We consider the expression for E[Tr(M ′k )]. Let a chain consists of a set of quadruples {aℓ , bℓ , cℓ , dℓ }ℓ∈[k] ∈ [n]4 such that for each ℓ ∈ [k], we have k{aℓ , bℓ } ∩ {cℓ−1 , dℓ−1 }| ≥ 1 (where we identify aℓ with aℓ mod k ). Let Ck denote the set of all chains of size k. We have that, Tr(M k ) ≤ Tr(M ′k ) = k Y 1 + o(1) X X i1 ,...,ik {aℓ ,bℓ ,cℓ ,dℓ }ℓ∈[k] ∈Ck ℓ=1 n2 · rℓ · Aiℓ ,aℓ Aiℓ ,bℓ Aiℓ ,cℓ Aiℓ ,dℓ , 1 2 where rℓ = n−1 or n−1 depending on whether one or both of aℓ , bℓ are common with the following link in the chain. The quantity Tr(M k ) consists of cycles of k links, each link is a star on 4 outer vertices aℓ , bℓ , cℓ , dℓ with center vertex iℓ , and the non-central vertices of the link must have at least one vertex in common with the next link, so each link has 4 edges and the cycle is a connected graph. See the figure below for an illustration (dashed lines indicate vertex equality, and are not edges). aℓ−1 cℓ−1 aℓ iℓ−1 bℓ−1 cℓ aℓ+1 iℓ+1 iℓ dℓ−1 bℓ dℓ 19 cℓ+1 bℓ+1 dℓ+1 Each term in the product has a factor of at most P01 and PW . Thus we have ′k E[Tr(M )] ≤  3 n3 k X X 2(1+o(1)) , n3 E i1 ,...,ik {aℓ ,bℓ ,cℓ ,dℓ }ℓ∈[k] ∈Cn " k Y due to the scaling of the entries of # Aiℓ ,aℓ Aiℓ ,bℓ Aiℓ ,cℓ Aiℓ ,dℓ . ℓ=1 The only contributing terms correspond to those for which every edge variable in the product has even multiplicity. Each contributing term is a connected graph and has 4k edges and at most 5k vertices where every labeled edge appears twice, so we may apply Proposition 4.2 to conclude that there are at most 2k + 1 labels in any such cycle. We thus have that ′k E[Tr(M )] ≤  3 n3 k and applying Lemma 4.1, we conclude that kM k . desired. · n2k+1 · (5k)!, log2 n n with probability 1 − O(n−ω(log n) ), as We combine the above lemmas to bound the norm of one final matrix that arises in the computations in Theorem 3.1. Lemma 4.6. With probability 1 − O(n−5 ), X Dw Π2 ΠW Π2 Dw  O(n) · Π0 + O(log2 n) · Idn . w Proof. We begin by replacing Π2 with (1 − Π01 ), as by Lemma 4.5, Π01 can be replaced by P01 n which has a convenient form. For any vector x ∈ R( 2 ) , ! ! ! ! X X X X Di Π01 ΠW Π01 Di x Di Π01 ΠW Di x + xT Di ΠW Di x − 2xT Di Π2 ΠW Π2 Di x = xT xT ≤ X i 2 kΠW Di xk + 2kΠW Π01 Di xk · kΠW Di xk + kΠW Π01 Di xk2 T X Di ΠW Di ! ≤ 2xT X Di ΠW Di ! ≤ 2x i i i i i i X (Di x)T Π01 ΠW Π01 Di x x+2 i !  x + 2n kΠ01 ΠW Π01 k · kxk2 , where to obtain the second line we have applied Cauchy-Schwarz, to obtain the third line we have used the fact that a2 +b2 ≥ 2ab, and to obtain the final line we have used the fact that kDi xk = kxk. Now, the second term is O(log2 n) · kxk2 with overwhelming probability by Lemma 4.5. It remains to bound the first term. To this end, we apply Lemma 4.3 to replace ΠW with 1+o(1) ·PW = n2 1+o(1) P 1 P T · i ai ai . Let M = n2 · i Di PW Di . An entry of M has the form n2 M (ab, cd) =  1  n+ n2 X i6=j  Aia Aib Aic Aid Aja Ajb Ajc Ajb  . 20 n n ⊤ is the all-ones matrix in R( 2 )×( 2 ) and Thus we can see that M = n1 J(n) + 1+o(1) n2 BB , where J(n 2) 2 B is the matrix whose entries have the form B(ab, ij) = Aia Aib Aja Ajb . The matrix B is actually equal to the matrix J4,1 from [DM15a], and by Lemma A.3 has kBk . n with probability 1−O(n−5 ). We can thus conclude that with probability 1−O(n−5 ), kM − n1 J(n) k ≤ 1+o(1) 2 n2 kBk ≤ Õ(1), and so xT M x ≤ which gives the desired result. 1+o(1) n hx, 2 1(n) i2 +xT (M −n−1J)x ≤ O(n)·kΠ0 xk2 + Õ(1)·kxk2 , 2 Acknowledgements We thank Satish Rao for many helpful conversations. We also greatfully acknowledge the comments of anonymous reviewers in helping us improve the manuscript. References [AKS98] Noga Alon, Michael Krivelevich, and Benny Sudakov, Finding a large hidden clique in a random graph, Random Struct. Algorithms 13 (1998), no. 3-4, 457–466. 1, 2 [Bar14] Boaz Barak, Sum of squares: upper bounds, lower bounds, and open questions (lecture notes, fall 2014), 2014. 2, 4 [BBH+ 12] Boaz Barak, Fernando G. S. L. Brandão, Aram Wettroth Harrow, Jonathan A. Kelner, David Steurer, and Yuan Zhou, Hypercontractivity, sum-of-squares proofs, and their applications, Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012, 2012, pp. 307–326. 2 [BE76] Bella Bollobas and Paul Erdös, Cliques in random graphs, Mathematical Proceedings of the Cambridge Philosophical Society 80 (1976), 419–427. 1 [BV09] S. Charles Brubaker and Santosh Vempala, Random tensors and planted cliques, Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, 12th International Workshop, APPROX 2009, and 13th International Workshop, RANDOM 2009, Berkeley, CA, USA, August 21-23, 2009. Proceedings (Irit Dinur, Klaus Jansen, Joseph Naor, and José D. P. Rolim, eds.), Lecture Notes in Computer Science, vol. 5687, Springer, 2009, pp. 406–419. 1 [DM15a] Yash Deshpande and Andrea Montanari, Improved sum-of-squares lower bounds for hidden clique and hidden submatrix problems, Proceedings of The 28th Conference on Learning Theory, COLT 2015, Paris, France, July 3-6, 2015 (Peter Grünwald, Elad Hazan, and Satyen Kale, eds.), JMLR Proceedings, vol. 40, JMLR.org, 2015, pp. 523–562. 1, 2, 3, 4, 5, 6, 7, 10, 12, 16, 21, 23, 24 [DM15b] , Improved sum-of-squares lower bounds for hidden clique and hidden submatrix problems, CoRR abs/1502.06590 (2015). 23, 24 21 [FGR+ 12] Vitaly Feldman, Elena Grigorescu, Lev Reyzin, Santosh Vempala, and Ying Xiao, Statistical algorithms and a lower bound for planted clique, Electronic Colloquium on Computational Complexity (ECCC) 19 (2012), 64. 1 [FK00] Uriel Feige and Robert Krauthgamer, Finding and certifying a large hidden clique in a semirandom graph, Random Struct. Algorithms 16 (2000), no. 2, 195–208. 1, 2 [FK03] , The probable value of the lovasz-schrijver relaxations for maximum independent set, SIAM Journal on Computing 32 (2003), 2003. 1, 2 [FK08] Alan M. Frieze and Ravi Kannan, A new approach to the planted clique problem, IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2008, December 9-11, 2008, Bangalore, India, 2008, pp. 187–198. 1 [GM75] Geoffrey R. Grimmett and Colin J. H. McDiarmid, On colouring random graphs, Mathematical Proceedings of the Cambridge Philosophical Society 77 (1975), 313–324. 1 [Hås96] Johan Håstad, Clique is hard to approximate within n1-epsilon , 37th Annual Symposium on Foundations of Computer Science, FOCS ’96, Burlington, Vermont, USA, 14-16 October, 1996, 1996, pp. 627–636. 1 [HKP15] Samuel B. Hopkins, Pravesh Kothari, and Aaron Potechin, SoS and planted clique: Tight analysis of MPW moments at all degrees and an optimal lower bound at degree four. 0, 2 [HM13] Aram Wettroth Harrow and Ashley Montanaro, Testing product states, quantum merlinarthur games and tensor optimization, J. ACM 60 (2013), no. 1, 3. 1 [Jer92] Mark Jerrum, Large cliques elude the metropolis process., Random Struct. Algorithms 3 (1992), no. 4, 347–360. 1 [Kar76] Richard Karp, The probabilistic analysis of some combinatorial search algorithms, Algorithms and Complexity: New Directions and Recent Results (1976), 1–19. 1 [Kho01] Subhash Khot, Improved inaproximability results for maxclique, chromatic number and approximate graph coloring, 42nd Annual Symposium on Foundations of Computer Science, FOCS 2001, 14-17 October 2001, Las Vegas, Nevada, USA, 2001, pp. 600–609. 1 [KS09] Subhash Khot and Rishi Saket, SDP integrality gaps with local ell 1-embeddability, 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2009, October 25-27, 2009, Atlanta, Georgia, USA, 2009, pp. 565–574. 2 [Mat76] David Matula, The largest clique size in a random graph, Tech. report, Southern Methodist University, Dallas, 1976. 1 [MPW15] Raghu Meka, Aaron Potechin, and Avi Wigderson, Sum-of-squares lower bounds for planted clique, Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, STOC 2015, Portland, OR, USA, June 14-17, 2015, 2015, pp. 87–96. 1, 2, 4, 5 [RS09] Prasad Raghavendra and David Steurer, Integrality gaps for strong SDP relaxations of UNIQUE GAMES, 50th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2009, October 25-27, 2009, Atlanta, Georgia, USA, 2009, pp. 575–585. 2 22 A Matrix Norm Bounds from Deshpande and Montanari In this appendix, we give for completeness a list of the bounds proven by Deshpande and Montanari [DM15a] that were not included in the body above out of space or expository considerations. Definition A.1. Let A = {a, b} ⊂ [n] be disjoint from B = {c, d} ⊂ [n]. For η ∈ {1, . . . , 4} and 4 ′ for ν(η) ∈ [ η ] we define the matrices J˜η,ν(η) as follows: ′ (A, B) = A J˜1,1 ac ′ (A, B) = A J˜1,2 ad ′ (A, B) = A J˜1,3 bc ′ ˜ J (A, B) = Abd 1,4 ′ (A, B) = A A J˜2,1 ac bd ′ (A, B) = A A J˜2,2 ac bc ′ (A, B) = A A J˜2,3 ac ad ′ ˜ J2,4 (A, B) = Aad Abd ′ (A, B) = A A J˜2,5 bc bd J˜′ (A, B) = Aad Abc ′ (A, B) = A A A ˜′ J˜3,1 ac ad bc J4,1 (A, B) = Aac Aad Abc Abd ′ J˜3,2 (A, B) = Aac Abc Abd ′ (A, B) = A A A J˜3,3 ac ad bd ′ ˜ J (A, B) = Aad Abc Abd 3,4 2,6 n n And further, letting P : R( 2 )×( 2 ) to be the matrix projector such that ( MA,B |A ∪ B| = 4 (PM )A,B = 0 otherwise , def 2η 16 α4 ′ we define Jη,nu = PJη,ν , and finally we define Jη,ν = P4 P(η4) so that Q = η=1 ν=1 Jη,ν . ′ · Jη,ν (as in Deshpande and Montanari), Notice that since we have defined Aii = 0 and since |{a, b}| = |{c, d}| = 2, we have J˜4,1 = J4,1 . For some of the terms, the J˜ is never considered; however for some terms it is cleaner to bound the spectral norm of J˜ in the subspace V2 , and so Deshpande and Montanari provide trace power method bounds on the difference in norm: Lemma A.2 (Lemma 4.26 in [DM15b]). With probability at least 1 − 6n−5 , for each η ≤ 2 and for 4 each ν ≤ η , kJη,ν − J˜η,ν k . α4 n̄. Deshpande and Montanari use the trace power method to bound the norm of Q by bounding the norms of the Jη,ν individually. Some of the Jη,ν matrices have Wigner-like behavior. Lemma A.3 (Lemmas 4.21, 4.22 in [DM15b]). With probability 1 − O(n−5 ), we have that for each (η, ν) ∈ {(2, 1), (2, 6), (3, ·), (4, 1)}, kJη,ν k . α4 · n. A select few of the Jη,ν have larger eigenvalues. Lemma A.4 (Lemmas 4.23, 4.24 in [DM15b]). With probability 1 − O(n−4 ), we have that for each (η, ν) ∈ {(1, ·), (2, 2), (2, 3), (2, 4), (2, 5)}, kJη,ν k . α4 · n3/2 . We also give a short proof of an observation of Deshpande and Montanari, which states that some of the Jη,ν vanish when projected to V2 : 23 Observation A.5 (Lemmas 4.23, 4.24 in [DM15a]). Let Π2 be the projector to V2 . Then always, ! 4 X = 0, and similarly, kΠ2 (J˜2,3 + J˜2,5 )k = 0. Π2 J˜1,ν ν=1 Proof. The proof follows from noting Pthat therange of both of these sums of Jη,ν is in V1 . Consider n def 4 v. We will look at the entry of v ′ indexed by the some vector v ∈ R( 2 ) ; let v ′ = J ν=1 1,ν disjoint pair A = {a, b}. By definition of the J1,ν , we have that  X  ′ vA = (Aa,c + Aa,d ) + (Ab,c + Ab,d vc,d c,d∈[n]     X X =  (Aa,c + Aa,d )vc,d  +  (Ab,c + Ab,d )vc,d  , c,d c,d and so by the characterization of V1 from Proposition 2.3 the vector v ′ ∈ V1 . The conclusion follows. A similar proof holds for the matrix J˜2,3 + J˜2,5 . Finally, we use a bound on the norm of the matrix K, which is the difference of H2,2 and the non-multilinear entries. Lemma A.6 (Lemma 4.25 in [DM15b]). Let K be the restriction of H2,2 − E[H2,2 ] to entries indexed by sets of size at most 3. With probability at least 1 − n−5 ), kKk ≤ Õ(α3 n1/2 ). We also require bounds on the matrices used in the Schur complement steps. The bounds of Deshpande and Montanari suffice for us, since we do not modify moments of order less than 4. Lemma A.7 (Consequence of Proposition 4.19 in [DM15b]). Define Qn ∈ Rn,n to be the orthogonal projection to the space spanned by ~1. Suppose that α satisfies α1 −α2 ≥ Ω(α2 n−1/2 ) and α2 −2α21 ≥ 0, α1 ≥ 0. Then with probability at least 1 − n−5 , H1,1  0 −1 H1,1  A.1 2 ⊥ 1 Qn + Q . 2 α1 n n(α2 p − α1 p) Additional Proofs We prove Lemma 2.5, which follows almost immediately from the bounds of [DM15a]. Proof of Lemma 2.5. Using the matrices from Definition A.1 and Observation A.5, we have that ! 4   X J3,ν + J4,1 , Π2 Q = Π2 (J˜2,4 + J˜2,2 ) + Π2 J2,4 − J˜2,4 + J2,2 − J˜2,2 + Π2 ν=1 Π2 ΠW Q = Π2 ΠW (J˜2,4 + J˜2,2 ) + Π2 ΠW   J2,4 − J˜2,4 + J2,2 − J˜2,2 + Π2 ΠW 24 4 X ν=1 J3,ν + J4,1 ! , where we have used the fact that the columns of J2,4 and J2,2 lie in W . We thus have Π2 Q − Π2 ΠW Q = Π2 (I − ΠW ) J2,2 − J˜2,2 + J2,4 − J˜2,4 + 4 X ν=1 J3,ν + J4,1 ! , And by the bounds kJ3,· k ≤ α4 ·n and kJ4,1 k ≤ α4 ·n from Lemma A.3 and the bounds kJ2,4 − J˜2,4 k ≤ α4 n and kJ2,2 − J˜2,2 k ≤ α4 n from Lemma A.2, and because Π2 (I − ΠW ) is a projection, the conclusion follows. Now, we prove that the trace power method works, for completeness. Proof of Lemma 4.1. The proof follows from an application of Markov’s inequality. We have that for even k, P[kM k ≥ t] = P[kM k k ≥ tk ] ≤ P[Tr(M k ) ≥ tk ] 1 ≤ k E[Tr(M k )] t  k γk 1p nαk+β , ≤ k πγk t e where we have applied Stirling’s approximation in the last step. Choosing k = O(log n) and  t = O η −1/k · γ · log n · nα completes the proof. 25
8cs.DS
Microwave Tomographic Imaging of Cerebrovascular Accidents by Using High-Performance Computing arXiv:1607.02573v1 [cs.CE] 9 Jul 2016 P.-H. Tourniera,b , I. Aliferisc , M. Bonazzolid , M. de Buhane , M. Darbasf , V. Doleand,g , F. Hechta,b , P. Joliveth , I. El Kanfoudc , C. Migliaccioc , F. Natafa,b , C. Pichotc , S. Semenovi a Laboratoire Jacques-Louis Lions, UMR CNRS 7598, Sorbonne Universités, UPMC, Paris, France b INRIA-Paris, EPC Alpines, Paris, France c Laboratoire LEAT, UMR CNRS 7248, Université Nice Sophia Antipolis, Sophia Antipolis, France d Laboratoire J.A. Dieudonné, UMR CNRS 7351, Université Nice Sophia Antipolis, Nice, France e MAP5, UMR CNRS 8145, Université Paris-Descartes, Sorbonne Paris Cité, France f LAMFA, UMR CNRS 7352, Université de Picardie Jules Verne, Amiens, France g Dept of Maths and Stats, University of Strathclyde, Glasgow, UK h IRIT, UMR CNRS 5505, Toulouse, France i EMTensor GmbH, TechGate, 1220 Vienna, Austria Abstract The motivation of this work is the detection of cerebrovascular accidents by microwave tomographic imaging. This requires the solution of an inverse problem relying on a minimization algorithm (for example, gradient-based), where successive iterations consist in repeated solutions of a direct problem. The reconstruction algorithm is extremely computationally intensive and makes use of efficient parallel algorithms and high-performance computing. The feasibility of this type of imaging is conditioned on one hand by an accurate reconstruction of the material properties of the propagation medium and on the other hand by a considerable reduction in simulation time. Fulfilling these two requirements will enable a very rapid and accurate diagnosis. From the mathematical and numerical point of view, this means solving Maxwell’s equations in time-harmonic regime by appropriate domain decomposition methods, which are naturally adapted to parallel architectures. Keywords: inverse problem, scalable preconditioners, Maxwell’s equations, microwave imaging Preprint submitted to Parallel Computing July 12, 2016 1. Introduction A stroke, also known as cerebrovascular accident, is a disturbance in the blood supply to the brain caused by a blocked or burst blood vessel. As a consequence, cerebral tissues are deprived of oxygen and nutrients. This results in a rapid loss of brain functions and often death. Strokes are classified into two major categories: ischemic (85% of strokes) and hemorrhagic (15% of strokes). During an acute ischemic stroke, the blood supply to a part of the brain is interrupted by thrombosis - the formation of a blood clot in a blood vessel - or by an embolism elsewhere in the body. A hemorrhagic stroke occurs when a blood vessel bursts inside the brain, increasing pressure in the brain and injuring brain cells. The two types of strokes result in opposite variations of the dielectric properties of the affected tissues. How quickly one can detect and characterize the stroke is of fundamental importance for the survival of the patient. The quicker the treatment is, the more reversible the damage and the better the chances of recovery are. Moreover, the treatment of ischemic stroke consists in thinning the blood (anticoagulants) and can be fatal if the stroke is hemorrhagic. Therefore, it is vital to make a clear distinction between the two types of strokes before treating the patient. Moreover, ideally one would want to monitor continuously the effect of the treatment on the evolution of the stroke during the hospitalization. The two most used imaging techniques for strokes diagnosis are MRI (magnetic resonance imaging) and CT scan (computerized tomography scan). One of their downsides is that the travel time from the patient’s home to the hospital is lost. Moreover, the cost and the lack of portability of MRI and the harmful character of CT scan make them unsuitable for a continuous monitoring at the hospital during treatment. This has motivated the study of an additional technique: microwave tomography. The measurement system is lightweight and thus transportable. The acquisition of the data is harmless and faster than CT or MRI. Hence, this imaging modality could be used by an emergency unit and for monitoring at the hospital. At frequencies of the order of 1 GHz, the tissues are well differentiated and can be imaged on the basis of their dielectric properties. After the first works on microwave imaging in 1982 by Lin and Clarke [1], other works followed, but almost always on synthetic simplified models [2]. New devices are currently designed and studied by EMTensor GmbH 2 Figure 1: Left: Operating principle of the diagnosis apparatus. Middle: imaging chamber prototype of EMTensor, by courtesy of EMTensor company. Right: the corresponding simulation domain. (Vienna, Austria) [3]. The purpose of this work is to solve in parallel the inverse problem associated with the time-harmonic Maxwell’s equations which model electromagnetic waves propagation. The dielectric properties of the brain tissues of a patient yield the image that could be used for a rapid diagnosis of brain strokes. Simulation results presented in this work have been obtained on the imaging system prototype developed by EMTensor GmbH [3] (see Figure 1). It is composed of 5 rings of 32 ceramic-loaded rectangular waveguides around a metallic cylindrical chamber of diameter 28.5 cm and total height 28 cm. The head of the patient is inserted into the chamber as shown in Figure 1 (left). The imaging chamber is filled with a matching solution and a membrane is used to isolate the head. Each antenna successively transmits a signal at a fixed frequency, typically 1 GHz. The electromagnetic wave propagates inside the chamber and in the object to be imaged according to its electromagnetic properties. The retrieved data then consist in the scattering parameters measured by the 160 receiving antennas, which are used as input for the inverse problem. These raw data can be wirelessly transferred to a remote computing center. The HPC machine will then compute the 3D images of the patient’s brain. Once formed, these images can be quickly transmitted from the computing center to the hospital, see Figure 2. The paper is organized as follows. In Section 2 the direct problem and the time-harmonic Maxwell’s equations in curl-curl form with suitable boundary conditions are introduced. In Section 3, we briefly describe the discretization method with edge finite elements. Section 4 is devoted to the introduction of the domain decomposition preconditioner. In Section 5 we explain how to compute the scattering coefficients. We also compare measurement data 3 Figure 2: Design concept of the diagnosis technology, by courtesy of EMTensor company. obtained by EMTensor with the coefficients computed by the simulation. We introduce the inverse problem in Section 6. Section 7 is dedicated to numerical results. We first perform a strong scaling analysis to show the effectiveness of the domain decomposition method. Then, we present results obtained by solving the inverse problem in a realistic configuration, with noisy synthetic data generated using a numerical brain model with a simulated hemorrhagic stroke. Finally, we conclude this paper in Section 8 and give directions for future research. 2. The direct problem Let the domain Ω ⊂ R3 represent the imaging chamber (see Figure 1, right). We consider in Ω a heterogeneous non-magnetic dissipative linear isotropic dielectric medium, of dielectric permittivity ε(x) > 0 and electrical conductivity σ(x) ≥ 0. For each transmitting antenna j = 1, . . . , N emitting a time periodic signal at angular frequency ω, the complex amplitude Ej (x) of the associated electric field Ej (x, t) = <(Ej (x)eiωt ) is solution to the following second order time-harmonic Maxwell’s equation: ∇ × (∇ × Ej ) − µ0 (ω 2 ε − iωσ)Ej = 0 in Ω, (1) where µ0 is the permeability of free space. Note that the coefficient κ =  µ0 (ω 2 ε − iωσ) in the equation can be written as κ = ω 2 µ0 ε − i ωσ , and in the next sections we will consider the relative complex permittivity εr given by the relation εr ε0 = ε − i ωσ , where ε0 is the permittivity of free space. Let n be the unit outward normal to ∂Ω. Equation (1) is equipped with perfectly conducting boundary conditions on the metallic walls Γm : Ej × n = 0 4 on Γm , and with impedance boundary conditions on the outer section of the transmitting waveguide j and of the receiving waveguides i = 1, . . . , N , i 6= j (see [4]): (∇ × Ej ) × n + iβn × (Ej × n) = gj (∇ × Ej ) × n + iβn × (Ej × n) = 0 on Γj , on Γi , i 6= j. (2) (3) Here β is the propagation wavenumber along the waveguide, corresponding to the propagation of the TE10 fundamental mode. Equation (2) imposes an incident wave which corresponds to the excitation of the fundamental mode E0j of the j-th waveguide, with gj = (∇ × E0j ) × n + iβn × (E0j × n). On the other hand equation (3) corresponds to a first order absorbing boundary condition of Silver–Müller approximating a transparent boundary condition on the outer section of the receiving waveguides i = 1, . . . , N , i 6= j. The bottom of the chamber is metallic, and we impose an impedance boundary condition on the top of the chamber. We end up with the following boundary value problem for each transmitting antenna j = 1, . . . , N : find Ej such that  ∇ × (∇ × Ej ) − µ0 (ω 2 ε − iωσ)Ej = 0 in Ω,     Ej × n = 0 on Γm , (4)  (∇ × Ej ) × n + iβn × (Ej × n) = gj on Γj ,    (∇ × Ej ) × n + iβn × (Ej × n) = 0 on Γi , i 6= j. Now, let V = {v ∈ H(curl, Ω), v × n = 0 on Γm }, where H(curl, Ω) = {v ∈ L2 (Ω)3 , ∇ × v ∈ L2 (Ω)3 } is the space of square integrable functions whose curl is also square integrable. For each transmitting antenna j = 1, . . . , N , the variational form of problem (4) reads: find Ej ∈ V such that Z   (∇ × Ej ) · (∇ × v) − µ0 (ω 2 ε − iωσ)Ej · v Z Ω Z (5) iβ(Ej × n) · (v × n) = gj · v ∀v ∈ V. + S N i=1 Γi Γj 3. Edge finite elements Nédélec edge elements [5] are finite elements particularly suited for the approximation of electromagnetic fields. Indeed, given a tetrahedral mesh T of the computational domain Ω, the finite dimensional subspace Vh generated 5 by Nédélec basis functions is included in H(curl, Ω), since their tangential component across faces shared by adjacent tetrahedra of T is continuous. They thus match the continuity properties of the electric field. Nédélec elements are called edge elements because the basis functions are associated with the edges of the mesh T . More precisely, for a tetrahedron T ∈ T , the local basis functions are associated with the oriented edges e = {ni , nj } of T as follows we = λi ∇λj − λj ∇λi , where the λ` are the barycentric coordinates of a point with respect to the node n` of T . Note that the polynomial degree of we is 1 since the barycentric coordinates λ` are polynomials of degree 1 and their gradients are constant. As these basis functions are vector functions, we only need one set of unknowns to approximate all the components of the field, and not three sets of unknowns, one for each component of the field as is instead required for usual nodal (scalar) finite elements. The finite element discretization of the variational problem is obtained by taking test functions v ∈ Vh , the edge finite element space on the mesh T , and by looking for a solution Eh ∈ Vh in the same space: find Eh ∈ Vh such that Z   (∇ × Eh ) · (∇ × v) − µ0 (ω 2 ε − iωσ)Eh · v Ω Z Z (6) + S iβ(Eh × n) · (v × n) = gj · v ∀v ∈ Vh . N i=1 Γi Γj Locally, over each tetrahedron T , we write the discretized field as Eh = P e e∈T ce w , a linear combination with coefficients ce of the basis functions associated with the edges e of T , and the coefficients ce will be the unknowns of the resulting linear system. For edge finite elements (of degree 1) these coefficients can be interpreted as the circulations of Eh along the edges of the tetrahedra: Z 1 Eh · te , ce = |e| e where te is the tangent vector to the edge e of length |e|, the length of e. This is a consequence of the fact that the basis functions are in duality with the degrees of freedom given by the circulations along the edges, that is: ( Z 1 if e = e0 , 1 0 we · te = |e| e 0 if e 6= e0 . 6 4. Domain decomposition preconditioning The finite element discretization (6) of the variational problem (5) produces linear systems Auj = bj for each transmitting antenna j. However, the matrix A can be ill-conditioned. This, combined with the fact that the underlying PDE is indefinite, highlights the need for a robust and efficient preconditioner. Here we employ domain decomposition preconditioners, which are extensively described in [6], as they are naturally suited to parallel computing. Our domain decomposition preconditioner is presented in the following. Let T be the mesh of the computational domain Ω. First, T is partitioned into NS non-overlapping meshes {Ti }16i6NS using standard graph partitioners such as SCOTCH [7] or METIS [8]. If δ is a positive integer, the overlapping decomposition {Tiδ }16i6NS is defined recursively as follows: Tiδ is obtained by including all tetrahedra of Tiδ−1 plus all adjacent tetrahedra of Tiδ−1 ; for δ = 0, Tiδ = Ti . Note that the number of layers in the overlap is then 2δ. Let Vh be the edge finite element space defined on T , and {Viδ }16i6NS the local edge finite element spaces defined on {Tiδ }16i6NS , δ > 0. Now consider the restrictions {Ri }16i6NS from Vh to {Viδ }16i6NS , and a local partition of unity {Di }16i6NS such that NS X RiT Di Ri = In×n . (7) i=1 Algebraically speaking, if n is the global number of unknowns and {ni }16i6NS are the numbers of unknowns for each local finite element space, then Ri is a Boolean matrix of size ni × n, and Di is a diagonal matrix of size ni × ni , for all 1 6 i 6 NS . Note that RiT , the transpose of Ri , is a n × ni matrix that gives the extension by 0 from Viδ to Vh . Using these matrices, one can define the following one-level preconditioner, called Optimized Restricted Additive Schwarz preconditioner (ORAS) [9]: NS X −1 MORAS = RiT Di Bi−1 Ri , (8) i=1 where {Bi }16i6NS are local operators corresponding to the subproblems with impedance boundary conditions (∇ × E) × n + ikn × (E × n), where k = √ ω µ0 εr ε0 is the wavenumber. These boundary conditions were first used as 7 transmission conditions at the interfaces between subdomains in [10]. The local matrices {Bi }16i6NS of the ORAS preconditioner make use of more efficient transmission boundary conditions than the submatrices {Ri ARiT }16i6NS of the original Restricted Additive Schwarz (RAS) preconditioner [11]. It is important to note that when a direct solver is used to compute the action of Bi−1 on multiple vectors, it can be done in a single forward elimination and backward substitution. More details on the solution of linear systems with multiple right-hand sides are given in Section 7. The preconditioner −1 MORAS (8) is naturally parallel since its assembly requires the concurrent factorization of each {Bi }16i6NS , which are typically stored locally on different processes in a distributed computing context. Likewise, applying (8) to a distributed vector only requires peer-to-peer communications between neighboring subdomains, and a local forward elimination and backward substitution. See chapter 8 of [6] for a more detailed analysis. 4.1. Partition of unity The construction of the partition of unity is intricate, especially for Nédélec edge finite elements. The starting point is the construction of partition of unity functions {χi }16i6NS for the classical P1 linear nodal finite element, whose degrees of freedom are the values at the nodes of the mesh. First of all, we define for i = 1, . . . , NS the function χ ei as the continuous piecewise linear function on T , with support contained in Tiδ , such that ( 1 at all nodes of Ti0 , χ ei = 0 at all nodes of Tiδ \ Ti0 . The function χi can then be defined as the continuous piecewise linear function on T , with support contained in Tiδ , such that its (discrete) value for each degree of freedom is evaluated by: χi = χ ei . NS X χ ej (9) j=1 P S Thus, we have N i=1 χi = 1 both at the discrete and continuous level. Remark that if δ > 1, not only the function χi but also its derivative is equal to zero on the border of Tiδ . This is essential for a good convergence if Robin boundary 8 conditions are chosen as transmission conditions at the interfaces between subdomains. Indeed, if this property is satisfied, the continuous version of the ORAS algorithm is equivalent to P. L. Lions’ algorithm (see [9] and [6] §2.3.2). Note that in the practical implementation, the functions χ ei and ej in (9) χi are constructed locally on Tiδ , the relevant contribution of the χ being on Tjδ ∩ Tiδ . This removes all dependency on the global mesh T , which could be otherwise problematic at large scales. Now, the degrees of freedom of Nédélec finite elements are associated with the edges of the mesh. For these finite elements, we can build a geometric partition of unity based on the support of the degrees of freedom (the edges of the mesh): the entries of the diagonal matrices Di , i = 1, . . . , NS are obtained for each degree of freedom by interpolating the piecewise linear function χi at the midpoint of the corresponding edge. The partition of unity property (7) PNS is then satisfied since i=1 χi = 1. 4.2. Software stack All operators related to the domain decomposition method can be easily generated using finite element Domain-Specific Languages (DSL). Here we use FreeFem++ [12] (http://www.freefem.org/ff++/) since it has already been proven that it can enable large-scale simulations using overlapping Schwarz methods [13] when used in combination with the library HPDDM [14] (High-Performance unified framework for Domain Decomposition Methods, https://github.com/hpddm/hpddm). HPDDM implements several domain decomposition methods such as RAS, ORAS, FETI, and BNN. It uses multiple levels of parallelism: communication between subdomains is based on the Message Passing Interface (MPI), and computations in the subdomains can be executed on several threads by calling optimized BLAS libraries (such as Intel MKL), or shared-memory direct solvers like PARDISO. Domain decomposition methods naturally offer good parallel properties on distributed architectures. The computational domain is decomposed into subdomains in which concurrent computations are performed. The coupling between subdomains requires communications between computing nodes via messages. The strong scalability of the ORAS preconditioner as implemented in HPDDM for the direct problem presented in Section 2 will be assessed in Section 7. 9 5. Computing the scattering parameters In order to compute the numerical counterparts of the reflection and transmission coefficients obtained by the measurement apparatus of the imaging chamber shown in Figure 1, we use the following formula, which is appropriate in the case of open-ended waveguides: Z Ej · E0i , i, j = 1, . . . , N, (10) Sij = ZΓi 0 2 |Ei | Γi where E0i is the TE10 fundamental mode of the i-th receiving waveguide and Ej is the solution of the problem where the j-th waveguide transmits the signal (Ej denotes the complex conjugate of Ej ). The Sij with i 6= j are the transmission coefficients, and the Sjj are the reflection coefficients. They are gathered in the scattering matrix, also called S-matrix. Here we compare the coefficients computed from the simulation with a set of measurements obtained by EMTensor. For this test case, the imaging chamber was filled with a homogeneous matching solution. The electric permittivity ε of the matching solution is chosen by EMTensor in order to minimize contrasts with the ceramic-loaded waveguides and with the different brain tissues. The choice of the conductivity σ of the matching solution is a compromise between the minimization of reflection artifacts from metallic boundaries and the desire to have best possible signal-to-noise ratio. Here the relative complex permittivity of the matching solution at frequency f = 1 GHz is εgel r = 44 − 20i. The relative complex permittivity inside the ceramic-loaded waveguides is εcer r = 59. The set of experimental data at hand given by EMTensor consists in transmission coefficients for transmitting antennas in the second ring from the top. Figure 3 shows the normalized magnitude (dB) and phase (degree) of the complex coefficients Sij corresponding to a transmitting antenna in the second ring from the top and to the 31 receiving antennas in the middle ring (note that measured coefficients are available only for 17 receiving antennas). The magnitude in dB is calculated as 20 log10 (|Sij |). The normalization is done by dividing every transmission coefficient by the transmission coefficient corresponding to the receiving antenna directly opposite to the transmitting antenna, which is thus set to 1. Since we normalize with respect to the coefficient having the lowest expected magnitude, the magnitude 10 70 simulation measurements 60 magnitude (dB) 50 40 30 20 10 0 5 10 15 20 receiver number 25 30 simulation measurements 0 phase (degree) -500 -1000 -1500 -2000 5 10 15 20 receiver number 25 30 Figure 3: The normalized magnitude (top) and phase (bottom) of the transmission coefficients computed with the simulation and measured experimentally. of the transmission coefficients displayed in Figure 3 is larger than 0 dB. We can see that the transmission coefficients computed from the simulation are in very good agreement with the measurements. 6. The inverse problem The inverse problem that we consider consists in finding the unknown dielectric permittivity ε(x) and conductivity σ(x) in Ω, such that the solutions Ej , j = 1, . . . , N of problem (4) lead to corresponding scattering parameters Sij (10) that coincide with the measured scattering parameters Sijmes , for i, j = 1, . . . , N . In the following, we present the inverse problem in the continuous setting for clarity. Let κ = µ0 (ω 2 ε − iωσ) be the unknown complex parameter of our inverse problem, and let us denote by Ej (κ) the solution of the direct problem 11 (4) with dielectric permittivity ε and conductivity σ. The corresponding scattering parameters will be denoted by Sij (κ) for i, j = 1, . . . , N : Z Ej (κ) · E0i , i, j = 1, . . . , N. Sij (κ) = ΓiZ 0 2 |Ei | Γi The misfit of the parameter κ to the data can be defined through the following functional: Z 2 0 E (κ) · E N N N N j i 1 XX 1 X X Γi 2 Z J(κ) = Sij (κ) − Sijmes = − Sijmes . 2 j=1 i=1 2 j=1 i=1 |E0i |2 Γi (11) In a classical way, solving the inverse problem then consists in minimizing the functional J with respect to the parameter κ. Computing the differential of J in a given arbitrary direction δκ yields Z   0 δE (κ) · E N X N i X   Γi j mes  , δκ ∈ C,  Z DJ(κ, δκ) = <  Sij (κ) − Sij  0 2 j=1 i=1 |Ei | Γi where δEj (κ) is the solution of the following linearized problem:  ∇ × (∇ × δEj ) − κδEj = δκEj in Ω,   δEj × n = 0 on Γm ,   (∇ × δE ) × n + iβn × (δE × n) = 0 on Γi , i = 1, . . . , N. j j (12) We now use the adjoint approach in order to simplify the expression of DJ. This will allow us to compute the gradient efficiently after discretization, with a number of computations independent of the size of the parameter space. Considering the variational formulation of problem (12) with a test 12 function F and integrating by parts, we get Z Z δκEj · F = (∇ × (∇ × δEj ) − κδEj ) · F Ω Z ZΩ (∇ × (∇ × F) − κF) · δEj − ((∇ × δEj ) × n) · F = Ω ∂Ω Z + ((∇ × F) × n) · δEj ∂Ω Z (∇ × (∇ × F) − κF) · δEj + = Ω N Z X i=1 Z (∇ × δEj ) · (F × n) + + Γm N Z X iβ(n × (F × n)) · δEj Γi ((∇ × F) × n) · δEj . Γi i=1 Introducing the solution Fj (κ) of the following adjoint problem  ∇ × (∇ × Fj ) − κFj = 0 in Ω,      Fj × n = 0 on Γm ,  mes (Sij (κ) − Sij ) 0  Z (∇ × F ) × n + iβn × (F × n) = Ei on Γi , i = 1, . . . , N,  j j    |E0i |2  Γi (13) we get Z Z δκEj · Fj = Ω N X E0i · δEj (Sij (κ) − Sijmes ) ΓZi i=1 . |E0i |2 Γi Finally, the differential of J can be computed as DJ(κ, δκ) = N X Z <  δκ Ej · Fj . Ω j=1 We can then compute the gradient to use in a gradient-based local optimization algorithm. The numerical results presented in Section 7 are obtained using a limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) algorithm. Note that every evaluation of J requires the solution of the state problem (4) while the computation of the gradient requires the solution of (4) 13 as well as the solution of the adjoint problem (13). Moreover, the state and adjoint problems use the same operator. Therefore, the computation of the gradient only needs the assembly of one matrix and its associated domain decomposition preconditioner. Numerical results for the reconstruction of a hemorrhagic stroke from synthetic data are presented in the next section. The functional J considered in the numerical results is slightly different from (11), as we add a normalization term for each pair (i, j) as well as a Tikhonov regularizing term: N N 1 X X Sij (κ) − Sijmes J(κ) = 2 2 j=1 i=1 Sijempty 2 α + 2 Z |∇κ|2 , (14) Ω where Sijempty refers to the coefficients computed from the simulation with the empty chamber, that is the chamber filled only with the homogeneous matching solution as described in the previous section, with no object inside. In this way, the contribution of each pair (i, j) in the misfit functional is normalized and does not depend on the amplitude of the coefficient, which can vary greatly between pairs (i, j) as displayed in Figure 3. The Tikhonov regularizing term aims at reducing the effects of noise in the data. For now, the regularization parameter α is chosen empirically so as to obtain a visually good compromise between reducing the effects of noise and keeping the reconstructed image pertinent. All calculations carried out in this section can be accommodated in a straightforward manner to definition (14) of the functional. As is usually the case with most medical imaging techniques, the reconstruction is done layer by layer. For the imaging chamber of EMTensor that we study in this paper, one layer corresponds to one of the five rings of 32 antennas. This allows us to exhibit another level of parallelism, by solving an inverse problem independently for each of the five rings in parallel. More precisely, each of these inverse problems is solved in a domain truncated around the corresponding ring of antennas, containing at most two other rings (one ring above and one ring below). We impose absorbing boundary conditions on the artificial boundaries of the truncated computational domain. For each inverse problem, only the coefficients Sij with transmitting antennas j in the corresponding ring are taken into account: we consider 32 antennas as transmitters and at most 96 antennas as receivers. 14 Time to solution (in seconds) 500 (43) Setup Solve Linear speedup (53) 200 (64) 50 (81) 10 256 512 1 024 # of subdomains 2 048 Figure 4: Strong scaling experiment. Colors indicate the fraction of the total time spent in the setup and solution phases. The number of GMRES iterations is reported in parentheses. 7. Numerical results Results in this paper were obtained on Curie, a system composed of 5,040 nodes made of two eight-core Intel Sandy Bridge processors clocked at 2.7 GHz. The interconnect is an InfiniBand QDR full fat tree and the MPI implementation used was BullxMPI version 1.2.8.4. Intel compilers and Math Kernel Library in their version 16.0.2.181 were used for all binaries and shared libraries, and as the linear algebra backend for dense computations. One-level preconditioners such as (8) assembled by HPDDM require the use of a sparse direct solver. In the following experiments, we have been using either PARDISO [15] from Intel MKL or MUMPS [16]. All linear systems resulting from the edge finite elements discretization are solved by GMRES right-preconditioned with ORAS (8) as implemented in HPDDM. The GMRES algorithm is stopped once the unpreconditioned relative residual is lower than 10−8 . First, we perform a strong scaling analysis in order to assess the efficiency of our preconditioner. We then solve the inverse problem in a realistic configuration, with noisy synthetic data generated using a numerical brain model with a simulated hemorrhagic stroke. 7.1. Scaling analysis Using the domain decomposition preconditioner (8), we solve the direct problem corresponding to the setting of Section 5 where the chamber is filled 15 NS 256 512 1,024 2,048 Setup 293.36 95.11 35.13 25.89 Solve 73.06 36.92 20.55 12.77 # of iterations 43 53 64 81 Speedup 1 2.8 6.6 9.5 Figure 5: Strong scaling experiment. Timings (in seconds) of the setup and solution phases. with a homogeneous matching solution. We consider a right-hand side corresponding to a transmitting antenna in the second ring from the top. Given a fine mesh of the domain composed of 82 million tetrahedra, we increase the number of MPI processes to solve the linear system of 96 million doubleprecision complex unknowns yielded by the discretization of Maxwell’s equation using edge elements. The global unstructured mesh is partitioned using SCOTCH [7] and the local solver is PARDISO from Intel MKL. We use one subdomain and two OpenMP threads per MPI process. Results are reported in Figure 5 and illustrated in Figure 4 with a plot of the time to solution including both the setup and solution phases on 256 up to 2048 subdomains. The setup time corresponds to the maximum time spent for the factorization of the local subproblem matrix Bi in (8) over all subdomains, while the solution time corresponds to the time needed to solve the linear system with GMRES. We are able to obtain very good speedups up to 4096 cores (2048 subdomains) on Curie, with a superlinear speedup of 9.5 between 256 and 2048 subdomains. 7.2. Reconstruction of a hemorrhagic stroke from synthetic data In this subsection, we assess the feasibility of the microwave imaging technique presented in this paper for stroke detection and monitoring through a numerical example in a realistic configuration. We use synthetic data corresponding to a numerical model of a virtual human head with a simulated hemorrhagic stroke as input for the inverse problem. The numerical model of the virtual head comes from CT and MRI tomographic images and consists of a complex permittivity map of 362 × 434 × 362 data points. Figure 6 (left) shows a sagittal section of the head. In the simulation, the head is immersed in the imaging chamber as shown in Figure 6 (right). In order to simulate a hemorrhagic stroke, a synthetic stroke is added in the form of an ellipsoid in which the value of the complex permittivity εr has been increased. For this 16 Figure 6: Left: sagittal section of the brain. Right: numerical head immersed in the imaging chamber, with a simulated ellipsoid-shaped hemorrhagic stroke. test case, the value of the permittivity in the ellipsoid is taken as the mean value between the relative permittivity of the original healthy brain and the relative permittivity of blood at frequency f = 1 GHz, εblood = 68 − 44i. r The imaging chamber is filled with a matching solution. The relative permittivity of the matching solution is chosen by EMTensor as explained in Section 5 and is equal to εgel r = 44 − 20i at frequency f = 1 GHz. In the real setting, a special membrane fitting the shape of the head is used in order to isolate the head from the matching medium. We do not take this membrane into account in this synthetic test case. The synthetic data are obtained by solving the direct problem on a mesh composed of 17.6 million tetrahedra (corresponding to approximately 20 points per wavelength) and consist in the transmission and reflection coefficients Sij calculated from the simulated electric field as in (10). We subsequently add noise to the real and imaginary parts of the coefficients Sij (10% additive Gaussian white noise, with different values for real and imaginary parts). The noisy data are then used as input for the inverse problem. Furthermore, we assume no a priori knowledge on the input data, and we set the initial guess for the inverse problem as the homogeneous matching solution everywhere inside the chamber. We use a piecewise linear approximation of the unknown parameter κ, defined on the same mesh used to solve the state and adjoint problems. For the purpose of parallel computations, the partitioning introduced by the domain decomposition method is also used to compute and store locally in each subdomain every entity involved in the inverse problem, such as the parameter κ and the gradient. 17 Figure 7: Top row: imaginary part of the exact permittivity used to produce noisy data as input for the inverse problem during time evolution of a simulated hemorrhagic stroke (indicated by the black arrow). The size of the ellipsoid is 3.9 cm×2.3 cm×2.3 cm and 7.7 cm×4.6 cm×4.6 cm in the middle and right column respectively. Bottom row: corresponding reconstructions obtained by taking into account only the first ring of transmitting antennas. Figure 7 shows the imaginary part of the exact and reconstructed permittivity for three steps of the evolution of the hemorrhagic stroke, from the healthy brain (left column) to the large stroke (right column). Increasing the size of the ellipsoid in which the value of the permittivity is raised simulates the evolution of the stroke. Each of the three reconstructions in Figure 7 corresponds to the solution of an inverse problem in the truncated domain containing only the first two rings of antennas from the top, and where only the coefficients Sij corresponding to transmitting antennas j in the first ring are taken into account. Each reconstruction starts from an initial guess consisting of the homogeneous matching solution and is obtained after reaching a convergence criterion of 10−2 for the value of the cost functional, which takes around 30 iterations of the L-BFGS algorithm. Figure 8 gathers the results of a strong scaling experiment which consists 18 Time in minutes 16 Linear speedup 8 4 2 1 0.5 64 128 256 512 1 0 2 0 4 0 24 48 96 # of MPI processes Figure 8: Strong scaling experiment: total time needed to obtain the third reconstructed image shown in Figure 7. in solving the same inverse problem corresponding to the third reconstructed image of Figure 7 for an increasing number of MPI processes. We report the total computing time needed to obtain the reconstructed image. For this experiment we use one subdomain and one OpenMP thread per MPI process. The mesh of the computational domain is composed of 674 580 tetrahedra, corresponding to approximately 10 points per wavelength. Note that evaluating the functional or its gradient requires the solution of a linear system with 32 right-hand sides, one right-hand side per transmitter. This introduces a trivial level of parallelism since the solution corresponding to each right-hand side can be computed independently. However when considering a finite number of available processors, there is a tradeoff between the parallelism induced by the multiple right-hand sides and the parallelism induced by the domain decomposition method. Additionally, we solve for multiple right-hand sides simultaneously using a pseudo-block method implemented inside GMRES which consists in fusing the multiple arithmetic operations corresponding to each right-hand side (matrix-vector products, dot products), resulting in higher arithmetic intensity. The scaling behavior of this pseudo-block algorithm with respect to the number of right-hand sides is nonlinear, as is the scaling behavior of the domain decomposition method with respect to the number of subdomains. Thus, for a given number of processors, we find the optimal tradeoff between parallelizing with respect to the number of subdomains or right-hand sides through trial and error. 19 For example, the best computing time for 2048 MPI processes is achieved by using 8 domain decomposition communicators (i.e. 8 concurrent direct solves) with 256 subdomains treating 4 right-hand sides each. Figure 8 shows that we can generate an image with a total computing time of less than 2 minutes (94 seconds) using 4096 cores of Curie. These preliminary results are very encouraging as we are already able to achieve a satisfactory reconstruction time in the perspective of using such an imaging technique for monitoring. This allows clinicians to obtain almost instantaneous images 24/7 or on demand. Although the reconstructed images do not feature the complex heterogeneities of the brain, which is in accordance with what we expect from microwave imaging methods, they allow the characterization of the stroke and its monitoring. 8. Conclusion We have developed a tool that reconstructs a microwave tomographic image of the brain in less than 2 minutes using 4096 cores. This computational time corresponds to clinician acceptance for rapid diagnosis or medical monitoring at the hospital. These images were obtained from noisy synthetic data from a very accurate model of the brain. To our knowledge, this is the first time that such a realistic study (operational acquisition device, highly accurate three-dimensional synthetic data, 10% noise) shows the feasibility of microwave imaging. This study was made possible by the use of massively parallel computers and facilitated by the HPDDM and FreeFem++ tools that we have developed. The next step is the validation of these results on clinical data. Regarding the numerical aspects of this work, we will accelerate the solution of the series of direct problems, which accounts for more than 80% of our elapsed time. We explain here the three main avenues of research: • The present ORAS solver for Maxwell’s equations is a one level algorithm, which cannot scale well over thousands of subdomains. The introduction of a two-level preconditioner with an adequate coarse space would allow for very good speedups even for decompositions into a large number of subdomains. • Recycling information obtained during the convergence of the optimization algorithm will also enable us to improve the performance of the method, see [17]. 20 • Iterative block methods that allow for simultaneous solutions of linear systems have not been fully investigated. Arithmetic intensity would be increased since block methods may converge in a smaller number of iterations while exploiting modern computer architectures effectively. Acknowledgments This work was granted access to the HPC resources of TGCC@CEA under the allocations 2016-067519 and 2016-067730 made by GENCI. This work has been supported in part by ANR through project MEDIMAX, ANR-13MONU-0012. [1] J. C. Lin, M. J. Clarke, Microwave imaging of cerebral edema, Proceedings of the IEEE 70 (5) (1982) 523–524. [2] S. Y. Semenov, D. R. Corfield, Microwave tomography for brain imaging: feasibility assessment for stroke detection, International Journal of Antennas and Propagation. [3] S. Semenov, B. Seiser, E. Stoegmann, E. Auff, Electromagnetic tomography for brain imaging: from virtual to human brain, in: 2014 IEEE Conference on Antenna Measurements & Applications (CAMA), 2014. [4] R. Beck, R. Hiptmair, Multilevel solution of the time-harmonic Maxwell’s equations based on edge elements, International Journal for Numerical Methods in Engineering 45 (7) (1999) 901–920. [5] J.-C. Nédélec, Mixed finite elements in R3 , Numerische Mathematik 35 (3) (1980) 315–341. [6] V. Dolean, P. Jolivet, F. Nataf, An Introduction to Domain Decomposition Methods: algorithms, theory and parallel implementation, SIAM, 2015. [7] F. Pellegrini, J. Roman, SCOTCH: A Software Package for Static Mapping by Dual Recursive Bipartitioning of Process and Architecture Graphs, in: High-Performance Computing and Networking, Springer, 1996, pp. 493–498. 21 [8] G. Karypis, V. Kumar, A fast and high quality multilevel scheme for partitioning irregular graphs, SIAM Journal on Scientific Computing 20 (1) (1998) 359–392. [9] A. St-Cyr, M. J. Gander, S. J. Thomas, Optimized multiplicative, additive, and restricted additive Schwarz preconditioning, SIAM Journal on Scientific Computing 29 (6) (2007) 2402–2425). [10] B. Després, P. Joly, J. E. Roberts, A domain decomposition method for the harmonic Maxwell equations, in: Iterative methods in linear algebra (Brussels, 1991), North-Holland, Amsterdam, 1992, pp. 475–484. [11] X.-C. Cai, M. Sarkis, A restricted additive Schwarz preconditioner for general sparse linear systems, SIAM Journal on Scientific Computing 21 (2) (1999) 792–797. [12] F. Hecht, New development in FreeFem++, Journal of Numerical Mathematics 20 (3-4) (2012) 251–265. [13] P. Jolivet, V. Dolean, F. Hecht, F. Nataf, C. Prud’homme, N. Spillane, High-performance domain decomposition methods on massively parallel architectures with FreeFem++, Journal of Numerical Mathematics 20 (3-4) (2012) 287–302. [14] P. Jolivet, F. Hecht, F. Nataf, C. Prud’homme, Scalable domain decomposition preconditioners for heterogeneous elliptic problems, in: Proc. of the Int. Conference on High Performance Computing, Networking, Storage and Analysis, IEEE, 2013, pp. 1–11. [15] O. Schenk, K. Gärtner, Solving unsymmetric sparse systems of linear equations with PARDISO, Future Generation Computer Systems 20 (3) (2004) 475–487. [16] P. Amestoy, I. Duff, J.-Y. L’Excellent, J. Koster, A fully asynchronous multifrontal solver using distributed dynamic scheduling, SIAM Journal on Matrix Analysis and Applications 23 (1) (2001) 15–41. [17] M. L. Parks, E. De Sturler, G. Mackey, D. D. Johnson, S. Maiti, Recycling Krylov Subspaces for Sequences of Linear Systems, SIAM Journal on Scientific Computing 28 (5) (2006) 1651–1674. 22
5cs.CE
Neural Processing Letters manuscript No. (will be inserted by the editor) An Ensemble Classification Algorithm Based on Information Entropy for Data Streams arXiv:1708.03496v1 [cs.DS] 11 Aug 2017 Junhong Wang · Shuliang Xu · Bingqian Duan · Caifeng Liu · Jiye Liang · Received: 02 Aug 2017 / Accepted: date Abstract Data stream mining problem has caused widely concerns in the area of machine learning and data mining. In some recent studies, ensemble classification has been widely used in concept drift detection, however, most of them regard classification accuracy as a criterion for judging whether concept drift happening or not. Information entropy is an important and effective method for measuring uncertainty. Based on the information entropy theory, a new algorithm using information entropy to evaluate a classification result is developed. It uses ensemble classification techniques, and the weight of each classifier is decided through the entropy of the result produced by an ensemble classifiers system. When the concept in data streams changing, the classifiers’ weight below a threshold value will be abandoned to adapt to a new concept in one time. In the experimental analysis section, six databases and four proposed algorithms are executed. The results show that the proposed method can not only handle concept drift effectively, but also have a better classification accuracy and time performance than the contrastive algorithms. J. Wang 1. School of Computer and Information Technology, Shanxi University, Taiyuan, China 2. Key Laboratory of Computational Intelligence and Chinese Information Processing, Ministry of Education, Taiyuan, China Tel.: +86 0351-7010566 E-mail: [email protected] S. Xu School of Computer and Information Technology, Shanxi University, Taiyuan, China E-mail: [email protected] B. Duan School of Computer and Information Technology, Shanxi University, Taiyuan, China E-mail: [email protected] C. Liu School of Computer Science and Technology, Faculty of Electronic Information and Electrical Engineering, Dalian University of Technology, Dalian, China E-mail: [email protected] J. Liang Key Laboratory of Computational Intelligence and Chinese Information Processing, Ministry of Education, Taiyuan, China E-mail: [email protected] 2 Junhong Wang et al. Keywords data streams · data mining · concept drift · information entropy · ensemble classification 1 Introduction With the development of information society, many fields have produced a large amount of data streams, such as: e-commerce, network monitoring, telecommunication, stock trading, etc. The data in these fields are very different from the conventional static data, due to achieving fast, unlimited number and concept drift in data streams, it makes the technologies of traditional data mining face a big challenge [1]. Since data streams mining problem was proposed, it has received many attentions [2-6]. Especially, it has been widely used when the ensemble classification method was put forward [7]. Li et al. proposed a data stream classification algorithm based on a random decision tree model [8]. The algorithm creates a number of random decision trees, then randomly chooses the split attribute, and determines the split value through the information gain; in addition, the algorithm can effectively distinguish noise data and concept drift. Elwell et al. proposed an incremental learning algorithm for periodic concept drift called Learn++.NSE [9]. Learn++.NSE preserves the historical classification models; when historical classifier to classify the data correctly, the classifier will be improved the weight; after classifying correctly many times, the weight of the historical classifier will reach the activation threshold which is predetermined by a user; the classifier is activated from sleeping state, and then joins to the system to participate in deciding the labels of the unlabeled data. Aiming at the problem of the unbalanced data stream classification, Rushing et al. proposed an incremental algorithm based on the overlaying mechanism called CBEA [10]. While the algorithm training a classifier, the training examples are also saved. When the number of classifiers reaches the threshold, the two most similar coverage sets are selected, and the oldest classifier will be deleted. The final classification results are determined by KNN algorithm. Gomes et al. proposed an adaptive algorithm based on the social network called SAE [11], the algorithm introduces the related concepts of social network and each sub classifier seeing as a node on the network, so a network consists of multiple classifiers. SAE algorithm sets a series of parameters to measure the performances of the classifiers, and updates the classifiers to adapt to the new concept. Brzezinski et al. proposed a data stream classification algorithm based on online data called OAUE [12], the algorithm uses mean square error to determine the weights of classification models; when a period of time for the detection coming, the replacement strategy is used to deal with concept drift. Farid et al. proposed an ensemble classification algorithm based on instances weighting mechanism [13], in order to detect outliers, the algorithm combines with the clustering algorithm, if a data point does not belong to any existed cluster in the system, the class of the data will be thought as a new concept, and then the algorithm counts the data information in leaf nodes to further confirm the result. Liang et al proposed an online sequential learning algorithm called OS-ELM [14-17], OSELM is a development of the extreme learning machine (ELM) algorithm [18-22]; when a new data block coming, OS-ELM uses new data to incrementally update the structures of the single hidden feedforward neural networks; by the mean of the online sequential learning mechanism, OS-ELM can effectively deal with concept drift in data stream environment. For the above ensemble classification algorithms, most of them detect the concept drift based on the accuracy of the classification result. In traditional data stream classification algorithm, accuracy is an important indicator which is used to detect the concept drift, but by using accuracy, it can only characterize current performance, and can not reflect the amount of information contained in An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 3 the information system. Information entropy can be used to measure the degree of uncertainty of a system, and it has been proved to be an effective method to describe the information content in information systems [38-41]. Information entropy is a powerful tool to deal with uncertainty problem, and it has been applied in many fields. Aiming at the problem of the data stream classification, in this paper, we extended information entropy to measure the uncertainty of the concept in data stream, and then an ensemble classification algorithm based on information entropy (ECBE) is proposed. The new algorithm is based on ensemble classification technique; the weighted voting rule is adopted, and the weights of classifiers are determined according to the change of entropy values before and after classification; by using Hoeffding bound, ECBE algorithm can estimate whether concept drift appears or not. When concept drift appearing, the algorithm automatically adjusts the classifiers according to their weights. Comparing with the existed algorithms, the ECBE algorithm not only can effectively detect the concept drift, but also can get better classification results. The rest of the paper is organized as follows: in section 2, we describe the related backgrounds; section 3 introduces the ensemble classification algorithm based on entropy for data stream; section 4 is the experimental process and data analysis; finally, section 5 gives the conclusions and summary. 2 Backgrounds 2.1 Data stream and concept drift We assume {· · · , dt−1 , dt , dt+1 , · · · } is a data stream generated by a system, where dt is the instance generating at t moment; for every instance, we mark dt = {xt , yt }, where xt is the features vector, and yt is the label. In order to illustrate related notions, we have the following definitions. Definition 1. A certain number of instances are organized as a data set according to the time sequence, so we call the data set as data block, which denoted by {d1 , d2 , · · · , dn }, where n is the size of data block. In the data stream classification, because in the face of massive data, the storage space of the data is far beyond the capacity of the computer memory, in order to make the algorithm handle massive data, the sliding window mechanism is widely used [23], in other words, each time, the window is only allowed one data block coming into the system, only if the data blocks in the current window are processed completely, the next data blocks can be acquired. Definition 2. At t moment, the data in sliding window is used to train a classifier, and the target concept we get is M ; ∆t time later, we use new data to train another classifier, and we get the target concept is N ; if M 6= N , we can say concept drift has happened in data stream. According to the different of ∆t, concept drift can be divided into two types: when ∆t is a short time, concept drift is called gradual concept drift; when ∆t is a long time, concept drift is called abrupt concept drift [24,42] 1 After concept drift appearing, the distribution of data in sliding window has changed, and pt (y | x) 6= pt+1 (y | x); at this time, the performance of the classifiers will decline, if the corresponding measures do not be taken, the error rate of the classification results will continuously rise. Therefore, in many applications, this property is used to detect concept drift [25]. 1 http://kns.cnki.net/KCMS/detail/detail.aspx?dbcode=CDFD&dbname=CDFD1214&filename=1013198451 .nh&uid=WEEvREcwSlJHSldRa1FhcEE0NXdoZ2VUa09aRHFDZ2h2cVlMcHpDU3FSYz0=$9A4hF YAuvQ5ob gVAqNKPCYcEjKensW4ggI8Fm4gTkoUKaID8j8gFw!!&v=MjE2MDRIYkt4RnRYSnJwRWJQSVI4ZVgxTHV4W VM3RGgxVDNxVHJXTTFGckNVUkwyZllPUnRGeW5tVTczQVZGMjY= 4 Junhong Wang et al. 2.2 Ensemble classification techniques for data streams Ensemble classification is an important classification method for data streams, which uses a number of weak classifiers to combine into a strong classifier; so the method can effectively deal with the problem of concept drift. In the process of classification, the ensemble classification gives different classifiers with different weights, by adjusting the weights of the sub classifiers to update classifiers system to adapt to the new concept of a data stream, classification result of the data eventually is decided by voting mechanism [26]. In the data stream environment, the classification performance of ensemble classifiers is better than that of single classifier [27]. Because of the many advantages of ensemble classification, the method is widely used in data stream data mining [28-30]. 3 Ensemble classification based on information entropy in data streams 3.1 Concept drift detection based on information entropy Entropy is used to describe the disordered state of thermodynamic system. In physics, entropy is used to indicate the disorder of a system. Shannon extended the concept of the entropy to the information system, and utilized information entropy to represent the uncertainty of a source [31]. The entropy of a variable is greater, and it indicates that the uncertainty of this variable is larger, so it needs more information when changing the state of the variable from uncertain to certain. In the classification of data streams, when data blocks are in the sliding window, at t moment, we assumes a data block in the sliding window is Bi , and Bi = {(x i1 , yi1 ), (x i2 , yi2 ), · · · , (x in , yin )}, where x is the feature matrix of the ith data block, x = {x i1 ; x i2 ; · · · ; x in }, and y is a label set of the ith data block, {yi1 , yi2 , · · · , yin } ⊆ y . So at this time, the entropy of the data in the sliding window is calculated as the equation (1): H=− |y| X pj log pj (1) j=1 Where |y | is the number of the labels in the y , and pk is the probability of the label yk in the instances; pk can be calculated as the equation (2): Pn |yim = yij | (2) pj = m=1 n In the equation (2), if yim = yj , |yim = yij | = 1; else if yim 6= yj , |yim = yij | = 0. By utilizing the classifiers to classify the data block, the classification result can be obtained with a weighted voting mechanism; at the same time, we can use the equations (1)-(2) to calculate the entropy values of the classification result and the real result of the data block which are marked as H1 and H2 respectively. The entropy’s deviation of the data block can be calculated: Ψ (H) = |H1 − H2 | (3) Lemma (Hoeffding bound) [32, 33]. By independently observing a random variable r for n times, the range of the random variable r is R, and the observed q average of r is r̄; when confidence level is 1 − α, the true value of r is at least r̄ − ε, where ε = 1 R2 ln( α ) . 2n An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 5 Theorem 1. When the concept of a data stream (the distribution of the data) is stable, S1 and S2 are the deviation of the two adjacent data blocks which are calculated according to the equation (3), so it can be known that: s R2 ln( α1 ) |S1 − S2 | ≤ 2 (4) 2n Proof: When the concept of a data stream is stable, the data distributions of the two adjacent data blocks are consistent, and the difference of the observed entropy values is very small. Let S0 be the real entropy of the data block according to the equation (3), from the Hoeffding bound, it is known that: |S1 − S0 | ≤ ε and |S2 − S0 | ≤ ε So it have: −ε ≤ S1 − S0 ≤ ε; −ε ≤ S0 − S2 ≤ ε If plus the two inequalities, the result is as follow: −2ε ≤ S1 − S2 ≤ 2ε So it can get |S1 − S2 | ≤ 2ε. Therefore, it can use ∆H = |Ψ (H1 ) − Ψ (H2 )| as a measure to detect the concept drift in data streams, where Ψ (H1 ) and Ψ (H2 ) are the deviation of the two adjacent data blocks. If ∆H > 2ε, it is thought concept drift has appeared. But it is obvious that when a special situation occurring, only using ∆H cannot work well: if the two adjacent data blocks represent different concepts, so the classification accuracies of the two adjacent data blocks are very low and they are almost equal; while calculating ∆H, it is still less than or equal to 2ε, and the algorithm will think no change happening, but in fact, concept drift has appeared at this time. In order to solve the problem, we correct the decision criterion of concept drift: ∆H > 2ε or Ψ (H1 ) > 2ε or Ψ (H2 ) > 2ε (5) we can say concept drift has appeared. From the equation (5), it is known that when the two adjacent data blocks occuring two concept drifts, ∆H will be less than or equal to 2ε , however, Ψ (H1 ) or Ψ (H2 ) will be still greater than 2ε, so concept drift will be detected. For each sub classifier ensemble(j), (j = 1, 2, 3, · · · , k); according to the classification results of the current data block, the entropy of the classification result and real result marked as hi and Hi can be calculated by using the equation (1); so the change of the entropy before and after classification is Ψ (hi ) = |hi − Hi |, and the weights of the classifiers are updated according to the equation (6): ensemble(j).weight(t) = δ(Ψ (hi )) · ensemble(j).weight(t − 1) (6) In the equation (6), ensemble(j).weight(t) is the new weight, and ensemble(j).weight(t − 1) is the weight before updating. The function δ(Ψ (hi )) is showed as the equation (7) :  1  Ψ (hi ) > 0 δ(Ψ (hi )) = e1+Ψ (hi ) (7)  β, β is constant and β > 1 Ψ (hi ) = 0 6 Junhong Wang et al. Theorem 2. If the concept of the data stream is stable, w1 , w2 , w3 , · · · , wn are the weights of the ensemble classifiers which are updated on the basis of the equation (6), and the confidence level is 1 − α, for each sub classifier, the weight must satisfy the following condition: n S 1X wq − √ tα (n − 1) − 3S wi ≥ n q=1 n S2 = n m 1 X 1X ( wq − wm )2 . n − 1 m=1 n q=1 Proof: If the concept of a data stream is stable, each sub classifier in the system is adaptive to the current concept; therefore, the difference of the classifier weights before after classifying is very small. We assume that the weights of the ensemble classifiers according with a normal distribution, so the mean and variance of the weights are calculated as: µ= n n 1 X 1X wq and S 2 = (µ − wm )2 n q=1 n − 1 m=1 So we have: ( P µ−w √S n ) 6 tα (n − 1) =1−α From the inequality, it can be known   S P w ≥ µ − √ tα (n − 1) = 1 − α n At the level of confidence 1 − α, we have S w ≥ µ − √ tα (n − 1) n We use S to approximately replace the standard deviation of the normal distribution δ, according to the 3δ principle of the normal distribution, it can conclude: n wi ≥ w − 3S ≥ S 1X wq − √ tα (n − 1) − 3S. n q=1 n From the theorem 2, we can see that when concept drift appearing, the algorithm will obtain the statistic about the weights of all classifiers from this time to the last time when the last concept drift happening, and the lower limit of the updating weight for each sub classifier is calculated as follow: n θ weight = 1X S wq − √ tα (n − 1) − 3S n q=1 n (8) According to the classification result of sub classifiers for the new data, the weights are updated by using the equation (6). When the classifiers cannot adapt to the current concept, the weights of the classifiers will sharply decreases below θ weight. Finally, the system will delete all classifiers which does not satisfy the equation (8), so in the next process of the classification, the classifiers with low performances do not continue to participate in the decision-making. An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 7 3.2 The execution of the ECBE algorithm From the above knowledge, we can know that the implementation steps of ECBE are as follows: Algorithm 1 ECBE Input: Ensemble classifier: ensemble=NULL; data stream S ; the number of sub classifier: k ; the size of data block: winsize; the array preserving the weights of the classifiers in the period of two adjacent concept drifts: num=NULL; Output: The trained classifiers: ensemble. 1: while S !=NULL do 2: Read winsize instances to organize a data block; 3: if size(ensemble)< k then 4: Use Bi to train a new classifier Cj ; 5: ensemble ← ensemble ∪ Cj and Cj .weight = 1; 6: else 7: Use the equation (3) to calculate the entropies Ψ (H1 ) and Ψ (H2 ); 8: for each ensemble(t) ∈ ensemble //updating the weights of the classifiers do 9: Calculate the entropy ht of the result which is from the ensemble(t) classifying the data block Bi , and update the weights of the classifiers according to the equation (6); 10: num ← num ∪ ensemble(t).weight; 11: end for 12: if ∆H > 2ε or Ψ (H1 ) > 2ε or Ψ (H2 ) > 2ε // concept drift then 13: Delete the classifier with the minimum weight; 14: Calculate the weight θ weight according to the equation (8); 15: num=NULL; 16: end if 17: Delete the classifier with weights less than θ weight; 18: Use Bi to train a new classifier Cnew ; 19: if size(ensemble)>=k then 20: Delete the classifier with the minimum weight; 21: end if 22: ensemble = ensemble ∪ Cnew ; 23: Use Bi to train each classifier in the system; 24: end if 25: end while In the ECBE algorithm, it uses entropy to detect concept drift; if the data block does not appear concept drift, the classifiers system will have a good performance, so the classification results and the actual labels are nearly consistent, and the difference of the two entropies is very small. When concept drift appearing, the error rate of the classification result will increase; the difference of the entropy will also increase, the increment will promote that concept drift in the data stream can be detected. After concept drift is detected, some classifiers in the system are unable to adapt to the current concept; if the defunct classifiers are not eliminated, it will not only decreases the accuracy of the classification results, but also gives a false alarm about concept drift. In order to solve this problem, ECBE algorithm preserves all the weights of the classifiers where the concept of 8 Junhong Wang et al. the data is stable in a period of two adjacent concept drift. When concept drift happens, by saving the statistical weights, the lower bound of the weight when the concept is stable can be computed. Meanwhile, because of the concept changing, the weights of the classifiers will be dramatically reduced, so all the classifiers whose weights are below the lower bound will be deleted; the measure ensures that the classifier system can adapt to new concept at a very fast speed. 4 Experimental analysis In order to validate the performance of ECBE algorithm, in this paper, we chosen SEA [34], AddExp [35], AWE [27], DCO [36],WEAP I[4], TOS-ELM [20] and OS-ELM [14] as the comparison algorithms; C4.5, CART and Naive Bayesian et al. are used as base classifiers; all the algorithms were tested on the three artificial datasets: waveform, Hyperplane and LED which were produced by MOA platform [37] and the three practical datasets: sensor reading 24, shuttle and page-blocks. The parameters of the experimental environment are as follows: Windows7 operating system, Intel dual core CPU, 4 G memory. The algorithm is implemented by R2013a Matlab. 4.1 The descriptions of the datasets The datasets using in the experiment are cited from UCI datasets. We noly give a brief explain about the datasets, and the detail can be see from the website 2 . waveform dataset: it is an artificial dataset and the data set has 50000 instances. Each instance has 22 attributes; the first 21 attributes are numeric and there are 3 different labels in the dataset. LED dataset: the dataset has 50000 instances, each of which contains 25 attributes, and the values of the first 24 attributes are 0 or 1. There are 10 different labels in the dataset; the data contains 5% of the noise. Hyperplane dataset: Pd hyperplane satisfies the following mathePd a sample X in a d dimensional matical expression: i=1 ai xi = a0 , where a0 = 21 i=1 ai . The dataset contains 50000 instances Pd and 11 dimensions; the values of the first 10 dimensions are in [0, 1]. If i=1 ai xi ≥ a0 , the label of the instance is marked as positive, otherwise, the label of the instance is marked as negative. In addition, the dataset contains 10% noise. sensor reading 24 dataset: the dataset contains 5456 instances and 25 properties. The first 24 properties are real; there are 4 different labels in the dataset. shuttle dataset: the dataset contains 43500 instances and 11 attributes. The values of the first 10 attributes are continuous; there are 7 different labels in the dataset. page-blocks dataset: the dataset contains 5473 instances and 11 attributes. In the first 10 attributes, some attributes values are continuous, and some of them are discrete. There are 5 different labels in the dataset. 4.2 The experimental results In order to verify the performance of the ECBE algorithm, SEA, AddExp, AWE, DCO, WEAP I, TOSELM and ECBE are run on the three artificial datasets: waveform, Hyperplane and LED. For 2 http://archive.ics.uci.edu/ml/datasets.html An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 9 all the algorithms, k = 5, winsize=2000; the parameters of AddExp are as follows: β = 0.5, γ = 0.1; the parameters of ECBE are as follows: α = 0.05, β = 0.5, γ = 0.1; the test results are showed in Tables 1 and 2. Table 1 Average accuracy on the artificial datasets SEA AddExp AWE DCO WEAP I TOSELM ECBE waveform Hyperplane LED 0.6777 0.3701 0.6653 0.6628 0.7090 0.5411 0.7583 0.6925 0.5404 0.6912 0.7086 0.6349 0.6349 0.7109 0.2878 0.1622 0.2715 0.3040 0.4165 0.3143 0.8145 Table 2 Time overhead on the artificial datasets (Unit: sec) SEA AddExp AWE DCO WEAP I TOSELM ECBE waveform Hyperplane LED 2743.422 1124.080 2272.473 1084.533 225.9743 0.01633 164.946 1429.004 1123.530 1004.433 407.561 99.3225 0.0338 85.381 6.2156 1249.691 4.8481 2.5660 4.0223 0.1407 26.551 From Tables 1 and 2, it is known that, on the three artificial datasets, for ECBE, the accuracy is the highest and the time overhead is far less than the other compared algorithms on most datasets except for TOSELM; the comprehensive performance of ECBE is the best of all. From the data Table 1, comparing with the other algorithms, AddExp has the lowest accuracy, and it is time consuming. The reason for the result is that AddExp updates the classifiers based on a single data; on the three datasets, the data contains gradual concept drift, and the concept of the data is constantly and slowly changing, which makes the accuracy of the old classifier decreasing; when an instance is classified wrongly by a classifier, the algorithm would eliminate the classifier to deal with the concept drift, however, the classifiers in the AddExp algorithm can get a better performance only after trained many times; due to the training for the new classifiers is inadequate, the error rate of the classification result is very higher, which will lead to the more classifier being replaced, so all the classifiers filling in the system are not trained adequately and the AddExp algorithm has a higher error rate on the three datasets. From Table 1, for the LED dataset, the accuracies of the algorithms are very low except the ECBE algorithm. On the LED dataset, there are 7 attributes relating to concept drift, and the others are redundant attributes. When concept drift appearing, the speed of the concept changing on the LED dataset is faster than that on the waveform and Hyperplane datasets; the three algorithms: SEA, AddExp and AWE delete the classifiers with low performance on the basis of a single classifier, so it will take a long training time to completely eliminate the weak classifiers; when the speed of 10 Junhong Wang et al. concept drift is lower than the elimination speed, the performance of the classifiers will be always at a low level. For the ECBE algorithm, when a concept drift is detected, the weights of the classifier will be greatly reduced, however, ECBE will delete all weak classifiers according to their weights at a time, so ECBE can adapt to the new concept at a fast speed. In this experiment, it shows the performance of ECBE is the best of all. In order to verify the effectiveness of the algorithm to deal with the practical datasets, SEA, AddExp, AWE, DCO, WEAP I, TOSELM and ECBE are run on the sensor reading 24, shuttle and page-blocks datasets, For all the algorithms, the maximum number of classifiers k =5; in the sensor reading 24 and page-blocks datasets, the size of data block winsize=200 and on the others datasets, winsize=2000; the parameters of AddExp are as follows: β = 0.5, γ = 0.1; the parameters of ECBE are as follows: α = 0.05, β = 2, γ = 0.1; the obtained results are shown in Tables 3 and 4. Table 3 Average accuracies on the practical datasets SEA AddExp AWE DCO WEAP I TOSELM ECBE sensor reading 24 shuttle page-blocks 0.8168 0.5715 0.8673 0.8458 0.9500 0.5608 0.7939 0.8717 0.8127 0.8691 0.8615 0.9054 0.8333 0.9137 0.8923 0.7877 0.9235 0.9231 0.9035 0.8973 0.9215 Table 4 Average time overhead on the real datasets (Unit: sec) SEA AddExp AWE DCO WEAP I TOSELM ECBE sensor reading 24 shuttle page-blocks 269.944 132.719 235.112 78.760 9.7250 2.1260 1.678 1163.610 1028.906 945.015 365.326 54.9151 2.1030 1.156 98.826 127.921 66.186 20.060 3.9338 1.2650 1.013 From Tables 3 and 4, it can be known that all the algorithms get good performances on the practical datasets. The accuracy of ECBE is most prominent only on the shuttle dataset, but every accuracy of the algorithm is more than 0.79 and the accuracies of ECBE on the other datasets are very close to the best results; in addition, for the time overhead, ECBE is far less than the comparison algorithms, so the advantage of ECBE is very obvious. From the data in Tables 3 and 4, the performances of SEA, AddExp, AWE, DCO, WEAP I and TOSELM testing on the three practical datasets are very close and most of them have achieved good results. On the sensor reading 24, shuttle and page-blocks datasets, the data whose labels are the same is highly concentrated; in most cases, the data distribution of two adjacent data blocks is consistent, and the classification model trained by the data has a better adaptability for new data, so the most performances of the eight algorithms are very good on the practical datasets. After An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 11 analyzing Tables 1-4, SEA, AddExp, AWE and DCO are effective for the datasets where the data with the same labels is highly concentrated, but when dealing with the datasets containing gradual concept drift, the performance of those algorithms are not satisfactory; if we analyze the results of ECBE, it is very obvious that ECBE can deal with the two types of concept drift. In the ECBE algorithm, we use the equation (8) to calculate the threshold which judges the change of the entropy of data stream, and the threshold has an important influence on the performance of the algorithm; in the algorithm, the n in the equation (8) is 20 × winsize. To explore the impact of the winsize values for the algorithm, we select the waveform dataset as the experimental data, and the parameters of ECBE are as follows: α = 0.05, β = 2, γ = 0.1; we run the ECBE algorithm, and the results are showed in Table 5 and Fig.1-6. Table 5 Average accuracy with different winsize values winsize 800 1000 1200 1400 1600 1800 2000 2200 2400 Hyperplan LED shuttle waveform 0.7050 0.5961 0.8922 0.7602 0.6968 0.8284 0.9143 0.7565 0.7051 0.7403 0.9002 0.7559 0.7081 0.8245 0.9013 0.7556 0.7041 0.8165 0.9115 0.7561 0.7132 0.8151 0.9042 0.7561 0.7109 0.8145 0.9979 0.7583 0.7065 0.8166 0.9145 0.7519 0.7080 0.8131 0.9604 0.75 winsize 20 40 60 80 100 120 140 160 190 page sensor 0.9409 0.9474 0.9220 0.8000 0.9275 0.7349 0.9303 0.7913 0.9096 0.6758 0.9150 0.7724 0.9109 0.8083 0.9287 0.7664 0.9193 0.7623 Fig. 1 Test result with different winsize values on Hyperplane In the Fig.1-6 and Table 5, under the situation of different winsize values, it can be seen, from the test result of the individual data blocks and the entire test results, there is no obvious linear rule between the winsize values and the performance of ECBE. For the ECBE algorithm, a small winsize value can lead to a large threshold, which can make ECBE is not too sensitive to the change of data distribution, but a small data block will cause the classifiers trained by the data are under 12 Junhong Wang et al. Fig. 2 Test result with different winsize values on LED Fig. 3 Test result with different winsize values on shuttle fitting, so the performance of the classifiers system will not be remarkably improved. If the winsize value is very large, it will lead to a small threshold, which makes the algorithm is too sensitive to the change of data distribution, so the classifiers will give a false alarm of concept drift and affect the performance of ECBE. Therefore, on a practical application, the value of winsize needs to consider the data distribution and the speed of concept changing; after trying many times, we select the optimal winsize value from a series of candidate values. In order to study the anti noise performance of ECBE, we select the waveform dataset as the experimental data, and add 5%, 10%, 15% and 20% noise. The parameters of ECBE are set as follows: winsize=2000, α = 0.05, β = 2, γ = 0.1. We run the ECBE algorithm on the datasets, and the test results are showed in the Fig.7 and Table 6. From the Fig.7, it can be known that the accuracy of ECBE also gradually reduces with the increase of noise. From the table 6, we can see, comparing with the data containing 5% noise, An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 13 Fig. 4 Test result with different winsize values on waveform Fig. 5 Test result with different winsize values on page Table 6 Average accuracy of algorithm with different noise Noise 5% 7% 10% 12% 15% 17% 20% 25% Average accuracy 0.7348 0.7263 0.7167 0.7009 0.6929 0.6863 0.6842 0.6678 when the noise increasing 2%, 5%, 7%, 10%, 12% ,15% and 20%, the accuracy of ECBE only decreases 0.0085, 0.0181, 0.0339, 0.0419, 0.0485, 0.0506 and 0.067 respectively and the magnitude of the change is very small, thus it is known that ECBE has a good noise immunity. The good noise immunity of ECBE comes from the elimination strategy; when the noise in the data stream is increasing, the difference of the entropies of the classification results and the actual results increases, and the weights of classifiers will decay at a fast speed. If the weights are below a specified threshold, 14 Junhong Wang et al. Fig. 6 Test result with different winsize values in Hyperplane on sensor reading 24 Fig. 7 Test result with different noise level the classifiers trained by the noise data will be deleted, so the weak classifiers will not affect the classification of new data. In order to further test the performance of ECBE, we compare ECBE with a representative neural network algorithm called OS-ELM on the 6 datasets and test OS-ELM with different activation functions. In the experiment, we choose radbas, sigmoid, sine and hardlim functions as the activation functions. The parameters of ECBE are as follows:α = 0.05, β = 2, γ = 0.1; the test results are showed in Tables 7 and 8. From Table 7, it can be seen, for the accuracy, ECBE is better than OS-ELM on 4 datasets; on the waveform and Hyperplane datasets, when the activation function of OS-ELM is sigmoid, OSELM is better than ECBE, but in fact, the advantage is very weak, after calculating, we can know the accuracies of OS-ELM are only more 0.0124 and 0.0194 than that of ECBE. In the aspect of time overhead, ECBE is better than OS-ELM on 4 datasets and OS-ELM is only better than ECBE An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 15 Table 7 Average accuracy testing on datasets ECBE waveform Hyperplane LED sensor reading 24 shuttle page-blocks 0.7505 0.7080 0.8119 0.7938 0.9971 0.9321 radbas OS-ELM sigmoid sine 0.3270 0.7020 0.2100 0.5645 0.7825 0.7888 0.7629 0.7274 0.7480 0.4366 0.8364 0.9127 hardlim 0.3595 0.6936 0.4737 0.4740 0.4618 0.4034 0.7116 0.6763 0.4673 0.6562 0.8584 0.8977 winsize 2500 2500 2500 300 1500 300 Table 8 Time overhead on datasets (Unit: sec) radbas OS-ELM sigmoid sine hardlim 74.5529 72.9289 73.3113 0.3586 99.4194 0.6552 72.5873 74.4905 72.6981 0.2652 24.1985 0.2964 72.6185 73.6169 72.5395 0.3486 24.1802 0.3987 ECBE waveform Hyperplane LED sensor reading 24 shuttle page-blocks 144.6957 68.7527 24.1768 0.8221 7.7122 0.8741 71.9789 773.6481 73.9757 0.3588 24.1958 0.2187 Table 9 The number of concept drift detected by ECBE Dataset Hyperplane SEA waveform RBF number accuracy winsize 6 0.6420 100 4 0.7460 100 6 0.746 100 7 0.2002 1650 on 2 datasets. If we synthetically consider the time overhead and accuracy of the two algorithms, on the sensor reading 24, although ECBE costs more time, the accuracy of ECBE is far higher than that of OS-ELM, so ECBE is still better than OS-ELM. From the analyses, it is obvious that ECBE is the best of all. In order to verify the ability of ECBE detecting the concept drift, we select Hyperplane, SEA, waveform and RBF as experimental datasets which are produced by MOA. In consideration of concept drift in the datasets unknown to us, so we reprocess Hyperplane, SEA and waveform, and make the three dataset contain 5 concept drift in which the label changes form 1 to 2 or reverse direction changing. The size of the four datasets are 3000, 3000, 3000 and 50000 respectively. The results are shown in Table 9 and Fig.8. From Fig.8, we can see when concept drift appearing, the accuracy of ECBE will degrade rapidly, and then ECBE will delete classifiers with weak performance, so the accuracy will be restored to the previous high level. In the experiment, ECBE detects concept drift for 15 times; from Table 9, we can know, on the Hyperplane and waveform datasets, the algorithm has detected all concept drifts, but producing a error alert; on the SEA dataset, no error alert has produced, but a real changing is omitted; RBF is a gradual concept drift dataset which is generated by computer and the number of concept drift in the datset is unknown; we use RBF to test the effectiveness of ECBE handling gradual concept drift; from the result on RBF, it is obvious that ECBE can detect gradual concept drift. So in summary, we can include that although there are some deviations for concept 16 Junhong Wang et al. Fig. 8 Test result with different datasets of ECBE drift detection in the algorithm, the experimental data indicates the mechanism of ECBE detecting concept drift is effective and ECBE can cope with different types of concept drift. 5 Conclusion In this paper, to solve the classification problem of the data streams, an ensemble classification algorithm based on information entropy was proposed. The algorithm is on the basis of the ensemble classification method, and utilizes the change of entropies before and after classification to detect concept drift. The experimental results show that ECBE is effective. But it is obvious that the ECBE algorithm is only suitable for the single labeled data, so how to apply the algorithm to the classification of multi-label data is the focus of our future research. Acknowledgments This work was supported by National Natural Science Fund of China (Nos.U1435212, 61432011, 61202018, 61303008),National Key Basic Research and Development Program of China (973) (No.2013CB329404). The authors are grateful to the editor and the anonymous reviewers for constructive comments that helped to improve the quality and presentation of this paper. References [1] J. Gama, R. Sebasti, P.P. Rodrigues, Issues in evaluation of stream learning algorithms, Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, (ACM, Paris, France, 2009), pp. 329-338. [2] L.L. Minku, X. Yao, DDD: A New Ensemble Approach for Dealing with Concept Drift, IEEE Transactions on Knowledge & Data Engineering, 24 (2011) 619-633. [3] A. Bifet, G. Holmes, B. Pfahringer, R. Kirkby, Gavald, R. , New ensemble methods for evolving data streams, ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (ACM 2009), pp. 139–148. [4] Z Ouyang, M Zhou, et al. Mining concept-drifting and noisy data streams using ensemble classifiers. Artificial Intelligence and Computational Intelligence, 2009. AICI’09. International Conference on. Vol. 4. IEEE, 2009. An Ensemble Classification Algorithm Based on Information Entropy for Data Streams 17 [5] X. Wu, P. Li, X. Hu, Learning from concept drifting data streams with unlabeled data, Neurocomputing, 92 (2012) 145-155 [6] D. Liu, Y. Wu, H. Jiang, FP-ELM: An online sequential learning algorithm for dealing with concept drift, Neurocomputing, 207 (2016) 322-334. [7] P. Jedrzejowicz, I. Czarnowski, R.J. Howlett, L.C. Jain, I. Czarnowski, P. J drzejowicz, Ensemble Classifier for Mining Data Streams, Procedia Computer Science, 35 (2014) 397-406. [8] P. Li, X. Wu, X. Hu, H. Wang, Learning concept-drifting data streams with random ensemble decision trees, Neurocomputing, 166 (2015) 68-83. [9] R. Elwell, R. Polikar, Incremental Learning of Concept Drift in Nonstationary Environments, IEEE Transactions on Neural Networks, 22 (2011) 1517-1531. [10] J. Rushing, S. Graves, E. Criswell, A. Lin, A Coverage Based Ensemble Algorithm (CBEA) for Streaming Data, IEEE International Conference on TOOLS with Artificial Intelligence (2004), pp. 106-112. [11] H. Murilo Gomes, F. Enembreck, SAE: Social Adaptive Ensemble classifier for data streams, Computational Intelligence and Data Mining (2013), pp. 199-206. [12] D. Brzezinski, J. Stefanowski, Combining block-based and online methods in learning ensembles from concept drifting data streams, Information Sciences An International Journal, 265 (2014) 50-67. [13] D.M. Farid, L. Zhang, A. Hossain, C.M. Rahman, R. Strachan, G. Sexton, K. Dahal, An adaptive ensemble classifier for mining concept drifting data streams, Expert Systems with Applications, 40 (2013) 5895-5906. [14] N.Y. Liang, G.B. Huang, P. Saratchandran, N. Sundararajan, A Fast and Accurate Online Sequential Learning Algorithm for Feedforward Networks, IEEE Transactions on Neural Networks, 17 (2006) 1411-1423. [15] J.S. Lim, S. Lee, H.S. Pang, Low complexity adaptive forgetting factor for online sequential extreme learning machine (OS-ELM) for application to nonstationary system estimations, Neural Computing & Applications, 22 (2013) 569-576. [16] V. Kumar, P. Gaur, A.P. Mittal, Trajectory control of DC servo using OS-ELM based controller, Power India Conference, 2012 IEEE Fifth (2012), pp. 1-5. [17] Z. Yang, Q. Wu, C. Leung, C. Miao, OS-ELM Based Emotion Recognition for Empathetic Elderly Companion (Springer International Publishing, (2015). [18] G.B. Huang, H. Zhou, X. Ding, R. Zhang, Extreme learning machine for regression and multiclass classification, IEEE Transactions on Systems Man & Cybernetics Part B Cybernetics A Publication of the IEEE Systems Man & Cybernetics Society, 42 (2012) 513-529. [19] G.B. Huang, Q.Y. Zhu, C.K. Siew, Extreme learning machine: Theory and applications, Neurocomputing, 70 (2006) 489-501. [20] Gu, Yang, et al., TOSELM: timeliness online sequential extreme learning machine. Neurocomputing 128 (2014): 119-127. [21] Z. Ma, G. Luo, D. Huang, Short term traffic flow prediction based on on-line sequential extreme learning machine, Eighth International Conference on Advanced Computational Intelligence (2016). [22] P. Escandell-Montero, D. Lorente, J.M. Martnez-Martnez, E. Soria-Olivas, J. Vila-Frances, J.D. Martn-Guerrero, Online fitted policy iteration based on extreme learning machines, Knowledge-Based Systems, 100 (2016) 200-211. [23] H. Ryang, U. Yun, High utility pattern mining over data streams with sliding window technique, Expert Systems with Applications, 57 (2016) 214-231. [24] H. Becker, M. Arias, Real-time ranking with concept drift using expert advice, ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (2007), pp. 86-94. [25] J. Gama, P. Medas, P.P. Rodrigues, Learning decision trees from dynamic data streams, ACM Symposium on Applied Computing (2005), pp. 685-688. [26] D. Brzezinski, J. Stefanowski, Reacting to different types of concept drift: the Accuracy Updated Ensemble algorithm, IEEE Transactions on Neural Networks & Learning Systems, 25 (2014) 81 - 94. [27] H. Wang, W. Fan, P.S. Yu, J. Han, Mining concept-drifting data streams using ensemble classifiers, Kdd, (2003) 226-235. [28] Z. Ouyang, M. Zhou, T. Wang, Q. Wu, Mining Concept-Drifting and Noisy Data Streams Using Ensemble Classifiers, International Conference on Artificial Intelligence and Computational Intelligence (2009), pp. 360-364. [29] Q. Wei, Z. Yang, Z. Junping, W. Yong, Mining multi-label concept-drifting data streams using ensemble classifiers, International Conference on Fuzzy Systems & Knowledge Discovery (2009), pp. 789. [30] S. Ramamurthy, R. Bhatnagar, Tracking Recurrent Concept Drift in Streaming Data Using Ensemble Classifiers, International Conference on Machine Learning and Applications (2007), pp. 404-409. [31] C.E. Shannon, A mathematical theory of communication (McGraw-Hill, 1974). [32] L. Rutkowski, L. Pietruczuk, P. Duda, M. Jaworski, Decision Trees for Mining Data Streams Based on the McDiarmid’s Bound, Knowledge & Data Engineering IEEE Transactions on, 25 (2013) 1272-1279. [33] P. Domingos, G. Hulten, Mining high-speed data streams, ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (2000), pp. 71-80. [34] W.N. Street, A streaming ensemble algorithm (SEA) for large-scale classification, ACM SIGKDD International Conference on Knowledge Discovery & Data Mining (2001), pp. 1152-1165. [35] J.Z. Kolter, M.A. Maloof, Using additive expert ensembles to cope with concept drift, International Conference, Bonn, Germany, August (2005), pp. 449–456. [36] Y. Zhang, X. Jin, An automatic construction and organization strategy for ensemble learning on data streams, SIGMOD Rec., 35 (2006) 28-33. [37] A. Bifet, G. Holmes, R. Kirkby, B. Pfahringer, MOA: Massive Online Analysis, Journal of Machine Learning Research, 11 (2010) 1601-1604. [38] Xie Z, Tie Y, Guan L. A new audiovisual emotion recognition system using entropy-estimation-based multimodal information fusion, IEEE International Symposium on Circuits and Systems. IEEE, 2015:726-729. [39] Zhang X, Mei C, Chen D, et al., Feature selection in mixed data: A method using a novel fuzzy rough set-based information entropy, Pattern Recognition, 2016, 56(1):1-15. 18 Junhong Wang et al. [40] Chen Y, Zhang Z, Zheng J, et al., Gene selection for tumor classification using neighborhood rough sets and entropy measures, Journal of Biomedical Informatics, 2017, 67:59-68. [41] Y Li,D Li,S Wang,Y Zhai, Incremental entropy-based clustering on categorical data streams with concept drift, KnowledgeBased Systems, 2014, 59:33-47. [42] Y Yao, L Feng, The Research on Massive and Dynamic Data Stream Classification Method, Dalian University of Technology, 2013. (in Chinese)
8cs.DS
arXiv:1401.2170v1 [math.AC] 9 Jan 2014 THE MULTIPLICATIVE STRUCTURE ON HOCHSCHILD COHOMOLOGY OF A COMPLETE INTERSECTION RAGNAR-OLAF BUCHWEITZ AND COLLIN ROBERTS Dedicated to Hans-Bjørn Foxby in admiration Abstract. We determine the product structure on Hochschild cohomology of commutative algebras in low degrees, obtaining the answer in all degrees for complete intersection algebras. As applications, we consider cyclic extension algebras as well as Hochschild and ordinary cohomology of finite abelian groups. Contents 1. Introduction 2. Statement of Results 3. Tate Models for the Multiplication Map of an Algebra 4. Diagonal Approximation and Graded Commutativity 5. Products in Low Degree 6. Proof of Theorem 2.5 7. Hochschild Cohomology of Homological Complete Intersections 8. The Case of One Variable 9. Cohomology of Finite Abelian Groups References 1 2 7 9 12 17 18 20 24 27 1. Introduction 1 For any associative algebra A over a commutative ring K, the Hochschild cohomology ring HH(A/K, A) with its cup (or Yoneda) product is graded commutative by Gerstenhaber’s fundamental result [20]. However, it is not necessarily strictly graded commutative, that is, the squaring operation HH2i+1 (A/K, A) → 2 HH4i+2 (A/K, A), for i > 0, from Hochschild cohomology in odd degrees to, necessarily, the 2–torsion of the Hochschild cohomology in twice that degree, might be nontrivial. Indeed, this is already so in the simplest example. If A = K[x]/(x2 ) with 2 = 0 in K, then the Hochschild cohomology ring of A over K is isomorphic to a polynomial Date: January 13, 2014. 2000 Mathematics Subject Classification. 13D03 16E40 13C40 18G10 . Key words and phrases. Hochschild cohomology, complete intersection, Tate model, diagonal approximation, cup and Yoneda product, strictly graded commutative, group cohomology. The authors were partly supported by NSERC grant 3-642-114-80 and this material is based upon work supported by the National Science Foundation under Grant No. 0932078 000, while the first author was in residence at the Mathematical Science Research Institute (MSRI) in Berkeley, California, during the semester of Jan.–May 2013. 1 All our rings have a multiplicative identity and ring homomorphisms are unital. 1 2 R.-O. BUCHWEITZ AND C. ROBERTS ring over A in one variable, HH(A/K, A) ∼ = A[z], where A ∼ = HH0 (A/K, A) is of cohomological degree zero, and the variable z is of degree one, representing the class ∂/∂x ∈ DerK (A, A) ∼ = HH1 (A/K, A). As we are in characteristic 2, this ring is indeed graded commutative, but certainly not strictly so, the square of z 2i+1 ∈ HH2i+1 (A/K, A) returning the non-zero element z 4i+2 ∈ HH4i+2 (A/K, A). The purpose here is to clarify the structure of this squaring map in the simplest case, when i = 0 and A is commutative. We will then deduce from this the entire ring structure when A is a homological complete intersection over K. The crucial point is that the square of a derivation with respect to cup product, as an element in HH2 (A/K, A), is determined by the Hessian quadratic forms associated to the defining equations. The key technical tool we use is the Tate model of the multiplication map µ : Aev = A ⊗K A → A for a commutative K–algebra A. We show that the Postnikov tower of such model carries a family of compatible co-unital diagonal approximations and we give an explicit description of such approximation in low degrees to obtain the desired results. Acknowledgement. The present paper relies to a large extent on the second author’s thesis [30]. The authors wish to thank Øyvind Solberg for originally asking how to determine the squaring map on Hochschild cohomology of a complete intersection, Luchezar L. Avramov and Alex Martsinkovsky for valuable help with references, and Lisa Townsley for sharing with them a synopsis of her thesis [38]. We also thank the referee of the paper for careful reading and valuable suggestions regarding presentation — aside from pointing out numerous typos that are hopefully taken care of now. 2. Statement of Results Our treatment requires some simple facts about differential forms and the calculus that goes along with them. While we cover all facts we will use, the reader may gain the full picture by consulting [21]. 2.1. If P = K[x ∈ X] is a polynomial ring over some commutative ring K, with X a set of variables, then the module of Kähler differentials of P over L K is a free P –module, based on the differentials dx for x ∈ X, that is, Ω1P/K ∼ = x∈X P dx. If now f ∈ P is any polynomial, then we may consider its Taylor expansion f (x + dx) in SymP Ω1P/K ∼ = P ⊗K P . = K[x, dx; x ∈ X] ∼ In concrete terms, the polynomial will only depend on finitely many variables, say, x = x1 , ..., xn , and then X ∂ (|a|) f (x) a dx , f (x + dx) = ∂ ax a=(a1 ,...,an )∈Nn P where |a| = i ai and the coefficient of dxa is the corresponding divided partial derivative of f , in that the usual partial derivative satisfies ∂ (|a|) f (x) ∂ |a| f (x) = a ! · · · a ! . 1 n ∂ a1 x1 · · · ∂ an xn ∂ a1 x1 · · · ∂ an xn 2.2. The linear part with respect to the dx in that expansion can be viewed as the Pn total differential of f , to wit, df = i=1 ∂f∂x(x) dxi ∈ Ω1P/K . i MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 3 It defines the P –linear Jacobian of the given polynomial, gf : DerK (P, P )−→P , jac D 7→ D(df ) on the P –module of K–linear derivations from P to P . The quadratic part with respect to the dx in the Taylor expansion, X ∂ (2) f (x) dxi dxj , Hf (dx) = ∂xi ∂xj 16i6j6n is the Hessian form defined by f . By definition it is an element of Sym2 Ω1P/K and so defines a P –quadratic form Pn that sends D = i=1 ∂ pi ∂x i h̃f : DerK (P, P )−→P P ∂ to + x∈X ′ px ∂x X ∂ (2) f (x) pi pj , ∂xi ∂xj 16i6j6n   where we have set X ′ = X \ {x}. The P –quadratic module DerK (P, P ), h̃f depends solely on f , not on the chosen coordinate system xi . h̃f (D) = (D ⊗ D)(Hf (dx)) = 2.3. If we take a family of polynomials f = {fb }b∈Y , then the associated (linear) Jacobian, respectively the (quadratic) Hessian map are given by X X Y gf = ] jac jac h̃f = h̃fb ∂fb : DerK (P, P ) → P ∂fb , fb ∂fb , b∈Y b∈Y b∈Y where the symbols ∂fb simply represent the corresponding δ–functions in the product of the free P –modules P ∂fb . 2.4. If A = P/I, with I = (fb )b∈Y , then A is a commutative K–algebra and the module of Kähler differentials of A over K has a free A–module presentation M M j A[fb ] −−→ A ⊗P Ω1P/K ∼ Adx −−→ Ω1A/K −−→ 0 , = x∈X b∈Y where the basis element L [fb ] is mapped to j([fb ]) = 1 ⊗ dfb . The A–linear map j factors as the surjection b∈Y A[fb ] → I/I 2 onto the conormal module I/I 2 that sends [fb ] to fb mod I 2 , followed by the A–linear map d : I/I 2 → A ⊗P Ω1P/K that is induced by the universal K–derivation, sending f mod I 2 to 1 ⊗ df . It follows that the Jacobian and Hessian descend, X X Y jacf = jacfb ∂fb , hf = hfb ∂fb : DerK (P, A) → (∗) A∂fb , b∈Y b∈Y b∈Y 2 the A–linear map jacf taking its values in NA/P = HomQ A (I/I , A), the normal module of A with respect L to P , viewed as a submodule of b∈Y A∂fb , the A–dual of the free A–module b∈Y A[fb ]. The kernel of the Jacobian satisfies Ker jacf ∼ = DerK (A, A) ∼ = HH1 (A/K, A) ∼ = Ext1Aev (A, A) . Note that the last isomorphism holds for any associative K–algebra A, when Aev denotes the enveloping algebra of A over K, while in higher degrees one only has natural maps HHi (A/K, A) → ExtiAev (A, A) that are isomorphisms when A is projective as K–module; see also 2.6 below. 4 R.-O. BUCHWEITZ AND C. ROBERTS Now we can formulate our first result. Theorem 2.5. Let A = P/I be a presentation of a commutative K–algebra as quotient of a polynomial ring P = K[x; x ∈ X] over some commutative ring K modulo an ideal I = (fb )b∈Y ⊆ P . (1) The Hessian map hf induces a well defined A–quadratic map q : DerK (A, A) −→ HomA (I/I 2 , A) from the module of derivations to the normal module. Explicitly, ! X ∂ (2) f (x) X ∂ q (f mod I 2 ) = ai aj mod I , ax ∂x ∂xi ∂xj 16i6j6n x∈X where, as above, x1 , ..., xn ∈ X are the variables that actually occur in a presentation of f , linearly ordered in some way. (2) There is a canonical A–linear map δ : HomA (I/I 2 , A)−→ Ext2Aev (A, A) , 1 whose image is TA/K ⊆ Ext2Aev (A, A), the first tangent or André–Quillen cohomology of A. (3) The map from DerK (A, A) = Ext1Aev (A, A) to Ext2Aev (A, A) that sends a derivation D to the class [D ◦ D] of its square under Yoneda product equals δ ◦ q and 1 takes its image in the 2–torsion of TA/K . Remark 2.6. If A as in the preceding result is further projective over K, then there is a natural bijection HH• (A/K, A) → Ext•Aev (A, A) of graded commutative K–algebras2. 1 Moreover, TA/K ⊆ HH2 (A/K, A) identifies with the A–submodule of classes of symmetric Hochschild 2–cocycles. 2.7. In our second result, let the K–algebra A = P/I be presented as above, but assume moreover that (a) A is transversal to itself as K–module in that K TorK + (A, A) = ⊕i>0 Tori (A, A) = 0 . (b) The ideal I ⊆ P is regular in the sense of Quillen [29, Def.6.10], that is, I/I 2 is a projective A–module and the canonical morphism of graded commutative algebras ^ (I/I 2 )−→ TorP (A, A) A is an isomorphism. In (loc.cit.) Quillen points out that for P noetherian, I is regular in P if, and only if, it is generated locally by a P –regular sequence. 2Simply using the definition of the algebra structure on source or target, one obtains an isomorphism from the opposite algebra of HH• (A/K, A) to the Yoneda Ext–algebra. However, as already   m Gerstenhaber pointed out in his original paper, sending an element u of degree m to (−1) 2 u provides an algebra isomorphism between a graded commutative algebra and its opposite algebra. MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 5 We will say, for short, that A is a homological complete intersection algebra over K if conditions (a) and (b) are satisfied. Alternative terminology would be to say that the kernel of the multiplication map µ : Aev → A has “free” or “exterior Koszul homology,” a notion introduced and studied by A. Blanco, J. Majadas Soto, and A. Rodicio Garcia in a series of articles following [7], or to call the multiplication map a “quasi-complete intersection homomorphism” as in [4]. 2.8. The key properties of such homological complete intersection algebras are that the corresponding Tate model is small and the associated cotangent complex LA/K is, by [29, Cor. 6.14], concentrated in homological degrees 0 and 1. More precisely, LA/K ≡ 0 / I/I 2 [1] d / A ⊗P Ω1 [0] P/K /0 and its shifted A–dual, the shifted tangent complex tA := HomA (LA/K [1], A) is the complex tA ≡ 0 / DerK (P, A)[−1] jacf / NA/P [−2] / 0, concentrated in cohomological degrees one and two. 2.9. The link between tangent and Hochschild cohomology was established in Quillen’s fundamental paper [29, Sect. 8]. In essence, it says that the complex returning Hochschild homology can be realized as a DG Hopf algebra whose primitive part is represented by the cotangent complex. The qualification here is two-fold: there generally is only a spectral sequence reflecting this interpretation that generally only degenerates in characteristic zero, and, on the dual side, for Hochschild cohomology vis-à-vis the enveloping algebra of the tangent complex, the algebra structures in cohomology do not match up. However, for complete intersection algebras, things are well controlled because the cotangent complex is so short. In detail, we can complement the picture as follows. 2.10. The Hessian A–quadratic map q from 2.4(∗) above can be interpreted as defining on tA the structure of a graded (super) Lie algebra, where we follow the axiomatization of this notion in [2], and the Jacobian can be viewed as a Lie algebra differential. The enveloping algebra of this DG Lie A–algebra; see [34]; is readily identified with the Clifford algebra Cliff(q) on that quadratic map and the Jacobian induces a DG algebra differential ∂jacf on it. In particular, the cohomology of this DG algebra inherits an algebra structure this way. Theorem 2.11. Let A = P/I be a homological complete intersection algebra over K, with P = K[x1 , ..., xn ] and I = (f1 , ..., fc ) such that the fj induce an A–basis of the A–module I/I 2 that we hence further assume to be free. The cohomology of the DG algebra (Cliff(q), ∂jacf ) is then the Yoneda Ext–algebra Ext•Aev (A, A) of self extensions of A as bimodule. In detail, Cliff(q) ∼ = Aht1 , ..., tn ; s1 , ..., sc i , with the ti in degree 1, the sj in degree 2, the differential determined by  c  X ∂fj mod I sj , ∂(sj ) = 0 . ∂(ti ) = ∂xi j=1 6 R.-O. BUCHWEITZ AND C. ROBERTS With respect to the multiplicative structure, the sj are central and  c  (2) X ∂ fj 2 mod I sj ti = ∂x2i j=1  c  X ∂ 2 fj ′ ′ ti ti + ti ti = mod I sj . ∂xi ∂xi′ j=1 If A is projective over K, then the natural homomorphism of graded commutative algebras HH• (A/K) → Ext•Aev (A, A) is an isomorphism, thus, the Hochschild cohomology is given as cohomology of that DG Clifford algebra too. Remark 2.12. In concrete terms, expanding on 2.9 above, the Poincaré–Birkhoff– Witt theorem for enveloping algebras of (super) Lie algebras shows that as differential graded coalgebras, in particular, as complexes of graded A–modules, one has  that Cliff(q), ∂jacf is isomorphic to the Koszul complex K over S = SymA (NA/P ) ∼ = A[s1 , ..., sj ] on the sequence  c  X ∂fj mod I sj ∈ S ; i = 1, ..., n. ∂xi j=1 Bigrading the Koszul complex by placing the variables ti = ∂xi ∈ DerK (P, A) into bidegree (1, 0) and sj = ∂fj into bidegree (0, 1), one regains the – well-known [39, 22] – A–linear Hodge decomposition of the Hochschild cohomology for such a homological complete intersection, M H i (K)j HHp (A/K) ∼ = i+2j=p  H (K)j ∼ = H i+2j HomA (Si+j (LA/K [1]), A) . i However, the preceding theorem says that, generally, this decomposition is not compatible with the multiplicative structure, in that squaring sends HH1 (A/K) = H 1 (K)0 to 1 = H 2 (HomA (LA/K [1], A)) ⊆ HH2 (A/K) , H 0 (K)1 ∼ = TA/K but not to the other summand H 2 (K)0 ∼ = HomA (Ω2A/K , A) = H 2 (HomA (S2 (LA/K [1]), A)) ⊆ HH2 (A/K) . In other words, the “obvious” multiplication on the Hodge decomposition needs to be twisted or “quantized”, here from the exterior multiplicative structure of the Koszul complex to that of the (homogeneous) Clifford algebra. This phenomenon is analogous; see [13] and the discussion therein; to the situation for non-affine smooth schemes in characteristic zero. Similarly, for arbitrary commutative rings over a field of characteristic zero, the relation between Hodge decomposition and multiplicative structure on Hochschild cohomology is studied from a combinatorial point of view in [6]. We hasten to point out that for the affine (homological) complete intersections considered here this multiplicative twist can only make a difference when 2 is not a unit in A. MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 7 We end the paper by presenting some simple examples that highlight how the treatment here encompasses in a unified manner various results scattered throughout the literature. 3. Tate Models for the Multiplication Map of an Algebra Let S → R be a homomorphism between commutative rings. In his seminal paper [37], John Tate presented in essence the following construction of a free S– resolution of R; see also [3] for further details, and, in particular, [14] for details on differential graded (DG) algebras with divided powers. The special case of the multiplication map R ⊗K R → R for a commutative K–algebra R of finite type that we will be mainly interested in has also been detailed in [5]. π 3.1. There exists a factorization of the given ring homomorphism as S → (T , ∂) − → R such that (i) T is a strictly graded commutative S–algebra of the form   ! ^ M M T• = SymS (F0 ) ⊗S Fi  , Fi ⊗S ΓS  S i odd i>0 , even with divided powers (in even degrees), graded so that S is concentrated in degree 0, each Fi , i > 0, a free S–module concentratedVin degree i. Here Sym denotes the symmetric algebra functor, the exterior algebra functor, and Γ the divided power algebra functor. (ii) The S–algebra differential ∂ : T• → T•−1 is compatible L with divided powers, thus, uniquely determined by its restriction to i>1 Fi ⊆ T , vanishing necessarily on F0 for degree reasons. (iii) The morphism π is a quasiisomorphism of DG algebras, where one endows R, concentrated in degree zero, with the, only possible, zero differential. Such factorization of S → R is then a Tate model for R over S, but, with the usual slight abuse, we also simply call (T , ∂) a Tate model, the remaining data understood. For given i, the module ⊕j6i Fj generates a DG subalgebra T (i) with divided S powers, and T (0) ⊆ · · · ⊆ T (i) ⊆ T (i+1) ⊆ · · · ⊆ T = i T (i) constitutes the associated Postnikov tower. It follows from the description given that the inclusion ∼ = T (i) → T induces isomorphisms Hj (T (i) ) −−→ Hj (T ) for j < i and that ∂|Fi+1 : (i) Fi+1 → T can be interpreted as an S–linear attaching map that kills Hi (T (i) ). Remark 3.2. Viewed just as a complex, such a Tate model constitutes in particular a free resolution of R as S–module, thus, can be used to calculate TorS (R, −) and ExtS (R, −). If S is noetherian and S → R is surjective, one may choose F0 = 0 and each Fi , for i > 1, to be free of finite rank over S, and then T is in turn free of finite rank over S in each degree. If R is only of finite type as an S–algebra, then one may choose F0 to be a finite free S–module and each Fi a finite free T (0) = SymS (F0 )–module. 3.3. Now consider the particular case, where A is a commutative K–algebra over some commutative ring K, and µ : Aev := A ⊗K A = S → A = R is the multiplication map, a K–algebra homomorphism from the enveloping algebra of A e 1A = Ω e 1A/K the kernel of the multiplication map and over K to A. We denote Ω 8 R.-O. BUCHWEITZ AND C. ROBERTS note that this ideal in Aev represents the functor of taking K–linear derivations into arbitrary A–bimodules — in contrast to the A–module of Kähler differential e 1 /(Ω e 1 )2 that represents the functor of taking K–linear derivations forms Ω1A/K = Ω A A in symmetric A–bimodules. We use the convention that the universal derivation e 1A sends a 7→ da = 1 ⊗ a − a ⊗ 1. d:A→Ω Assume now that A is presented as (SymK F )/I, for some free K–module F and some ideal I in the polynomial ring P = SymK F over this free module. The following result holds for an arbitrary presentation A = P/I, with neither P nor A necessarily commutative. Lemma 3.4 (cf. [18, Cor.2.11]). There exists an exact sequence of Aev –modules (†) I/I 2 d e 1P ⊗P A / A ⊗P Ω j / Aev µ /A /0 e 1 to where d is induced by restricting the universal K–linear derivation d : P → Ω P 1 ∼ e I and j is obtained from the inclusion i : ΩP ⊆ P ⊗K P as j = A ⊗P i ⊗P A taking  into account Aev ∼ = A ⊗P (P ⊗K P ) ⊗P A. Returning to the commutative situation, choose a P ev –linear surjection P ⊗K G ⊗K P → I for some free K–module G. The preceding Lemma has the following immediate consequence. Corollary 3.5. One may construct a Tate model for the multiplication map µ : A ⊗K A → A with F0 = 0, F1 = A ⊗K F ⊗K A, and F2 = A ⊗K G ⊗K A. Proof. As the multiplication map is surjective, one may choose F0 = 0 in the construction of the Tate model. e 1 to F ⊆ P The image of the restriction of the universal derivation d : P → Ω P e 1 ⊆ P ⊗K P and this shows that the induced map A ⊗K generates the ideal Ω P e 1P ⊗P A is surjective, thus, the choice of F1 . The resulting DG F ⊗K A → A ⊗PV Ω algebra T (1) = Aev F1 is nothing but the Koszul complex over the composition j e 1 ⊗P A − → Aev whose first homology is isomorphic to A ⊗K F ⊗K A → A ⊗P Ω P e 1 ⊗P A. d(I/I 2 ) — this is exactness of the sequence (†) above at the term A ⊗P Ω P Applying on both sides the tensor product over P with A to the P ev –linear surjection P ⊗K G ⊗K P → I yields an Aev –linear surjection first from F2 onto I/I 2 and then via d onto that homology. As F2 is Aev –projective, one can find a lifting of that surjection into the 1-cycles of T (1) and such lifting extends the differential from T (1) to ^ T (2) = (F1 ) ⊗Aev ΓAev (F2 ) , ev A whence the claim concerning F2 follows.  To be even more specific, Lemma 3.4 and the proof of the corollary indicate how to describe the possible differentials on T (2) . 3.6. Let x = {xa }a be a basis of the free K–module F . Then the universal derivation sends these algebra generators to e 1P ⊆ P ⊗K P ∼ dxa = x′′a − x′a ∈ Ω = SymK (F ⊕ F ) , MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 9 where we abbreviate x′ = x ⊗ 1, x′′ = 1 ⊗ x. Below, we will use the same notation for the respective residue classes in AevP . Representing a polynomial f (x) = ′A=(a1 ,...,ak ) αA xa1 · · · xak ∈ P , with αA ∈ K, as a finite sum of (ordered) monomials in (finitely many) basis elements xa of F , the definition of d and then the product rule for this derivation yield (∗) df = 1 ⊗ f − f ⊗ 1 = f (x′′ ) − f (x′ ) X = k X αA x′a1 · · · x′aκ−1 dxaκ x′′aκ+1 · · · x′′ak A=(a1 ,...,ak ) κ=1 = X k X αA x′a1 · · · x′aκ−1 (x′′aκ − x′aκ )x′′aκ+1 · · · x′′ak A=(a1 ,...,ak ) κ=1 in e1 Ω P = (x′′a − x′a )a ⊆ P ⊗K P . 3.7. Slightly abusing notation, we may then base the free Aev –module F1 in the construction of T above on symbols dxa and define ∂dxa = x′′a − x′a ∈ Aev . Similarly, if {fb }b are polynomials in I whose classes generate I/I 2 , we may base the free Aev –module F2 on symbols dfb and choose (∗∗) ∂(dfb ) = X k X αA x′a1 · · · x′aκ−1 dxaκ x′′aκ+1 · · · x′′ak ∈ F1 A=(a1 ,...,ak ) κ=1 for the differential on those basis elements, where the right hand side results from a chosen presentation of f = fb as above. This time, the right hand side will depend on the chosen presentation, but those choices are easily controlled, in that one may add ∂(ωb ) to the right hand side for V any two-form ωb ∈ 2Aev F1 to change the value of ∂(dfb ). These are also the only choices. If we collect coefficients of the terms dxa in (∗) for f = fb to write X dfb = ∆b,a (x′ , x′′ )dxa , a with ∆b,a (x′ , x′′ ) in P ⊗K P , then these coefficients satisfy µ∆b,a (x′ , x′′ ) = ∆b,a (x, x) = ∂fb (x) ∂xa in P irrespective of the representation we chose. 4. Diagonal Approximation and Graded Commutativity With T a Tate model of the multiplication map Aev → A for a commutative K–algebra as before, note that T is naturally a complex of A–bimodules so that we can form the tensor product T ⊗A T . This tensor product carries again the structure of a differential strictly graded commutative algebra with divided powers. Denote j1,2 : T → T ⊗A T the DG algebra homomorphisms j1 (t) = t ⊗A 1, respectively j2 (t) = 1 ⊗A t, for t ∈ T . 4.1. The complex underlying T ⊗A T is one of free A–trimodules, that is, free modules over A⊗3 . We make no claim about the homology of this complex, except 10 R.-O. BUCHWEITZ AND C. ROBERTS to note that the algebra homomorphism ǫ ⊗A ǫ : T ⊗A T → A ⊗A A ∼ = A is the natural map onto the zeroth homology. Note, however, that if A is flat over K, then Aev is A–flat via both j1 or j2 , and T constitutes a flat resolution of A over A via either j1 or j2 , thus, the homology of T ⊗A T is trivial, equal to A in degree zero. However, even without flatness we have the following. Lemma 4.2. With notation as introduced above, (1) The algebra homomorphisms ǫ1 = ǫ ⊗ A T : T ⊗ A T → A ⊗ A T ∼ =T ∼T ǫ2 = T ⊗ A ǫ : T ⊗ A T → T ⊗ A A = are homotopic as morphisms of complexes of A–trimodules. (2) If Hm (T ⊗A T ) = 0 for 1 ≤ m ≤ i for some i, then Ker ǫ1 ∩Ker ǫ2 has vanishing homology up to and including degree i. In particular, if A is flat over K, then the subcomplex Ker ǫ1 ∩ Ker ǫ2 ⊆ T ⊗A T has zero homology. Proof. As ǫǫ1 = ǫǫ2 , the difference ǫ2 − ǫ1 takes its values in the acyclic complex Ker(ǫ : T → A). As its source is a complex of projective, even free A–trimodules, the claim (1) follows. Concerning (2), consider the following commutative diagram of complexes with exact rows and columns 0 0O 0O / Ker ǫ O /T O 0O ǫ /A O ǫ2 0 / Ker ǫ1 O / T ⊗A T O 0 / Ker ǫ1 ∩ Ker ǫ2 O 0 /0 ǫ ǫ1 /T O /0 / Ker ǫ2 O / Ker ǫ O /0 0 0 By construction, ǫ is a quasi isomorphism, whence Ker ǫ is acyclic. By assumption ǫ1 , ǫ2 are quasiisomorphisms in degrees up to and including i, where we may take i = ∞ if A is flat over K. The long exact homology sequence obtained from the short exact sequence, say, at the bottom yields then the claims.  Definition 4.3 (cf. [32]). Let A be a complex of Aev –modules that comes with ǫ an augmentation A − → A. A co-unital diagonal approximation on A is a morphism Φ : A → A ⊗A A of Aev –complexes so that the following diagram commutes, A❍ ✇✇✇✇ ❍❍❍❍❍❍❍❍ ✇ ✇ ✇ ❍❍❍❍ Φ ✇✇✇✇ ❍❍❍❍ ✇✇✇✇✇ ❍❍❍ ✇  ✇ ✇✇ / A, o A A ⊗A A ǫ⊗A A⊗ǫ MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 11 where we have identified A ⊗A A ∼ =A∼ = A ⊗A A. As is well-known, the existence of a co-unital diagonal approximation on a Tate model of the multiplication map implies graded commutativity of the Yoneda product on ExtAev (A, A); see, for example, [11, 32, 35]. Definition 4.4. Given a co-unital diagonal approximation Φ : T → T ⊗A T on the Tate model of µ : Aev → A, define a cup product ∪ = ∪Φ on Hom•Aev (T , A) through f ⊗g Φ µ f ∪ g = µ(f ⊗A g)Φ : T −−→ T ⊗A T −−−−→ A ⊗A A −− → A, ∼ = for cochains f, g : T → A. Proposition 4.5. Let A be a commutative K–algebra with a Tate model of µ : Aev → A that admits a co-unital diagonal approximation. The corresponding cup product then induces a graded commutative product in H(Hom•Aev (T , A)) = Ext•Aev (A, A). This product coincides with the usual Yoneda or composition product on the Ext–algebra. Proof. Given cocycles f, g ∈ Hom•Aev (T , A), lift them to morphisms of complexes f˜, g̃ ∈ Hom•Aev (T , T ). In the homotopy category of complexes ǫ1 , ǫ2 : T ⊗A T → T agree because of Lemma 4.2(1), and so the following diagram of complexes of Aev – modules commutes in the homotopy category, ˜ id ⊗g̃ Φ / T ⊗A T f ⊗id / T ⊗A T ǫ1 ⊗A ǫ2/ A ⊗A A T ❍❍❍ / T ⊗A T ❍❍❍❍ ❍❍❍❍ ❍❍❍❍ ǫ1 ǫ1 = ǫ2 ǫ2 ❍❍❍❍   ❍  g̃ f˜ ∼ /T ❱ /T ▼ = µ T ❨❨❨❨❨❨❨ ▼▼▼ ❨❨❨❨❨❨ ❱❱❱❱❱❱❱ ❨❨❨❨❨❨ ❱❱❱❱f ▼ ǫ ❨❨❨❨❨❨ ❱❱❱❱ ▼▼▼▼ ❨❨❨❨❨❱❨❱❱❱❱ ▼▼ f ◦g̃ ❨❨❨❨❱❨❱❨❱▼&*  ,A By definition, f ◦ g̃ is a cocycle representing the Yoneda product of f with g, while the composition across the top and down yields f ∪ g. Thus, these two products coincide in ExtAev (A, A). |g| |f | Further, for f˜ ∈ EndAev (T ), g̃ ∈ EndAev (T ) lifts of homogeneous cocycles as above, one has (f˜ ⊗ id)(id ⊗g̃) = f˜ ⊗ g̃ = (−1)|f ||g| (id ⊗g̃)(f˜ ⊗ id) whence combining the above diagram with that corresponding to (id ⊗g̃)(f˜ ⊗ id) yields graded commutativity of the Yoneda or cup product in cohomology, that is, in Ext•Aev (A, A).  Remark 4.6. The preceding proof shows that a partial co-unital diagonal approximation Φ(i) : T (i) → T (i) ⊗A T (i) is enough to express the Yoneda product of two cohomology classes whose degrees add up to at most i through the cup product on Hom•Aev (T (i) , A). Moreover, these classes will commute in the graded sense with respect to the product. In the particular case that A is flat over K, one can indeed construct a co-unital diagonal approximation that is furthermore a homomorphism of DG algebras with divided powers. 12 R.-O. BUCHWEITZ AND C. ROBERTS Proposition 4.7. If A is flat over K, then there exists a co-unital diagonal approximation Φ on the Tate model T of µ : Aev → A that induces such approximation Φ(i) on each DG algebra T (i) in the Postnikov tower. Proof. We construct a desired co-unital diagonal approximation Φ inductively along the Postnikov tower. At the basis of the Postnikov tower, we have T (0) = T0 = Aev and T (0) ⊗A T (0) = (T ⊗A T )0 ∼ = A⊗3 ⊆ T ⊗A T . Now Φ(0) : T (0) ∼ = A⊗2 → T (0) ⊗A T (0) ∼ = A⊗3 , Φ(0) (a ⊗ b) = a ⊗ 1 ⊗ b defines a homomorphism of algebras such that ǫ1 Φ(0) = idA⊗2 = ǫ2 Φ(0) . Via Φ(0) , we can, and will, view T ⊗A T as a DG Aev –algebra. Now assume a co-unital diagonal approximation Φ(i) : T (i) → T (i) ⊗A T (i) has been defined for some i > 0. With T (i+1) = T (i) hFi+1 i for some free Aev –module Fi+1 , note that (j1 + j2 )|Fi+1 : Fi+1 → T (i+1) ⊗A T (i+1) satisfies ǫ1 (j1 + j2 )|Fi+1 = idFi+1 = ǫ2 (j1 + j2 )|Fi+1 . For m = 1, 2, by the induction hypothesis ǫm Φ(i) = idT (i) . As ǫm is a morphism of complexes, it follows that ǫm (Φ(i) ∂ − ∂(j1 + j2 )) = ∂ − ∂ǫm (j1 + j2 ) , vanishes on Fi+1 . Because Φ(i) is a morphism of complexes, ∂(Φ(i) ∂ − ∂(j1 + j2 )) = 0 , whence it follows that Φ(i) ∂ − ∂(j1 + j2 ) maps Fi+1 into the cycles of Ker ǫ1 ∩Ker ǫ2 . As the latter complex is acyclic for A flat over K by Lemma 4.2(2), and as Fi+1 is projective, even free, we can find Φ′i+1 : Fi+1 → Ker ǫ1 ∩ Ker ǫ2 such that Φ(i) ∂ = ∂(Φ′i+1 + j1 + j2 ) on Fi+1 . The algebra homomorphism given by Φ(i) on T (i) and extended through Φi+1 = Φ′i+1 + j1 + j2 first to Fi+1 and, then as algebra homomorphism to Φ(i+1) on T (i+1) satisfies ∂Φ(i+1) = Φ(i+1) ∂ and ǫm Φ(i+1) = id. In other words, we have found an extension of Φ(i) to a co-unital diagonal approximation on T (i+1) , completing the inductive argument.  5. Products in Low Degree 5.1. We can sharpen Proposition 4.7 a bit in low degrees in that we do not need any flatness there. Proceding as in the proof of Proposition 4.7, define Φ1 = (j1 + j2 )|F1 : F1 → T (1) ⊗A T (1) and extend Φ(0) , Φ1 to a homomorphism Φ(1) : T (1) → T (1) ⊗A T (1) of strictly commutative graded algebras with divided powers. It will indeed be a co-unital approximation and homomorphism of DG algebras, as Φ(0) is such a MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 13 homomorphism and ∂Φ1 (dxa ) = ∂(j1 + j2 )(dxa ) = (j1 + j2 )∂(dxa ) = j1 (1 ⊗ xa − xa ⊗ 1) + j2 (1 ⊗ xa − xa ⊗ 1) = (1 ⊗ xa ⊗ 1 − xa ⊗ 1 ⊗ 1) + (1 ⊗ 1 ⊗ xa − 1 ⊗ xa ⊗ 1) = 1 ⊗ 1 ⊗ xa − xa ⊗ 1 ⊗ 1 = Φ(0) (∂dxa ) for any basis element dxa in F1 . Put differently, a diagonal approximation Φ(1) : T (1) → T (1) ⊗A T (1) can be chosen in such a way that Φ(1) (a ⊗ b) = a ⊗ 1 ⊗ b Φ(1) (dxa ) = dx′a + dx′′a for a ⊗ b ∈ Aev , for dxa ∈ F1 , where we have shortened notation to dx′a = dxa ⊗1 = j1 (dxa ) and dx′′a = 1⊗dxa = j2 (dxa ). We also use the algebra homomorphism Φ(0) : Aev → A⊗3 to identify x′ = Φ(0) (x′ ) = x ⊗ 1 ⊗ 1 , x = 1⊗x⊗1, x′′ = Φ(0) (x′′ ) = 1 ⊗ 1 ⊗ x . 5.2. It is noteworthy that the induced cup product on Hom•Aev (T (1) , A) is always strictly graded commutative. Indeed, recall that T (1) is nothing but the Koszul complex on (x′′a − x′a )a in Aev . Dualizing into A, the induced differential becomes zero, and there is a quasi isomorphism M M Hom•Aev (T (1) , A) ≃ HomAev (A ⊗P ΩiP/K ⊗P A, A) ∼ HomP (ΩiP/K , A) = i>0 i>0 to the graded module of alternating K–linear polyvector fields on P with values in |f | A. If now f ∈ HomAev (T (1) , A) is a cocycle of odd degree, then f ∪ f = 0. In fact, (1) if ω ∈ T2|f | , then Φ(1) (ω), in Sweedler notation, is of the form X Φ(1) (ω) = (ω(1) ⊗A ω(2) + (−1)|ω(1) ||ω(2) | ω(2) ⊗A ω(1) ) for suitable homogeneous ω(k) ∈ T (1) , k = 1, 2, whose degrees add up to 2|f |, as the explicit form of Φ(1) shows. Now f ⊗ f is zero on any summand with |ω(k) | 6= |f |, while on summands where |ω(k) | = |f | is odd, one has (f ⊗ f )(ω(1) ⊗A ω(2) − ω(2) ⊗A ω(1) ) = f (ω(1) )f (ω(2) ) − f (ω(2) )f (ω(1) ) = 0 , as A is commutative. 5.3. As just demonstrated, the construction of Φ(1) does not require A to be flat over K, and we now show by explicit construction that one can find also without any flatness assumption a co-unital diagonal approximation Φ(2) on T (2) that extends the just constructed Φ(1) . Recall that T (2) = T (1) hF2 i, with F2 a free Aev –module based on elements dfb that correspond to polynomials fb ∈ I ⊆ P whose classes in I/I 2 generate that Aev – module. An “attaching map” ∂|F2 : F2 → T (1) that killed the second homology of T (1) was obtained in 3.7(∗∗) from some representation of each fb as K–linear combination of monomials in the algebra generators of P over K. In those terms, and extending the shorthand notation to dfb′ = dfb ⊗1 = j1 (dfb ) and dfb′′ = 1⊗dfb = j2 (dfb ), we now determine a diagonal approximation in degree 2. 14 R.-O. BUCHWEITZ AND C. ROBERTS Proposition 5.4. The algebra homomorphism Φ(2) : T (2) → T (2) ⊗A T (2) that extends Φ(1) by means of Φ2 (dfb ) = dfb′ + dfb′′ X − X αA x′a1 · · · x′aκ−1 dx′aκ xaκ+1 · · · xaλ−1 dx′′aλ x′′aλ+1 · · · x′′ak A=(a1 ,...,ak ) 16κ<λ6k P′ for some finite presentation fb (x) = A=(a1 ,...,ak ) αA xa1 · · · xak ∈ P of the given polynomial fb defines a co-unital diagonal approximation. Proof. Inspection reveals immediately that Φ(2) is co-unital, that is, ǫ1 Φ(2) = idT (2) = ǫ2 Φ(2) . It thus remains to verify that Φ(2) is compatible with the differentials, equivalently, that ∂Φ2 (dfb ) = Φ(1) (∂dfb ) for each b. This is a straightforward verification. First, we exhibit ∂(dfb′ ) and ∂(dfb′′ ) for use below, X ∂(dfb′ ) = k X αA x′a1 · · · x′aκ−1 dx′aκ xaκ+1 · · · xak , A=(a1 ,...,ak ) κ=1 X ∂(dfb′′ ) = k X αA xa1 · · · xaκ−1 dx′′aκ x′′aκ+1 · · · x′′ak . A=(a1 ,...,ak ) κ=1 Next we apply the differential to the double sum in the definition of Φ2 (dfb ) and obtain   X X ∂ αA x′a1 · · · x′aκ−1 dx′aκ xaκ+1 · · · xaλ−1 dx′′aλ x′′aλ+1 · · · x′′ak  A=(a1 ,...,ak ) 16κ<λ6k = X X αA x′a1 · · · x′aκ−1 (xaκ − x′aκ )xaκ+1 · · · xaλ−1 dx′′aλ x′′aλ+1 · · · x′′ak A=(a1 ,...,ak ) 16κ<λ6k − X X αA x′a1 · · · x′aκ−1 dx′aκ xaκ+1 · · · xaλ−1 (x′′aλ − xaλ )x′′aλ+1 · · · x′′ak A=(a1 ,...,ak ) 16κ<λ6k = X X αA (xa1 · · · xaλ−1 − x′a1 · · · x′aλ−1 )dx′′aλ x′′aλ+1 · · · x′′ak A=(a1 ,...,ak ) 16λ6k − X X αA x′a1 · · · x′aκ−1 dx′aκ (x′′aκ+1 · · · x′′ak − xaκ+1 · · · xak ) A=(a1 ,...,ak ) 16κ6k = ∂(dfb′′ ) + ∂(dfb′ ) − Φ(1) (∂dfb ) , where the first equality uses that ∂ is a skew derivation of degree one, and the second equality applies 3.6(∗) to the monomials xa1 · · · xaκ−1 , respectively, xaκ+1 · · · xak , while the final equality uses the form of ∂(dfb′ ) and ∂(dfb′′ ) as recalled above. Reordering the terms, we obtain Φ(2) (∂dfb ) = ∂Φ(2) (dfb ) as required.  Note the following special property of the co-unital diagonal approximation just constructed. Corollary 5.5. The co-unital diagonal approximation Φ(2) is cocommutative in the dfb , in that the automorphism of graded algebras σ : T (2) ⊗A T (2) → T (2) ⊗A MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 15 T (2) , ignoring differentials, that exchanges dfb′ ↔ dfb′′ , for each b, but leaves the remaining variables unchanged, satisfies σ ◦ Φ(2) = Φ(2) .  Having determined one explicit co-unital diagonal approximation on T (2) , what choices were involved? Provided T ⊗A T is exact in low degrees, we can easily describe all co-unital diagonal approximations on T (2) that are algebra homomorphisms between algebras with divided powers.. Theorem 5.6. Let T be a Tate model of µ : Aev → A as before. The just exhibited co-unital diagonal approximation Φ(2) can be modified to the DG algebra homomorphism Ψ : T (2) → T (2) ⊗A T (2) that respects divided powers, agrees in degree zero with Φ(0) and is given on the algebra generators of T in degrees 1 and 2 through Ψ(dxa ) = dx′a + dx′′a + ∂ωa X Ψ(dfb ) = Φ(2) (dfb ) + ∆b,a (x′ , x′′ )ωa + ∂ηb , a where ∆b,a ∈ Aev are as in 3.6, the ωa are of degree 2 and the ηb are of degree 3 in P T (2) ⊗A T (2) , such that ∂ωa and a ∆b,a (x′ , x′′ )ωa + ∂ηb are in Ker ǫ1 ∩ Ker ǫ2 . If T (2) ⊗A T (2) is exact in degrees 1 and 2, then these are the only possible co-unital diagonal approximations that are homomorphisms of DG algebras with divided powers and that agree with Φ(2) in degree zero. Moreover, in this case ωa and ηb can already be chosen in Ker ǫ1 ∩ Ker ǫ2 . Proof. That Ψ is a co-unital diagonal approximation along with Φ(2) is easily verified directly. Conversely, if Ψ is some co-unital diagonal approximation on T (2) , then (Ψ − (2) Φ )(dxa ) is a cycle for each a and, if H1 (T (2) ⊗A T (2) ) = 0, it is a boundary, thus, of the form ∂ωa for suitable ωa in degree two. Moreover, ∂ωa is necessarily a cycle in Ker ǫ1 ∩ Ker ǫ2 , as both diagonal approximations are co-unital, and Lemma 4.2(2) shows that H1 of that complex vanishes too. Thus, ωa can be chosen in Ker ǫ1 ∩ Ker ǫ2 . P If also H2 (T (2) ⊗A T (2) ) = 0, then the 2–cycles Ψ(dfb )−Φ(2) (dfb )− a ∆b,a ωa are boundaries, thus, of the form ∂ηb for some form ηb of degree 3. Again, ∂ηb belongs necessarily to Ker ǫ1 ∩Ker ǫ2 and H2 of that complex vanishes by the same argument as before, whence we may replace ηb , if necessary, by an element in Ker ǫ1 ∩ Ker ǫ2 that has the same image under the differential.  To illustrate, we determine the cup product of two 1–cochains. 5.7. Assume T is a Tate model of µ : Aev → A for some commutative K–algebra A. Let f, g : T → A be Aev –linear cochains of degree 1. Their cup product is then a cochain of degree 2 with values in A, explicitly given by (f ∪ g)(dxa1 ∧ dxa2 ) = µ(f ⊗A g)Φ(dxa1 ∧ dxa2 ) = µ(f ⊗A g)((dx′a1 + dx′′a1 ) ∧ (dx′a2 + dx′′a2 )) = g(dxa1 )f (dxa2 ) − f (dxa1 )g(dxa2 ) 16 R.-O. BUCHWEITZ AND C. ROBERTS and (f ∪ g)(dfb ) = µ(f ⊗A g)Φ(dfb ) X X = αA xa1 · · · xaκ−1 f (dxaκ )xaκ+1 · · · xaλ−1 g(dxaλ )xaλ+1 · · · xak A 16κ<λ6k = X X A 16κ<λ6k baλ xaλ+1 · · · xak f (dxaκ )g(dxaλ ) baκ xaκ+1 · · · xaλ−1 x αA xa1 · · · xaκ−1 x It remains to find a palatable form of the coefficients of f (dxaκ )g(dxaλ ) in that expression. Theorem 5.8. Given a commutative K–algebra A, represented as A ∼ = K[x; x ∈ X]/(fb )b . If for a given b, the polynomial fb depends on the variables x1 , ..., xn ∈ X, one may choose a co-unital diagonal approximation Φ(2) on T (2) in such a way that  X  ∂ (2) fb (x) mod I f (dxi )g(dxj ) ∈ A , (f ∪ g)(dfb ) = ∂xi ∂xj 16i6j6n ev for any A –linear cochains f, g : T → A of degree one. P e1 en Proof. Let fb = e∈Nn αe x1 · · · xn with ae ∈ K be the presentation of fb as polynomial in the variables x1 , ..., xn . Rewrite the occurring monomials as αe x1e1 · · · xenn = αe xa1 · · · xa|e| , where xa1 = · · · = xae1 = x1 , xae1 +1 = · · · = xae1 +e2 = x2 , xae1 +···+en−1 +1 .. . = · · · = xae1 +···+en = xn . In the corresponding choice of Φ2 (dfb ) in Proposition 5.4, this term contributes X αe x′a1 · · · x′aκ−1 dx′aκ xaκ+1 · · · xaλ−1 dx′′aλ x′′aλ+1 · · · x′′a|e| . 16κ<λ6|e| Specializing to xa = x′a = x′′a for each index a, and sorting reduces this sum to n   X ei e1 ei−1 ei −2 ei+1 x1 · · · xi−1 xi xi+1 · · · xenn dx′i dx′′i αe 2 i=1  X ej−1 ej −1 ej+1 ei−1 ei −1 ei+1 + xj xj+1 · · · xenn dx′i dx′′j  ei ej xe11 · · · xi−1 xi xi+1 · · · xj−1 16i<j6n The coefficient of dx′i dx′′j in this expression is indeed the corresponding divided second derivative of the monomial, whence, putting the terms together again, it follows that for this choice of presentation, X ∂ (2) fb (x) Φ2 (dfb )(x, x, x) = dfb′ + dfb′′ − dx′i dx′′j ∂xi ∂xj 16i6j6n and then the cup product takes the form claimed.  MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 17 6. Proof of Theorem 2.5 Let A = P/I be as before a presentation of a commutative K–algebra as quotient of a polynomial ring P = K[x; x ∈ X] over some commutative ring K modulo an ideal I = (fb )b∈Y ⊆ P . We need to show that the Hessian quadratic map X Y hf = hfb ∂fb : DerK (P, A) → A∂fb b∈Y b∈Y as defined in 2.4 sends DerK (A, A) ⊆ DerK (P, A) to NA/P = HomA (I/I 2 , A) ⊆ Q b∈Y A∂fb . Q an element in the normal Now an element (ub ∂fb )b ∈ b∈Y A∂fb , represents P module NA/P if, and only if, for every relation P b zb fb = 0, with zb ∈ P and only finitely many of these elements nonzero, the sum b zb ub is zero in A. Let X ′ = {x1 , ..., xN } ⊂ X be the finite subset of variables that are involved in the finitely many polynomials fb that occur with nonzero coefficient in the given relation. P P ∂ ∂ If D = x∈X ax ∂x ∈ DerK (A, A) is given, set D′ = x∈X ′ ãx ∂x where ãx ∈ P lifts ax ∈ A. One then has D′ (fb ) ≡ D(fb ) = 0 mod I, and q(D)b = X 16i6j6N ∂ (2) fb (x) ai aj mod I ≡ h̃f (D′ )(fb ) mod I ∂xi ∂xj for those fb that are involved in the relation. Next note that the second divided P (2) power D′(2) = 16i6j6N ∂x∂i ∂xj ãi ãj of D′ satisfies D′(2) (f g) = D′(2) (f )g + D′ (f )D′ (g) + f D′(2) (g) for any polynomials f, g ∈ P . P Apply D′(2) to the relation 0 = b zb fb to obtain ! X X 0 = D′(2) D′(2) (zb fb ) zb fb = b b = X (D′(2) (zb )fb + D′ (zb )D′ (fb ) + zb D′(2) (fb )) b ≡ X zb q(D)b mod I b as in the middle equation, each term D′(2) (zb )fb is in I and D′ (fb ) ≡ D(fb ) = 0 mod I as D is a derivation on A. Therefore, q(D) = (q(D)b )b is indeed an element of the normal module. This proves part (1) of Theorem 2.5. Part (2) of Theorem 2.5 just restates a well-known fact, but we give another deduction using the Tate model T of the multiplication map µ : Aev → A and establish along the way as well Part (3) of Theorem 2.5. To this end, recall, from 5.2 above, that T (1) is just the Koszul complex on (x′′a − xa )a in Aev and that its dual HomAev (T (1) , A) carries the cup product induced by Φ(1) with respect to which its cohomology H • (HomAev (T (1) , A)) ∼ = HomA (Ω•P/K , A) is a strictly graded commutative algebra. As the diagonal approximation Φ on T extends the diagonal approximation Φ(1) on T (1) , the A–linear surjective restriction map p : T ∗ = Hom•Aev (T , A) → T (1)∗ = Hom•Aev (T (1) , A) resulting from the inclusion T (1) ⊂ T is compatible with the 18 R.-O. BUCHWEITZ AND C. ROBERTS cup products on source and target, thus, induces a K–algebra homomorphism in cohomology. If K is the kernel of the restriction map on the complexes, then the long exact cohomology sequence contains / H 2 (K) H 1 (T (1)∗ ) DerK (P, A) jac / NA/K / H 2 (T ∗ ) δ / Ext2Aev (A, A) H 2 (p) / H 2 (T (1)∗ ) / HomA (Ω2 , A) . P/A If now D ∈ DerK (A, A) = H 1 (Hom•Aev (T , A)) then H 2 (p)(D ∪ D) = 0, as H • (p) is an algebra homomorphism into a strictly graded commutative algebra. Thus, D ∪D is in the image of the map δ : NA/P → Ext2Aev (A, A), and this image is known to 1 be TA/K , the first André–Quillen cohomology of A over K. Moreover, the explicit description of the cup product on HomAev (T (2) , A) shows that q(D) ∈ NA/P is mapped via δ to D ∪ D.  7. Hochschild Cohomology of Homological Complete Intersections Now we consider the case that A = P/I is a homological complete intersection over K with I/I 2 free. Proposition 7.1. (see [7] and [4, 25]) Assume the commutative K–algebra A admits a presentation A = P/I, with P = SymK F a symmetric K–algebra on a free K–module F , and I ⊆ P an ideal. K (2) If TorK as constructed in Corol+ (A, A) = ⊕i>0 Tori (A, A) = 0, then T ev lary 3.5 is already a Tate model of µ : A → A if, and only if, I/I 2 is a free the natural homomorphism of strictly graded commutative algebras V A–module, P 2 I/I → Tor (A, A) is an isomorphism, and the surjection P ⊗K G ⊗K P → I A was chosen to induce a bijection from a K–basis of G to an A–basis of I/I 2 . Proof. In Corollary 3.5 we formed T (1) as the Koszul complex on (x′′a − x′a )a in Aev , where xa runs through a K–basis of F . Its homology can be identified as ∼ TorP ⊗K P (P, A ⊗K A) . H(T (1) ) = By [15, Chap. XVI§5(5a)], flatness of P over K together with TorK + (A, A) = 0 P ⊗K P P ∼ yields an isomorphism Tor (P, A ⊗K A) = Tor (A, A). V If I/I 2 is free and the canonical map A I/I 2 → TorP (A, A) ∼ = H(T (1) ) is an (2) = T , provided isomorphism of algebras, then already Tate [37] showed that T the map G → I/I 2 sends a K–basis to an A–basis. The main result of [7] yields the converse.  Remark 7.2. This proposition applies in particular when I = (f1 , ..., fc ) ⊆ P = K[x1 , ..., xn ] defines a complete intersection, in the sense that the fj form a Koszul– regular sequence in P . In this case, the condition TorK + (A, A) = 0 is equivalent to exactness of the Koszul complex on f1 (x′ ), ..., fc (x′ ), f1 (x′′1 ), ..., fc (x′′ ) in P ⊗K P ∼ = K[x′ , x′′ ], in that this complex is simply the tensor product of the Koszul complex on f1 , ..., fc in P , a free resolution of A over K, with itself over K. The resolution of a complete intersection ring over its enveloping algebra through the Tate model has a long history. MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 19 Wolffhardt [39] was the first to exhibit it, but he apparently was unaware of Tate’s result and wrote down the resolution in case K is a field of characteristic zero — in which case divided powers can be replaced by symmetric ones at the expense of introducing denominators. In explicit form, this resolution was also described in [10, 12, 22]. As the reviewers of [26] in MathSciNet note: “...the authors recover the calculation of HH∗ (A/K, A) due originally to K. Wolffhardt [Trans. Amer. Math. Soc. 171 (1972), 5166; MR0306192 (46 #5319)], and more recently (since 1988) to a host of other authors, including the reviewers.” To see that the condition TorK + (A, A) = 0 is not void even in this special situation, contrary to what is implied in [12] or [22], one may just take c = 1 with, say, K = Z, and f1 = 17x ∈ Z[x]. See also the next section for a detailed discussion of this point. Remark 7.3. Wolffhardt [39] treats the analytic case, when A is quotient of a noetherian smooth analytic algebra in the broad sense of [1, Supplement]. We leave it to the readers to retrace the foregoing results and to convince themselves that everything works as well in that situation, provided one replaces the occurring tensor products by their analytic counterparts. We now turn to the Proof of Theorem 2.11. In light of 5.7 and Theorem 5.8, we know explicitly the form of the cup product on HomAev (T (2) , A), thus, on HomAev (T , A) in the case at hand. F . As a complex, Hom•Aev (T (2) , A) Set F ∗ = HomAev (F, A) for any Aev –module n Pc ∂fj is the Koszul complex on in the polynomial ring A[∂ f1 , ..., ∂ fc ]. j=1 ∂xi ∂ fj i=1 Here {∂ fj }j=1,..,c ∈ F2∗ form the dual A–basis to {dfj }j=1,..,c ⊆ F2 and we employ the A–basis ∂ x1 , ..., ∂ xn ∈ F1∗ dual to {dxi }i=1,...,n ⊆ F1 . That Koszul complex has then the compact description ^ Hom•Aev (T (2) , A) = (F1∗ [−1]) ⊗A SymA (F2∗ [−2]) A Pc ∂f with differential ∂(∂ xi ) = j=1 ∂xji ∂ fj and ∂∂ fj = 0. The cohomological grading on Hom•Aev (T (2) , A) is recovered from putting ∂ xi into degree 1 and ∂ fj into degree 2 as indicated. It remains to determine the multiplicative structure. V2 Identify {∂ xi1 ∧ ∂ xi2 }i2 <i1 ⊆ A F1∗ with the A–basis dual to {dxi2 ∧ dxi1 }i2 <i1 V2 in A F1 . The cup product resulting from the diagonal approximation in Theorem 5.8 is then explicitly given by  Pc ∂ (2) fj   ∂ xi1 ∧ ∂ xi2 + j=1 ∂xi1 ∂xi2 ∂fb if i1 < i2 , (2) ∂ xi1 ∪ ∂ xi2 = Pc ∂ 2 fj ∂fj if i = i1 = i2 , j=1 ∂ xi   ∂ if i > i . ∧∂ xi1 xi2 1 2 Moreover, the elements ∂fj are central, the co-unital diagonal approximation Φ being cocommutative in the dfj as pointed out in Corollary 5.5. These explicit calculations show that Hom•Aev (T , A) with the cup product ∪ = ∪Φ from Theorem 20 R.-O. BUCHWEITZ AND C. ROBERTS 5.8 satisfies the relations ∂ xi ∪ ∂ xi = ∂ xi1 ∪ ∂ xi2 + ∂ xi2 ∪ ∂ xi1 = c X ∂ (2) fj j=1 c X j=1 ∂ 2 xi ∂fj , ∂ 2 fj ∂fj , ∂xi1 ∂xi2 ∂ xi ∪ ∂ fj = ∂ fj ∪ ∂ xi , ∂ fj1 ∪ ∂ fj2 = ∂ fj2 ∪ ∂ fj1 . for i, i1 , i2 = 1, ..., n and j, j1 , j2 = 1, .., c. Putting it together, this shows (Hom•Aev (T , A), ∪) ∼ = Cliff(q) as graded algebras and the differential on Hom•Aev (T , A) readily identifies with ∂jacf on Cliff(q). This completes the proof of Theorem 2.11.  8. The Case of One Variable 8.1. Here we consider cyclic extensions A = K[x]/(f ), with K some commutative ring, f = a0 xd + · · · + ad ∈ P = K[x] a polynomial. We set I = (f ) and abbreviate ∂x f = ∂f ∂x . Let c = cf = (a0 , ..., ad ) ⊆ K be the content ideal of f . By [27, 5.3 Thm. 7], the polynomial f is a non-zero-divisor in K[x] if, and only if, the annihilator of the content ideal in K is zero, equivalently, HomK (K/c, K) = 0. To provide some context, we quote the following results from the literature and refer to the references cited below for unexplained terminology. Proposition 8.2. Let f = a0 xd + · · · + ad ∈ K[x] be a polynomial as above and set A = K[x]/(f ). (1) A is free as K–module if, and only if, the ideal I is generated by a monic polynomial. A is then necessarily free of finite rank. (2) A is finitely generated projective as K–module if, and only if, the ideal I is generated by a quasi-monic polynomial. (3) A is projective as K–module if, and only if, the ideal I is generated by an almost quasi-monic polynomial. (4) A is flat as K–module if, and only if, the content ideal c of f is generated in K by an idempotent. In cases (1) and (2), f is a non-zero-divisor in K[x], while in cases (3) and (4), the content ideal is generated by an idempotent e ∈ K, cf = (e). With K1 = K/(1 − e), K2 = K/(e), so that K = K1 × K2 , the polynomial ef is then a nonzero-divisor in K1 [x], while (1 − e)f = 0, and A ∼ = K1 [x]/(ef ) × K2 [x]. Proof. Parts (1), (2) and (3) can be found in [9], where also the terminology “(almost) quasi–monic” is introduced, while part (4) is contained in [28, Thm. 4.3].  Examples 8.3. The polynomial f = 15xd + 10x + 6, for d > 2, is quasi-monic over K = Z/30Z. The polynomial f = 15xd + 6, for d > 1, is almost quasi-monic, but not quasi-monic over K = Z/30Z. The ring A = Z[x]/(2x − 1) ∼ = Z[ 12 ] is flat as module over K = Z, but not projective. 8.4. In each of the cases considered in Proposition 8.2, we have a decomposition K = K1 × K2 and A ∼ = A1 × A2 , where A1 = K1 [x]/(f ) with f a non-zero-divisor MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 21 in K1 [x] and A2 = K2 [x] a polynomial ring. Moreover, as algebras, ∼ ExtAop ⊗ A (A1 , A1 ) × ExtAop ⊗ A (A2 , A2 ) , ExtAev (A, A) = 1 K1 1 2 K2 2 with the second factor satisfying ∂ (A2 , A2 ) ∼ ExtAop [−1] = K2 [x][0] ⊕ K2 [x] ∂x 2 ⊗K2 A2 with obvious multiplicative structure. We will therefore now concentrate on the case that the given polynomial f ∈ K[x] is a non-zero-divisor. 8.5. If f is a non-zero-divisor, the natural map A → I/I 2 , 1 7→ f mod I, is an f isomorphism, and 0 → P − → P → A → 0 is aVfree resolution of A both over P and K, so that TorK (A, A) = 0 for i > 2 and A I/I 2 → TorP (A, A) is trivially an i isomorphism. In other words, I = (f ) ⊆ P is a regular ideal. The only missing piece for A to be a homological complete intersection over K is thus the vanishing of TorK 1 (A, A). That vanishing is equivalent to f ⊗ 1 ∈ P ⊗K A being a non-zero-divisor, in turn equivalent to 1 ⊗ f, f ⊗ 1 forming a regular sequence in P ⊗K P . In light of [27, 5. Exercise 9], the sequence 1 ⊗ f, f ⊗ 1 is regular in P ⊗K P if, and only if, ExtiK (K/c, K) = 0 for i = 0, 1, that is, the depth of the content ideal c on K is at least 2. Example 8.6. Let R[s, t, u, v] be polynomial ring over a commutative ring R, and set K = R[s, t, u, v]/(sv − tu). For d > 1, the polynomial f (x) = sxd + v ∈ K[x] has content ideal cf = (s, v) of depth 2, while g(x) = sxd + u ∈ K[x] has content ideal cg = (s, u) of depth 1. Both f, g are thus non-zero-divisors in K[x], but only f defines a homological complete intersection A = K[x]/(f ) over K. 8.7. Constructing the beginning of the Tate resolution of the multiplication map µ : Aev ∼ = K[x′ , x′′ ]/(f (x′ ), f (x′′ )) → A, µ(x′ ) = µ(x′′ ) = x, as in Corollary 3.5, one obtains T (2) as a 2–periodic complex, augmented versus A in degree 0, 0O o AO o 0O o 0O o 0O o ··· ≡ µ 0o AO ǫ ′′ ′ ev o x −x A Aev o ∆ ′′ ′ ev o x −x A Aev o ··· ≡ T (2) where ∆ ∈ Aev is the residue class of the unique polynomial ∆(x′ , x′′ ) ∈ K[x′ , x′′ ] that satisfies f (x′′ ) − f (x′ ) = (x′′ − x′ )∆(x′ , x′′ ). Summarizing the discussion so far, we have the following characterizations, where we refer to [4, 8] for the terminology and properties of exact zero divisors. Theorem 8.8. If f = a0 xd + · · · + ad is a non-zero-divisor in K[x], then the following are equivalent. (1) A = K[x]/(f ) is a homological complete intersection over K. (2) T (2) resolves A as Aev –module. (3) (x′′ − x′ , ∆) is a pair of exact zero-divisors in Aev . (4) The content ideal c of f has grade at least 2, in that HomK (K/c, K) = 0 = Ext1K (K/c, K). 22 R.-O. BUCHWEITZ AND C. ROBERTS Moreover, A will be flat over K if, and only if the content ideal of f is the unit ideal in K. Proof. The equivalence (1)⇐⇒ (2) is a special case of Proposition 7.1, while (2)⇐⇒ (3) is a tautology, in that (x′′ − x′ , ∆) is, by definition, a pair of exact zero-divisors in Aev if, and only if, the ideals (x′′ − x′ ) and (∆) are each other’s annihilators in Aev , if, and only if, the 2–periodic complex T (2) displayed above is exact. The equivalence (3)⇐⇒ (4) has been discussed in 8.5 above. The final claim follows from Proposition 8.2 in that flatness means that cf is generated by an idempotent. If that idempotent is not 1, then f is not a non-zerodivisor in K[x].  Assume for the remainder of this section that f and A satisfy the equivalent conditions in Theorem 8.8. We determine the algebra Ext•Aev (A, A). 8.9. Call A′ = K[x]/ (f (x), ∂x f ), the ramification algebra of f and introduce as well the annihilator of ∂x f in A, given by θ = (f :P ∂x f ) /(f ) ⊆ A . Note that θ(∂x f ) = 0 in A, whence θ is naturally an A′ –module. In fact, θ ∼ = HomA (A′ , A), as dualizing the exact sequence 0 /θ /A ∂x f /A / A′ /0 of A–modules shows. The same sequence can be read to identify θ ∼ = DerK (A, A) 1 , the first André–Quillen (tangent) cohomology of A over K. and A′ ∼ = TA/K Theorem 8.10. Assume f ∈ K[x] is a polynomial whose content ideal c is of depth at least two. The Yoneda Ext–algebra of A = K[x]/(f ) as Aev –module is then graded commutative and satisfies Ext•Aev (A, A) ∼ = A × A′ (A′ ⊕ θt)[s] , (at)(bt) − abf (2) s; a, b ∈ θ where A, A′ and θ are in degree zero, t is of degree 1, while s is central of degree 2, and f (2) denotes the residue class of the second divided derivative of f in A′ . 2i In particular, the even Yoneda Ext–algebra Exteven Aev (A, A) = ⊕i>0 ExtAev (A, A) ′ ′ is the fibre product of the ring A over A with the polynomial ring A [s] in one variable of degree 2, ′ ∼ Exteven ev (A, A) = A ×A′ A [s] . A Proof. Just note that the algebra displayed is indeed the cohomology algebra of the DG Clifford algebra Aht, si with relations t2 = f (2) s, ts = st, and differential ∂(t) = (∂x f )s, ∂s = 0. Now apply Theorem 2.11.  Remark 8.11. While we know from graded commutativity of the algebra that the classes abf (2) , for a, b ∈ θ must be 2–torsion in A′ , we can do better, in that these classes are already 2–torsion in A. To see this, observe that 2f (2) = ∂ 2 f /∂x2 , the ordinary second derivative of f , and use that a∂x f = uf, b∂x f = vf for suitable polynomials u, v ∈ K[x], because MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 23 a, b ∈ θ. One then obtains ab ∂2f = a (∂x (b∂x f ) − ∂x b · ∂x f ) ∂x2 = a∂x (vf ) − a∂x b · ∂x f by the product rule, using b∂x f = vf , = a(∂x v)f + av∂x f − a∂x b · ∂x f by the product rule again, = (a∂x v + uv − u∂x b) f using a∂x f = uf , ≡ 0 mod f. Corollary 8.12. If 2 is a non-zero-divisor in A = K[x]/(f ), for f a polynomial in K[x] with content ideal of depth at least two, then Ext•Aev (A, A) is strictly graded commutative.  Example 8.13 (Inspired by [31, 19]). The foregoing Corollary fails in more than one variable. Consider A = Z[x, y]/(x2 − 4xy + y 2 − 1) as a Z–algebra. As f = x2 − 4xy + y 2 − 1 is monic in y of degree 2, the Z[x]–module A is free of rank 2, in particular, 2 is a non-zero-divisor on A and A is projective over Z. ∂f The Euler identity yields x ∂f ∂x +y ∂y = 2f +2 ≡ 2 in A, whence the Jacobi ideal of 1 ∼ A over Z is (2x−4y, −4x+2y) = 2A, and so TA/Z = A/(2A) ∼ = Z2 [x, y]/((x+y+1)2 ) is a nonzero 2–torsion A–module.   ∂f ∂ ∂ ∂ ∂ For D = 12 ∂f − ∂y ∂x ∂x ∂y = (2x−y) ∂x +(x−2y) ∂y one verifies that D(f ) = 0, already in Z[x, y]. Using Theorem 2.5, one finds ∂2f ∂ (2) f ∂ (2) f + (2x − y)(x − 2y) + (x − 2y)2 2 ∂x ∂x∂y ∂y 2 = (2x − y)2 − 4(2x − y)(x − 2y) + (x − 2y)2 q(D)(f ) = (2x − y)2 ≡ y 2 + x2 ≡ 1 mod (f, 2) , whence q(D)(f ) is not 2–torsion in the normal module NA/P ∼ = A. 1 Further, D ∪ D ≡ 1 (mod 2A) does not vanish in TA/K , in fact, the squaring 1 map sends Ext1Aev (A, A) ∼ , and one may verify = DerZ (A, A) surjectively onto TA/K 2 2 1 ∼ Ext ev (A, A) ∼ HH (A/K, A). easily that further TA/K = = A We finish this section by looking at some classical situations. The Separable or Unramified Case. Recall that a polynomial f (x) ∈ K[x] is separable over K, if its derivative ∂x f is a unit modulo f , equivalently, (f, ∂x f ) = K[x]. In that case, the content ideal cf necessarily equals K, whence f is a nonzero-divisor, A = K[x]/(f ) is flat over K, and Theorem 8.10 applies. We retrieve that all higher extension groups vanish, Ext>0 Aev (A, A) = 0, as it should be. The Generically Unramified Case. The polynomial f is generically unramified, if it is a non-zero-divisor in K[x] and its derivative ∂x f is a non-zero-divisor modulo f . Assuming furthermore that A is flat over K, equivalently, that the content of f is the unit ideal, Theorem 8.10 applies and shows that f is generically unramified if, and only if, Ext1Aev (A, A) = 0, equivalently, all odd extension groups Ext2i+1 Aev (A, A) vanish. In that case, the Yoneda Ext–algebra is thus reduced to its even part, the fibre product of A over A′ with a polynomial ring A′ [z] generated in cohomological degree 2. 24 R.-O. BUCHWEITZ AND C. ROBERTS There is no room for a non-zero squaring map and so the Ext–algebra is strictly graded commutative. The Totally Ramified Case. The polynomial f is totally ramified, if it is a nonzero-divisor in K[x], but its derivative ∂x f is zero modulo f . Equivalently, A′ = A. Assuming that the content of f is the unit ideal, Theorem 8.10 shows that the Yoneda algebra Ext•Aev (A, A) is the Clifford algebra over the A–quadratic map q : At → As, q(t) = f (2) (x)s. If f (2) (x) = 0 in A, as happens, for example, by Remark 8.11 if 2 is a non-zero-divisor in A, then the Yoneda algebra is the tensor product of the exterior algebra over A generated by t in degree 1 with the symmetric algebra over A generated by s in degree 2. In contrast, if f (2) (x) is a unit in A, whence A is necessarily of characteristic 2 by Remark 8.11, then the Yoneda algebra is the tensor algebra over A on a single generator t in degree 1. This covers the case A = K[x]/(x2 ) with char K = 2 mentioned in the Introduction. Polynomials over a field. Last, but not least, let us consider the case when the coefficient ring K is a field. Then being a non-zero-divisor simply means that f is not the zero polynomial. Trivially, A is projective over K, thus the Yoneda Ext–algebra of self-extensions agrees with Hochschild cohomology. Further, K[x] being a principal ideal domain, we obtain explicit descriptions of A′ and θ. Set g = gcd(f, ∂x f ) and h = f /g in K[x], so that A′ ∼ = K[x]/(g) and θ = (f (x) : ∂x f )/(f ) ∼ = (h)/(f ). Thus, θ is the principal ideal generated by h in K[x]/(f ), isomorphic to A′ as A–module. Therefore, we obtain the following presentation HH• (A/K) ∼ = K[x, y, z]  f, gy, gz, y 2 + f (2) h2 z of the Hochschild cohomology ring of A = K[x]/(f ) over K as a quotient of a graded polynomial ring, where x is of degree 0, y is the class of h∂x of degree 1, and z is of degree 2. If char K 6= 2, then necessarily f (2) h2 ≡ 0 (mod f ) by Remark 8.11 and the description simplifies accordingly. Remark 8.14. This last example encompasses Theorem 3.2, Lemma 4.1, Lemma 5.1, Theorem 5.2 and Theorem 6.2 from [23], completes the characteristic 2 cases that were not handled there, and covers as well Theorem 3.9 from [36]. 9. Cohomology of Finite Abelian Groups 9.1. As our final example, we consider the Hochschild and ordinary cohomology of finite abelian groups. If G = µn1 × · · · µnr is such a group, with µn the multiplicatively written cyclic group of order n, we may assume that the orders of the factors satisfy 2 6 n1 | n2 | · · · | nr , so that the ni are the elementary divisors or invariant factors of the group. 9.2. The group algebra on G over a commutative ring K is then given by A = KG ∼ = K[x1 , ..., xr ]/(xn1 1 − 1, ..., xnr r − 1). It is a homological complete intersection over K, thus, Theorem 2.11 applies. However, because the variables xi become units in A, one can simplify that result in this case, and recover as well the fact established in [17] that there is an isomorphism of graded commutative algebras MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 25 HH• (A/K) ∼ = A⊗K Ext•A (K, K), where K is considered an A–module via the trivial representation of G. Theorem 9.3. Let G = µn1 × · · · µnr be a finite abelian group as above. The Hochschild cohomology of KG over K is then the cohomology of the tensor product of differential graded Clifford algebras, ! r O Khτj , σj i , ∂τj = nj σj , ∂σj = 0 , (C(G), ∂) = KG ⊗K (τj2 − mj σj , τj σj − σj τj ) j=1 where mj = ( 0 nj /2 if nj is odd, if nj is even , and the (cohomological) degree of the τj is 1, that of the σj is 2. Further, the cohomology of the second factor in the tensor product is the group cohomology H • (G, K) = Ext•KG (K, K), where K is the trivial G–representation, and one retrieves the isomorphism from [17] of graded commutative algebras HH• (KG/K) ∼ = KG ⊗K H • (G, K) . Proof. Note that A = KG ∼ = Kµn1 ⊗K · · · ⊗K Kµnr and that accordingly the multiplication map µ : Aev → A is the tensor product over K of the multiplication maps µj : (Kµj )ev → Kµj . It follows that a Tate model for A over K is obtainable as tensor product of the corresponding Tate models of the cyclic groups involved. Thus, it remains to discuss the Tate model of a single cyclic group, say µn , for some natural number n. The group algebra Kµn ∼ = K[x]/(xn − 1) is a cyclic extension of K, free as K–module. Therefore, we can apply 8.7 with f = xn − 1 ∈ K[x] to obtain the Tate model T (2) = T as a 2–periodic complex, augmented versus Kµn in degree 0, 0O o 0O o KµO n o 0O o 0O o ··· ≡ µ 0o Kµ n O ǫ x Kµn ev o ′′ −x ′ Kµn ev o ∆ x Kµn ev o ′′ −x ′ Kµn ev o ··· ≡ T (2) where ∆ ∈ Kµn ev is the residue class of the unique polynomial ∆ = ∆(x′ , x′′ ) = n−1 X (x′′ )n − (x′ )n (x′′ )i (x′ )n−1−i ∈ K[x′ , x′′ ] = ′′ ′ x −x i=0 that satisfies f (x′′ )−f (x′ ) = (x′′ −x′ )∆(x′ , x′′ ) in K[x′ , x′′ ]. Written as DG algebra, ^ T = Kµn ev hdx, df i ∼ (dx) ⊗Kµn ev ΓKµn ev (df ) , = ev Kµn with dx in (homological) degree 1 and df in degree 2 and differential ∂(df ) = ∆(x′ , x′′ )dx and ∂(dx) = x′′ − x′ . Further, the co-unital diagonal approximation Φ : T → T ⊗Kµn T from Proposition 5.4 is determined by Φ1 (dx) = dx′ + dx′′ Φ2 (df ) = dx′ + dx′′ − X (x′ )p (dx′ )xq (dx′′ )(x′′ )r p+q+r=n−2 26 R.-O. BUCHWEITZ AND C. ROBERTS in our earlier notation. Next we adapt this co-unital diagonal approximation using Theorem 5.6. Setting x = x′ = x′′ , we have   n n−2 ′ ′′ ′ ′′ Φ2 (df ) ≡ dx + dx − x dx dx mod (x′′ − x, x − x′ ) . 2 Now the form dx′ df ′′ ∈ T ⊗Kµn T of degree 3 is in the kernel of both augmentation maps ǫ1,2 and satisfies ∂(dx′ df ′′ ) = (x − x′ )df ′′ − dx′ ∆(x, x′′ )dx′′ ≡ nxn−1 dx′ dx′′ mod (x′′ − x, x − x′ ) . As x is a unit in Kµn , we can adjust Φ2 by adding ∂η, where ( n−1 (x′ )−1 dx′ df ′′ if n is odd, η = n 2 ′ −1 ′ ′′ dx df if n is even, 2 (x ) to obtain the adapted co-unital diagonal approximation Ψ that agrees in degrees 0, 1 with Φ, but in degree 2 is given by Ψ(df ) = Φ2 (df ) + ∂η ≡ dx′ + dx′′ mod (x′′ − x, x − x′ ) if n is odd, n n−2 ′ ′′ x dx dx mod (x′′ − x, x − x′ ) 2 if n is even. (This adaptation of the multiplicative structure in case of a cyclic group already occurs in [15, Chap. XII §7, p.252].) At this stage, HomKµn ev (T , Kµn ) with the cup product ∪Ψ and original differential is the DG Clifford algebra Ψ(df ) = Φ2 (df ) + ∂η ≡ dx′ + dx′′ − HomKµn ev (T , Kµn ) ∼ = Kµn ht, si , (t2 − mxn−2 s, st − ts) where m = 0 for n odd, m = n/2 for n even, while the differential satisfies ∂(t) = nxn−1 s and ∂s = 0. For the final touch, set τ = xt, σ = xn s and note that this coordinate change is indeed invertible, as x is a unit in Kµn . In terms of τ, σ we obtain   Kµn hτ, σi (HomKµn ev (T , Kµn ), ∂) ∼ , ∂(τ ) = nσ, ∂σ = 0 . = (τ 2 − mσ, στ − τ σ) Finally, taking the tensor product over K of the Tate models for the cyclic groups involved, their adapted diagonal approximations fit together to endow the tensor product with a co-unital diagonal approximation. Dualizing into KG over KGev results in the DG Clifford algebra (C(G), ∂) in the statement of the theorem. To establish the relation to group cohomology, note first that  ! r O Khτ , σ i j j  H(C(G), ∂) ∼ = KG ⊗K H  2 − m σ , τ σ − σ τ ) , ∂τj = nj σj , ∂σj = 0 (τ j j j j j j j j=1 as KG is flat over K. Secondly, observe that applying K ⊗KG (−) to the Tate model T of µ : KGev → KG and then taking cohomology of HomKG (K ⊗KG T , K ⊗KG T ) yields a homomorphism of graded algebras K⊗KG (−) Ext•KGev (KG, KG) −−−−−−−−→ Ext•KG (K, K) MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 27 that factors through K ⊗KG Ext•KGev (KG, KG). Thus, one obtains a homomorphism of graded algebras  ! r O Khτ , σ i j j  −→ Ext•KG (K, K) , (⋄) H 2 − m σ , τ σ − σ τ ) , ∂j (τ j j j j j j j j=1 where ∂j τj = nj σj , ∂j σj = 0. One may check directly that this is an isomorphism by noting that one may construct a Tate model for the augmentation KG → K that returns the argument of H in the source of this homomorphism and that this is, at least, a K–linear isomorphism, if one initially ignores the multiplicative structure. Alternatively, one may use [33] to observe that the structure map K → KG induces an algebra homomorphism ExtKG (K, K)−→KG ⊗ ExtKG (K, K) ∼ = HH(KG/K) that provides a splitting to the K–algebra homomorphism (⋄).  Remark 9.4. One obstacle to an even more transparent proof that (⋄) is an isomorphism is that the co-unital diagonal approximation on the Tate model for µ : KGev → KG does not obviously induce such an approximation when applying K ⊗KG (−). This obstacle can be overcome by exhibiting directly such a co-unital diagonal approximation on the Tate model for the augmentation KG → K, as is done in [30], so that it will agree with the one on K ⊗KG C(G) exhibited above. An explicit co-unital diagonal approximation on the Tate model for the augmentation KG → K has also been described in [24] and we refer to that reference and [30] for explicit information on the structure of H(G, K), augmenting and reproducing results from [16, 38]. References [1] André, M.: Homologie des algèbres commutatives. Die Grundlehren der mathematischen Wissenschaften, Band 206. Springer-Verlag, Berlin-New York, 1974. xv+341 pp. 19 [2] Avramov, L. L.: Local algebra and rational homotopy. Algebraic homotopy and local algebra (Luminy, 1982), 15–43, Astérisque, 113-114, Soc. Math. France, Paris, 1984. 5 [3] Avramov, L. L.: Infinite free resolutions. Six lectures on commutative algebra (Bellaterra, 1996), 1–118, Progr. Math., 166, Birkhäuser, Basel, 1998. 7 [4] Avramov, L. L.; Bonacho Dos Anjos Henriques, I. B.; Şega, L. M.: Quasi-complete intersection homomorphisms. preprint 2010, 20 pages, arXiv:1010.2143 5, 18, 21 [5] Avramov, L. L.; Vigué-Poirrier, M.: Hochschild homology criteria for smoothness. Internat. Math. Res. Notices 1992, no. 1, 17–25. 7 [6] Bergeron, N.; Wolfgang, H.L.: The decomposition of Hochschild cohomology and Gerstenhaber operations. J. Pure Appl. Algebra 104 (1995), no. 3, 243–265. 6 [7] Blanco, A.; Majadas, J.; Rodicio, A. G.: On the acyclicity of the Tate complex. J. Pure Appl. Algebra 131 (1998), no. 2, 125–132. 5, 18 [8] Bonacho Dos Anjos Henriques, I.; Şega, L. M.: Free resolutions over short Gorenstein local rings. Math. Z. 267 (2011), no. 3-4, 645–663. 21 [9] Brewer, J. W.; Montgomery, P. R.: The finiteness of I when R[X]/I is R–projective. Proc. Amer. Math. Soc. 41 (1973), 407–414. 20 [10] Brüderle, S.; Kunz, E.: Divided powers and Hochschild homology of complete intersections. With an appendix by Reinhold Hübl. Math. Ann. 299 (1994), no. 1, 57–76. 19 [11] Buchweitz, R.-O.; Flenner, H.: Global Hochschild (co-)homology of singular spaces. Adv. Math. 217 (2008), no. 1, 205–242. 11 [12] Buenos Aires Cyclic Homology Group: Hochschild and cyclic homology of hypersurfaces. Adv. Math. 95 (1992), no. 1, 18–60. 19 28 R.-O. BUCHWEITZ AND C. ROBERTS [13] Calaque, D.; Van den Bergh, M.: Hochschild cohomology and Atiyah classes. Adv. Math. 224 (2010), no. 5, 1839–1889. 6 [14] Cartan, H.: Algèbre d’Eilenberg-Mac Lane et Homotopie. Séminaire Henri Cartan 7 (195455); available in electronic form through NumDam. 7 [15] Cartan, H. and Eilenberg, S.: Homological algebra, Princeton University Press, 1956. 18, 26 [16] Chapman, G. R.: The cohomology ring of a finite abelian group. Proc. London Math. Soc. (3) 45 (1982), no. 3, 564–576. 27 [17] Cibils, C. and Solotar, A.: Hochschild cohomology algebra of abelian groups. Arch. Math. (Basel) 68 (1997), no. 1, 17–21. 24, 25 [18] Cuntz, J. and Quillen, D.: Algebra extensions and nonsingularity. J. Amer. Math. Soc. 8, no. 2 (1995), 251–289. 8 [19] Dumitrescu, T.; Ionescu, C.: Some examples of two-dimensional regular rings. preprint 2013, 6 pages, arXiv:1301.2615 23 [20] Gerstenhaber, M.: The cohomology structure of an associative ring. Ann. of Math. (2) 78 (1963), 267–288 1 [21] Grothendieck, A.: Eléments de géométrie algébrique. IV. Étude locale des schémas et des morphismes de schémas. I. Inst. Hautes Études Sci. Publ. Math. No. 20 (1964), 259 pp. 2 [22] Guccione, J. A.; Guccione, J. J.: Hochschild homology of complete intersections. J. Pure Appl. Algebra 74 (1991), no. 2, 159–176 6, 19 [23] Holm, T.: Hochschild cohomology rings of algebras k[X]/(f ). Beiträge Algebra Geom. 41 (2000), no. 1, 291–301. 24 [24] Hübschmann, J.: Cohomology of finitely generated abelian groups. Enseign. Math. (2) 37 (1991), no. 1-2, 61–71. 27 [25] Iyengar, S.: Acyclicity of Tate constructions. J. Pure Appl. Algebra 163 (2001), no. 3, 289–300. 18 [26] Majadas, J.; Rodicio, A. G.: The Hochschild (co-)homology of hypersurfaces. Comm. Algebra 20 (1992), no. 2, 349–386. 19 [27] Northcott, D. G.: Finite free resolutions. Cambridge Tracts in Mathematics, No. 71. Cambridge University Press, Cambridge-New York-Melbourne, 1976. xii+271 pp. 20, 21 [28] Ohm, J.; Rush, D. E.: The finiteness of I when R[X]/I is flat. Trans. Amer. Math. Soc. 171 (1972), 377–408. 20 [29] Quillen, D.: On the (co-)homology of commutative rings. Applications of Categorical Algebra (Proc. Sympos. Pure Math., Vol. XVII, New York, 1968) pp. 65–87. Amer. Math. Soc., Providence, R.I., 1970. 4, 5 [30] Roberts, C. D.: The Cohomology Ring of a Finite Abelian Group. Thesis (Ph.D.)– University of Waterloo. 2013. 141 pages. 2, 27 [31] Roberts, L. G.: Some examples of smooth and regular rings. Canad. Math. Bull. 23 (1980), no. 3, 255–259. 23 [32] Sanada, K.: On the Hochschild cohomology of crossed products. Comm. Algebra 21 (1993), no. 8, 2727–2748. 10, 11 [33] Siegel, S. F.; Witherspoon, S. J.: The Hochschild cohomology ring of a group algebra. Proc. London Math. Soc. (3) 79 (1999), no. 1, 131–157. 27 [34] Sjödin, G.: Hopf algebras and derivations. J. Algebra 64 (1980), no. 1, 218–229. 5 [35] Suárez-Alvarez, M.: The Hilton-Heckmann argument for the anti-commutativity of cup products. Proc. Amer. Math. Soc. 132 (2004), no. 8, 2241–2246 11 [36] Suárez-Alvarez, M.: Applications of the change-of-rings spectral sequence to the computation of Hochschild cohomology. preprint 2007, 27 pages, arXiv:0707.3210 24 [37] Tate, J.: Homology of Noetherian rings and local rings. Illinois J. Math. 1 (1957), 14–27. 7, 18 [38] Townsley Kulich, L. G.: Investigations of the integral cohomology ring of a finite group. Thesis (Ph.D.)–Northwestern University. 1988. 83 pp. 2, 27 [39] Wolffhardt, K.: The Hochschild homology of complete intersections. Trans. Amer. Math. Soc. 171 (1972), 51–66 6, 19 MULTIPLICATIVE STRUCTURE OF HOCHSCHILD COHOMOLOGY 29 Dept. of Computer and Mathematical Sciences, University of Toronto at Scarborough, 1265 Military Trail, Toronto, ON M1C 1A4, Canada E-mail address: [email protected] Dept. of Pure Mathematics, University of Waterloo, 200 University Avenue West, Waterloo, ON N2L 3G1, Canada E-mail address: [email protected]
0math.AC
JMLR: Workshop and Conference Proceedings 1–7 Unsupervised model compression for multilayer bootstrap networks Xiao-Lei Zhang arXiv:1503.06452v1 [cs.LG] 22 Mar 2015 [email protected] Department of Computer Science and Engineering, The Ohio State University, Columbus, OH 43210, USA. Abstract Recently, multilayer bootstrap network (MBN) has demonstrated promising performance in unsupervised dimensionality reduction. It can learn compact representations in standard data sets, i.e. MNIST and RCV1. However, as a bootstrap method, the prediction complexity of MBN is high. In this paper, we propose an unsupervised model compression framework for this general problem of unsupervised bootstrap methods. The framework compresses a large unsupervised bootstrap model into a small model by taking the bootstrap model and its application together as a black box and learning a mapping function from the input of the bootstrap model to the output of the application by a supervised learner. To specialize the framework, we propose a new technique, named compressive MBN. It takes MBN as the unsupervised bootstrap model and deep neural network (DNN) as the supervised learner. Our initial result on MNIST showed that compressive MBN not only maintains the high prediction accuracy of MBN but also is over thousands of times faster than MBN at the prediction stage. Our result suggests that the new technique integrates the effectiveness of MBN on unsupervised learning and the effectiveness and efficiency of DNN on supervised learning together for the effectiveness and efficiency of compressive MBN on unsupervised learning. Keywords: Model compression, multilayer bootstrap networks, unsupervised learning. 1. Introduction Dimensionality reduction is a core problem of machine learning, where classification and clustering can be regarded as its special cases that reduce high dimensional data to discrete points. In this paper, we focus on unsupervised learning. Traditionally, dimensionality reduction can be categorized to kernel methods, neural networks, probabilistic models, and sparse coding. Kernel methods are too costly on large-scale problems. Although neural networks are scalable to large scale data, they double the computational complexity by a bottleneck structure and take the input as the output of the bottleneck structure at the training stage which is slow, moreover, they learn data distribution globally which is not very effective on learning local structures. Multilayer bootstrap network (MBN) is a recently proposed bootstrap method (or unsupervised ensemble method). It has multiple nonlinear layers. Each layer is an ensemble of k-centers clusterings. The centers of each k-centers clustering are only randomly sampled data points (called a bootstrap sample) from the input. MBN is easily implemented and trained, and scales well to large-scale problems as neural networks at the training stage. Moreover, MBN learns a data distribution locally so that it can learn effective representa- c X.-L. Zhang. Zhang tions of data easily. However, MBN contains hundreds of clusterings, which is difficult to be used for prediction. Motivated by the aforementioned problem and the recent progress of compressing ensemble classifiers to a single small classifier in supervised learning (Bucilu et al. (2006); Hinton et al. (2015)), in this abstract paper, we propose an unsupervised model compression framework. The framework uses a supervised model to approximate the mapping function from the input of an unsupervised bootstrap method to the output of the application of the unsupervised bootstrap method. We further specify the framework by taking MBN as the unsupervised bootstrap method and DNN as the supervised model. The proposed method is named compressive MBN. To our best knowledge, this is the first work of model compression for bootstrap methods on unsupervised learning. 2. Methods Compressive MBN is as follows: • The first step trains MBN on a give training set, and outputs the low dimensional representation of the training data points. • [A step driven by applications] The second step applies the low dimensional representation to a given application in unsupervised learning, and outputs the prediction result of the training data. • The third step trains a DNN with the training set as the input and the prediction result as the target. Finally, the DNN model will be used for prediction. The algorithm is a very basic framework. We can easily extend compressive MBN to other techniques by simply using other unsupervised bootstrap techniques to replace MBN in the first step for potentially better performance. We can also use many other supervised learners to replace DNN in the third step, but to our knowledge, DNN is currently already a good choice. We may also design a lot of new algorithms by simply specifying the second step for different applications. Some examples are as follows. (i) When compressive MBN is used for visualization, we may omit the second step, and simply take the input and output of the MBN as the input and output of DNN respectively. (ii) When compressive MBN is used for unsupervised prediction, we may run a hard clustering algorithm on the training set, and get the predicted indicator vector of each training data point. For example, if a data point is assigned to the second cluster, then its predicted indicator vector is [0, 1, 0, 0, . . . , 0]. We may also get the probabilistic output of the clustering. 3. Experiments We conducted an initial experiment on MNIST. We showed that the technique is very helpful for reducing the high computational cost of MBN on unsupervised prediction problems. The MNIST data was normalized by dividing its entries by 255. 2 Unsupervised model compression for multilayer bootstrap networks Figure 1: MBN. Its prediction time on the 5000 images is 2333.24 seconds. Figure 2: Compressive MBN. Its prediction time on the 5000 images is 0.58 seconds. 3.1. Experiment on visualizing small subsets of MNIST In this subsection, we did not consider the generalization ability of MBN and compressive MBN. Instead, we studied their visualization ability. A data set that contained 5000 unlabeled images randomly selected from the training set of MNIST was used for both training and test. For the MBN training, we trained MBN similarly as in the second experiment in (Zhang (2014)). Specifically, the number of clusterings in each layer was set to 400. The parameters k from layer 1 to layer 9 were set to 4000-2000-1000-500-250-125-65-30-15 respectively. As we can see, MBN is a very large sparse model: (4000-2000-1000-500-250-125-65-30-15)×400. The parameter a for random feature selection was set to 0.5. The parameter r for random 3 Zhang reconstruction was set to 0.5. After getting the high-dimensional sparse representation from MBN at the top hidden layer, we mapped it to two dimensional space by the expectationmaximization principle component analysis (EM-PCA) (Roweis (1998)). For the training of compressive MBN, we omitted the second step, and used the input and output of MBN as the input and output of a DNN model respectively. The parameter settings are as follows. We trained a 786-2048-2048-2 DNN. The dropout rate was set to 0.2. The rectified linear unit was used as the hidden unit, and the linear function was used as the output unit. The number of the training epoches was set to 120. The batch size was set to 32. The learning rate was set to 0.001. The two dimensional visualizations produced by MBN and compressive MBN were shown in Fig. 1 and Fig. 2 respectively. From the two figures, we found that the visualizations of both MBN and compressive MBN by DNN were equivalently good. When we used the features for clustering, the NMIs of both the methods were around 81%. Amazingly, the prediction time of the compressive MBN on the 5000 images was only 0.58 seconds, which accelerated the prediction time of MBN by around 4000 times!1 3.2. Experiment on the full MNIST We used all 60,000 training images for unsupervised model training and 10,000 test images for test. We discussed the unsupervised generalization ability of the compressive MBN on the test images. 3.2.1. Compressive MBN without random reconstruction (i.e. parameter r = 0) For the MBN training, we trained MBN similarly as in the third experiment in (Zhang (2014)). Specifically, the number of clusterings in each layer was set to 400. The parameters k from layer 1 to layer 9 were set to 4000-2000-1000-500-250-125-65-30-15 respectively. As we can see, MBN is a very large sparse model: (4000-2000-1000-500-250-125-65-30-15)×400. The parameter a for random feature selection was set to 0.5. The parameter r for random reconstruction was set to 0. After getting the high-dimensional sparse representation from MBN at the top hidden layer, we mapped it to 5 dimensional space by EM-PCA (Roweis (1998)). We further encoded the 5-dimensional representations to 10-dimensional indicator vectors by k-means clustering, which was a specialization of the second step of compressive MBN. For the training of compressive MBN, we took the raw feature of the training set as the input of DNN, and took the 10-dimensional predicted indicator vectors as the training target of DNN. The parameter settings of the DNN were as follows. We trained a 7862048-2048-10 DNN. The dropout rate was set to 0.2. The rectified linear unit was used as the hidden unit, and the sigmoid function was used as the output unit. The number of the training epoches was set to 50. The batch size was set to 128. The learning rate was set to 0.001. Because k-means clustering suffers from local minima, we ran the aforementioned methods 10 times and recorded the average results. The experimental comparison between MBN 1. MBN did not enable parallel computing. 4 Unsupervised model compression for multilayer bootstrap networks MBN & Compressive MBN without random reconstruction 0.9 0.85 Normalized mutual information 0.8 0.75 0.7 0.65 0.6 Training accuracy by MBN 0.55 Training accuracy by compressive MBN Test accuracy by MBN 0.5 Test accuracy by compressive MBN 0.45 0.4 0 2 4 6 Number of layers 8 10 Figure 3: Comparison of the generalization ability of MBN and compressive MBN on clustering when the random reconstruction of MBN is not used (i.e. r = 0). The clustering accuracy is evaluated by normalized mutual information. The prediction time of MBN on the 10,000 test images is 4699.69 seconds. The prediction time of compressive MBN on the 10,000 test images is 1.15 seconds. MBN & Compressive MBN with random reconstruction 0.9 0.85 Normalized mutual information 0.8 0.75 0.7 0.65 0.6 0.55 Training accuracy by MBN 0.5 Training accuracy by compressive MBN Test accuracy by MBN 0.45 0.4 Test accuracy by compressive MBN 0 2 4 6 Number of layers 8 10 Figure 4: Comparison of the generalization ability of MBN and compressive MBN on clustering when the random reconstruction of MBN is not used (i.e. r = 0.5). The prediction time of MBN on the 10,000 test images is 4857.45 seconds. The prediction time of compressive MBN on the 10,000 test images is 1.10 seconds. and compressive MBN was summarized in Fig. 3. From the figure, we observed that the curves of the training accuracy of MBN and compressive MBN were completely coincident; 5 Zhang moreover, the curve of prediction of compressive MBN was even slightly better than that of MBN; the highest prediction accuracy of compressive MBN reached 84% in terms of NMI. The most advanced property of compressive MBN is that it needed only 1.15 seconds to predict 10,000 images, while MBN needed 4699.69 seconds to predict 10,000 images. The prediction time was accelerated by around 4000 times. 3.2.2. Compressive MBN with random reconstruction (i.e. parameter r = 0.5) It is shown in (Zhang (2014)) that when the data is small scale (i.e. the training size was similar to the largest parameter k), the random reconstruction operation can be quite helpful, however, it is still unclear that whether random reconstruction will be helpful when the data is large scale (i.e. the training size is much larger than the largest parameter k), since the largest k in the third experiment of (Zhang (2014)) was only 1000 and the experimental results of MBN with or without random reconstruction was not very exciting. In this subsection, we enlarged k to 4000 as in Section 3.2.1. The experimental settings of both MBN and compressive MBN were the same as in Section 3.2.1 except that we set r = 0.5 and mapped the sparse features to 2 dimensional space by EM-PCA. The experimental results were summarized in Fig. 4. From the figure, we observed that all experimental conclusions in Section 3.2.1 could also be summarized here, except that when random reconstruction was used, the performance of both MBN and compressive MBN was not as good as that without random reconstruction. 4. Conclusions In this paper, we proposed a general framework for unsupervised model compression. The framework takes MBN (Zhang (2014)) as a case of study. The specialized technique, named compressive MBN, uses DNN as an auxiliary model for modeling the mapping function from the input of MBN to the prediction result of a given application that takes the low dimension output of MBN as its input. The new technique aims to solve the problem that although MBN is simple, effective, robust, and efficient-at-the-training-stage, it is time consuming on prediction. Our initial experimental result on MNIST showed that compressive MBN not only inherited the generalization ability of MBN (and is even slightly better than MBN), but also accelerated the prediction efficiency of MBN by over thousands of times. Compressive MBN concatenates the effectiveness of MBN on unsupervised learning and the effectiveness and efficiency of DNN on supervised learning together for both its effectiveness and its efficiency on unsupervised learning. Moreover, we can easily extend compressive MBN to other unsupervised model compression techniques. 5. Acknowledgements The author thanks Dr Yuxuan Wang for providing the well-designed DNN toolbox and Prof DeLiang Wang for providing computing resources of the Ohio Supercomputing Center. 6 Unsupervised model compression for multilayer bootstrap networks References Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proc. 12th Int. Conf. Knowl. Disc., Data Min., pages 535–541. ACM, 2006. Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. Sam T Roweis. EM algorithms for PCA and SPCA. In Advances in Neural Information Processing Systems 10, pages 626–632, Denver, CO, 1998. Alexander Strehl and Joydeep Ghosh. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. J. Mach. Learn. Res., 3:583–617, 2003. Xiao-Lei Zhang. Nonlinear dimensionality reduction of data by multilayer bootstrap networks. arXiv preprint arXiv:1408.0848, pages 1–18, 2014. 7
9cs.NE
Approximating the Largest Root and Applications to Interlacing Families arXiv:1704.03892v1 [cs.DS] 12 Apr 2017 Nima Anari1 , Shayan Oveis Gharan2 , Amin Saberi1 , and Nikhil Srivastava3 1 Stanford University, {anari,saberi}@stanford.edu University of Washington, [email protected] 3 University of California, Berkeley, [email protected] 2 April 14, 2017 Abstract We study the problem of approximating the largest root of a real-rooted polynomial of degree n using its top k coefficients and give nearly matching upper and lower bounds. We present algorithms with running time polynomial in k that use the top k coefficients to approximate the maximum root within a factor of n1/k and 1 + O( logk n )2 when k ≤ log n and k > log n respectively. We also prove corresponding information-theoretic lower bounds of nΩ(1/k) and  2n 2 log k , and show strong lower bounds for noisy version of the problem in which one is 1+Ω k given access to approximate coefficients. This problem has applications in the context of the method of interlacing families of polynomials, which was used for proving the existence of Ramanujan graphs of all degrees, the solution of the Kadison-Singer problem, and bounding the integrality gap of the asymmetric traveling salesman problem. All of these involve computing the maximum root of certain real-rooted polynomials for which the top few coefficients are√accessible in subexponential time. Our results 3 yield an algorithm with the running time of 2Õ( n) for all of them. Contents 1 Introduction 1.1 Motivation and Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Preliminaries 2 3 5 3 Approximation of the Largest Root 8 3.1 Proof of Theorem 3.1: An Algorithm for Approximating the Largest Root . . . . . . 9 3.2 Proofs of Theorems 3.2 and 3.3: Matching Lower Bounds . . . . . . . . . . . . . . . 11 3.3 Lower Bound Given Approximate Coefficients . . . . . . . . . . . . . . . . . . . . . . 15 4 Applications to Interlacing Families 17 4.1 Oracle for Kadison-Singer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.2 Oracle for ATSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1 A Appendix A: Proofs of Preliminary Facts 23 B Appendix B: Constructions of Graphs with Large Girth 24 1 Introduction For a non-negative vector µ = (µ1 , . . . , µn ) ∈ Rn+ , let χµ denote the unique monic polynomial with roots µ1 , . . . , µn : n Y (x − µi ). χµ (x) := i=1 Suppose that we do not know µ, but rather know the top k coefficients of χµ where 1 ≤ k < n. In more concrete terms, suppose that χµ (x) = xn + c1 xn−1 + c2 xn−2 + · · · + cn , and we only know c1 , . . . , ck . What do c1 , . . . , ck tell us about the roots and in particular maxi µi ? Problem 1.1. Given the top k coefficients of a real rooted polynomial of degree n, how well can you approximate its largest root? This problem may seem completely impossible if k is significantly smaller than n. For example, consider the two polynomials xn −a and xn −b. The largest roots of these two polynomials can differ arbitrarily in absolute value and even by knowing the top n − 1 coefficients we can not approximate the absolute value of the largest at all. The key to approach the above problem is to exploit real rootedness. One approach is to construct a polynomial with the given coefficients and study its roots. Unfortunately, even assuming that the roots of the original polynomial are real and well-separated, adding an exponentially small amount of noise to the (bottom) coefficients can lead to constant sized perturbations of the roots in the complex plane — the most famous example is Wilkinson’s polynomial [Wil84]: (x − 1)(x − 2) . . . (x − 20). Instead, we use the given coefficients to compute a polynomial of the roots, e.g., the k-th moment of the roots, and we use that polynomial to estimate the largest root. Our contributions towards Problem 1.1 are as follows. Efficient Algorithm for Approximating the Largest Root. In Theorem 3.1, we present an upper bound showing that we can use the top k coefficients of a real rooted polynomial with nonnegative roots to efficiently obtain an αk,n approximation of the largest root where ( n1/k k ≤ log n, αk,n = log n 2 1 + O( k ) k > log n. Moreover   such an approximation can be done in poly(k) time. This implies that exact access to log n O √ǫ coefficients is sufficient for (1 + ǫ)-approximation of the largest root. 2 Nearly Matching Lower Bounds. The main nontrivial part of this work is our informationtheoretic matching lower bounds. In Theorem 3.2, we show that when k < n1−ǫ and for some constant c, there are no algorithms with approximation factor better than αck,n . Chebyshev polynomials are critical for this construction as well. We also use known constructions for large-girth graphs, and the proof of [MSS13a] for a variant of Bilu-Linial’s conjecture [BL06]. Our bounds can be made slightly sharper assuming Erdős’s girth conjecture. 1.1 Motivation and Applications For many important polynomials, it is easy to compute the top k coefficients exactly, whereas it is provably hard to compute all of them. One example is the matching polynomial of a graph, whose coefficients encode the number of matchings of various sizes. For this polynomial, computing the constant term, i.e. the number of perfect matchings, is #P-hard [Val79], whereas for small k, one can compute the number of matchings of size k exactly, in time nO(k) , by simply enumerating all possibilities. Roots of the matching polynomial, and in particular the largest root arise in a number of important applications [HL72, MSS13a, SS13]. So it is natural to ask how well the largest root can be approximated from the top few coefficients. Another example of a polynomial whose top coefficients are easy to compute is the independence polynomial of a graph, which is real rooted for claw-free graphs [CS07], and whose roots have connections to the Lovász Local Lemma (see e.g. [HSV16]). Subexponential Time Algorithms for Method of Interlacing Polynomials Our main motivation for this work is the method of interlacing families of polynomials [MSS13a, MSS13b, AO15b], which has been an essential tool in the development of several recent results including the construction of Ramanujan graphs via lifts [MSS13a, MSS15, HPS15], the solution of the KadisonSinger problem [MSS13b], and improved integrality gaps for the asymmetric traveling salesman problem [AO15a]. Unfortunately, all these results on the existence of expanders, matrix pavings, and thin trees, have the drawback of being nonconstructive, in the sense that they do not give polynomial time algorithms for finding the desired objects (with the notable exception of [Coh16]). As such, the situation is somewhat similar to that of the Lovász Local Lemma (which is able to guarantee the existence of certain rare objects nonconstructively), before algorithmic proofs of it were found [Bec91, MT10]. √ 3 In Section 4, we use Theorem 3.1 to give a 2Õ( m) time algorithm for rounding an interlacing family of depth m, improving on the previously known running time of 2O(m) . This leads to algorithms of the same running time for all of the problems mentioned above. Lower Bounds Given Approximate Coefficients In the context of efficient algorithms, one might imagine that computing a much larger number of coefficients approximately might provide a better estimate of the largest root. In particular, we consider the following noisy version of Problem 1.1: Problem 1.2. Given real numbers a1 , . . . , ak , promised to be (1 + δ)−approximations of the first k coefficients of a real-rooted polynomial p, how well can you approximate the largest root of p? An important extension of our information theoretic lower bounds is that Problem 1.1 is extremely sensitive to noise: in Proposition 3.12 we prove that even knowing all but the k-th coefficient 3 exactly and knowing the k-th one up to a 1+1/2k error is no better than knowing only the first k−1 coefficients exactly. We do this by exhibiting two polynomials which agree on all their coefficients except for the kth , in which they differ slightly, but nonetheless have very different largest roots. This example is relevant in the context of interlacing families, because the polynomials in our lower bound have a common interlacing and are characteristic polynomials of 2−lifts of a base graph, which means they could actually arise in the proofs of [MSS13a, MSS13b]. To appreciate this more broadly, one can consider the following taxonomy of increasingly structured polynomials: complex polynomials ⊃ real-rooted polynomials ⊃ mixed characteristic polynomials ⊃ characteristic polynomials of lifts of graphs. Our example complements the standard numerical analysis wisdom (as in Wilkinson’s example) that complex polynomial roots are in general terribly ill-conditioned as functions of their coefficients, and shows that this fact remains true even in the structured setting of interlacing families. Proposition 3.12 is relevant to the quest for efficient algorithms for interlacing families for the following reason. All of the coefficients of the matching polynomial of a bipartite graph can be approximated to 1 + 1/ poly(n) error in polynomial time, for any fixed polynomial, using Markov Chain Monte Carlo techniques [SJ89, JSV04, FL06]. One might imagine that an extension of these techniques could be used to approximate the coefficients of the more general expected characteristic polynomials that appear in applications of interlacing families. In fact for some families of interlacing polynomials (namely, the mixed characteristic polynomials of [MSS13b]) we can design Markov chain Monte Carlo techniques to approximate the top half of the coefficients within 1 + 1/ poly(n) error. Our information theoretic lower bounds rule out this method as a way to approximate the largest root, at least in full generality, since knowing all of the coefficients of a real-rooted polynomial up to a (1 + 1/ poly(n)) error for any poly(n) is no better than just knowing the first log n coefficients exactly, in the worst case, even under the promise that the given polynomials have a common interlacing. In other words, even an MCMC oracle that gives 1 + 1/ poly(n) approximation of all coefficients would not generically allow one to round an interlacing family of depth greater than logarithmic in n, since the error accumulated at each step would be 1/polylog(n). Connections to Poisson Binomial Distributions Finally, there is a probabilistic view of Problem 1.1. Assume that X = B(p1 ) + · · · + B(pn ) is a sum of independent Bernoulli random variables, i.e. a Poisson binomial, with parameters p1 , . . . , pn ∈ [0, 1]. Then Problem 1.1 becomes the following: Given the first k moments of X how well can we approximate maxi pi ? In this view, our paper is related to [DP15], where it was shown that any pair of such Poisson binomial random variables with the same first k moments have total variation distance at most 2−Ω(k) . However, the bound on the total variation distance does not directly imply a bound on the maximum pi . Discussion Besides conducting a precise study of the dependence of the largest root of a realrooted polynomial on its coefficients, the results of this paper shed light on what a truly efficient 1/3 algorithm for interlacing families might look like. On one hand, our running time of 2Õ(m ) shows that the problem is not ETH hard, and is unnatural enough to suggest that a faster algorithm (for instance, quasipolynomial) may exist. On the other hand, our lower bounds show that the polynomials that arise in this method are in general hard to compute in a rather robust sense: namely, obtaining an inverse polynomial error approximation of their largest roots requires knowing 4 many coefficients exactly. This implies that in order to obtain an efficient algorithm for even approximately simulating the interlacing families proof technique, one will have to exploit finer properties of the polynomials at hand, or find a more “global” proof which is able to reason about the error in a more sophisticated amortized manner, or perhaps track a more well-conditioned quantity in place of the largest root, which can be computed using fewer coefficients and which still satisfies an approximate interlacing property. 2 Preliminaries  We let [n] denote the set {1, . . . , n}. We use the notation [n] to denote the family of subsets k T ⊆ [n] with |T | = k. We let Sn denote the set of permutations on [n], i.e. the set of bijections σ : [n] → [n]. We use bold letters to denote vectors. For a vector µ ∈ Rn , we denote its coordinates by µ1 , . . . , µn . We let µmax and µmin denote maxi µi and mini µi respectively. For a symmetric matrix A, we denote the vector of eigenvalues of A, i.e. the roots of det(xI −A), by λ(A). Similarly we denote the largest and smallest eigenvalues by λmax (A) and λmin (A). We slightly abuse notation, and for a polynomial p we write λ(p) to denote the vector of roots of p. We also write λmax (p) to denote the largest root of p. For a graph G = (V, E) we let degmax (G) denote the maximum degree of its vertices and degavg (G) denote the average degree of its vertices, i.e. 2|E|/|V |. What follows are mostly standard facts; the proofs of Fact 2.4, Fact 2.13, Fact 2.13, and Fact 2.22 are included in Appendix A for completness. Facts from Linear Algebra For a matrix A ∈ Rn×n , the characteristic polynomial of A is defined as det(xI − A). Letting σk (A) be the sum of all principal k-by-k minors of A, we have: det(xI − A) = n X xn−k σk (A). k=0 There are several algorithms that for a matrix A ∈ Rn×n calculate det(xI − A) in time polynomial in n. By the above identity, we can use any such algorithm to efficiently obtain σk (A) for any 1 ≤ k ≤ n. The following proposition is proved in [MSS13b] using the Cauchy-Binet formula. Proposition 2.1. Let v1 , . . . , vm ∈ Rn . Then, ! n m X X X σk (−1)k xn−k vi viT = det xI − i=1 k=0 [m] k S⊆( ) X i∈S vi viT ! . Symmetric Polynomials We will make heavy use of the elementary symmetric polynomials, which relate the roots of a polynomial to its coefficients. Definition 2.2. Let ek ∈ R[µ1 , . . . , µn ] denote the k-th elementary symmetric polynomial defined as X Y ek (µ) := µi . i∈T T ∈([n] k ) 5 Fact 2.3. Consider the monic univariate polynomial χ(x) = xn + c1 xn−1 + · · · + cn . Suppose that µ1 , . . . , µn are the roots of χ. Then for every k ∈ [n], ck = (−1)k ek (µ1 , . . . , µn ). This means that knowing the top k coefficients of a polynomial is equivalent to knowing the first k elementary symmetric polynomials of the roots. It also implies the following fact about how shifting and scaling affect the elementary symmetric polynomials. Fact 2.4. Let µ, ν ∈ Rn be such that ei (µ) = ei (ν) for i = 1, . . . , k. If a, b ∈ R then ei (aµ + b) = ei (aν + b) for i = 1, . . . , k. We will use the following relationship between the elementary symmetric polynomials and the power sum polynomials. Pn k Theorem 2.5 (Newton’s Identities). For 1 ≤ k ≤ n, the polynomial pk (µ) := i=1 µi can be written as qk (e1 (µ), . . . , ek (µ)), where qk ∈ R[e1 , . . . , ek ]. Furthermore, qk can be computed at any point in time poly(k). One of the immediate corollaries of the above is the following. Corollary 2.6. Let p(x) ∈ R[x] be a univariate polynomial with deg p ≤ k. Then be written as q(e1 (µ), . . . , ek (µ)), Pn i=1 p(µi ) can where q ∈ R[e1 , . . . , ek ]. Furthermore, q can be computed at any point in time poly(k). Theorem 2.5 shows how p1 , . . . , pk can be computed from e1 , . . . , ek . The reverse is also true. A second set of identities, also known as Newton’s identities, imply the following. Theorem 2.7 (Newton’s Identities). For each k ∈ [n], ek (µ) can be written as a polynomial of p1 (µ), . . . , pk (µ) which can be computed in time poly(k). A corollary of the above and Theorem 2.5 is the following. Corollary 2.8. For two vectors µ, ν ∈ Rn , we have (∀i ∈ [k] : ei (µ) = ei (ν)) ⇐⇒ (∀i ∈ [k] : pi (µ) = pi (ν)) . Chebyshev Polynomials Chebyshev polynomials of the first kind, which we will simply call Chebyshev polynomials, are defined as follows. Definition 2.9. Let the polynomials T0 , T1 , · · · ∈ R[x] be recursively defined as T0 (x) := 1, T1 (x) := x, Tn+1 (x) := 2xTn (x) − Tn−1 (x). We will call Tk the k-th Chebyshev polynomial. 6 Notice that the coefficients of Tk can be computed in poly(k) time, by the above recurrence for example. Chebyshev polynomials have many useful properties, some of which we mention below. For further information, see [Sze39]. Fact 2.10. For k ≥ 0 and θ ∈ R, we have Tk (cos(θ)) = cos(kθ), Tk (cosh(θ)) = cosh(kθ). Fact 2.11. The k-th Chebyshev polynomial Tk has degree k. Fact 2.12. For any x ∈ [−1, 1], we have Tk (x) ∈ [−1, 1]. Fact 2.13. For any integer k ≥ 0, Tk (1 + x) is monotonically increasing for x ≥ 0. Furthermore for x ≥ 0, √ Tk (1 + x) ≥ (1 + 2x)k /2. In our approximate lower bound we will use the following connection between Chebyshev polynomials and graphs, due to Godsil and Gutman [?]. Fact 2.14. If An is the adjacency matrix of a cycle on n vertices, then det(2xI − An ) = 2Tn (x). Graphs with Large Girth In order to prove some of our impossibility results, we use the existence of extremal graphs with no small cycles. Definition 2.15. For an undirected graph G, we denote the length of its shortest cycle by girth(G). If G is a forest, then girth(G) = ∞. The following conjecture by Erdős characterizes extremal graphs with no small cycles. Conjecture 2.16 (Erdős’s girth conjecture [Erd64]). For every integer k ≥ 1 and sufficiently large n, there exist graphs G on n vertices with girth(G) > 2k that have Ω(n1+1/k ) edges, or in other words satisfy degavg (G) = Ω(n1/k ). This conjecture has been proven for k = 1, 2, 3, 5 [Wen91]. We will use the following more general construction of graphs of somewhat lower girth. Theorem 2.17 ([LU95]). If d is a prime power and t ≥ 3 is odd, there is a d-regular bipartite graph G on 2dt vertices with girth(G) ≥ t + 5. Signed Adjacency Matrices Our lower bounds will also utilize facts about signings of graphs. Definition 2.18. For a graph G = ([n], E), we define a signing to be any function s : E → {−1, +1}. We define the signed adjacency matrix As ∈ Rn×n , associated with signing s, as follows ( 0 {u, v} ∈ / E, As (u, v) := s({u, v}) {u, v} ∈ E. 7 Note that by definition, As is symmetric and has zeros on the diagonal. The following fact is immediate. Fact 2.19. For a signed adjacency matrix As of a graph G, the eigenvalues λ(As ), i.e. the roots of χ(x) := det(xI − As ), are real. If G is bipartite, the eigenvalues are symmetric about the origin (counting multiplicities). Signed adjacency matrices were used in [MSS13a] to prove the existence of bipartite Ramanujan graphs of all degrees. We state one of the main results of [MSS13a] below. Theorem 2.20 ([MSS13a]). For every graph G, there exists a signing s such that p λmax (As ) ≤ 2 degmax (G) − 1. By Fact 2.19, we have the following immediate corollary. Corollary 2.21. For every bipartite p graph G, there exists a signing s such that the eigenvalues of As have absolute value at most 2 degmax (G) − 1. We note that trivially signing every edge with +1 is often far from achieving the above bound as witnessed by the following fact. Fact 2.22. Let A be the adjacency matrix of a graph G = ([n], E) (i.e. the signed adjacency matrix where the sign of every edge is +1). Then the maximum eigenvalue of A is at least degavg (G). 3 Approximation of the Largest Root In this section we give an answer to Problem 1.1. As witnessed by Fact 2.3, knowing the top k coefficients of the polynomial χµ is the same as knowing e1 (µ), . . . , ek (µ). Therefore, without loss of generality and more conveniently, we state the results in terms of knowing e1 (µ), . . . , ek (µ). Theorem 3.1. There is an algorithm that receives n and e1 (µ), . . . , ek (µ) for some unknown µ ∈ Rn+ as input and outputs µ∗max , an approximation of µmax , with the guarantee that µ∗max ≤ µmax ≤ αk,n · µ∗max , where the approximation factor αk,n is αk,n ( n1/k = 1 + O( logk n )2 k ≤ log n, k > log n. Furthermore the algorithm runs in time poly(k). Note that there is a change in the behavior of the approximation factor in the two regimes k ≪ log n and k ≫ log n. When k > log n, the expression n1/k is 1 + Θ( logk n ) which can be a much worse bound compared to 1 + O( logk n )2 . When k is near the threshold of log n, n1/k and 1 + Θ( logk n )2 are close to each other and both of the order of 1 + Θ(1). We complement this result by showing information-theoretic lower bounds. 8 Theorem 3.2. For every 1 ≤ k < n, there are two vectors µ, ν ∈ Rn+ such that ei (µ) = ei (ν) for i = 1, . . . , k, and νmax ≥ βk,n , µmax where  nΩ(1/k) k ≤ log n,  2n 2 βk,n = 1 + Ω log k k > log n. k This shows that no algorithm can approximate µmax by a factor better than βk,n using e1 (µ), . . . , ek (µ). Note that for k < n1−ǫ , βk,n = αck,n for some constant c bounded away from zero. For constant k, it is possible to give a constant multiplicative bound assuming Erdős’s girth conjecture. Theorem 3.3. Assume that k is fixed and Erdős’s girth conjecture (Conjecture 2.16) is true for graphs of girth > 2k. Then for large enough n there are two vectors µ, ν ∈ Rn+ such that ei (µ) = ei (ν) for i = 1, . . . , k and νmax ≥ Ω(n1/k ). µmax 3.1 Proof of Theorem 3.1: An Algorithm for Approximating the Largest Root We consider two cases: if k ≤ log n we return (pk (µ)/n)1/k as the estimate for the maximum root. It is not hard to see that in this case, (pk (µ)/n)1/k gives an n1/k approximation of the maximum root (see Claim 3.4 below). For k > log n we can still use (pk (µ)/n)1/k to estimate the maximum root, but this only guarantees a 1 + O( logk n ) approximation. We show that using the machinery of Chebyshev polynomials we can obtain a better bound. The pseudocode for the algorithm can be see in Algorithm 1. Algorithm 1 Algorithm For Approximating the Maximum Root From Top Coefficients Input: n and e1 (µ), e2 (µ), . . . , ek (µ) for some µ ∈ Rn+ . Output: µ∗max , an approximation of µmax . if k ≤ log n then P Compute pk (µ) = ni=1 µki using Newton’s identities (Theorem 2.5). return (pk (µ)/n)1/k . else t ← e1 (µ). loop P Compute p(µ) := ni=1 Tk ( µti ) using Corollary 2.6. if p(µ) > n then return µ∗max ← t. end if t t← 20 log n 2 . 1+( end loop end if k ) We will prove the following claims to show the correctness of Algorithm 1. Let us start with the case k ≤ log n. 9 Claim 3.4. For any k ≥ 1 we have  p (µ) 1/k k ≤ µmax ≤ pk (µ)1/k . n Proof. Observe, pk (µ)/n = n X µk i i=1 n ≤ n X µk max i=1 n = µkmax ≤ Taking k1 -th root of all sides of the above proves the claim. n X µki = pk (µ), i=1 The rest of the section handles the case where k > log n. Our first claim shows that as long as t ≥ µmax , the algorithm keeps decreasing t by a multiplicative factor of (1 − Ω(log(n)/k)2 ). Since at the beginning we have t = e1 (µ) ≥ µmax , we will have µ∗max ≤ µmax . Claim 3.5. For any t ≥ µmax , n X Tk ( i=1 µi ) ≤ n. t Proof. If t ≥ µmax , then µi /t ∈ [0, 1] for every i ∈ [n]. By Fact 2.12, we have n X n Tk ( X µi 1 = n. )≤ t i=1 i=1 To finish the proof of correctness it is enough to show that µmax ≤ µ∗max (1 + O(log n/k)2 ). This is done in the next claim. It shows that as soon as t gets lower than µmax , within one more iteration of the loop, the algorithm terminates. n 2 Claim 3.6. For k > log n and t > 0, if µmax > (1 + ( 20 log ) )t, then k n X i=1 Tk ( µi ) > n. t n 2 ) )t, by Fact 2.13 we have Proof. When µmax > (1 + ( 20 log k    20 log n 2  1  √ 20 log n k µmax ≥ ) ≥ Tk 1 + 1+ 2· t k 2 k  k 1 3 log n ≥ exp > 2n, 2 k √ where we used the inequality 1 + 800x ≥ e3x for x ∈ [0, 1]. Now we have Tk ( n X i=1 Tk ( µi µmax ) = Tk ( )+ t t X i6=argmaxj µj Tk ( µi ) ≥ 2n − (n − 1) > n, t where we used Fact 2.12 and Fact 2.13 to conclude Tk ( µti ) ≥ −1 for every i. 10 The above claim also gives us a bound on the number of iterations in which the algorithm terminates. This is because we start the loop with t = e1 (µ) ≤ nµmax and the loop terminates within one iteration as soon as t < µmax . Therefore the number of iterations is at most   k 2 log n   = O log n · ( ) = O(k2 ). 1+ n 2 log n log 1 + ( 20 log ) k 3.2 Proofs of Theorems 3.2 and 3.3: Matching Lower Bounds The machinery of Chebyshev polynomials was used to prove Theorem 3.1. We show that this machinery can also be used to prove a weaker version of Theorem 3.2. Theorem 3.7. For every 1 ≤ k < n, there are µ, ν ∈ Rn+ such that ei (µ) = ei (ν) for i = 1, . . . , k and νmax ≥ 1 + Ω(1/k2 ) µmax Proof. First let us prove this for k = n − 1. Let µ be the set of roots of Tn (x − 1) + 1 and ν the set of roots of Tn (x − 1) − 1. These two polynomials are the same except for the constant term. It follows that ei (µ) = ei (ν) for i = 1, . . . , n − 1. We use the following lemma to prove that µ, ν ∈ Rn+ . Lemma 3.8. For θ ∈ R, the roots of Tn (x) − cos(θ), counting multiplicities, are cos( θ+2πi n ) for i = 0, . . . , n − 1. Proof. We have Tn   θ + 2πi ) = cos(θ + 2πi) = cos(θ). cos( n For almost all θ these roots are distinct and since Tn has degree n, it follows that they are all of the roots. When some of these roots collide, we can perturb θ and use the fact that roots are continuous functions of the polynomial coefficients to prove the statement. 2πi Using the above lemma for θ = π and θ = 0, we get that µi = 1+cos( π+2πi n ) and νi = 1+cos( n ). n This proves that µ, ν ∈ R+ . Moreover we have νmax 1+1 = = 1 + Ω(1/n2 ). µmax 1 + cos(π/n) This finishes the proof for k = n − 1. Now let us prove the statement for general k. By applying the above proof for n = k + 1, we such that ei (µ̃) = ei (ν̃) for i = 1, . . . , k and get µ̃, ν̃ ∈ Rk+1 + ν̃max ≥ 1 + Ω(1/k 2 ). µ̃max Now construct µ, ν from µ̃, ν̃ by adding zeros to make the total count n. It is not hard to see, by using Corollary 2.8 that ei (µ) = ei (ν) for i = 1, . . . , k. Moreover µmax = µ̃max and νmax = ν̃max . This finishes the proof. 11 Note that the above lower bound is the same as the lower bound in Theorem 3.2 when k = Ω(n). However, to prove Theorem 3.2 and Theorem 3.3 we need more tools. The crucial idea we use to get the stronger Theorem 3.2 and Theorem 3.3 is the following observation about signed adjacency matrices for graphs of large girth. Lemma 3.9. Let G = ([n], E) be a graph and D ∈ Rn×n an arbitrary diagonal matrix. If girth(G) > k, then the top k coefficients of the polynomial χ(x) = det(xI − (D + As )) are independent of the signing s. In other words, ei (λ(D + As1 )) = ei (λ(D + As2 )), for any two signings s1 , s2 and i = 1, . . . , k. We will apply the above lemma, with D = 0, to graphs of large girth constructed based on Conjecture 2.16 or Theorem 2.17, in order to prove Theorem 3.3 and Theorem 3.2 for the regime k ≤ Θ(log n). In order to prove Theorem 3.3 for the regime k ≥ Θ(log n), we marry these constructions with Chebyshev polynomials. We will prove the above lemma at the end of this section, after proving Theorem 3.2 and Theorem 3.3. First let us prove Theorem 3.3. Proof of Theorem 3.3. We apply Lemma 3.9 to the following graph construction, the proof of which we defer to Appendix B. Claim 3.10. Let k be fixed and assume that Conjecture 2.16 is true for graphs of girth > 2k. Then, for all sufficiently large n, there exist bipartite graphs G = ([n], E) with girth(G) > 2k, degmax (G) = O(n1/k ), and degavg (G) = Ω(n1/k ). Let G be the graph from the above claim. Let s1 be the trivial signing that assigns +1 to every edge, and s2 the signing guaranteed by Corollary 2.21. Now let ν = λ(A2s1 ), i.e. the square of the eigenvalues of As1 , and µ = λ(A2s2 ), i.e. the square of the eigenvalues of As2 . By Lemma 3.9 and Corollary 2.8, we have pi (ν) = p2i (λ(As1 )) = p2i (λ(As2 )) = pi (µ), for i = 1, . . . , k. By another application of Corollary 2.8, we have ei (µ) = ei (ν) for i = 1, . . . , k. On the other hand, by Corollary 2.21, we have µmax = λmax (As2 )2 ≤ 4(degmax (G) − 1) = O(n1/k ), and by Fact 2.22, we have νmax = λmax (As1 )2 ≥ degavg (G)2 = Ω(n2/k ). Therefore Ω(n2/k ) νmax = Ω(n1/k ). = µmax O(n1/k ) Now let us prove Theorem 3.2 for k ≤ Θ(log n). 12 Proof of Theorem 3.2 for k ≤ Θ(log n). We apply Lemma 3.9 to the following graph construction, the proof of which we defer to Appendix B. Claim 3.11. Let d be a prime. For all sufficiently large n, there exist bipartite graphs G = ([n], E) with girth(G) = Ω(log n), degmax (G) ≤ d, and degavg (G) ≥ d/2. We will fix d to a specific prime later. Similar to the proof of Theorem 3.3, we let s1 be the trivial signing with all +1s and s2 be the signing guaranteed by Corollary 2.21. Let t = Ω(log n/k) be an even integer such that tk < girth(G). Such a t exists when k < c log n for some constant c. Take ν = λ(Ats1 ) and µ = λ(Ats2 ). Then we have √ µmax = λmax (As2 )t ≤ (2 d − 1)t , and νmax = λmax (As1 )t ≥ (d/2)t . This means that νmax ≥ µmax  d √ 4 d−1 t ≥ eΩ(log n/k) = nΩ(1/k) , as long as 4√dd−1 > e, which happens for sufficiently large d (such as d = 127). It only remains to show that ei (µ) = ei (ν) for i = 1, . . . , k. For every i ∈ [k] we have t · i < girth(G), which by Lemma 3.9 gives us pi (ν) = pt·i (λ(As1 )) = pt·i (λ(As2 )) = pi (ν), and this finishes the proof because of Corollary 2.8. The above method unfortunately does not seem to directly extend to the regime k ≥ Θ(log n), since for large k, getting girth(G) > k requires many vertices of degree at most 2.1 Instead we use the machinery of Chebyshev polynomials to boost our graph constructions. Proof of Theorem 3.2 for k ≥ Θ(log n). Since Theorem 3.7 proves the same desired bound as Theorem 3.2 when k = Ω(n), we may without loss of generality assume that n/k is at least a large enough constant. Let m be the largest integer such that c· n m ≤ , log m k where c is a large constant that we will fix later. It is easy to see that n n  log( ) . m=Θ k k (1) (2) We have already proved Theorem 3.2 for the small k regime. Using this proof (for n = m and k = Θ(log m)), we can find µ̃, ν̃ ∈ Rm + such that ei (µ̃) = ei (ν̃) for i = 1, . . . , Ω(log m) and ν̃max /µ̃max ≥ m1/Θ(log m) ≥ 2. Without loss of generality, by a simple scaling, we may assume that ν̃max = 1 and µ̃max ≤ 1/2. Let χµ̃ (x), χν̃ (x) ∈ R[x] be the unique monic polynomials whose roots are µ̃, ν̃ respectively. By construction, the top Ω(log m) coefficients of these polynomials are the same. We boost the number of equal coefficients by composing them with Chebyshev polynomials. Let p(x) := χµ̃ (Tt (x)) and 1 Unless all degrees are 2 in which case we can actually reprove Theorem 3.7; we omit the details here. 13 q(x) := χν̃ (Tt (x)) where t = ⌊n/m⌋. Note that deg p = deg q = tm ≤ n. We let µ, ν be the roots of p(x), q(x) together with some additional zeros to make their counts n. First, we show that the top k coefficients of p, q are the same. Then we show that they are real rooted, i.e., µ, ν are real vectors. Finally, we lower bound νmax /µmax . Note that p(x), q(x) have degree tm. They are not monic, but their leading terms are the same. Besides the leading terms, we claim that they have the same top Ω(t log m) coefficients. This follows from the fact that Tt (x) is a degree t polynomial. When expanding either χν̃ (Tt (x)) or χµ̃ (Tt (x)), terms of degree ≤ m − Ω(log m) in χµ̃ , χν̃ produce monomials of degree at most tm − Ω(t log m), which means that the top Ω(t log m) coefficients are the same. This shows that the first Ω(t log m) elementary symmetric polynomials of µ, ν are the same. It follows that the first k elementary symmetric polynomials to be the same, which follows from Ω(t log m) = Ω( n log m ) ≥ Ω(ck) ≥ k, m where for the first inequality we used (1) and for the second inequality we assumed c is large enough that it cancels the hidden constants in Ω. It is not obvious if µ, ν are even real. This is where we crucially use the properties of the Chebyshev polynomial Tt (x). Note that the roots of χµ̃ (x) and χν̃ (x), i.e. µ̃i ’s and ν̃i ’s are all in [0, 1] ⊆ [−1, 1]. Therefore each one of them can be written as cos(θ) for some θ ∈ R. By Lemma 3.8 the equation Tt (x) = cos(θ), has t real roots (counting multiplicities), and they are simply x = cos( θ+2πi t ) for i = 0, . . . , t − 1. So for each root of χµ̃ (x) we have t roots of χµ̃ (Tt (x)), all in [−1, 1]. This means that all of the roots of p(x) are real and in [−1, 1]. By a similar argument, all of the roots of q(x) are real and in [−1, 1]. The largest root of q(x) is 1, since q(1) = χν̃ (Tt (1)) = χν̃ (1) = χν̃ (νmax ) = 0. On the other hand, the largest root of p(x) is at most cos(π/3t), because for any x ∈ (cos(π/3t), 1] there is θ ∈ [0, π/3t) such that x = cos(θ) and this means p(x) = χµ̃ (Tt (cos(θ))) = χµ̃ (cos(tθ)) 6= 0, because cos(tθ) > cos(π/3) = 1/2 ≥ µ̃max . By the above arguments, µ, ν satisfy almost all of the desired properties, except that they could be negative. However we know that µ, ν ∈ [−1, 1]n . So using Fact 2.4 we can easily make them nonnegative. We simply replace µ, ν by µ + 1, ν + 1. Then µ, ν ∈ [0, 2]n and ei (µ) = ei (ν) for i = 1, . . . , k. Finally, we have νmax 1+1 = 1+Ω ≥ µmax 1 + cos(π/3t)  1 t2  =1+Ω  m 2 n =1+Ω log 2n k k !2 , where we used (2) for the last equality. Having finished the proofs of Theorem 3.2, Theorem 3.3 we are ready to prove Lemma 3.9. 14 Proof of Lemma 3.9. By Corollary 2.8, it is enough to prove that pk (λ(D + As1 )) = pk (λ(D + As2 )), for k < girth(G). This is the same as proving     Tr (D + As1 )k = Tr (D + As2 )k . (3) For a matrix M ∈ Rn×n we have the following identity X Mv1 ,v2 Mv2 ,v3 . . . Mvk−1 ,vk Mvk ,v1 . Tr(M k ) = (v1 ,...,vk )∈[n]k For ease of notation let us identify vk+1 with v1 . We apply the above formula to both sides of (3). The sequence (v1 , . . . , vk ) can be interpreted as a sequence of vertices in the graph G. If for any i, vi 6= vi+1 and {vi , vi+1 } ∈ / E, then the term inside the sum vanishes. Therefore we can restrict the sum to those terms (v1 , . . . , vk ) where for each i ∈ [k], either vi = vi+1 or vi and vi+1 are connected in G. To borrow and abuse some notation from Markov chains, let us call such a sequence a lazy closed walk of length k. In order to prove (3) it is enough to prove that for any such lazy closed walk we get the same term for both s1 and s2 . Let (v1 , . . . , vk ) be one such lazy closed walk. Consider a particle that at time i resides at vi . In each step, the particle either does not move or moves to a neighboring vertex, and at time k + 1 it returns to its starting position. For each step that the particle does not move we get one of the entries of D, corresponding to the current vertex, as a factor. This is clearly independent of the signing. When the particle moves however, we get the sign of the edge over which it moved as a factor. We will show that the particle must cross each edge an even number of times. Therefore the signs for each edge cancel each other and we get the same result for s1 , s2 . Consider the induced subgraph on v1 , . . . , vk . Because k < girth(G), this subgraph has no cycles; therefore it must be a tree. A (lazy) closed walk crosses any cut in a graph an even number of times. Each edge in this tree constitutes a cut. Therefore the lazy closed walk (v1 , . . . , vk ) must cross each edge in the tree an even number of times. 3.3 Lower Bound Given Approximate Coefficients The lower bounds proved in the previous section show that knowing a small number of the coefficients of a polynomial exactly is insufficient to obtain a good estimate of its largest root. In this section we generalize the construction of Theorem 3.2 to provide a satisfying lower bound to Problem 1.2. Proposition 3.12. For every integer n > 1 and 1 < k < n there are degree n polynomials r(x), s(x) such that 1. All of the coefficients of r and s except for the 2kth are exactly equal, and the 2kth coefficients are within a multiplicative factor of 1 + 242k . 2. The largest root of r is at least 1 + Ω(1/k 2 ) of the largest root of s. 3. r and s have a common interlacing. 15 4. r and s are characteristic polynomials of graph Laplacians. Further, these Laplacians correspond to 2−lifts of a common base graph. Proof. Let r(x) := 2Tk2 (3/2 − x) Since and s(x) := T2k (3/2 − x). T2k = 2Tk2 − 1, these polynomials differ only in their constant terms. Moreover, we have r(0) = 2Tk2 (3/2) ≥ (2k−1 )2 and s(0) ≥ 22k−1 /2 by Fact 2.13. Thus, they agree on the first 2k − 1 coefficients, and differ by a multiplicative factor of at most 22k−2 + 1 = 1 + 4/22k 22k−2 in the 2kth coefficient, establishing (1). To see (2), observe that r(x) has largest root 3/2 + cos(2π/k) whereas s(x) has largest root 3/2 + cos(2π/2k). Since the difference of these numbers is 4π 2 1 1 ( − + o(1/k4 )), 2 k2 4k2 we conclude that their ratio is at least 1 + Ω(1/k 2 ). To see (3), observe that the roots of r(x) are cos(2π/k) − cos(2π/2k) = 3/2 − cos(2πj/k) j = 0, . . . , k − 1 with multiplicity 2 and the roots of s(x) are 3/2 − cos(2πj/2k) j = 0, . . . , 2k − 1 with multiplicity 1, whence r and s have a common interlacing according to Definition 4.1. For (4) we first apply Fact 2.14 to interpret both r and s as characteristic polynomials of cycles. Let Ck denote a cycle of length k and let Ck ∪ Ck denote a union of two such cycles. Then we have: det(2xI − ACk ∪Ck ) = det(2xI − ACk )2 = 4Tk (x)2 = 2r(3/2 − x), and det(2xI − AC2k ) = 2T2k (x) = 2s(3/2 − x), whence r(x) = (−2)k 1 det(3I − ACk ∪Ck − 2xI) = det(xI − ((3/2)I − (1/2)ACk ∪Ck ) 2 2 and (−2)k 1 det(3I − AC2k − 2xI) = det(xI − ((3/2)I − (1/2)C2k ), 2 2 which are characteristic polynomials of graph Laplacians of weighted graphs with self loops. Note that both graphs are 2−covers of Ck . Since multiplying by constants does not change any of the properties we are interested in, we can ignore them. Considering r̃(x) = xn−k r(x) and s̃(x) = xn−k s(x) yields examples of the desired dimension n; note that multiplying by xn−k simply corresponds to adding isolated vertices to the corresponding graphs. s(x) = 16 4 Applications to Interlacing Families √ 3 In this section we use Theorem 3.1 to give an 2Õ( m) time algorithm for rounding an interlacing family of depth m. Let us start by defining an interlacing family. Qn−1 Definition 4.1 (Interlacing). We say that a real rooted polynomial g(x) = α 0 i=1 (x − αi ) interQn laces a real rooted polynomial f (x) = β0 i=1 (x − βi ) if β1 ≤ α1 ≤ β2 ≤ α2 ≤ · · · ≤ αn−1 ≤ βn . We say that polynomials f1 , . . . , fk have a common interlacing if there is a polynomial g such that g interlaces all fi . The following key lemma is proved in [MSS13a]. Lemma 4.2. Let f1 , . . . , fk be polynomials of the same degree that are real rooted and have positive leading coefficients. If f1 , . . . , fk have a common interlacing, then there is an i such that λmax (fi ) ≤ λmax (f1 + · · · + fk ). Definition 4.3 (Interlacing Family). Let S1 , . . . , Sm be finite sets. Let F ⊆ S1 × S2 × · · · × Sm be nonempty. For any s1 , s2 , . . . , sm ∈ F, let fs1 ,...,sm (x) be a real rooted polynomial of degree n with a positive leading coefficient. For s1 , . . . , sk ∈ S1 × · · · × Sk with k < m, let Fs1 ,...,sk := {t1 , . . . , tm ∈ F : si = ti , ∀1 ≤ i ≤ k}. Note that F = F∅ . Define fs1 ,...,sk = X ft1 ,...,tm , t1 ,...,tm ∈Fs1 ,...,sk and f∅ = X ft1 ,...,tm . t1 ,...,tm ∈F We say polynomials {fs1 ,...,sm }s1 ,...,sm ∈F form an interlacing family if for all 0 ≤ k < m and all s1 , . . . , sk ∈ S1 × · · · × Sk the following holds: The polynomials fs1 ,...,sk ,ti which are not identically zero have a common interlacing. In the above definition we say m is the depth of the interlacing families. It follows by repeated applications of Lemma 4.2 that for any interlacing family {fs1 ,...,sm }s1 ,...,sm ∈F , there is a polynomial fs1 ,...,sm such that the largest root of fs1 ,...,sm is at most the largest root of f∅ [MSS13b, Thm 3.4]. For an α > 1, an α-approximation rounding algorithm for an interlacing family {fs1 ,...,sm }s1 ,...,sm ∈F is an algorithm that returns a polynomial fs1,...,sm such that λmax (fs1 ,...,sm ) ≤ αλmax (f∅ ). Next, we design such a rounding algorithm, given an oracle that computes the first k coefficients of the polynomials in an interlacing family. Theorem 4.4. Let S1 , . . . , Sm be finite sets and let {fs1 ,...,sm }s1 ,...,sm ∈F be an interlacing family of degree n polynomials. Suppose that we are given an oracle that for any 1 ≤ k ≤ n and s1 , . . . , sℓ ∈ S1 , . . . , Sℓ with ℓ < m returns the top k coefficients of fs1 ,...,sm in time T (k). Then, there is an algorithm that for any ǫ > 0 returns a polynomial fs1 ,...,sm such that the largest root of fs1 ,...,sm is √ 1/3 at most 1 + ǫ times the largest root of f∅ , in time T (O(log(n)m1/3 / ǫ)) max{|Si |}O(m ) poly(n). 17 Proof. Let M = m1/3 and k ≍ √1ǫ log(n)M . Then, by Theorem 3.1, for any polynomial fs1,...,sℓ we can find a 1 + 2Mǫ 2 approximation of the largest root of fs1,...,sm in time T (k) poly(n). We round the interlacing family in M 2 many steps and in each step we round M of the coordinates. We make sure that each step only incurs a (multiplicative) approximation of 1 + 2Mǫ 2 so that the cumulative approximation error is no more than ǫ M2 ≤1+ǫ ) (1 + 2M 2 as desired. Let us describe the algorithm inductively. Suppose we have selected s1 , . . . , sℓ for some 0 ≤ ℓ < m. We brute force over all polynomials fs1 ,...,sℓ ,tℓ+1 ,...,tℓ+M which are not identically zero for all tℓ+1 , . . . , tℓ+M ∈ Sℓ+1 , . . . , Sℓ+M . Note that there are at most (maxi |Si |)M many such polynomials. For any polynomial fs1 ,...,sℓ ,tℓ+1 ,...,tℓ+M (which is not identically zero) we compute µ∗s1 ,...,sℓ ,tℓ+1 ,...,tℓ+M , a 1 + 2Mǫ 2 approximation of its largest root using its top k coefficients. We let sℓ+1 , . . . , sℓ+M = argmin µ∗s1 ,...,sℓ ,tℓ+1 ,...,tℓ+M . tℓ+1 ,...,tℓ+M It follows that the algorithm runs in time T (k) poly(n)(maxi |Si |)O(M ) . Because we have an interlacing family, there is a polynomial fs1 ,...,sℓ ,tℓ+1 ,...,tℓ+M whose largest root is at most the largest root of fs1 ,...,sℓ , in each step of the algorithm. Therefore, λmax (fs1 ,...,sℓ+M ) ≤ (1 + ǫ )λmax (fs1 ,...,sℓ ). 2M 2 Therefore, by induction, as desired. λmax (fs1 ,...,sm ) ≤ (1 + ǫ)λmax (f∅ ) We remark that without the use of Chebyshev polynomials and Theorem 3.1, one can obtain √ the somewhat worse running time of 2Õ( m) by applying the same trick of rounding the vectors in groups rather than one at a time. To use the above theorem, we need to construct the aforementioned oracle for each application of the interlacing families. Next, we construct such an oracle for several examples. 4.1 Oracle for Kadison-Singer We start with interlacing families corresponding to the Weaver’s problem which is an equivalent formulation of the Kadison-Singer problem. Marcus, Spielman, and Srivastava proved the following theorem. Theorem 4.5 ([MSS13b]). Given vectors v1 , . . . , vm in isotropic position, m X vi viT = I, i=1 such that maxi kvi k2 ≤ δ, there is a partitioning S1 , S2 of [m] such that for j ∈ {1, 2}, X i∈Sj √ vi viT ≤ 1/2 + O( δ). 18 1/3 We give an algorithm that finds the above partitioning and runs in time 2m /δ . It follows from the proof of [MSS13b] that it is enough to design a (1 + δ)-approximation rounding algorithm for the following interlacing family. Let r1 , . . . , rm ∈ Rn be independent random vectors where for each i, Si is the support of ri . For any r1 , . . . , rm ∈ S1 × . . . Sm let fr1 ,...,rm (x) = det(xI − m X ri rTi ). i=1 Marcus et al. [MSS13b] showed that {fr1 ,...,rm }r1 ,...,rm ∈S1 ×···×Sm is an interlacing family. Next we design an algorithm that returns the first k coefficients of any polynomial in this family in time (m · maxi |Si |)k . Theorem 4.6. Given independent random vectors r1 , . . . , rm ∈ Rd with support S1 , . . . , Sm . There is an algorithm that for any r1 , . . . , rℓ ∈ S1 × · · · × Sℓ with 1 ≤ ℓ ≤ m and 1 ≤ k ≤ n returns the top k coefficients of fr1,...,rℓ in time (m · maxi |Si |)k poly(n). Proof. Fix r1 , . . . , rℓ ∈ S1 × · · · × Sℓ for some 1 ≤ ℓ ≤ m. It is sufficient to show that for any 0 ≤ k ≤ n, we can compute the coefficient of xn−k of fr1 ,...,rℓ in time (m · maxi |Si |)k poly(n). First, observe that " !# m X T fr1 ,...,rℓ = Erℓ+1,...,rm det xI − ri ri . i=1 So, by Proposition 2.1, the coefficient of (−1)k xn−k in the above is equal to !# " X X . ri rTi Erℓ+1,...,rm σk i∈T T ⊆([m] k )  k Note that there are at most in the above summation. For any T ⊆ [m] k , we can exactly  P m terms compute Erℓ+1,...,rm σk ( i∈T ri rTi ) in time (maxi |Si |)k poly(n). All we need to do is brute force over all vectors in the domain of {Si }i>ℓ,i∈T and average out σk (.) of the corresponding sums of rank 1 matrices. It follows by Theorem 4.4 and Theorem 4.6 that for any given set of vectors v1 , . . . , vm ∈ Rn in isotropic position of squared norm at most δ we can find a two partitioning S1 , S2 such that √ P T ≤ 1/2 + O( δ) in time nO(m1/3 δ−1/4 ) . i∈Sj vi vi 4.2 Oracle for ATSP Next, we construct an oracle for interlacing families related to the asymmetric traveling salesman problem. We say a multivariate polynomial p ∈ R[z1 , . . . , zm ] is real stable if it has no roots in the upper-half complex plane, i.e., p(z) 6= 0 whenever Im(zi ) > 0 for all i. The generating polynomial of µ is defined as X Y gµ (z1 , . . . , zm ) = µ(S) zi . S⊆[m] i∈S We say µ is a strongly Rayleigh probability distribution if gµ (z) is real stable. We say µ is homogeneous if all sets in the support of µ have the same size. The following theorem is proved by the first and the second authors [AO15b]. 19 Theorem 4.7 ([AO15b]). Let µ be a homogeneous strongly Rayleigh probability distribution on subsets of [m] such that for each i, P [i] < ǫ1 . Let v1 , . . . , vm ∈ Rn be in isotropic position such that for each i, kvi k2 ≤ ǫ2 . Then, there is a set S in the support of µ such that X i∈S vi viT ≤ O(ǫ1 + ǫ2 ). We give an algorithm that finds such a set S as promised in the above theorem assuming that we have an oracle that for any z ∈ Rm returns gµ (z). It follows from the proof of [AO15b] that it is enough to design a 1 + O(ǫ1 + ǫ2 )-approximation rounding algorithm for the following interlacing family. For any 1 ≤ i ≤ m, let Si = {0, vi }. For any S in the support of µ, let ri = vi if i ∈ S and ri = 0 otherwise and we add r1 , . . . , rm to F. Then, define ! m X T ri ri . fr1 ,...,rm = µ(S) · det xI − i=1 It follows from [AO15b] that {fr1 ,...,rm }r1 ,...,rm ∈F is an interlacing family. Next, we design an algorithm that returns the top k coefficients of any polynomial in this family in time mk poly(n). Theorem 4.8. Given a strongly Rayleigh distribution µ on subsets of [m] and a set of vectors v1 , . . . , vm ∈ Rn , suppose that we are given an oracle that for any z ∈ Rm returns gµ (z). There is an algorithm that for any r1 , . . . , rℓ ∈ S1 × · · · × Sℓ with 1 ≤ ℓ ≤ m and 1 ≤ k ≤ n returns the top k coefficients of fr1 ,...,rℓ in time mk poly(n). Proof. Fix r1 , . . . , rℓ ∈ S1 × · · · × Sℓ for some 1 ≤ ℓ ≤ m. First, note that if there is no such element in F, then gµ (1, . . . , 1, zℓ+1 , . . . , zm ) = 0 and there is nothing to prove. So assume for some rℓ+1 , . . . , rm , r1 , . . . , rm ∈ F. It is sufficient to show that for any 0 ≤ k ≤ n, we can compute the coefficient of xn−k of fr1 ,...,rℓ in time mk poly(n). Firstly, observe that since we are only summing up the characteristic polynomials that are consistent with r1 , . . . , rℓ , we can work with the conditional distribution µ̃ = {µ | i if 1 ≤ i ≤ ℓ and ri = vi , i if 1 ≤ i ≤ ℓ, ri = 0}. Note that since we can efficiently compute gµ (z1 , . . . , zm ), we can also compute gµ̃ (zℓ+1 , . . . , zm ). For any i that is conditioned to be in, we need to differentiate with respect to zi and for any i that is conditioned to be out we let zi = 0. Also, note that instead of differentiating we can let zi = M for a very large number M , and then divide the resulting polynomial by M . We note that when µ is a determinantal distribution, which is the case in applications to the asymmetric traveling salesman problem, this differentiation can be computed exactly and efficiently; in other cases, M can be taken to be exponentially large, as we can tolerate an exponentially small error. Now, we can write !# " X T . vi vi fr1 ,...,rℓ = ET ∼µ̃ det xI − i∈T 20 So, by Proposition 2.1, the coefficient of xn−k in the above is equal to ! X X T k vi vi . Pµ̃ [T ] · σk (−1) i∈T T ∈([m] k )  To compute the aboveP quantity it is enough to brute force over all sets T ∈ [m] k . For any such T we can compute σk ( i∈T vi viT ) in time poly(n). In addition, we can efficiently compute Pµ̃ [T ] using our oracle. It is enough to differentiate with respect to any i ∈ T , Y i∈T :i>ℓ ∂ gµ̃ (zℓ+1 , . . . , zm )|zℓ+1 =···=zm =1 . ∂zi Therefore, the algorithm runs in time mk poly(n). It follows from Theorem 4.4 and Theorem 4.8 that for any homogeneous strongly Rayleigh distribution µ with marginal probabilities ǫ1 with an oracle that computes gµ (z) for any z ∈ Rn , and for any vectors v1 , . . . , vm in isotropic position with squared norm at most ǫ2 , we can find a P T ≤ O(ǫ + ǫ ) in time nO(m1/3 (ǫ1 +ǫ2 )1/2 ) . set S in the support of µ such that v 1 2 i∈S i vi This is enough to get a polyloglog(m) approximation algorithm for asymmetric traveling sales1/3 man problem on a graph with m vertices that runs in time 2Õ(m ) [AO15a]. References [AO15a] Nima Anari and Shayan Oveis Gharan. Effective-Resistance-Reducing Flows, Spectrally Thin Trees, and Asymmetric TSP. pages 20–39, 2015. FOCS. 3, 21 [AO15b] Nima Anari and Shayan Oveis Gharan. The kadison-singer problem for strongly rayleigh measures and applications to asymmetric tsp. 2015. 3, 19, 20 [Bec91] József Beck. An algorithmic approach to the Lovász local lemma. I. Random Structures Algorithms, 2(4):343–365, 1991. 3 [BL06] Yonatan Bilu and Nathan Linial. Lifts, discrepancy and nearly optimal spectral gap. Combinatorica, 26(5):495–519, 2006. 3 [Coh16] Michael B Cohen. Ramanujan graphs in polynomial time. arXiv:1604.03544, 2016. 3 [CS07] Maria Chudnovsky and Paul Seymour. The roots of the independence polynomial of a clawfree graph. J. Combin. Theory Ser. B, 97(3):350–357, 2007. 3 [DP15] Constantinos Daskalakis and Christos Papadimitriou. Sparse covers for sums of indicators. Probab. Theory Related Fields, 162(3-4):679–705, 2015. 4 [Erd64] P. Erdős. Extremal problems in graph theory. In Theory of Graphs and its Applications (Proc. Sympos. Smolenice, 1963), pages 29–36. Publ. House Czechoslovak Acad. Sci., Prague, 1964. 7 21 arXiv preprint [FL06] Shmuel Friedland and Daniel Levy. A polynomial-time approximation algorithm for the number of k-matchings in bipartite graphs. arXiv preprint cs.CC/0607135, 28, 2006. 4 [HL72] Ole J. Heilmann and Elliott H. Lieb. Theory of monomer-dimer systems. Comm. Math. Phys., 25:190–232, 1972. 3 [HPS15] Chris Hall, Doron Puder, and William F Sawin. Ramanujan coverings of graphs. arXiv preprint arXiv:1506.02335, 2015. 3 [HSV16] Nicholas JA Harvey, Piyush Srivastava, and Jan Vondrák. Computing the independence polynomial in shearer’s region for the lll. arXiv preprint arXiv:1608.02282, 2016. 3 [JSV04] Mark Jerrum, Alistair Sinclair, and Eric Vigoda. A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries. J. ACM, 51(4):671– 697, July 2004. 4 [LU95] Felix Lazebnik and Vasiliy A. Ustimenko. Explicit construction of graphs with an arbitrary large girth and of large size. Discrete Appl. Math., 60(1-3):275–284, 1995. ARIDAM VI and VII (New Brunswick, NJ, 1991/1992). 7 [MSS13a] Adam Marcus, Daniel A. Spielman, and Nikhil Srivastava. Interlacing Families I: Bipartite Ramanujan Graphs of All Degrees. In FOCS, pages 529–537, 2013. 3, 4, 8, 17 [MSS13b] Adam Marcus, Daniel A Spielman, and Nikhil Srivastava. Interlacing Families II: Mixed Characteristic Polynomials and the Kadison-Singer Problem. 2013. 3, 4, 5, 17, 18, 19 [MSS15] Adam W. Marcus, Nikhil Srivastava, and Daniel A. Spielman. Interlacing families iv: Bipartite ramanujan graphs of all sizes. to appear in FOCS, 2015. 3 [MT10] Robin A. Moser and Gábor Tardos. A constructive proof of the general Lovász local lemma. J. ACM, 57(2):Art. 11, 15, 2010. 3 [SJ89] Alistair Sinclair and Mark Jerrum. Approximate counting, uniform generation and rapidly mixing Markov chains. Inf. Comput., 82(1):93–133, July 1989. 4 [SS13] Alistair Sinclair and Piyush Srivastava. Lee-Yang theorems and the complexity of computing averages. In STOC’13—Proceedings of the 2013 ACM Symposium on Theory of Computing, pages 625–634. ACM, New York, 2013. 3 [Sze39] Gabor Szeg. Orthogonal polynomials, volume 23. American Mathematical Soc., 1939. 7 [Val79] L. G. Valiant. The complexity of computing the permanent. Theoret. Comput. Sci., 8(2):189–201, 1979. 3 [Wen91] R. Wenger. Extremal graphs with no C 4 ’s, C 6 ’s, or C 10 ’s. J. Combin. Theory Ser. B, 52(1):113–116, 1991. 7 [Wil84] James H. Wilkinson. The perfidious polynomial. In Studies in numerical analysis, volume 24 of MAA Stud. Math., pages 1–28. Math. Assoc. America, Washington, DC, 1984. 2 22 A Appendix A: Proofs of Preliminary Facts Proof of Fact 2.4. If a = 0, the conclusion is trivial. Otherwise let ℓ(x) = (x − b)/a. Then aµ + b is the vector of the roots of χµ (ℓ(x)) and similarly aν + b is the vector of the roots of χν (ℓ(x)). It is easy to see that if χµ and χν have the same top k coefficients, then after expansion χµ (ℓ(x)) and χν (ℓ(x)) have the same top k coefficients as well, since ℓ(x) is linear. Proof of Corollary 2.6. For p(x) = xk , the statement of the corollary becomes the same as Theorem 2.5. For any other polynomial, we can write p(x) = a0 + a1 x + · · · + ak xk . Then we have n X p(µi ) = k X aj j=1 i=1 n X i=1 µji ! = k X aj pj (µ). j=1 Now because of Theorem 2.5, it follows that n X p(µi ) = i=1 k X aj qj (e1 (µ), . . . , ek (µ)). j=1 The above is a polynomial of e1 (µ), . . . , ek (µ), and it can be computed in time poly(k), since each qj can be computed in time poly(k). Proof of Fact 2.13. For x ≥ 0, we have Tk (1+x) = cosh(k cosh−1 (1+x)); here cosh−1 is the inverse of cosh when looked at as a function from [0, ∞) to [1, ∞). Both cosh and cosh−1 are monotonically increasing over the appropriate ranges. Therefore Tk (1 + x) is monotonically increasing for x ≥ 0. For x ≥ 0, we have exp(k cosh−1 (1 + x)) √ k2 −1 k (1 + 2x) exp(cosh (1 + x)) ≥ . = 2 2 Tk (1 + x) = cosh(k cosh−1 (1 + x)) ≥ In the first inequality we used the fact that cosh(x) ≥ ex /2, and in the last inequality we used the √ fact that exp(cosh−1 (1 + x)) ≥ 1 + 2x. Proof of Fact 2.22. The maximum eigenvalue of A is characterized by the so called Rayleigh quotient x⊺ Ax , λmax (A) = max x∈Rn −{0} x⊺ x For x = 1, the all 1s vector, we have λmax (A) ≥ 1⊺ A1 2|E| = = degavg (G). ⊺ 1 1 n 23 B Appendix B: Constructions of Graphs with Large Girth In this section we prove Claim 3.10 and Claim 3.11. Proof of Claim 3.10. Assume that k is fixed and Conjecture 2.16 is true for graphs of girth > 2k. The graphs promised by Conjecture 2.16 already have average degree Ω(n1/k ). We just need to make them bipartite and make sure that their maximum degree is at most O(n1/k ). Making the graph bipartite is easy. Given a graph G, the following procedure makes it bipartite: Replace each vertex v by v1 , v2 . Replace each edge {u, v} with two edges {v1 , u2 } and {u1 , v2 }. This procedure doubles the number of edges and the number of vertices, and it is easy to see that it does not decrease the girth. We can trim the maximum degree by the following procedure: If there is a vertex v where deg v > n1/k , we introduce a new vertex v ′ and take an arbitrary subset of n1/k edges incident to v and change their endpoint from v to v ′ . By repeating this procedure the graph will eventually have maximum degree bounded by n1/k . This procedure increases the number of vertices, but the number of new vertices is easily bounded by 2|E|/n1/k because each new vertex has degree n1/k until the end and the number of edges |E| does not change. Both of the above procedures change the number of vertices. To get graphs of arbitrary size n, we can use the following trick: We start with a graph G0 promised by Conjecture 2.16 on n/c vertices, where c is a large constant. We make sure that it has no more than (n/c)1+1/k edges by removing edges if necessary (this can only increase girth). Now we make a bipartite graph G1 from G0 by the aforementioned procedure. From G1 we make G2 using the second procedure which makes sure degmax (G2 ) = O(n1/k ). The number of new vertices added by this step is O(n/c). So at the end the total number of vertices in G2 is O(n/c) and if we make c large enough we can make sure it is less than n. We can add isolated vertices to G2 until the total number of vertices becomes n and we get G. This procedure changes degavg by at most a constant factor and does not change degmax , so both are Θ(n1/k ) at the end. Proof of Claim 3.11. We build our graphs using Theorem 2.17. Let t ≥ 3 be the largest odd number such that 2dt ≤ n. If n is large enough, such a t exists, and we have t = Ω(log n). By Theorem 2.17, there exists a d-regular bipartite graph H with 2dt vertices and girth(H) ≥ t + 5 = Ω(log n). To construct G, put as many copies of H as possible side by side making sure the number of vertices does not grow more than n. At the end add some isolated vertices to make the total number of vertices n and get G. It is easy to see that number of isolated vertices added at the end is at most n/2. These vertices have degree 0 and the rest have degree d. Therefore degavg (G) ≥ d/2 and degmax (G) = d. 24
8cs.DS
Reasoning in Systems with Elements that Randomly Switch Characteristics Subhash Kak Abstract. We examine the issue of stability of probability in reasoning about complex systems with uncertainty in structure. Normally, propositions are viewed as probability functions on an abstract random graph where it is implicitly assumed that the nodes of the graph have stable properties. But what if some of the nodes change their characteristics? This is a situation that cannot be covered by abstractions of either static or dynamic sets when these changes take place at regular intervals. We propose the use of sets with elements that change, and modular forms are proposed to account for one type of such change. An expression for the dependence of the mean on the probability of the switching elements has been determined. The system is also analyzed from the perspective of decision between different hypotheses. Such sets are likely to be of use in complex system queries and in analysis of surveys. Introduction For reasoning in complex systems, one often uses static data structures designed for situations that do not change after they are constructed. Static sets allow only query operations on their elements — such as checking whether a given value is in the set, or enumerating the values in some arbitrary order. In dynamic sets, on the other hand, one can insert and delete elements. But what if the elements stay the same in number, yet their properties change randomly? Consider a very basic model where the set of N objects is viewed as consisting of nA objects of Type A and the remaining of Type B, where the properties of the two types are distinct. The observation process consists of choosing a random element and examining it and then replacing it in the box. By repeated interaction with the system, the probability of A is easily computed: P( A) = nA N (1) Let the outcomes A and B be mapped to the random variable X with values 1 and -1, respectively. We can pick the threshold of 0 to determine which probability is greater. If ∑ 𝑋𝑋𝑖𝑖 > 0, then P(A) > P(B). Now assume that the objects are actually of 3 types: A, B, and C with numbers that are nA, nB, and nC, nA+nB+nC=N, where C nodes are special in the sense that during query (interaction) they project the properties of A and B in some random fashion? One could also view the situation as 1 consisting of nC objects of Type C that are non-classical or one could view Class C as a random set whose elements change between Type A and B. An example of this will be polling surveys. Assume there are three political parties but only two candidates who belong to Parties A and B. The members of the third party must pick candidate A or B, where their choice varies from day to day based on news and public opinion (for simplicity, we assume here that members of the other two parties vote for their party candidates, for in reality there will be some cross-voting from the other groups as well). This situation represents unstable sets with a subset of floating elements and this fact should be considered in determining system behavior. Figure1. Elements of C switch characteristics randomly between A and B The probability P(A) will not stabilize as the system is queried (say on different days) and its value will fall in a range: 𝑛𝑛𝐴𝐴 𝑁𝑁 ≤ 𝑃𝑃(𝐴𝐴) ≤ 𝑛𝑛𝐴𝐴 +𝑛𝑛𝐶𝐶 (2) 𝑁𝑁 The C nodes may be seen as creating noise in the measurement and if indeed real systems behave like this this property needs to be taken into consideration and its impact on reasoning evaluated. For purpose of illustration, assume nA=5, nB=2, and and nC=3. If the transitions occur at the end of the day, then sampling of different systems will change the estimate of elements of Class A as in Figure 2 below. 2 10 8 6 4 2 0 0 10 20 30 40 Series1 Figure 2. Changing count of the elements of A As example of importance of such sets, consider that in medicine, a patient might respond to different active ingredients in different ways due to a certain element of interchangeability in the structure. The changeability will complicate analysis of Simpson’s and related paradoxes [1][2]. The Simpson’s paradox arises from the fact that if a1 / b1 > c1 / d1 and a2 / b2 > c2 / d 2 there will be situations so that ( c1 + c2 ) /(d1 + d 2 ) > ( a1 + a2 ) /(b1 + b2 ) , but if there is range associated with the numerator values, we get a more complicated picture related to the ranges where probability inversion occurs as seen in Table 1. Table 1. Probability inversion Week 1 Week 2 Lisa 0/1 3 or 4/5 Bart 1/4 2 or 3/3 Total 3 or 4/6 3 or 4/7 Lisa and Bart are assigned the task of editing articles. In Week 2, their work gets further edited differently by supervisors. The performance of Bart is superior to Lisa’s both weeks (excepting when Lisa has done 4/5 and Bart has done 2/3) but when the work is aggregated, Lisa is better. Our consideration of interswitching may make it possible to do an indirect accounting of interaction networks that exist in the body and the complicating influence of information and regulatory networks to examine the placebo effect [3]. This effect is counterintuitive in that an inert substance turns out to be an effective treatment for some patients, and it arises out of the information flows and expectations associated with the treatment. In some cases the interaction between elements may rightly be seen through the lens of quantum decision theory, especially when there is evidence of superpositional behavior by the nodes [4][5]. One major consequence of switching nodes in the quantum context is that probability measurements are not commutative. Thus the result P(T1,T2)≠P(T2,T1) even when T1 and T2 are apparently independent. The interaction disturbs the system that causes the 3 variables to change, so that the order has an influence on the expectations associated with the system [6]. These ideas also apply in the field of belief vectors, which represent relations between states underlying the reasoning process. A specific belief may be a numerical value or a Boolean variable representing a choice between alternatives and in a basic form it may be seen as representing a class such as Type A. The choice itself might fluctuate between two different possibilities that may be viewed as being altered by the random influence projected by Class C. The dynamics of this projection may be such so that it does go to zero or some other fixed point. In this paper, we consider the problem of reasoning with states of the system that change dynamically with each interaction. Specifically, we consider a model where the internal states change and a nonlinear mapping is proposed as a possible mechanism. Results on the statistical characteristics of the observations have been obtained. The system has also been analyzed from the perspective of noise theory. Dynamics of the system model Since the components of the system interact with each other, the system cannot be analyzed based on classical probability. But since the nature of these interactions is potentially endless, we must constrain our analysis by means of specific assumptions. We assume the system to have nodes of type A, B, and C. The C nodes switch into A and B back and forth just like the population of the predators and prey in an isolated habitat. Such complex system dynamics will be characterized by fixed points and orbits. Different mechanisms may be at work in different systems. Rather than speak of the full system, we will now focus only on the elements of Type C. Let the probability that an element of C will projected as A be n. Let each interaction with the system change the proportion of A and B nodes. Assume dynamics determined by the function s: N → N on the set of positive integers where 0 is taken to be an even number, and (3) 𝑠𝑠(𝑖𝑖 + 1) = 𝑓𝑓(𝑠𝑠(𝑖𝑖)) where i is the interaction count with the system. 4 Various modular schemes for the dynamic change of probability will be considered. Let s(i) be the number of Type C nodes that are observed as Class A nodes at ith measurement. Let the value of i run from 0 to M-1. Scheme 1 (4) 𝑠𝑠(𝑖𝑖 + 1) = 𝑠𝑠(𝑖𝑖) + 𝑘𝑘 mod 𝑀𝑀 This will make the probability change in a zig-zag manner. Scheme 2 (5) 𝑠𝑠(𝑖𝑖 + 1) = 𝑘𝑘𝑘𝑘(𝑖𝑖) mod 𝑀𝑀 If M is prime then the nodes will go through a cycle and the cycle is full if k is a primitive element of the prime. Example 1. We have M=6, or a total of 5 nodes of Type C, and k = 2. The changes in the number of Type A nodes on each inspection will be as follows (where the first row represents the number in the first encounter): 1 2 3 4 5 2 4 0 2 4 4 2 0 4 2 So in this case we have a fixed point (which is 0) and a cycle 2 4. If the initial number of nodes was not 3, then the probability will switch between the values 4/5 and 2/5. For initial number 3, the probability goes to zero. Scheme 3 Consider a general modular mapping: 𝑠𝑠(𝑛𝑛) = � 𝑛𝑛 2 , if 𝑛𝑛 is even (6) 𝑘𝑘𝑘𝑘 + 1 if 𝑛𝑛 is odd In particular, we consider this transformation for the specific case of k=3: 5  n/2 s( n ) =  3n + 1 mod M if n is even (7) if n is odd This is the finite version of the 3n+1 – mapping associated with the names of L. Collatz and other mathematicians [7][8]. The value of M determines the largest orbit that will be associated with the probability evolution. The initial count of nodes of Type A will be taken to be s(0). If M is even, the population of Type A nodes will never go down to zero excepting when 3i =1 mod M. As example, consider the mapping for mod 17. The numbers 1 through 16 are mapped in one step as follows: s(0) values  (9) Figure 2. The evolution of the initial states with each observation. The fixed point is 0 and the orbit is 1 4 2 1 If M is odd, the Type A nodes will either have a fixed point or be part of an orbit. Example 2. If i(0) = 7, and M= 55, one gets the sequence 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1; in other words, the orbit or trajectory of 7 has 17 elements and the path length is 16. The maximum value generated is 52. Let N= 37, for the same initial distribution. We then get 7, 22, 11, 34, 17, 15, 9, 28, 14, 7, …. which is an orbit of 9. The trajectory for n = 3 for M=100 is 3, 10, 5, 16, 8, 4, 2, 1, that is it has 8 elements in it or it has a path length of 7, with a maximum value of 16. The sequence for n = 25, takes 23 steps, climbing to 88 before descending to 1: ( 25, 76, 38, 19, 58, 29, 88, 44, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5, 16, 8, 4, 2, 1 ). 6 The assumption in the modular mappings above is that the system is classical although highly nonlinear. However there are situations where this is not true and the consideration of a quantum model appears justified [9][10[11][12]. This takes us beyond classical sets in a different manner. Statistical analysis Given that nA, nB, and nC are the number of elements belonging to the sets A, B, and C, respectively, and 𝑁𝑁 = (𝑛𝑛𝐴𝐴 + 𝑛𝑛𝐵𝐵 + 𝑛𝑛𝐶𝐶 ), we can begin with the basic probability associated with events A and B. Figure 4. Probability of sets A and B Let M be the variable representing the short-term average of X. Give the random switching of the elements of C, M takes values that range over (𝑛𝑛𝐴𝐴 − 𝑛𝑛𝐵𝐵 − 𝑛𝑛𝐶𝐶 )/𝑁𝑁 to (𝑛𝑛𝐴𝐴 − 𝑛𝑛𝐵𝐵 + 𝑛𝑛𝐶𝐶 )/𝑁𝑁. We will assume that M is a uniformly distributed random variable as shown below: Figure 4. Distribution of M The expected value of M, E(M)= E(X): 𝐸𝐸(𝑀𝑀) = (𝑛𝑛𝐴𝐴 −𝑛𝑛𝐵𝐵 ) (9) 𝑁𝑁 The mean square value of M, E(M2), may be easily computed: 𝐸𝐸(𝑀𝑀2 ) = And the variance of M is 2 2 2 (3𝑛𝑛𝐴𝐴 +3𝑛𝑛𝐵𝐵 +𝑛𝑛𝐶𝐶 −6𝑛𝑛𝐴𝐴 𝑛𝑛𝐵𝐵 ) (10) 𝑛𝑛2 (11) 3𝑁𝑁 2 𝑉𝑉𝑉𝑉𝑉𝑉(𝑀𝑀) = 3𝑁𝑁𝐶𝐶2 7 Thus the variance of the mean is one-third of the square of the proportion of switching elements. This variance is independent of the actual values of nA and nB. An estimate of this variance will be a measure of the size of C, which may be important in determining how many individuals in the poll belong to a separate class where the choices are not firm. Class C as Noise We can also present a noise theory perspective on the problem. Assume, for the sake of symmetry, that Classes A and B have the same number of elements and that they represent two different Hypotheses A and B. A number of measurements, Xi, are taken and with A and B mapped to 1 and -1, the decision taken is by threshold logic: Choose Hypothesis A if ∑𝑖𝑖 𝑋𝑋𝑖𝑖 ≥ 0; Otherwise, Hypothesis B. (12) Since we assume that the changes in the membership of C occurs with low rate (so that the surveys on a specific day, when the membership is stable) can be as large as one pleases. One might also assume now that elements of A and B can also change as in Figure 12 below. The source probabilities are expressed by subscript “s” and the observation probabilities are expressed by subscript “o”. Figure 5. The observation process We have 𝑝𝑝(𝐴𝐴𝑜𝑜 ) = 𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐴𝐴𝑠𝑠 )𝑝𝑝(𝐴𝐴𝑠𝑠 ) + 𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐵𝐵)𝑝𝑝(𝐵𝐵𝑠𝑠 ) + 𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐶𝐶𝑠𝑠 )𝑝𝑝(𝐶𝐶𝑠𝑠 ) and so on. (13) By Bayes’ theorem: 𝑝𝑝(𝐴𝐴𝑠𝑠 |𝐴𝐴𝑜𝑜 ) = 𝑝𝑝(𝐴𝐴 𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐴𝐴𝑠𝑠 )𝑝𝑝(𝐴𝐴𝑠𝑠 𝑜𝑜 |𝐴𝐴𝑠𝑠 )𝑝𝑝(𝐴𝐴𝑠𝑠 )+𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐵𝐵)𝑝𝑝(𝐵𝐵𝑠𝑠 )+𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐶𝐶𝑠𝑠 )𝑝𝑝(𝐶𝐶𝑠𝑠 ) (14) If the task is to estimate the size of A (or B), then Bayes’ estimate may be used [13][14][15]. 8 However, the random nature of the elements of set C implies that the probabilities 𝑝𝑝(𝐴𝐴𝑜𝑜 |𝐶𝐶)and 𝑝𝑝(𝐵𝐵𝑜𝑜 |𝐶𝐶)are not fixed. Under certain conditions, these probabilities may be taken to be fixed and constant. But in general, the nature of the nonlinear process underlying the change of the characteristics as well as the environment will determine what these probabilities are. The query could be to ascertain the probability of various subsets associated with the system as a means of determining its structure. But as information about the subsets comes in, the sampling strategy will have to be changed to reflect the estimates obtained by Bayes’ testing. This is a process that will have to be updated continuously. Conclusions We have considered sets where some of the elements switch characteristics in some random manner over time. This is a situation that cannot be covered by abstractions of either static or dynamic sets when these changes take place at regular intervals. We propose the use of sets with elements that change, and modular forms are proposed to account for one kind of such change. An expression for the dependence of the mean on the probability of the switching elements was determined. The system was also analyzed from the perspective of decision between different hypotheses. Such sets are likely to be of use in complex system queries and in analysis of surveys. References 1. Pearl, J. (2014) Understanding Simpson’s paradox. The American Statistician 88: 8-13 2. Rücker, G. (1989) A two-stage trial design for testing treatment, self-selection and treatment preference effects. Statistics in Medicine 8: 477-485 3. Kaptchuk, T.J. and Miller, F.G. (2015) Placebo effect in medicine. N Engl J Med 373:8-9 4. Kak, S. (1996) The three languages of the brain: quantum, reorganizational, and associative. In Learning as Self-Organization, K. Pribram and J. King (editors). Lawrence Erlbaum Associates, Mahwah, NJ, 185-219 5. Lambert et al. (2013) Quantum biology. Nature Physics, 9(1), 10-18 6. Kak, S. (2016). Communication languages and agents in biological systems. In Biocommunication: Sign-Mediated Interactions between Cells and Organisms. J. Seckbach & R. Gordon (editors). London, World Scientific Publishing. Pp. 203-226 7. Lagarias, J.C. (1985) The 3x + 1 problem and its generalization. Amer. Math. Monthly, 92(1): 3-23 8. Wirsching, G.J. (1998) The Dynamical System Generated by the 3n+1 Function. Lecture Notes in Mathematics 1681. Springer-Verlag. 9. Kak, S. (2000) Active agents, intelligence, and quantum computing. Information Sciences 128: 117 10. Kak, S. (1999) The initialization problem in quantum computing. Foundations of Physics 29: 267279 11. Kak, S. (2007) Quantum information and entropy. Int. Journal of Theoretical Physics 46: 860-876 9 12. Aerts, D. (2009) Quantum structure in cognition. Journal of Mathematical Psychology 53: 314348 13. Kumar, P.R. and Varaiya, P. (2015) Stochastic Systems: Estimation, identification, and adaptive control. SIAM. 14. Scott, D.W. (2015) Multivariate Density Estimation: theory, practice, and visualization. John Wiley. 15. Tuzlukov, V.P. (2001) Signal Detection Theory. Springer Science. 10
2cs.AI
A Local Approach for Information Transfer arXiv:1801.09527v1 [cs.IT] 9 Jan 2018 P. Garcı́aa∗and R. Mujicab a Facultad de Ingenierı́a en Ciencias Aplicadas, Universidad Técnica del Norte, Ibarra, Ecuador. b Centro de Fı́sica Teórica y Computacional, Laboratorio de Fenómenos No Lineales, Escuela de Fı́sica, Facultad de Ciencias, Universidad Central de Venezuela, Caracas, Venezuela. Abstract In this work, a strategy to estimate the information transfer between the elements of a complex system, from the time series associated to the evolution of this elements, is presented. By using the nearest neighbors of each state, the local approaches of the deterministic dynamical rule generating the data and the probability density functions, both marginals and conditionals, necessaries to calculate some measures of information transfer, are estimated. The performance of the method using numerically simulated data and real signals is exposed. 1 Introduction The estimation of directionality of coupling between electrocardiographic and respiratory signals[1] may help to decide on which system exerts control allowing a more efficient medication; determination of the causal relations between shares of stock, to select which one to monitor, in order to make decisions to buy or sell; the detection of the elements that control the evolution of the others in a complex network, allows to estimate its robustness and simplifies the control problem by reducing the number of sites on which to take control actions[2]; these are some of the situations where it is ∗ Permanent address: Laboratorio de Sistemas Complejos, Departamento de Fı́sica Aplicada, Facultad de Ingenierı́a, Universidad Central de Venezuela, Caracas, Venezuela. useful to estimate how a subsystem sends and receives information from another in a complex system. From a more general perspective, the estimation of the extent to which a component contributes to the production of information system and the rate at which it is shared with the rest of the components, can provide important information about its structure. For this reason, detecting the transfer of information and its directionality is a subject of great interest due to the variety of practical applications, in areas ranging from physics to marketing. Since Wiener[3] proposed that an improvement of the prediction of the future of a time series x, by the incorporation of information from the past of a second time series y, can be seen as an indicator of a causal interaction from y to x, an operational way to implement these ideas was proposed by Granger [4] and a further formalization of the strategy by Schreiber [5]; the problem of the estimation of a cause-effect relation between elements of a complex system, have been addressed under many different points of views. From deterministic [6, 7, 8, 35, 10] to probabilistic [5, 11, 12] modeling schemes have been proposed and the problem has been named as detection of causality [7, 8] or directionality of the coupling estimation [6, 10, 11, 12] or detection of direct links [13], among others. In this work we propose to estimate the transmission of information between elements of complex systems, using the formal probabilistic scheme proposed by Schreiber in [5], but approximating the probability density functions (PDF) involved, by using a k-nearest neighbors approach. In this case, the neighborhood, to any point, is used in a deterministic nonlinear local model to estimate the conditional PDF’s and in a density estimator to approximate the marginals PDF’s associated with the data. This strategy, although it is also based on the determination of the k nearest neighbors, is conceptually simpler than the strategy presented in [14] and has the advantage that the estimate can be made using only the nearest neighbor, which in principle makes it computationally less expensive. The use of deterministic models for the further determination of the information transfer, is expected to offer an interesting relationship between the strategies based on probabilistic and deterministic models, as well as between the parametric and nonparametric schemes. In order to show the usefulness of the scheme, the work is organized as follows: section 1 is devoted to present the idea behind of the information transfer and section 2 gives a methodology to estimate the conditional PDF’s involved in information transfer, using local approaches. In section 3 we combine these ideas, into the approach of Schreiber [5], to estimate the information transfer in the case of numerically simulated and real signals. Finally in section 4, we give some concluding remarks. 2 Information transfer There are many tools to estimate the information transfer in time series, see for example [15] and references therein. Nevertheless an attempt to classify them in few categories require a titanic effort, among other reasons, because of the unclear relations between them. However, most popular time series tools appear to fall into one of two broad classes, model-based strategies and parameter-free strategies or model-free strategies. The representative of the first class is an approach called Granger Causality [4] and the other class is represented by a scheme based on information theory, entropy transfer, proposed by Schreiber in [5]. In Granger’s method, causality could be tested by measuring the ability to predict, using a linear model, the future values of a time series using prior values of another time series. Using this scheme in the case of nonlinear subsystems can leads to erroneous conclusions. This problem is addressed in [16] where a nonlinear model is performed using radial basis functions. Despite this, the scheme still has the weakness of being a static measure. In the case of parameter-free methods, the usual strategy to quantify the superimposing of information contained in interacting subsystems is the mutual information. Unfortunately this is a symmetrical and static measure, so that does not give a sense of direction or temporal evolution of information in the system. A strategy which overcomes the two previously mentioned weaknesses is proposed in [5] to estimate the transmission of information based on observations of the time series associated with the system elements and information theory [17]. In [5], Schreiber proposes a measure of transfer of entropy which represents a rigorous derivation of Wiener causal measure and shares some of the desired properties, to represent transfer of information, with Mutual Information but takes into account the dynamics of the system. This measure, with minimal assumptions about the dynamics of the system and the nature of the coupling, is able to quantify the exchange of information between two systems x and y as follows: Ix→y Iy→x   p(yn+1 |yn , xn ) = p(yn+1 , yn , xn ) log2 p(yn+1 |yn ) yn+1 ,xn ,yn   X p(xn+1 |xn , yn ) = p(xn+1 , xn , yn ) log2 p(xn+1 |xn ) x ,x ,y X n+1 n (1) n and it may be thought [18] as a conditional mutual information. Where p(·, ·) and p(·|·) are the joint and conditional probabilities of occurrence of the state or system. Determining the flow of information given by (1) requires the calculation of probability densities associated with transitions between states of each subsystem, and in this case of a brute-force estimation, requires a coarse graining of the time series associated to both subsystems. This represents a large computational cost that increases considerably when these probabilities should be calculated for all pairs of elements of a large extended system. 3 Probability densities and local modeling According to Wiener’s idea, if the improvement in prediction can be associated with a reduction in uncertainty, it is natural that a measure of causality can be represented in terms of information theory concepts. However, the determination of causal relationships or information transfer, may also be represented in terms of deterministic models. To show the feasibility of the idea, we start by representing the joint probabilities, in the entropy transfer definition (1), in terms of conditional and marginal probability densities using: p(x, y, z) = p(x|y, z)p(y|z)p(z), for later, we propose a strategy to estimate both, the conditional densities probabilities and marginal densities probabilities, using local nonlinear modeling of the dynamical system [19, 20, 21] and nonparametric method to estimate marginals densities functions [22] respectively. Inspired in [23], we propose to estimate the conditional probabilities densities p(xn+1 |xn ), p(xn+1 |xn , yn ), p(xn+1 |yn ) and p(yn+1 |yn ), p(yn+1 |yn , xn ), p(yn+1 |xn ) associated to the appearance of states xn+1 and yn+1 , given some of the predecessors states of both subsystems, using the quality of predictions made from a deterministic model. Specifically, we base the approach in the estimation of the nearest neighbors of xn and yn . The marginal probability density functions, p(xn ) and p(yn ), can be approached using the same strategy. In order to do this, we start by constructing a Cumulative Distribution Function to derive from it the necessary probability densities. This function is, by definition, a real-valued and strictly increasing function of a random variable X, usually represented as: FX (x) = P (X ≤ x), (2) where the right-hand side is the probability that, the random variable X takes on a value less than or equal to x. The probability that x lies in the semi-closed interval (a, b], where a < b, is therefore P (a < X ≤ b) = FX (b) − FX (a). (3) The Cumulative Density Function of a continuous random variable X can be expressed as the integral of its probability density function pX (x) as follows: Z x FX (x) = pX (t) dt. (4) −∞ Similarly, for the case of Cumulative Conditional Distribution Function: Z y FXY (y|x) = pXY (y|x) dy. (5) −∞ Thus, the conditional probability density (CPD) function can be obtained as: pXY (y|x) = ∂F (y|x) ∂y (6) If we chose the Cumulative Conditional Distribution Function in (6) as a sigmoid function, S(u) = 1/1 + e−ru , with u = f (x) − y, as in [23]: F (y|x) = S(f (x) − y) (7) where f is a model for the system, constructed from the data; then we can distinguish between two extremes for distribution: one strictly deterministic, i.e. without errors, where r → ∞ and F is given by: F (y|x) = θ(f (x) − y), (8) with θ the Heaviside function, or a probabilistic approach, where the parameter r < ∞. Here r is, in some sense, a measure of the randomness of the process X. It is clear, from equations (6) and (8), that if we have an approximation of the dynamic rule that governs the evolution of the system, then it is possible to construct an adequate cumulative distribution function, that allows to estimate the probability densities, necessary to calculate the transfer of information. In this case we propose to chose the parameter r, in the sigmoid function, proportional to 1/σ, where σ is the standard deviation of the modeling errors, since the slope of the transition of the sigmoid function determines the width of the distribution associated with it. At this point, we can summarize the presentation into two main ideas: the Schreiber’s information transfer, and some other estimators, can be written in terms of CPD’s and the CPD’s can be estimated using deterministic models of the rule generating the data. The remainder of the section, is intended to implement these models and show how they can be incorporated into an estimator of information transfer, with a computational cost similar to the determination of the k-nearest neighbors, with k = 1. Let us suppose that we have a series of values of the states of a dynamical system d {xi }N i=1 , with xi ∈ R , obtained either by measuring the d components of system’s state at regular time intervals or by reconstructing the state space by using the Takens theorem[24], from partial information about the states. In our approach the dynamical rule is estimated using a local approximation for f . This approach can be presented algorithmically as: i. Given the i-th data value xi , with i = 1, 2, · · · , N . ii. Determine the set of the m nearest states ({xvi }m j=1 ), to the state i in the Euj clidean metric, sorted in ascendant order with the distance from xi . Here vji , the label of the j-th neighbor of the i-th data value, is an integer in the interval [1, N − 1]. iii. The approximation is obtained by Taylor expanding f to first order, around of the nearest neighbor xvi , to obtain: 1 xi+1 ≈ f (xvi ) + Df (xvi )(xi − xvi ) 1 1 1 (9) where, Df (xvi ) is the Jacobian matrix of f . 1 iv. Finally, in zero order, the evolution of the system is approximated by the evolution of the nearest neighbor, i.e., xi+1 ≈ xvi +1 . For a first order approximation it is 1 necessary to calculate Df (xvi ). 1 The marginal probabilities densities functions p(x) y p(y), can be estimated using the k-th nearest neighbor density estimator[22]: p(xi ) = k . N ||x − xvi || (10) k To illustrate graphically the methodology to estimate the probability densities, Figure 1 shows conditional and marginal probability density functions, for N = 500 data points of the skew tent map with a = 0.65,  xi 0≤x≤a a fa (xi ) = , (11) 1−xi a<x≤1 1−a Thus, for zero order approach of the dynamical rule f in (11) and using the equations (6) and (8), the CPD function is given by: −r(xvi +1 −x1+1 ) p(xi+1 |xi ) = h re 1+e 1 i −r(xvi +1 −xi+1 ) 2 (12) 1 Figure 1, illustrates the above mentioned ideas and gives a graphical insight of how the proposed strategy associates the modeling errors with CPD’s. 4 Results In order to show the performance of our strategy, we estimate the information transfer in the case of signals from a numerical simulation and real data. 0.10 p ( xn ) 0.08 0.06 0.04 0.02 0.00 0.0 0.2 0.4 0.6 0.8 1.0 xn Figure 1: Left: CPD function. Doted line shows, as an example, the probability of the occurrence of all values given the occurrence of the value 0.2. Right: Marginal probability density function. The solid line represents the local estimation and the doted one represents a histogram of the data. Both PDFs are estimated using 500 data points of the skew tent map with parameter a = 0.65 and k = 1. 4.1 Numerical simulations The data associated with the numerical simulations correspond to two coupled skew tent maps in chaotic regime, connected by a nonlinear and bidirectional coupling function as in [25] and the Chuas’s system[26] the first case provides a controlled experiment where the directionality of the transfer of information is known, which allows a performance testing strategy; the second example will allow to compare the performance of the strategy using numerically simulated data with the results for the same system but in the case of real data. 4.1.1 Coupled chaotic maps Here, two chaotic tent maps (11) with parameter a = 0.5, are coupled according to: xn+1 = f (xn + (yn − xn )) yn+1 = f (yn + µ(xn − yn )) (13) where the parameters  and µ define the intensity of the coupling. The transmission of information, in this case, can be associated to the synchronization of the trajectories of the systems [27]. Being understood by synchronization, the coincidence between the states of the subsystems once sufficient time has elapsed. Figure 2 shows synchronization error and information transfer between the coupled maps (13) as a function of the coupling parameters. It is worth to note as the flat zone, in the information transfer surface, coincide with the synchronization zone, as suggested by Bollt in [27]. |x N - y N | 0.4 0.35 0.3 μ 0.25 0.2 0.15 0.1 0.05 0.0 0.0 0.1 0.2 0.3 0.4 ϵ Figure 2: Left: Synchronization error |xN − yN | as a function of the coupling parameters. Right: Information Transfer between the elements of the systems (13), estimated using 500 data points. 4.1.2 Chua’s system The Chua’s system is a well-known chaotic system, representing a RLC circuit with one or more nonlinear elements. The easy construction of the circuit has made it an ubiquitous real-world example of a chaotic system. dVC1 dt dVC2 RC2 dt diL dt = α[VC2 − VC1 − g(VC1 )] = VC1 − VC2 + RiL = −βVC2 (14) where g(VC1 ), is the usual piece-wise linear function representing the Chua’s diode and all parameters are chosen as in [28]. Let us rename the elements of the circuits indexing them as C1 → 1, C2 → 2 y L → 3 and define the net flow of information associated to each component of the circuit, as the difference among the sum of the information transfer between it and the rest of the elements and the sum of the information transfer from the rest of the elements to it, as: VC 1 VC 2 iL Ii→j 1.0 VC 1 0.8 0.6 VC 2 0.4 0.2 iL 0 Figure 3: Information transfer between all pairs formed with signals VC1 , VC2 and iL . The data is obtained by numerical integration of the system (14) using a Runge-Kutta of 4-th order. Here we chose the parameter r as two times the standard deviation of the modeling errors at dimension three. Ti = 3 X Ii→j − Ij→i . (15) j=1 The evaluation of these quantities, see Figure 3, produces: T1 = −0.5684, T2 = 1.6476, T3 = −1.0792. This is consistent with some results about the control of Chua’s circuit [28, 29, 30]. Here the authors prove that Chua’s system can be controlled by using a linear feedback controller and say that their numerical simulations show that simplest control can be achieved by perturbing only VC2 . 4.2 4.2.1 Real data Chua’s circuit In this case, an experimental implementation of the Chua’s circuit was done, using operational amplifiers to simulate the Chua’s diode and the inductor L[31, 32]. The current in the inductor was obtained by an indirect measure and the data, sampled with rate of 5ms, is shown in the left side of Figure 4. The right side of Figure 4 shows the information transfer estimated as explained before for all pairs formed with signals VC1 , VC2 and iL . In this case, T1 = −0.268914, T2 = 1.39525 and T3 = −1.09931, which is consistent with the results obtained previously for the numerical simulation of this system. VC 1 VC 2 iL Ii→j 1.0 0.6 VC 1 0.8 0.2 0.6 VC 2 0.4 VC 2 0.0 0.4 - 0.2 0.2 - 0.4 iL - 1.0 - 0.5 0.0 VC 0.5 1.0 0 1 Figure 4: Left: VC1 vs VC2 , for 1024 experimental data points from Chua’s circuit. Right: Information transfer between all pairs formed with signals VC1 , VC2 and iL . Here we chose the parameter r as two times the standard deviation of the modeling errors at dimension three and the number of neighbors k = 1, but the numerical experiments suggests that the results are not strongly dependent of this choice. 4.2.2 Physiological signals This experimental data correspond to time series taken from the Massachusetts General Hospital/Marquette Foundation (MGH/MF) Waveform Database in https://www.physionet.org/pn3/mghdb/ [34]. From there, the series mgh003, mgh005, mgh006, mgh087, mgh097, mgh148, mgh160, mgh183, mgh190 and mgh202, corresponding to electrocardiographic and blood pressure signals measured simultaneously, in patients in intensive care, were selected. To estimate the information transfer between both systems, 10000 data points from each pair of series were used. In all cases a greater transfer of information from arterial pressure or baro-reflex (br) system to the electro-cardiac (ec) system, T = (Ibr→ec − Iec→br )/(Ibr→ec + Iec→br ), as obtained in [35]. 5 Final remarks Three aspects should be highlighted, regarding the performance of the proposed strategy, first, but not the most important, is referred to the low computational cost associated with the determination of the first nearest neighbors compared, at least, to the cost to estimate CPD’s using coarse graining or calculating correlation integrals as in [5, 33]. Second, we must note that in the face of the results using experimental data, the estimation of the transfer of information based on nearest neighbors appears to be robust to the presence of moderate noise, given the consistency with the results in references [28, 29, 30]. Although a more detailed study of these aspects it is needed to 1.0 ● ● ● 0.8 ● ● ● 0.6 T ● ● 0.4 ● ● 0.2 mgh202 mgh190 mgh183 mgh160 mgh148 mgh097 mgh087 mgh006 mgh005 0 mgh003 0.0 Data set Figure 5: Information transfer between pairs formed with electrocardiographic and blood pressure signals measured simultaneously. In this case T represent the information transfer from the baro-reflex system to the cardiac system. be conclusive, it is out of the scope of the present work and is subject of our current research. Finally, we emphasize that, although one of the advantages of Schreiber’s estimator is that it is independent of models, and with this proposal, it will become a dependentmodel scheme, nevertheless we believe that the establishment of a relationship between an useful probabilistic definition of information transfer and deterministic modeling, may be a practical idea in the development of methodologies to determine causal relationship between subsystems of complex systems or contribute in the design of control schemes for extended systems. References [1] S. Schultz, F-C. Adochier, I-R. Edu, R. Schroeder, H. Costin, K-J. Bar and A. Voss, Philos Trans A Math Phys Eng Sci, 371 (2013). [2] Y-Y. Liu, J-J. Slotine, and A-L. Barabasi, Nature 473, 167 (2011). [3] N. Wiener, The theory of prediction. In Modern Mathematics for Engineer, McGraw-Hill, 1956. [4] C. Granger, Econometrica 37, 424 (1969). [5] T. Schreiber, Phys. Rev. Lett. 85, 461 (2000). [6] B. Bezruchko, V. Ponomarenko, M. G. Rosenblum and A. Pikovsky, CHAOS 13, 179 (2003). [7] H. Ma, K. Aihara and L. Chen, Scientific Reports 4, 1 (2014). [8] K. Ishiguro, N. Otsu, M. Lungarella and Y. Kuniyoshi, Phys. Rev. E. 77, 026216 (2008). [9] L. Cisneros, J. Jiménez, M. G. Cosenza and A. Parravano, Phys. Rev. E. 65, 045204R (2002). [10] M. G. Rosenblum and A. S. Pikovsky, Phys. Rev. E. 64, 045202R (2001). [11] M. Palus and A. Stefanovska, Phys. Rev. E. 67, 055201R (2003). [12] M. Vejmelka and M. Palus, Phys. Rev. E. 77, 026214 (2008). [13] N. Rubido, A. Martı́, E. Bianco-Martı́nez, C. Grebogi, M. S. Baptista and C. Masoller, New Journal of Physics 16, 093010 (2014). [14] J. Zhu, J-J. Bellanger, H. Shu and R. Le Bouquin Jeannés, Entropy 17, 4173 (2015). [15] R. Vicente and M. Wibral, In: Efficient estimation of Information Transfer, Springer-Verlag Berlin, 2014. [16] N. Ancona, D. Marinazzo and S. Stramaglia, Phys. Rev. E. 70, 056221 (2004). [17] C. Shannon, The Bell System Technical Journal 27, 379 (1948). [18] M. Palus, Phys. Rev. E. 67, 046211 (2003). [19] J. D. Farmer and J. J. Sidorowich, Phys. Rev. Lett. 58, 845 (1987). [20] P. Garcı́a, J. Jiménez, A. Marcano and F. Moleiro, Phys. Rev. Lett. 76, 1449 (1996). [21] P. Garcı́a and A. Merlitti. The European Physical Journal Special Topics 143, 261 (2007). [22] D. Loftgaarden and C. Quesenberry, Annals of Mathematical Statistics 36, 1049 (1965). [23] D. Husmeier, In: Perspectives in Neural Computing, Springer-Verlag, 1999. [24] F. Takens, In: Dynamical Systems and Turbulence, Springer Berlin, 1980. [25] M. Hasler and Y-L. Maistrenko. IEEE Trans. Circuits Syst. 44, 856 (1997). [26] T. Matsumoto, IEEE Transactions on Circuits and Systems 31, 1055 (1984). [27] E. M. Bollt, International Journal of Bifurcation and Chaos 22, 1250261 (2012). [28] G. Chen and X. Dong, Journal of Circuits Systems and Computers 3, 139 (1993). [29] G. Chen, Chaos, Solitons & Fractals 8, 1461 (1997). [30] C. Chen and X. Dong, Proc. of IEEE Inr. Symp. on Circ. Syst., Chicago, IL. 2604–2607 (1983). [31] K. Gopakumar, B. Premlet and K. G. Gopchandran, International Journal of Electronics 98, 667 (2011). [32] The implementation of this circuit is already an undergraduate exercise, in this case it was done using an Educational Laboratory and Virtual Instrumentation Suite (NI-ELVIS) from National Instruments. [33] W. Liebert, Phys. Lett. A. 142, 107 (1989). [34] J. P. Welch, P. J. Ford, R. S. Teplick and R. M. Rubsamen, The MGH/MF Waveform Database, 1992. [35] L. Cisneros and J. Jiménez, Revista Mexicana de Fsica 49, 17 (2003).
7cs.IT
arXiv:cs/0312031v1 [cs.DC] 16 Dec 2003 Theory and Practice of Logic Programming 1(3) 251–282, May 2001. 1 Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW library∗ DANIEL CABEZA and MANUEL HERMENEGILDO CLIP Group http://www.clip.dia.fi.upm.es – http://www.cliplab.org Facultad de Informática Universidad Politécnica de Madrid (UPM) 28660-Boadilla del Monte, Madrid, Spain (e-mail: {dcabeza,herme}@fi.upm.es) Abstract We discuss from a practical point of view a number of issues involved in writing distributed Internet and WWW applications using LP/CLP systems. We describe PiLLoW, a publicdomain Internet and WWW programming library for LP/CLP systems that we have designed in order to simplify the process of writing such applications. PiLLoW provides facilities for accessing documents and code on the WWW; parsing, manipulating and generating HTML and XML structured documents and data; producing HTML forms; writing form handlers and CGI-scripts; and processing HTML/XML templates. An important contribution of PiLLoW is to model HTML/XML code (and, thus, the content of WWW pages) as terms. The PiLLoW library has been developed in the context of the Ciao Prolog system, but it has been adapted to a number of popular LP/CLP systems, supporting most of its functionality. We also describe the use of concurrency and a highlevel model of client-server interaction, Ciao Prolog’s active modules, in the context of WWW programming. We propose a solution for client-side downloading and execution of Prolog code, using generic browsers. Finally, we also provide an overview of related work on the topic. Keywords: WWW, HTML, XML, CGI, HTTP, Distributed Execution, (Constraint) Logic Programming. 1 Introduction The wide diffusion of the Internet and the popularity of the “World Wide Web” (Berners-Lee et al., 1994) –WWW– protocols are effectively providing a novel platform that facilitates the development of new classes of portable and user-friendly distributed applications. Good support for network connectivity and the protocols and communication architectures of this novel platform are obviously requirements for any programming tool to be useful in this arena. However, this alone may not be enough. It seems natural that significant parts 0 This paper is an expanded and improved version of (Cabeza & Hermenegildo, 1996a; Cabeza & Hermenegildo, 1996b; Cabeza & Hermenegildo, 1997; Cabeza et al., 1996). 2 D. Cabeza and M. Hermenegildo of network applications will require symbolic and numeric capabilities which are not necessarily related with distribution. Important such capabilities are, for example, high-level symbolic information processing, dealing with combinatorial problems, and natural language processing in general. Logic Programming (LP) (Kowalski, 1974; Colmerauer, 1975) and Constraint Logic Programming (CLP) systems (Jaffar & Lassez, 1987; Van Hentenryck, 1989; Colmerauer, 1990; M. Dincbas & Van Hentenryck, 1990; ECRC, 1993) have been shown particularly successful at tackling these issues (see, for example, the proceedings of recent conferences on the “Practical Applications of Prolog” and “Practical Applications of Constraint Technology”). It seems natural to study how LP/CLP technology fares in developing applications which have to operate over the Internet. In fact, Prolog, its concurrent and constraint based extensions, and logic programming languages in general have many characteristics which appear to set them particularly well placed for making an impact on the development of practical networked applications, ranging from the simple to the quite sophisticated. Notably, LP/CLP systems share many characteristics with other recently proposed network programming tools, such as Java, including dynamic memory management, well-behaved structure and pointer manipulation, robustness, and compilation to architecture-independent bytecode. Furthermore, and unlike the scripting or application languages currently being proposed (e.g., shell scripts, Perl, Java, etc.), LP/CLP systems offer a quite unique set of additional features including dynamic databases, search facilities, grammars, sophisticated meta-programming, and well understood semantics. In addition, most LP/CLP systems also already offer some kind of low level support for remote communication using Internet protocols. This generally involves providing a sockets (ports) interface whereby it is possible to make remote data connections via the Internet’s native protocol, TCP/IP. A few systems support higherlevel communication layers on top of this interface including linda-style blackboards (e.g., SICStus Prolog (Carlsson, 1988), Ciao (Carro & Hermenegildo, 1999; Cabeza & Hermenegildo, 1995; Hermenegildo & CLIP Group, 1994; Hermenegildo et al., 1995a; Hermenegildo et al., 1999a; Hermenegildo et al., 1999b; Bueno et al., 1997), BinProlog/µ2Prolog (Tarau, 1996; De Bosschere, 1989), etc.) or shared variable-based communication (e.g., KL1 (Chikayama et al., 1994), AKL (Janson & Haridi, 1991), Oz (Smolka, 1994), Ciao (Hermenegildo et al., 1995b; Cabeza & Hermenegildo, 1995), etc.). In some cases, this functionality is provided via libraries, building on top of the basic TCP/IP primitives. This is the case, for example, of the SICStus and Ciao distributed linda-style interfaces. In fact, as we have shown in previous work, sharedvariable based communication can also be implemented in conventional systems via library predicates, by using attributed variables (Hermenegildo et al., 1995b; Cabeza & Hermenegildo, 1995). In addition to these communication primitives, several systems offer concurrency and even higher-level abstractions (distributed objects, mobile code, ...) which are very useful for developing general-purpose distributed applications. Our concrete interest here is WWW applications. These applications generally Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 3 use specific high-level protocols (such as HTTP or FTP), data formats (such as HTML or XML), and application architectures (e.g., the CGI interface) which are different from, e.g., the shared-variable or linda-based protocols typically used in other types of distributed applications. In this paper we study how good support for these WWW-related protocols, data formats, and architectures can be provided for LP/CLP systems, building on the widely available interfaces to the basic TCP/IP protocols. Our aim is to discuss from a practical point of view a number of the new issues involved in writing WWW applications using LP/CLP systems, as well as the architecture of some typical solutions. In the process, we will describe PiLLoW (“Programming in Logic Languages on the Web”), a public domain Internet/WWW programming library for LP/CLP systems which, we argue, significantly simplifies the process of writing such applications. PiLLoW provides facilities for generating HTML/XML structured documents by handling them as Herbrand terms, producing HTML forms, writing form handlers, processing HTML/XML templates, accessing and parsing WWW documents, etc. We also describe the architecture of some relatively sophisticated application classes, using a high-level model of clientserver interaction, active modules (Cabeza & Hermenegildo, 1995). Finally we describe an architecture for automatic LP/CLP code downloading for local execution, using just the library and generic browsers. Apart from the tutorial value of the paper, we present a number of technical contributions which include the idea of representing HTML and XML code (and structured text in general) as Prolog terms, the use of the logical variable in such terms leading to a model of an “HTML template” (a pair comprising a term with free variables and a dictionary associating names to those variables), the notion of “active logic modules” and its application to solving efficiency issues in CGI interaction in a very simple way, the idea of “Prolog scripts” and its application to CGIs, and the identification of a number of features that should be added to existing systems in order to facilitate the programming of WWW applications – mainly concurrency. The argument throughout the paper is that, with only very small limitations in functionality (which disappear when concurrency is added, as in systems such as BinProlog/µ2-Prolog, AKL, Oz, KL1, and Ciao Prolog), it is possible to add an extremely useful Internet/WWW programming layer to any LP/CLP system without making any significant changes in the implementation. We argue that this layer can simplify the generation of applications in LP/CLP systems including active WWW pages, search tools, content analyzers, indexers, software demonstrators, collaborative work systems, MUDs and MOOs, code distributors, etc. The purpose of the paper is also to serve as a tutorial, containing sufficient information for developing relatively complex WWW applications in Prolog and other LP and CLP languages using the PiLLoW library. The PiLLoW library has been developed in the context of the Ciao Prolog system, but it has been adapted to a number of other popular LP/CLP systems, supporting most of its functionality. The Ciao Prolog system and the PiLLoW library can be freely downloaded from http://www.clip.dia.fi.upm.es and http://www.cliplab.org. 4 D. Cabeza and M. Hermenegildo www.xxx.yyy HTTP Server 1 WWW Browser std. doc. request 4 output 2 3 hello_world Fig. 1. The CGI interface 2 Writing basic cgi-bin applications The simplest way of writing WWW applications is through the use of the “Common Gateway Interface” (CGI). A CGI executable is a standard executable file but such that the HTTP server (the program that responds to HTTP requests in a machine which serves a WWW site) can tell that it in fact contains a program that is to be run, rather than a document text that is to be sent to the client (the browser) as usual. The file can be distinguished by belonging to a special directory, commonly named cgi-bin, or by a special filename ending, such as .cgi. This is normally set during configuration of the HTTP server. The basic idea behind the CGI interface is illustrated in Figure 1. When the user selects an address of a CGI executable in a document, such as http://www.xxx.yyy/cgi-bin/hello_world (or perhaps http://www.xxx.yyy/foo/hello_world.cgi) the browser issues a standard document request (1). The HTTP server, recognizing that it is a CGI executable rather than a document, starts the executable (2), and during such execution stores the output of the executable in a buffer (3). Upon termination of the executable, the contents of the buffer (which should be in a format that the browser can handle, such as HTML) are returned to the browser as if a normal page with that content had been accessed (4). The following is an example of how a very simple such executable can be written in an LP/CLP language. The source might be as follows:1 main :write(’Content-type: text/html’), nl, nl, write(’<HTML>’), write(’Hello world.’), write(’</HTML>’). And the actual executable could be generated as usual, for example in the Ciao 1 Note that in the examples presented, and in order to shorten them, the HTML code may be slightly simplified, and as a result of this it may not be completely standard-conforming. However, the examples can be used as is with all popular browsers. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 5 system, using the standalone compiler, by writing at a UNIX shell “ciaoc -o hello_world.cgi hello_world”.2 The executable then has to be placed in an appropriate place (accessible via an HTTP address by a browser) and have the right permissions for being executed by the server (for example, in some systems this means being executable by the user “nobody”). In systems which make executables through saved states (which usually have the disadvantage of their generally large size), at the system prompt one could create the executable by writing something like: ?:- compile(’hello_world.pl’), save(’hello_world.cgi’), main. 3 LP/CLP Scripts for CGI Applications CGI executables are often small- to medium-sized programs that perform relatively simple tasks. This, added to the slow speed of the network connection in comparison with that of executing a program (which makes program execution speed less important) has made scripting languages (such as shell scripts or Perl) very popular for writing these programs. The popularity is due to the fact that no compilation is necessary (extensive string handling capabilities also play an important role in the case of Perl), and thus changes and updates to the program imply only editing the source file. Logic languages are, a priori, excellent candidates to be used as scripting languages.3 However, the relative complication in making executables (needing in some systems to start the top-level, compile or consult the file, and make a saved state) and the often large size of the resulting executables may deter CGI application programmers. It appears convenient to provide a means for LP/CLP programs to be executable as scripts, even if with reduced performance. It is generally relatively easy to support scripts with the same functionality in most LP/CLP systems. In Ciao, the program ciao-shell –which has also been adapted to SICStus (Hermenegildo, 1996)– accomplishes this task, by first loading the file given to it as the first argument (but skipping the first lines and avoiding loading messages) and then starting execution at main/1 (the argument provides the list of command line options). Then, for example, in a Unix system, the following program can be run directly as a script without any need for compilation: #!/usr/local/bin/ciao-shell main(_) :write(’Content-type: text/html’), nl, nl, write(’<HTML>’), 2 3 It often convenient to use options (such as ciaoc’s -s or -S) which will generate a standalone executable which is independent of any libraries. For example, the built-in grammars and databases greatly simplify many typical script-based applications. 6 D. Cabeza and M. Hermenegildo www.xxx.yyy <form action="http://www.xxx.yyy/handler.cgi"> 2 WWW Browser 1 HTTP Server form data 6 3 form reply 4 5 handler.cgi Fig. 2. The Forms interface write(’Hello world.’), write(’</HTML>’). Note that in some UNIX versions either the program ciao-shell must be included in the /etc/shells listing or the first line should be replaced by these two: #!/bin/sh exec ciao-shell $0 "$@" The execution of Prolog scripts may be optimized in some systems. For example, in Ciao, the first time a script is run it is also compiled and its bytecode is saved to a file. At subsequent times, if the script has not changed, the object code is retrieved from that file, avoiding compilation or interpretation overhead. 4 Form Handling in HTTP So far we have shown CGI executables which produce output, but this output is not a function of input coming from the request, which is obviously of limited interest. CGI executables become most useful when combined with HTML forms. HTML forms are HTML documents (or parts of HTML documents) which include special fields such as text areas, menus, radio buttons, etc. which allow providing input to CGI executables. The steps involved in the handling of the input contained in a form are illustrated in Figure 2. When a document containing a form is accessed via a form-capable browser (Mosaic, Netscape, Lynx, etc.), the browser displays the input fields, buttons, menus, etc. indicated in the document, and locally allows the user to perform input by modifying such fields. However, this input is not ultimately handled by the browser. Instead, it will be sent to a “handler” CGI program, which can be anywhere on the net, and whose address must be given in the form itself (1). Forms generally have a “submit” button such that, when pressed, the input Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 7 provided through the menus, text areas, etc. is sent by the browser to the HTTP server corresponding to the handler (2). Two methods for sending this input exist: “GET” and “POST”. In the meantime, the sending browser waits for a response from that program, which should come in the form of a new HTML document. The handler program is invoked in much the same way as a cgi-bin application (3), except that the information from the form is supplied to the handler (in different ways depending on the system, the method of invocation, and the content type) (4). This information is encoded in a predefined format, which relates each piece of information to the corresponding field in the form, by means of a keyword associated with each field. The handler then identifies the information corresponding to each field in the original form, processes it, and then responds by writing an HTML document to its standard output (5), which is forwarded by the server to the waiting browser when the handler terminates (6). An important point to be noted is that, as with simple cgi-bin applications, the handler is started and should terminate for each transaction. The reader is referred, for example, to (Grobe & Naseer, 1998) for a more complete introduction to CGI scripts and HTML forms. 5 Writing Form Handlers with Pi LLoW The only complication in writing form handlers compared to writing simple CGI applications is the need to capture and parse the form data. As we said before, this data can be provided in several ways, depending on the system and the method used to invoke the form, and is encoded with escape sequences. It is relatively easy to write a Prolog program to parse such input (using, for example, definite clause grammars –DCGs). The PiLLoW library provides some predicates which do this and simplify the whole task, hiding the low-level protocol behind. The principal predicates provided include: get_form_input(Dic ) Translates input from the form (with either the POST or GET methods, and even with CONTENT_TYPE multipart/form-data) to a dictionary Dic of attribute=value pairs. It translates empty values (which indicate only the presence of an attribute) to the atom ’$empty’, values with more than one line (from text areas or files) to a list of lines as strings, the rest to atoms or numbers (using name/2). This is implemented using DCG parsers. get_form_value(Dic,Var,Val ) Gets value Val for attribute Var in dictionary Dic. Does not fail: value is ’’ if not found (this simplifies merging form producers and form handlers, see later). form_empty_value(V ) Useful to check that a value V from a text area is empty (filters spaces, newlines, linefeeds, etc.). form_default(Val,Default,NewVal ) Useful when a form is only partially filled (and also in the first invocation of a combined form handler/producer – see Section 7). If the value of Val is empty then NewVal=Default, else NewVal=Val. my_url(URL ) Returns in URL the Uniform Resource Locator (WWW address) of this cgi executable. form_request_method(Method ) Returns in Method the method of invocation of the form handler (“GET” or “POST”). 8 D. Cabeza and M. Hermenegildo For example, suppose we want to make a handler which implements a database of telephone numbers and is queried by a form including a single entry field with name person_name. The handler might be coded as follows: #!/usr/local/bin/ciao-shell :- include(library(pillow)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), write(’Content-type: text/html’), nl, nl, write(’<HTML><TITLE>Telephone database</TITLE>’), nl, write(’<IMG SRC="phone.gif">’), write(’<H2>Telephone database</H2><HR>’), write_info(Name), write(’</HTML>’). write_info(Name) :form_empty_value(Name) -> write(’You have to provide a name.’) ; phone(Name, Phone) -> write(’Telephone number of <B>’), write(Name), write(’</B>: ’), write(Phone) ; write(’No telephone number available for <B>’), write(Name), write(’</B>.’). phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). The code above is quite simple. On the other hand, the interspersion throughout the text of calls to write with HTML markup inside makes the code somewhat inelegant. Also, there is no separation between computation and input/output, as is normally desirable. It would be much preferable to have an encoding of HTML code as Prolog terms, which could then be manipulated easily in a more elegant way, and a predicate to translate such terms to HTML for output. This functionality, provided by the PiLLoW library, is presented in the next section. 6 Handling HTML as Prolog Terms Since LP/CLP systems perform symbolic processing using Herbrand terms, it seems natural to be able to handle HTML code directly as terms. Then, such structures Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 9 only need to be translated by appropriate predicates to HTML code when they need to be output. In general, this relationship between HTML code and Prolog terms allows viewing any WWW page as a Herbrand term. The predicates which provide this functionality in PiLLoW are: output_html(F ) Accepts in F an HTML term (or a list of HTML terms) and sends to the standard output the text which is the rendering of the term(s) in HTML format. html2terms(Chars,Terms ) (also, xml2terms/2) Relates a list of HTML (resp. XML) terms and a list of ASCII characters which are the rendering of the terms in HTML format. This predicate is reversible (but it normalizes in the reverse direction –see later). output_html/2 uses this predicate to transform HTML terms in characters. Again, this is implemented via DCG parsing. In an HTML term certain atoms and structures represent special functionality at the HTML level. An HTML term can be recursively a list of HTML terms. The following are legal HTML terms: hello [hello, world] ["This is an ", em(’HTML’), " term"] When converting HTML terms to characters, html2terms/2 translates special structures into the corresponding format in HTML, applying itself recursively to their arguments. Strings are always left unchanged. HTML terms may contain logic variables, provided they are instantiated before the term is translated or output. This allows creating documents piecemeal, back-patching of references in documents, etc. In the following sections we list the meaning of the principal Prolog structures that represent special functionality at the HTML level. Only special atoms are translated, the rest are assumed to be normal text and will be passed through to the HTML document. 6.1 General Structures Basically, HTML has two kinds of components: HTML elements and HTML environments. An HTML element has the form “<NAME Attributes >” were NAME is the name of the element and Attributes is a (possibly empty) sequence of attributes, each of them being either an attribute name or an attribute assignment as name="Value". An HTML environment has the form “<NAME Attributes > Text </NAME>” were NAME is the name of the environment an Attributes has the same form as before. The general Prolog structures that represent these two HTML constructions are: Name $Atts (‘$/2’ is defined as an infix, binary operator.) Represents an HTML element of name Name and attributes Atts, were Atts is a (possibly empty) list 10 D. Cabeza and M. Hermenegildo of attributes, each of them being either an atom or a structure name =value . For example, the term img$[src=’images/map.gif’,alt="A map",ismap] is translated into the HTML source <img src="images/map.gif" alt="A map" ismap> Note that HTML is not case-sensitive, so we can use lower-case atoms. name (Text ) (A term with functor name/1 and argument Text) Represents an HTML environment of name name and included text Text. For example, the term address(’[email protected]’) is translated into the HTML source <address>[email protected]</address> name (Atts,Text ) (This is a term with functor name/2 and arguments Atts and Text) Represents an HTML environment of name name, attributes Atts and included text Text. For example, the term a([href=’http://www.clip.dia.fi.upm.es/’],"Clip home") represents the HTML source <a href="http://www.clip.dia.fi.upm.es/">Clip home</a> env(Name,Atts,Text ) Equivalent to Name (Atts,Text ). begin(Name,Atts ) It translates to the start of an HTML environment of name Name and attributes Atts. There exists also a begin(Name ) structure. Useful, in conjunction with the next structure, when including in a document output generated by an existing piece of code (e.g. Name = pre). Its use is otherwise discouraged. end(Name ) Translates to the end of an HTML environment of name Name. Now we can rewrite the previous example as follows (note how the use of the logic variable Response allows injecting the result of the call to response/1 into the output term, using unification): #!/usr/local/bin/ciao-shell :- include(library(pillow)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), output_html([ ’Content-type: text/html\n\n’, html([title(’Telephone database’), img$[src=’phone.gif’], h2(’Telephone database’), hr$[], Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 11 Response])]). %% Using the logic variable. response(Name, Response) :form_empty_value(Name) -> Response = ’You have to provide a name.’ ; phone(Name, Phone) -> Response = [’Telephone number of ’,b(Name),’: ’,Phone] ; Response = [’No telephone number available for ’,b(Name),’.’]. phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). Any HTML construction can be represented with these structures (except comments and declarations, which could be included as atoms or strings), but the PiLLoW library provides additional, specific structures to simplify HTML creation. 6.2 Specific Structures In this section we will list some special structures for HTML which PiLLoW understands. While in many cases using the general structures (with the native HTML names) is probably good practice, using specific structures such as these can sometimes be convenient. Also, some of these structures have special functionality (e.g., prolog_term/1). A predicate html_expansion/2 is provided which allows defining new structures (tables, layers, etc). Specific structures include (the reader is referred to the PiLLoW manual for a full listing): start Used at the beginning of a document (translates to <html>). end Used at the end of a document (translates to </html>). -- Produces a horizontal rule (translates to <hr>). \\ Produces a line break (translates to <br>). $ Produces a paragraph break (translates to <p>). comment(Comment ) Used to insert an HTML comment (translates to <!-- Comment -->). declare(Decl ) Used to insert an HTML declaration – seldom used (translates to <!Decl >). image(Addr ) Used to include an image of address (URL) Addr (translates to an <img> element). image(Addr,Atts ) As above with the list of attributes Atts. ref(Addr,Text ) Produces a hypertext link, Addr is the URL of the referenced resource, Text is the text of the reference (translates to <a href="Addr">Text</a>). label(Label,Text ) Labels Text as a target destination with label Label (translates to <a name="Label">Text</a>). heading(N,Text ) Produces a heading of level N (1 ≤ N ≤ 6), Text is the text to be used as heading – useful when one wants a heading level relative to another heading (translates to a <hN > environment). 12 D. Cabeza and M. Hermenegildo itemize(Items ) Produces a list of bulleted items, Items is a list of corresponding HTML terms (translates to a <ul> environment). enumerate(Items ) Produces a list of numbered items, Items is a list of corresponding HTML terms (translates to an <ol> environment). description(Defs ) Produces a list of defined items, Defs is a list whose elements are definitions, each of them being a Prolog sequence (composed by ’,’/2 operators). The last element of the sequence is the definition, the other (if any) are the defined terms (translates to an <dl> environment). nice_itemize(Img,Items ) Produces a list of bulleted items, using the image Img as bullet. The predicate icon_address/2 provides a colored bullet. preformatted(Text ) Used to include preformatted text, Text is a list of HTML terms, each element of the list being a line of the resulting document (translates to a <pre> environment). verbatim(Text ) Used to include text verbatim, special HTML characters (<,>,&,") are translated into its quoted HTML equivalent. prolog_term(Term ) Includes any prolog term Term, represented in functional notation. Variables are output as _. nl Used to include a newline in the HTML source (just to improve human readability). entity(Name ) Includes the entity of name Name (ISO-8859-1 special character). cgi_reply This is not HTML, rather, the CGI protocol requires this content descriptor to be used by CGI executables (including form handlers) when replying (translates to “Content-type: text/html”). pr Includes in the page a graphical logo with the message “Developed using the PiLLoW Web programming library”, which points to the manual and library source. With these additional structures, we can rewrite the previous example as follows (note that in this example the use of heading/2 or h2/1 is equally suitable): #!/usr/local/bin/ciao-shell :- include(library(pillow)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), output_html([ cgi_reply, start, title(’Telephone database’), image(’phone.gif’), heading(2,’Telephone database’), --, Response, Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 13 end]). response(Name, Response) :form_empty_value(Name) -> Response = ’You have to provide a name.’ ; phone(Name, Phone) -> Response = [’Telephone number of ’,b(Name),’: ’,Phone] ; Response = [’No telephone number available for ’,b(Name),’.’]. phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). We have not included above the specific structures for creating forms. They are included and explained in the following section. 6.3 Specific Structures for Forms In this section we explain the structures which represent the various elements related to forms: start_form(Addr [,Atts ]) Specifies the beginning of a form. Addr is the address (URL) of the program that will handle the form, and Atts other attributes of the form, as the method used to invoke it. If Atts is not present the method defaults to POST. (Translates to <form action="Addr " Atts >.) start_form Specifies the beginning of a form without assigning address to the handler, so that the form handler will be the cgi-bin executable producing the form. end_form Specifies the end of a form (translates to </form>). checkbox(Name,State ) Specifies an input of type checkbox with name Name, State=on if the checkbox is initially checked (translates to an <input> element). radio(Name,Value,Selected ) Specifies an input of type radio with name Name (several radio buttons which are interlocked must share their name), Value is the the value returned by the button, if Selected=Value the button is initially checked (translates to an <input> element). input(Type,Atts ) Specifies an input of type Type with a list of attributes Atts. Possible values of Type are text, hidden, submit, reset, . . . (translates to an <input> element). textinput(Name,Atts,Text ) Specifies an input text area of name Name. Text provides the default text to be shown in the area, Atts a list of attributes (translates to a <textarea> environment). option(Name,Val,Options ) Specifies a simple option selector of name Name, Options is the list of available options and Val is the initial selected option (if Val is not in Options the first item is selected) (translates to a <select> environment). 14 D. Cabeza and M. Hermenegildo menu(Name,Atts,Items ) Specifies a menu of name Name, list of attributes Atts and list of options Items. The elements of the list Items are marked with the prefix operator ‘$’ to indicate that they are selected (translates to a <select> environment). For example, in order to generate a form suitable for sending input to the previously described phone database handler one could execute the following goal: output_html([ start, title(’Telephone database’), heading(2,’Telephone database’), $, start_form(’http://www.clip.dia.fi.upm.es/cgi-bin/phone_db.pl’), ’Click here, enter name of clip member, and press Return:’, \\, input(text,[name=person_name,size=20]), end_form, end]). Of course, one could have also simply written directly the resulting HTML document: <html> <title>Telephone database</title> <h2>Telephone database</h2> <p> <form method="POST" action="http://www.clip.dia.fi.upm.es/cgi-bin/phone_db.pl"> Click here, enter name of clip member, and press Return: <br> <input type="text" name="person_name" size="20"> </form> </html> 7 Merging the Form Producer and the Handler An interesting practice when producing HTML forms and handlers is to merge the operation of the form producer and the handler into the same program. The idea is to produce a generalized handler which receives the form input, parses it, computes the answer, and produces a new document which contains the answer to the input, as well as a new form. A special case must be made for the first invocation, in which the input would be empty, and then only the form should be generated. The following is an example which merges the producer and the handler for the phones database:4 4 Notice that when only one text field exists in a form, the form can be submitted by simply pressing “Return” inside the text field. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 15 #!/usr/local/bin/ciao-shell :- include(library(pillow)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), output_html([ cgi_reply, start, title(’Telephone database’), image(’phone.gif’), heading(2,’Telephone database’), --, Response, start_form, ’Click here, enter name of clip member, and press Return:’, \\, input(text,[name=person_name,size=20]), end_form, end]). response(Name, Response) :form_empty_value(Name) -> Response = [] ; phone(Name, Phone) -> Response = [’Telephone number of ’,b(Name),’: ’,Phone,$] ; Response = [’No telephone number available for ’,b(Name),’.’,$]. phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). This combination of the form producer and the handler allows producing applications that give the impression of being interactive, even if each step involves starting and running the handler to completion. Note that forms can contain fields which are not displayed and are passed as input to the next invocation of the handler. This allows passing state from one invocation of the handler to the next one. Finally, a note about testing and debugging CGI scripts: this is unfortunately not as straightforward as it could be. Useful techniques include carefully checking permissions, looking at the data logs of the server, replacing predicates such as get_form_... with versions that print what is really being received, etc. 16 D. Cabeza and M. Hermenegildo 8 Templates A problem in the previous programs is that the layout of the output page is not easily configurable –it is hard-coded in the source and can only be changed by modifying the program. This is something that a normal user (or even an expert programmer if the size of the program is large) may not want to do. In order to address this, PiLLoW provides a facility for reading in “HTML templates” (also XML templates), and converting them into a term format in which it is very natural to manipulate them. An HTML template is a file which contains standard HTML code, but in which “slots” can be defined and given an identifier by means of a special tag. These slots represent parts of the HTML code in which other HTML code can be inserted. Once the HTML template is read by PiLLoW, such slots appear as free logic variables in the corresponding PiLLoW terms. In this way, the user can define a layout with an HTML editor of choice, taking care of marking the “left out” parts with given names. These parts will then be filled appropriately by the program. The functionality associated with parsing such terms is encapsulated in the following predicate: html_template(Chars, Terms, Dict ) Parses the string Chars as the contents of an HTML template and unifies Terms with the list of HTML terms comprised in the template, substituting occurrences of the special tag <V>name</V> with prolog variables. Dict is instantiated to the dictionary of such substitutions, as a list of name=Variable pairs. In the following example a template file called TlfDB.html is assumed to hold the formatting of the output page, defining an HTML variable called “response” which will be substituted by the response of the CGI program. Note that the predicate file_to_string/2 (defined in Ciao library file_utils) reads a file and returns in its second argument the contents of the file as a list of character codes. Note also that calling html_template/3 with the third argument instantiated to [response = Response] has the effect of instantiating the “slot” in HTML_terms to the contents of Response (this makes use of the fact that there is only one slot on the template; normally, a call to member/2 is used to locate the appropriate name=Variable pair). #!/usr/local/bin/ciao-shell :- include(library(pillow)). :- use_module(library(file_utils)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), file_to_string(’TlfDB.html’, Contents), html_template(Contents, HTML_terms, [response = Response]), output_html([cgi_reply|HTML_terms]). Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 17 response(Name, Response) :form_empty_value(Name) -> Response = [] ; phone(Name, Phone) -> Response = [’Telephone number of ’,b(Name),’: ’,Phone,$] ; Response = [’No telephone number available for ’,b(Name),’.’,$]. phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). An example of the contents of the template file could be: <HTML><HEAD><TITLE>Telephone database</TITLE></HEAD> <BODY background="bg.gif"> <IMG src="phone.gif"> <H2>Telephone database</H2> <HR> <V>response</V> <FORM method="POST"> Click here, enter name of clip member, and press Return:<BR> <INPUT type="text" name="person_name" size="20"></FORM> </BODY> </HTML> 9 Accessing WWW documents The facilities presented in the previous sections allow generating HTML documents, including forms, and handling the input coming from forms. In many applications such as search tools, content analyzers, etc., it is also desirable to be able to access documents on the Internet. Such access is generally accomplished through protocols such as FTP and HTTP which are built on top of TCP/IP. In LP/CLP systems which have TCP/IP connectivity (i.e., a sockets/ports interface) the required protocols can be easily coded in the source language using such facilities and DCG parsers. At present, only the HTTP protocol is supported by PiLLoW. As with HTML code, the library uses an internal representation of Uniform Resource Locators (URLs), to be able to manipulate them easily, and provides predicates which translate between the internal representation and the textual form. The facilities provided by PiLLoW for accessing WWW documents include the following predicates: url_info(URL,Info ) Translates a URL URL to an internal structure Info which details its various components and vice-versa. For now non-HTTP URLs make the predicate fail. E.g. url_info(’http://www.foo.com/bar/scooby.txt’,Info) gives Info = http(’www.foo.com’,80,"/bar/scooby.txt"), url_info(URL, http(’www.foo.com’,2000,"/bar/scooby.txt") gives URL = "http://www.foo.com:2000/bar/scooby.txt" (a string). 18 D. Cabeza and M. Hermenegildo url_info_relative(URL,BaseInfo,Info ) Translates a relative URL URL which appears in the HTML page referred to by BaseInfo (given as an url_info structure) to a complete url_info structure Info. Absolute URLs are translated as with the previous predicate. E.g. url_info_relative("/guu/intro.html", http(’www.foo.com’,80,"/bar/scoob.html"), Info) gives Info = http(’www.foo.com’,80,"/guu/intro.html") url_info_relative("dadu.html", http(’www.foo.com’,80,"/bar/scoob.html"), Info) gives Info = http(’www.foo.com’,80,"/bar/dadu.html"). url_query(Dic,Args ) Translates a list of attribute=value pairs Dic (in the same form as the dictionary returned by get_form_input/1) to a string Args for appending to a URL pointing to a form handler. fetch_url(URL,Request,Response ) Fetches a document from the Internet. URL is the Uniform Resource Locator of the document, given as a url_info structure. Request is a list of options which specify the parameters of the request, Response is a list which includes the parameters of the response. The request parameters available include: head To specify that we are only interested in the header. timeout(Time ) Time specifies the maximum period of time (in seconds) to wait for a response. The predicate fails on timeout. if_modified_since(Date ) Get document only if newer than Date. An example of a structure that represents a date is date(’Tuesday’,15,’January’,1985,’06:14:02’). user_agent(Name ) Provide a user-agent field. authorization(Scheme,Params ) Provides an authentication field when accessing restricted sites. name (Param ) Any other functor translates to a field of the same name (e.g. from(’user@machine’)). The parameters which can be returned in the response list include (see the HTTP/1.0 definition for more information): content(Content ) Returns in Content the actual document text, as a list of characters. status(Type,Code,Phrase ) Gives the status of the response. Type can be any of informational, success, redirection, request_error, server_error or extension_code, Code is the status code and Phrase is a textual explanation of the status. pragma(Data ) Miscellaneous data. message_date(Date ) The time at which the message was sent. location(URL ) The document has moved to this URL. http_server(Server ) Identifies the server responding. allow(methods ) List of methods allowed by the server. last_modified(Date ) Date/time at which the sender believes the resource was last modified. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 19 expires(Date ) Date/time after which the entity should be considered stale. content_type(Type,Subtype,Params ) Returns the MIME type/subtype of the document. content_encoding(Type ) Encoding of the document (if any). content_length(Length ) Length is the size of the document, in bytes. authenticate(Challenges ) Request for authentication. html2terms(Chars,Terms ) We have already explained how this predicate transforms HTML terms to HTML format. Used the other way around it can parse HTML code, for example retrieved by fetch_url. The resulting list of HTML terms Terms is normalized: it contains only comment/1, declare/1, env/3 and $/2 structures. For example, a simple fetch of a document can be done as follows: url_info(’http://www.foo.com’,UI), fetch_url(UI,[],R), member(content(C),R), html2terms(C, HTML_Terms). Note that if an error occurs (the document does not exist or has moved, for example) this will simply fail. The following call retrieves a document if it has been modified since October 6, 1999: fetch_url(http(’www.foo.com’,80,"/doc.html"), [if_modified_since(’Wednesday’,6,’October’,1999,’00:00:00’)], R). This last one retrieves the header of a document (with a timeout of 10 seconds) to get its last modified date: fetch_url(http(’www.foo.com’,80,"/last_news.html"), [head,timeout(10)],R), member(last_modified(Date),R). The following is a simple application illustrating the use of fetch_url and html2terms. The example defines check_links(URL,BadLinks ). The predicate fetches the HTML document pointed to by URL and scours it to check for links which produce errors when followed. The list BadLinks contains all the bad links found, stored as compound terms of the form: badlink(Link,Error) where Link is the problematic link and Error is the error explanation given by the server. check_links(URL,BadLinks) :url_info(URL,URLInfo), fetch_url(URLInfo,[],Response), member(content_type(text,html,_),Response), member(content(Content),Response), html2terms(Content,Terms), check_source_links(Terms,URLInfo,[],BadLinks). check_source_links([],_,BL,BL). check_source_links([E|Es],BaseURL,BL0,BL) :- 20 D. Cabeza and M. Hermenegildo check_source_links1(E,BaseURL,BL0,BL1), check_source_links(Es,BaseURL,BL1,BL). check_source_links1(env(a,AnchorAtts,_),BaseURL,BL0,BL) :member((href=URL),AnchorAtts), !, check_link(URL,BaseURL,BL0,BL). check_source_links1(env(_Name,_Atts,Env_html),BaseURL,BL0,BL) :- !, check_source_links(Env_html,BaseURL,BL0,BL). check_source_links1(_,_,BL,BL). check_link(URL,BaseURL,BL0,BL) :url_info_relative(URL,BaseURL,URLInfo), !, fetch_url_status(URLInfo,Status,Phrase), ( Status \== success -> name(P,Phrase), name(U,URL), BL = [badlink(U,P)|BL0] ; BL = BL0 ). check_link(_,_,BL,BL). fetch_url_status(URL,Status,Phrase) :fetch_url(URL,[head,timeout(20)],Response), !, member(status(Status,_,Phrase),Response). fetch_url_status(_,timeout,"Timeout"). 10 Providing Code Through the WWW A facility which can be easily built on top of the primitives presented so far is that of “remote WWW modules,” i.e., program modules which reside on the net at a particular HTTP address in the same way that normal program modules reside in a particular location in the local file system. This allows for example always fetching the most recent version of a given library (e.g., PiLLoW) when a program is compiled. For example, the form handler of Section 6.1, if rewritten as #!/usr/local/bin/ciao-shell :- use_module(’http://www.clip.dia.fi.upm.es/lib/pillow.pl’). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), ... would load the current version of the library each time it is executed. This generalized module declaration is just syntactic sugar, using expand_term, for a document Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 21 www.xxx.yyy <form action="http://www.xxx.yyy/am_inter.cgi"> HTTP Server 2 1 WWW Browser form data 8 3 form reply 4 7 5 Active Module am_inter 6 predicate(Arg1,Arg2,...,ArgN) Fig. 3. The Forms Interface using Active Modules fetch, using fetch_url, followed by a standard use_module declaration. It is obviously interesting to combine this facility with caching strategies. An interesting (and straightforward to implement) additional feature is to fetch remote byte-code (as generally done by use_module), if available, but this is only possible if the two systems use the same byte-code (this can normally be checked easily in the bytecode itself). Also, it may be interesting to combine this type of code downloading with WWW document accesses, so that code is downloaded automatically when a particular document is fetched. This issue is addressed in Section 12. Finally, there are obvious security issues related to downloading code in general, which can be addressed with standard techniques such as security signatures. 11 A High-Level Model of Client-Server Interaction: Active Modules Despite its power, the cgi-bin interface also has some shortcomings. The most serious is perhaps the fact that the handler is started and expected to terminate for each interaction. This has two disadvantages. First, no state is preserved from one query to the next. However, as mentioned before, this can be fixed by passing the state through the form (using hidden fields), by saving it in a temporary file at the server side, by using “cookies”, etc. Second, and more importantly, starting and stopping the application may be inefficient. For example, if the idea is to query a large database or a natural language understanding system, it may take a long time to start and stop the system. In order to avoid this we propose an alternative architecture for cgi-bin applications (a similar idea, although not based on the idea of active modules, has been proposed independently by Ken Bowen (Bowen, 1996)). The basic idea is illustrated in Figure 3. The operation is identical to that of standard form handlers, as illustrated in Figure 2, up to step 3. In this step, the handler started is not the application itself, but rather an interface to the actual application, which is running continuously and thus contains state. Thus, only the 22 D. Cabeza and M. Hermenegildo interface is started and stopped with every transaction. The interface simply passes the form input received from the server (4) to the running application (5) and then forwards the output from the application (6) to the server before terminating, while the application itself continues running. Both the interface and the application can be written in LP/CLP, using the predicates presented. The interface can be a simple script, while the application itself will be typically compiled. An interesting issue is that of communication between interface and application. This can of course be done through sockets. However, as a cleaner and much simpler alternative, the concept of active modules (Cabeza & Hermenegildo, 1995) can be used to advantage in this application. An active module (or an active object, if modularity is implemented via objects) is an ordinary module to which computational resources are attached (for example, a process on a UNIX machine), and which resides at a given (socket) address on the network.5 Compiling an active module produces an executable which, when running, acts as a server for a number of relations, which are the predicates exported by the module. The relations exported by the active module can be accessed by any program on the network by simply “loading” the module and thus importing such “remote relations.” The idea is that the process of loading an active module does not involve transferring any code, but rather setting up things so that calls in the local module are executed as remote procedure calls to the active module, possibly over the network. Except for compiling it in a special way, an active module is identical from the programmer point of view to an ordinary module. Also, a program using an active module imports it and uses it in the same way as any other module, except that it uses “use_active_module” rather than “use_module” (see below). Also, an active module has an address (network address) which must be known in order to use it. The address can be announced by the active module when it is started via a file or a name server (which would be itself another active module with a fixed address). We now present the constructs related to active modules in Ciao: :- use_active_module(Module,Predicates ) A declaration used to import the predicates in the list Predicates from the active module Module . From this point on, the code should be written as if a standard use_module/2 declaration had been used. The declaration needs the following predicate to be accessible from the module. module_address(Module,Address ) This predicate must return in Address the address of Module , for any active module imported in the code. There are a number of standard libraries defining versions of this predicate. save_addr_actmod(Address ) This predicate should define a way to publish Address , to be used in active modules (the name of the active module is taken as the name of the current executable). There are a number of standard libraries defining versions of this predicate, which are in correspondence with the libraries which define versions of the previous predicate. 5 It is also possible to provide active modules via a WWW address. However, we find it more straightforward to simply use socket addresses. In any case, this is generally hidden inside the access method and can be thus made transparent to the user. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 23 make_actmod(ModuleFile,PublishModule ) Makes an active module executable from the module residing in ModuleFile , using address publish module of name PublishModule . When the executable is run (for example, at the operating system level by “Module &”), a socket is created and the hook predicate save_addr_actmod/1 mentioned above (which is supposed to be defined in PublishModule ) is called in order to export the active module address as required. Then, a standard driver is run to attend network requests for the module exported predicates. Note that the code of ModuleFile does not need to be written in any special way. This scheme is very flexible, allowing to completely configure the way active modules are located. This is accomplished by writing a pair of libraries, one defining the way an active module address is published, and a second defining the way the address of a given active module is found. For example, the Ciao standard libraries include as an example an implementation (libraries filebased_publish and filebased_locate) which uses a directory accessible by all the involved machines (via NFS) to store the addresses of the active modules, and the module_address/2 predicate examines this directory to find the required data. Other solutions provided as examples include posting the address at a WWW address (webbased_publish / webbased_locate), and an implementation of a name server, that is, another active module (this one with a known, fixed address) that records the addresses of active modules and supplies this data to the modules that import it, serving as a contact agency between servers and clients. From the implementation point of view, active modules are essentially daemons: Prolog executables which are started as independent processes at the operating system level. In the Ciao system library, communication with active modules is implemented using sockets (thus, the address of an active module is a UNIX socket in a machine). Requests to execute goals in the module are sent through the socket by remote programs. When such a request arrives, the process running the active module takes it and executes it, returning through the socket the computed results. These results are then taken by the remote processes. Thus, when the compiler finds a use_active_module declaration, it defines the imported predicates as remote calls to the active module. For example, if the predicate P is imported from the active module M , the predicate would be defined as P :- module_address(M,A), remote_call(A,P ) Compiling the following code as an active module, by writing at the Ciao toplevel “make_actmod(phone_db, ’actmods/filebased_publish’)” (or, using the standalone compiler, by executing “ciaoc -a ’actmods/filebased_publish’ phone_db”), creates an executable phone_db which, when started as a process (for example, by typing “phone_db &” at a UNIX shell prompt) saves its address (i.e., that of its socket) in file phone_db.addr and waits for queries from any module which “imports” this module (it also provides a predicate to dynamically add information to the database): :- module(phone_db,[response/2,add_phone/2]). 24 D. Cabeza and M. Hermenegildo response(Name, Response) :form_empty_value(Name) -> Response = ’You have to provide a name.’ ; phone(Name, Phone) -> Response = [’Telephone number of ’,b(Name),’: ’,Phone] ; Response = [’No telephone number available for ’,b(Name),’.’]. add_phone(Name, Phone) :assert(phone(Name, Phone)). :- dynamic phone/2. phone(daniel, ’336-7448’). phone(manuel, ’336-7435’). phone(sacha, ’543-5316’). The following simple script can be used as a cgi-bin executable which will be the active module interface for the previous active module. When started, it will process the form input, issue a call to response/2 (which will be automatically handled by the phone_db active module), and produce a new form before terminating. It will locate the address of the phone_db active module via the module_address/2 predicate defined in library ’actmods/filebased_locate’. #!/usr/local/bin/ciao-shell :- use_active_module(phone_db,[response/2]). :- use_module(library(’actmods/filebased_locate’)). :- include(library(pillow)). main(_) :get_form_input(Input), get_form_value(Input,person_name,Name), response(Name,Response), output_html([ cgi_reply, start, title(’Telephone database’), image(’phone.gif’), heading(2,’Telephone database’), --, Response, $, start_form, ’Click here, enter name of clip member, and press Return:’, Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 25 \\, input(text,[name=person_name,size=20]), end_form, end]). There are many enhancements to this simple schema which, for brevity, are only sketched here. One is to add concurrency to the active module (or whatever means of handling the client-server interaction is being used), in order to handle queries from different clients concurrently. This is easy to do in systems that support concurrency natively, such as Ciao, BinProlog/µ2-Prolog, AKL, Oz, and KL1. We feel that Ciao can offer advantages in this area because it offers compatibility with Prolog and CLP systems while at the same time efficiently supporting concurrent execution of clause goals via local or distributed threads (Carro & Hermenegildo, 1999). Such goals can communicate at different levels of abstraction: sockets/ports, the shared fact database (similarly to a blackboard), or shared variables. BinProlog/µ2Prolog also supports threads, with somewhat different communication mechanisms (Tarau, 1996; De Bosschere, 1989). Finally, as shown in (Szeredi et al., 1996), it is also possible to exploit the concurrency present in or-parallel Prolog systems such as Aurora for implementing a multitasking server. It is also interesting to set up things so that a single active module can handle different forms. This can be done even dynamically (i.e., the capabilities of the active module are augmented on the fly, being able to handle a new form), by designating a directory in which code to be loaded by the active module would be put, the active module consulting the directory periodically to increase its functionalities. Finally, another important issue that has not been addressed is that of providing security, i.e., ensuring that only allowed clients connect to the active module. As in the case of remote code downloading, standard forms of authentication based on codes can be used. 12 Automatic Code Downloading and Local Execution In this section we describe an architecture which, using only the facilities we have presented in previous sections, allows the downloading and local execution of Prolog (or other LP/CLP) code by accessing a WWW address, without requiring a special browser. This is a complementary approach to giving WWW access to an active module in the sense that it provides code which will be executed in the client machine (à la Java). More concretely, the functionality that we desire is that by simply clicking on a WWW pointer, and transparently for the user, remote Prolog code is automatically downloaded in such a way that it can be queried via forms and all the processing is done locally. To allow this, the HTTP server on the server machine is configured to give a specific mime.type (for example application/x-prolog) to the files which will hold WWW-downloadable Prolog code (for example those with a special suffix, like .wpl). On the other side, the browser is configured to start the wpl_handler helper application when receiving data of type application/x-prolog. This wpl_handler 26 D. Cabeza and M. Hermenegildo <form action="http://localhost/wpl_questioner.cgi"> www.xxx.yyy WWW Browser http://www.xxx.yyy/app.wpl form data /tmp/x1349 form reply 1 app.wpl 2 11 wpl_handler /tmp/x1349 7 8 wpl_handler loaded wpl_questioner 3 ? 6 4 10 9 5 FormReply Active Module code FormData answerform(FormData, FormReply) loadcode(’/tmp/x1349’) Fig. 4. Automatic code downloading architecture application is the interface to a Prolog engine which will execute the WWW downloaded code, acting as an active module. We now sketch the procedure (see figure 4): 1. The form that will be used to query the downloaded code (and which we assume already loaded on the browser) contains a link which points to a WWW-aware Prolog code file. Clicking on this link produces the download as explained below. Note that for browsers that can handle multipart/mixed mime types (such as most modern browsers), the form and the code file could alternatively be combined in the same document. However, for brevity, we will only describe the case when they are separate. The handler for the form is specified as the local cgi-bin executable wpl_questioner.cgi. 2. As the server of the file tells the browser that this page is of type application/x-prolog, the browser starts a wpl_handler and passes the file to it (in this example by saving the file in a temporal directory and passing its name). 3. The wpl_handler process checks whether a Prolog engine is currently running for this browser and, if necessary, starts one. This Prolog engine is configured as an active module. 4. Then, through a call to a predicate of the active module “loadcode(File )” the handler asks the active module to read the code. 5. The active module reads the code and compiles it. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 27 6. wpl_handler waits for the active module to complete the compilation and writes a “done” message to the browser. 7. The browser receives the “done” message. 8. Now, when the “submit” button in the form is pressed, and following the standard procedure for forms, the browser starts a wpl_questioner process, sending it the form data. 9. The wpl_questioner process gets this form data, translates it to a dictionary FormData and passes it to the active module through a call to its exported predicate answerform(FormData,FormReply ). 10. The active module processes this request, and returns in FormReply a WWW page (as a term) which contains the answer to it (and possibly a new form). 11. The wpl_questioner process translates FormReply to raw HTML and gives it back to the browser, dying afterwards. Subsequent queries to the active module can be accomplished either by going back to the previous page (using the “back” button present in many browsers) or, if the answer page contains a new query form, by using it. In any case, the procedure continues at 8. The net effect of the approach is that by simply clicking on a WWW pointer, remote Prolog code is automatically downloaded to a local Prolog engine. Queries posed via the form are answered locally by the Prolog engine. There are obvious security issues that need to be taken care of in this architecture. Again, standard authentication techniques can be used. However, since source code is being passed around, it is comparatively easy to verify that no dangerous predicates (for example, perhaps those that can access files) are executed. Note again that it is also possible to download bytecode, since this is supported by most current LP/CLP systems, using a similar approach. 13 Related Work Previous general purpose work on WWW programming using computational logic systems includes, to the best of our knowledge, the publicly available html.pl library (Cabeza & Hermenegildo, 1996a) and manual, and the LogicWeb system (Loke & Davison, 1996) (the PiLLoW library was also described previously in (Cabeza et al., 1996)). The html.pl library was built by D. Cabeza and M. Hermenegildo, using input from L. Naish’s forms code for NU-Prolog and M. Hermenegildo and F. Bueno’s experiments building a WWW interface to the CHAT80 (Warren & Pereira, 1982) program. It was released as a publicly available WWW library for LP/CLP systems and announced, among other places, in the Internet comp.lang.prolog newsgroup (Cabeza & Hermenegildo, 1996b). The library has since been ported to a large number of systems and adapted by several Prolog vendors, as well as used by different programmers in various institutions. In particular, Ken Bowen has ported the library to ALS Prolog and extended it to provide group processing of forms and an alternative to our use of active modules (Bowen, 1996). The present work is essentially a significant extension of the html.pl library. The main other previous body of work related to general-purpose interfacing of 28 D. Cabeza and M. Hermenegildo logic programming and the WWW that we have knowledge of is the LogicWeb (Loke & Davison, 1996) system, by S.W. Loke and A. Davison. The aim of LogicWeb is to use logic programming to extend the concept of WWW pages, incorporating in them programmable behavior and state. In this, it shares goals with Java. It also offers rich primitives for accessing code in remote pages and module structuring. The aims of LogicWeb are different from those of html.pl/PiLLoW. LogicWeb is presented as a system itself, and its implementation is done through a tight integration with the Mosaic browser, making use of special features of this browser. In contrast, html.pl/PiLLoW is a general purpose library, meant to be used by a general computational logic systems and is browser-independent. html.pl/PiLLoW offers a wide range of functionalities, such as syntax conversion between HTML and logic terms, access predicates for WWW pages, predicates for handling forms, etc., which are generally at a somewhat lower level of abstraction than those of LogicWeb. We believe that using PiLLoW and the ideas sketched in this paper it is possible to add the quite interesting functionality offered by LogicWeb to standard LP and CLP systems. We have shown some examples including access to passive remote code (modules with an ftp or http address) from programs and automatic remote code access and querying using standard browsers and forms. In addition, we have discussed active remote code, where the functionality, rather than the code itself, is exported. More recently, a larger body of work on the topic was presented at the workshop held on the topic of Logic Programming and the Internet at the 1996 Joint International Conference and Symposium on Logic Programming (where also a previous version of this paper was presented). The work presented in (S.W. Loke & Sterling, 1996) is based on LogicWeb, and aims to provide distributed lightweight databases on the WWW. As with the basic LogicWeb system, we believe that the PiLLoW library can be used to implement in other systems the interesting ideas proposed therein. As briefly mentioned before, the work in (Szeredi et al., 1996) proposes an architecture similar to that of our active modules in order to handle form requests. In this solution the handling multiple requests is performed by using or-parallelism. While we feel that and-parallelism (as in &-Prolog’s or Ciao’s threads) is more natural for modeling this kind of concurrency, the ideas proposed are quite interesting. The ECLiPSe HTTP-library (Ph. Bonnet & Thomsen, 1996), aimed at implementing INTERNET agents, offers functionality that is in part similar to that of the Ciao html.pl/PiLLoW libraries, including facilities that are similar to our active modules. The approach is different, however, in several respects. The ECLiPSe library implements special HTTP servers and clients. In contrast, PiLLoW uses standard HTTP servers and interfaces. Using special purpose servers may be interesting because the approach possibly allows greater functionality. On the other hand this approach in general requires either the substitution of the standard server on a given machine or setting the special server at a different socket address from the standard one. The ECLiPSe library also contains functionality that is related to our active modules, although the interface provided is at a lower level. Finally, other papers describing very interesting WWW applications are being presented regularly, which underline the suitability of Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 29 computational logic systems for the task. We believe that the Ciao PiLLoW library can contribute to making it even easier to develop such applications in the future. Additional work on the topic of Logic Programming and the Internet can be found in the proceedings of the workshop sponsored by the CompulogNet research network. The reader is referred to the tutorials and papers presented in these two workshops for more information on a number of applications, other libraries, and topics such as interfacing and compilation from computational logic systems to Java. Examples of Prolog systems interfaced with Java are BinProlog (see http://clement.info.umoncton.ca/BinProlog), Ciao (Bueno et al., 1997), and others (Calejo, 1999). Experimental Prolog to Java compilers have been built both in academia (see for example jProlog at http://www.cs.kuleuven.ac.be/~bmd/PrologInJava/) and Commercially (see for example the IF Prolog tools http://www.ifcomputer.com). This approach is quite attractive, although the results cannot compete in performance with conventional Prolog compilers (it is open for research whether improvements in Java performance or improved Prolog-to-Java compilation technology can bridge the gap). Other commercial work on the topic of interfacing Prolog and the WWW (in addition to that done on the ALS system mentioned above) include the Amzi! Prolog WebLS System (http://www.amzi.com/share.htm ) and the LPA PrologWeb System (http://www.lpa.co.uk ). Recent work using PiLLoW includes the “Web Integrator”(Davulcu et al., 1999) –a webbase system that integrates data from various Web sources, and allows users to query these Web sources as if they were a single database– and WebDB (Cabeza & Hermenegildo, 1998) –a WWW-based database management interface. Also, within the RadioWeb project (Partners, 1997), we have developed (in collaboration with the group of M. Codish at Ben Gurion University) a constraint-based language for describing WWW page layout and style rules and an engine which, by interpreting these rules, can generate WWW sites which dynamically adapt to parameters such as user characteristics (Cederberg & CLIP Group, 1999). Additional applications developed with the PiLLoW library can be accessed from the PiLLoW WWW site (see later). A page with pointers to the proceedings of the previously mentioned workshops, as well as other information (including technical reports and tutorial) regarding the topic of Logic Programming, Constraint Programming, and the Internet is maintained at http://www.clip.dia.fi.upm.es/lpnet/. 14 Conclusions and Future Work We have discussed from a practical point of view a number of issues involved in writing Internet and WWW applications using LP/CLP systems. In doing so, we have described PiLLoW, an Internet/WWW programming library for LP/CLP systems. PiLLoW provides facilities for generating HTML/XML structured documents, producing HTML forms, writing form handlers, processing HTML/XML templates, accessing and parsing WWW documents, and accessing code posted at HTTP addresses. We have also described the architecture of some application 30 D. Cabeza and M. Hermenegildo classes, including automatic code downloading, using a high-level model of clientserver interaction, active modules. Finally we have also described an architecture for automatic LP/CLP code downloading for local execution, using generic browsers. We believe that the Ciao PiLLoW library can ease substantially the process of developing WWW applications using computational logic systems. We have recently developed several extensions to the library (for example, for setting and getting “cookies”), and sample applications which make extensive use of concurrency (on those LP/CLP systems that support it) to overlap network requests. We have also developed a complementary library for interfacing Prolog with the Virtual Reality Modeling Language VRML (Smedbäck et al., 1999). In addition to being included as part of the Ciao system, the PiLLoW library is provided as a standard, standalone public domain library for SICStus Prolog and other Prolog and CLP systems, supporting most of its functionality. Please contact the authors or consult our WWW site http://www.clip.dia.fi.upm.es and the PiLLoW page at http://www.clip.dia.fi.upm.es/Software/pillow/pillow.html for download details and an up-to-date online version of the PiLLoW manual. The Ciao Prolog system is also freely available from http://www.clip.dia.fi.upm.es and http://www.ciaoprolog.org. Acknowledgments The authors would like to thank Lee Naish, Mats Carlsson, Tony Beaumont, Ken Bowen, Michael Codish, Markus Fromherz, Paul Tarau, Andrew Davison, and Koen De Bosschere for useful feedback on previous versions of this document and the PiLLoW code. The first versions of the Ciao system and the html.pl library were developed under partial support from the ACCLAIM ESPRIT project. Subsequent development has occurred in the context of MCYT projects “ELLA” and “EDIPIA” (MCYT TIC99-1151), ESPRIT project RADIOWEB, and NSF/CICYT collaboration “ECCOSIC” (Fulbright 98059). References Berners-Lee, T., Cailliau, R., Luotonen, A., Nielsen, H.F., & Secret, A. (1994). The World-Wide Web. Communications of the ACM, 37(8), 76–82. Bowen, K. 1996 (March). Personal communication. Available from http://www.als.com/als/html_pl.html. Bueno, F., Cabeza, D., Carro, M., Hermenegildo, M., López-Garcı́a, P., & Puebla, G. 1997 (August). The Ciao Prolog System. Reference Manual. The Ciao System Documentation Series–TR CLIP3/97.1. School of Computer Science, Technical University of Madrid (UPM). Cabeza, D., & Hermenegildo, M. (1995). Distributed Concurrent Constraint Execution in the CIAO System. Proc. of the 1995 compulog-net workshop on parallelism and implementation technologies. Utrecht, NL: U. Utrecht / T.U. Madrid. Available from http://www.clip.dia.fi.upm.es/. Cabeza, D., & Hermenegildo, M. 1996a (March). html.pl: An HTML package for (C)LP systems. Spain. Available from http://www.clip.dia.fi.upm.es/miscdocs/. Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 31 Cabeza, D., & Hermenegildo, M. 1996b (February). LP/CLP HTML and WWW interface publicly available. Posting in comp.lang.prolog. Available from http://www.clip.dia.fi.upm.es/. Cabeza, D., & Hermenegildo, M. 1997 (April). WWW Programming using Computational Logic Systems (and the PiLLoW/Ciao Library). Proceedings of the workshop on logic programming and the WWW at WWW6. Cabeza, D., & Hermenegildo, M. 1998 (June). A WWW Database Management Interface for Prolog. Technical Report CLIP2/98.0. School of Computer Science, Technical University of Madrid (UPM), Facultad Informática UPM, 28660-Boadilla del Monte, Madrid-Spain. Cabeza, D., Hermenegildo, M., & Varma, S. 1996 (September). The PiLLoW/Ciao Library for INTERNET/WWW Programming using Computational Logic Systems. Proceedings of the 1st workshop on logic programming tools for internet applications. Available from http://clement.info.umoncton.ca/~lpnet. Calejo, M. (1999). Java+prolog: A land of opportunities. Pages 1–2 of: Proceedings of the first international conference on the practical application of constraint technologies and logic programming. The Practical Application Company Ltd. Also available at http://dev.servisoft.pt/interprolog/paclp99/default.htm. Carlsson, M. 1988 (February). Sicstus Prolog User’s Manual. Po Box 1263, S-16313 Spanga, Sweden. Carro, M., & Hermenegildo, M. (1999). Concurrency in Prolog Using Threads and a Shared Database. Pages 320–334 of: 1999 international conference on logic programming. MIT Press, Cambridge, MA, U.S.A. Cederberg, Per, & CLIP Group, The. 1999 (June). Flexible Layout and Styling – The LaSt Language. Technical Report D2.2.M3 CLIP 3/99.0. RADIOWEB Project. Chikayama, T., Fujise, T., & Sekita, D. (1994). A Portable and Efficient Implementation of KL1. Tick, Evan (ed), Proc. of the 1994 icot/nsf workshop on parallel and concurrent programming. U. of Oregon. Colmerauer, A. (1975). Les gramaire de metamorphose. Tech. rept. Univ. D’aix-Marseille, Groupe De Ia. Colmerauer, A. (1990). An Introduction to Prolog III. Communications of the ACM, 28(4), 412–418. Davulcu, Hasan, Freire, Juliana, Kifer, Michael, & Ramakrishnan, I.V. 1999 (June). A layered architecture for querying dynamic web content. ACM SIGMOD international conference on management of data. URL: http://www.acm.org/sigmod/sigmod99/eproceedings/. De Bosschere, K. (1989). Multi–Prolog, Another Approach for Parallelizing Prolog. Pages 443–448 of: Proceedings of parallel computing. Elsevier, North Holland. ECRC. (1993). Eclipse user’s guide. European Computer Research Center. Grobe, M., & Naseer, Hasan. 1998 (July). An instantaneous introduction to CGI scripts and HTML forms. Available from http://www.cc.ukans.edu/~acs/docs/other/forms-intro.shtml. Hermenegildo, M. 1996 (April). Writing “Shell Scripts” in SICStus Prolog. Posting in comp.lang.prolog. Available from http://www.clip.dia.fi.upm.es/. Hermenegildo, M., & CLIP Group, The. (1994). Some Methodological Issues in the Design of CIAO - A Generic, Parallel, Concurrent Constraint System. Pages 123–133 of: Principles and practice of constraint programming. LNCS, no. 874. Springer-Verlag. Hermenegildo, M., Bueno, F., Garcı́a de la Banda, M., & Puebla, G. 1995a (December). The CIAO Multi-Dialect Compiler and System: An Experimentation Workbench for 32 D. Cabeza and M. Hermenegildo Future (C)LP Systems. Proceedings of the ilps’95 workshop on visions for the future of logic programming. Available from http://www.clip.dia.fi.upm.es/. Hermenegildo, M., Cabeza, D., & Carro, M. (1995b). Using Attributed Variables in the Implementation of Concurrent and Parallel Logic Programming Systems. Pages 631– 645 of: Proc. of the twelfth international conference on logic programming. MIT Press. Hermenegildo, M., Bueno, F., Cabeza, D., Carro, M., M. Garcı́a de la Banda, LópezGarcı́a, P., & Puebla, G. (1999a). The CIAO Multi-Dialect Compiler and System: An Experimentation Workbench for Future (C)LP Systems. Pages 65–85 of: Parallelism and Implementation of Logic and Constraint Logic Programming. Commack, NY, USA: Nova Science. Hermenegildo, M., Puebla, G., & Bueno, F. (1999b). Using Global Analysis, Partial Specifications, and an Extensible Assertion Language for Program Validation and Debugging. Pages 161–192 of: Apt, K. R., Marek, V., Truszczynski, M., & Warren, D. S. (eds), The Logic Programming Paradigm: a 25–Year Perspective. Springer-Verlag. Jaffar, Joxan, & Lassez, Jean-Louis. (1987). Constraint Logic Programming. Pages 111– 119 of: ACM symposium on principles of programming languages. ACM. Janson, S., & Haridi, S. (1991). Programming Paradigms of the Andorra Kernel Language. Pages 167–183 of: 1991 international logic programming symposium. MIT Press. Kowalski, R. A. (1974). Predicate Logic as a Programming Language. Pages 569–574 of: Proceedings ifips. Loke, S.W., & Davison, A. (1996). Logic programming with the World-Wide Web. Pages 235–245 of: 7th. ACM Conference on Hypertext. ACM Press. Available from http://www.cs.unc.edu/~barman/HT96/P14/lpwww.html. M. Dincbas, H. Simonis, & Van Hentenryck, P. (1990). Solving Large Combinatorial Problems in Logic Programming. Journal of logic programming, 8(1 & 2), 72–93. Partners, The RADIOWEB Project. 1997 (July). RADIOWEB EP25562: Automatic Generation of Web Sites for the Radio Brodcasting Industry – Project Description / Technical Annex. Technical Report. RADIOWEB Project. Ph. Bonnet, S. Bressan, L. Leth, & Thomsen, B. 1996 (September). Towards ECLiPSe Agents on the INTERNET. Proceedings of the 1st workshop on logic programming tools for internet applications. Available from http://clement.info.umoncton.ca/~lpnet/lpnet2.html. Smedbäck, G., Carro, M., & Hermenegildo, M. (1999). Interfacing Prolog and VRML and its Application to Constraint Visualization. Pages 453–471 of: The practical application of constraint technologies and logic programming. The Practical Application Company. Smolka, G. 1994 (November). The Definition of Kernel Oz. DFKI Oz documentation series. German Research Center for Artificial Intelligence (DFKI). S.W. Loke, A. Davison, & Sterling, L. 1996 (September). Lightweight Deductive Databases on the World-Wide Web. Proceedings of the 1st workshop on logic programming tools for internet applications. Available from http://clement.info.umoncton.ca/~lpnet/lpnet10.html. Szeredi, Péter, Molnár, Katalin, & Scott, Rob. 1996 (September). Serving Multiple HTML Clients from a Prolog Application. Proceedings of the 1st workshop on logic programming tools for internet applications. Available from http://clement.info.umoncton.ca/~lpnet/lpnet9.html. Tarau, P. 1996 (April). Binprolog 5.00. Posting in comp.lang.prolog. Available from http://clement.info.umoncton.ca/~tarau. Van Hentenryck, P. (1989). Constraint Satisfaction in Logic Programming. MIT Press. Warren, D.H.D., & Pereira, F. C. N. (1982). An Efficient, Easily Adaptable System For Distributed WWW Programming using (Ciao-)Prolog and the PiLLoW lib 33 Interpreting Natural Language Queries. American journal of computational linguistics, 8(3-4), 110–122.
6cs.PL
Call-by-need, neededness and all that⋆ Delia Kesner1 , Alejandro Rı́os2, and Andrés Viso3 arXiv:1801.10519v1 [cs.LO] 31 Jan 2018 1 3 IRIF, CNRS and Univ. Paris-Diderot 2 Universidad de Buenos Aires CONICET and Universidad de Buenos Aires Abstract. We show that call-by-need is observationally equivalent to weak-head needed reduction. The proof of this result uses a semantical argument based on a (non-idempotent) intersection type system called V. Interestingly, system V also allows to syntactically identify all the weak-head needed redexes of a term. 1 Introduction One of the fundamental notions underlying this paper is the one of needed reduction in λ-calculus, which is to be used here to understand (lazy) evaluation of functional programs. Key notions are those of reducible and non-reducible programs: the former are programs (represented by λ-terms) containing nonevaluated subprograms, called reducible expressions (redexes), whereas the latter can be seen as definitive results of computations, called normal forms. It turns out that every reducible program contains a special kind of redex known as needed or, in other words, every λ-term not in normal form contains a needed redex. A redex r is said to be needed in a λ-term t if r has to be contracted (i.e. evaluated) sooner or later when reducing t to normal form, or, informally said, if there is no way of avoiding r to reach a normal form. The needed strategy, which always contracts a needed redex, is normalising [8], i.e. if a term can be reduced (in any way) to a normal form, then contraction of needed redexes necessarily terminates. This is an excellent starting point to design an evaluation strategy, but unfortunately, neededness of a redex is not decidable [8]. As a consequence, real implementations of functional languages cannot be directly based on this notion. Our goal is, however, to establish a clear connection between the semantical notion of neededness and different implementations of lazy functional languages (e.g. Miranda or Haskell). Such implementations are based on call-by-need calculi, pioneered by Wadsworth [19], and extensively studied e.g. in [3]. Indeed, call-by-need calculi fill the gap between the well-known operational semantics of the call-by-name λ-calculus and the actual implementations of lazy functional languages. While call-by-name re-evaluates an argument each time it is used –an operation which is quite expensive– call-by-need can be seen as a memoized version of call-by-name, where the value of an argument is stored the first time it is ⋆ This work was partially founded by LIA INFINIS. evaluated for subsequent uses. For example, if t = ∆ (I I), where ∆ = λx.x x and I = λz.z, then call-by-name duplicates the argument I I, while lazy languages first reduce I I to the value I so that further uses of this argument do not need to evaluate it again. While the notion of needed reduction is defined with respect to (full strong) normal forms, call-by-need calculi evaluate programs to special values called weak-head normal forms, which are either abstractions or arbitrary applications headed by a variable (i.e. terms of the form x t1 . . . tn where t1 . . . tn are arbitrary terms). To overcome this shortfall, we first adapt the notion of needed redex to terms that are not going to be fully reduced to normal forms but only to weakhead normal forms. Thus, informally, a redex r is weak-head needed in a term t if r has to be contracted sooner or later when reducing t to a weak-head normal form. The derived notion of strategy is called a weak-head needed strategy, which always contracts a weak-head needed redex. This paper introduces two independent results about weak-head neededness, both obtained by means of (non-idempotent) intersection types [13,12] (a survey can be found in [9]). We consider, in particular, typing system V [14] and show that it allows to identify all the weak-head needed redexes of a weak-head normalising term. This is done by adapting the classical notion of principal type [16] and proving that a redex in a weak-head normalising term t is weak-head needed iff it is typed in a principally typed derivation for t in V. Our second goal is to show observational equivalence between call-by-need and weak-head needed reduction. Two terms are observationally equivalent when all the empirically testable computations on them are identical. This means that a term t can be evaluated to a weak-head normal form using the call-by-need machinery if and only if the weak-head needed reduction normalises t. By means of system V mentioned so far we use a technique to reason about observational equivalence that is flexible, general and easy to verify or even certify. Indeed, system V provides a semantic argument: first showing that a term t is typable in system V iff it is normalising for the weak-head needed strategy (t ∈ WN whnd ), then by resorting to some results in [14], showing that system V is complete for call-by-name, i.e. a term t is typable in system V iff t is normalising for call-by-name (t ∈ WN name ); and that t is normalising for call-by-name iff t is normalising for call-by-need (t ∈ WN need ). Thus completing the following chain of equivalences: t ∈ WN whnd t typable in V t ∈ WN name t ∈ WN need This leads to the observational equivalence between call-by-need, call-by-name and weak-head needed reduction. Structure of the paper : Sec. 2 introduces preliminary concepts while Sec. 3 defines different notions of needed reduction. The type system V is studied in Sec. 4. Sec 5 extends β-reduction to derivation trees. We show in Sec. 6 how system V identifies weak-head needed redexes, while Sec. 7 gives a characterisation of normalisation for the weak-head needed reduction. Sec. 8 is devoted to define call-by-need. Finally, Sec. 9 presents the observational equivalence result. 2 Preliminaries This section introduces some standard definitions and notions concerning the reduction strategies studied in this paper, that is, call-by-name, head and weakhead reduction, and neededness, this later notion being based on the theory of residuals [7]. 2.1 The Call-By-Name Lambda-Calculus Given a countable infinite set X of variables x, y, z, . . . we consider the following grammar: (Terms) t, u ::= x ∈ X | t u | λx.t (Values) v ::= λx.t (Contexts) C ::=  | C t | t C | λx.C (Name contexts) E ::=  | E t The set of λ-terms is denoted by Ta . We use I, K and Ω to denote the terms λx.x, λx.λy.x and (λx.x x) (λx.x x) respectively. We use Chti (resp. Ehti) for the term obtained by replacing the hole  of C (resp. E) by t. The sets of free and bound variables of a term t, written respectively fv(t) and bv(t), are defined as usual [7]. We work with the standard notion of α-conversion, i.e. renaming of bound variables for abstractions; thus for example λx.x y =α λz.z y. A term of the form (λx.t) u is called a β-redex (or just redex when β is clear from the context) and λx is called the anchor of the redex. The onestep reduction relation →β (resp. →name ) is given by the closure by contexts C (resp. E) of the rewriting rule (λx.t) u 7→β t {x /u }, where { / } denotes the capture-free standard higher-order substitution. Thus, call-by-name forbids reduction inside arguments and λ-abstractions, e.g. (λx.II ) (II) →β (λx.II) I and (λx.II) (II) →β (λx.I) (II) but neither (λx.II) (II) →name (λx.II) I nor (λx.II) (II) →name (λx.I) (II) holds. We write ։β (resp. ։name ) for the reflexivetransitive closure of →β (resp. →name ). 2.2 Head, Weak-Head and Leftmost Reductions In order to introduce different notions of reduction, we start by formalising the general mechanism of reduction which consists in contracting a redex at some specific occurrence. Occurrences are finite words over the alphabet {0, 1}. We use ǫ to denote the empty word and notation an for n ∈ N concatenations of some letter a of the alphabet. The set of occurrences of a given term is def def {ǫ} ∪ {0p | p ∈ oc(t)} ∪ {ǫ}; oc(t u) = defined by induction as follows: oc(x) = def {1p | p ∈ oc(u)}; oc(λx.t) = {ǫ} ∪ {0p | p ∈ oc(t)}. Given two occurrences p and q, we use the notation p ≤ q to mean that p is a prefix of q, i.e. there is p′ such that pp′ = q. We denote by t|p the subterm of t at occurrence p, defined as expected [4], thus for example ((λx.y) z)|00 = y. The def set of redex occurrences of t is defined by roc(t) = {p ∈ oc(t) | t|p = (λx.s) u}. We use the notation r : t →β t′ to mean that r ∈ roc(t) and t reduces to t′ by contracting the redex at occurrence r, e.g. 000 : (λx.(λy.y) x x) z →β (λx.x x) z. This notion is extended to reduction sequences as expected, and noted ρ : t ։β t′ , where ρ is the list of all the redex occurrences contracted along the reduction sequence. We use nil to denote the empty reduction sequence, so that nil : t ։β t holds for every term t. Any term t has exactly one of the following forms: λx1 .. . . λxn .y t1 . . . tm or λx1 .. . . λxn .(λy.s) u t1 . . . tm with n, m ≥ 0. In the latter case we say that (λy.s) u is the head redex of t, while in the former case there is no head redex. Moreover, if n = 0, we say that (λy.s) u is the weak-head redex of t. In terms of occurrences, the head redex of t is the minimal redex occurrence of the form 0n with n ≥ 0. In particular, if it satisfies that t|0k is not an abstraction for every k ≤ n, it is the weak-head redex of t. A reduction sequence contracting at each step the head redex (resp. weak-head redex) of the corresponding term is called the head reduction (resp. weak-head reduction). Given two redex occurrences r, r′ ∈ roc(t), we say that r is to-the-left of ′ r if the anchor of r is to the left of the anchor of r′ . Thus for example, the redex occurrence 0 is to-the-left of 1 in the term (I x) (I y), and ǫ is to-the-left of 00 in (λx.(I I)) z. Alternatively, the relation to-the-left can be understood as a dictionary order between redex occurrences, i.e. r is to-the-left of r′ if either r′ = rq with q 6= ǫ (i.e. r is a proper prefix of r′ ); or r = p0q and r′ = p1q′ (i.e. they share a common prefix and r is on the left-hand side of an application while r′ is on the right-hand side). Notice that in any case this implies r′ 6≤ r. Since this notion defines a total order on redexes, every term not in normal form has a unique leftmost redex . The term t leftmost reduces to t′ if t reduces to t′ and the reduction step contracts the leftmost redex of t. For example, (I x) (I y) leftmost reduces to x (I y) and (λx.(I I)) z leftmost reduces to I I. This notion extends to reduction sequences as expected. 3 Towards neededness Needed reduction is based on two fundamental notions: that of residual, which describes how a given redex is traced all along a reduction sequence, and that of normal form, which gives the form of the expected result of the reduction sequence. This section extends the standard notion of needed reduction [8] to those of head and weak-head needed reductions. 3.1 Residuals Given a term t, p ∈ oc(t) and r ∈ roc(t), the descendants of p after r in t, written p/r, is the set of occurrences defined as follows: ∅ if {p} if {rq} if {rkq | s|k = x} if p = r or p = r0 r 6≤ p p = r00q p = r1q with t|r = (λx.s) u For instance, given t = (λx.(λy.x) x) z, then oc(t) = {ǫ, 0, 1, 00, 000, 001, 0000}, roc(t) = {ǫ, 00}, 00/00 = ∅, ǫ/00 = {ǫ}, 00/ǫ = {ǫ} and 1/ǫ = {1, 00}. Notice that p/r ⊆ oc(t′ ) where r : t →β t′ . Furthermore, if p is the occurrence of a redex in t (i.e. p ∈ roc(t)), then p/r ⊆ roc(t′ ), and each position in p/r is called a residual of p after reducing r. This notion is extended to S sets of redex def occurrences, indeed, the residuals of P after r in t are P/r = p∈P p/r. In particular ∅/r = ∅. Given ρ : t ։β t′ and P ⊆ roc(t), the residuals of P def def after the sequence ρ are: P/nil = P and P/rρ′ = (P/r)/ρ′ . Stability of the to-the-left relation makes use of the notion of residual: Lemma 1. Given a term t, let l, r, s ∈ roc(t) such that l is to-the-left of r, s 6≤ l and s : t →β t′ . Then, l ∈ roc(t′ ) and l is to-the-left of r′ for every r′ ∈ r/s. Proof. First, notice that s 6≤ l implies l/s = {l}, then it is immediate to see that l ∈ roc(t′ ). If s 6≤ r, then r/s = {r} and the result holds immediately. Otherwise, s ≤ r implies s ≤ r′ for every r′ ∈ r/s by definition. From l is to-the-left of r, we may distinguish two cases: either r = lq with q 6= ǫ; or r = p1q and l = p0q′ . Both cases imply that l and r share a common prefix, say p′ (resp. l or p on each case). From s 6≤ l and s ≤ r we know that p′ is a proper prefix of s. Thus, it is a proper prefix of r′ too, i.e. either r′ = lq′′ with q′′ 6= ǫ; or r′ = p1q′′ . Hence, l is to-the-left of r′ for every r′ ∈ r/s. Notice that this result does not only implies that the leftmost redex is preserved by reduction of other redexes, but also that the residual of the leftmost redex occurs in exactly the same occurrence as the original one. Corollary 1. Given a term t, and l ∈ roc(t) the leftmost redex of t, if the reduction ρ : t ։β t′ contracts neither l nor any of its residuals, then l ∈ roc(t′ ) is the leftmost redex of t′ . Proof. By induction on the length of ρ using Lem. 1. 3.2 Notions of Normal Form The expected result of evaluating a program is specified by means of some appropriate notion of normal form. Given any relation →R , a term t is said to be in R-normal form (NF R ) iff there is no t′ such that t →R t′ . A term t is R-normalising (WN R ) iff there exists u ∈ NF R such that t ։R u. Thus, given an R-normalising term t, we can define the set of R-normal forms of t as def nfR (t) = {t′ | t ։R t′ ∧ t′ ∈ NF R }. In particular, it turns out that a term in weak-head β-normal form (WHNF β ) is of the form x t1 . . . tn (n ≥ 0) or λx.t, where t, t1 , . . . , tn are arbitrary terms, i.e. it has no weak-head redex. The set of weak-head β-normal def forms of t is whnfβ (t) = {t′ | t ։β t′ ∧ t′ ∈ WHNF β }. Similarly, a term in head β-normal form (HNF β ) turns out to be of the form λx1 .. . . λxn .x t1 . . . tm (n, m ≥ 0), i.e. it has no head redex. The set of head β-normal forms of t is given by hnfβ (t) def = {t′ | t ։β t′ ∧ t′ ∈ HNF β }. Last, any term in β-normal form (NF β ) has the form λx1 .. . . λxn .x t1 . . . tm (n, m ≥ 0) where t1 , . . . , tm are themselves in β-normal form. It is well-known that the set nfβ (t) is a singleton, so we may use it either as a set or as its unique element. It is worth noticing that NF β ⊂ HNF β ⊂ WHNF β . Indeed, the inclusions are strict, for instance λx.(λy.y) z is in weak-head but not in head β-normal form, while x ((λy.y) x) z is in head but not in β-normal form. 3.3 Notions of Needed Reduction The different notions of normal form considered in Sec. 3.2 suggest different notions of needed reduction, besides the standard one in the literature [8]. Indeed, consider r ∈ roc(t). We say that r is used in a reduction sequence ρ iff ρ reduces r or some residual of r. Then: 1. r is needed in t if every reduction sequence from t to β-normal form uses r; 2. r is head needed in t if every reduction sequence from t to head β-normal form uses r; 3. r is weak-head needed in t if every reduction sequence of t to weak-head β-normal form uses r. Notice in particular that nfβ (t) = ∅ (resp. hnfβ (t) = ∅ or whnfβ (t) = ∅) implies every redex in t is needed (resp. head needed or weak-head needed). A one-step reduction →β is needed (resp. head or weak-head needed ), noted →nd (resp. →hnd or →whnd ), if the contracted redex is needed (resp. head or weak-head needed). A reduction sequence ։β is needed (resp. head or weak-head needed ), noted ։nd (resp. ։hnd or ։whnd ), if every reduction step in the sequence is needed (resp. head or weak-head needed). For instance, consider the reduction sequence: (λy.λx.I x (I I r1 )) (I I) →nd (λy.λx.I xr2 I) (I I) →nd (λy.λx.x I) (I I)r →nd λx.x I 3 which is needed but not head needed, since redex r1 might not be contracted to reach a head normal form: (λy.λx.I xr2 (I I)) (I I) →hnd (λy.λx.x (I I)) (I I) →hnd λx.x (I I) r3 Moreover, this second reduction sequence is head needed but not weak-head needed since only redex r3 is needed to get a weak-head normal form: (λy.λx.I x (I I)) (I I) →whnd λx.I x (I I) r3 Notice that the following equalities hold: NF nd = NF β , NF hnd = HNF β and NF whnd = WHNF β . Leftmost redexes and reduction sequences are indeed needed: Lemma 2. The leftmost redex in any term not in normal form (resp. head or weak-head normal form) is needed (resp. head or weak-head needed). Proof. Since the existing proof [8] does not extend to weak-head normal forms, we give here an alternative argument which does not only cover the standard case of needed reduction but also the new ones of head and weak-head reductions. Let t be a term not in normal form (resp. head normal form or weak-head normal form) and let us consider ρ : t ։β t′ such that t′ is a normal form (resp. head normal form or weak-head normal form). Assume towards a contradiction that the leftmost redex l of t is not used in ρ. By Cor. 1 the occurrence l is still the leftmost redex of t′ . This leads to a contradiction with t′ being a normal form (resp. head normal form or weak-head normal form), in particular because the leftmost redex of a term not in head normal form (resp. weak-head normal form) is necessarily the head redex (resp. weak-head redex). Theorem 1. Let r ∈ roc(t) and ρ : t ։β t′ be the leftmost reduction (resp. head reduction or weak-head reduction) starting with t such that t′ = nfβ (t) (resp. t′ ∈ hnfβ (t) or t′ ∈ whnfβ (t)). Then, r is needed (resp. head or weak-head needed) in t iff r is used in ρ. Proof. ⇒) Immediate by definition of needed (resp. head or weak-head needed). ⇐) Let ρ = ρ′ r′ ρ′′ with r′ ∈ r/ρ′ . By hypothesis r′ is the leftmost redex of its corresponding term. By Lem. 2, r′ is needed (resp. head or weak-head needed). Notice that, given a redex s not needed in t, it follows from the definition that no residual of s is needed either. Therefore, r′ needed (resp. head or weak-head needed) implies r needed (resp. head or weak-head needed) as well. Notice that the weak-head reduction is a prefix of the head reduction, which is in turn a prefix of the leftmost reduction to normal form. As a consequence, it is immediate to see that every weak-head needed redex is in particular head needed, and every head needed redex is needed as well. For example, consider: r2 r3 r4 (λy.λx.I x (I I )) (I I ) r1 where r3 is a needed redex but not head needed nor weak-head needed. However, r2 is both needed and head needed, while r1 is the only weak-head needed redex in the term, and r4 is not needed at all. 4 The Type System V In this section we recall the (non-idempotent) intersection type system V [14] –an extension of those in [13,12]– used here to characterise normalising terms w.r.t. the weak-head strategy. More precisely, we show that t is typable in system V if and only if t is normalising when only weak-head needed redexes are contracted. This characterisation is used in Sec. 9 to conclude that the weak-head needed strategy is observationally equivalent to the call-by-need calculus (to be introduced in Sec. 8). Given a constant type a that denotes answers and a countable infinite set B of base type variables α, β, γ, . . ., we define the following sets of types: (Types) τ, σ ::= a | α ∈ B | M → τ (Multiset types) M, N ::= {{τi }}i∈I where I is a finite set The empty multiset is denoted by {{}}. We remark that types are strict [17], i.e. the right-hand sides of functional types are never multisets. Thus, the general form of a type is M1 → . . . → Mn → τ with τ being the constant type or a base type variable. Typing contexts (or just contexts), written Γ, ∆, are functions from variables to multiset types, assigning the empty multiset to all but a finite set of def variables. The domain of Γ is given by dom(Γ ) = {x | Γ (x) 6= {{}}}. The union def of contexts, written Γ + ∆, is defined by (Γ + ∆)(x) = Γ (x) ⊔ ∆(x), where ⊔ denotes multiset union. An example is (x : {{σ}}, y : {{τ }}) + (x : {{σ}}, z : {{τ }}) = (x : {{σ, σ}}, y : {{τ }}, z : {{τ }}). This notion is extended to several contexts as expected, so that +i∈I Γi denotes a finite union of contexts (when I = ∅ the notation is to be understood as the empty context). We write Γ \\ x for the context (Γ \\ x)(x) = {{}} and (Γ \\ x)(y) = Γ (y) if y 6= x. Type judgements have the form Γ ⊢ t : τ , where Γ is a typing context, t is a term and τ is a type. The intersection type system V for the λ-calculus is given in Fig. 1. x : {{τ }} ⊢ x : τ (ax) Γ ⊢t:τ Γ \\ x ⊢ λx.t : Γ (x) → τ Γ ⊢ t : {{σi }}i∈I → τ ⊢ λx.t : a (val) ( → i) (∆i ⊢ u : σi )i∈I Γ +i∈I ∆i ⊢ t u : τ ( → e) Fig. 1. The non-idempotent intersection type system V. The constant type a in rule (val) is used to type values. The axiom (ax) is relevant (there is no weakening) and the rule ( → e) is multiplicative. Note that the argument of an application is typed #(I) times by the premises of rule ( → e). A particular case is when I = ∅: the subterm u occurring in the typed term t u turns out to be untyped. A (type) derivation is a tree obtained by applying the (inductive) typing rules of system V. The notation ⊲V Γ ⊢ t : τ means there is a derivation of the judgement Γ ⊢ t : τ in system V. The term t is typable in system V, or V-typable, iff t is the subject of some derivation, i.e. iff there are Γ and τ such that ⊲V Γ ⊢ t : τ . We use the capital Greek letters Φ, Ψ, . . . to name type derivations, by writing for example Φ ⊲V Γ ⊢ t : τ . For short, we usually denote with Φt a derivation with subject t for some type and context. The size of the derivation Φ, denoted by sz(Φ), is defined as the number of nodes of the corresponding derivation tree. We write RULE(Φ) ∈ {(ax), ( → i), ( → e)} to access the last rule applied in the derivation Φ. Likewise, PREM(Φ) is the multiset of proper maximal subderivations of Φ. For instance, given Φ= Φt (Φiu )i∈I Γ ⊢ tu : τ ( → e) we have RULE(Φ) = ( → e) and PREM(Φ) = {{Φt }} ⊔ {{Φiu | i ∈ I}}. We also use functions CTXT(Φ), SUBJ(Φ) and TYPE(Φ) to access the context, subject and type of the judgement in the root of the derivation tree respectively. For short, we also use notation Φ(x) to denote the type associated to the variable x in the def typing environment of the conclusion of Φ (i.e. Φ(x) = CTXT(Φ)(x)). Intersection type systems can usually be seen as models [11], i.e. typing is stable by convertibility: if t is typable and t =β t′ , then t′ is typable too. This property splits in two different statements known as subject reduction and subject expansion respectively, the first one giving stability of typing by reduction, the second one by expansion. In the particular case of non-idempotent types, subject reduction refines to weighted subject-reduction, stating that not only typability is stable by reduction, but also that the size of type derivations is decreasing. Moreover, this decrease is strict when reduction is performed on special occurrences of redexes, called typed occurrences. We now introduce all these concepts. Given a type derivation Φ, the set TOC(Φ) of typed occurrences of Φ, which is a subset of oc(SUBJ(Φ)), is defined by induction on the last rule of Φ. – If RULE(Φ) ∈ {(ax), (val)}, then TOC(Φ) def = {ǫ}. – If RULE(Φ) = ( → i) with SUBJ(Φ) = λx.t and PREM(Φ) = {{Φt }}, then def TOC(Φ) = {ǫ} ∪ {0p | p ∈ TOC(Φt )}. – If RULE(Φ) = ( → e) with SUBJ(Φ) = t u andSPREM(Φ) = {{Φt }} ⊔ {{Φiu | i ∈ I}}, def then TOC(Φ) = {ǫ} ∪ {0p | p ∈ TOC(Φt )} ∪ ( i∈I {1p | p ∈ TOC(Φiu )}). Remark that there are two kind of untyped occurrences, those inside untyped arguments of applications, and those inside untyped bodies of abstractions. For instance consider the following type derivations: x : {{a}} ⊢ x : a ΦK = (ax) x : {{a}} ⊢ λy.x : {{}} → a ⊢ K : {{a}} → {{}} → a ( → i) ΦKI = ( → i) ΦKIΩ = ΦK ⊢I:a (val) ⊢ K I : {{}} → a ⊢KIΩ :a ( → e) ( → e) Then, TOC(ΦKIΩ ) = {ǫ, 0, 00, 01, 000, 0000} ⊆ oc(KIΩ). Remark 1. The weak-head redex of a typed term is always a typed occurrence. For convenience we introduce an alternative way to denote type derivations. We refer to AX(x, τ ) as the result of applying (ax) with subject x and type τ : def AX(x, τ ) = x : {{τ }} ⊢ x : τ (ax) We denote with VAL(x, t) the result of applying (val) abstracting x and term t: def VAL(x, t) = ⊢ λx.t : a (val) We refer to ABS(x, Φt ) as the result of applying ( → i) with premise Φt and abstracting variable x: def ABS(x, Φt ) = Φt CTXT(Φt ) \\ x ⊢ λx.t : Φt (x) → TYPE(Φt ) ( → i) Likewise, we write APP(Φt , u, (Φiu )i∈I ) for the result of applying ( → e) with premises Φt and (Φiu )i∈I , and argument u (the argument u is untyped when I = ∅). Note that this application is valid provided that TYPE(Φt ) = {{σi }}i∈I → τ and (TYPE(Φiu ) = σi )i∈I . Then: def APP(Φt , u, (Φiu )i∈I ) = Φt (Φiu )i∈I CTXT(Φt ) +i∈I CTXT(Φiu ) ⊢ t u : τ ( → e) Given Φ and p ∈ TOC(Φ), the multiset Φ|p of all the subderivations of Φ at occurrence p is inductively defined as follows: def {{Φ}}. – If p = ǫ, then Φ|p = ′ – If p = 0p , i.e. RULE(Φ) ∈ {( → i), ( → e)} with SUBJ(Φ) ∈ {λx.t, t u} and Φt ∈ PREM(Φ). Then, Φ|p def = Φt |p′ . – If p = 1p′ , i.e. RULE(Φ) = (F → e) with SUBJ(Φ) = t u and PREM(Φ) = {{Φt }} ⊔ def i {{Φiu | i ∈ I}}. Then, Φ|p = i∈I Φu |p′ (recall ⊔ denotes multiset union). Given type derivations Φ, (Ψi )i∈I and a position p ∈ oc(SUBJ(Φ)), replacing the subderivations of Φ at occurrence p by (Ψi )i∈I , written Φ[(Ψi )i∈I ]p , is a type derivation inductively defined as follows, assuming #(Φ|p ) = #(I) and SUBJ(Ψi ) = SUBJ(Ψj ) for every i, j ∈ I (we call s the unique subject of all these derivations): def – If p = ǫ, then Φ[(Ψi )i∈I ]p = Ψi0 with I = {i0 }. ′ – If p = 0p , either: • RULE(Φ) = ( → i) with SUBJ(Φ) = λx.t and PREM(Φ) = {{Φt }}. Then, def Φ[(Ψi )i∈I ]p = ABS(x, Φt [(Ψi )i∈I ]p′ ); or • RULE(Φ) = ( → e) with SUBJ(Φ) = t u and PREM(Φ) = {{Φt }}⊔{{Φju | j ∈ J}}. def Then, Φ[(Ψi )i∈I ]p = APP(Φt [(Ψi )i∈I ]p′ , u, (Φju )j∈J ). – If p = 1p′ , i.e. RULE(Φ) U = ( → e) with SUBJ(Φ) = t u, PREM(Φ) = {{Φt }} ⊔ {{Φju | j ∈ J}} and I = j∈J Ij . Then, def Φ[(Ψi )i∈I ]p = APP(Φt , u[s]p′ , (Φju [(Ψi )i∈Ij ]p′ )j∈J ) where s is the unique subject of all the derivations Ψi and r′ [r]q denotes the replacement of the subterm r′ |q by r in r′ (variable capture is allowed). Remark that the decomposition of I into the sets Ij (j ∈ J) is non-deterministic, thus replacement turns out to be a non-deterministic operation. We can now state the two main properties of system V, whose proofs can be found in Sec. 7 of [9]. Theorem 2 (Weighted Subject Reduction). Let Φ ⊲V Γ ⊢ t : τ . If r : t →β t′ , then there exists Φ′ s.t. Φ′ ⊲V Γ ⊢ t′ : τ . Moreover, 1. If r ∈ TOC(Φ), then sz(Φ) > sz(Φ′ ). 2. If r ∈ / TOC(Φ), then sz(Φ) = sz(Φ′ ). Theorem 3 (Subject Expansion). Let Φ′ ⊲V Γ ⊢ t′ : τ . If t →β t′ , then there exists Φ s.t. Φ ⊲V Γ ⊢ t : τ . Note that weighted subject reduction implies that reduction of typed redex occurrences turns out to be normalising. 5 Substitution and Reduction on Derivations In order to relate typed redex occurrences of convertible terms, we now extend the notion of β-reduction to derivation trees, by making use of a natural and basic concept of typed substitution. In contrast to substitution and β-reduction on terms, these operations are now both non-deterministic on derivation trees (see [18] for discussions and examples). Given a variable x and type derivations Φt and (Φiu )i∈I , the typed substitution of x by (Φiu )i∈I in Φt , written   Φt x (Φiu )i∈I by making an abuse of notation, is a type derivation inductively defined on Φt , only if Φt (x) = {{TYPE(Φiu )}}i∈I : – If Φt = AX(y, τ ), then   Φt x (Φiu )i∈I def = ( Φiu0 Φt if y = x where I = {i0 } if y = 6 x – If Φt = VAL(y, t′ ), then   Φt x (Φiu )i∈I = VAL(y, t′ {x /u }) def if there is no capture of the variable y. – If Φt = ABS(y, Φt′ ), then     def Φt x (Φiu )i∈I = ABS(y, Φt′ x (Φiu )i∈I ) if there is no capture of the variable y. U – If Φt = APP(Φr , s, (Φjs )j∈J ) with I = I ′ ⊎( j∈J Ij ), where Φr (x) = {{TYPE(Φiu )}}i∈I ′ and (Φs (x) = {{TYPE(Φiu )}}i∈Ij )j∈J , then   Φt x (Φiu )i∈I     def = APP(Φr x (Φiu )i∈I ′ , s {x /u }, (Φjs x (Φiu )i∈Ij )j∈J ) Remark that the decomposition of I into I ′ and the sets Ij (j ∈ J) is non-deterministic, thus substitution of derivation trees turns out to be a non-deterministic operation. Intuitively, the typed substitution replaces typed occurrences of x in Φt by a corresponding derivation Φiu matching the same type, where such a matching is chosen in a non-deterministic way. Moreover, it also substitutes all untyped occurrences of x by u, where this untyped operation is completely deterministic. Thus, for example, consider the following substitution, where ΦKI is defined in Sec. 4:   (ax) ΦKI x : {{{{}} → a}} ⊢ x : {{}} → a  ( → e) ( → e) {x /ΦKI } = ⊢ (KI) (KI) : a x : {{{{}} → a}} ⊢ x x : a The following lemma relates the typed occurrences of the trees composing a substitution and those of the substituted tree itself:   Lemma 3. Let Φt and (Φiu )i∈I be derivations such that Φt x (Φiu )i∈I is defined, and p ∈ oc(t). Then,   1. p ∈ TOC(Φt ) iff p ∈ TOC(Φt x (Φiu )i∈I ). 2. q ∈ TOC(Φku ) for some  k ∈ I iff there exists p ∈ TOC(Φt ) such that t|p = x and pq ∈ TOC(Φt x (Φiu )i∈I ). Proof. By induction on Φt . Based on the previous notion of substitutions on derivations, we are now able to introduce (non-deterministic) reduction on derivation trees. The reduction relation →β on derivation trees is then defined by first considering the following basic rewriting rules. 1. For typed β-redexes: Φt ⊲V Γ ; x : {{σi }}i∈I ⊢ t : τ Γ ⊢ λx.t : {{σi }}i∈I → τ (Φiu ⊲V ∆i ⊢ u : σi )i∈I Γ +i∈I ∆i ⊢ (λx.t) u : τ   7→β Φt x (Φiu )i∈I 2. For β-redexes in untyped occurrences, with u →β u′ : Γ ⊢ t : {{}} → τ Γ ⊢ tu : τ 7→ν Γ ⊢ t : {{}} → τ Γ ⊢ t u′ : τ ⊢ λx.u : a 7→ξ ⊢ λx.u′ : a As in the case of the λ-calculus, where reduction is closed under usual term contexts, we need to close the previous relation under derivation tree contexts. However, a one-step reduction on a given subterm causes many one-step reductions in the corresponding derivation tree (recall Φ|p is defined to be a multiset). Then, informally, given a redex occurrence r of t, a type derivation Φ of t, and the multiset of minimal subderivations of Φ containing r, written M , we apply the reduction rules 7→β,ν,ξ to all the elements of M , thus obtaining a multiset M ′ , and we recompose the type derivation of the reduct of t. To formalise this idea, given a type derivation Φ and an occurrence p ∈ oc(SUBJ(Φ)), we define the maximal typed prefix of p in Φ, written mtpΦ (p), as the unique prefix of p satisfying mtpΦ (p) ∈ TOC(Φ) ∧ ∀q ∈ TOC(Φ).(q ≤ p =⇒ q ≤ mtpΦ (p)) Notice that the multiset of subderivations of Φ at position mtpΦ (p) (i.e. Φ|mtpΦ (p) ) corresponds to the multiset of minimal subderivations of Φ containing p. For instance, consider the type derivation ΦKIΩ presented in Sec. 4: ΦK ΦKIΩ = ΦI = ⊢I:a ⊢ K I : {{}} → a ⊢KIΩ :a (val) ( → e) ( → e) where TOC(ΦKIΩ ) = {ǫ, 0, 00, 01, 000, 0000}. Indeed, mtpΦKIΩ (010) = 01 and the minimal subderivation of ΦKIΩ containing this occurrence is ΦKIΩ |01 = {{ΦI }}. Also, mtpΦKIΩ (1p) = ǫ where ΦKIΩ |ǫ = {{ΦKIΩ }}. Then, given terms t and t′ , and type derivations Φ and Φ′ of t and t′ respectively, we say that Φ reduces to Φ′ (written Φ →β Φ′ ) iff there exists r ∈ roc(t) such that Φ|mtpΦ (r) β,ν,ξ M and Φ′ = Φ[M ]mtpΦ (r) where β,ν,ξ denotes the lifting to multisets of the basic rewriting rules introduced above by applying the same rule to all the elements of the multiset. This gives the reduction relation →β on trees. A reduction sequence on derivation trees contracting only redexes in typed positions is dubbed a typed reduction sequence. Note that typed reductions are normalising by Thm. 2, yielding a special kind of derivation. Indeed, given a type derivation Φ ⊲V Γ ⊢ t : τ , we say that Φ is normal iff TOC(Φ) ∩ roc(t) = ∅. Reduction on trees induces reduction on terms: when ρ : Φ ։β Φ′ , then SUBJ(Φ) ։β SUBJ(Φ′ ). By abuse of notation we may denote both sequences with the same letter ρ. 6 Weak-Head Neededness and Typed Occurrences This section presents one of our main results. It establishes a connection between weak-head needed redexes and typed redex occurrences. More precisely, we first show in Sec. 6.1 that every weak-head needed redex occurrence turns out to be a typed occurrence, whatever its type derivation is. The converse does not however hold. But, we show in Sec. 6.2 that any typed occurrence in a special kind of typed derivation (that we call principal) corresponds to a weak-head needed redex occurrence. We start with a technical lemma. Lemma 4. Let r : Φt →β Φt′ and p ∈ oc(t) such that p 6= r and p 6= r0. Then, p ∈ TOC(Φt ) iff there exists p′ ∈ p/r such that p′ ∈ TOC(Φt′ ). Proof. If p = ǫ the result holds since ǫ/r = {ǫ} and ǫ ∈ TOC(Φ) for every possible Φ by definition. Then, assume p 6= ǫ. We proceed by induction on r. – r = ǫ. Then, r ≤ p and r ∈ roc(t) ∩ TOC(Φt ). Moreover, t = t|r = (λx.t1 ) t2 and Φt1 Φt = (Φit2 )i∈I Γ ′ ⊢ λx.t1 : {{σi }}i∈I → τ Γ ⊢ (λx.t1 ) t2 : τ   →β Φt1 x (Φit2 )i∈I = Φt′ with t′ = t1 {x /t2 }. Then, there are two possibilities for p: 1. p = 00p′ . Then, p/ǫ = {p′ }. By definition, p ∈ TOC(Φt ) iff p′ ∈ TOC(Φt1 ). Moreover, by Lem. 3 (1), p′ ∈ TOC(Φt1 ) iff p′ ∈ TOC(Φt′ ) (notice that p′ ∈ oc(t1 )). Thus, we conclude. 2. p = 1p′′ . Then, p/ǫ = {qp′′ | t1 |q = x}. By definition p ∈ TOC(Φt ) iff p′′ ∈ TOC(Φkt2 ) for some k ∈ I. By Lem. 3 (2), p′′ ∈ TOC(Φkt2 ) iff there exists q ∈ TOC(Φt1 ) such that t1 |q = x and p′ = qp′′ ∈ TOC(Φt′ ). Thus, we conclude. – r = 0r′ . Then, we analyse the form of t: • t = t1 t2 . Then, t′ = t′1 t2 with r′ : t1 →β t′1 . Moreover, Φt = Φt1 (Φit2 )i∈I Γ ⊢ t1 t2 : τ →β Φt′1 (Φit2 )i∈I Γ ⊢ t′1 t2 : τ = Φt′ with Φt1 →β Φt′1 . Now we have two possibilities for p: ∗ p = 0q. By definition, p ∈ TOC(Φt ) iff q ∈ TOC(Φt1 ). Since p 6= r implies q 6= r′ , by inductive hypothesis, q ∈ TOC(Φt1 ) iff there exists q′ ∈ q/r′ such that q′ ∈ TOC(Φt′1 ). Thus, by definition once again, p ∈ TOC(Φt ) iff there exists p′ ∈ p/r such that p′ ∈ TOC(Φt′ ) (i.e. p′ = 0q′ ). ∗ p = 1q. Then, r 6≤ p and p/r = {p} (i.e. p′ = p). Thus, p ∈ TOC(Φt ) iff q ∈ TOC(Φkt2 ) for some k ∈ I iff p′ ∈ TOC(Φt′ ) by definition. • t = λx.t1 . Then, t′ = λx.t′1 with r′ : t1 →β t′1 . If RULE(Φt ) = (val), the result is immediate since TOC(Φt ) = {ǫ} = TOC(Φt′ ). If not, Φt = Φt1 Γ ⊢ λx.t1 : τ →β Φt′1 Γ ⊢ λx.t′1 : τ = Φt′ with Φt1 →β Φt′1 . Then, p = 0q and, by definition, p ∈ TOC(Φt1 ) iff q ∈ TOC(Φt1 ). By inductive hypothesis, q ∈ TOC(Φt1 ) iff there exists q′ ∈ q/r′ such that q′ ∈ TOC(Φt′1 ). Thus, we conclude as in the previous case. – r = 1r′ . This case is symmetric to the one presented above. We have t = t1 t2 and t′ = t1 t′2 with r′ : t2 →β t′2 , and Φt = Φt1 (Φit2 )i∈I Γ ⊢ t1 t2 : τ →β Φt1 (Φit′2 )i∈I Γ ⊢ t1 t′2 : τ = Φt′ with (Φit2 →β Φit′ )i∈I . Then, if p = 0q (i.e. r 6≤ p) we may conclude by 2 definition with p/r = {p}. Otherwise, p = 1q and p ∈ TOC(Φt ) iff q ∈ TOC(Φkt′ ) 2 for some k ∈ I. Thus, the result follows by definition from the inductive hypothesis. 6.1 Weak-Head Needed Redexes are Typed In order to show that every weak-head needed redex occurrence corresponds to a typed occurrence in some type derivation we start by proving that typed occurrences do not come from untyped ones. Lemma 5. Let ρ : Φt ։β Φt′ and p ∈ oc(t). If there exists p′ ∈ p/ρ such that p′ ∈ TOC(Φt′ ), then p ∈ TOC(Φt ). Proof. Straightforward induction on ρ using Lem. 4. Theorem 4. Let r be a weak-head needed redex in t. Let Φ be a type derivation of t. Then, r ∈ TOC(Φ). Proof. By Thm. 1, r is used in the weak-head reduction from t to t′ ∈ WHNF β . By Rem. 1, the weak-head reduction contracts only typed redexes. Thus, r or some of its residuals is a typed occurrence in its corresponding derivation tree. Finally, we conclude by Lem. 5, r ∈ TOC(Φ). 6.2 Principally Typed Redexes are Weak-Head Needed As mentioned before, the converse of Thm. 4 does not hold: there are some typed occurrences that do not correspond to any weak-head needed redex occurrence. This can be illustrated in the following examples (recall ΦKIΩ defined in Sec. 4): ΦKIΩ ⊢ λy.KIΩ : {{}} → a ( → i) y : {{{{a}} → a}} ⊢ y : {{a}} → a (ax) y : {{{{a}} → a}} ⊢ y (KIΩ) : a ΦKIΩ ( → e) Indeed, the occurrence 0 (resp 1) in the term λy.KIΩ (resp. y (KIΩ)) is typed but not weak-head needed, since both terms are already in weak-head normal form. Fortunately, typing relates to redex occurrences if we restrict type derivations to principal ones: given a term t in weak-head β-normal form, the derivation Φ ⊲V Γ ⊢ t : τ is normal principally typed if: n times z }| { – t = x t1 . . . tn (n ≥ 0), and Γ = {x : {{{{}} → . . . → {{}} → τ }}} and τ is a type variable α (i.e. none of the ti are typed), or – t = λx.t′ , and Γ = ∅ and τ = a. Given a weak-head normalising term t such that Φt ⊲V Γ ⊢ t : τ , we say that Φt is principally typed if Φt ։β Φt′ for some t′ ∈ whnfβ (t) implies Φt′ is normal principally typed. Note in particular that the previous definition does not depend on the chosen weak-head normal form t′ : suppose t′′ ∈ whnfβ (t) is another weak-head normal form of t, then t′ and t′′ are convertible terms by the Church-Rosser property [7] so that t′ can be normal principally typed iff t′′ can, by Thm. 2 and 3. Lemma 6. Let Φt be a type derivation with subject t and r ∈ roc(t) ∩ TOC(Φt ). Let ρ : Φt ։β Φt′ such that Φt′ is normal. Then, r is used in ρ. Proof. Straightforward induction on ρ using Lem. 4. The notions of leftmost and weak-head needed reductions on (untyped) terms naturally extends to typed reductions on tree derivations. We thus have: Lemma 7. Let t be a weak-head normalising term and Φt be principally typed. Then, a leftmost typed reduction sequence starting at Φt is weak-head needed. Proof. By induction on the leftmost typed sequence (called ρ). If ρ is empty the result is immediate. If not, we show that t has a typed weak-head needed redex (which is leftmost by definition) and conclude by inductive hypothesis. Indeed, assume t ∈ WHNF β . By definition Φt is normal principally typed and thus it has no typed redexes. This contradicts ρ being non-empty. Hence, t has a weak-head redex r (i.e. t ∈ / WHNF β ). Moreover, r is both typed (by Rem. 1) and weak-head needed (by Lem. 2). Thus, we conclude. Theorem 5. Let t be a weak-head normalising term, Φt be principally typed and r ∈ roc(t) ∩ TOC(Φt ). Then, r is a weak-head needed redex in t. Proof. Let ρ : Φt ։β Φt′ be the leftmost typed reduction sequence where Φt′ is normal. Note that Φt′ exists by definition of principally typed. By Lem. 7, ρ is a weak-head needed reduction sequence. Moreover, by Lem. 6, r is used in ρ. Hence, r is a weak-head needed redex in t. As a direct consequence of Thm. 4 and 5, given a weak-head normalising term t, the typed redex occurrences in its principally typed derivation (which always exists) correspond to its weak-head needed redexes. Hence, system V allows to identify all the weak-head needed redexes of a weak-head normalising term. 7 Characterising Weak-Head Needed Normalisation This section presents one of the main pieces contributing to our observational equivalence result. Indeed, we relate typing with weak-head neededness by showing that any typable term in system V is normalising for weak-head needed reduction. This characterisation highlights the power of intersection types. We start by a technical lemma. Lemma 8. Let Φ ⊲V Γ ⊢ t : τ . Then, Φ normal implies t ∈ WHNF β . Proof. By induction on Φ analysing the last rule applied. – – – – (ax). Then t = x ∈ WHNF β . (val). Then t = λx.t′ ∈ WHNF β . ( → i). Then t = λx.t′ ∈ WHNF β . ( → e). Then t = r u with Γ = Γ ′ +i∈I ∆i , Φ′ ⊲V Γ ′ ⊢ r : {{σi }}i∈I → τ and (∆i ⊢ u : σi )i∈I for some I. From Φ normal we have Φ′ normal too. Thus, by inductive hypothesis, r ∈ WHNF β . Moreover, r 6= λy.r′ since ǫ ∈ TOC(Φ). Then, r = x r1 . . . rn and we conclude with t = x r1 . . . rn u ∈ WHNF β . Let ρ : t1 ։β tn . We say that ρ is a left-to-right reduction sequence iff for every i < n if ri : ti →β ti+1 and li is to the left of ri then, for every j > i such that rj : tj →β tj+1 we have that rj ∈ / {li }/ρij where ρij : ti ։β tj is the corresponding subsequence of ρ. In other words, for every j and every i < j, rj is not a residual of a redex to the left of ri (relative to the given reduction subsequence from ti to tj ) [7]. Left-to-right reductions define in particular standard strategies, which give canonical ways to construct reduction sequences from one term to another: Theorem 6 ([7]). If t ։β t′ , there exists a left-to-right reduction from t to t′ . Theorem 7. Let t ∈ Ta . Then, Φ ⊲V Γ ⊢ t : τ iff t ∈ WN whnd . Proof. ⇒) By Thm. 2 we know that the strategy reducing only typed redex occurrences is normalising, i.e. there exist t′ and Φ′ such that t ։β t′ , Φ′ ⊲V Γ ⊢ t′ : τ and Φ′ normal. Then, by Lem. 8, t′ ∈ WHNF β . By Thm. 6, there exists a left-to-right reduction ρ : t ։β t′ . Let us write ρ : t = t1 ։β tn ։β t′ such that t1 , . . . , tn−1 ∈ / WHNF β and tn ∈ WHNF β . We claim that all reduction steps in t1 ։β tn are leftmost. Assume towards a contradiction that there exists k < n such that r : tk →β tk+1 and r is not the leftmost redex of tk (written lk ). Since ρ is a left-to-right reduction, no residual of lk is contracted after the k-th step. Thus, there is a reduction sequence from tk ∈ / WHNF β to tn ∈ WHNF β such that lk is not used in it. This leads to a contradiction with lk being weak-head needed in tk by Lem. 2. As a consequence, there is a leftmost reduction sequence t ։β tn . Moreover, by Lem. 2, t ։whnd tn ∈ WHNF β = NF whnd . Thus, t ∈ WN whnd . ⇐) Consider the reduction ρ : t ։whnd t′ with t′ ∈ whnfβ (t). Let Φ′ ⊲V Γ ⊢ t′ : τ be the normal principally typed derivation for t′ as defined in Sec. 6.2. Finally, we conclude by induction in ρ using Thm. 3, Φ ⊲V Γ ⊢ t : τ . 8 The Call-by-Need Lambda-Calculus This section describes the syntax and the operational semantics of the call-byneed lambda-calculus introduced in [1]. It is more concise than previous specifications of call-by-need [3,2,15,10], but it is operationally equivalent to them [6], so that our results could also be presented by using alternative specifications. Given a countable infinite set X of variables x, y, z, . . . we define different syntactic categories for terms, values, list contexts, answers and need contexts: (Terms) t, u ::= x ∈ X | t u | λx.t | t[x\u] (Values) v ::= λx.t (List contexts) L ::=  | L[x\t] (Answers) a ::= Lhλy.ti (Need contexts) M, N ::=  | N t | N[x\t] | Nhhxii[x\M] We denote the set of terms by Te . Terms of the form t[x\u] are closures, and [x\u] is called an explicit substitution (ES). The set of Te -terms without ES is the set of terms of the λ-calculus, i.e. Ta . The notions of free and bound def variables are defined as expected, in particular, fv(t[x\u]) = fv(t) \ {x} ∪ fv(u), def def fv(λx.t) = fv(t)\{x}, bv(t[x\u]) = bv(t)∪{x}∪bv(u) and bv(λx.t) def = bv(t)∪{x}. We extend the standard notion of α-conversion to ES, as expected. We use the special notation Nhhuii or Lhhuii when the free variables of u are not captured by the context, i.e. there are no abstractions or explicit substitutions in the context that binds the free variables of u. Thus for example, given N = ( x)[x\z], we have (y x)[x\z] = Nhyi = Nhhyii, but (x x)[x\z] = Nhxi cannot be written as Nhhxii. Notice the use of this special notation in the last case of needed contexts, an example of such case being (x y)[y\t][x\]. The call-by-need calculus, introduced in [1], is given by the set of terms Te and the reduction relation →need , the union of →dB and →lsv , which are, respectively, the closure by need contexts of the following rewriting rules: Lhλx.ti u 7→dB Lht[x\u]i Nhhxii[x\Lhvi] 7→lsv LhNhhvii[x\v]i These rules avoid capture of free variables. An example of need-reduction sequence is the following, where the redex of each step is underlined for clearness: (λx1 .I (x1 I)) (λy.I y) x2 [x2 \x1 I][x1 \λy.I y] x2 [x2 \(I x3 )[x3 \I]][x1 \λy.I y] x2 [x2 \x4 [x4 \I][x3 \I]][x1 \λy.I y] I[x2 \I][x4 \I][x3 \I][x1 \λy.I y] →dB →lsv →dB →lsv (I (x1 I))[x1 \λy.I y] x2 [x2 \(λx3 .I x3 ) I][x1 \λy.I y] x2 [x2 \x4 [x4 \x3 ][x3 \I]][x1 \λy.I y] x2 [x2 \I[x4 \I][x3 \I]][x1 \λy.I y] →dB →dB →lsv →lsv As for call-by-name, reduction preserves free variables, i.e. t →need t′ implies fv(t) ⊇ fv(t′ ). Notice that call-by-need reduction is also weak, so that answers are not need-reducible. 9 Observational Equivalence The results in Sec. 7 are used here to prove soundness and completeness of callby-need w.r.t weak-head neededness, our second main result. More precisely, a call-by-need interpreter stops in a value if and only if the weak-head needed reduction stops in a value. This means that call-by-need and call-by-name are observationally equivalent. Formally, given a reduction relation R on a term language T , and an associated notion of context for T , we define t to be observationally equivalent to u, written t ∼ =R u, iff Chti ∈ WN R ⇔ Chui ∈ WN R for every context C. In order to show our final result we resort to the following theorem: Theorem 8 ([14]). 1. Let t ∈ Ta . Then, Φ ⊲V Γ ⊢ t : τ iff t ∈ WN name . 2. For all terms t and u in Ta , t ∼ =name u iff t ∼ =need u. These observations allows us to conclude: Theorem 9. For all terms t and u in Ta , t ∼ =need u. =whnd u iff t ∼ ∼ Proof. By Thm. 8:2 it is sufficient to show t =whnd u iff t ∼ =name u. The proof proceeds as follows: t∼ iff (definition) =name u Chti ∈ WN name ⇔ Chui ∈ WN name iff (Thm. 8:1) Chti typable in V ⇔ Chui typable in V iff (Thm. 7) Chti ∈ WN whnd ⇔ Chui ∈ WN whnd iff (definition) t∼ =whnd u 10 Conclusion We establish a clear connection between the semantical standard notion of neededness and the syntactical concept of call-by-need. The use of non-idempotent types –a powerful technique being able to characterise different operational properties– provides a simple and natural tool to show observational equivalence between these two notions. We refer the reader to [5] for other proof techniques (not based on intersection types) used to connect semantical notions of neededness with syntactical notions of lazy evaluation. An interesting (and not difficult) extension of our result in Sec. 6 is that call-by-need reduction (defined on λ-terms with explicit substitutions) contracts only dB weak-head needed redexes, for an appropriate (and very natural) notion of weak-head needed redex for λ-terms with explicit substitutions. A technical tool to obtain such a result would be the type system A [14], a straightforward adaptation of system V to call-by-need syntax. Given the recent formulation of strong call-by-need [6] describing a deterministic call-by-need strategy to normal form (instead of weak-head normal form), it would be natural to extend our technique to obtain an observational equivalence result between the standard notion of needed reduction (to full normal forms) and the strong call-by-need strategy. This remains as future work. References 1. Beniamino Accattoli, Pablo Barenbaum, and Damiano Mazza. Distilling abstract machines. In Johan Jeuring and Manuel M. T. Chakravarty, editors, Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, pages 363–376. ACM, 2014. 2. Zena M. Ariola and Matthias Felleisen. The call-by-need lambda calculus. J. Funct. Program., 7(3):265–301, 1997. 3. Zena M. Ariola, Matthias Felleisen, John Maraist, Martin Odersky, and Philip Wadler. The call-by-need lambda calculus. In Ron K. Cytron and Peter Lee, editors, Conference Record of POPL’95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, San Francisco, California, USA, January 23-25, 1995, pages 233–246. ACM Press, 1995. 4. Franz Baader and Tobias Nipkow. Term rewriting and all that. Cambridge University Press, 1998. 5. Thibaut Balabonski. La pleine paresse, une certaine optimalité. Ph.D. Thesis, Université Paris-Diderot, 2012. 6. Thibaut Balabonski, Pablo Barenbaum, Eduardo Bonelli, and Delia Kesner. Foundations of strong call by need. PACMPL, 1(ICFP):20:1–20:29, 2017. 7. Hendrik P. Barendregt. The Lambda Calculus Its Syntax and Semantics, volume 103. North Holland, revised edition, 1984. 8. Hendrik P. Barendregt, Richard Kennaway, Jan Willem Klop, and M. Ronan Sleep. Needed reduction and spine strategies for the lambda calculus. Inf. Comput., 75(3):191–231, 1987. 9. Antonio Bucciarelli, Delia Kesner, and Daniel Ventura. Non-idempotent intersection types for the lambda-calculus. Logic Journal of the IGPL, 25(4):431–464, 2017. 10. Stephen Chang and Matthias Felleisen. The call-by-need lambda calculus, revisited. In Helmut Seidl, editor, Programming Languages and Systems - 21st European Symposium on Programming, ESOP 2012, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2012, Tallinn, Estonia, March 24 - April 1, 2012. Proceedings, volume 7211 of Lecture Notes in Computer Science, pages 128–147. Springer, 2012. 11. Mario Coppo and Mariangiola Dezani-Ciancaglini. An extension of the basic functionality theory for the λ-calculus. Notre Dame Journal of Formal Logic, 21(4):685– 693, 1980. 12. Daniel de Carvalho. Sémantiques de la logique linéaire et temps de calcul. PhD thesis, Université Aix-Marseille II, 2007. 13. Philippa Gardner. Discovering needed reductions using type theory. In Masami Hagiya and John C. Mitchell, editors, Theoretical Aspects of Computer Software, International Conference TACS ’94, Sendai, Japan, April 19-22, 1994, Proceedings, volume 789 of Lecture Notes in Computer Science, pages 555–574. Springer, 1994. 14. Delia Kesner. Reasoning about call-by-need by means of types. In Bart Jacobs and Christof Löding, editors, Foundations of Software Science and Computation Structures - 19th International Conference, FOSSACS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings, volume 9634 of Lecture Notes in Computer Science, pages 424–441. Springer, 2016. 15. John Maraist, Martin Odersky, and Philip Wadler. The call-by-need lambda calculus. J. Funct. Program., 8(3):275–317, 1998. 16. Simona Ronchi Della Rocca. Principal type scheme and unification for intersection type discipline. Theor. Comput. Sci., 59:181–209, 1988. 17. Steffen van Bakel. Complete restrictions of the intersection type discipline. Theor. Comput. Sci., 102(1):135–163, 1992. 18. Pierre Vial. Non-Idempotent Intersection Types, Beyond Lambda-Calculus. PhD thesis, Université Paris-Diderot, 2017. 19. Christopher P. Wadsworth. Semantics and Pragmatics of the Lambda Calculus. PhD thesis, Oxford University, 1971.
6cs.PL
A Differential Complex for CAT(0) Cubical Spaces arXiv:1610.05069v1 [math.KT] 17 Oct 2016 J. Brodzki∗, E. Guentner†, N. Higson‡ 1. Introduction In the 1980’s Pierre Julg and Alain Valette [JV83, JV84], and also Tadeusz Pytlik and Ryszard Szwarc [PS86], constructed and studied a certain Fredholm operator associated to a simplicial tree. The operator can be defined in at least two ways: from a combinatorial flow on the tree, similar to the flows in Forman’s discrete Morse theory [For98], or from the theory of unitary operator-valued cocycles [Pim87, Val90]. There are applications of the theory surrounding the operator to C ∗ -algebra K-theory [JV83, JV84], to the theory of completely bounded representations of groups that act on trees [PS86], and to the Selberg principle in the representation theory of p-adic groups [JV86, JV87]. The crucial property of the Fredholm operator introduced by Julg and Valette is that it is the initial operator in a continuous family of Fredholm operators parametrized by a closed interval. The applications all emerge from the properties of the family in the circumstance where a group G acts properly on the underlying tree, in which case all the operators in the family act on Hilbert spaces that carry unitary representations of G. Roughly speaking, the family connects the regular representation of G to the trivial representation within an index-theoretic context. This calls to mind Kazhdan’s property T [Kaž67, BdlHV08], or rather the negation of property T, as well as Haagerup’s property [Haa79, CCJ+ 01], which is a strong negation of property T. Groups that act on trees are known to have the Haagerup property (this is essentially due to Haagerup himself), and the Julg-Valette, PytlikSzwarc construction is perhaps best viewed as a geometric incarnation of this fact. An immediate consequence is the K-theoretic amenability of any group that acts property on a tree [Cun83, JV84], which is another strong negation of property T. The main aim of this paper is to extend the constructions of Julg and Valette, and Pytlik and Szwarc, to CAT(0) cubical spaces (a one-dimensional CAT(0) cubical J. B. was supported in part by EPSRC grants EP/I016945/1 and EP/N014189/1. E. G. was supported in part by a grant from the Simons Foundation (#245398). ‡ N. H. was supported in part by NSF grant DMS-1101382. ∗ † 1 space is the same thing as a simplicial tree). A secondary aim is to illustrate the utility of the extended construction by developing an application to operator Ktheory and giving a new proof of K-amenability for groups that act properly on bounded-geometry CAT(0)-cubical spaces. But we expect there will be other uses for our constructions, beyond operator K-theory. We shall associate to each bounded geometry CAT(0) cubical space not a Fredholm operator but a differential complex with finite-dimensional cohomology. The construction is rather more challenging for general CAT(0) cubical spaces than it is for trees. Whereas for trees there is a more or less canonical notion of flow towards a distinguished base vertex in the tree, in higher dimensions this is not so, and for example a vertex is typically connected to a given base vertex by a large number of edge-paths. In addition, the need to consider higher-dimensional cubes, and the need to impose the condition d2 = 0, oblige us to carefully consider orientations of cubes in a way that is quite unnecessary for trees. More interesting still is the problem of defining the final complex in the one-parameter family of complexes that we aim to construct. To solve it we shall rely on the theory of hyperplanes in CAT(0) cubical spaces [NR98a]. In the case of a tree the hyperplanes are simply the midpoints of edges, but in general they have a nontrivial geometry all of their own; in fact they are CAT(0) cubical spaces in their own rights. We shall also introduce and study a related notion of parallelism among the cubes in a CAT(0) cubical space. In a tree, any two vertices are parallel, while no two distinct edges are parallel, but in higher dimensions parallelism is more subtle. For instance in a finite tree the number of vertices is precisely one plus the number of edges (this simple geometric fact is in fact an essential part of the Julg-Valette, Pytlik-Szwarc construction). But the proof of the following generalization to higher dimensions is quite a bit more involved. Proposition. If X is finite CAT(0) cubical space, then the number of vertices of X is equal to the number of parallelism classes of cubes of all dimensions. We expect that parallelism and the other aspects of our constructions, will be of interest and value elsewhere in the theory of CAT(0) cube complexes. One last challenge comes in passing from CAT(0) cubical geometry to Fredholm complexes and operator K-theory. There are two standard paradigms in operator K-theory, of bounded cycles and unbounded cycles, but the geometry we are faced with here forces us to consider a hybrid of the two. However once this is done we shall arrive at our application: Theorem. If a second countable and locally compact group G admits a proper action on a bounded geometry CAT(0) cube complex, then G is K-amenable. 2 Groups that act properly on CAT(0) cube complexes are known to have the Haagerup property [NR98b], and they were proved to be K-amenable in [HK01, Theorem 9.4]. The advantage of the present approach is that the constructions in the proof are all tied to the finite-dimensional cube complex itself, whereas in [HK01] the authors rely on an auxilliary action of the group on an infinite-dimensional Euclidean space that is rather hard to understand directly. Here is a brief outline of the paper. After reviewing the concept of hyperplane in Section 2 we shall study orientations and define our Julg-Valette complex in Section 3. We shall introduce parallelism in Section 4 and define the final complex (we shall call it the Pytlik-Szwarc complex) in Section 5. The one-parameter family of complexes connecting the two will be constructed in stages, in Sections 6, 7 and 8, and the application to operator K-theory will be the subject of Sections 9 and 10. 2. Cubes and Hyperplanes We shall begin by fixing some basic notation concerning the cubes and hyperplanes in a CAT(0) cube complex. We shall follow the exposition of Niblo and Reeves in [NR98a], with some adaptations. Throughout the paper X will denote a CAT(0) cube complex as in [NR98a, Section 2.2]. Though not everywhere necessary, we shall assume throughout that X is finitedimensional, and that it has bounded geometry in the sense that the number of cubes intersecting any one cube C is uniformly bounded as C varies over all cubes. Every q-cube contains exactly 2q codimension-one faces. Each such face is disjoint from precisely one other, which we shall call the opposite face. We shall use the standard terms vertex and edge for 0-dimensional and 1-dimensional cubes. The concept of a midplane of a cube is introduced in [NR98a, Section 2.3]. If we identify a q-cube with the standard cube [− 21 , 12 ]q in Rq , then the midplanes are precisely the intersections of the cube with the coordinate hyperplanes in Rq (thus the midplanes of a cube C are in particular closed subsets of C). A q-cube contains precisely q midplanes (and in particular a vertex contains no midplanes) Niblo and Reeves describe an equivalence relation on the set of all midplanes in a cube complex: two midplanes are (hyperplane) equivalent if they can be arranged as the first and last members of a finite sequence of midplanes for which the intersection of any two consecutive midplanes is again a midplane. 2.1 Definition. (See [NR98a, Definition 2.5].) A hyperplane in X is the union of the set of all midplanes in an equivalence class of midplanes. A hyperplane cuts a cube if it contains a midplane of that cube. When a hyperplane cuts an edge, we say that 3 the edge crosses the hyperplane. See Figure 1. H Figure 1: The hyperplane H is the union of three midplanes. 2.2 Examples. If X is a tree, then the hyperplanes are precisely the midpoints of edges. If X is the plane, divided into cubes by the integer coordinate lines, then hyperplanes are the half-integer coordinate lines. Hyperplanes are particularly relevant in the context of CAT(0) cube complexes (such as the previous two examples) for the following reason: 2.3 Lemma. (See [Sag95, Theorem 4.10] or [NR98a, Lemma 2.7].) If X is a CAT(0) cube complex, then every hyperplane is a totally geodesic subspace of X that separates X into two connected components. The components of the complement of a hyperplane are the two half-spaces associated to the hyperplane. The half-spaces are open, totally geodesic subsets of X. Moreover the union of all cubes contained in a given half-space is a CAT(0) cube complex in its own right, and a totally geodesic subcomplex of X. Later on, it will be helpful to approximate an infinite complex by finite complexes, as follows. 2.4 Lemma. Every bounded geometry CAT(0) cube complex X is an increasing union of finite, totally geodesic CAT(0) subcomplexes Xn whose hyperplanes are precisely the nonempty intersections of the hyperplanes in X with Xn . Proof. Fix a base point in X and an integer n > 0. Form the set of all hyperplanes whose distance to the base point is n or greater, and then form the intersection of all 4 the half-spaces for these hyperplanes that contain the base point . Denote by Xn the union of all cubes that are included in this intersection; it is a totally geodesic subset of X and so a CAT(0) cube complex. Moreover the intersection of any hyperplane in X with Xn is connected. The union of all the Xn as n → ∞ is X and, since the set of hyperplanes of distance less than n to the base point is finite, each Xn is a finite subcomplex of X. 2.5 Definition. A hyperplane and a vertex are adjacent if the vertex is included in an edge that crosses the hyperplane. 2.6 Lemma. If k hyperplanes in a CAT(0) cube complex intersect pairwise, then all k intersect within some k-cube. Proof. See [Sag95, Theorem 4.14]. 2.7 Lemma. Assume that k distinct hyperplanes in a CAT(0) cube complex have a non-empty intersection. If are they are all adjacent to a vertex, then they intersect in a k-cube that contains that vertex. Proof. See [NR98a, Lemma 2.14 and Proposition 2.15]. 2.8 Lemma. If two hyperplanes H and K in a CAT(0) cube complex X are disjoint, then one of the half-spaces of H is contained in one of the half-spaces of K. Proof. See [GH10, Lemma 2.10]. 3. The Julg-Valette Complex Let X be a bounded geometry CAT(0) cube complex of dimension n. The aim of this section is to define a differential complex d d d d C[X 0 ] Ð→ C[X 1 ] Ð→ ⋯ Ð→ C[X n−1 ] Ð→ C[X n ] which generalizes the complex introduced by Julg and Valette in the case of a tree [JV83, JV84]. To motivate the subsequent discussion we recall their construction. Let T be a tree with vertex set T 0 and edge set T 1 . Fix a base vertex P0 . The Julg-Valette differential d ∶ C[T 0 ] Ð→ C[T 1 ] is defined by mapping a vertex P ≠ P0 to the first edge E on the unique geodesic path from P to P0 ; P0 itself is mapped to zero. There is an adjoint differential δ ∶ C[T 1 ] Ð→ C[T 0 ] 5 that maps each edge to its furtherest vertex from P0 . The composite dδ is the identity on C[T 1 ], whereas 1−δd is the natural rank-one projection onto the subspace of C[T 0 ] spanned by the base vertex. It follows easily that the cohomology of the Julg-Valette complex is C in degree zero and 0 otherwise. For the higher-dimensional construction we shall need a concept of orientation for the cubes in X, and we begin there. 3.1 Definition. A presentation of a cube consists of a vertex in the cube, together with a linear ordering of the hyperplanes that cut the cube. Two presentations are equivalent if the edge-path distance between the two vertices has the same parity as the permutation between the two orderings. An orientation of a cube of positive dimension is a choice of equivalence class of presentations; an orientation of a vertex is a choice of sign + or −. 3.2 Remark. Every cube has precisely two orientations, and if C is an oriented cube we shall write C ∗ for the same underlying unoriented cube equiped with the opposite orientation. 3.3 Definition. The space C[X q ] of oriented q-cochains on X is the vector space comprising the finitely-supported, anti-symmetric, complex-valued functions on the set of oriented q-cubes X q . Here, a function f is anti-symmetric if f (C) + f (C ∗ ) = 0 for every oriented cube C. 3.4 Remark. The space C[X q ] is a subspace of the vector space of of all finitely supported functions on X q , which we shall call the full space of q-cochains. The formula f ∗ (C) = f (C ∗ ) defines an involution on the full space of q-cochains. We shall write C for both the Dirac function at the oriented q-cube C and for the cube itself; in this way C belongs to the full space of q-cochains. We shall write ⟨C⟩ for the oriented q-cochain ⟨C⟩ = C − C ∗ ∈ C[X q ], which is the difference of the Dirac functions at C and C ∗ (the two possible meanings of the symbol C ∗ agree). Next, we introduce some geometric ideas that will allow us to define the Julg-Valette differential in higher dimensions. The first is the following generalization of the notion of adjacency introduced in Definition 2.5. 3.5 Definition. A q-cube C is adjacent to a hyperplane H if it is disjoint from H and if there exists a (q+1)-cube containing C as a codimension-one face that is cut by H. 6 3.6 Lemma. A q-cube C is adjacent to a hyperplane H if and only if it is not cut by H and all of its vertices are adjacent to H. Proof. Clearly, if the cube C is adjacent to H then so are all of its vertices. For the converse, assume that all of the vertices of C are adjacent to H. By Lemma 2.6 it suffices to show that every hyperplane K that cuts C must also cross H. For this, let P and Q be vertices of C separated only by K, and denote by P op and Qop the vertices separated from P and Q only by H, respectively. These four vertices belong to the four distinct half-space intersections associated with the hyperplanes H and K, so that by Lemma 2.8 these hyperplanes intersect. We shall now fix a base vertex P0 in the complex X. 3.7 Definition. Let H be a hyperplane in X. Define an operator H ∧ ∶ C[X q ] Ð→ C[X q+1 ] as follows. Let C be an oriented q-cube in X. (a) We put H ∧ C = 0 if C is not adjacent to H. (b) In addition, we put H ∧ C = 0 if C is adjacent to H, but C lies in the same H-half-space as the base point P0 . (c) If C is adjacent to H, and is separated by H from the base point, then we define H ∧ C to be the unique cube containing C as a codimension-one face that is cut by H. As for the orientations in (c), if C has positive dimension and is oriented by the vertex P , and by the listing on hyperplanes H1 , . . . , Hq , then we orient H ∧ C by the vertex that is separated from P by the hyperplane H alone, and by the listing of hyperplanes H, H1 , . . . , Hq . If C is a vertex with orientation + then H ∧ C is oriented as above; if C has orientation − then H ∧ C receives the opposite orientation. 3.8 Remark. The linear operator H ∧ of the previous definition is initially defined on the full space of q-cochains by specifying its values on the oriented q-cubes C, which form a basis of this space. We omit the elementary check that for an oriented q-cube C we have (3.1) H ∧ C ∗ = (H ∧ C)∗ , which allows us to restrict H ∧ to an operator on the spaces of oriented q-cochains. We shall employ similar conventions consistently throughout, so that all linear operators will be defined initially on the full space of cochains and then restricted to the space of oriented cochains. Some formulas will hold only for the restricted operators and we shall point these few instances out. 7 3.9 Definition. The Julg-Valette differential is the linear map d∶ C[X q ] Ð→ C[X q+1 ] given by the formula d C = ∑ H ∧ C, H where the sum is taken over all hyperplanes in X. Note that only finitely many terms in this sum are nonzero. 3.10 Example. In the case of a tree, if P is any vertex distinct from the base point P0 , then H ∧ P is the first edge on the geodesic edge-path from P to P0 and our operator d agrees the one defined by Julg and Valette. Once a base point is chosen every edge (in any CAT(0) cube complex) is canonically oriented by selecting the vertex nearest to the base point; vertices are canonically oriented by the orientation +. Thus, because the original construction of Julg and Valette involves only vertices and edges and assumes a base point, orientations do not appear explicitly. 3.11 Lemma. If H1 and H2 are any two hyperplanes, and if C is any oriented cube, then (a) H1 ∧ H2 ∧ C is nonzero if and only if H1 and H2 are distinct, they are both adjacent to C, and they both separate C from P0 . (b) H1 ∧ H2 ∧ C = (H2 ∧ H1 ∧ C)∗ . 3.12 Remark. Here, H1 ∧ H2 ∧ C means H1 ∧ (H2 ∧ C), and so on. Proof. Item (a) follows from Lemmas 2.7 and 2.8. To prove (b), note first that as a result of (a) the left hand side is nonzero if and only if the right hand side is nonzero. In this case, both have the same underlying unoriented (q + 2)-cube, namely the unique cube containing C as a codimension-two face and cut by H1 and H2 . As for orientation, suppose C is presented by the ordering K1 , . . . , Kq and the vertex P . The cube H1 ∧ H2 ∧ C is then presented by the ordering H1 , H2 , K1 , . . . , Kq and the vertex Q, the vertex immediately opposite both H1 and H2 from P ; the cube H2 ∧ H1 ∧ C is presented by the ordering H2 , H1 , K1 , . . . , Kq and the same vertex. The same argument applies when C is a vertex with the orientation +, and the remaining case follows from this and the identity (3.1). 3.13 Lemma. The Julg-Valette differential d, regarded as an operator on the space of oriented cochains, satisfies d2 = 0. Proof. Let C be any q-cube, so that d2 ⟨C⟩ = ∑ H1 ∧ H2 ∧ ⟨C⟩, H1 ,H2 8 As a consequence of Lemma 3.11 we have H1 ∧ H2 ∧ ⟨ C ⟩ + H2 ∧ H1 ∧ ⟨ C ⟩ = 0, and the sum vanishes. It is important here that we work on C[X q ] and not on the larger full space of q-cochains, where the result is not true. See Remarks 3.4 and 3.8. 3.14 Definition. Let H be a hyperplane and let q ≥ 1. Define an operator H ⌟ ∶ C[X q ] Ð→ C[X q−1 ] as follows. Let C be an oriented q-cube in X. (a) If H does not cut C, then H ⌟ C = 0. (b) If H does cut C then we define H ⌟ C to be the codimension-one face of C that lies entirely in the half-space of H that is separated from the base point by H. As for orientations in (b), if C is presented by the ordered list H, H1 , . . . , Hq−1 and the vertex P , and P is not separated from the base point by H, then H ⌟ C is presented by the ordered list H1 , . . . , Hq−1 and the vertex separated from P by H alone. If C is an edge presented by the vertex P not separated from the base point by H then H ⌟ C = P op , the vertex of C opposite to P , with the orientation +; if C is presented by the vertex P and P is separated from the base point by H then H ⌟ C = P with the orientation −. 3.15 Remark. For convenience we shall define the operator H ⌟ vertices. to be zero on 3.16 Example. Let us again consider a tree T with a selected base vertex P0 . If E is any edge then H ⌟ E is zero unless H cuts E. In this case H ⌟ E = P , where P is the vertex of E which is farthest away from P0 ; we choose the orientation − if E was oriented by the vertex P , and the orientation + otherwise. 3.17 Definition. Let q ≥ 0. Define an operator δ∶ C[X q+1 ] Ð→ C[X q ] by δ C = ∑ H ⌟ C. H 3.18 Definition. The oriented q-cubes are a vector space basis for the full space of q-cochains. We equip this space with an inner product by√declaring this to be an orthogonal basis and each oriented q-cube to have length 1/ 2. The subspace C[X q ] of oriented q-cochains inherits an inner product in which ⎧ 1, if C1 = C2 ⎪ ⎪ ⎪ ⎪ ⟨⟨C1 ⟩, ⟨C2 ⟩⟩ = ⎨−1, if C1 = C2∗ ⎪ ⎪ ⎪ ⎪ otherwise. ⎩0, 9 Thus, selecting for each unoriented q-cube one of its possible orientations gives a collection of oriented q-cubes for which the corresponding ⟨C⟩ form an orthonormal basis of the space of oriented q-cochains; this basis is canonical up to signs coming from the relations −⟨C⟩ = ⟨C ∗ ⟩. 3.19 Proposition. The operators d and δ of Definitions 3.9 and 3.17 are formally adjoint and bounded with respect to the inner products in Definition 3.18. Proof. The fact that the operators are bounded follows from our assumption that the complex X has bounded geometry. The fact that they are adjoint follows from the following assertion: for a hyperplane H, an oriented q-cube C and an oriented (q + 1)-cube D we have that H ∧ C = D if and only if H ⌟ D = C. See Definitions 3.7 and 3.14. To conclude the section, let us compute the cohomology of the Julg-Valette complex. We form the Julg-Valette Laplacian (3.2) ∆ = (d + δ)2 = dδ + δd, where all operators are defined on the space of oriented cochains (and not on the larger full space of cochains), where we have available the formula d2 = 0 and hence also δ 2 = 0. 3.20 Proposition. If C is an oriented q-cube then ∆⟨C⟩ = (q + p(C)) ⟨C⟩, where p(C) is the number of hyperplanes that are adjacent to C and separate C from P0 . In particular, the ⟨C⟩ form an orthonormal basis of eigenvectors of ∆, which is invertible on the orthogonal complement of ⟨P0 ⟩ (and so also on the space of oriented q-cochains for q > 0). Proof. We shall show that each oriented q-cube C is an eigenvector of dδ + δd acting on the full space of q-cochains, with eigenvalue as in the statement. If P is a vertex, then dδP = 0 for dimension reasons while δdP = p(P )P , irrespective of the choice of orientation. In higher dimensions, if q ≥ 1 and C is an oriented q-cube, then δdC = ∑ H1 ⌟ H2 ∧ C H1 ,H2 and similarly dδC = ∑ H1 ∧ H2 ⌟ C. H1 ,H2 10 Adding these, and separating the sum into terms where H1 = H2 and terms where H1 ≠ H2 we obtain (3.3) (dδ +δd)C = ∑ (H ⌟ H ∧ C + H ∧ H ⌟ C)+ ∑ (H1 ⌟ H2 ∧ C + H2 ∧ H1 ⌟ C) . H H1 ≠H2 It follows from Lemma 3.21 below that (each term of) the second sum in (3.3) is zero. To understand the first sum in (3.3), observe that if H is any hyperplane and C is any oriented cube, then ⎧ ⎪ ⎪C, if H cuts C H ∧ (H ⌟ C) = ⎨ ⎪ ⎪ ⎩0, otherwise, and also ⎧ ⎪ ⎪C, if C is adjacent to H and is separated by H from P0 H ⌟ (H ∧ C) = ⎨ ⎪ ⎪ ⎩0, otherwise. The proposition now follows. 3.21 Lemma. If H1 and H2 are distinct hyperplanes, then H1 ⌟ H2 ∧ C = H2 ∧ H1 ⌟ C ∗ for every oriented cube C. Proof. If C is a vertex then both sides of the formula are zero. More generally, if C is a q-cube and one of the following two conditions fails then both sides of the formula are zero: (a) H2 is adjacent to C, and separates it from the base point; (b) H1 cuts C and crosses H2 . Assume both of these conditions, and suppose that C may be presented by the listing of hyperplanes H1 , K2 , . . . , Kq and vertex P , and that H1 separates P from the base point ; if C is not an edge this is always possible. We shall leave the exceptional case in which C is an edge oriented by its vertex closest to the base point to the reader. Now, let Q be the vertex of C separated from P by H1 alone, and let P op and Qop be the vertices directly opposite H2 from P and Q, respectively. The cube H ∧ C is presented by the listing H2 , H1 , K2 , . . . , Kq together with the vertex P op , hence also by the listing H1 , H2 , K2 , . . . , Kq and the vertex Qop . It follows that H1 ⌟ H2 ∧ C is presented by the listing H2 , K2 , . . . , Kq and the vertex P op . As for the right hand side, C ∗ is presented by the same listing as C but with the vertex Q, so that H1 ⌟ C ∗ is presented by the listing K2 , . . . , Kq and the vertex P . It follows that H2 ∧ H1 ⌟ C ∗ is presented by the listing H2 , K2 , . . . , Kq and the vertex P op , as required. 11 3.22 Corollary. The cohomology of the Julg-Valette complex is C in degree zero and 0 otherwise. Proof. In degree q = 0 the kernel of d is one dimensional and is spanned by ⟨P0 ⟩. In degrees q ≥ 1 proceed as follows. From d2 = 0 it follows that d∆ = dδd = ∆d, so that also d∆−1 = ∆−1 d. Now the calculation f = ∆∆−1 f = (dδ + δd)∆−1 f = d(δ∆−1 )f shows that an oriented q-cocycle f is also an oriented q-coboundary. We conclude the section with a slight generalization that will be needed later. 3.23 Definition. A weight function for X is a positive-real-valued function w on the set of hyperplanes in X. The weighted Julg-Valette differential is the linear map dw ∶ C[X q ] Ð→ C[X q+1 ] given by the formula dw C = ∑ w(H) H ∧ C. H In addition the adjoint operator δw ∶ C[X q+1 ] Ð→ C[X q ] is defined by δw C = ∑ w(H) H ⌟ C. H 3.24 Remark. We are mainly interested in the following examples, or small variations on them: (a) w(H) ≡ 1. (b) w(H) = the minimal edge-path distance to the base point P0 from a vertex adjacent to H. The calculations in this section are easily repeated in the weighted context: the operators dw and δw are formally adjoint, although unbounded in the case of an unbounded weight function as, for example, in (b); both are differentials when restricted to the spaces of oriented cochains; and the cohomology of either complex is C in degree zero and 0 otherwise. We record here the formula for the weighted Julg-Valette Laplacian. Compare Proposition 3.20. 3.25 Proposition. If C is an oriented q-cube then ∆w ⟨C⟩ = (qw (C) + pw (C))⟨C⟩, where qw (C) is the sum of the squares of the weights of the hyperplanes that cut C and pw (C) is the sum of the squares of the weights of the hyperplanes that are adjacent to C and separate C from the base vertex. 12 4. Parallelism Classes of Cubes The remaining aspects of our generalization of the Julg-Valette and Pytlik-Szwarc theory to CAT(0) cube complexes all rest on the following geometric concept: 4.1 Definition. Two cubes D1 and D2 in a CAT(0) cube complex X are parallel if they have the same dimension, and if every hyperplane that cuts D1 also cuts D2 . H Figure 2: The darker edges form a parallelism class determined by the hyperplane H, see Definition 4.1. Every parallelism class of q-cubes in X is determined by, and determines, a set of q pairwise intersecting hyperplanes, namely the hyperplanes that cut all the cubes in the parallelism class. Call these the determining hyperplanes for the parallelism class. 4.2 Proposition. The intersection of the determining hyperplanes associated to a parallelism class of q-cubes carries the structure of a CAT(0) cube complex in which the p-cubes are the intersections of this space with the (p+q)-cubes in X that are cut by every determining hyperplane. Proof. The case when q = 0 is the assertion that X itself is a CAT(0) cube complex. The case when q = 1 is the assertion that a hyperplane in CAT(0) cube complex X is itself a CAT(0) cube complex in the manner described above, and this is proved by Sageev in [Sag95, Thm. 4.11]. For the general result, we proceed inductively as follows. Suppose given k distinct hyperplanes K1 , . . . , Kk in X. The intersection Z = K2 ∩ ⋅ ⋅ ⋅ ∩ Kk is then a CAT(0) cube complex as described in the statement, and the result will follow from another application of [Sag95, Thm. 4.11] once we verify that K1 ∩Z is a hyperplane in Z. Now the cubes, and so also the midplanes of Z are exactly the non-empty intersections of the cubes and midplanes of X with Z. So, we must show that if two midplanes 13 belonging to the hyperplane K1 of X intersect Z non-trivially then their intersections are hyperplane equivalent in Z. But this follows from the fact that Z is a totally geodesic subspace of X. 4.3 Proposition. Let X be a CAT(0) cube complex and let P be a vertex in X. In each parallelism class of q-cubes there is a unique cube that is closest to P , as measured by the distance from closest point in the cube to P in the edge-path metric. Before beginning the proof, we recall that the edge-path distance between two vertices is equal to the number of hyperplanes separating the vertices; see for example [Sag95, Theorem 4.13]. In addition, let us make note of the following simple fact: 4.4 Lemma. A hyperplane that separates two vertices of distinct cubes in the same parallelism class must intersect every determining hyperplane. Proof. This is obvious if the hyperplane is one of the determining hyperplanes. Otherwise, the hyperplane must in fact separate two cubes in the parallelism class, and so it must separate two midplanes from each determining hyperplane. Since hyperplanes are connected the result follows. Proof of Proposition 4.3. Choose a vertex R from among the cubes in the parallelism class such that (4.1) d(P, R) ≤ d(P, S) for every other such vertex S. We shall prove the addition formula (4.2) d(P, S) = d(P, R) + d(R, S), and this will certainly prove the uniqueness of R. The addition formula (4.2) is a consequence of the following hyperplane property of any R satisfying (4.1): every hyperplane that separates P from R is parallel to (that is, it does not intersect) at least one determining hyperplane. Indeed, it follows from Lemma 4.4 and the hyperplane property that no hyperplane can separate R from both P and S, so that (4.2) follows from the characterization of the edge path distance given above. It remains to prove the hyperplane property for any R satisfying (4.1). For this we shall use the notion of normal cube path from [NR98a, Section 3]. There exists a normal cube path from R to P with vertices R = R1 , . . . , Rl = P. 14 This means that every pair of consecutive Ri are diagonally opposite a cube, called a normal cube, all of whose hyperplanes separate R from P , and every such separating hyperplane cuts exactly one normal cube. It also means that every hyperplane K separating Ri from Ri+1 is parallel to at least one of the hyperplanes H separating Ri−1 from Ri (so each normal cube is, in turn, as large as possible). Note that the hyperplane K is contained completely in the half-space of H that contains P . No hyperplane H separating R = R1 from R2 can intersect every determining hyperplane, for if it did, then it would follow from Lemma 2.7 that H and the determining hyperplanes would intersect in a (q+1)-cube having R as a vertex. The vertex S separated from R by H alone would then belong to a cube in the parallelism class, and would be strictly closer to P than R. Consider the second normal cube, with opposite vertices R3 and R2 . Any hyperplane K separating R3 from R2 is parallel to some hyperplane H separating R2 from R1 , and this is in turn parallel to some determining hyperplane. But K is contained completely in the half-space of H that contains P , while the determining hyperplane is contained completely in the half-space of H that contains R. So K does not meet this determining hyperplane. Continuing in this fashion with successive normal cubes, we find that every hyperplane that separates P from R is indeed parallel to some determining hyperplane, as required. We can now verify the formula mentioned in the introduction: 4.5 Proposition. If X is finite CAT(0) cubical space, then the number of vertices of X is equal to the number of parallelism classes of cubes of all dimensions. Proof. Fix a base vertex P and associate to each vertex Q the first cube in the normal cube path from Q to P . This correspondence induces a bijection from vertices to parallelism classes of cubes. Indeed it follows from the hyperplane property that if C is the nearest cube to P within its parallelism class, and if Q is the vertex of C furthest from P , then C is the first cube in the normal cube path from Q to P . So our map is surjective. On the other hand it follows from the addition formula that if C is not nearest to P within its equivalence class, and if Q is the vertex of C furthest from P , then any hyperplane that separates Q from the nearest cube also separates Q from P . Choosing a hyperplane that is adjacent to Q but not does not cut C, we find that C is not the first cube in the normal cube path from Q to P , and our map is injective. 4.6 Proposition. Let X be a CAT(0) cube complex and let P and Q be vertices in X that are separated by a single hyperplane H. The nearest q-cubes to P and Q within 15 a parallelism class are either the same, or are opposite faces, separated by H, of a (q+1)-cube that is cut by H. Proof. Denote by R and S the nearest vertices to P and Q, respectively, among the vertices of cubes in the equivalence class, and suppose that a hyperplane K separates R from S. Then it must separate P from S by the addition formula (4.2) applied to the nearest point R, and also separate Q from R, by the addition formula applied to the nearest point S. So it must separate P from Q, and hence must be H. So either there is no hyperplane separating R from S, in which case of course R = S and the nearest cubes to P and Q are the same, or R is opposite S across H. If H is a determining hyperplane, then R and S are vertices of the same q-cube in the parallelism class; if H is not a determining hyperplane, then R and S belong to q-cubes that are opposite to one another across H, as required. 5. The Pytlik-Szwarc Complex As described in the introduction, our ultimate goal involves deforming the JulgValette complex into what we call the Pytlik-Szwarc complex , a complex with the same cohomology but which is equivariant in the case of a group acting on the CAT(0) cube complex. In this short section we describe the (algebraic) Pytlik-Szwarc complex. As motivation for what follows we consider how to compare orientations on parallel cubes. The key observation is that a vertex in a q-cube is uniquely determined by its position relative to the cutting hyperplanes K1 , . . . , Kq . Thus, there is a natural isometry between (the vertex sets of) any two parallel q-cubes. We shall say that parallel q-cubes of positive dimension are compatibly oriented if their orientations are presented by vertices P1 and P2 which correspond under this isometry and a common listing of the cutting hyperplanes K1 , . . . , Kq ; vertices are compatibly oriented if they are oriented by the same choice of sign. We shall now generalize these considerations to pairs comprising a cube and one of its faces. 5.1 Definition. A cube pair is a pair (C, D) in which C is a cube containing D as a face. Two cube pairs (C1 , D1 ) and (C2 , D2 ) are parallel if the cubes C1 and C2 are parallel, and the cubes D1 and D2 are parallel too. When D is a q-cube, and C is a (p + q)-cube, we shall call (C, D) a (p, q)-cube pair, always keeping in mind that in this notation p is the codimension of D in C. We may describe the parallelism class of a (p, q)-cube pair (C, D) by grouping the determining hyperplanes of the parallelism class of C into a symbol (5.1) { H1 , . . . , Hp ∣ K1 , . . . , Kq } , 16 in which the K1 , . . . , Kq determine the parallelism class of D. The hyperplanes H1 , . . . , Hp which cut C but not D are the complementary hyperplanes of the cube pair, or of the parallelism class. An orientation of a cube pair (C, D) is an orientation of the face D. In order to compare orientations of parallel cube pairs (Ci , Di ) we can compare the orientations on the faces Di , which are themselves parallel cubes, but must also take into account the position of the faces within the ambient cubes Ci . For this we introduce the following notion. 5.2 Definition. Two parallel cube pairs (C1 , D1 ) and (C2 , D2 ) have the same parity if the number of complementary hyperplanes that separate D1 from D2 , is even. Otherwise they have the opposite parity. 5.3 Definition. Let (C1 , D1 ) and (C2 , D2 ) be parallel cube pairs, each with an orientation. The orientations are aligned if one of the following conditions holds: (a) (C1 , D1 ) and (C2 , D2 ) have the same parity, and D1 and D2 are compatibly oriented; or (b) (C1 , D1 ) and (C2 , D2 ) have the opposite parity, and D1 and D2 are not compatibly oriented. In the symbol (5.1) describing the parallelism class of a cube pair (C, D), the hyperplanes are not ordered; the only relevant data is which are to the left, and which to the right of the vertical bar. If the cube pair (C, D) is oriented, then the symbol receives additional structure coming from the orientation of D. We group the determining hyperplanes as before, and include a vertex R of D into a new symbol (5.2) { H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R } . Here, in the case q > 0, the hyperplanes K1 , . . . , Kq form an ordered list which, together with the vertex R are a presentation of the oriented cube D. In the case q = 0 this list is empty and we replace it by the sign representing the orientation of the vertex D = R, obtaining a symbol of the form (5.3) { H1 , . . . , Hp ∣ + ∣ R } or { H1 , . . . , Hp ∣ − ∣ R } . In either case the hyperplanes H1 , . . . , Hp remain an unordered set. Conversely, a formal expression as in (5.2) or (5.3) is the symbol of some oriented (p, q)-cube pair precisely when the hyperplanes H1 , . . . , Kq are distinct and have nonempty (pairwise) intersection, and the vertex R is adjacent to all of them. The following definition captures the notion of alignment of orientations in terms of the associated symbols. 17 5.4 Definition. Symbols { H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R } and { H1′ , . . . , Hp′ ∣ K1′ , . . . , Kq′ ∣ R′ } of the form (5.2) are equivalent if (a) the sets { H1 , . . . , Hp } and { H1′ , . . . , Hp′ } are equal; (b) the K1 , . . . , Kq are a permutation of the K1′ , . . . , Kq′ ; and (c) the number of hyperplanes among the H1 , . . . , Kq separating R and R′ has the same parity as the permutation in (b). In the case of symbols of the form (5.3) we omit (b) and replace (c) by (c′ ) the number of hyperplanes among the H1 , . . . , Hp separating R and R′ is even if the orientation signs agree, and odd otherwise. An oriented (p, q)-symbol is an equivalence class of symbols. We shall denote the equivalence class of the symbol (5.2) by [ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ], or simply by [ H ∣ K ∣ R ] when no confusion can arise, and we use similar notation in the case of symbols of the form (5.3). We shall denote the set of oriented (p, q)symbols by Hqp , and the (disjoint) union Hq0 ∪ ⋯ ∪ Hqn−q by Hq . 5.5 Proposition. The oriented symbols associated to oriented (p, q)-cube pairs agree precisely when the orientations of the cube pairs are aligned. Our generalization of the Pytlik-Szwarc complex will be a differential complex designed to capture the combinatorics of oriented, aligned cube pairs: (5.4) d d d d C[H0 ] Ð→ C[H1 ] Ð→ ⋯ Ð→ C[Hn−1 ] Ð→ C[Hn ]. 5.6 Definition. The space of oriented q-cochains of type p in the Pytlik-Szwarc complex is the space of finitely supported, anti-symmetric, complex-valued functions on Hqp . Here, a function is anti-symmetric if f ([ H ∣ K ∣ R ]) + f ([ H ∣ K ∣ R ]∗ ) = 0, where we have used the involution on Hqp defined by reversing the orientation of the symbol. We shall denote this space by C[Hqp ]. The space of oriented q-cochains is defined similarly using the oriented symbols of type (p, q) for all 0 ≤ p ≤ n − q. It splits as the direct sum C[Hq ] = C[Hq0 ] ⊕ ⋅ ⋅ ⋅ ⊕ C[Hqn−q ]. 18 5.7 Remark. As with the Julg-Valette cochains, the space of oriented Pytlik-Szwarc q-cochains of type p is a subspace of the full space of Pytlik-Szwarc q-cochains of type p, which is the vector space of all finitely supported functions on the set Hqp . We shall follow conventions similar to those in Section 3: we write [ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ] or [H ∣K ∣R] for both the Dirac function at an oriented symbol and the symbol itself, and ⟨ H ∣ K ∣ R ⟩ = [ H ∣ K ∣ R ] − [ H ∣ K ∣ R ] ∈ C[Hqp ] ∗ for the difference of the Dirac functions. Further, linear operators will be defined on the full space of cochains by specifying their values on the basis of Dirac functions at the oriented symbols. We shall typically omit the elementary check that an operator commutes with the involution and so restricts to an operator on the spaces of oriented cochains. We now define the differential in the Pytlik-Szwarc complex (5.4). 5.8 Definition. The Pytlik-Szwarc differential is the linear map d ∶ C[Hq ] → C[Hq+1 ] which is 0 on oriented symbols of type (0, q) and which satisfies p ̂i , . . . , Hp ∣ Hi , K1 , . . . , Kq ∣ Ri ] d [ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ] = ∑ [ H1 , . . . , H i=1 for oriented (p, q)-symbols with p, q ≥ 1. Here, Ri is the vertex separated from R by Hi alone and, as usual, a ‘hat’ means that an entry is removed. When q = 0 the same formula is used for symbols of the form [H ∣+∣ R] which, together with the requirement that d commute with the involution, determines d on symbols of the form [H ∣ − ∣ R]. Since d maps an oriented symbol of type (p, q) to a linear combination of oriented symbols of type (p − 1, q + 1) in all cases, it splits as the direct sum of linear maps p−1 ] d ∶ C[Hqp ] Ð→ C[Hq+1 for 0 < p ≤ n − q, and is 0 on the C[Hq0 ]. 5.9 Lemma. The Pytlik-Szwarc differential d, regarded as an operator on the space of oriented cochains, satisfies d2 = 0. 5.10 Example. Let T be a tree. The Pytlik-Szwarc complex has the form d ∶ C ⊕ C[H01 ] Ð→ C[H10 ], where d is 0 on C and, after identifying each of C[H01 ] and C[H10 ] with the space of finitely supported functions on the set of edges of T , the identity C[H01 ] → C[H10 ]. For the identifications, note that both H10 and H01 are identified with the set of oriented edges in T and that the involution acts by reversing the orientation. So the space of anti-symmetric functions on each identifies with the space of finitely supported functions on the set of edges. 19 Our goal for the remainder of this section is to analyze the Pytlik-Szwarc complex. Emphasizing the similarities with the Julg-Valette complex we begin by providing a formula for the formal adjoint of the Pytlik-Szwarc differential. 5.11 Definition. Let δ ∶ C[Hq ] → C[Hq−1 ] be the linear map which is 0 on oriented symbols of type (p, 0) and which satisfies q ̂j , . . . , Kq ∣ R ] , δ [ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ] = ∑(−1)j [ H1 , . . . , Hp , Kj ∣ K1 , . . . , K j=1 for oriented symbols of type (p, q) with q ≥ 1. Again a ‘hat’ means that an entry is removed. Since δ maps an oriented symbol of type (p, q) to a linear combination of oriented symbols of type (p + 1, q − 1) it splits as a direct sum of linear maps p+1 δ ∶ C[Hqp ] → C[Hq−1 ] for 0 < q ≤ n − p, and is 0 on the C[H0p ]. 5.12 Definition. We define an inner product on the full space of Pytlik-Szwarc qcochains √ by declaring that the elements of Hq are orthogonal, and that each has length 1/ 2. The subspace C[Hq ] of oriented Pytlik-Szwarc q-cochains inherits an inner product in which ⎧ 1, [ H ∣ K ∣ R ] = [ H ′ ∣ K ′ ∣ R′ ] ⎪ ⎪ ⎪ ⎪ ⟨⟨ H ∣ K ∣ R ⟩ , ⟨ H ′ ∣ K ′ ∣ R′ ⟩⟩ = ⎨−1, [ H ∣ K ∣ R ] = [ H ′ ∣ K ′ ∣ R′ ]∗ ⎪ ⎪ ⎪ ⎪ otherwise ⎩0, 5.13 Lemma. The operators d and δ of Definitions 5.8 and 5.11 are formally adjoint and bounded with respect to the inner products in Definition 5.12. 5.14 Proposition. The Pytlik-Szwarc Laplacian ∆ = (d + δ)2 = dδ + δd ∶ C[Hq ] Ð→ C[Hq ] acts on the summand C[Hqp ] as scalar multiplication by p + q. Proof. We prove the above statement for the operator dδ + δd defined on the full space of cochains. This operator equals ∆ when restricted to the subspace of oriented cochains. The proof is a direct calculation. The result of applying δd to an oriented symbol [ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ] of type (p, q) is the sum p ∑[ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ] + i=1 p q ̂i , . . . , Hp , Kj ∣ Hi , K1 , . . . , K ̂j , . . . , Kq ∣ R ], + ∑ ∑(−1)j [ H1 , . . . , H i=1 j=1 20 whereas the result of applying dδ is q ̂ j , . . . , Kq ∣ R ] + ∑(−1)j+1 [ H1 , . . . , Hp ∣ Kj , K1 , . . . , K j=1 q p j=1 i=1 ̂i , . . . , Hp , Kj ∣ Hi , K1 , . . . , K ̂j , . . . , Kq ∣ R ]. + ∑(−1)j+1 ∑[ H1 , . . . , H When these are added, the second summands cancel and the first summands combine to give (p + q)[ H1 , . . . , Hp ∣ K1 , . . . , Kq ∣ R ]. 5.15 Corollary. The cohomology of the Pytlik-Szwarc complex is C in dimension zero and 0 otherwise. 6. Continuous Fields of Hilbert Spaces Our objective over the next several sections is to construct a family of complexes that continuously interpolates between the Julg-Valette complex and the Pytlik-Szwarc complex. We shall construct the interpolation within the Hilbert space context, using the concept of a continuous field of Hilbert spaces. We refer the reader to [Dix77, Chapter 10] for a comprehensive treatment of continuous fields of Hilbert spaces. In brief, a continuous field of Hilbert spaces over a topological space T consists of a family of Hilbert spaces parametrized by the points of T , together with a distinguished family Σ of sections that satisfies several axioms, of which the most important is that the pointwise inner product of any two sections in Σ is a continuous function on T . See [Dix77, Definition 10.1.2]. The following theorem gives a convenient means of constructing continuous fields. 6.1 Theorem. Let T be a topological space, let {Ht } be a family of Hilbert spaces parametrized by the points of T , and let Σ0 be a family of sections that satisfies the following conditions: (a) The pointwise inner product of any two sections in Σ0 is a continuous function on T . (b) For every t ∈ T the linear span of {σ(t) ∶ σ ∈ Σ } is dense in Ht . There is a unique enlargement of Σ0 that gives {Ht }t∈T the structure of a continuous field of Hilbert spaces. Proof. The enlargement Σ consists of all sections σ such that for every t0 ∈ T and every ε > 0 there is a section σ0 in the linear span of Σ0 such that ∥σ0 (t) − σ(t)∥t < ε for all t in some neighborhood of t0 . See [Dix77, Proposition 10.2.3]. 21 6.2 Definition. We shall call a family Σ0 , as in the statement of Theorem 6.1, a generating family of sections for the associated continuous field of Hilbert spaces. Ultimately we shall use the parameter space T = [0, ∞], but in this section we shall concentrate on the open subspace (0, ∞], and then extend to [0, ∞] in the next section. In both this section and the next we shall deal only with the construction of continuous fields of Hilbert spaces; we shall construct the differentials acting between these fields in Section 8. We begin by completing the various cochain spaces from Section 3 in the natural way so as to obtain Hilbert spaces. 6.3 Definition. Denote by `2 (X q ) the Hilbert space completion of the Julg-Valette oriented cochain space C[X q ] in the inner product of Definition 3.18 in which the basis comprised of the oriented cochains ⟨ C ⟩ is orthonormal. 6.4 Remark. As was the case in Section 3, we shall also consider the full cochain space comprised of the square-summable functions on the set of oriented q-cubes. This is the completion of the full space of Julg-Valette q-cochains in the inner product of Definition 3.18, and contains the space `2 (X q ) of the previous definition as the subspace of anti-symmetric functions. We shall now construct, for every q ≥ 0, families of Hilbert spaces parametrized by the topological space (0, ∞]. These will be completions of the spaces of Julg-Valette q-cochains, both full and oriented, but with respect to a family of pairwise distinct inner products. Considering the oriented cochains, we obtain a family of Hilbert spaces `2t (X q ) each of which is a completion of the corresponding C[X q ]. The Hilbert space `2∞ (X q ) will be the space `2 (X q ) just defined. 6.5 Definition. If D1 and D2 are q-cubes in X, and if D1 and D2 are parallel and have compatible orientations, then denote by d(D1 , D2 ) the number of hyperplanes in X that are disjoint from D1 and D2 and that separate D1 from D2 . If D1 and D2 are q-cubes in X, but are not parallel, or have incompatible orientations, then set d(D1 , D2 ) = ∞. If D1 and D2 are (compatibly oriented) vertices, then d(D1 , D2 ) is the edge-path distance from D1 to D2 . In higher dimensions, if D1 and D2 are parallel then they may be identified with vertices in the CAT(0) cube comples which is the intersection of the determining hyperplanes for the parallelism class. If in addition they are compatibly oriented, then d(D1 , D2 ) is the edge-path distance in this complex. Compare Theorem 4.2. 6.6 Definition. Let t > 0 and q ≥ 0. For every two oriented q-cubes D1 and D2 define ⟨D1 , D2 ⟩t = 21 exp(− 12 t2 d(D1 , D2 )), 22 where of course we set exp(− 12 t2 d(D1 , D2 )) = 0 if d(D1 , D2 ) = ∞, and then extend by linearity to a sesqui-linear form on the full space of Julg-Valette q-cochains. Note that the formula in the definition makes sense when t = ∞, where 1 2 exp(− 12 t2 d(D1 , D2 )) ⎧ ⎪ ⎪ 21 , D1 = D2 =⎨ ⎪ ⎪ ⎩0, D1 ≠ D2 . In particular, the form ⟨ , ⟩∞ is the one underlying Definition 3.18 that we used to define `2 (X q ). 6.7 Theorem. The sesqui-linear form ⟨ , ⟩t is positive semi-definite. Proof. Consideration of oriented, as opposed to unoriented, cubes merely gives two (orthogonal copies) of each space of functions. Aside from this, the result is proved in [NR98a, Technical Lemma, p.6] in the case q = 0. See also [GH10, Prop. 3.6]. The case q > 0 reduces to the case q = 0 using Theorem 4.2. 6.8 Definition. For t ∈ (0, ∞] denote by `2t (X q ) the Hilbert space completion of the Julg-Valette oriented cochain space C[X q ] in the inner product ⟨ , ⟩t . 6.9 Remark. The Hilbert spaces of the previous definition are completions of the quotient of C[X q ] by the elements of zero norm. We shall soon see that every nonzero linear combination of oriented q-cubes has nonzero `2t -norm for every t, so the natural maps from C[X q ] into the `2t (X q ) are injective. Next, we define a generating family of sections, using either one of the following lemmas; on the basis of Theorem 6.1, it is easy to check that the continuous fields arising from the lemmas are one and the same. 6.10 Lemma. Let t ∈ (0, ∞]. The set of all sections of the form t ↦ f ∈ C[X q ] ⊆ `2t (X q ), indexed by all f ∈ C[X q ], is a generating family of sections for a continuous field. 6.11 Lemma. The set of all sections of the form t ↦ f (t) ⟨C⟩ ∈ `2t (X q ), where f is a continuous scalar function on (0, ∞] and C is an oriented q-cube, is a generating family of sections for a continuous field. 23 The continuous fields that we have constructed are not particularly interesting as continuous fields. In fact they are isomorphic to constant fields (they become much more interesting when further structure is taken into account, as we shall do later in the paper). For the sequel it will be important to fix a particular isomorphism, and we conclude this section by doing this. The required unitary isomorphism will be defined using certain cocycle operators Wt (C1 , C2 ), which are analogues of those studied by Valette in [Val90] in the case of trees. In the case q = 0 the cocycle operators for general CAT(0) cube complexes were constructed in [GH10]. The case where q > 0 involves only a minor elaboration of the q = 0 case, and so we shall refer to [GH10] for details in what follows. 6.12 Definition. If D is a q-cube that is adjacent to a hyperplane H, then define Dop to be the opposite face to D in the unique (q + 1)-cube that is cut by H and contains D as a q-face (such a cube exists by Lemma 3.6). In the case D is oriented, we orient Dop compatibly. In either case, we shall refer to a pair such as D and Dop as being adjacent across H. 6.13 Definition. Let C and C op be adjacent across a hyperplane H, as in the previous definition. If D is any oriented q-cube that is adjacent to H, then for t ∈ (0, ∞] we define 1 2 ⎧ 2 ⎪ ⎪(1 − e−t )1/2 D − e− 2 t Dop , if D is separated from C by H Wt (C , C)D = ⎨ − 1 t2 op 2 ⎪ 2 D + (1 − e−t )1/2 D, if D is not separated from C by H; ⎪ ⎩e op in addition we define Wt (C op , C)D = D if D is not adjacent to H. We extend Wt (C op , C) by linearity to a linear operator on the spaces of (full and oriented) Julg-Valette q-cochains. For example W0 (C op , C)C = C op and W0 (C op , C)C op = −C, W∞ (C op , C)C = C and W∞ (C op , C)C op = C op , while and indeed W∞ (C op , C) is the identity operator. More generally, when restricted to the two-dimensional space spanned by the ordered basis (D, Dop ) with D adjacent to H but not separated from C by H, the operator Wt (C op , C) acts as the unitary matrix 1 2 2 (1 − et )1/2 −e− 2 t [ ]. 1 2 2 e− 2 t (1 − et )1/2 24 In particular, Wt (C op , C) extends to a unitary operator on the completed cochain spaces of Definition 6.3 and subsequent remark. Let us now assume that two q-cubes C1 and C2 are parallel, but not necessarily adjacent across a hyperplane. It follows from Theorem 4.2 that that there exists a path of q-cubes E1 , E2 , . . . , En , with E1 = C1 and En = C2 , where each consecutive pair Ei , Ei+1 consists of parallel and adjacent q-cubes. For all t ≥ 0 let us define (6.1) Wt (C1 , C2 ) = Wt (E1 , E2 )Wt (E2 , E3 ) . . . Wt (En−1 , En ). This notation, which omits mention of the path, is justified by the following result: 6.14 Proposition. The unitary operator Wt (C1 , C2 ) is independent of the path from C1 to C2 . Proof. Let γ and γ ′ be two cube paths connecting cubes C1 and C2 . As the cubes C1 and C2 are parallel, by Theorem 4.2 they can be thought of as vertices in the CAT(0) cube complex created from their parallelism class. The paths γ and γ ′ then give rise to vertex paths in this CAT(0) cube complex with common beginning and end vertices. In this way we reduce the general case of the proposition to the zero dimensional case, which has been proved in [GH10, Lemma 3.3]. In what follows we shall use the base vertex P0 that was selected during the construction of the Julg-Valette complex. 6.15 Definition. Let t ∈ (0, ∞]. For every oriented q-cube D let Ut D = Wt (D0 , D)D, where D0 is the cube nearest to the base vertex P0 in the parallelism class of D (see Proposition 4.3). Extend Ut by linearity to a linear operator on the spaces of full and oriented Julg-Valette q-cochains; in particular, on oriented cochains we have Ut ∶ C[X q ] Ð→ C[X q ]. 6.16 Lemma. The linear operator Ut is a vector space isomorphism. Proof. Consider the increasing filtration of the cochain space, indexed by the natural numbers, in which the nth space is spanned by those cubes whose nearest vertex to P0 in the edge-path metric is of distance n or less from P0 . The operator Ut preserves this filtration. In fact, a simple direct calculation (see [GH10, Lemma 4.7]) shows that Ut D = Wt (D0 , D)D = constant ⋅ D + linear combination of cubes closer to P0 than D. This formula shows that the induced map on associated graded spaces is an isomorphism. So Ut is an isomorphism. 25 6.17 Lemma. If D1 and D2 are any two oriented q-cubes in X, then ⟨Ut D1 , Ut D2 ⟩ = ⟨D1 , D2 ⟩t , where the inner product on the left hand side is that of `2 (X q ). 6.18 Remark. The lemma implies that the sesqui-linear form ⟨ , ⟩t is positive definite for each t > 0, since ⟨ , ⟩ is positive-definite and Ut is an isomorphism. Proof of the lemma. We can assume that the q-cubes D1 and D2 are parallel and compatibly oriented since otherwise both sides of the formula are zero. Let D0 denote the q-cube in the parallelism class that is nearest to the base vertex P0 . Then the unitarity of Wt and Proposition 6.14 give ⟨Ut D1 , Ut D2 ⟩ = ⟨Wt (D0 , D1 )D1 , Wt (D0 , D2 )D2 ⟩ = ⟨Wt (D0 , D2 )∗ Wt (D0 , D1 )D1 , D2 ⟩ = ⟨Wt (D2 , D0 )Wt (D0 , D1 )D1 , D2 ⟩ = ⟨Wt (D2 , D1 )D1 , D2 ⟩. But, by an elaboration of [GH10, Proposition 3.6] we have 1 2 d(D (6.2) Wt (D2 , D1 )D1 = e− 2 t 2 ,D1 ) D2 + multiples of oriented cubes other than D2 . Hence we conclude that 1 2 d(D ⟨Wt (D2 , D1 )D1 , D2 ⟩ = 21 e− 2 t 2 ,D1 ) = ⟨D1 , D2 ⟩t , as required. The following results are immediate consequences of the above: 6.19 Theorem. For all t ∈ (0, ∞] the map Ut ∶ C[X q ] Ð→ C[X q ] extends to a unitary isomorphism Ut ∶ `2t (X q ) Ð→ `2∞ (X q ). 6.20 Theorem. The unitary operators Ut determine a unitary isomorphism from the continuous field {`2t (X q )}t∈(0,∞] generated by sections in Lemmas 6.10 and 6.11 to the constant field with fiber `2 (X q ). 26 7. Extension of the Continuous Field In this section we shall extend the continuous fields over (0, ∞] defined in Section 6 by adding the following fibers at t = 0. 7.1 Definition. We shall denote by `20 (X q ) the completion of the space of oriented Pytlik-Szwarc q-cochains in the inner product of Definition 5.12. It is the subspace of anti-symmetric functions in the Hilbert space of all square-summable functions on the set of oriented symbols Hq . The following two definitions focus on the particular continuous sections that we shall extend. 7.2 Definition. Let p, q ≥ 0 and let (C, D) be an oriented (p, q)-cube pair. The associated basic q-cochain of type p is the linear combination fC,D = ∑ (−1)d(D,E) E E∥C D in the full cochain space. Here, the sum is over those q-cubes E in C that are parallel to D, each of which is given the orientation compatible with the orientation of D. The associated basic oriented cochain is f⟨C,D⟩ = fC,D − fC,D∗ = ∑ (−1)d(D,E) ⟨ E ⟩, E∥C D belonging to the space C[X q ] of oriented q-cochains. 7.3 Example. For q ≥ 0, a basic q-cochain of type p = 0 is just a single oriented q-cube. A basic 0-cochain of type 1 is a difference of vertices across an edge. Finally, if p + q > dim(X) then there are no basic q-cochains of type p, since there are no (p + q)-cubes in X. 7.4 Definition. A basic section of type p of the continuous field { `2t (X q ) }t∈(0,∞] is a continuous section of the form (0, ∞] ∋ t z→ t−p f⟨C,D⟩ ∈ `2t (X q ), where (C, D) is an oriented (p, q)-cube pair. We shall extend the basic sections to sections over [0, ∞] by assigning to each of them a value at t = 0 in the Hilbert space `20 (X q ), namely the Pytlik-Szwarc symbol associated to the cube pair (C, D), as in Section 5. We shall write it as ⟨ C, D ⟩ = [C, D] − [C, D]∗ ∈ `20 (X q ). Compare Definition 5.4 and Remark 5.7. We shall prove the following result. 27 7.5 Theorem. Let q ≥ 0. (a) The pointwise inner product ⟨t−p1 fC1 ,D1 , t−p2 fC2 ,D2 ⟩t of any two basic sections (of possibly different types) extends to a continuous function on [0, ∞]. (b) The value of this continuous function at 0 ∈ [0, ∞] is equal to the inner product ⟨[C1 , D1 ], [C2 , D2 ]⟩0 . 7.6 Example. Suppose that X is a tree. When q = 1, the only basic sections are those of type p = 0, and they are the functions t ↦ E, where E is an oriented edge in X. Theorem 7.5 is easily checked in this case. When q = 0 there are basic sections t ↦ Q of type p = 0, which are again easily handled, but also basic sections of type p = 1. These have the form t ↦ t−1 (P − Q), where P and Q are adjacent vertices in the tree. One calculates that 1 2 ⟨t−1 (P − Q), t−1 (P − Q)⟩t = 2t−2 (1 − e− 2 t ), which converges to 1 as t → 0, in agreement with Theorem 7.5. In addition if t−1 (R−S) is a second, distinct basic cochain, and if the vertices P, Q, R, S are arranged in sequence along a path in the tree, then a short calculation reveals that if d is the distance between Q and R, then 1 2 1 2 ⟨t−1 (P − Q), t−1 (R − S)⟩t = −t−2 e−d 2 t (1 − e− 2 t )2 = O(t2 ). In particular the inner product converges to 0 as t ↘ 0, again in agreement with Theorem 7.5. 7.7 Definition. An extended basic section of type p of the continuous field of Hilbert spaces { `2t (X q ) }t∈[0,∞] is a section of the form ⎧ ⎪ t=0 ⎪⟨C, D⟩, t z→ ⎨ −p ⎪ ⎪ ⎩t f⟨C,D⟩ , t > 0, where (C, D) is an oriented (p, q)-cube pair. The basic sections form a generating family of sections for the continuous field {`2t (X q )}t∈(0,∞] , and of course the symbols ⟨C, D⟩ span `20 (X q ). So it follows from the theorem that the extended basic sections form a generating family of sections for a continuous field over [0, ∞] with fibers `2t (X q ), whose restriction to (0, ∞] is the continuous field of the previous section. 28 We shall prove Theorem 7.5 by carrying out a sequence of smaller calculations. The following formula is common to all of them, and it will also be of use in Section 8. Here, and subsequently, we shall write O(tp ) for any finite sum of oriented q-cubes times coefficient functions, each of which is bounded by a constant times tp as t ↘ 0. 7.8 Lemma. If (C, D) is an oriented (p, q)-cube pair then ∑ (−1)d(D,E) Wt (D, E)E = (−t)p Dop + O(tp+1 ), (7.1) E∥C D where Dop is the q-face of C separated from D by the complementary hyperplanes of the pair (C, D), with compatible orientation. Proof. We shall prove the lemma by induction on p. The case p = 0 is clear. As for the case p > 0, let H be a hyperplane that cuts C but not D. Our aim is to apply the induction hypothesis to the codimension-one faces of C separated by H. Denote these faces by C± with C+ being the face containing D; denote D+ = D and D− the face of C− directly across H from D; and finally denote by D±op the face in C± separated from D± by all the complementary hyperplanes of the pair (C, D) except H. We have, in particular, Dop = D−op . Now, the expression on the left hand side of (7.1) depends on the cube pair (C, D) and for the course of the proof we shall denote it by gC,D . We compute the summand of gC,D corresponding to a face E that belongs to C− using the path from D+ to D− and on to E. Doing so, we see that gC,D = gC+ ,D+ − Wt (D+ , D− )gC− ,D− 1 2 1 2 = (1 − e− 2 t ) gC+ ,D+ − (1 − e−t ) 2 gC− ,D− . Here, we have used that the coefficient of gC+ ,D+ at a face E of C+ equals the coefficient of gC− ,D− at the face of C− which is directly across H from E. By the induction 1 2 hypothesis, gC+ ,D+ = (−t)p−1 D+op + O(tp ), which is O(tp−1 ). Since 1 − e− 2 t is O(t2 ) the first term in this expression is O(tp+1 ). As for the second term, again by induction we have gC− ,D− = (−t)p−1 D−op + O(tp ), which is O(tp−1 ). It follows that 2 1 2 1 −(1 − e−t ) 2 gC− ,D− = −t gC− ,D− + (t − (1 − e−t ) 2 ) gC− ,D− 2 1 = (−t)p D−op + O(tp+1 ) + (t − (1 − e−t ) 2 )O(tp−1 ) = (−t)p Dop + O(tp+1 ), 1 where we have used that t − (1 − e−t ) 2 is O(t3 ). Putting things together, the lemma is proved. 2 In the previous section we defined unitary isomorphisms Ut ∶ `2t (X q ) → `2 (X q ). While these were defined using a specific choice of base point within each parallelism class 29 of q-cubes, the choice is not important as far as the unitarity of Ut is concerned. We shall exploit this by making judicious choices of base point to calculate the inner products in Theorem 7.5. 7.9 Lemma. Let (C, D) be an oriented (p, q)-cube pair, and let fC,D be the associated basic q-cochain of type p. The pointwise inner product ⟨t−p fC,D , t−p fC,D ⟩t converges to 1 2 as t ↘ 0. Proof. Choose D as the base point for defining the unitary isomorphisms Ut . Then Ut fC,D is exactly the expression (7.1) in the previous lemma. It follows from the lemma that ⟨t−p fC,D , t−p fC,D ⟩t = ⟨t−p Ut fC,D , t−p Ut fC,D ⟩∞ = ⟨(−1)p Dop + O(t), (−1)p Dop + O(t)⟩∞ = 21 + O(t), and the result follows. 7.10 Lemma. Let (C1 , D1 ) and (C2 , D2 ) be parallel (p, q)-cube pairs of the same parity, in which the q-dimensional faces are compatibly oriented. The pointwise inner product ⟨t−p fC1 ,D1 , t−p fC2 ,D2 ⟩t converges to 1 2 as t ↘ 0. Proof. We may assume that D2 lies on the same side of each of the complementary hyperplanes of the parallelism class as D1 ; indeed replacing D2 by this face, if necessary, does not change the corresponding basic cochain. Choose D1 as the base point for defining the unitary isomorphisms Ut , so that by Lemma 7.8 we have Ut fC1 ,D1 = (−t)p D1op + O(tp+1 ) and also, using the identity Wt (D1 , E) = Wt (D1 , D2 )Wt (D2 , E) for the q-dimensional faces E of C2 , Ut fC2 ,D2 = (−t)p Wt (D1 , D2 )D2op + O(tp+1 ). But, the hyperplanes separating D1 and D2 are precisely those separating D1op and D2op , so that by (6.2) we have Wt (D1 , D2 )D2op = Wt (D1op , D2op )D2op 1 2 = e− 2 d(D1 ,D2 )t D1op + terms orthogonal to D1op . 30 Putting everything together we get ⟨t−p fC1 ,D1 , t−p fC2 ,D2 ⟩t = ⟨t−p Ut fC1 ,D1 , t−p Ut fC2 ,D2 ⟩∞ 1 2 = e− 2 d(D1 ,D2 )t ⟨(−1)p D1op , (−1)p D1op ⟩∞ + O(t) and the result follows from this. 7.11 Lemma. Let (C1 , D1 ) and (C2 , D2 ) be oriented cube pairs of types (p1 , q) and (p2 , q), respectively, and let fC1 ,D1 and fC2 ,D2 be the associated basic q-cochains. If (C1 , D1 ) and (C2 , D2 ) are not parallel, or if D1 and D2 are not compatibly oriented, then the pointwise inner product ⟨t−p1 fC1 ,D1 , t−p2 fC2 ,D2 ⟩t converges to 0 as t ↘ 0. In particular, this is the case if p1 ≠ p2 . Proof. If D1 and D2 fail to be parallel or have incompatible orientations, then fC1 ,D1 and fC2 ,D2 are orthogonal in the full cochain space for all t > 0, and the lemma is proved. So we can assume that D1 and D2 are parallel and compatibly oriented, and therefore that C1 and C2 are not parallel. There is then, after reindexing if necessary, a hyperplane H that passes through C2 but not C1 , and through neither D1 nor D2 . Choose as a base point for the unitary Ut a q-dimensional face D of C2 which is parallel to the Di , compatibly oriented, and on the same side of H as the cube C1 . So fC2 ,D2 = ±fC2 ,D and also ⟨t−p1 fC1 ,D1 , t−p2 fC2 ,D ⟩t = ⟨t−p1 Ut fC1 ,D1 , t−p2 Ut fC2 ,D ⟩∞ = ⟨t−p1 Ut fC1 ,D1 , (−1)p2 Dop + O(t)⟩∞ , where Dop is the face of C2 separated from D by all the complementary hyperplanes of the pair (C2 , D). In particular, D and Dop are on opposite sides of H. Now, it follows from the definition of Ut and basic properties of the cocycle Wt that all cubes appearing in the support of Ut fC1 ,D1 are on the same side of H as D. Further, from Lemma 7.8 we have that Ut fC1 ,D1 is O(tp1 ), so that the inner product above is O(t). Proof of Theorem 7.5. The possible values of the inner product in (b) are 0 and ±1/2: the positive value occurs when the oriented cube pairs (C1 , D1 ) and (C2 , D2 ) are parallel and aligned; the negative value occurs when they are parallel and not aligned; and 0 occurs when they are not parallel. The result now follows from Lemmas 7.10 and 7.11. As we already pointed out, Theorem 7.5 allows us to extend our continuous field to [0, ∞]. In the sequel it will be convenient to work with the following generating family of continuous bounded sections. 31 7.12 Definition. A (not necessarily continuous) section σ of the continuous field {`2t (X q )}t∈[0,∞] is geometrically bounded if there is a finite set A ⊆ Xq such that s(t) is supported in A for all t ∈ (0, ∞]. 7.13 Proposition. The space of geometrically bounded, continuous sections of the continuous field {`2t (X q )}t∈[0,∞] is spanned over C[0, ∞] by the extended basic continuous sections. Proof. Every basic continuous section is certainly geometrically bounded. If X is a finite complex, then the converse is true since the fiber dimension of the continuous field is finite and constant in this case, and so the continuous field is a vector bundle, while the basic continuous sections span each fiber of the bundle. In the general case, we can regard any geometrically bounded continuous section as a section of the continuous field associated to a suitable finite subcomplex, as in Lemma 2.4, and so express it as a combination of basic continuous sections. 8. Differentials on the Continuous Field The purpose of this section is to construct differentials dt dt dt dt `2t (X 0 ) Ð→ `2t (X 1 ) Ð→ ⋯ Ð→ `2t (X n−1 ) Ð→ `2t (X n ) that continuously interpolate between the Julg-Valette differentials at t = ∞ and the Pytlik-Szwarc differentials at t = 0. For later purposes it will be important to use weighted versions of the Julg-Valette differentials, as in Definition 3.23. But first we shall proceed without the weights, and then indicate at the end of this section how the weights are incorporated. Recall that the operators Ut ∶ C[X q ] Ð→ C[X q ] from Definition 6.15 were proved to be isomorphisms in Lemma 6.16. 8.1 Definition. For t ∈ (0, ∞] we define dt = Ut−1 dUt ∶ C[X q ] Ð→ C[X q+1 ], where d is the Julg-Valette differential from Definition 3.9. In addition, we define d0 ∶ C[Hq ] Ð→ C[Hq+1 ] to be the Pytlik-Szwarc differential from Definition 5.8. We aim to prove the following continuity statement concerning these operators: 32 8.2 Theorem. If {σ(t)} is any continuous and geometrically bounded section of the continuous field {`2t (X q )}t∈[0,∞] , then the pointwise differential {dt σ(t)} is a continuous and geometrically bounded section of {`2t (X q+1 )}t∈[0,∞] . According to Proposition 7.13, the space of continuous and geometrically bounded sections is generated as a module over C[0, ∞] by the extended basic sections, so it suffices to prove Theorem 8.2 for such a section. This we shall now do, following two preliminary lemmas. 8.3 Lemma. Let (C, D) be an oriented (p, q)-cube pair and assume that all the complementary hyperplanes of the pair (C, D) separate D from the base point P0 . The associated basic q-cochain of type p satisfies t−p Ut fC,D = Wt (D0 , D1 )D + O(t), where D0 is the q-cube in X that is closest to the base point P0 among cubes parallel to D, and D1 is the face of C that is parallel to D and separated from D by all the complementary hyperplanes. Proof. According to our definitions, fC,D = (−1)p fC,D1 and Ut fC,D1 = ∑ (−1)d(D1 ,E) Wt (D0 , E)E E∥C D = Wt (D0 , D1 ) ∑ (−1)d(D1 ,E) Wt (D1 , E)E E∥C D = (−t) D + O(tp+1 ), p where we have applied Lemma 7.8. The result follows. 8.4 Lemma. Let (C, D) and D1 be as in the previous lemma. Let C0 be the nearest cube to P0 in the parallelism class of C, let F be the face of C0 which is parallel to D and separated from the base point P0 by the complementary hyperplanes, and let F1 be the face of C0 that is parallel to D and separated from F by the complementary hyperplanes. Then (a) H ∧ F is nonzero if and only if H is a complementary hyperplane, in which case H ∧ F ⊆ C0 ; (b) d(C0 , C) = d(F, D) = d(F1 , D1 ); (c) Wt (D0 , D1 )D = F + O(t). Proof. Consider first the case q = 0. In this case, D0 = P0 and the vertex F1 is characterized by the following hyperplane property from the proof of Proposition 4.3: every hyperplane separating P0 and F1 is parallel to at least one determining hyperplane of parallelism class of C (and C0 ). 33 For (a), H ∧ F is nonzero exactly when H is adjacent to F and separates it from P0 . The hyperplanes cutting C0 certainly satisfy this condition. Conversely, a hyperplane satisfying this condition must intersect all determining hyperplanes by Lemma 2.8, so cannot separate F1 from P0 and so must cut C0 . For (b), no determining hyperplane (of the parallelism class of C) separates F and D. It follows easily that a hyperplane separates C and C0 if and only if it separates F and D. The same argument applies to F1 and D1 . For (c), from the cocycle property we have Wt (D0 , D1 )D = Wt (D0 , F1 )Wt (F1 , D1 )D. To evaluate this, observe that a hyperplane appearing along (a geodesic) path from F1 to D1 must cross every determining hyperplane. It follows that Wt (F, F1 ) = W (D, D1 ) commutes with Wt (F1 , D1 ) and we have Wt (F1 , D1 )D = Wt (F, F1 )W (D1 , D)Wt (F1 , D1 )D = Wt (F, D)D 1 2 = e 2 dt F + O(t), where d = d(F, D), and the last equality follows from an elaboration of [GH10, Proposition 3.6]. Finally, no hyperplane separating D0 and F1 is adjacent to F so that Wt (D0 , F1 )F = F . Putting things together, the result follows. We reduce the general case to the case q = 0 using Proposition 4.2, according to which the set of q-cubes parallel to D is the vertex set of a CAT(0) cube complex in such a way that the (p + q)-cubes in X correspond to the p-cubes in this complex. The key observation is that the p-cube in this complex corresponding to the (p + q) cube C0 in the statement of the lemma is the p-cube closest to the vertex corresponding to D0 . Proof of Theorem 8.2. Let (C, D) be an oriented (p, q)-cube pair, with associated extended basic q-cochain ⎧ ⎪ ⎪[C, D], t = 0 σC,D (t) = ⎨ −p ⎪ ⎪ ⎩t fC,D , t > 0. We shall show that the section {dt σ(t)}t∈[0,∞] is a linear combination of extended basic cochains, plus a term that is geometrically bounded and O(t). After possibly changing a sign, we can assume that D is the furthest from the base point among the q-dimensional faces of C parallel to D. In other words, we can assume that the complementary hyperplanes H1 , . . . , Hp of the pair (C, D) separate 34 D from the base point. Each Hi ∧ D is therefore a (q + 1)-dimensional face of C, and we shall show that p dt (σC,D (t)) = ∑ σC,Hi ∧D (t) + O(t). i=1 We have equality when t = 0, so it suffices to show that p dt (t−p fC,D ) = t−(p−1) ∑ fC,Hi ∧D + O(t) i=1 for t > 0, or equivalently that p (8.1) d Ut (t−p fC,D ) = ∑ Ut (t−(p−1) fC,Hi ∧D ) + O(t). i=1 As for the left hand side of (8.1), applying Lemmas 8.3 and 8.4 we have p d Ut (t−p fC,D ) = d F + O(t) = ∑ Hi ∧ F + O(t), i=1 where F is as in the statement of Lemma 8.4. So, to complete the verification of (8.1) it suffices to check that Ut (t−(p−1) fC,Hi ∧D ) = Hi ∧ F + O(t). But this follows from Lemmas 8.3 and 8.4, applied to the (p − 1, q + 1)-cube pair (C, Hi ∧ D) (although a little care must be taken here since the base cube D0 that is nearest to P0 within the parallelism class of D should be replaced by an analogous base cube for the parallelism class of Hi ∧ D). Consider now the adjoint operators (8.2) δt = Ut−1 δUt ∶ C[X q ] Ð→ C[X q+1 ] for t > 0, together with the adjoint Pytlik-Szwarc differential δ0 ∶ C[Hq ] Ð→ C[Hq+1 ] 8.5 Theorem. If {σ(t)} is any continuous and geometrically bounded section of the continuous field {`2t (X q+1 )}t∈[0,∞] , then {δt σ(t)} is a continuous and geometrically bounded section of the continuous field {`2t (X q )}t∈[0,∞] . Proof. While this could be approached through computations similar to those used to prove Theorem 8.2, there is a shortcut. Each continuous and geometrically bounded section can be viewed as associated to a finite subcomplex of X as in Lemma 2.4. In the case of a finite complex the differentials {dt } constitute a map of vector bundles, and their pointwise adjoints {δt } automatically give a map of vector bundles too. 35 Finally, we return to the issue of weights, which will be important in the next section when we work in the context of Kasparov theory. Let wt the function on hyperplanes defined by the formula (8.3) ⎧ ⎪ ⎪1 + t dist(H, P0 ), 0 < t ≤ 1 wt (H) = ⎨ ⎪ 1 ≤ t ≤ ∞. ⎪ ⎩1 + dist(H, P0 ) In the next section we shall work with the weighted operators (8.4) dt = Ut−1 dwt Ut ∶ C[X q ] Ð→ C[X q+1 ], for t > 0, where as before Ut is the isomorphism from Definition 6.15, and where dwt is the weighted Julg-Valette differential described in Definition 3.23. If t > 0, then operator in (8.4) does not extend from C[X q ] to a bounded operator between `2t -spaces. But since the pointwise values of a geometrically bounded section lie in C[X q ], Theorem 8.2 makes sense in the weighted case without extending the domains of the operators dt in (8.4) beyond C[X q ]. Moreover the theorem remains true for the weighted family of operators. The proof reduces immediately to the unweighted case because the weighted and unweighted differentials, applied to a continuous and geometrically bounded section, differ by an O(t) term. The same applies to Theorem 8.5. 9. Equivariant Fredholm Complexes We shall assume from now on that a second countable, locally compact Hausdorff topological group1 G acts on our CAT(0) cube complex X (preserving the cubical structure). We shall not assume that G fixes any base point in X. Our goal in this section to place the Julg-Valette and Pytlik-Szwarc complexes within the context of equivariant Fredholm complexes, and we need to begin with some definitions. 9.1 Definition. A Fredholm complex of Hilbert spaces is a bounded complex of Hilbert spaces and bounded operators for which the identity morphism on the complex is chain homotopic, through a chain homotopy consisting of bounded operators, to a morphism consisting of compact Hilbert space operators. In other words, a Fredholm complex of Hilbert spaces is a complex of the form d d d H0 Ð→ H1 Ð→ ⋯ Ð→ Hn , 1 The topological restrictions on the group G are not really necessary, but they will allow us to easily fit the concept of equivariant Fredholm complex into the context of Kasparov’s KK-theory in the next section. 36 with each Hp a Hilbert space and each differential a bounded operator. Moreover there exist bounded operators h ∶ Hp Ð→ Hp−1 (p = 1, . . . , n) such that each operator dh + hd ∶ Hp Ð→ Hp (p = 0, . . . , n) is a compact perturbation of the identity operator. The Fredholm condition implies that the cohomology groups of a Fredholm complex are all finite-dimensional, which is the main reason for the definition. But we are interested in the following concept of equivariant Fredholm complex, for which the cohomology groups are not so relevant. 9.2 Definition. Let G be a second countable Hausdorff locally compact topological group. A G-equivariant Fredholm complex of Hilbert spaces is a bounded complex of separable Hilbert spaces and bounded operators for which (a) Each Hilbert space carries a continuous unitary representation of G. (b) The differentials d are not necessarily equivariant, but the differences d − gdg −1 are compact operator-valued and norm-continuous functions of g ∈ G. (c) The identity morphism on the complex is chain homotopic, through a chain homotopy consisting of bounded operators, to a morphism consisting of compact Hilbert space operators. (d) The operators h in the chain homotopy above are again not necessarily equivariant, but the differences h − ghg −1 are compact operator-valued and normcontinuous functions of g ∈ G. 9.3 Remark. Because the differentials are not necessarily equivariant, the cohomology groups of an equivariant Fredholm complex of Hilbert spaces do not necessarily carry actions of G, and so are not of direct interest themselves as far as G is concerned. Nevertheless the above definition, which is due to Kasparov (in a minor variant form), has played an important role in a number of mathematical areas, most notably the study of the Novikov conjecture in manifold topology [Kas88] (see [BCH94] for a survey of other topics). We are going to manufacture equivariant Fredholm complexes from the Julg-Valette and Pytlik-Szwarc complexes. The Julg-Valette complex is the more difficult of the two to understand. Disregarding the group action, the Julg-Valette differentials from Definition 3.9 extend to bounded operators on the Hilbert space completions of the cochain spaces associated to the inner products in (3.18), and the resulting complex of Hilbert spaces and bounded operators is Fredholm, as in Definition 9.1. Moreover 37 the group G certainly acts unitarily. But the Julg-Valette differentials typically fail to be G-equivariant, since they are defined using a choice of base point in the complex X which need not be fixed by G. This means that the technical items (b) and (d) in Definition 9.2 need to be considered carefully. In fact to handle these technical items it will be necessary to finally make use of the weight functions w(H) that we introduced in Definition 3.23. The following computation will be our starting point. Assemble together all the Julg-Valette cochain spaces so as to form the single space dim(X) C[X ] = ⊕ C[X q ], ● q=0 and then form the Hilbert space completion dim(X) ` (X ) = ⊕ `2 (X q ). 2 ● q=0 9.4 Lemma. For any weight function w(H) the Julg-Valette operator D = d + δ ∶ `2 (X ● ) Ð→ `2 (X ● ), viewed as a densely-defined operator with domain C[X ● ], is essentially self-adjoint. Proof. The operator D is formally self-adjoint in the sense that ⟨Df1 , f2 ⟩ = ⟨f1 , Df2 ⟩ for all f1 , f2 ∈ C[X ● ]. The essential self-adjointness of D is a consequence of the fact that the range of the operator I + ∆ = I + D2 is dense in `2 (X ● ), and this in turn is a consequence of the fact that the Julg-Valette Laplacian is a diagonal operator, as indicated in Proposition 3.25. Since D is an essentially self-adjoint operator, we can study the resolvent operators (D ± iI)−1 , which extend from their initial domains of definition (namely the ranges of (D ± iI) on C[X ● ]) to bounded operators on `2 (X ● ). 9.5 Lemma. If w is a weight function that is proper in the sense that for every d > 0 the set { H ∶ w(H) < d } is finite, then the resolvent operators (D ± iI)−1 ∶ `2 (X ● ) Ð→ `2 (X ● ) are compact Hilbert space operators. 38 Proof. The two resolvent operators are adjoint to one another, and so it suffices to show that the product (I + ∆)−1 = (D + iI)−1 (D − iI)−1 is compact. But the compactness of (I + ∆)−1 is clear from Proposition 3.25. Let us now examine the dependence of the Julg-Valette operator D on the initial choice of base point in X. 9.6 Lemma. If w is a weight function that is G-bounded in the sense that sup ∣w(H) − w(gH)∣ < ∞ H for every g ∈ G, then ∥D − g(D)∥ < ∞. That is, the difference D − g(D), which is a linear operator on C[X ● ], extends to a bounded linear operator on `2 (X ● ). Proof. It suffices to prove the estimate for d in place of D = d + δ, since d and δ are adjoint to one another. Now dC − g(d)C = ∑ w(H)H ∧P0 C − ∑ w(g(H))H ∧g(P0 ) C, H H where ∧P0 and ∧g(P0 ) denote the operators of Definition 3.7 associated to the two indicated choices of base points. Since w(H) − w(gH) is uniformly bounded we can replace w(g(H)) by w(H) in the second sum, and change the overall expression only by a term that defines a bounded operator. So it suffices to show that for any pair of base points P0 and P1 the expression ∑ w(H)(H ∧P0 C − H ∧P1 C) H defines a bounded operator. But the expression in parentheses is only non-zero when H separates P0 from P1 , and there are only finitely many such hyperplanes. So the lemma follows from the fact that for any hyperplane H the formula H ∧P0 C − H ∧P1 C defines a bounded operator, as long as the cube complex X has bounded geometry. From now on we shall assume that the Julg-Valette complex is weighted using a proper and G-bounded weight function. In fact, in the next section we shall work with the specific weight function w∞ in (8.3), and so let us do the same here, even though it 39 is not yet necessary. Since the weighted Julg-Valette differential is not bounded, we shall need to make an adjustment to fit the weighted complex into the framework of Fredholm complexes of Hilbert spaces and bounded operators. We do this by forming the normalized differentials 1 d′ = d(I + ∆)− 2 ∶ `2 (X q ) Ð→ `2 (X q+1 ) (where, strictly speaking, by d in the above formula we mean the closure of d in the sense of unbounded operator theory). The normalized Julg-Valette complex is the complex (9.1) d′ d′ d′ `2 (X 0 ) Ð→ `2 (X 1 ) Ð→ ⋯ Ð→ `2 (X n ). 1 It is indeed a complex because d and (I + ∆)− 2 commute with one another, and it is a Fredholm complex because the adjoints d′∗ constitute a chain homotopy between the identity and a compact operator-valued cochain map. In fact d′ d′∗ + d′∗ d′ = D2 (I + D2 )−1 = I − (I + D2 )−1 , and (I + D2 )−1 is compact by Lemma 9.5. We shall use the following computation from the functional calculus to show that the normalized complex is an equivariant Fredholm complex of Hilbert spaces. 9.7 Lemma (Compare [BJ83]). If T is a positive, self-adjoint Hilbert space operator that is bounded below by some positive constant, then 1 T −2 = 2 ∞ 2 (λ + T )−1 dλ ∫ π 0 The integral converges in the norm topology. 9.8 Theorem. The normalized Julg-Valette complex d′ d′ d′ `2 (X 0 ) Ð→ `2 (X 1 ) Ð→ ⋯ Ð→ `2 (X n ) that is defined using the proper and G-bounded weight function w∞ in (8.3) is an equivariant Fredholm complex. Proof. It suffices to show that the normalized operator D′ = D(I + D2 )−1/2 = d′ + d′∗ has the property that g(D′ ) − D′ is a compact operator-valued and norm-continuous function of g ∈ G. For this we use Lemma 9.7 and the formula 1 D(λ2 + 1 + D2 )−1 = ((D + iµ)−1 + (D − iµ)−1 ), 2 40 where µ = (λ2 + 1)1/2 , to write the difference g(D′ ) − D′ as a linear combination of two integrals ∞ −1 −1 ∫ ((g(D) ± iµ) − (D ± iµ) ) dλ. 0 The integrand is (9.2) (g(D) ± iµ)−1 (D − g(D))(D ± iµ)−1 , which is a norm-continuous, compact operator valued function of λ ∈ [0, ∞) whose norm is O(λ−2 ) as λ ↗ ∞. So the integrals converge to compact operators, as required. Let us now examine the Pytlik-Szwarc complex. The inner products on the PytlikSzwarc cochain spaces given in Definition 5.12 are G-invariant, and the Pytlik-Szwarc differentials given in Definition 5.8 are bounded and G-equivariant, so the story here is much simpler. 9.9 Theorem. The Pytlik-Szwarc complex `20 (X 0 ) Ð→ `20 (X 1 ) Ð→ ⋯ Ð→ `20 (X n ) is an equivariant Fredholm complex. Proof. It follows from Proposition 5.14 that the formula h= 1 p+1 ] δ ∶ C[Hqp ] Ð→ C[Hq−1 p+q (we set h = 0 when p = q = 0) defines an exactly G-equivariant and bounded chain homotopy between the identity and a compact operator-valued cochain map, namely the orthogonal projection onto C[H00 ] ≅ C in degree zero, and the zero operator in higher degrees. To conclude this section we introduce the following notion of (topological, as opposed to chain) homotopy between two equivariant Fredholm complexes. In the next section we shall construct a homotopy between the Julg-Valette and Pytilik-Szwarc equivariant Fredholm complexes we constructed above using the continuous field of complexes constructed in Section 8. 9.10 Definition. Two equivariant complexes of Hilbert spaces (H●0 , d0 ) and (H●1 , d1 ) are homotopic if there is a bounded complex of continuous fields of Hilbert spaces over [0, 1] and adjointable families of bounded differentials for which (a) Each continuous field carries a continuous unitary representation of G. 41 (b) The differentials d = {dt } are not necessarily equivariant, but the differences d − gdg −1 are compact operator-valued and norm-continuous functions of g ∈ G. (c) The identity morphism on the complex is chain homotopic, through a chain homotopy consisting of adjointable families of bounded operators, to a morphism consisting of compact operators between continuous fields. (d) The operators h = {ht } in the homotopy above are again not necessarily equivariant, but the differences h − ghg −1 are compact operator-valued and normcontinuous functions of g ∈ G. (e) The restrictions of the complex to the points 0, 1 ∈ [0, 1] are the complexes (H●0 , d0 ) and (H●1 , d1 ). We need to supply definitions for the operator-theoretic concepts mentioned above. These are usually formulated in the language of Hilbert modules, as for example in [Lan95], but for consistency with the rest of this paper we shall continue to use the language of continuous fields of Hilbert spaces. 9.11 Definition. An adjointable family of operators (soon we shall contract this to adjointable operator ) between continuous fields {Ht } and {H′t } over the same compact space T is a family of bounded operators At ∶ Ht Ð→ H′t that carries continuous sections to continuous sections, whose adjoint family A∗t ∶ H′t Ð→ Ht also carries continuous sections to continuous sections. An adjointable operator is unitary if each At is unitary. 9.12 Definition. A representation of G as unitary adjointable operators on a continuous field {Ht } is continuous if the action map G × { continuous sections } Ð→ { continuous sections } is continuous. We place on the space of continuous sections the topology associated to the norm ∥σ∥ = max ∥σ(t)∥. 9.13 Definition. An adjointable operator A = {At } between continuous fields of Hilbert spaces over the same compact base space T is compact if it is the norm limit, as a Banach space operator A ∶ { continuous sections } Ð→ { continuous sections }, of a sequence of linear combinations of operators of the form σ z→ ⟨σ1 , σ⟩σ2 , 42 where σ1 and σ2 are continuous sections (of the domain and range continuous fields, respectively). The compact operators form a closed, two-sided ideal in the C ∗ -algebra of all adjointable operators. Here, then, is the theorem that we shall prove in the next section: 9.14 Theorem. The equivariant Fredholm complexes obtained from the Julg-Valette and Pytlik-Szwarc complexes in Theorems 9.8 and 9.9 are homotopic (in the sense of Definition 9.10). 10. K-Amenability The purpose of this section is to prove Theorem 9.14. But before giving the proof, we shall explain the K-theoretic relevance of the theorem. To do so we shall need to use the language of Kasparov’s equivariant KK-theory [Kas88], but we emphasize that the proof of Theorem 9.14 will involve only the definitions from the last section our work ealier in the paper. We shall assume familiarity with Kasparov’s theory. A G-equivariant complex of Hilbert spaces, as in Definition 9.2, determines a class in Kasparov’s equivariant representation ring R(G) = KKG (C, C), in such a way that (a) homotopic complexes, as in Definition 9.10, determine the same element, (b) a complex whose differentials are exactly G-equivariant determines the same class as the complex of cohomology groups (these are finite-dimensional unitary representations of G) with zero differentials, and (c) a complex with the one-dimensional trivial representation in degree zero, and no higher-dimensional cochain spaces, determines the multiplicative identity element 1 ∈ R(G). 10.1 Definition. See [JV84, Definition 1.2]. A second countable and locally compact Hausdorff topological group G is K-amenable if the multiplicative identity element 1 ∈ R(G) is representable by an equivariant Fredholm complex of Hilbert spaces H0 Ð→ H1 Ð→ ⋯ Ð→ Hn in which the each cochain space Hp , viewed as a unitary representation of G, is weakly contained in the regular representation of G. 10.2 Theorem (See [JV84, Corollary 3.6].). If G is K-amenable, then the natural homomorphism of C ∗ -algebras ∗ ∗ Cmax (G) Ð→ Cred (G) 43 induces an isomorphism of K-theory groups ∗ ∗ K∗ (Cmax (G)) Ð→ K∗ (Cred (G)). 10.3 Remarks. The C ∗ -algebra homomorphism in the theorem is itself an isomorphism if and only if the group G is amenable; this explains the term K-amenable. Not every group is K-amenable; for example an infinite group with Kazhdan’s property T is certainly not K-amenable, because the K-theory homomorphism is certainly not an isomorphism. After having quickly surveyed this background information, we can state the main result of this section: 10.4 Theorem. If a second countable and locally compact group G admits a proper action on a bounded geometry CAT(0) cube complex, then G is K-amenable. The theorem was proved by Julg and Valette in [JV84] in the case where the cube complex is a tree. They used the Julg-Valette complex, as we have called it, for a tree, and showed that the continuous field of complexes that we have constructed in this paper is a homotopy connecting the Julg-Valette and Pytlik-Szwarc complexes. We shall do the same in the general case. The construction of this homotopy proves the theorem in view of the following simple result, whose proof we shall omit. 10.5 Lemma. Assume that a second countable and locally compact group G acts proper action on a CAT(0) cube complex. The Hilbert spaces in the Julg-Valette complex are weakly contained in the regular representation of G. 10.6 Remark. Theorem 10.4 is not new; it was proved by Higson and Kasparov in [HK01, Theorem 9.4] using a very different argument that is both far more general (it applies to a much broader class of groups) and far less geometric. To prove Theorem 10.4 it therefore suffices to prove Theorem 9.14, and this is what we shall now do. We shall construct the homotopy that the theorem requires by modifying the constructions in Section 8 in more or less the same way that we modified the Julg-Valette complex to construct the complex (9.1). We shall therefore be applying the functional calculus to the family of operators (10.1) Dt = Ut∗ (dwt + δwt )Ut ∶ `2t (X ● ) Ð→ `2t (X ● ), where dwt is the Julg-Valette differential associated to the weight function in (8.3), and of course δwt is the adjoint differential. To apply the functional calculus we shall need to know that the family of resolvent operators (Dt + iλ)−1 ∶ `2t (X ● ) Ð→ `2t (X ● ) 44 carries continuous sections to continuous sections. This is a consequence of the following result: 10.7 Proposition. Let λ be a nonzero real number. The family of operators { (Dt + iλI)−1 ∶ `2t (X ● ) → `2t (X ● ) }t∈[0,∞] carries the space of continuous and geometrically bounded sections to a dense subspace of the space of continuous and geometrically bounded sections in the norm ∥s∥ = supt∈[0,∞] ∥s(t)∥`2t (X ● ) . Actually we shall need a small variation on this proposition: 10.8 Definition. Denote by P = {Pt } the operator that is in each fiber the orthogonal projection onto the span of the single basic q-cochain fP0 ,P0 of type p = 0 (of course this basic cochain is just P0 ). It follows from the formula for the Julg-Valette Laplacian in Proposition 3.20 that the operators Pt + ∆t are essentially self-adoint and bounded below by 1. So we can form the resolvent operators (Dt + Pt + iλI)−1 for any λ ∈ R, including λ = 0. 10.9 Proposition. Let λ be any real number (possibly zero). The family of operators { (Dt + Pt + iλI)−1 ∶ `2t (X ● ) → `2t (X ● ) }t∈[0,∞] carries the space of continuous and geometrically bounded sections to a dense subspace of the space of continuous and geometrically bounded sections. Both propositions will be proved by examining action of the Laplacians (10.2) ∆t = Dt2 = Ut∗ (dwt + δwt )2 Ut on continuous and geometrically controlled sections of the field {`2t (X ● }t∈[0,∞] . Proof of Propositions 10.7 and 10.9. The family of operators {Dt } maps the space of continuous, geometrically bounded sections into itself, so we can consider the compositions ∆t + λ2 I = (Dt + iλI)(Dt − iλI) and ∆t + Pt + λ2 I = (Dt + Pt + iλI)(Dt + Pt − iλI), and it suffices to show that the families of these operators map the space continuous and geometrically bounded sections into a dense subspace of itself. 45 Let fC,D ∈ C[X q ] be a basic q-cochain of type p. Lemmas 8.3 and 8.4 tell us that t−p Ut fC,D = (−1)p F + O(t), where the q-cube F has the property that there are precisely p hyperplanes adjacent to it that separate it from the base point P0 . So according to our formula for the Julg-Valette Laplacian in Proposition 3.20, (dwt + δwt )2 Ut ∶ t−p fC,D z→ (p + q) ⋅ (−1)p F + O(t) and so, by applying Ut∗ to both sides we get (∆2t + λ2 I) ∶ t−p fC,D z→ ((p + q) + λ2 ) ⋅ t−p fC,D + O(t). Similarly (∆t +Pt +λ2 I) ∶ t−p fC,D z→ (max{1, (p + q)} + λ2 ) ⋅ t−p fC,D + O(t). So the ranges of the families {∆t +λ2 I} and {∆t +Pt +λ2 I} contain O(t) perturbations of every basic section. The propositions follow from this. Now form the bounded self-adjoint operators 1 Ft = Dt (Pt + Dt2 )− 2 . By the above and Lemma 9.7 the family {Ft }t∈[0,∞] maps continuous sections to continuous sections. So we can consider the bounded complex of continuous fields of Hilbert spaces over [0, 1] and bounded adjointable operators (10.3) {`2t (X 0 )}t∈[0,∞] {d′t }t∈[0,∞] / {`2 (X 1 )}t∈[0,∞] t {d′t }t∈[0,∞] / ⋯ {d′t }t∈[0,∞] / {`2t (X n )}t∈[0,∞] in which each differential {d′t } is the component of {Ft } mapping between the indicated continuous fields. 10.10 Proposition. Disregarding the G-action, the complex (10.3) is a homotopy of Fredholm complexes. Proof. If we set ht = d′t ∗ , then ht d′t + d′t ht = ∆t (Pt + ∆t )−1 = I − Pt (Pt + ∆t )−1 , and {Pt (Pt +∆t )−1 }, is compact operator on the continuous field {`2t (X ● )}t∈[0,∞] . 46 It remains show that (10.3) is an equivariant homotopy. If the resolvent families {(Dt + Pt + iλI)−1 } were compact, then we would be able to follow the route taken in the previous section to prove equivariance of the Fredholm complex associated to the Julg-Valette complex. But compactness fails at t = 0, and so we need to be a bit more careful. The following two propositions will substitute for the Lemmas 9.5 and 9.6 that were used to handle the Julg-Valette complex in the previous section. 10.11 Proposition. For every ε > 0 and for every λ ∈ R the restricted family of operators {(Dt + Pt ± iλ)−1 }t∈[ε,∞] is a compact operator on the continuous field {`2t (X ● )}t∈[ε,∞] . Moreover ∥(Dt + Pt ± iλ)−1 ∥ ≤ ∣1 + iλ∣−1 for all t and all λ. 10.12 Proposition. For every g ∈ G the operators Dt − g(Dt ) are uniformly bounded in t: sup ∥Dt − g(Dt )∥ < ∞ t∈[0,∞] Moreover ∥Dt − g(Dt )∥ = O(t). as t → 0. Taking these for granted, for a moment, here is the result of the calculation: 10.13 Theorem. The complex (10.3) is a homotopy of equivariant Fredholm complexes in the sense of Definition 9.10. Proof. We need to check that the families of differentials {d′t } in the complex (10.3) are G-equivariant modulo compact operators, and also that {g(d′t )} varies normcontinuously with g ∈ G. Let us discuss norm-continuity first. If g is sufficiently close to the identity in G, then g fixes the base point P0 , and for such g we have g(d′t ) = d′t for all t. So {g(d′t )} is actually locally constant as a function of g. The proof of equivariance modulo compact operators is a small variation of the proof of Theorem 9.8. It suffices to show that the family of operators {g(Ft )−Ft } is compact. Since 1 Ft = Dt (Pt + ∆t )− 2 1 = (Pt + Dt )(Pt + ∆t )− 2 + compact operator, 47 it suffices to prove that the operator 1 Et = (Pt + Dt )(Pt + ∆t )− 2 is equivariant modulo compact operators. Applying Lemma 9.7 we find that 2 ∞ (Pt + Dt )(λ2 I + Pt + ∆t )−1 dλ π ∫0 1 ∞ = ∫ ((Dt + Pt − iλ)−1 + (Dt + Pt + iλ)−1 ) dλ π 0 Et = So the difference g(Et ) − Et is the sum of the two integrals (10.4) 1 ∞ ((g(Dt ) + g(Pt ) ± iλ)−1 − (Dt + Pt ± iλ)−1 ) dλ ∫ π 0 Now the integrands in (10.4) can be written as (10.5) (g(Pt ) + g(Dt ) ± iλ)−1 (Dt − g(Dt ))(Pt + Dt ± iλ)−1 + (g(Pt ) + g(Dt ) ± iλ)−1 (Pt − g(Pt ))(Pt + Dt ± iλ)−1 Both terms in (10.5) are norm-continuous, compact operator valued functions of λ ∈ [0, ∞), the first by virtue of Proposition 10.12 and the second because Pt is compact. Moreover the norms of both are O(λ−2 ) as λ → ∞. So the integrals in (10.4) converge to compact operators, as required. It remains to prove Propositions 10.11 and 10.12. The first is easy and we can deal with it immediately. Proof of Proposition 10.11. We want to show that the family of operators {Kt }t∈[ε,∞] = {(Dt + Pt ± iλ)−1 }t∈[ε,∞] is compact. Since the compact operators form a closed, two-sided ideal in the C ∗ algebra of all adjointable families of operators it suffices to show that the family {Kt∗ Kt }t∈[ε,∞] = {(∆t + Pt + λ2 )−1 }t∈[ε,∞] is compact; compare [Ped79, Proposition 1.4.5]. Conjugating by the unitaries Ut it suffices to prove that the family {(dwt δwt + δwt dwt + Pt + λ2 )−1 }t∈[ε,∞] on the constant field of Hilbert spaces with fiber `2 (X ● ) is compact; this is one of the things that restricting to t ∈ [ε, ∞] makes possible. But this final assertion is a simple 48 consequence of the explicit formula for the Julg-Valette Laplacian in Proposition 3.20, together with the fact that the weight functions wt are uniformly proper in t ∈ [ε, ∞] in the sense that for every N , all but finitely many hyperplanes H satisfy wt (H) ≥ N for all t ∈ [ε, ∞]. As for the norm estimate in the proposition, this holds not just for ∆t + Pt but for any self-adjoint operator bounded below by 1, and is elementary. Let us turn now to Proposition 10.12. A complicating factor is that G not only fails to preserve the Julg-Valette differential, but also fails to preserve the unitary operators Ut that appear in the definitions of the differentials dt . The proposition is only correct because the two failures to a certain extent cancel one another out. 10.14 Definition. Let P and Q be vertices in X. Define a unitary operator ̂t (Q, P )∶ `2 (X q ) Ð→ `2 (X q ) W ̂t (Q, P ) to be the cocycle operator Wt (Q, P ) as follows. When q = 0, we define W ̂t (Q, P ) respects the decomposition of `2 (X q ) of Definition 6.13. On higher cubes, W according to parallelism classes, and on a summand determined by a given class we ̂t (Q, P ) = Wt (CQ , CP ), where CQ and CP are the cubes in the equivalence class set W nearest to Q and P . It is immediate from the definition of the unitary operator Ut in Definition 6.15 that (10.6) g(Ut ) = Wt (Q0 , P0 )Ut ∶ `2t (X ● ) → `2 (X ● ) From this and the definition of Dt we find that (10.7) ̂t (Q, P )Ut . ̂t (Q, P )∗ (g(dwt ) + g(δwt ))W g(Dt ) = Ut∗ W ̂t ∶= W ̂t (Q, P ) and write Now let us use the abbreviation W ̂t∗ (g(dwt ) + g(δwt ))W ̂t )Ut Dt − g(Dt ) = Ut∗ ((dwt + δwt ) − W The right-hand side can be rearranged as Ut∗ Wt∗ (Wt dwt − g(dwt )Wt )Ut + Ut∗ (δwt Wt∗ − Wt∗ g(δwt ))Wt Ut and the norm of this expression is no more than ̂t dwt − g(dwt )W ̂t ∥ + ∥δwt W ̂t∗ − W ̂t∗ g(δwt )∥ ∥W So it suffices to show that the operators (10.8) ̂t dwt − g(dwt )W ̂t W ̂t∗ − W ̂t∗ g(δwt ) and δwt W 49 satisfy the conclusions of Proposition 10.12. The second operator is adjoint to the first. So in fact it suffices to prove the conclusions of Proposition 10.12 for the first operator alone. This is what we shall do. Before we proceed, let us adjust our notation a bit, as follows. Given a vertex P in X, we shall denote by dP,wt the Julg-Valette differential that is defined using the base vertex P and the weight function (8.3), for whose definition we also use the base vertex P rather than P0 . With this new notation we can drop further mention of the group G: Proposition 10.12 is a consequence of the following assertion: 10.15 Proposition. The operator ̂t (Q, P )∶ C[X q ] Ð→ C[X q+1 ] ̂t (Q, P )dP,wt − dQ,wt W W is bounded for all t > 0, and moreover ̂t (Q, P )dP,wt − dQ,wt W ̂t (Q, P )∥ = 0. lim∥W t→0 Recall now that the Julg-Valette differential is defined using the operation H ∧ C between hyperplanes and cubes. Since the operation depends on a choice of base vertex, we shall from now on write H ∧P C to indicate that choice, as we did earlier. To prove Proposition 10.15 it suffices to consider the case where P and Q are at distance 1 from one another (so they are separated by a unique hyperplane). We shall make this assumption from now on. 10.16 Lemma. If a hyperplane H fails to separate P from Q, then ̂t (P, Q)D = W ̂t (P, Q)(H ∧Q D) H ∧P W for all oriented q-cubes D. Proof. First, if H fails to separate P from Q, then the operators H∧P and H∧Q are equal to one another. We shall drop the subscripts for the rest of the proof. Next, if H cuts D, then it cuts all the cubes parallel to D, and therefore it cuts all ̂t (P, Q)D. So both sides of the equation in the lemma are the cubes that make up W zero. So can assume from now on that H is disjoint from D. Let K be the hyperplane that separates Q from P . According to Proposition 4.6 the nearest q-cubes to P and Q in the parallelism class of D are either equal or are ̂t (P, Q)D is either opposite faces, across K, of a (q+1)-cube that is cut by K. So W just D or is a combination (10.9) ̂t (P, Q)D = aD + bE W 50 of D and another cube E that is an opposite face from D in a (q+1)-cube that is cut by K. We see that if H fails to separate D from P , or equivalently, if it fails to separate D ̂t (P, Q)D from P or Q, from Q, then it also fails to separate any of the terms in W and accordingly both sides of the equation in the lemma are zero. So we can assume from now on that H does separate D from P and Q. Suppose now that K fails to be adjacent to D, either because it cuts D or because some vertex of D is not adjacent to K. The left-hand side of the equation is then H ∧ D. This is either zero, in which case the equation obviously holds, or it is a (q+1)-cube to which K also fails to be adjacent, in which case the right-hand side of the equation is simple H ∧ D. So we can assume that K is adjacent to D. Let E be the q-cube that is separated from D by K alone, as in (10.9). Since H fails to separate D from E, or P from Q, but separates D and E from P and Q, we see from Lemma 2.8 that H and K intersect. By Lemma 2.7, if H is adjacent to either of D or E, then there is a (q+2)-cube that is cut by H and K and contains both D and E as faces. In this case both sides of the equation in the lemma are aH ∧ D + bH ∧ E with a and b as in (10.9). Finally, if H is adjacent to neither D nor E, then both sides of the equation are zero. 10.17 Lemma. If H separates P from Q, then ̂t (P, Q)D − W ̂t (P, Q)(H ∧Q D) = f (t)H ∧Q D − g(t)H ∧P D, H ∧P W where f and g are smooth, bounded functions on [0, ∞) that vanish at t = 0. Proof. If D fails to be adjacent to H, then both sides in the displayed formula are zero. So suppose D is adjacent to H. In this case ̂t (P, Q)(H ∧Q D) = H ∧Q D. W Now according to the definitions ̂t (P, Q)D = ±e− 21 t2 E + (1 − e−t2 ) 21 D W where E is the q-cube opposite D across H, and where the sign is +1 if D is separated from P by H, and −1 if it is not. We find then that ̂t (P, Q)D = ±e− 12 t2 H ∧P E + (1 − e−t2 ) 12 H ∧P D. H ∧P W 51 But H ∧P E = 0 if E is not separated from P by H, which is to say if D is separated from P by H. So we can write ̂t (P, Q)D = −e− 12 t2 H ∧P E + (1 − e−t2 ) 12 H ∧P D. H ∧P W In addition H ∧P E = −H ∧Q D so that ̂t (P, Q)D = e− 21 t2 H ∧Q D + (1 − e−t2 ) 21 H ∧P D. H ∧P W Finally we obtain ̂t (P, Q)(H ∧Q D) − H ∧P W ̂t (P, Q)D = (e 21 t2 − 1)H ∧Q D − (1 − e−t2 ) 21 H ∧P D, W as required. Proof of Proposition 10.15. We shall use the previous lemmas and the formula dP,wt D = ∑ wP,t (H) H ∧P D, H for the Julg-Valette differential. We get ̂t (Q, P )dP,wt − dQ,wt W ̂t (Q, P ) (10.10) W ̂t (Q, P )D). ̂t (Q, P ) (H ∧P D) − wQ,t (H)H ∧Q W = ∑(wP,t (H)W H Let us separate the sum into a part indexed by hyperplanes that do not separate P from Q, followed by the single term indexed by the hyperplane H0 that does separate P from Q. According to Lemma 10.16 the first part is ̂t (Q, P ) (H ∧P D) . ∑ (wP,t (H) − wQ,t (H)) W H≠H0 Inserting the definition of the weight function, we obtain (10.11) ̂t (Q, P ) (H ∧P D) , t ∑ (dist(H, P ) − dist(H, Q)) W H≠H0 and moreover ∣dist(H, P ) − dist(H, Q)∣ ≤ 1. As for the part of (10.10) indexed by H, keeping in mind that dist(H0 , P ) = 1 2 = dist(H0 , Q), we obtain from Lemma 10.17 the following formula for it: (10.12) (1 + 21 t)f (t)H0 ∧Q D − (1 + 21 t)g(t)H0 ∧P D, where f and g are bounded and vanish at 0. The required estimates follow, because the terms in (10.11) and (10.12) are uniformly bounded in number, are supported uniformly close to D, are uniformly bounded in size, and vanish at t = 0. 52 References [BCH94] P. Baum, A. Connes, and N. Higson. Classifying space for proper actions and K-theory of group C ∗ -algebras. In C ∗ -algebras: 1943–1993 (San Antonio, TX, 1993), volume 167 of Contemp. Math., pages 240–291. Amer. Math. Soc., Providence, RI, 1994. [BdlHV08] B. Bekka, P. de la Harpe, and A. Valette. Kazhdan’s property (T), volume 11 of New Mathematical Monographs. Cambridge University Press, Cambridge, 2008. [BJ83] S. Baaj and P. Julg. Théorie bivariante de Kasparov et opérateurs non bornés dans les C ∗ -modules hilbertiens. C. R. Acad. Sci. Paris Sér. I Math., 296(21):875–878, 1983. [CCJ+ 01] P.-A. Cherix, M. Cowling, P. Jolissaint, P. Julg, and A. Valette. Groups with the Haagerup property. Modern Birkhäuser Classics. Birkhäuser/Springer, Basel, 2001. Gromov’s a-T-menability, Paperback reprint of the 2001 edition [ MR1852148]. [Cun83] J. Cuntz. K-theoretic amenability for discrete groups. J. Reine Angew. Math., 344:180–195, 1983. [Dix77] J. Dixmier. C ∗ -algebras. North-Holland Publishing Co., Amsterdam, 1977. Translated from the French by Francis Jellett, North-Holland Mathematical Library, Vol. 15. [For98] R. Forman. Morse theory for cell complexes. Adv. Math., 134(1):90–145, 1998. [GH10] E. Guentner and N. Higson. Weak amenability of CAT(0)-cubical groups. Geom. Dedicata, 148:137–156, 2010. [Haa79] U. Haagerup. An example of a nonnuclear C ∗ -algebra, which has the metric approximation property. Invent. Math., 50(3):279–293, 1978/79. [HK01] N. Higson and G. G. Kasparov. E-theory and KK-theory for groups which act properly and isometrically on Hilbert space. Invent. Math., 144(1):23–74, 2001. [JV83] P. Julg and A. Valette. K-moyennabilité pour les groupes opérant sur les arbres. C. R. Acad. Sci. Paris Sér. I Math., 296(23):977–980, 1983. [JV84] P. Julg and A. Valette. K-theoretic amenability for SL2 (Qp ), and the action on the associated tree. J. Funct. Anal., 58(2):194–215, 1984. 53 [JV86] P. Julg and A. Valette. Twisted coboundary operator on a tree and the Selberg principle. J. Operator Theory, 16(2):285–304, 1986. [JV87] P. Julg and A. Valette. L’opérateur de co-bord tordu sur un arbre, et le principe de Selberg. II. J. Operator Theory, 17(2):347–355, 1987. [Kas88] G. G. Kasparov. Equivariant KK-theory and the Novikov conjecture. Invent. Math., 91(1):147–201, 1988. [Kaž67] D. A. Každan. On the connection of the dual space of a group with the structure of its closed subgroups. Funkcional. Anal. i Priložen., 1:71–74, 1967. [Lan95] E. C. Lance. Hilbert C ∗ -modules: A toolkit for operator algebraists, volume 210 of London Mathematical Society Lecture Note Series. Cambridge University Press, Cambridge, 1995. [NR98a] G. A. Niblo and L. D. Reeves. The geometry of cube complexes and the complexity of their fundamental groups. Topology, 37(3):621–633, 1998. [NR98b] G. A. Niblo and M. A. Roller. Groups acting on cubes and Kazhdan’s property (T). Proc. Amer. Math. Soc., 126(3):693–699, 1998. [Ped79] G. K. Pedersen. C ∗ -algebras and their automorphism groups, volume 14 of London Mathematical Society Monographs. Academic Press, Inc. [Harcourt Brace Jovanovich, Publishers], London-New York, 1979. [Pim87] M. V. Pimsner. Cocycles on trees. J. Operator Theory, 17(1):121–128, 1987. [PS86] T. Pytlik and R. Szwarc. An analytic family of uniformly bounded representations of free groups. Acta Math., 157(3-4):287–309, 1986. [Sag95] M. Sageev. Ends of group pairs and non-positively curved cube complexes. Proc. London Math. Soc. (3), 71(3):585–617, 1995. [Val90] A. Valette. Cocycles d’arbres et représentations uniformément bornées. C. R. Acad. Sci. Paris Sér. I Math., 310(10):703–708, 1990. Department of Mathematical Sciences, University of Southampton, Southampton SO17 1BJ, UK E-mail address: [email protected] Department of Mathematical Sciences, University of Hawaii at Manoa, Honolulu, HI 96822, USA 54 E-mail address: [email protected] Department of Mathematics, Penn State University, University Park, PA 16802, USA E-mail address: [email protected] 55
4math.GR
arXiv:1711.10968v1 [cs.CV] 29 Nov 2017 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 1 Colour Constancy: Biologically-inspired Contrast Variant Pooling Mechanism Arash Akbarinia1 1 Centre de Visió per Computador Universitat Autònoma de Barcelona Barcelona, Spain 2 Department of Information and Communication Technologies Universitat Pompeu Fabra Barcelona, Spain www.cvc.uab.es/people/sakbarinia/ Raquel Gil Rodríguez2 http://ip4ec.upf.edu/user/53 1 C. Alejandro Parraga www.cvc.uab.es/people/aparraga/ 1 Abstract Pooling is a ubiquitous operation in image processing algorithms that allows for higher-level processes to collect relevant low-level features from a region of interest. Currently, max-pooling is one of the most commonly used operators in the computational literature. However, it can lack robustness to outliers due to the fact that it relies merely on the peak of a function. Pooling mechanisms are also present in the primate visual cortex where neurons of higher cortical areas pool signals from lower ones. The receptive fields of these neurons have been shown to vary according to the contrast by aggregating signals over a larger region in the presence of low contrast stimuli. We hypothesise that this contrast-variant-pooling mechanism can address some of the shortcomings of maxpooling. We modelled this contrast variation through a histogram clipping in which the percentage of pooled signal is inversely proportional to the local contrast of an image. We tested our hypothesis by applying it to the phenomenon of colour constancy where a number of popular algorithms utilise a max-pooling step (e.g. White-Patch, Grey-Edge and Double-Opponency). For each of these methods, we investigated the consequences of replacing their original max-pooling by the proposed contrast-variant-pooling. Our experiments on three colour constancy benchmark datasets suggest that previous results can significantly improve by adopting a contrast-variant-pooling mechanism. Introduction Many computer vision frameworks contain a pooling stage that combines local responses at different spatial locations [8]. This operation is often a sum- or max-pooling mechanism implemented by a wide range of algorithms, e.g. in feature descriptors (such as SIFT [37] and HOG [12]) or convolutional neural networks [36, 43]. Choosing the correct pooling operator can make a great difference in the performance of a method [8]. Current standard pooling mechanisms lack the desired generalisation to find equilibrium between frequently-occurring and rare but informative descriptors [39]. Therefore, many computer vision applications can benefit from a more dynamic pooling solution that takes into account the content of pooled signals. c 2017. The copyright of this document resides with its authors. It may be distributed unchanged freely in print or electronic forms. 2 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM Such pooling operators are commonly used in modelling the phenomenon of colour constancy (i.e. a visual effect that makes the perceived colour of surfaces remain approximately constant under changes in illumination [19, 28]) both in biological [10] and computational [34] solutions. Despite decades of research, colour constancy still remains as an open question [19], and solutions to this phenomenon are important from a practical point of view, e.g. camera manufacturers need to produce images of objects that appear the same as the actual objects in order to satisfy customers. Motivated by above, in this article we propose a contrast-variant-pooling mechanism and investigate its feasibility in the context of computational colour constancy. 1.1 Computational Models of Colour Constancy Mathematically, the recovery of spectral reflectance from a scene illuminated by light of unknown spectral irradiance is an ill-posed problem (it has infinite possible solutions). The simplest and most popular solution has been to impose some arbitrary assumptions regarding the scene illuminant or its chromatic content. Broadly speaking colour constancy algorithms can be divided into two categories: (i) low-level driven, which reduce the problem to solving a set of non-linear mathematical equations [23, 34, 46], and (ii) learning-based, which train machine learning techniques on relevant image features [1, 18, 21]. Learning-based approaches may offer the highest performance results, however, they have major setbacks which make them unsuitable in certain conditions: (a) they rely heavily on training data that is not easy to obtain for all possible situations, and (b) they are likely to be slow [24] and unsuitable for deployment inside limited hardware. A large portion of low-level driven models can be summarised using a general Minkowski expression [15, 46] such as: Z Lc (p) = p [ fc (x)] dx 1 p = kec , (1) Ω where L represents the illuminant at colour channel c ∈ {R, G, B}; f (x) is the image’s pixel value at the spatial coordinate x ∈ Ω; p is the Minkowski norm; and k is a multiplicative constant chosen such that the illuminant colour, e, is a unit vector. Distinct values of the Minkowski norm p results into different pooling mechanisms. Setting p = 1 in Eq. 1 reproduces the well known Grey-World algorithm (i.e. sum-pooling), in which it is assumed that all colours in the scene average to grey [9]. Setting p = ∞ replicates the White-Patch algorithm (i.e. max-pooling), which assumes the brightest patch in the image corresponds to the scene illuminant [34]. In general, it is challenging to automatically tune p for every image and dataset. At the same time inaccurate p values may corrupt the results noticeably [24]. The Minkowski framework can be generalised further by replacing f (x) in Eq. 1 with its higher-order derivatives [46]. These non-linear solutions are analogous to centre-surround mechanisms of visual cortex [35], which is typically modelled by a Difference-of-Gaussians (DoG) operators where a narrower, positive Gaussian plays the role of the “centre” and a broader, negative Gaussian plays the role of the “surround” [14, 38]. Recently, a few biologically-inspired models of colour constancy grounded on DoG have offered promising results [23, 41], however their efficiency largely depends on finding an optimum pooling strategy for higher cortical areas. In short, pooling is a crucial component of many colour constancy models driven by low-level features (or even in deep-learning solutions [7, 20]). In the primate visual systems the size of the receptive field varies according to the local 3 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM contrast of the light falling on it [4, 45] presenting a dynamic solution dependent on the region of interest. The low-level models mentioned above are related to the early stages of visual processing, i.e. the primary visual cortex (area V1), that are likely to be involved in colour constancy. Physiological measures suggest that although receptive fields triple in size from area V1 to area V2 [48], their basic circuity with respect to surround modulation is similar, i.e. keeping the same size dependency with contrast properties found in V1 [45]. This is consistent with the large body of physiological and psychophysical literature highlighting the significance of contrast in the visual cortex. In computer vision, contrast-dependent models have also shown encouraging results in various applications such as visual attention [29], tone mapping [42], and boundary detection [2, 3], to name a few. From these we can hypothesise the convenience and explanatory value of various “pooling strategies” such as those proposed by previous colour constancy methods. In the rest of this work we will explore the advantages of replacing the different feed-forward (pooling) configurations of some successful colour constancy models [23, 34, 46] by that of the visual system (as described by current neurophysiological literature [4, 45]). Our aim in doing so is dual, on the one hand we want to explore the technological possibilities of creating a more efficient algorithm and on the other hand we would like to test the idea that contrast-variant-pooling might play an important role in colour constancy. 1.2 Summary of the Contributions 1 1 0 1 0 Figure 1: Flowchart of the proposed contrast-variant-pooling (CVP) mechanism in the context of colour constancy. We implemented CVP through a top-x-percentage-pooling. Given an input image or a feature map: (i) value of the x is computed according to the inverse of local contrast for each channel, and (ii) we estimate the scene illuminant as the average value of the top-x-percentage of pooled pixels (those on the right side of the depicted dashed lines). In the present article we propose a generic contrast-variant-pooling (CVP) mechanism that can replace standard sum- and max-pooling operators in a wide range of computer vision applications. Figure 1 illustrates the flowchart of CVP, which is based on local contrast and therefore it offers a dynamic solution that adapts the pooling mechanism accord- 4 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM ing to the content of region of interest. We tested the feasibility of CVP in the context of colour constancy by substituting the pooling operation of four algorithms: (a) WhitePatch [34], (b) first-order Grey-Edge [46], (c) second-order Grey-Edge [46], and (d) DoubleOpponency [23] in three benchmark datasets. Results of our experiments show the quantitative and qualitative benefits of CVP over max-pooling. 2 2.1 Model Max-pooling Colour Constancy One of the earliest computational models of colour constancy (White-Patch) is grounded on the assumption that the brightest pixel in an image corresponds to a bright spot or specular reflection containing all necessary information about the scene illuminant [34]. Mathematically this is equivalent to a max-pooling operation over the intensity of all pixels: Lc = arg max Ic (x, y), (2) x,y where L represents the estimated illuminant at each chromatic channel c ∈ {R, G, B}; I is the original image and (x, y) are the spatial coordinates in the image domain. One important flaw of this simple approach is that a single bright pixel can misrepresent the whole illuminant. Furthermore, the White-Patch algorithm may fail in the presence of noise or clipped pixels in the image due to the limitations of the max-pooling operator [22]. One approach to address these issues is to account for a larger set of “white” points by pooling a small percentage of the brightest pixels (e.g. the top 1%) [13], an operation referred as top-x-percentage-pooling. In this manner, the pooling mechanism is collectively computed considering a group of pixels rather than a single one. This small variant might be a crucial factor in the estimation of the scene illuminant [32]. A similar mechanism has also been deployed successfully in other applications such as shadow removal [17]. In practice, given the chosen x-percentage, the top-x-percentage-pooling can be implemented through a histogram-based clipping mechanism [13, 17]. Let H be the histogram of the input image I, and let Hc (i) represents number of pixels in colour channel c with intensity i ∈ [0, · · · , Kc ] (histogram’s domain). The scene illuminant Lc is computed as: Lc = 1 Nkc Kc ∑ i · Hc (i), (3) i=kc where Nkc is the total number of pixels within the intensity range kc to Kc . The values of kc={R,G,B} are determined from the chosen x-percentage such that: Kc Nkc = ∑ Hc (i) = xc · P, (4) i=kc where P is the total number of pixels in the image and xc is the chosen percentage for colour channel c. Within this formulation it is very cumbersome to define a universal, optimallyfixed percentage of pixels to be pooled [13] and consequently the free variable x requires specific tuning for each image or dataset individually. Naturally, this limitation restricts the usability of the top-x-percentage-pooling operator. In the following sections we show how to automatically compute this percentage, based on the local contrast of each image. ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 2.2 5 Pooling Mechanisms in the Visual Cortex We know from the physiology of the cerebral cortex that neurons in higher cortical areas pool information from lower areas over increasingly larger image regions. Although the exact pooling mechanism is yet to be discovered, “winner-takes-all” and “sparse coding” kurtotical behaviour are common to many groups of neurons all over the visual cortex [10, 40], and it is conceivable that a mechanism analogous to max-pooling might be present within the cortical layers. Indeed such behaviour has been discovered across a population of cells in the cat visual cortex [33] and the activation level of cells with max-like behaviour was reported to vary depending on the contrast of visual stimuli. Results reported by [33] suggest an inverse relationship between the contrast of a stimulus and the percentage of the signal pooled. When pooling neurons were exposed to low contrast stimuli, their responses shifted slightly away from pure max-pooling (selecting the highest activation response within a region) towards integrating over a larger number of highly activated neurons. In the language of computer vision, this can be regarded as topx-percentage-pooling, where x assumes a smaller value in high contrast and a larger value in low contrast. Interestingly, the pooling of those neurons remained always much closer to max-pooling than to the linear integration of all neurons (sum-pooling) [33]. Mathematically, this can be interpreted as having a very small (top-x-percentage-pooling) x value. It does not come as a great surprise that the pooling mechanism in the visual cortex depends on the stimulus’ contrast. There is a large body of physiological studies showing that receptive fields (RF) of neurons are contrast variant (for a comprehensive review refer to [4]). Quantitative results suggest that RFs in visual area one (V1) of awake macaques double their size when measured at low contrast [45]. Similar expansions have also been reported for the RFs of neurons in extrastriate areas, such as V2 and V4. This implies that a typical neuron in higher cortical areas that normally pool responses from its preceding areas over about three neighbouring spatial locations [48] can access a substantially larger region to pool from in the presence of low contrast stimuli. This is in line with the reported pooling mechanism in the cat visual cortex [33]. 2.3 Contrast Variant Pooling In order to model this contrast-variant-pooling mechanism, we first computed local contrast C of the input image I at every pixel location by means of its local standard deviation defined as: s 2 1 Cc (x, y; σ ) = Ic (x0 , y0 ) − µ(x, y) (5) ∑ #Nσ (x, y) (x0 ,y0 )∈N (x,y) σ where c indexes each colour channel; (x, y) are the spatial coordinates of a pixel; µ is an isotropic average kernel with size σ ; and Nσ (x, y) represents the neighbourhood centred on pixel (x, y) of radius σ . To simulate this inverse relation between stimulus contrast and percentage of signal pooled [33] in the top-x-percentage-pooling operator, we determined the percentage xc in Eq. 4 as the average of inverse local contrast signals: xc = 1 1 , ∀(x, y) ∈ Ω, P∑ C (x, y; σ ) c x,y (6) where Cc is computed from Eq. 5, and Ω is the spatial image domain. In this fashion, instead of defining a fix percentage of signal (pixels) to be pooled (as in [17]), we chose an adaptive 6 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM percentage according to the contrast of image. In terms of colour constancy, this effectively relates the number of pooled pixels to compute the scene illuminant to the average contrast of an image. We illustrated this mechanism of contrast-variant-pooling in the central panel of Figure 1, where red, green and blue signals correspond to the histogram of each chromatic channel. Pixels on the right side of the dashed lines (kc ) are pooled. In this example, contrast is higher for the red signal and therefore a smaller percentage of cells are pooled in the red channel. Bearing in mind that “contrast” is just a fraction in the range [0, 1] – with 0 characterising an absolutely uniform area and 1 representing points with the highest contrast, e.g. edges – we can predict that the percentage x will be a very small number for natural images where homogeneous regions are likely to form the majority of the scene. Consequently in our topx-percentage-pooling operator we always pool a small percentage. This is in agreement with observations of [33] which indicate that such pooling mechanism is always much closer to max-pooling than to sum-pooling. 2.4 Generalisation to Other Colour Constancy Models There is a number of colour constancy models in the literature which are driven by low-level features that require a pooling mechanism on top of their computed feature maps in order to estimate the scene illuminant. In the Double-Opponency [23] algorithm this feature map is computed by convolving a colour-opponent representation of the image with a DoG kernel followed by a max-pooling operation. In the Grey-Edge [46] model, higher-order derivatives of the image are calculated through its convolution with the first- and second-order derivative of a Gaussian kernel. This is complemented by a Minkowski summation, which oscillates between sum- and max-pooling depending on its norm. Similar to the White-Patch algorithm, the pooling mechanism of these models can also be replaced with our top-x-percentage-pooling operator, where x is computed according to the local contrast of image as explained above. The only difference is that instead of pooling from an intensity image (as in case of the White-Patch algorithm), Double-Opponency and Grey-Edge pool over their respective feature maps. This means that Eq. 3 receives a feature map M instead of an intensity image I as input. 3 Experiments and Results In order to investigate the efficiency of our model, we applied the proposed contrast-variantpooling (CVP) mechanism to four different colour constancy algorithms whose source code were publicly available: White-Patch [34], first-order Grey-Edge [46], second-order GreyEdge [46], and Double-Opponency [23]. We simply replaced their max-pooling operator with our proposed pooling mechanism. To evaluate each method we used the recovery angular error defined as:   < ee , et > ◦ ε (ee , et ) = arccos , (7) kee kket k where < . > represents the dot product of the estimated illuminant ee and the ground truth et ; and k.k stands for the Euclidean norm of a vector. It is worth mentioning that this error measure might not correspond precisely to observers’ preferences [47], however, it is the most commonly used comparative measure in the literature. We also computed the reproduction 7 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM angular error [16] in all experiments (due to lack of space these results are not reported here). Readers are encouraged to check the accompanying supplementary materials. We conducted experiments on three benchmark datasets1 , (i) SFU Lab (321 images) [6], (ii) Colour Checker (568 images) [44], and (iii) Grey Ball (11,346 images) [11]. In Table 1 we have reported the best median and trimean angular errors for each of the considered methods (these metrics were proposed by [27] and [25] respectively to evaluate colour constancy algorithms since they are robust to outliers). Mean angular errors are reported in the supplementary materials. SFU Lab [6] Colour Checker [44] Grey Ball [11] Median Trimean Median Trimean Median Trimean White-Patch [34] 6.44 7.51 5.68 6.35 6.00 6.50 Grey-Edge 1st -order [46] 3.52 4.02 3.72 4.76 5.01 5.80 Grey-Edge 2nd -order [46] 3.22 3.65 4.27 5.19 5.72 6.39 Double-Opponency [23] 2.37 3.27 3.46 4.38 4.62 5.28 CVP White-Patch 2.99 3.42 2.97 3.45 5.02 5.15 CVP Grey-Edge 1st -order 3.29 3.72 2.48 2.79 4.70 5.17 CVP Grey-Edge 2nd -order 2.85 3.13 2.59 2.93 4.65 5.05 CVP Double-Opponency 2.02 2.56 2.39 2.84 4.00 4.24 Table 1: Recovery angular errors of four colour constancy methods under max- and contrastvariant-pooling (CVP) on three benchmark datasets. Lower figures indicate better performance. Method Figure 2 illustrates three exemplary results obtained by the proposed contrast-variantpooling (CVP) operator for two colour constancy models: White-Patch and the first-order Grey-Edge. Qualitatively, we can observe that CVP does a better job than max-pooling in estimating the scene illuminant. This is also confirmed quantitatively for the angular errors, shown at the right bottom side of each computed output. 9.73◦ 1.83◦ 6.73◦ 2.59◦ 11.39◦ 1.52◦ 10.31◦ 2.34◦ 8.45◦ 1.45◦ 7.18◦ 1.69◦ Original Ground Truth WP CVP WP GE1 CVP GE1 Figure 2: Qualitative results of White-Patch (WP) and the first-order Grey-Edge (GE1) under max- and contrast-variant-pooling (CVP). Angular errors are indicated on the bottom right corner of each panel. Images are from the SFU Lab, Colour Checker and Grey Ball dataset respectively. 1 All source code and materials are available in the supplementary submission. 8 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 3.1 Influence of the Free Parameters For each free variable of the tested models we compared the performance of max- to contrastvariant-pooling. White-Patch does not have any free variable, therefore it is exempted from this analysis. In Figure 3 we have reported the impact of different σ s (receptive filed size) on Double-Opponency algorithm for the best and the worst results obtained by free variable k in each dataset (results for all ks are available in the supplementary material). We can observe that almost in all cases contrast-variant-pooling outperforms max-pooling. The improvement is more tangible for the Colour Checker and Grey Ball datasets and in low σ s. 10 10 10 9 9 9 8 8 8 7 7 7 6 6 6 5 5 5 4 4 4 3 3 3 2 2 2 1 1 1 0 1 2 3 4 5 6 7 0 8 1 2 3 4 5 6 7 0 8 1 2 3 4 5 6 7 8 SFU Lab [6] Colour Checker [44] Grey Ball [11] Figure 3: The best and the worst results obtained by max- and contrast-variant-pooling for the free variables of Double-Opponency [23] algorithm (k and σ ). Figure 4 illustrates the impact of different σ s (Gaussian size) on the first- and secondorder Grey-Edge algorithm. We can observe similar patterns as with Double-Opponency (contrast-variant-pooling outperforms max-pooling practically in all cases). This improvement is more significant for low σ s, for the Colour Checker dataset and for the second-order derivative. It must be noted that the objective of this article was merely to study the performance of max-pooling and CVP on top of the Grey-Edge algorithm. However, the angular errors of our CVP Grey-Edge happen to be in par with the best results reported for Grey-Edge (obtained by using the optimum Minkowski norm for each dataset [46]), with the important caveat that CVP has no extra variables to be tuned, whereas in the Minkowski norm optimisation the value of p must be hand-picked for each dataset. 9 9 9 8 8 8 7 7 7 6 6 5 5 5 4 4 4 3 3 6 3 2 2 1 2 3 4 5 6 1 2 3 4 5 6 2 1 2 3 4 5 6 SFU Lab [6] Colour Checker [44] Grey Ball [11] Figure 4: Comparison of max- and contrast-variant-pooling for the free variable σ of GreyEdge [46] algorithm (both the first- and second-order derivatives). From Figures 3 and 4 we can observe that the greatest improvement occurs in the Colour Checker dataset. We speculate that one of the reasons for this is the larger range of intensity values in the Colour Checker dataset (16-bit) in comparison to the other two datasets that contain 8-bit images, therefore, an inaccurate max-pooling is more severely penalised. ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 3.2 9 Discussion We would like to emphasise that the objective of this article is not to improve state-of-the-art in colour constancy, but to show that contrast-variant-pooling (CVP) almost always produces improvements over max-pooling. Surprisingly, the results we obtained are even competitive with the state-of-the-art. For instance, in the SFU Lab dataset, the lowest reported angular error is 2.1 (obtained by an Intersection-based Gamut algorithm [5]). This means that our CVP Double-Opponency with an angular error of 2.0 outperforms the state-of-the-art in this dataset. In the Colour Checker and Grey Ball datasets there are a few learning-based models (e.g. Exemplar-based method [31]) that obtain lower angular errors in comparison to CVP Double-Opponency, nevertheless our results are comparable with theirs. Physiological evidence besides, the better performance of CVP can be explained intuitively by the fact that max-pooling relies merely on the peak of a function (or a region of interest), whereas in our model, pooling is defined collectively based on a number of elements near the maximum. Consequently, those peaks that are outliers and likely caused by noise get normalised by other pooled elements. The rationale within our model is to pool a larger percentage at low contrast since in those conditions, peaks are not informative on their own, whereas at high contrast peaks are likely to be more informative and other irrelevant details must be removed (therefore a smaller percentage is pooled). Although, the importance of choosing an appropriate pooling type has been demonstrated both experimentally [30, 49], and theoretically [8], current standard pooling mechanisms lack the desired generalisation [39]. We believe that contrast-variant-pooling can offer a more dynamic and general solution. In this article, we evaluated CVP on the colour constancy phenomenon as a proof-of-concept, however our formulation of CVP is generic (and based on local contrast) and in principle it can be applied to a wider range of computer vision algorithms, such as deep-learning, where pooling is a decisive factor [43]. In our implementation of CVP, we approximated local contrast through local standard deviation (see Eq. 5). There are at least two factors that require a more profound analysis: (i) incorporating more sophisticated models of contrast perception [26] accounting for extrema in human contrast sensitivity; and (ii) analysing the role of kernel size in the computation of local contrast. 4 Conclusion In this article, we presented a novel biologically-inspired contrast-variant-pooling (CVP) mechanism grounded in the physiology of the visual cortex. Our main contribution can be summarised as linking the percentage of pooled signal to the local contrast of the stimuli, i.e. pooling a larger percentage at low contrast and a smaller percentage at high contrast. Our CVP operator remains always closer to max-pooling rather than to sum-pooling since natural images generally contain more homogeneous areas than abrupt discontinuities. We tested the efficiency of our CVP model in the context of colour constancy by replacing the max-pooling operator of four algorithms with the proposed pooling. After that, we conducted experiments in three benchmark datasets. Our results show that contrast-variantpooling outperforms the commonly used max-pooling operator nearly in all cases. This can be explained by the fact that our model allows for more informative peaks to be pooled while suppressing less informative peaks and outliers. We further argued that the proposed CVP is a generic operator, thus its application can 10 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM be extended to a wider range of computer vision algorithms by offering a dynamic (and automatic) framework that is based on the local contrast of an image or a pixel. This opens a multitude of possibilities for future lines of research and it remains an open question whether our model can reproduce its excellent results in other domains as well. Therefore, it certainly is interesting to investigate whether our CVP can improve convolutional neural networks. Acknowledgements This work was funded by the Spanish Secretary of Research and Innovation (TIN201341751-P and TIN2013-49982-EXP). References [1] Vivek Agarwal, Andrei V Gribok, and Mongi A Abidi. Machine learning approach to color constancy. Neural Networks, 20(5):559–563, 2007. [2] Arash Akbarinia and C Alejandro Parraga. Biologically-inspired edge detection through surround modulation. In Proceedings of the British Machine Vision Conference, pages 1–13, 2016. [3] Arash Akbarinia and C Alejandro Parraga. Feedback and surround modulated boundary detection. International Journal of Computer Vision, pages 1–14, 2017. [4] Alessandra Angelucci and S Shushruth. Beyond the classical receptive field: Surround modulation in primary visual cortex. The new visual neurosciences, pages 425–444, 2013. [5] Kobus Barnard. Improvements to gamut mapping colour constancy algorithms. In Computer Vision–ECCV 2000, pages 390–403. Springer, 2000. [6] Kobus Barnard, Lindsay Martin, Brian Funt, and Adam Coath. A data set for color research. Color Research & Application, 27(3):147–151, 2002. [7] Jonathan T Barron. Convolutional color constancy. In Proceedings of the IEEE International Conference on Computer Vision, pages 379–387, 2015. [8] Y-Lan Boureau, Jean Ponce, and Yann LeCun. A theoretical analysis of feature pooling in visual recognition. In Proceedings of the international conference on machine learning (ICML), pages 111–118, 2010. [9] Gershon Buchsbaum. A spatial processor model for object colour perception. Journal of the Franklin institute, 310(1):1–26, 1980. [10] Matteo Carandini and David J Heeger. Normalization as a canonical neural computation. Nature Reviews Neuroscience, 13(1):51–62, 2012. [11] Florian Ciurea and Brian Funt. A large image database for color constancy research. In Color and Imaging Conference, volume 2003, pages 160–164, 2003. [12] Navneet Dalal and Bill Triggs. Histograms of oriented gradients for human detection. In Computer Vision and Pattern Recognition (CVPR), volume 1, pages 886–893, 2005. ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 11 [13] Marc Ebner. Color constancy, volume 6. John Wiley & Sons, 2007. [14] Christina Enroth-Cugell and John G Robson. The contrast sensitivity of retinal ganglion cells of the cat. The Journal of physiology, 187(3):517–552, 1966. [15] Graham D Finlayson and Elisabetta Trezzi. Shades of gray and colour constancy. In Color and Imaging Conference, volume 2004, pages 37–41, 2004. [16] Graham D Finlayson and Roshanak Zakizadeh. Reproduction angular error: An improved performance metric for illuminant estimation. perception, 310(1):1–26, 2014. [17] Graham D Finlayson, Steven D Hordley, and Mark S Drew. Removing shadows from images. In Computer Vision–ECCV 2002, pages 823–836. Springer, 2002. [18] David A Forsyth. A novel algorithm for color constancy. International Journal of Computer Vision, 5(1):5–35, 1990. [19] David H Foster. Color constancy. Vision research, 51(7):674–700, 2011. [20] Damien Fourure, Rémi Emonet, Elisa Fromont, Damien Muselet, Alain Trémeau, and Christian Wolf. Mixed pooling neural networks for color constancy. In Image Processing (ICIP), 2016 IEEE International Conference on, pages 3997–4001. IEEE, 2016. [21] Brian Funt and Weihua Xiong. Estimating illumination chromaticity via support vector regression. In Color and Imaging Conference, volume 2004, pages 47–52. Society for Imaging Science and Technology, 2004. [22] Brian Funt, Kobus Barnard, and Lindsay Martin. Is machine colour constancy good enough? In Computer Vision–ECCV’98, pages 445–459. Springer, 1998. [23] Shao-Bing Gao, Kai-Fu Yang, Chao-Yi Li, and Yong-Jie Li. Color constancy using double-opponency. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 37(10):1973–1985, 2015. [24] Arjan Gijsenij and Theo Gevers. Color constancy using natural image statistics and scene semantics. IEEE Transactions on Pattern Analysis and Machine Intelligence, 33 (4):687–698, 2011. [25] Arjan Gijsenij, Theo Gevers, and Marcel P Lucassen. Perceptual analysis of distance measures for color constancy algorithms. JOSA A, 26(10):2243–2256, 2009. [26] Andrew M Haun and Eli Peli. Perceived contrast in complex images. Journal of vision, 13(13):3–3, 2013. [27] Steven D Hordley and Graham D Finlayson. Reevaluation of color constancy algorithm performance. JOSA A, 23(5):1008–1020, 2006. [28] Paul M Hubel. The perception of color at dawn and dusk. Journal of Imaging Science and Technology, 44(4):371–375, 2000. [29] Laurent Itti and Christof Koch. Computational modelling of visual attention. Nature reviews neuroscience, 2(3):194–203, 2001. 12 ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM [30] Kevin Jarrett, Koray Kavukcuoglu, Yann LeCun, et al. What is the best multi-stage architecture for object recognition? In International Conference on Computer Vision (ICCV), pages 2146–2153, 2009. [31] Hamid Reza Vaezi Joze and Mark S Drew. Exemplar-based color constancy and multiple illumination. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 36(5):860–873, 2014. [32] Hamid Reza Vaezi Joze, Mark S Drew, Graham D Finlayson, and Perla Aurora Troncoso Rey. The role of bright pixels in illumination estimation. In Color and Imaging Conference, volume 2012, pages 41–46, 2012. [33] Ilan Lampl, David Ferster, Tomaso Poggio, and Maximilian Riesenhuber. Intracellular measurements of spatial integration and the max operation in complex cells of the cat primary visual cortex. Journal of neurophysiology, 92(5):2704–2713, 2004. [34] Edwin H Land. The Retinex Theory of Color Vision. Scientific American offprints. W.H. Freeman Company. [35] Edwin H Land. An alternative technique for the computation of the designator in the retinex theory of color vision. Proceedings of the National Academy of Sciences, 83 (10):3078–3080, 1986. [36] Yann LeCun, Bernhard E Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne E Hubbard, and Lawrence D Jackel. Handwritten digit recognition with a back-propagation network. In Advances in neural information processing systems, pages 396–404, 1990. [37] David G Lowe. Distinctive image features from scale-invariant keypoints. International journal of computer vision, 60(2):91–110, 2004. [38] David Marr and Ellen Hildreth. Theory of edge detection. Proceedings of the Royal Society of London B: Biological Sciences, 207(1167):187–217, 1980. [39] Naila Murray and Florent Perronnin. Generalized max pooling. In Computer Vision and Pattern Recognition (CVPR), pages 2473–2480, 2014. [40] Bruno A Olshausen et al. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607–609, 1996. [41] C. Alejandro Parraga and Arash Akbarinia. Colour constancy as a product of dynamic centre-surround adaptation. Journal of Vision, 16(12):214–214, 2016. [42] Erik Reinhard, Michael Stark, Peter Shirley, and James Ferwerda. Photographic tone reproduction for digital images. In ACM Transactions on Graphics (TOG), volume 21, pages 267–276. ACM, 2002. [43] Dominik Scherer, Andreas Müller, and Sven Behnke. Evaluation of pooling operations in convolutional architectures for object recognition. Artificial Neural Networks– ICANN 2010, pages 92–101, 2010. [44] Lilong Shi and Brian Funt. Re-processed version of the gehler color constancy dataset of 568 images. http://www.cs.sfu.ca/~colour/data/. ARASH AKBARINIA: CONTRAST VARIANT POOLING MECHANISM 13 [45] S Shushruth, Jennifer M Ichida, Jonathan B Levitt, and Alessandra Angelucci. Comparison of spatial summation properties of neurons in macaque v1 and v2. Journal of neurophysiology, 102(4):2069–2083, 2009. [46] Joost Van De Weijer, Theo Gevers, and Arjan Gijsenij. Edge-based color constancy. IEEE Transactions on image processing, 16(9):2207–2214, 2007. [47] Javier Vazquez-Corral, C. Alejandro Parraga, Ramon Baldrich, and Maria Vanrell. Color constancy algorithms: Psychophysical evaluation on a new dataset. Journal of Imaging Science and Technology, 53(3):31105–1, 2009. [48] Hugh R Wilson and Frances Wilkinson. Configural pooling in the ventral pathway. The new visual neurosciences, pages 617–626, 2014. [49] Jianchao Yang, Kai Yu, Yihong Gong, and Thomas Huang. Linear spatial pyramid matching using sparse coding for image classification. In Computer Vision and Pattern Recognition (CVPR), pages 1794–1801, 2009.
1cs.CV
1 Data Discovery and Anomaly Detection Using Atypicality: Theory arXiv:1709.03189v1 [cs.IT] 10 Sep 2017 Anders Høst-Madsen, Fellow, IEEE, Elyas Sabeti, Member, IEEE, Chad Walton Abstract A central question in the era of ’big data’ is what to do with the enormous amount of information. One possibility is to characterize it through statistics, e.g., averages, or classify it using machine learning, in order to understand the general structure of the overall data. The perspective in this paper is the opposite, namely that most of the value in the information in some applications is in the parts that deviate from the average, that are unusual, atypical. We define what we mean by ’atypical’ in an axiomatic way as data that can be encoded with fewer bits in itself rather than using the code for the typical data. We show that this definition has good theoretical properties. We then develop an implementation based on universal source coding, and apply this to a number of real world data sets. Index Terms Big Data, atypicality, minimum description length, data discovery, anomaly. I. I NTRODUCTION One characteristic of the information age is the exponential growth of information, and the ready availability of this information through networks, including the internet – “Big Data.” The question is what to do with this enormous amount of information. One possibility is to characterize it through statistics – think averages. The perspective in this paper is the opposite, namely that most of the value in the information is in the parts that deviate from the average, that are unusual, atypical. The rest is just background noise. Take art: the truly valuable paintings are those that are rare and atypical. The same could be true for scientific research and entrepreneurship. Take online collections of photos, such as Flickr.com. Most of the photos are rather pedestrian snapshots and not of interest to a wider audience. The photos that of interest are those that are unique. Flickr has a collection of photos rated for ’interestingness,’ and one can notice that those photos are indeed very different from typical photos. They are atypical. The aim of our approach is to extract such ’rare interesting’ data out of big data sets. The central question is what ’interesting’ means. A first thought is to focus on the ’rare’ part. That is, interesting data is something that is unlikely based on prior knowledge of typical data or examples of typical data, i.e., training. This is the way A. Høst-Madsen and E. Sabeti are with the Department of Electrical Engineering, University of Hawaii Manoa, Honolulu, HI 96822 (e-mail: {ahm,sabeti}@hawaii.edu). C. Walton is with the Department of Surgery, University of Hawaii, Honolulu, HI, 96813. Email: [email protected]. This work was supported in part by NSF grants CCF 1017823, 1017775, and 1434600. The paper was presented in part at IEEE Information Theory Workshop 2013, Seville. September 12, 2017 DRAFT 2 an outlier is usually defined. Unlikeliness could be measured in terms of likelihood, in terms of codelength [1], [2] – called ’surprise’ in [3] – or according to some distance measure. This is also the most common principle in anomaly detection [4]. However, perhaps being unlikely is not sufficient for something to be ’interesting.’ In many cases, outliers are junk that are eliminated not to contaminate the typical data. What makes something interesting is maybe that it has a new unusual structure in itself that is quite different from the structure of the data we have already seen. Return to the example of paintings: what make masterworks interesting is not just that they are different than other paintings, but that they have some ’structure’ that is intriguing. Or take another example. Many scientific discoveries, like the theory of relativity and quantum mechanics, began with experiments that did not fit with prevailing theories. The experiments were outliers or anomalies. What made them truly interesting was that it was possible to find a new theory to explain the data, be it relativity or quantum mechanics. This is the principle we pursue: finding data that have better alternative explanations than those that fit the typical data. Something being unlikely is not even necessary for the data to be ’interesting.’ Suppose the typical data is iid uniform {0, 1}. Then any sequence of bits are equally likely. Therefore, a sequence consisting of purely 1, 1111111 . . . is in no way ’surprising.’ Yet, it should catch our interest. When we look for new interesting data, a characteristic is that we do not know what we are looking for. We are looking for “unknown unknowns” [5]. Instead of looking at specific statistics of data, we need to use a universal approach. This is provided by information theory. This idea of finding alternative explanations for data rather than measuring some kind of difference from typical data is what separates our method from usual approaches in outlier detection and anomaly detection. As far as we can determine from reading hundreds of papers, our approach has not been explored previously. Obviously, information theory and coding have been used in anomaly detection, data mining, and knowledge discovery before, and we will discuss how this compares to our approach later. Our methodology also has connections to tests for randomness, e.g., the run length test and [6], [7], but our aim is different. A. Applications Atypicality is relevant in large number of various applications. We will list a few applications here. ECG. For electrocardiogram (ECG) recordings there are patterns in heart rate variability that are known to indicate possible heart disease [8], [9], [10], [11]. With modern technology it is possible for an individual to wear and unobtrusive heart rate monitor 24/7. If atypical patterns occur, it could be indicative of disease, and the individual or a doctor could be notified. But perhaps a more important application is to medical research. One can analyze a large collection of ECG recordings and look for individuals with atypical patterns. This can then potentially be used to develop new diagnostic tools. Genomics. Another example of application is interpretation of large collections of genomics data. Given that all mammals have essentially the same set of genes, there must exist some significant differences that distinguish the obvious distinct attributes between species, as well as more subtle differences within a species. Although the genome has been mined by exhaustive studies applying a panoply of approaches, regions once thought to be “uninteresting” have recently come under increased study for their potential role in defined morphological and September 12, 2017 DRAFT 3 physiological differences between individuals [12]. Applying an atypical evaluation tool to genomic data from individuals of known pathophysiological/morphological irregularities may provide valuable insight to the genetic mechanisms underlying the condition. Ocean Monitoring. In passive acoustic monitoring (PAM) [13] of oceans, one or more hydrophones is towed behind a ship or deployed in a fixed bottom-mounted or suspended array in order to record vocalizations of marine mammals. One major focus is to detect, and perhaps count, rare or endangered species. It would be highly interesting to scan the data for any unusual patterns, which can then be further examined by a researcher. Plant Monitoring. In for example nuclear plants, atypical monitoring data may be indicative of something about to go wrong. Computer Networks. Atypical network traffic could be indicative of a cyberattack. This is already being used through anomaly detection [14]. However, an abstract atypicality approach can be used to find more subtle attacks – the unknown unknowns. Airport Security. Already software is being used to flag suspicious flyers, likely based on past attacks. Atypical detection could be used to find innovative attackers. Stock Market. Atypicality could be used to detect insider trading. It could also be used by investors to find unusual stocks to invest in, promising outstanding returns – or ruin. Astronomy. Atypicality can be used to scan huge databases for new kinds of cosmological phenomena. Credit Card Fraud. Unusual spending patterns could be indicative of fraud. This is already used by credit card companies, but obviously in a simple, and annoying way, as anyone who’s credit card has been blocked on an overseas trip can testify to. Gambling. Casinos are constantly fighting fraudsters. This is a game of cat and mouse. Fraudsters constantly find new ways to trick the casinos (one such inventor was Shannon himself). Therefore, an abstract atypicality approach may be the best solution to catch new ways of fraud. B. Notation We use x to denote a sequence in general, and xl when we need to make the length explicit; xi denotes a single sample of the sequence. We use capital letters Xi to denote random variables rather than specific outcomes. Finally X denotes a subsequence. All logarithms are to base 2 unless otherwise indicated. II. ATYPICALITY Our starting point is the in theory of randomness developed by Kolmogorov and Martin-Löf [15], [7], [16]. Kolmogorov divides (infinite) sequences into ’typical’ and ’special.’ The typical sequences are those that we can call random, that is, they satisfy all laws of probability. They can be characterized through Kolmogorov complexity. A sequence of bits {xn , n = 1, . . . , ∞} is random (i.e, iid uniform) if the Kolmogorov complexity of the sequence satisfies K(x1 , . . . , xn ) ≥ n − c for some constant c and for all n[15]. The sequence is incompressible if K(x1 , . . . , xn |n) ≥ n for all n, and a finite sequence is algorithmically random if K(x1 , . . . , xn |n) ≥ n [16]. In terms of coding, an iid random sequence is also incompressible, or, put another way, the best coder is the identity September 12, 2017 DRAFT 4 function. Let us assume we draw sequences xn from an iid uniform distribution. The optimum coder is the identity function, and the code length is n. Now suppose that for one of these sequences we can find a (universal) coder so that the code length is less than n; while not directly equivalent, one could state this as K(x1 , . . . , xn |n) < n. With an interpretation of Kolmogorov’s terms, this would not be a ’typical’ sequence, but a ’special’ sequence. We will instead call such sequences ’atypical.’ Considering general distributions and general (finite) alphabets instead of iid uniform distributions, we can state this in the following general principle Definition 1. A sequence is atypical if it can be described (coded) with fewer bits in itself rather than using the (optimum) code for typical sequences. This definition is central to our approach to the atypicality problem. In the definition, the “(optimum) code for typical sequences,” is quite specific, following the principles in for example [16]. We assume prefix free codes. Within that class the coding could be done using Huffman codes, Shannon codes, Shannon-Fano-Elias codes, arithmetic coding etc. We care only about the code length, and among these the variation in length is within a few bits, so that the code length for typical encoding can be quite accurately calculated. On the other hand, “described (coded) with fewer bits in itself” is less precise. In principle one could use Kolmogorov complexity, but Kolmogorov complexity is not calculable and it is only given except for a constant, and comparison with code length therefore is not an “apples-to-apples” comparison. Rather, some type of universal source coder should be used. This can be given a quite precise meaning in the class of finite state machine sources, [17] and following work, and is strongly related to minimum description length (MDL) [18], [19], [20], [17]. What is essential is that we adhere to strict decodability at the decoder. The decoder only sees a stream of bits, and from this it should be able to accurately reconstruct the source sequence. So, for example, if a sequence is atypical, there must be a type of “header” telling the decoder to use a universal decoder rather than the typical decoder. Or, if atypical sequences can be encoded in multiple ways, the decoder must be informed through the sequence of bits which encoder was used. One could argue that such things are irrelevant for for example anomaly detection, since we are not actually encoding sequences. The problem is that if such terms are omitted, it is far too easy to encode a sequence “in itself.” This is like choosing a more complex model to fit data, without accounting for the model complexity in itself, which is exactly what MDL sets out to solve, although also in this case actual encoding is not done. We therefore try to account for all factors needed to describe data, and we believe this is one of the key strengths of the approach. A major difference between atypical data and anomalous data is that atypicality is an axiomatic property of data, defined by Definition 1 based on Kolmogorov-Martin-Löf randomness. On the other hand, as far as we know, an anomaly is not something that can be strictly defined. Usually, we think of an anomaly as something caused by an outside phenomenon: an intruder in a computer network, a heart failure, a gambler playing tricks. This influences how we think of performance. If a detector fails to give an indication of an anomaly, we have a miss (or type II error), but if it gives an indication when such things are not happening we have a false alarm (type I error). September 12, 2017 DRAFT 5 Atypicality, on the other hand, is purely a property of data. Ideally, there are therefore no misses or false alarms: data is atypical or not. Here is what we mean. If there is an anomaly that expresses itself through the observed data, that must mean that there is some structure in the data, and in theory a source coder would discover and exploit such structure and reduce code length. Thus, if the data is not atypical that means there is simply no way to detect the anomaly through the observations – again in theory. We therefore cannot really call that a miss. On the other hand, suppose that in a casino a gambler has a long sequence of wins. This could be due to fraud, but it could also be simply due to randomness. But casino security would be interested in either case for further scrutiny. Thus, the reason for the atypicality does not really matter, the atypicality itself matters. Still, to distinguish the two cases we call a sequence intrinsically atypical if it is atypical according to Definition 1 while being generated from the typical probability model, while it is extrinsically atypical if it is in fact generated by any other probability law. Definition 1 has two parts that work in concert, and we can write it simplified as Ct (x) − Ca (x) > 0 where Ct is the typical codelength and Ca the atypical codelength. The typical code length Ct (x) is simply an expression of the likelihood of seeing a particular sequence. If Ct (x) is large it means that the given sequence is unlikely to happen, and detecting sequences by Ct (x) > τ would catch many outliers. As an extreme example, if a sequence is impossible according to the typical distribution, Ct (x) = ∞, and it would always be caught. But it would not work universally. If, as we started out with, typical sequences are iid uniform, any sequence is equally likely and Ct (x) > τ would not catch any sequences. In this case, if a test sequence has some structure, it is possible that Ca (x) < Ct (x), and such sequences would be caught by atypicality; thus calculating Ca (x) is essential. Calculating Ct (x) is also essential. Suppose that we instead use E[Ct ] − Ca (x), where E[Ct ] is the code length used to encode typical sequences “on average,” essentially the entropy rate. Again, this will catch some sequences: if a test sequence has more or less structure than typical sequences, E[Ct ] − Ca (x) 6= 0. But again, it will omit very obvious examples: if as test sequence we use a typical sequence with 0 and 1 swapped, E[Ct ] ≈ Ca (x), while on the other hand Ct (x) > Ca (x). And impossible sequences with Ct (x) = ∞ would not be caught with absolute certainty. Now, to declare something an outlier, we have to find a coder with Ca (x) < Ct (x). It is not sufficient that Ct (x) is large, i.e., that the sequence is unlikely to happen. However, we can always use the trivial coder that transmits data uncoded. If the sequence is unlikely to happen according to the typical distribution, then it is likely that Ct (x) > (length of x). Thus, it can be seen that the two parts work in concert to catch sequences. Each part might catch some sequences, but to catch all “anomalies,” both parts have to be used. Another point of view is the following. Suppose again the typical model is binary uniform iid. We look at a collection of sequences, and now we want to find the most atypical sequences, i.e., the most “interesting” sequences. Without a specification of what “interesting” is, it seems reasonable to choose those sequences that have the most structure, and again this can reasonably be measured by how much the sequence can be compressed. This is what Rissanen [17] calls “useful information,” U (x) = n − Ca (x). But again, we need to take into account the typical model if it is not uniform iid. For example, if typical sequences have much structure, then sequence with little structure might be more interesting. We therefore end up with that Ct (x) − Ca (x) is a reasonable measure of how interesting sequences might be. September 12, 2017 DRAFT 6 A. Alternative approaches While, as argued in the introduction, and outlined above, what we are aiming for is not anomaly detection in the traditional sense, there are still many similarities. And certainly information theory and universal source coding has been used previously in anomaly detection, e.g., [4], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30]. The approaches have mostly been heuristic. A more fundamental and systematic approach is Information Distance defined in [31]. Without being able to claim that this applies to all of the perhaps hundreds of papers, we think the various approaches can be summarized as using universal source coding as a type of distance measure, whether it satisfies strict mathematical metric properties as in [31] or is more heuristic. On the other hand, our methodology in Definition 1 cannot be classified as a distance measure in a traditional sense. We are instead trying to find alternative explanations for data. We will comment on how our approach contrasts with a few other approaches. While the similarity distance developed in [31] is not directly applicable to the problem we consider, we can to some extent adapt it, which is useful for contrast. The similarity distance is d= min{K(y|x∗ ), K(x|y ∗ )} max{K(x), K(y)} Instead of being given the typical distribution, we can imagine that we are given a very long typical sequence x which is used for “training.” In that case d= K(x|y ∗ ) K(x, y) − K(y) = K(x) K(x) within a certain approximation. Suppose, as was our starting point above, that the typical distribution is binary iid uniform. If y is also binary iid uniform, within a constant K(x, y) = K(x) + K(y), and d = 1. But if y is drawn from some other distribution, x cannot help describing x either, and still d = 1. That makes sense: two completely random sequences are not similar, whether they are from the same distribution or not. Thus, similarity distance cannot be used for ’anomaly’ detection as we have have defined it: looking for ’special’ sequences in the words of Kolmogorov. This is not a problem of the similarity metric; it does exactly what it is designed for, which is really deterministic similarity between sequences, appropriate for classification. The reason similarity distance still gives results for anomaly detection [32] is actually that universal source coders approximate Kolmogorov complexity poorly. Heuristic methods using for anomaly detection using universal source coding [4], [21], [22], [23], [24], [25], [26], [27], [28], [29], [30], [1], [2] are mostly based on comparing code length. Let C(x) be the code length to encode the sequence x with a universal source coder. Let x be a training string and y a test sequence. We can then compare C(x) |x| with C(y) |y| (which could be seen as a measure of entropy rate) or compare C(xy) with C(x) to detect change. The issue with this is that there are many completely dissimilar sources that have the same entropy rate. As an example, let the data be binary iid with the original source having P (X = 1) = 1 3 and the new source P (X = 1) = 23 . Then the optimum code for the original source and the optimum code for the new source have the same length. On the other hand, atypicality will immediately distinguish such sequences. September 12, 2017 DRAFT 7 III. B INARY IID C ASE In order to clarify ideas, at first we consider a very simple model. The typical model is iid binary with P (Xn = 1) = p. The alternative model class also binary iid but with P (Xn = 1) = θ, where θ is unknown. We want to decide if a given sequence xl is typical or atypical. This can be stated as the hypothesis test problem H0 :θ = p H1 :θ 6= p This problem does not have an UMP (universal most powerful) test. However, a common approach to solving this type of problem is the GLRT (generalized likelihood ratio test) [33]. Let P (b) = P (Xn = b) P̂ (b) = N (b|xl ) l where l is the sequence length and N (b|xl ) is the number of xn = b ∈ {0, 1}. The GLRT is Q1 l P̂ (b)N (b|x ) L = log Qb=0 1 N (b|xl ) b=0 P (b) = 1 X b=0 =l 1 X 1 N (b|x ) log N (b|xl ) − N (b|xl ) log P (b) l 1 X b=0 l b=0 1 P̂ (b) log N (b|xl ) − l l 1 X P̂ (b) log P (b) b=0 = lD(p̂kp)   1 L > t φ(xl ) =  0 L ≤ t Where D(p̂kp) = P1 b=0 P̂ (b) log P̂ (b) P (b) (1) is the relative entropy [16] and t some threshold. While the GLRT is a heuristic principle, it satisfies some optimality properties, and in this case it is equal to the invariant UMP test [34], which can be considered an optimum solution under certain constraints. Thus, it is reasonably to take this as the optimum solution for this problem, and we do not need to appeal to Kolmogorov or information theory to solve the problem. The complications start if we consider sequences of variable length l. The test (1) depends on the sequence length. We need to choose a threshold t(l) as a function of l, which will then result in a false alarm probability PF A (t(l)) and detection probability PD (t(l)). There is no obvious argument for how to choose t(l) from a hypothesis testing point of view; we could choose t independent of l, but that is just another arbitrary choice. We will consider this problem in the context of Definition 1. In order to do so, we need to model the problem from a coding point of view. We assume we have an (infinite) sequence of sequences of variable length li , and these need to be encoded. We need to encode each bit, and also to encode whenever a new sequence starts. For September 12, 2017 DRAFT 8 typical encoding of the bits we can use a Shannon code, Huffman code, arithmetic coding etc. The code length for a sequence of length l is 1 1 Lt = N (1|xl ) log + N (0|xl ) log p 1−p   1 1 = l p̂ log + (1 − p̂) log (2) p 1−p P xi . We also need to encode where a sequence ends except for a small constant factor; here p̂ = P̂ (1) = 1l and a new one starts. For simplicity let us for now assume lengths are geometrically distributed. We can then model the problem as one with three source symbols ’0’, ’1’ and ’,’ with an iid distribution with P (0 ,0 ) = , P (0 00 ) = p − 2 , P (0 10 ) = (1 − p) − 2 . If we assume  is small, the expression (2) is still valid for the content part, and to each sequence is added a constant − log  to encode separators. To decide if a sequence is atypical according to Definition 1, we can use the universal source coder from [16]: the source encodes first the number of ones k; then it enumerates the sequences with k ones, and transmits the index of the given sequence. For analysis it is important to have a simple expression for the code length. We can therefore use La = lH(p̂) + 1 2 log l. This is an approximation which is good for reasonably large l and it also reaches the lower bound in [17], [35]. The source-coder also needs to inform the decoder that the following is an atypical sequence (so that it knows to use the atypical decoder rather than the typical encoder), and where it ends. For the former we can use a ’.’ to indicate the start of an atypical sequence rather than the ’,’ for typical sequences. If the probability that a sequence is atypical is δ  1, P (0 .0 ) = δ and P (0 ,0 ) = (1 − δ) ≈ . The code length for a ’.’ now is − log  − log δ. To mark the end of the atypical sequence we could again insert a ’.’ or a ’,’. But the code for either is based on the distribution of lengths of typical sequences, which we assume known, whereas we would have no knowledge of the length of atypical sequences. Instead it seems more reasonable to encode the length of the specific atypical sequence. As argued in [18], [36] this can be done with log∗ l + log c, where c is a constant and log∗ (l) = log l + log log l + log log log l + · · · (3) where the sum continues as long as the argument to the log is positive. To summarize we have   1 1 Lt = l p̂ log + (1 − p̂) log − log  p 1−p 1 La = lH(p̂) + log l + log∗ l + log c − log  − log δ 2 3 ≈ lH(p̂) + log l − log  + τ 2 τ = − log δ + log c (4) The criterion for a sequence to be atypical is La < Lt , which easily seen to be equivalent to D(p̂kp) > τ+ 3 2 log l (5) l If the lengths are fixed, this reduces to (1). But if the lengths are variable, (5) provides a threshold as a function of l. The term September 12, 2017 3 2 log l ensures that liml→∞ PF A (l) = 0, which seems reasonable. If instead D(p̂kp) > τ l is used, it DRAFT 9 is easy to see that liml→∞ PF A (l) > 0. Except for this property, the term 3 2? 3 2 log l might seem arbitrary, e.g., why But it is based on solid theory, and as will be seen later it has several important theoretical properties. We will examine the criterion (5) in more detail. The inequality (5) gives two thresholds for p̂, p̂ > p+ p̂ < p− Where 0 < p− < p < p+ < 1. It is impossible to find explicit expressions for p± , but it is clear that p± → p as l → ∞. Therefore, for l large, we can replace D(p̂kp) with a series expansion. We then end up with the more explicit criterion (p − p̂)2 1 3 > (τ + log l) pq ln 4 l 2 r r pq ln 4 3 · τ + log l |p̂ − p| > ∆τ = l 2 (6) In the following we will use this as it is considerably simpler to analyze. We can also write this as Pl √ i=1 xi − p √ > 2τ ln 2 + 3 ln l pql (7) Now, if not for the term 3 ln l, this would be a central limit type of statement, and the probability that a sequence is classified as (intrinsically) atypical would be PA ≈ 2Q √ 2 ln 2τ  (8) independent of l. Our main interest is exactly the the dependency on l, which is given by the following Theorem Theorem 2. Consider an iid {0, 1}-sequence. Let PA (l) be the probability that a sequence of length l is classified as intrinsically atypical according to (6). Then PA (l) is bounded by PA (l) ≤2−τ +1 1 K(l, τ ) l3/2 (9) ∀τ : lim K(l, τ ) =1 l→∞ For p = 1 2 this can be strengthened to 1 l3/2 (10) ln PA (l) =1 l→∞ − 3 ln l 2 (11) PA (l) ≤2−τ +1 These bounds are tight in the sense that lim Proof: The Chernoff bound (e.g., [37]) states PA (l) = P (|p̂ − p| > ∆τ ) =2P l X ! Xi ≥ lp + b i=1  ≤2 inf e−lsp−sb MX (s)l s>0 September 12, 2017 DRAFT 10 Where (as usual, q = 1 − p) r b= r lpq ln 4 τ + 3 log l 2 and MS (s) is the moment generating function of Xi , which for a Bernoulli random variable is MX (s) =pes + q Then n o 1 l PA (l) ≤ inf exp (−s (pl + b)) (pes + q) s>0 2 Minimizing over s gives 1 PA (l) ≤ 2  lq lq − b l  q(lp + b) p(lq − b) −lp−b or   q(lp + b) + (−lp − b) ln p(lq − b)     b b =l ln 1 + + (−lp − b) ln 1 + lq − b p(lq − b)  2 2 2 2 2 b 3l q p + lb(7p − 6p − 3) + b (6p + 3) ≤ 6p2 (b − lq)3 1 ln PA (l) ≤l ln 2 ≤− lq lq − b For p = for p = 1 2 1 2 x2 2  b2 b3 + O (1) 2 2lpq l = − τ ln 2 − where we have used x −  ≤ ln(1 + x) ≤ x − 3 ln3/2 l ln l + O (1) √ τ 3/2 , 2 l x2 2 + x3 3 (12) for x ≥ 0. The equation (12) directly leads to (9). Hoeffding’s inequality [38] gives the bound   b2 PA (l) ≤ 2 exp −2 l    3 = 2 exp − ln 2 τ + log l 2 (13) this is tighter than (12). For the lower bound we use moderate deviations from [39]. Define X̃i = Pl i=1 X̃i p >1 l(2τ ln 2 + 3 ln l) We define al = 1 2τ ln 2+3 ln l , Xi −p √ pq . We can then rewrite (7) as which satisfies liml→∞ al = 0, liml→∞ lal = ∞. Using this as al in [39, Theorem 3.7.1] gives 1 lim inf ln P l→∞ 2τ ln 2 + 3 ln l = lim inf l→∞ ≥− September 12, 2017 1 ln P 3 ln l Pl i=1 p X̃i l(2τ ln 2 + 3 ln l) ! Pl X̃ i i=1 p >1 l(2τ ln 2 + 3 ln l) ! >1 1 2 DRAFT 11 Together with the upper bound, this gives (11). Figure 1 compares the upper bound with simulations. −1 10 Upper bound Simulation −2 10 −3 PA 10 −4 10 −5 10 −6 10 −7 10 1 10 2 3 10 4 10 10 n Fig. 1. Simulated PA and the Upper bound for τ = 1, p = 0.3. We can also bound the miss probability for extrinsically atypical sequences as follows Theorem 3. Suppose that the typical sequence is iid {0, 1}-sequence with P (Xn = 1) = p. Let the test sequence by iid with P (Xn = 1) = pa . The probability that the test sequence is missed according to criterion (6) is upper bounded by −τ PM (l) ≤2 1  qa p pa q √lpq(2τ ln 2+3 ln l) l3/2  p−1 p+1 −l qa q × K(l, τ ) ppa pp (14) ∀τ : lim K(l, τ ) =1 l→∞ Proof: We may assume that pa < p. Similarly to the proof of Theorem 2 the Chernoff bound is PM (l) ≤ inf s>0 n o l exp (−s (pl − b)) (pa es + qa ) Minimizing over s gives  PM (l) ≤ September 12, 2017 lqa lq + b l  qa (lp − b) pa (lq + b) −lp+b DRAFT 12 or     lqa qa (lp − b) ln PM (l) ≤l ln + (−lp + b) ln lq + b pa (lq + b)       qa qa q ≤l ln − lp ln − lp ln q pa p       3 p qa b2 b + b ln + ln − +O 2 q pa 2lpq l using series expansions. A. Hypothesis testing interpretation The solution (5) may seem arbitrary, but it has a nice interpretation in terms of hypothesis testing [40]. Return to the solution (1). That solution gives a test for a given l. However, the problem is that it does not reconcile tests for different l. One way to solve that issue is to consider l a random variable, i.e., introducing a prior distribution in the Bayesian sense. Let the prior distribution of l be PL (l). The equation (1) now becomes Q1 N (b|xl ) PL (l) b=0 P̂ (b) L = log Q1 l) N (b|x PL (0) b=0 P (b) =l 1 X b=0 −l 1 X 1 P̂ (b) log N (b|xl ) l P̂ (b) log P (b) + log PL (l) − log PL (0) b=0 = lD(p̂kp) + log PL (l) − log PL (0) The hypothesis test now is D(p̂kp) > τ + log PL (0) − log PL (l) l (15) Of course, the problem is that we don’t know P (l). Still, compare that with (5) without the approximations, D(p̂kp) > τ+ 1 2 log l + c + log∗ l l (16) To the term c + log∗ l corresponds a distribution on the integers, namely Q(l) in [18, (3.6)]. Except for the term 1 2 log l, the equations (15) and (16) are identical if we use the prior distribution PL (l) = Q(l). Rissanen [18] argues that the distribution Q(l) is the most reasonable distribution on the integers when we have really no prior knowledge, mainly from a coding point of view. This therefore seems a reasonable distribution for P (l). What about the term 1 2 log l? The model for the non-null hypothesis has one unknown parameter, p, so that it is more complex than the null hypothesis. We have to account for this additional complexity. Our goal is to find an explanation for atypical sequences among a large class of explanations, not just the distribution of zeros and ones. If there is no “penalty” for finding a complex explanation, any data can be explained, and all data will by atypical. This is Occam’s razor [16]. The “penalty” for one unknown parameter as argued by Rissanen is exactly 1 2 log l. We therefore have the following explanation for (5), September 12, 2017 DRAFT 13 Fact 4. The criterion (5) can be understood as a hypothesis test with prior distribution Q(l) [18] and penalty 1 2 log l for the unknown parameter. Seen in this light, Theorem 2 is not surprising. In (5) we have replaced implicitly corresponds to the prior distribution PL (l) ∼ l −3/2 1 2 log l + log∗ l with 3 2 log l, which , which is exactly the distribution seen in (9). B. Atypical subsequences One problem where we believe our approach excels is in finding atypical subsequences of long sequences. The difficulty in find atypical subsequences is that we may have short subsequences that deviate much from the typical model, and long subsequences that deviate little. How do we choose among these? Definition 1 gives a precise answer. For the formal problem statement, consider a sequence {xn , n = −∞, . . . , ∞} from a finite alphabet A (where in this section A = {0, 1}). The sequence is generated according to a probability law P, which is known. In this sequence is embedded (infrequent) finite subsequences Xi = {xn , n = ni , . . . , ni + li − 1} from the finite alphabet A, which are generated by an alternative probability law P̃θ . The probability law P̃θ is unknown, but it might be known to be from a certain class of probability distributions, for example parametrized by the parameter θ. Each subsequence Xi may be drawn from a different probability law. The problem we consider is to isolate these subsequences, which we call atypical subsequences. In this section, as above, we will assume both P and P̃θ are binary iid. The solution is very similar to the one for variable length sequences above. The atypical subsequences are encoded with the universal source coder from [16] with a code length La = lH(p̂) + 1 2 log l. The start of the sequence is encoded with an extra symbol ’.’ which has a code length − log P ( . ) and the length is encoded in log∗ l bits. In 0 0 conclusion we end up with exactly the same criterion as (5), repeated here D(p̂kp) > τ+ 3 2 log l (17) l The only difference is that τ has a slight different meaning. For the subsequence problem, a central question is what the probability is that a given sample xn is part of an (intrinsically) atypical subsequence. Notice that there are infinitely many subsequences that can contain xn , and each of these have a probability of being atypical given by Theorem 2. We can obtain an upper bound as follows. Let us say that Xn has been determined to be part of an atypical sequence Xi . It is clear that the sequence Xi must also be atypical according to (17). Therefore, we can upper bound the probability PA (Xn ) that Xn is part of an atypical sequence with the probability of the event (17), using the approximate criterion (6), Pn1 +l−1 ∃n1 ≤ n < n1 + l : September 12, 2017 i=n1 √ Xi − p pql > √ 2τ ln 2 + 3 ln l DRAFT 14 We can rewrite this as Pn1 +l−1 i=n1 √ ∃n1 ≤ n < n1 + l : pql n1X +l−1 ∃n1 ≤ n < n1 + l : Xi − p > Xi − p > √ 2τ ln 2 + 3 ln l p lpq ln 2(2τ + 3 log l) i=n1 We could upper bound this with a union bound using Theorem 2. However, it is quickly seen that this does not converge. The problem is that the events in the union bound are highly dependent, so we need a slightly more refined approach; this results in the following Theorem Theorem 5. Consider the case p = 1 2. The probability PA (Xn ) that a given sample Xn is part of an atypical subsequence is upper bounded by √ PA (Xn ) ≤ (K1 τ + K2 )2−τ (18) for some constants K1 , K2 . Proof: Without loss of generality we can assume n = 0. For some l0 > 0 let Il0 be the set of subsequences containing X0 of length l ≤ l0 . For i ∈ Il0 let l(i) be the length of the subinterval. From Theorem 2 we know that 1 PA (i) ≤ 2−τ +1 l3/2 K(l, τ ) and therefore X PA (i) ≤ K2−τ i∈Il0 for some constant K. This argument does not work if we allow arbitrarily long subsequences, because the sum is divergent. However, we can write PA (X0 ) ≤ X PA (i) ≤ K2−τ + PA,l0 (X0 ) i∈Il0 where PA,l0 (X0 ) is the probability that X0 is in an atypical subsequence of at least length l0 . The proof will be to bound PA,l0 (X0 ). Define the following events (n ) 1 +l−1 X A(n1 , l) = Xi − p > p lpq ln 2(2τ + 3 log l) i=n1 (n ) 1 +l−1 X A(n1 , l) = Xi − p < − p lpq ln 2(2τ + 3 log l) i=n1 For p = 1 2 we can rewrite n1X +l−1 Xi − p > p lpq ln 2(2τ + 3 log l) i=n1 = n1X +l−1 (2Xi − 1) > p l ln 2(2τ + 3 log l) (19) i=n1 For ease of notation define υ(l) = September 12, 2017 lp m l ln 2(2τ + 3 log l) DRAFT 15 Then using the union bound we can write −1 X PA (X0 ) ≤ ∞ [ P n1 =−∞ ∞ [ P n1 =−∞ −1 X ≤2 =2 A(n1 , l) ∞ [ P ! A(n1 , l) l=−n1 +1 ∞ \ 1−P n1 =−∞ c ! A (n1 , l) l=−n1 +1 −1 X =2 ! l=−n1 +1 n1 =−∞ −1 X A(n1 , l) l=−n1 +1 −1 X + ! 1− n1 =−∞ ∞ Y P c A (n1 , l) l=−n1 +1 l−1 \ c !! A (n1 , `) `=n−n1 +1   c Tl−1 c where we have excluded the length one sequence consisting of X0 itself. Now consider P A (n1 , l) `=−n1 +1 A (n1 , `) =   Tl−1 c 1 − P A(n1 , l) `=−n1 +1 A (n1 , `) . Pn1 +l−1 We can think of Sl = (2Xi − 1) as a simple random [41] , and we will use this to upper bound i=n1   Tl−1 c the probability P A(n1 , l) `=−n1 +1 A (n1 , `) . This probability can be interpreted as the probability that the random walk passes υ(l) given that it was below υ(`) at times −n1 < ` < l. But since the random walk can increase by at most one, and since the threshold is increasing with l, that means that at time l we must have Sl = υ(l). Furthermore, it is easy to see that the probability is upper bounded by the probability that Sl = υ(l) given that the random walk is below υ(l) at times −n1 < ` < l. Thus ! l−1 \ c P A(n1 , l) A (n1 , `) `=−n1 +1 ≤ P (Sl = υ(l) |S` < υ(l), −n1 < ` < l ) P (Sl = υ(l), S` < υ(l), −n1 < ` < l) P (S` < υ(l), −n1 < ` < l) P (Sl = υ(l), S` < υ(l), −n1 < ` < l) ≤ P (S` < υ(l), 0 ≤ ` < l) = (20) The denominator can be interpreted as the probability that the maximum of the random walk stays below υ(l), which by Theorem 2 can be expressed by PD (l) = P (S` < υ(l), 0 ≤ ` < l) = 1 − 2P (Sl−1 ≥ υ(l + 1) − 1) − P (Sl−1 = υ(l) − 1) ≥ 1 − 2−τ +c l−3/2 ≥ September 12, 2017 1 2 DRAFT 16 for τ and l sufficiently large, and where c is some constant. Since, as discussed at the start of the proof, we can assume that l ≥ l0 , we can choose l0 large enough that this is satisfied; furthermore, since PN (l) is increasing in τ , we can choose l0 independent of τ as long as τ is sufficiently large. We will next upper bound the numerator in (20). This is the probability that we have a path that has stayed below υ(l) at steps −n1 < ` < l, but then at step l hits υ(l). We will count such paths. We divide them into two groups that we count separately. The first group are all paths that start at zero and hit υ(l) first time after l steps. The second group is more easily described in reverse time. Those are paths that start at υ(l) at step l, then stay below υ(l) until time ñ < 0, when they hit υ(l) again, and finally hit 0 at time n1 . According to [41, Section 3.10] we can count all these paths by N= −n 1 +1 X υ(l) 1 Nl (0, υ(l)) + Nl−t−1 (1, 0)Nt (0, υ(l)) l l−t−1 (21) t=υ(l) Where Nn (a, b) are the number of length n paths between a and b. We need to upper bound the probability P (Sn = k) that a path starting a 0 hits k after n steps. We use [41, Section 3.10] and [16, 13.2] to get P (Sn = k) =Nn (0, k)2−n   n  2−n = 1 2 (n + k) ≤ r s = nH n 2 1 π 4 (n + k)(n − k) nH 4n 2 2 2 π(n − k )   1 (n+k) 2 n 1 (n+k) 2 n  2−n  2−n We can bound the power of the exponent to 2 as follows  1 2 (n + k) −n nH n     1 1k =n H + −1 2 2n  2 2 1k ≤− n ln 2 2n =− 1 k2 2 ln 2 n (22) Thus,   2 1 k2 P (Sn = k) ≤ √ e2 − 2 ln 2 n πn where e2 (x) = 2x . We will use this to bound the probability of set of paths in the second term in (21). We can bound September 12, 2017 DRAFT 17 P2 (n1 , l) = −n 1 +1 X t=υ(l) ≤ ≤ Here the sum P−n1 +1 t=υ(l) 1 Nl−t−1 (1, 0)Nt (0, υ(l))2−(l−1) l−t−1 −n 1 +1 X 2 1 p l − t − 1 π(l − t − 1) t=υ(l)   1 1 × e2 − Nt (0, υ(l))2−t 2 ln 2 l − t − 1 −n 1 +1 X 4 π(l + n1 − 2)3/2 P (St = υ(l)) t=υ(l) P (St = υ(l)) when looked at in reverse time can be interpreted as the probability of a path starting at υ(l) hits zero before time −n1 + 1. We can the write this as (See [41, Section 3.10]) −n 1 +1 X P (St = υ(l)) = P (M−n1 +1 ≥ υ(l)) t=υ(l) ≤ 2P (S−n1 +1 ≥ υ(l)) We can use the proof of Theorem 2, specifically (13) to bound this by   2υ(l)2 P (M−n1 +1 ≥ υ(l)) ≤ exp − −n1 + 1 Then P2 (n1 , l) ≤   √ K υ(l)2 exp − −n1 + 1 3/2 2(−n1 + 1) (l + n1 − 2) We will next bound the probability of the paths in the first term in (21). We have s   4l 1 υ(l)2 P (Sl = υ(l)) ≤ e2 − π(l2 − υ(l)2 ) 2 ln 2 l v   u 1 υ(l)2 u  4  e − t 2 2 2 ln 2 l πl 1 − υ(l) 2 l 2 =r  π 1− −τ −2 υ(l)2 2 l l2 and P1 (l) = r ≤ υ(l) P (Sl = υ(l)) l ln 2(2τ + 3 log l) 2 r  l π 1− υ(l)2 l2 2 −τ −2 l v u 8τ ln 2 u  2−τ l−5/2 ≤t  υ(l)2 π 1 − l2 v r u u  12 ln l  4 −τ −5/2 +t 2 l 2 π π 1 − υ(l) 2 l September 12, 2017 DRAFT 18 Thus ∞ Y ln l−1 \ c A (n1 , l) P ≥ l=−n1 +1 ≥K !! A (n1 , `) `=−n1 +1 l=−n1 +1 ∞ X c   P1 (l) − P2 (n1 , l) ln 1 − PD (l) ∞ X −P1 (l) − P2 (n1 , l) l=−n1 +1 . =S(−n1 , τ ) and −1 X PA (X0 ) ≤2 1 − eS(−n1 ,τ ) n1 =−∞ −1 X ≤2K ∞ X P1 (l) n1 =−∞ l=−n1 +1 −1 X + 2K ∞ X P2 (n1 , l) (23) n1 =−∞ l=−n1 +1 where K > 0 is some constant. First we evaluate the sum of P1 (l). The term υ(l)2 l2 is decreasing in l, so for sufficiently large l1 , υ(l)2 l2 ≤ 21 . We can evaluate the sum separately for l0 ≤ l ≤ l1 and for l > l1 . Convergence depends only on the latter tail. The threshold l1 is increasing with τ . If for example we put l1 = 8τ ln 2 , i.e., proportional to τ , we have for τ > 10. Therefore l1 X υ(l)2 l2 ≤ 1 2 P1 (l) ≤ Kτ 2−τ l=l0 For l > l1 we can write r P1 (l) = 16τ ln 2 −τ −5/2 2 l + π r 24 ln l π r 4 −τ −5/2 2 l π Then (for −n1 + 1 > l1 ) ∞ X K P1 (l) l=−n1 +1 s ln(n − n1 ) (−n1 )3 ! r 3 −τ + k2 2 erfc ln(−n1 ) 2 r τ + k3 2−τ (−n1 )3 −τ ≤k1 2 September 12, 2017 (24) DRAFT 19 where ki > 0 are some constants and where we have used Z ∞ ∞ X −5/2 l ≤ x−5/2 dx = k−1 l=k ∞ √ X ln ll−5/2 ≤ ∞ Z √ 2 3(k − 1)3/2 ln xx−5/2 dx k−1 l=k √ 1 = 9 "r 6πerfc # ! √ 3 6 ln k − 1 ln k − 1 + 2 (k − 1)3/2 as it can be verified that all three sums, when (24) is inserted in (23), are convergent, using R∞ f (x)dx. 1 P∞ k=1 f (k) ≤ f (1) + We bound the second sum in (23), −1 X ∞ X P2 (n1 , l) n1 =−∞ l=−n1 +1 −1 X = √   8 −n1 + 1 υ(l)2 exp − 2(−n1 + 1) π(l + n1 − 2)3/2 +1 ∞ X n1 =−∞ l=−n1 We can ignore the small constants and write P = −1 X ∞ X n1 =−∞ l=−n1   √ 8 υ(l)2 exp − −n1 3/2 2(−n ) π(l + n1 ) 1 +1 √ lτ 3l 8 −n1 = 2− −n1 l− −n1 3/2 π(l + n1 ) n1 =−∞ l=−n1 +1 √ Z ∞Z ∞ lτ 3l 8 t ≤ 2− t l− t dldt 3/2 π(l − t) 1 t √ Z ∞Z ∞ 8 t 2−l̃τ ˜l−3l̃ t−3l̃ td˜ldt = πt3/2 (˜l − 1)3/2 1 1 Z ∞Z ∞ 8 2−l̃τ ˜l−3l̃ t−3l̃ d˜ldt = π(˜l − 1)3/2 1 1  Z ∞ Z ∞ 8 −3l̃ = 2−l̃τ ˜l−3l̃ d˜l t dt 3/2 ˜ π(l − 1) 1 1 Z ∞ 8 1 2−l̃τ ˜l−3l̃ d˜l = 3˜l − 1 π(˜l − 1)3/2 1 Z ∞ 1 8 = 2−τ 2−(l̃−1)τ ˜l−3l̃ d˜l 3˜l − 1 π(˜l − 1)3/2 1 −1 X ∞ X The remaining integral is clearly convergent, and decreasing in τ . Therefore P ≤ K2−τ There are two important implications of Theorem 5. First is that for τ sufficiently large, PA (Xn ) < 1, and in fact PA (Xn ) can be made arbitrarily small for large enough τ . This is an important theoretical validation of Definition 1 and the resulting criterion (5) and (6). If the theory had resulted in PA (Xn ) = 1 then everything would be atypical, and atypicality would be meaningless. That this is not trivially satisfied is shown by Proposition 6 just below. What that Proposition says is that if in the above equation instead of have been atypical. Now, 1 2 3 2 log l we had had 1 2 log l, then everything would log l corresponds to “forgetting” that the length of an atypical sequence also needs to be encoded for the resulting sequence to be decodable. Thus, it is the strict adherence to decodability that has September 12, 2017 DRAFT 20 lead to a meaningful criterion. So, although decodability at first seems unrelated to detection, it turns out to be of crucial importance. Similarly, at first the term 3 2 log l may have seen arbitrary. However, this is just (within a margin) sufficient to ensure that not everything becomes atypical. The second important implication of Theorem 5 is that it validates the meaning of τ . The way we introduced τ was as the number of bits needed to encode the fact that an atypical sequence starts, and therefore we should put τ = − log P (atypical sequence starts). Theorem 5 confirms that τ has the desired meaning for purely random sequences. And the reasons is this is not trivial is that τ was chosen from the probability of an atypical sequence, while Theorem 5 gives the probability of a sample being atypical. Proposition 6. Consider the case p = 12 . Suppose instead of (7) we use the criterion Pl √ Xi − p q > 2τ ln 2 + α ln l 1 4l i=1 (25) (with α = 3 giving (7)). Then if α ≤ 1, the probability that a given sample Xn is part of an atypical subsequence is PA (Xn ) = 1. Proof: We can assume that n = 0. We will continue with the random walk framework from the proof of Theorem 5. Define the event ( Āl = 0 X ) p (2Xi − 1) > l ln 2(2τ + α log l) i=−l+1 ( Al = 0 X ) p (2Xi − 1) < l ln 2(2τ + α log l) i=−l+1 and υ(l) = lp l ln 2(2τ + α log l) Then PA (X0 ) ≥ P ∞ [ ∞ [ Āl ∪ l=0 m ! Al l=0 Namely, we declare that X0 is atypical if it is the endpoint of an atypical sequence {x[−l], x[−l + 1], . . . , x[0]} for some l. Clearly, X0 could be the start or midpoint of an atypical sequence, so this a rather loose lower bound. Now we can write P ∞ [ Āl ∪ l=0 ∞ [ ! Al l=0 =1−P ∞ \ Ācl ∩ l=0 =1− ∞ Y P =1− l=0 September 12, 2017 ! Acl l=0 Ācl l=0 ∞ Y ∞ \ ∩ Acl l−1 \ Āck ∩ k=0 " 1−P Āl ∪ Al l−1 \ ! Ack k=0 l−1 \ k=0 Āck ∩ l−1 \ !# Ack k=0 DRAFT 21   Tl−1 Tl−1 Consider the probability P Āl ∪ Al k=0 Āck ∩ k=0 Ack . The only way the conditional event can happen is if Sl−1 = υ(l) − 1 and Xl = 1 or Sl−1 = −υ(l) + 1 and Xl = −1. Here we have P (Sl−1 = υ(l) − 1) = Nl−1 (0, υ(l) − 1)2−l+1   l−1  2−l+1 = 1 2 (l + υ(l) − 2) s  1 (l+υ(l)−2) (l−1)H 2 l−1 l−1 2−l+1 ≥ 2 2(l + υ(l) − 2)(l − υ(l)) s 1  (l+υ(l)−2) (l−1)H 2 l−1 l−1 2 = 2−l+1 2((l − 1)2 − (υ(l) − 1)2 )  1 r (l+υ(l)−2) 1 (l−1)H 2 l−1 2−l+1 ≥ 2 2l Here 1  (l + υ(l) − 2) (l − 1)H 2 −l+1 l−1     1 1 υ(l) − 1 =(l − 1) H + −1 2 2 l−1  2  3 ! 1 υ(l) − 1 υ(l) − 1 2 (l − 1) + (l − 1)o ≥− ln 2 2 l−1 l−1   2 1 1 (υ(l) − 1) (υ(l) − 1)3 =− +  2 ln 2 l−1 (l − 1)2 l     2 2 1 υ(l) υ(l) 1 υ(l)3 1 ≥− + + + 2  2 ln 2 l (l − 1)2 l−1 l l   2 3 1 υ(l) υ(l) 1 =− + 2  2 ln 2 l l l ≥− 1 υ(l)2 υ(l)3 − 2 2 ln 2 l l Where the last inequality is only true for l sufficiently large, as for some l0 we have ∀l > l0 : |(l−1 )| < 1. Then r 1 −τ − α − υ(l)2 3 2 l 22 l P (Sl−1 = υ(l) − 1) ≥ 2l r 1 −τ − α+1 − υ(l)2 3 = 2 l 2 2 l 2 And ln 1 − P ∞ [ l=0 ≤ ≤ ∞ X l=1 ∞ X l=0 September 12, 2017 r ln 1 − r − Āl ∪ ∞ [ !! Al l=0 1 −τ − α+1 − υ(l)2 3 2 l 2 2 l 2 ! 1 −τ − α+1 − υ(l)2 3 2 l 2 2 l 2 DRAFT 22 Here liml→∞ υ(l)3 l2 υ(l)3 l2 ≤ 1. Then !! ∞ ∞ [ [ Āl ∪ Al = 0. So, for example, for l sufficiently large, ln 1 − P l=0 ∞ X l=0 r 1 −τ − α+1 2 l 2 2 l=l0  S∞ S∞ This is divergent for α ≤ 1 proving that P l=0 Āl ∪ l=0 Al = 1. ≤ Theorem 5 states that for α = 3 2 − 1 2 PA (Xn ) < 1 (convergence), while Proposition 6 shows that for α = 1 2 PA (Xn ) = 1 (divergence). There is a gap between those values of α that is hard to fill in theoretically. We have therefore tested it out numerically, see Fig. 2. Of course, testing convergence numerically is not quite well-posed. Still the figure indicates that the phase transitions between divergence and convergence happens right around α = 1. Probability of atypicality of samle Xn for different values of τ when length=105+1 and n = length/2 (at the middle) 1 τ = 0.5 τ=1 τ=2 0.9 0.8 Probability 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 0.5 1 1.5 2 α 2.5 3 3.5 4 Fig. 2. Transition between divergence and convergence as a function of α C. Recursive coding Instead of using Definition 1 directly, we could approach the problem as follows. First the sequence is encoded with the typical code. Now, if the distribution of the sequence is in agreement with the typical code, the results should be a sequence of iid binary bits with P (Xi = 1) = 1 2 [16], i.e., a purely random sequence; and this sequence cannot be further encoded. We can now try if we can further encode the sequence with a (universal) code. If so, we categorize the sequence as atypical. Let l∗ be the length of the sequence after typical coding. In (4) the typical and atypical codelengths are therefore Lt = l∗ − log  La = l∗ H(p̂∗ ) + September 12, 2017 3 log l∗ − log  + τ ∗ 2 (26) DRAFT 23 Here p̂∗ is the estimated p for the encoded sequence. Now   1 1 ∗ l = l p̂ log + (1 − p̂) log p 1−p (27) l∗ H(p̂∗ ) ∼ lH(p̂) (28)  log l∗ = log l + log p̂ log 1 1 + (1 − p̂) log p 1−p  ∼ log l (29) (30) The argument for (28) is as follows (without doing detailed calculations): if we encode a sequence with a “wrong” code and then later re-encode with the “correct” code (for the induced statistic), the result is the same as originally encoding with the correct code. Thus the criterion (4) and (26) are approximately equivalent. We can state this as follows Proposition 7. Definition 1 can be applied to encoded sequences instead of the original data. This of course ignores all integer constraints, block boundaries etc. But the importance of this statement is that it is sometimes easier to operate on (partially) encoded sequences simply because the amount of data has already been reduced, and the problem has been standardized: as such, we do not need to know the typical codebook or even the model of typical data since everything under the typical model has been reduced to a stream of iid binary digits, and atypicality algorithms can therefore be applied to data streams without knowledge of what is the original data. It also means that theoretical results such as Theorem 5 where we assume typical data is iid uniform has general applicability. However, first encoding the sequence and then doing atypicality detection also has disadvantages in a practical, finite length setting. Atypical subsequences become embedded in typical sequences in unpredictable ways. For example, it could be difficult to determine where exactly an atypical sequence starts and ends. Our practical implementation therefore uses Definition 1 directly. IV. G ENERAL C ASE Return to the problem considered at the start of Section III where we are given a sequence x of fixed length l and we need to determine if it is atypical. In the iid case this is a simple hypothesis test problem and the solution is given by (1). In the general case we would like find to alternative explanations from a large abstract class of models. The issue is that it is often possible to fit an alternative model very well to the data if we just allow complex enough models – the well known Occam’s razor problem [16]. Rissanen’s MDL [42], [18], [19] is a solution to this problem. Therefore, in the general case, even for fixed length sequences, the problem is not a straightforward hypothesis test problem, and we have to resort to information theory. September 12, 2017 DRAFT 24 A. Finite State Machines On possible class of models in the general case is the class of finite state machines (FSM). Rissanen [17] defines the complexity of a sequence xl in the class of FSM sources by I(xl ) = min{− log P̂ (xl |fj ) + log∗ j + c} (31) where f1 , f2 , . . . is a sequence of state machines, and where we have used P̂ (xl |fj ) to emphasize that the probability is estimated. Rissanen uses Laplace’s estimator, but the KT-estimator [43], [16] could also be used. Except for integer constraints, this is a valid descriptive length, and can therefore be used in Definition 1. This is a natural extension of the iid case considered in Section III. As opposed to Kolmogorov complexity, this complexity could actually be calculated, although with high complexity. Because of the complexity, it is mostly useful for theoretical considerations, and one result is the following generalization of Theorem 2 Theorem 8. Assume that the typical distribution is iid uniform. If the atypical descriptive length is given by (31) with a maximum number of states independent of l, the probability of an intrinsically atypical sequence PA (l) satisfies ln PA (l) =1 l→∞ − 3 ln l 2 lim (32) Proof: Since we consider all state machines with the number of states up to a certain maximum, this must also include the state machine with a single state. This is equivalent to the iid model in Section III, and we therefore get the lower bound in (32). The proof will be to upper bound the probability. As in Section III we use log l + τ bits to indicate beginning and end of atypical sequences. The probability that a sequence xl is atypical therefore is PA (l) = P (I(xl ) + log l + τ > l) [ = P ( − log P̂ (xl |fj ) + log∗ j + c + log l + τ > l) fj ≤ [ P (− log P̂ (xl |fj ) + log l + τ > l) fj We will prove that P (− log P̂ (xl |fj ) + log l + τ > l) ≤ Kj l−(k+2)/2 for constants Kj and k the number of states in the state machine, and since the slowest decay dominates, we get the upper bound for (32). For a fixed state machine f the code length according to [17, (3.6)] is   l X X n (x ) s + L(xl |f ) = log  log(ns (xl ) + 1) l n (x ) s s 0|s where ns (xl ) denotes the number of occurrences of state s in xl and n0|s (xl ) the number of times the next symbols is 0 at this state. Further, from [16, 13.2] l L(x |f ) ≥ X s l ns (x )H n0|s (xl ) ns (xl ) ! n0|s (xl ) n1|s (xl ) 1 − log 8 2 ns (xl ) ns (xl ) + log(ns (xl ) + 1) September 12, 2017 − 1 log ns (xl ) 2 ! (33) DRAFT 25 We want to upper bound the probability of the event L(xl |f ) + log l + τ < l. We can write 2 ! 1 1 1 ns (xl ) + 1 l l log(ns (x ) + 1) − log(ns (x )) = log l + log . 2 2 l ns (xl ) Let l r(x ) = X l ns (x ) H s n0|s (xl ) ns (xl ) ! ! −1 and let R(xl ) be the remaining small terms in (33) dependent on xl , ! n0|s (xl ) n1|s (xl ) 1 R(x ) = − log 8 2 ns (xl ) ns (xl ) s 2 ! 1 ns (xl ) + 1 + log . l ns (xl ) P Then we have to upper bound (notice that s ns (xl ) = l),   k+2 l l log l P −r(x ) − R(x ) ≥ τ + 2 X l The Chernoff bound is  P −r(xl ) − R(xl ) ≥ τ + ≤ exp(−t(τ + k+2 log l 2  k+2 log l))M (t) 2 or  ln P −r(xl ) − R(xl ) ≥ τ + ≤ −t(τ + k+2 log l 2  k+2 log l) + ln M (t) 2 where   M (t) = E exp(−t(r(xl ) + R(xl )) In order to get a valid bound, we need to show that M (t) < K < ∞ independent of l for t < ln 2. Now it’s easy to see that exp(−tR(xl )) ≤ K < ∞ for all t and l. So, we have to show   E exp(−t(r(xl )) ≤ K < ∞ We have to show that this is true for all state machines in the class of finite state machines with k states, which can be done by showing   max E exp(−t(r(xl )) ≤ K FSM with k states It turns out it easier to prove this if we expand the class over which we take the maximum, and clearly expanding the class does not decrease the maximum. A FSM with k states is a function f (xl ) ∈ {1, . . . , k} that satisfies that if f (xm ) = f (x̃m ) = s then f (xm b) = f (x̃m b) for any bit b [17], i.e., if the FSM is in state s after m steps, the next state transition is only dependent on the next bit, not how it got to state s. We extend the class by dispensing with this requirement. We can then describe the ’program’ we run as follows. Based on xm we choose a state sm ∈ {1, . . . , k} without having any knowledge about xm+1 , except that it is independent and uniformly September 12, 2017 DRAFT 26 distributed (by the assumption on the typical distribution). We can think of this slightly differently. The program   puts xm+1 into bucket s ∈ {1, . . . , k} and updates ns (m) and ni|s (m), in order to maximize E exp(−t(r(xl )) . It does so based on past data xm . Now, as opposed to the state machine setup, the choice of sm in no way restricts the choices of states (or buckets) sn , n > m. Since the program has no knowledge of xm+1 the program cannot optimize sm based on the values of xm . Rather, it is sufficient to look at ns (m). It is now easy to see that the worst case is obtained if the bits are distributed evenly in the states. Thus, the worst case of r(xl ) is ! ! X l n0|s (xl ) l H −1 r(x ) = k l/k s where the n0|s (xl ) are independent of s. Thus, the problem is reduced to the case of a single state, which is showing that      k ≤K<∞ E exp tl 1 − H l (34) Here we have      k E exp tl 1 − H l   l X k t k  2−l = 2 ln 2 l(1−H( l ))  l k=0   l/2 X k k t  2−l =1+2 2 ln 2 l(1−H( l ))  l k=1 s l/2 X t k k l(1−H( )) −l lH( ) l ≤1+2 2 ln 2 2 2 l k=1 l/2 X l πk(l − k) s l πk(l − k) k=1 s l/2 X t 2 k 1 2 l ≤1+2 2−(1− ln 2 ) ln 2 l( l − 2 ) πk(l − k) =1+2 2 (1− lnt 2 )l(1−H( kl )) k=1 where we have used [16, 13.2] and (22). The sum is actually decreasing as a function of l, but this seems hard to prove. Instead we upper bound the sum by l/2 X s l πk(l − k) k=1 s Z l/2 t 2 k 1 2 l ≤ 2−(1− ln 2 ) ln 2 l( l − 2 ) dk πk(l − k) 1 September 12, 2017 2−( 1− lnt 2 ) 2 ln 2 l ( k 1 l −2 ) 2 DRAFT 27  4k Here we can upper bound q √1 l  −1 +2 for 1 ≤ k ≤ 2l . Then s Z l/2 2 l −(1− lnt 2 ) ln22 l( kl − 12 ) 2 dk πk(l − k) 1 q  1 Z 1/2 4x −1 +2 t 2 1 2 l √ 2−(1− ln 2 ) ln 2 l(x− 2 ) ≤ ldx π 1/l  q 1 Z 1/2 − 1 +2 4x 2 t 2 1 l √ 2−(1− ln 2 ) ln 2 l(x− 2 ) ldx ≤ π −∞ K1 = √ + K2 l l πk(l−k) ≤ k √ π for some constants K1 , K2 , using Gaussian moments. This proves (34). 10 -1 The probability of intrinsically atypical sequence Probability Upper Bound 10 -2 PA (l) 10 -3 10 -4 10 -5 10 -6 10 1 10 2 10 3 Length Fig. 3. Probability of an intrinsically atypical sequence. The typical distribution is iid uniform, and for detection of atypical sequences the CTW algorithm has been used (Section IV-B). While the Theorem is for the typical model iid uniform, as outlined in Section III-C in principle it also applies to general sources, since we can first encode and then look for atypical sequences. The theorem shows that looking for more complex explanations for data does not essentially increase the probability of intrinsically atypical sequences. Fig. 3 (compare with Fig. 1) confirms this experimentally. The atypical detection is based on CTW, which as explained in Section IV-B below, is a good approximation of FSM modeling. On the other hand, if one of the FSM models do in fact fit the data, the chance of detecting the sequence is greatly increased, although hard to quantify. If we think of intrinsically atypical sequences as false alarms, this shows the power of the methodology. Since FSM sources has the same PA (l) as in the iid case, it seems reasonable to conjecture that Theorem 5 is still valid, that is PA (Xn ) < 1 for sufficiently large τ , which is clearly an essential theoretical property of atypicality. September 12, 2017 DRAFT 28 However, as Theorem 5 does not follow directly from Theorem 2, to verify the conjecture requires a formal proof which we do not have at present. B. Atypical Encoding In terms of coding, Definition 1 can be stated in the following form C(x|P) − C(x) > 0 Here C(x|P) is the code length of x encoded with the optimum coder according to the typical law, and C(x) is x encoded ’in itself.’ As argued in Section III, we need to put a ’header’ in atypical sequences to inform the encoder that an atypical encoder is used. We can therefore write C(x) = τ + C̃(x), where τ is the number of bits for the ’header,’ and C̃(x) is the number of bits used for encoding the data itself. For encoding the data itself an obvious solution is to use a universal source coder. There are many approaches to universal source coding: Lempel-Ziv [16], [44], [45], Burrows-Wheeler transform [46], partial predictive mapping (PPM) [47], [48], or T-complexity [49], [6], [50], [51], [52], [53], [54], and anyone of them could be applied to the problem considered in this paper. The idea of atypicality is not linked to any particular coding strategy. In fact a coding strategy does not need to be decided. We could try several source coders and choose the the one giving the shortest code length; or they could even be combined as in [55]. However, to control complexity, we choose a single source coder. The most popular and simplest approach to source coding is perhaps Lempel-Ziv [16], [44], [45]. The issue with this is that while l ) = H(X) wp 1, the convergence is very slow. According to [56] it is optimum in the sense that lim supl→∞ C(x l h i h i l C(xl ) C(x ) 1 E − H(X) ∼ log ∼ 1l . Thus, Lempel-Ziv is poor for short sequences, which is exactly l l while var l what we are interested in for atypicality. We have therefore chosen to use the Context Tree Weighing (CTW) algorithm [43]. The CTW approach has some advantages in our setup: it is a natural extension of the simple example considered in Section III, it allows estimation of code length without actually encoding, there is flexibility in how to estimate probabilities. Importantly, it can be seen as a practical implementation of the FSM based descriptive length used in Section IV-A. C. Typical Encoding and Training In Definition 1 and the example in Section III we have assumed that the typical model of data is exactly known. If that is the case, typical encoding is straightforward, using for example arithmetic coding – notice that we just need codelength, which can be calculated for arithmetic coding without actually encoding. However, in many cases the typical model is not known exactly. In the simplest case, the typical model is from a small class parametrized with a few parameters (e.g., binary iid with P (X = 1) unknown). In that case, finding the typical model is a simple parameter estimation problem, and we will not discuss this further. We will focus on the case where the typical model is not given by a specific model. In that case, it seems obvious to also use universal source coding for typical data. However, this is not straightforward if we want to stay faithful to the idea of Definition 1 as we will argue below. September 12, 2017 DRAFT 29 Let P be the typical model and P̂ be the estimated typical model. When no specific model is given, in principle P̂ could be given by an estimate of the various joint probability mass functions. However, a more useful approach is to estimate the conditional probabilities p(xn = 1|xn−1 , xn−2 , . . . , xn−N ), where s = xn−1 , xn−2 , . . . , xn−N is called the context. If the source has finite memory these probabilities characterize the source, and otherwise they could give a good approximate model. The issue is that there are 2N possible contexts, so for N even moderately large the amount of training data required to even observe every context is large, and to get good estimates for every context it is even larger. Realistically, therefore not every probability p(xn = 1|s) can be estimated. This is an issue universal source coding is designed to deal with, and we therefore turn to universal source coding. Let us assume we are given a single long sequence t for training – rather than a model P – and based on this we need to encode a sequence x. Let us denote this coder as C(x|t). To understand what this means, we have to realize that when x is encoded according to C(x|P) with a known P, the coding probabilities are fixed; they are not affected by x. As discussed in Section II, this is an important part of Definition 1 that reacts to ’outliers,’ data that does not fit the typical model. If the coding probabilities for C(x|P) were allowed to depend on x, in extreme case we would always have C(x) = C(x|P). The issue with universal source coders is that they often easily adapts to new types of data, a desirable property of a good universal source coder, but problematic in light of the above discussion. We therefore need to ’freeze’ the source coder, for example by not updating the dictionary. However, because the training data is likely incomplete as discussed above, the freezing should not be too hard. The resulting encoder C(x|t) is not a universal source coder, but rather a training based fixed source coder, and the implementation can be quite different from a universal source coder, requiring careful consideration. We will suggest one algorithm based on the principle of the CTW algorithm. This naturally complements using the CTW algorithm for atypical encoding, but could also be used with other atypical encoders. The following discussion requires a good knowledge of the CTW algorithm, which is most easily obtained from [57]. The algorithm is based on estimating P (xn = 1|s) for contexts s. The estimate for a given s is done with the KT-estimator [43], [16] P (xn = 1|s) = bs +1/2 as +bs +1 , where as and bs are the number of 0s and 1s respectively seen with context s in the training data t, but unaffected by the test sequence x. As discussed above, the complication is that not every context s might be seen and that in particular long contexts s are rarely seen so that the estimates P (Xn = 1|s) might be more accurate for shorter contexts. We solve that with the weighting idea of the CTW algorithm; the weights can be thought of as a prior distribution on different models. We can summarize this as follows. For every context s, the subsequence associated with s could either be memoryless or it could have memory [57]. We call the former model M1 and the latter M2 . The CTW algorithm uses a prior distribution, weights, on the models P (M1 ) = P (M2 ) = 21 . Our basic idea is to weigh with P (M1 |t) and P (M2 |t) instead of 12 . The algorithm is best described through an example. We have trained the algorithm with t, resulting in the context tree seen in Fig. 4. Now suppose we want to find a coding distribution P (1|010) for the actual data. We begin at September 12, 2017 DRAFT 30 as, bs s=11 1 as, bs s=1 1 0 as, bs s=λ as, bs s=01 0 as, bs s=0 Fig. 4. Example context tree. the root and calculate P (1|010, t) = P (1|010, M1 )P (M1 |t) + P (1|010, M2 )P (M2 |t) P (Mi |t) = P (t|Mi )P (Mi ) P (t|Mi ) = P (t) P (t|M1 ) + P (t|M2 ) P (t|M1 ) = Pe (as , bs ) P (t|M2 ) = Pw0s (t)Pw1s (t) s=λ (empty context) under model M1 the data is memoryless, so P (1|010, M1 ) = P (1|M1 ) = bs + 1/2 ; as + bs + 1 s=λ To find P (1|010, M2 ) we look in the 0-node of the context tree. Here we calculate similarly P (1|010, t) = P (1|010, M1 )P (M1 |t) + P (1|010, M2 )P (M2 |t) P (Mi |t) = P (t|Mi )P (Mi ) P (t|Mi ) = P (t) P (t|M1 ) + P (t|M2 ) P (t|M1 ) = Pe (as , bs ) P (t|M2 ) = Pw0s (t)Pw1s (t) s=0 and again under model M1 the data is iid, so P (1|10, M1 ) = P (1|0, M1 ) = September 12, 2017 bs + 1/2 ; as + bs + 1 s=0 DRAFT 31 and so on. From the context tree it is seen that the context 10 has not been seen before; then the context 010 has not been seen either. Then we have P (1|010, M2 ) = 1 . 2 No more look-up is needed, and the calculation has completed. The algorithm can be implemented as follows. We run the standard CTW algorithm on the training data. To freeze, in each node corresponding to the context s we can pre-compute P (M1 |t) and P (1|s, M1 ). This is the only data that needs to be stored. While the algorithm is described from the root and up, implementation is simpler (no recursion) from the top and down to the root. Often the source coder might be trained with many separate sequences, rather than one long sequence. This is not an issue, but care has to be taken with the startup for each sequence. The original CTW paper [43] assumes that a context of length at least D is available prior to the start of the sequence, which is not true in practice. The paper [58] solves this by introducing an indeterminate context. A context may start with an indeterminate context, but at most once. With multiple training sequences this could happen more than once. A better approach is therefore to use the start of each training sequence purely as a context (i.e., not code it). This wastes some training bits, but if the sequences are long the loss is minor. A different case would be if we need to find short atypical sequences rather than subsequences. In that case a more careful treatment of start of sequences would be needed. Freezing the encoder is essential in implementing atypicality. A simulation confirming this is shown in Fig. 5. The CTW algorithm is trained with a three-state Markov chain with transition probability [.05 .95 0;0 .05 .95;.95 0 .05] while generating {0,1} according to [0 1 x;x 1 0;1 x 0], so this Markov chain mostly generates the following pattern: [1 0 1]. The test sequence is generated by another three-state Markov chain with the same transition probability but generating {0,1} according to [0 1 x;x 1 0;0 x 1], i.e., generating mostly [1 0 0] as pattern. With the non-frozen algorithm the code length difference between typical and atypical encoding is so small that it can easily be missed, although the difference in the patterns themselves in the raw data is clearly visible to the naked eye. The reason the non-frozen algorithm does not work is that it quickly learns the new [1 0 0] pattern. Any good source coder would do that including LZ. This is advantageous to source coding, but in this case it means missing a very obvious atypical pattern. If a very large amount of data is used for training, the complexity can become very high, mainly in terms of memory. Namely, all contexts might be observed, and the context tree completely filled out. For example, suppose the typical data is actually iid. That means that every string x1 , . . . , xN is seen with equal probability. For the CTW algorithm that means that every node of the context tree will be filled out, and the number of nodes with depth D is 2D+1 . For dictionary based algorithms, it means that the dictionary size becomes huge. What is needed is some algorithm that not only estimates the unknown parameters, but also the model (e.g., iid). One way could be to trim the context tree (or dictionary), but we have not looked into this in detail. D. Atypical subsequences For finding atypical subsequences of a a long sequences, the same basic setup as in the previous sections can be used. Let X (n, l) = (xn , xn+1 , . . . , xn+l−1 ) be a subsequence of {xn , n = 0, . . . , ∞} that we want to test for September 12, 2017 DRAFT 32 The Effect of Freezing: Non-Frozen Typical Coder Will Learn The Atypical Sequences 800 Non-Frozen Typical Code Length Frozen Typical Code Length Atypical Code Length 700 600 500 400 300 200 100 0 0 50 100 150 200 250 300 350 400 450 500 Fig. 5. The importance of freezing source coding when testing for atypicality. atypicality. As in Section III-B the start of a sequence needs to be encoded as well as the length. Additionally the code length is minimized over the maximum depth D of the context tree. The atypical code length is then given by  LA (X (n, l)) = min − log Pwλ (D) + log∗ D + log∗ l D except for the τ . Here Pwλ (D) denotes the probability at the root of the context tree [43] of depth D. Since we are also interested in finding short sequences, how the encoding is initialized is of importance, and for atypical coding we therefore use the algorithm in Section II of [58]. For typical coding we use either a known fixed model and Shannon codes, or the algorithm in Section IV-C when the model is not known; when we encode X (n, l) we use xn−D , . . . xn−1 as context for xn (we can assume n > D). Equivalently, we can encode the total sequence {xn , n = 0, . . . , ∞} (with the algorithm from Section IV-C); let L(n) be the codelength for the sequence x0 , . . . , xn . Then we can put LT (X (n, l)) = L(n+l−1)−L(n). We need to test every subsequence of every length, that is, we need to test subsequences X (n, l) for every value of n and l. For atypical coding this means that a new CTW algorithm needs to be started at every sample time. So, if the maximum sequence length is L, L separate CTW trees need to maintained at any time. These are completely independent, so they can be run on parallel processors. The result is that for every bit of the data we calculate ∆L(n) = LA (X (n, l)) − min LT (X (n, l)) l (35) and we can state the atypicality criterion as ∆L(n) < −τ . The advantage of stating it like this is that we do not need to choose τ prior to running the algorithm. We can sort according to ∆L(n), and first examine the data with smallest ∆L(n), which should be the most atypical parts of data. Thus, the algorithm is really parameter free, September 12, 2017 DRAFT 33 which is one advantage of our approach. In many anomaly detection algorithms, there are multiple parameters that need to be adjusted. This implementation clearly is quite complex, but still feasible to implement for medium sized data sets due to the speed of the source coder. In order to process larger data sets, a faster approximate search algorithm is needed, and we are working on such algorithms, but leave that as a topic of later papers. V. E XPERIMENTAL R ESULTS In order to verify the performance of our algorithm, we used three different experiments. In the first we evaluated randomness of sources, in accordance with our starting point of Kolmogorov-Martin-Löf randomness. In the second, we looked for infection in human DNA, and in the third we looked for arrhythmia in ECG. A word about presentation of the results. For the outcome of our method we plot ∆L(n) given by (35). At the same time, we would like to illustrate the raw data. The source in all cases is a stream of bits x[n] ∈ {0, 1}. We PN convert this to y[n] ∈ {−1, 1} (i.e, y[n] = (−1)x[n]−1 ), and then plot S[N ] = n=1 y[n]; we call this the random walk representation. In our experience, this allows one to quickly assess if there is any obvious pattern in data. If the data is random, the results will look like a typical random walk: both small fluctuations and large fluctuations. All experimental data and software used is available at http://itdata.hostmadsen.com. A. Coin Tosses In this experiment the typical data is iid binary random. As source of typical data we used experimental coin tosses from [59]. This data consists of 40,000 tosses by two Berkeley undergraduates of a fair coin and the result has 20,217 heads (Xi = 1), so Pr{Xi = 1} = 0.505425 ≈ 1 2. Therefore we can consider it as a real binary IID experiment, indeed it is an example of pure random data. In our experiments with this data, we examine the randomness of other types of data. One type of data one might think is purely random are word length changes in a text. In the first experiment, we generate binary data using consecutive word length comparison of part of M. B. Synge’s “On the shores of the great sea” in the following manner: If the next word is longer than the current word, 1 is assigned to the binary data, otherwise 0. In the case of two consecutive words with same length, a random 0 or 1 is generated (with a good random number generator). We then insert this data in the coin toss data. Since we assume coin tosses data is IID, there is no need to train the CTW and the the code length of the IID case (2) can be used for typical coding. Fig. 6 illustrates the result of the algorithm on the mixed data. Thus, word length changes are not iid random. Perhaps this is because word length is bounded from above and below, so that there are limits to how long runs of 0s or 1s are possible. In second experiment, we generated random data with the infamous RANDU random number generator. This was a random number generator that was widely used until it was discovered that it has some clear deviation from randomness. RANDU generates random numbers in the interval [0, 231 − 1], so each number needs 31 bits for binary representation. But instead of using 31 bits for each number, we sum up all the 31 bits and compare it with September 12, 2017 DRAFT 34 Mixture of Coin Tosses and Consecutive Word Length Comparison Data from "On The Shores Of The Great Sea" by M. B. Synge 100 Random Walk of Mixed Data "L(n) (bits) 80 Cummulative Bits 60 40 20 Text Word Length Comparison 0 -20 -40 500 1000 1500 2000 2500 3000 3500 4000 Samples Fig. 6. Random walk of mixed coin tosses and consecutive word comparison. Mixture of Coin Tosses and RANDU Data 300 Random Walk of Mixed Data "L(n) (bits) 250 Cummulative Bits 200 150 100 50 RANDU 0 -50 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Samples Fig. 7. Random walk of mixed coin tosses and RANDU. 15.5 to generate either 0 or 1. Then this data is inserted in the part of coin tosses data. Fig. 7 shows that the most atypical segment is where we have inserted data from RANDU random number generator. In the third experiment, we generate binary data using consecutive heart rate comparison of part of normal sinus rhythm downloaded from MIT- BIH database [60] in the same way as for the text. Fig. 7 represents the result of the algorithm on the mixed data. As can be seen the atypicality measure shows a huge difference between iid randomness and randomness of consecutive heart beats. We don’t know why this is the case. September 12, 2017 DRAFT 35 Mixture of Coin Tosses and Consecutive Normal Heart Rate Comparison 150 Normal Heart Rate Comparison Cummulative Bits 100 50 0 -50 Random Walk of Mixed Data "L(n) (bits) -100 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Samples Fig. 8. Random walk of mixed coin tosses and HRV. B. DNA In this collection of experiments, we detect viral and bacterial insertion into human genomic DNA. DNA from foreign species can be inserted into the human genome either through natural processes [61], typically though viral infections, bacterial infections, or through genetic engineering [62]. The inverse also occurs in genetic engineering experiments during the creation of “transgenic” organisms, with the insertion of human DNA into bacteria, yeast, worms, or mice. In the experiments we show here, we have focused on the former case. We train the CTW algorithm on pure human genomic DNA. The data that we have used was comprised of ~20 kilobases of human genomic DNA (each sequence from a different chromosome) with either bacterial or viral random DNA sequences (~2 kilobases per insertion) inserted. Since our software is too slow to find atypical sequences of length more than a few hundreds, we removed the middle of the insertions. Notice that this actually makes detection harder. We used some of the human DNA for training, but not the same as the test sequences. In the first experiment we tried to detect short sequences from Streptococcus Pneumoniae (a bacterial infection with a high fatality rate, and a frequent cause of death in the elderly) randomly inserted into larger segments of human genomic DNA. Fig. 9 illustrates the result of the experiment. Based on the figure, the inserted Streptococcus Pneumoniae DNA fragment was detected by our algorithms. In the second experiment we tried to detect HIV inserted into human genomic DNA to mimic viral infection, which is a more realistic experiment since viruses typically insert their DNA into the host genome every time a human obtains a viral infection. Fig. 10 illustrates the result of the experiment. As can be seen, the infected viral fragment was detected by our algorithms. September 12, 2017 DRAFT 36 Primarily Human Genomic DNA Infected with Streptococcus Pneumoniae (Fatal Bacterial Infection In the Elderly) 80 60 Cummulative Bits 40 20 0 -20 -40 -60 Streptococcus Pneumoniae Infection -80 -100 Random Walk of the Infected Human DNA "L(n) (bits) -120 1000 2000 3000 4000 5000 6000 7000 DNA samples Fig. 9. Random walk of human DNA with bactrial infection. 50 Primarily Human Genomic DNA Infected with HIV (Viral Infection) Random Walk of the Infected Human DNA "L(n) (bits) 0 Cummulative Bits -50 -100 -150 -200 -250 HIV Infection -300 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 DNA samples Fig. 10. Random walk of human DNA with viral infection. C. HRV While HRV (Heart Rate Variability) can be a powerful indicator for arrhythmia [8], the common issue is that it is not known exactly what to look for in the data. Our aim for this application is to use atypicality to localize signs of subtle and complex arrhythmia. In [63] based on our modest goal of localizing a simple type of known arrhythmia, we managed to find premature beats using HRV signal, but here we attempted to detect more subtle arrhythmia. The HRV signals that we used were downloaded from MIT- BIH database [60]. We used “MIT-BIH normal sinus rhythm database (nsrdb)” and “MIT-BIH supraventricular arrhythmia database (svdb)”. Encoding of HRV signals September 12, 2017 DRAFT 37 were done by same manner as the text word length comparison of subsection V-A. In this experiment, CTW was trained with HRV of normal sinus rhythm, then applied to a HRV signal that has supraventricular rhythms. Fig. 11 shows the result of the simulation. The algorithm was able to localize the segment that suffers from abnormal rhythms. 200 HRV Random Walk and Atypicality Measure 150 Supraventricular Arrhythmia Cummulative Bits 100 50 0 -50 -100 Random Walk of the HRV "L(n) (bits) -150 1000 2000 3000 4000 5000 6000 7000 8000 HRV samples Fig. 11. Random walk of HRV. VI. C ONCLUSION In this paper we have developed a criterion for finding atypical (sub)sequences in large datasets. The criterion is based on a solid theoretical foundation, and we have shown that the criterion is amenable to theoretical analysis. In particular, we have shown that the probability that a sample is intrinsically atypical is less than 1, an important theoretical requirement that is not trivially satisfied. We have also shows in a few examples with real-world data that the method is able to find known atypical subsequences. Our aim set out in the introduction was more ambitiously to find ’interesting’ data in large datasets. In that context, the purpose of the current paper is only to introduce the methodology, and show some theoretical properties. In order to analyze really big datasets, we need much faster (probably approximate) algorithms, much more efficient software (say in Python or C), and faster computers. We are working on that as future work. R EFERENCES [1] L. Akoglu, H. Tong, J. Vreeken, and C. Faloutsos, “Fast and reliable anomaly detection in categorical data,” in Proceedings of the 21st ACM international conference on Information and knowledge management. ACM, 2012, pp. 415–424. [2] K. Smets and J. Vreeken, The Odd One Out: Identifying and Characterising Anomalies, 2011, ch. 69, pp. 804–815. [Online]. Available: http://epubs.siam.org/doi/abs/10.1137/1.9781611972818.69 [3] W. Liu, I. Park, and J. Principe, “An information theoretic approach of designing sparse kernel adaptive filters,” Neural Networks, IEEE Transactions on, vol. 20, no. 12, pp. 1950–1961, Dec 2009. September 12, 2017 DRAFT 38 [4] V. Chandola, A. Banerjee, and V. Kumar, “Anomaly detection for discrete sequences: A survey,” Knowledge and Data Engineering, IEEE Transactions on, vol. 24, no. 5, pp. 823 –839, may 2012. [5] D. Rumsfeld, Known and Unknown: A Memoir. Penguin, 2011. [6] K. Hamano and H. Yamamoto, “A randomness test based on t-codes,” in Information Theory and Its Applications, 2008. ISITA 2008. International Symposium on, dec. 2008, pp. 1 –6. [7] A. Nies, Computability and Randomness. Oxford University Press, 2009. [8] M. Malik, “Heart rate variability,” Annals of Noninvasive Electrocardiology, vol. 1, no. 2, pp. 151–181, April 1996. [9] M. F. Hilton, R. A. Bates, K. R. Godfrey, and et al., “Evaluation of frequency and time-frequency spectral analysis of heart rate variability as a diagnostic marker of the sleep apnea syndrome,” Med. Biol. Eng. Comput., vol. 37, no. 6, pp. 760–769, November 1999. [10] N. V. Thakor and Y. S. Zhu, “Application of adaptive filtering to ECG analysis: Noise cancellation and arrhythmia detection,” IEEE Trans. on Biomed. Eng., vol. 38, pp. 785–794, August 1991. [11] J. F. Thayer, S. S. Yamamoto, and J. F. Brosschot, “The relationship of autonomic imbalance, heart rate variability and cardiovascular disease risk factors,” International Journal of Cardiology, vol. 141, no. 2, pp. 122–131, May 2009. [12] J. Fondon and H. Garner, “Probing human cardiovascular congenital disease using transgenic mouse models,” Proc Natl Acad Sci U S A, vol. 101, no. 52, pp. 18 058–63, 2004. [13] D. K. Mellinger, K. M. Stafford, S. E. Moore, R. P. Dziak, and H. Matsumoto, “An overview of fixed passive acoustic observation methods for cetaceans,” Oceanograpy, vol. 20, no. 4, pp. 36–45, 2007. [14] M. Thottan and C. Ji, “Anomaly detection in ip networks,” Signal Processing, IEEE Transactions on, vol. 51, no. 8, pp. 2191 – 2204, aug. 2003. [15] M. Li and P. Vitányi, An Introduction to Kolmogorov Complexity and Its Applications, 3rd ed. [16] T. Cover and J. Thomas, Information Theory, 2nd Edition. Springer, 2008. John Wiley, 2006. [17] J. Rissanen, “Complexity of strings in the class of markov sources,” Information Theory, IEEE Transactions on, vol. 32, no. 4, pp. 526 – 532, jul 1986. [18] ——, “A universal prior for integers and estimation by minimum description length,” The Annals of Statistics, no. 2, pp. 416–431, 1983. [19] ——, “Universal coding, information, prediction, and estimation,” Information Theory, IEEE Transactions on, vol. 30, no. 4, pp. 629 – 636, jul 1984. [20] ——, “Stochastic complexity and modeling,” The Annals of Statistics, no. 3, pp. 1080–1100, Sep. 1986. [21] S. Evans, B. Barnett, S. Bush, and G. Saulnier, “Minimum description length principles for detection and classification of ftp exploits,” in Military Communications Conference, 2004. MILCOM 2004. 2004 IEEE, vol. 1, oct.-3 nov. 2004, pp. 473 – 479 Vol. 1. [22] N. Wang, J. Han, and J. Fang, “An anomaly detection algorithm based on lossless compression,” in Networking, Architecture and Storage (NAS), 2012 IEEE 7th International Conference on, 2012, pp. 31–38. [23] W. Lee and D. Xiang, “Information-theoretic measures for anomaly detection,” in Security and Privacy, 2001. S P 2001. Proceedings. 2001 IEEE Symposium on, 2001, pp. 130–143. [24] I. Paschalidis and G. Smaragdakis, “Spatio-temporal network anomaly detection by assessing deviations of empirical measures,” Networking, IEEE/ACM Transactions on, vol. 17, no. 3, pp. 685–697, 2009. [25] C.-K. Han and H.-K. Choi, “Effective discovery of attacks using entropy of packet dynamics,” Network, IEEE, vol. 23, no. 5, pp. 4–12, 2009. [26] P. Baliga and T. Lin, “Kolmogorov complexity based automata modeling for intrusion detection,” in Granular Computing, 2005 IEEE International Conference on, vol. 2, 2005, pp. 387–392 Vol. 2. [27] H. Shahriar and M. Zulkernine, “Information-theoretic detection of sql injection attacks,” in High-Assurance Systems Engineering (HASE), 2012 IEEE 14th International Symposium on, 2012, pp. 40–47. [28] Y. Xiang, K. Li, and W. Zhou, “Low-rate ddos attacks detection and traceback by using new information metrics,” Information Forensics and Security, IEEE Transactions on, vol. 6, no. 2, pp. 426–437, 2011. [29] F. Pan and W. Wang, “Anomaly detection based-on the regularity of normal behaviors,” in Systems and Control in Aerospace and Astronautics, 2006. ISSCAA 2006. 1st International Symposium on, 2006, pp. 6 pp.–1046. [30] E. Eiland and L. Liebrock, “An application of information theory to intrusion detection,” in Information Assurance, 2006. IWIA 2006. Fourth IEEE International Workshop on, 2006, pp. 16 pp.–134. [31] M. Li, X. Chen, X. Li, B. Ma, and P. Vitanyi, “The similarity metric,” Information Theory, IEEE Transactions on, vol. 50, no. 12, pp. 3250 – 3264, dec. 2004. September 12, 2017 DRAFT 39 [32] E. Keogh, S. Lonardi, and C. A. Ratanamahatana, “Towards parameter-free data mining,” in Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining. ACM, 2004, pp. 206–215. [33] S. M. Kay, Fundamentals of Statistical Signal Processing, Volume I: Estimation Theory. Prentice-Hall, 1993. [34] L. L. Scharf, Statistical Signal Processing: Detection, Estimation, and Time Series Analysis. Addison-Wesley, 1990. [35] G. Shamir, “On the mdl principle for i.i.d. sources with large alphabets,” Information Theory, IEEE Transactions on, vol. 52, no. 5, pp. 1939–1955, May 2006. [36] P. Elias, “Universal codeword sets and representations of the integers,” Information Theory, IEEE Transactions on, vol. 21, no. 2, pp. 194 – 203, mar 1975. [37] H. V. Poor, An Introduction to Signal Detection and Estimation. Springer-Verlag, 1994. [38] W. Hoeffding, “Probability inequalities for sums of bounded random variables,” Journal of the American statistical association, vol. 58, no. 301, pp. 13–30, 1963. [39] A. Dembo and O. Zeitouni, Large Deviations Techniques and Applications. [40] E. L. Lehmann, Testing Statistical Hypotheses. Springer, 1998. Springer, 2005. [41] G. R. Grimmett and D. R. Stirzaker, Probability and Random Processes, Third Edition. Oxford University Press, 2001. [42] J. Rissanen, “Modeling by shortest data description,” Automatica, pp. 465–471, 1978. [43] F. M. J. Willems, Y. Shtarkov, and T. Tjalkens, “The context-tree weighting method: basic properties,” Information Theory, IEEE Transactions on, vol. 41, no. 3, pp. 653–664, 1995. [44] J. Ziv and A. Lempel, “A universal algorithm for sequential data compression,” Information Theory, IEEE Transactions on, vol. 23, no. 3, pp. 337 – 343, may 1977. [45] ——, “Compression of individual sequences via variable-rate coding,” Information Theory, IEEE Transactions on, vol. 24, no. 5, pp. 530 – 536, sep 1978. [46] M. Effros, K. Visweswariah, S. Kulkarni, and S. Verdu, “Universal lossless source coding with the burrows wheeler transform,” Information Theory, IEEE Transactions on, vol. 48, no. 5, pp. 1061 –1081, may 2002. [47] J. Cleary and I. Witten, “Data compression using adaptive coding and partial string matching,” Communications, IEEE Transactions on, vol. 32, no. 4, pp. 396 – 402, apr 1984. [48] A. Moffat, “Implementing the ppm data compression scheme,” Communications, IEEE Transactions on, vol. 38, no. 11, pp. 1917 –1921, nov 1990. [49] M. Titchener, “Deterministic computation of complexity, information and entropy,” in Information Theory, 1998. Proceedings. 1998 IEEE International Symposium on, aug 1998, p. 326. [50] K. Kawaharada, K. Ohzeki, and U. Speidel, “Information and entropy measurements on video sequences,” in Information, Communications and Signal Processing, 2005 Fifth International Conference on, 0-0 2005, pp. 1150 –1154. [51] U. Speidel, “A note on the estimation of string complexity for short strings,” in Information, Communications and Signal Processing, 2009. ICICS 2009. 7th International Conference on, dec. 2009, pp. 1 –5. [52] U. Speidel, R. Eimann, and N. Brownlee, “Detecting network events via t-entropy,” in Information, Communications Signal Processing, 2007 6th International Conference on, dec. 2007, pp. 1 –5. [53] U. Speidel and T. Gulliver, “An analytic upper bound on t-complexity,” in Information Theory Proceedings (ISIT), 2012 IEEE International Symposium on, july 2012, pp. 2706 –2710. [54] J. Yang and U. Speidel, “String parsing-based similarity detection,” in Information Theory Workshop, 2005 IEEE, aug.-1 sept. 2005, p. 5 pp. [55] P. A. J. Volf and F. M. J. Willems, “Switching between two universal source coding algorithms,” in Data Compression Conference, 1998. DCC ’98. Proceedings, 1998, pp. 491–500. [56] P. Jacquet and W. Szpankowski, “Limiting distribution of lempel ziv’78 redundancy,” in Information Theory Proceedings (ISIT), 2011 IEEE International Symposium on, 31 2011-aug. 5 2011, pp. 1509 –1513. [57] F. Willems, Y. Shtarkov, and T. Tjalkens, “Reflections on "the context tree weighting method: Basic properties",” Newsletter of the IEEE Information Theory Society, vol. 47, no. 1, 1997. [58] F. Willems, “The context-tree weighting method: extensions,” Information Theory, IEEE Transactions on, vol. 44, no. 2, pp. 792–798, Mar 1998. [59] “Department of Statistics, UC Berkeley,” http://www.stat.berkeley.edu/. [60] “PhysioBank ATM,” http://physionet.org/cgi-bin/atm/ATM/. September 12, 2017 DRAFT 40 [61] R. J. Britten, “DNA sequence insertion and evolutionary variation in gene regulation,” Proceedings of the National Academy of Sciences, vol. 93, no. 18, pp. 9374–9377, 1996. [Online]. Available: http://www.pnas.org/content/93/18/9374.abstract [62] J. Z. K. Khattak, S. Rauf, Z. Anwar, H. M. Wahedi, and T. Jamil, “Recent advances in genetic engineering - a review,” Current Research Journal of Biological Sciences, vol. 4, no. 1, 2012. [63] A. Høst-Madsen, E. Sabeti, and C. Walton, “Information theory for atypical sequences,” in IEEE Information Theory Workshop (ITW’13), Seville, Spain, 2013. September 12, 2017 DRAFT
7cs.IT
arXiv:1611.06245v1 [cs.NE] 18 Nov 2016 Spikes as Regularizers Anders Søgaard∗ Department of Computer Science University of Copenhagen Copenhagen, DK-2200 [email protected] Abstract We present a confidence-based single-layer feed-forward learning algorithm S PI RAL (Spike Regularized Adaptive Learning) relying on an encoding of activation spikes. We adaptively update a weight vector relying on confidence estimates and activation offsets relative to previous activity. We regularize updates proportionally to item-level confidence and weight-specific support, loosely inspired by the observation from neurophysiology that high spike rates are sometimes accompanied by low temporal precision. Our experiments suggest that the new learning algorithm S PIRAL is more robust and less prone to overfitting than both the averaged perceptron and A ROW. 1 Confidence-weighted Learning of Linear Classifiers The perceptron [Rosenblatt, 1958] is a conceptually simple and widely used discriminative and linear classification algorithm. It was originally motivated by observations of how signals are passed between neurons in the brain. We will return to the perceptron as a model of neural computation, but from a more technical point of view, the main weakness of the perceptron as a linear classifier is that it is prone to overfitting. One particular type of overfitting that is likely to happen in perceptron learning is feature swamping [Sutton et al., 2006], i.e., that very frequent features may prevent co-variant features from being updated, leading to catastrophic performance if the frequent features are absent or less frequent at test time. In other words, in the perceptron, as well as in passive-aggressive learning Crammer et al. [2006], parameters are only updated when features occur, and rare features therefore often receive inaccurate values. There are several ways to approach such overfitting, e.g., capping the model’s supremum norm, but here we focus on a specific line of research: confidence-weighted learning of linear classifiers. Confidence-weighted learning explicitly estimates confidence during induction, often by maintaining Gaussian distributions over parameter vectors. In other words, each model parameter is interpreted as a mean, and augmented with a covariance estimate. Confidence-Weighted Learning CWL [Dredze et al., 2008] was the first learning algorithm to do this, but Crammer et al. [2009] later introduced Adaptive Regularization of Weight Vectors (A ROW), which is a simpler and more effective alternative: A ROW passes over the data, item by item, computing a margin, i.e., a dot product of a weight vector µ and the item, and updating µ and a covariance matrix Σ in a standard additive fashion. As in CWL, the weights – which are interpreted as means – and the covariance matrix form a Gaussian distribution over the weight vectors. Specifically, the confidence is x> Σx. We add a smoothing constant r(= 0.1) and compute the learning rate α adaptively: ∗ This research is funded by the ERC Starting Grant LOWLANDS No. 313695, as well as by the Danish Research Council. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. α= max(0, 1 − yx> µ) x> Σx + r (1) We then update µ proportionally to α, and update the covariance matrix as follows: Σ← Σ − Σxx> Σ x> Σx + r (2) CWL and A ROW have been shown to be more robust than the (averaged) perceptron in several studies [Crammer et al., 2012, Søgaard and Johannsen, 2012], but below we show that replacing binary activations with samples from spikes can lead to better regularized and more robust models. 2 2.1 Spikes as Regularizers Neurophysiological motivation Neurons do not fire synchronously at a constant rate. Neural signals are spike-shaped with an onset, an increase in signal, followed by a spike and a decrease in signal, and with an inhibition of the neuron before returning to its equilibrium. Below we simplify the picture a bit by assuming that spikes are bell-shaped (Gaussians). The learning algorithm (S PIRAL) which we will propose below, is motivated by the observation that spike rate (the speed at which a neuron fires) increases the more a neuron fires [Kawai and Sterling, 2002, Keller and Takahashi, 2015]. Futhermore, Keller and Takahashi [2015] show that increased activity may lead to spiking at higher rates with lower temporal precision. This means that the more active neurons are less successful in passing on signals, leading the neuron to return to a more stable firing rate. In other words, the brain performs implicit regularization by exhibiting low temporal precision at high spike rates. This prevents highly active neurons from swamping other co-variant, but less active neurons. We hypothesise that implementing a similar mechanism in our learning algorithms will prevent feature swamping in a similar fashion. Finally, Blanco et al. [2015] show that periods of increased spike rate lead to a smaller standard deviation in the synaptic weights. This loosely inspired us to implement the temporal imprecision at high spike rates by decreasing the weight’s standard deviation. 2.2 The algorithm In a single layer feedforward model, such as the perceptron, sampling from Gaussian spikes only effect the input, and we can therefore implement our regularizer as noise injection [Bishop, 1995]. The variance is the relative confidence of the model on the input item (same for all parameters), and the means are the parameter values. We multiply the input by the inverse of the sample, reflecting the intuition that highly active neurons are less precise and more likely to drop out, before we clip the sample from 0 to 1. We give the pseudocode in Algorithm 1, following the conventions in Crammer et al. [2009]. 3 3.1 Experiments Main experiments We extract 10 binary classification problems from MNIST, training on odd data points, testing on even ones. Since our algorithm is parameter-free, we did not do explicit parameter tuning, but during the implementation of S PIRAL, we only experiment with the first of these ten problems (left, upper corner). To test the robustness of S PIRAL relatively to the perceptron and A ROW, we randomly corrupt the input at test time by removing features. Our set-up is inspired by Globerson and Roweis [2006]. In the plots in Figure 2, the x-axis presents the number of features kept (not deleted). We observe two tendencies in the results: (i) S PIRAL outperforms the perceptron consistently with up to 80% of the features, and sometimes by a very large margin; except that in 2/10 cases, the perceptron 2 Figure 1: Sampling activations from Gaussian spikes. A ROW 1.00 1.00 1.00 0.95 0.95 0.95 0.90 0.90 0.90 1.00 1.00 0.95 0.95 0.90 0.90 0.85 0.85 0.85 0.85 0.85 0.80 acc 0.80 acc acc acc acc 0.80 0.80 0.80 0.75 0.75 0.75 0.75 0.75 0.70 0.70 0.70 Perceptron 0.65 0.70 Perceptron 0.65 Arow 0.60 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.60 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.6 0.7 0.8 0.9 0.60 0.1 1.0 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 0.55 0.1 1.0 0.2 0.3 0.4 0.6 0.7 0.8 0.9 Arow 0.60 0.1 1.0 0.2 0.3 0.4 0.6 0.7 0.8 0.6 0.7 0.8 0.6 0.7 0.8 0.6 0.7 0.8 0.9 1.0 1.00 0.95 0.95 0.90 0.90 0.5 noise 1.00 0.95 0.95 0.5 noise 1.00 0.90 Perceptron 0.65 Arow noise 1.00 0.95 Perceptron 0.60 Arow noise 1.00 0.70 0.65 Perceptron 0.65 Arow 0.90 0.90 0.85 0.85 0.85 0.85 0.80 acc acc 0.80 acc 0.80 acc acc 0.85 0.80 0.75 0.80 0.75 0.75 0.75 0.70 0.75 0.70 0.70 0.70 Perceptron 0.65 Perceptron Arow 0.60 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Arow 0.65 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.6 0.7 0.8 0.9 0.70 0.65 Perceptron 0.65 Perceptron 0.60 Arow 0.60 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.6 0.7 0.8 0.9 Perceptron 0.65 Arow 0.55 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.6 0.7 0.8 0.9 Arow 0.60 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.9 1.0 noise S PIRAL 1.00 1.00 0.95 0.95 0.90 0.90 1.00 1.00 0.95 0.95 0.90 0.90 0.85 0.80 acc acc acc 0.85 acc 0.80 0.80 0.80 0.75 0.80 0.75 0.75 0.70 0.70 0.75 0.70 0.75 0.70 Perceptron Perceptron Spikes 0.65 0.1 0.85 0.85 acc 0.85 1.00 0.95 0.90 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Perceptron 0.65 Spikes 0.65 0.1 1.0 0.2 0.3 0.4 noise 0.5 0.6 0.7 0.8 0.9 0.2 0.3 0.4 noise 1.00 0.5 0.6 0.7 0.8 0.9 Perceptron Spikes 0.60 0.1 1.0 0.2 0.3 0.4 noise 1.00 0.70 Perceptron 0.65 Spikes 0.60 0.1 1.0 0.5 0.6 0.7 0.8 0.9 Spikes 0.65 0.1 1.0 0.2 0.3 0.4 noise 1.00 0.5 0.9 1.0 noise 1.00 1.00 0.95 0.95 0.95 0.95 0.95 0.90 0.90 0.90 0.90 0.90 0.85 acc acc 0.85 0.80 0.85 0.80 acc acc 0.85 acc 0.85 0.75 0.80 0.80 0.80 0.70 0.75 0.75 0.75 0.65 0.75 0.70 Perceptron 0.2 0.3 0.4 0.5 noise 0.6 0.7 0.8 0.9 0.70 Perceptron Spikes 0.65 0.1 Perceptron Spikes 1.0 0.70 0.1 0.2 0.3 0.4 0.5 noise 0.6 0.7 0.8 0.9 1.0 0.2 0.3 0.4 0.5 noise 0.6 0.7 0.8 0.9 0.70 Perceptron 0.60 Spikes 0.65 0.1 Perceptron Spikes 1.0 0.55 0.1 0.2 0.3 0.4 0.5 noise 0.6 0.7 0.8 0.9 Spikes 1.0 0.65 0.1 0.2 0.3 0.4 0.5 0.9 1.0 noise Figure 2: Performance over noise levels (percentage of features kept). First two lines compare the perceptron (blue) and A ROW (green); the third and fourth compare the perceptron (blue) and S PIRAL (green). 3 Algorithm 1 S PIRAL. Except for lines 8–10, this is identical to A ROW. 1: r = 0.1, µ0 = 0, Σ0 = I, {xt | xt ∈ Rd }, v = 0 2: for t < T do 3: xt = xt · 4: if vt > v then 5: v = vt 6: end if 7: vt = x> t Σt−1 xt (sampling activations from Gaussian spikes) 8: vt = 0 < vt < 1 (clipping values outside the [0,1] window) 9: νt ∼ N (µt−1 , vvt ) 10: xt = xt · (1 − νt ) 11: mt = µt−1 · xt 12: if mt yt < 1 then 13: 14: max(0,1−y x> µ ) t t t−1 αt = x> t Σt−1 xt +r µt = µt−1 + αt Σt−1 yt xt Σ 15: Σt = t−1 16: end if 17: end for 18: return µT , ΣT −Σt−1 xt x> t Σt−1 x> t Σxt +r is better with only 10% of the features. (ii) In contrast, A ROW is less stable, and only improves significantly over the perceptron under mid-range noise levels in a few cases. The perceptron is almost always superior on the full set of features, since this is a relatively simple learning problem, where overfitting is unlikely, unless noise is injected at test time. 3.2 Practical Rademacher complexity We compute S PIRAL’s practical Rademacher complexity as the ability of S PIRAL to fit random re-labelings of data. We randomly label the above dataset ten times and compute the average error reduction over a random baseline. The perceptron achieves a 5% error reduction over a random baseline, on average, overfitting quite a bit to the random labelling of the data. In contrast, S PIRAL only reduces 0.6% of the errors of a random baseline on average, suggesting that it is almost resilient to overfitting on this dataset. 4 Conclusion We have presented a simple, confidence-based single layer feed-forward learning algorithm S PI RAL that uses sampling from Gaussian spikes as a regularizer, loosely inspired by recent findings in neurophysiology. S PIRAL outperforms the perceptron and A ROW by a large margin, when noise is injected at test time, and has lower Rademacher complexity than both of these algorithms. Acknowledgments References Cristopher Bishop. Training with noise is equivalent to tikhonov regularization. Neural Computation, 7(1):108–116, 1995. Wilfredo Blanco, Catia Pereira, Vinicius Cota, Annie Souza, Cesar Renno-Costa, Sharlene Santos, Gabriella Dias, Ana Guerreiro, Adriano Tort, Adriao Neto, and Sidarta Ribeiro. Synaptic homeostasis and restructuring across the sleep-wake cycle. PLoS Computational Biology, 11:1–29, 2015. Koby Crammer, Ofer Dekel, Joseph Keshet, Shai Shalev-Shwartz, and Yoram Singer. Online passive-agressive algorithms. Journal of Machine Learning Research, 7:551–585, 2006. Koby Crammer, A Kulesza, and Mark Dredze. Adaptive regularization of weighted vectors. In NIPS, 2009. 4 Koby Crammer, Mark Dredze, and Fernando Pereira. Confidence-weighted linear classification for text categorization. Journal of Machine Learning Research, 13:1891–1926, 2012. Mark Dredze, Koby Crammer, and Fernando Pereira. Confidence-weighted linear classification. In ICML, 2008. Amir Globerson and Sam Roweis. Nightmare at test time: robust learning by feature deletion. In ICML, 2006. Fusao Kawai and Peter Sterling. cgmp modulates spike responses of retinal ganglion cells via a cgmp-gated current. Visual Neuroscience, 19:373–380, 2002. Clifford Keller and Terry Takahashi. Spike timing precision changes with spike rate adaptation in the owl’s auditory space map. Journal of Neurophysiology, 114:2204–2219, 2015. Frank Rosenblatt. The perceptron: a probabilistic model for information storage and organization in the brain. Psychological Review, 65(6):386–408, 1958. Anders Søgaard and Anders Johannsen. Robust learning in random subspaces: equipping NLP against OOV effects. In COLING, 2012. Charles Sutton, Michael Sindelar, and Andrew McCallum. Reducing weight undertraining in structured discriminative learning. In NAACL, 2006. 5
9cs.NE
arXiv:1801.04486v5 [cs.AI] 19 Mar 2018 Can Computers Create Art? Aaron Hertzmann Adobe Research∗ March 20, 2018 Abstract This essay discusses whether computers, using Artificial Intelligence (AI), could create art. The first part concerns AI-based tools for assisting with art making. The history of technologies that automated aspects of art is covered, including photography and animation. In each case, we see initial fears and denial of the technology, followed by a blossoming of new creative and professional opportunities for artists. The hype and reality of Artificial Intelligence (AI) tools for art making is discussed, together with predictions about how AI tools will be used. The second part speculates about whether it could ever happen that AI systems could conceive of artwork, and be credited with authorship of an artwork. It is theorized that art is something created by social agents, and so computers cannot be credited with authorship of art in our current understanding. A few ways that this could change are also hypothesized. 1 Introduction Artificial Intelligence (AI) research has made staggering advances recently, including many publicly-visible developments in web search, image recognition, conversational agents, and robotics. These developments have stoked fear about Artificial Intelligence’s effect on many aspects of society. In the context of art, news media hype presents new image and video creation algorithms as if they are automating the creation of art. Perhaps they will empower everyday users while putting artists out of work... and, while they’re at it, rob us of our humanity? Beyond the hype, confusion about how technology influences art pervades serious discussions. Professional artists often are concerned that computers might put them out of their jobs ∗ This essay expresses my own opinions and not those of my employer. This manuscript was submitted to the journal Arts, Special Issue on The Machine as Artist (for the 21st Century) ( http://www.mdpi.com/ journal/arts/special_issues/Machine_Artist ), by invitation. Please send comments to [email protected]. However, I cannot promise to respond to all feedback. 1 [48] — a concern I’ve heard for decades. Some practitioners present their algorithms as themselves, potentially, artists [10, 21, 58], as do some journalists [51, 19]. And, I was recently contacted by a prominent social psychologist who, inspired by recent results with neural networks, wished to conduct experiments to assess whether ordinary people might be willing to buy artwork made by a computer, and, if so, why. It was assumed that computers were already happily making their own artwork. On the other hand, whenever I have informally asked friends or colleagues the question of whether computers can create art, the answer is usually a decisive “No.” Art requires human intent, inspiration, a desire to express something. Thus, by definition, there is no such thing as art created by a computer... why would anyone worry? The concepts of art and inspiration are often spoken of in mystical terms, something special and primal beyond the realm of science and technology; as if humans can only create art because only humans have “souls.” Surely, there should be a more scientific explanation. In this essay, I tackle the question of “Can Computers Create Art?” This might seem like a simple question, but it hides substantial complications. People sometimes approach this question as one of technological capability: are computers “smart” enough or “creative” enough; analogous to asking whether computers can perform well-defined tasks like solving mathematical problems or accurately resolving search queries. But, I argue, this is not the right way to look at the question, and I do not attempt any sort of survey of the existing technology. In my opinion, whether computers can create art is not a computer science question so much as it is a question of philosophy of art and human psychology. In the first part of this essay, I discuss the history and current state of automation for art. I begin with some historical perspective: previous moments in history when new technologies automated image and film creation, particularly the invention of photography. In each case, we see that these new technologies caused fears of displacing artists, when, in fact, the new technology both created new opportunities for artists while invigorating the traditional media. I argue that new technologies benefit art and artists, creating new tools and modes of expression, and new styles of expression. Sadly, art and science are often viewed as being separate, or in even opposition or competition [61]. Rather than being a foe, technological development stimulates so much of the continued vitality of art, and new artistic technologies create new job opportunities. Often, artists are important contributors to these innovations; artists and technologists have much in common, as tinkerers, experimenters, and explorers. Our new AI technologies follow this trend, and will for the forseeable future: new AI algorithms will provide new tools for expression and transform our art in culture in positive ways, just as so many other technologies have in the past. Computers do not create art, artists using computers create art. Despite many decades of procedural and computer-generated art, there has never been a computer which has widely accepted as the author of an artwork. In the second part, I discuss whether this could ever change: would we ever agree to assign authorship to a computer? I argue that artistic creation is primarily a social act, an action that people primarily as an interaction with other humans in society. This means that computers cannot create art, just as people do not give gifts to their coffeemakers or marry their cars. 2 However, the boundaries of art are fluid, and I discuss scenarios where AI algorithms could come to be accepted as artists, along with some of the dangers of too eagerly accepting software as artists. This essay expresses my point of view on these topics, as someone who has developed various kinds of technology for art, has followed the development of new technologies affecting art and culture over the years, and, in a few small instances, exhibited my own work as artworks. I have written it in a style that is meant to be accessible to a general audience, since these are topics that many kinds of people care about. 2 History and Current Practice Before making general claims about how computer tools relate to art, I begin by first describing several useful historical examples, including the inventions of photography, film, and computer animation. These examples show previous situations in which a new technology appeared poised to displace artists, but, in reality, provided new opportunities and roles for artists. I also discuss how procedural art and computer art employs automation. In so many of these fields, outsiders view the computer or the technology as doing the work of creativity. Yet, in each of these cases, the human artist or artists behind the work are the true authors of the work. I argue that, throughout history, technology has expanded creative and professional opportunities for artists dramatically, by providing newer and more powerful tools for artists. The advent of new technologies often cause fears of displacement among traditional artists. In fact, these new tools ultimately enable new artistic styles and inject vitality into art forms that might otherwise grow stale. These new tools also make art more accessible to wider sections of society, both as creators and as consumers. These trends are particularly visible in the past two centuries since the Industrial Revolution. 2.1 How photography became an artform “From today, painting is dead!” – Paul Delaroche, painter, at a demonstration of the daguerreotype in 18391 For lessons from the past about AI and art, perhaps no invention is more significant than photography.2 Prior to the invention of photography, realistic images of the world could only be produced by artists. In today’s world, we are so swamped with images that it is hard to imagine just how special and unique it must have felt to see a skillfully-executed realistic painting. The technical skills of realism were inseparable from other creative aspects. This changed when photography automated the task of producing images of the real world. In 1839, the first two commercially-practical photographic processes were invented: LouisJacques-Mandé Daguerre’s dagguereotype, and William Henry Fox Talbot’s negative-positive process. They were mainly presented as ways to produce practical records of the world. Of the 1 2 The historical information from this section is distilled from two texts: [54] and [57]. This connection has been made previously [32, 1], but I expand upon it much more here. 3 (a) (b) Figure 1: (a) A traditional silhouette portrait. (b) Daguerreotype portrait of Abraham Lincoln, 1846. Photographic techniques like this completely displaced previous portraiture techniques. two, the daguerreotype was more popular for several decades, because Talbot’s process was restricted by patents. Improvements to Talbot’s method eventually made the daguerreotype obsolete and evolved into modern film processes. Portraiture was a main driver for early adoption. Then, as today, people enjoyed possessing pictures of their friends, loved-ones, and ancestors. Portrait painting was only available to aristocrats and the very wealthy; even today, portrait painting is a symbol of great wealth and status. In the 18th century, a number of inexpensive alternatives were developed, such as the silhouette, a tiny black representation of an individual’s outline (Figure 1(a)), typically handcut by an artisan out of black paper. The daguerreotype offered an economical way to create a realistic portrait (Figure 1(b)). It was very slow and required locking the subject’s head in place with a head brace for several minutes, while the subject gripped their chair tightly, so as not to flutter their fingers. Nonetheless, numerous daguerreotype studios arose and became commonplace as technologies improved, and many portraitists switched to this new technology. By 1863, a painter-photographer named Henri Le Secq said “One knows that photography has harmed painting considerably, and has killed portraiture especially, once the livelihood of the artist.” Photography largely replaced most older forms of portraiture, such as the silhouette, and no one seems to particularly regret this loss. As much as I appreciate the mystery and beauty at looking at old etchings and portraits, I’d rather use my mobile phone camera for my own pictures than to try to paint them by hand. Another early use for the daguerreotype was to produce souvenirs for tourists: by 1850, daguerreotypes of Roman ruins completely replaced the etchings and lithographs that tourists had previously purchased. As the technology improved, photography became indispensable as a source of records for engineering projects and disappearing architectural ruins, as well as for 4 Figure 2: The Unhappy Painter, by Theodor Hosemann, 1843, satirizes the painter, a victim of progress, made obsolete by a daguerreotype. documentary purposes, such as Matthew Brady’s photographs of the horrors of the American civil war. “Is photography art?” This question was debated for many decades, coalescing into three main positions. Many people believed that photography could not be art, because it was made by a mechanical device rather than by human creativity. Many artists were dismissive of photography, and saw it as a threat to “real art.” A second view was that photography could be useful to real artists, such as for reference, but should not be considered as equal to drawing and painting. Finally, a third group, relating photography to established forms like etching and lithography, felt that photography could eventually be as significant an art form as painting. Photography ultimately had a profound and unexpected effect on painting. Painters’ mimetic abilities had been improving over the centuries. Many painters of the 19th century, such as the Pre-Raphaelites like John Everett Millais and Neoclassicists like Ingres, painted depictions of the world with dazzling realism, more than had ever been seen before. However, cameras became cheaper, lighter, and easier to use, and grew widespread among both amateurs and professionals. Realistic photographs became commonplace by the end of the 19th century. If photorealism could be reduced to a mechanical process, then what is the artist’s role? This question drove painters away from visual realism toward different forms of abstraction. James McNeill Whistler’s Tonalist movement created atmospheric, moody scenes; he wrote: “The imitator is a poor kind of creature. If the man who paints only the tree, or the flower, or other surface he sees before him were an artist, the king of artists would be the photographer. It is for the artist to do something beyond this.” The Impressionists, who sought to capture the perceptions of scenes, were likely influenced by the perceptual “imperfections” of photographs. In contrast, Symbolists and post-Impressionist artists moved away from perceptual realism altogether. Edvard Munch wrote “I have no fear of photography as long as it cannot be used in heaven and in hell. ... I am going to paint people who breathe, feel, love, and suffer.” Vincent Van Gogh, describing his artistic breakthroughs around 1888, wrote to his brother: “You must boldly exaggerate the effects of either harmony or discord which colors produce. It is the same thing in drawing — accurate drawing, accurate color, is perhaps not the 5 essential thing to aim at, because the reflection of reality in a mirror, if it could be caught, color and all, would not be a picture at all, no more than a photograph.” Photography continued to influence modern art of the 20th century; one can infer a significant influence of Étienne-Jules Marey’s multiple-exposure photography on Futurism and Cubism, e.g., in Duchamp’s Nude Descending A Staircase. One can argue, in fact, that photography was one of the major catalysts of the Modern Art movement: its influence led to decades of vitality in the world of painting, as artists were both inspired by photographic images and pushed to go beyond realism. Meanwhile, the Pictorialist movement, begun around 1885, was an attempt to firmly establish photography as an art form. Pictorialists introduced much more artistic control over the photographs, often using highly-posed subjects as in classical painting, and manipulating their images in the darkroom. Many of their works had a hazy, atmospheric work, similar to Tonalism, that deliberately softened the realism of high-quality photography. They seemed to be deliberately mimicking the qualities of the fine art painting of the time, and today seem rather affected. They pursued various strategies toward legitimization of their work as art form, such as the organization of photographic societies, periodicals, and juried photography exhibitions [64]. Their works and achievements made it harder and harder to deny the artistic contributions of photography; culminating in the “Buffalo Show,” organized by Alfred Stieglitz at the Albright Gallery in Buffalo, NY, the first photography exhibition at an American art museum, in 1910. Photography was firmly established as an art, and free to move beyond the pretensions of Pictorialism. This story provides several lessons that are directly relevant for AI as an artistic tool. At first, photography, like AI, was seen by many as non-artistic, because it was a mechanical process. Some saw photography as a threat and argued against its legitimacy. Photography did displace old technologies that had fulfilled non-artistic functions, such as portraiture’s social function. Some artists enthusiastically embraced the new technology, and began to explore its potential. As the technology improved, and became more widespread over nearly a century, artists learned to better control and express themselves with the new technology, until there was no more real controversy over the status of photography. The new technology made imagemaking much more accessible to non-experts and hobbyists; today, everyone can experiment with photography. Furthermore, the new technology breathed new life into the old art form, provoking it toward greater abstraction. Wherever there is controversy in AI as an artistic tool, I predict the same trajectory. Eventually, new AI tools will be fully recognized as artists’ tools; AI tools may stimulate traditional media as well, e.g., the New Aesthetic [63]. 2.2 The technology of live-action cinema The story of filmmaking and technology has important lessons about how artists and technologists can work together, each pushing the other further. Most of the early photographers were, by necessity, both artists and technologists, experimenting with new techniques driven by their art or to inspire their art. But, in film and animation, the interaction has been much more central to the art form. 6 Figure 3: The interplay of painting and early photography. (a) By the 19th century, Western painters had achieved dazzling levels of realism. (b) Early cameras took low-quality (though evocative) pictures. This daguerreotype took over ten minutes to expose. (c) However, camera technology steadily improved, capturing greater and greater realism, in much faster exposures. (d) This challenged painters to create works that were not about hyper-realistic depiction, such as Whistler’s Tonalist Nocturne. (e) The Pictorialist photographers attempted to establish photography as an art form by mimicking the styles and abstraction of painting. Works: (a) Ophelia, John Everett Millais, 1851 (b) Boulevard du Temple, Daguerre, 1838; (c) Portrait of Sarah Bernhardt, Félix Nadar, 1864; (d) Nocturne in Blue and Gold: Old Battersea Bridge, James MacNeill Whistler, c. 1872-1875; (e) Morning, Clarence H. White, 1908 7 (a) (b) (c) Figure 4: Technological developments in the art of filmmaking: (a) the first captured film, of workers leaving the Lumiere Brothers’ factory (1895), (b) George Méliès’ 1908 A Trip to The Moon filmed like a stage play but with fantastical special effects, (c) Citizen Kane, which used numerous experimental camera and lens effects to tell the story. The history of film is filled with artist-tinkerers, as well as teams of artists and technologists. The Lumière Brothers created the first film, a simple recording of workers leaving their factory, but also experimented with a wide range of camera technologies, color processing, and artistic ways to use them. The stage magician George Méliès filmed fantastical stories like A Trip to the Moon, employing a wide range of clever in-camera tricks and techniques to create delightfully inventive and beguiling films. Walt Disney employed and pushed new technologies of sound and color recording, and drove other innovations along the way, such as the multiplane camera. Many of Orson Welles’ innovative film techniques were made possible by new camera lenses employed by his cinematographer Gregg Toland. The introduction of more portable camera and audio equipment enabled the experiments of the French New Wave, who, in turn, influenced young American directors like Francis Ford Coppola and George Lucas. George Lucas’ team for Star Wars was an early developer of many new visual effects on a shoestring budget (think of Ben Burtt hitting telephone guy-wires to create the “blaster” sound effect), as well as an early innovation in digital film editing and compositing [56]. Digital and computer graphics technology, have, obviously, revolutionized film storytelling since then, with directors like Michel Gondry and James Cameron pushing the technology further into unforeseen directions. In each case, we see technologies rapidly adopted by directors to create new storytelling techniques and styles, transforming the medium over and over. 2.3 3D computer animation: a collaboration 3D computer animation as an artform was pioneered by Pixar Animation Studios, and that success is due to the close collaboration of artists and engineers [52]. It all began with Ed Catmull, an animation enthusiast who received a PhD in computer science in 1974. In his thesis, he invented several core techniques that every major 3D computer graphics system uses today. During his time in graduate school, he quietly set a goal for himself: to make the world’s first computer-animated film [5]. Consequently, he founded the Lucasfilm Computer Division, and hired a team of brilliant engineers to invent computer systems to be used for film-making. However, none of this group could animate, that is, bring a character to life through movement. Hence, Catmull recruited John Lasseter, an animator trained deeply in the Disney tradition. 8 Through tight collaboration between Lasseter and the technical staff, they were able to invent new technologies and discover together how computer animation could start to become its own art form [41]. This group spun out as Pixar, and, over the following years, invented numerous technical innovations aimed at answering the needs set out by Pixar’s artists; in turn, the artists were inspired by these new tools, and pushed them to new extremes, and so on. One of their mantras was “Art challenges technology, technology challenges art” [5]. Pixar, by design, treats artists and engineers both as crucial to the company’s success and minimizes any barriers between the groups. When I worked there during a sabbatical, despite my technical role, I had many energizing conversations with different kinds of artists, attended many lectures on art and storytelling, sketched at an open life drawing session, watched a performance of an employee improv troupe, and participated in many other social and educational events that deliberately mixed people from different parts of the company. This is the culture that, though it still has some flaws to address, achieved so many years of technical and creative innovation, and, ultimately, commercial and artistic success. Computer animation is another technology that scared traditional artists. In the early, prePixar days, Catmull’s group made many attempts to interest Disney animators in their work [52]. Alvy Ray Smith later said: “Animators were frightened of the computer. They felt that it was going to take their jobs away. We spent a lot of time telling people, No, it’s just a tool-it doesn’t do the creativity!’ That misconception was everywhere” [50]. It is a common misconception that computer animation just amounts to the computer solving everything; a programmer presses a button and the characters just move on their own. In reality, computer animation is extraordinarily labor-intensive, requiring the skills of talented artists (especially animators) for almost every little detail. Character animation is an art form of extreme skill and talent, requiring laborious effort using the same fundamental skills of performance — of bringing a character to life through pure movement — as in conventional animation [41]. Traditional cel animation jobs did not last at Disney, for various reasons. Disney Feature Animation underwent a renaissance in the early ’90s, starting with The Little Mermaid. Then, following some changes in management, the Disney animation began a slow, sad decline. After releasing duds like Brother Bear and Home on the Range, management shut down all traditional 2D animation at Disney, and converted the studios entirely to 3D computer animation. Many conventional animators were retrained in 3D animation, but Disney’s first 3D animation, Chicken Little was still a dud. Following Disney’s acquisition of Pixar several years later, they revived Disney’s beloved 2D animation productions. The result, a charming and enjoyable film called The Princess and The Frog, performed so-so at the box office, and, moreover, the animators’ creative energy was focused on the newer 3D art form [5]. Today, traditional 2D animation at Disney is dead.3 Today, computer animation is a thriving industry, and it thrives in many more places than cel animation ever did: at many different film studios, in visual effects for live-action films, in video games, television studios, web startups, independent web animators, and many more. There are now more types of opportunities for animators than ever 3 Traditional animation styles are still vital in countries like Japan and France that, unlike America, do not believe that animation is just for kids. Even so, their visual styles have evolved considerably due to computer technology. 9 Figure 5: Procedural artworks in the fine art world of galleries and art museums. Left: Electric Sheep, by Scott Draves, evolves dazzling procedural abstract animations based on thousands of votes. Right: The Top Grossing Film of All Time, 1 x 1 (2000) by Jason Salavon, shows the average color of each frame of the movie Titanic. before. The story here is not the destruction of jobs, but the evolution and growth of an art form through technology. This is another story that contradicts the popular notion of art and technology operating in conflict, when, in fact, the opposite is usually true. 2.4 Procedural artwork In the art world, there is a long tradition of procedural artwork. Jean Arp created artworks governed by laws of chance in the 1910s (or so he claimed), and, beginning in the 1950s, John Cage used random rules to compose music. The term Generative Art appears to have originated in the 1960s. Sol LeWitt’s wall drawings are provided as lists of precise instructions; people are still drawing new versions of his paintings after his death [11]. Starting in the 1970’s, classically-trained painter Harold Cohen began exhibiting paintings generated by a program he wrote called AARON [6]. Since the 1980s, many current artists, such as Karl Sims, Scott Snibbe, Golan Levin, Scott Draves, and Jason Salavon, produce abstract artworks by writing computer programs that produce either static images, or create interactive artistic experiences and installation works (Figure 5). In Sims’ and Draves’ work, the artwork “evolves” according to audience input. The popularity of the Processing computer language for artists speaks to the growth of procedural art. In each of these cases, despite the presence of procedural, emergent, and/or crowdsourced elements, the human behind it is credited as the author of the artwork, and it would seem perverse to suggest otherwise. The human has done all of the creative decision-making around the visual style, of designing a framework and process, of testing and evaluating alternative algorithms, and so on. 2.5 State of the art in computer science research Recent developments in computational artistic image synthesis are quite spectacular. But they should not be mistaken for AI artists. 10 (a) (b) Figure 6: Painterly rendering algorithms that process an input photograph, using hand-coded rules and algorithms. (a) Paul Haeberli’s interactive painting system [30]. (b) My automatic painting system [31] processes a photograph without user input aside from selecting some parameter settings. Non-Photorealistic Rendering (NPR) is a subfield of computer graphics research [55] that I have worked in for many years. NPR research develops new algorithms and artistic tools for creating images inspired by the look of a conventional media, such as painting or drawing. Paul Haeberli’s groundbreaking 1990 paper [30] introduced a paint program that began with a user-selected photograph. Whenever the user clicked on the canvas (initially blank), the system placed a brush stroke with color and orientation based on the photograph. In this way, a user could quickly create a simple painting without any particular technical skill (Figure 6(a)). In a follow-up paper, Pete Litwinowcz automated the process entirely, by placing brush strokes on a grid [43]. My own first research paper arose from experimenting with modifications to his algorithm: the method that I came up with places long curved strokes, beginning with a large strokes that were then refined by small details [31] (Figure 6(b)). The algorithm was inspired by my experience with real painting, and the way artists often start from a rough sketch and then refine it. This type of artistic algorithm design reflects the majority of computer graphics research in this area [33, 55]. The algorithms are automated, but we can explain in complete detail why the algorithm works and the intuitions about artistic process it embodies. This mathematical modeling of artistic representation continues the tradition begun in the Renaissance with Filippo Brunelleschi’s invention of linear perspective, a viewpoint I have written about elsewhere [34]. At some point, I found it very difficult to embody richer intuitions about artistic process 11 Figure 7: Our Image Analogies algorithm [35], which stylizes a photograph in the style of a given artwork; in this case, Van Gogh’s Starry Night over the Rhône. Figure 8: The Neural Style Transfer Algorithm [24], which stylizes a photograph in the style of a given artwork; in this case, Van Gogh’s The Starry Night. This algorithm has led to numerous new apps and research in stylization. into source code. Instead, inspired by recent results in computer vision [20], I began to develop a method for working from examples. My collaborators and I published this method in 2001, calling it “Image Analogies” [35]. We presented the work as learning artistic style from example. But the “learning” here was quite shallow. It amounted to rearranging the pixels of the source artwork in a clever way, but not generalizing to radically new scenes or style (Figure 7). Since then, other researchers have improved the method substantially, making it much more robust [23]. In 2016, Leon Gatys and his colleagues published a new breakthrough in this space, Neural Style Transfer [24]. Based on recent advances in neural networks, their method transfers certain neural network correlation statistics from a painting to a photograph, thus producing a new painting of the input photograph (Figure 8). The method is still “shallow” in a sense — there is no “understanding” of the photograph or the artwork — but the method seems to be more robust than the original Image Analogies algorithm. This paper led to a flurry of excitement and new applications, including the popular Prisma app and Facebook’s Live Video stylization, as well as many new research papers improving upon these ideas. This work is ongoing today. Another development which received considerable attention in 2015 was the invention of DeepDreams by Alexander Mordvintsev [46], who, developing a visualization tool for neural networks, discovered that a simple activation excitation procedure produced striking, hallu12 Figure 9: Images that we generated using a neural network trained on different subsets of a database of artistic imagery [71]. Each one is meant to typify a single stylistic category or a medium, though the biases of the convolutional neural network architecture are also evident. cinatory imagery of a type we had never seen before. There are many other current projects, particularly those around Generative Adversarial Networks [28] and Project Magenta at Google [44], that also show promise as new artistic tools. For example, Figure 9 shows images that we generated by visualizing trends learned by a neural network from a large collection of artistic images in different styles. A variety of related images are produced by Creative Adversarial Networks [21]; it is a visual style that seems familiar but not the same as what we are familiar with (and is probably driven, in part, by the biases of the convolutional neural network representation). In each of these cases, the artworks are produced by a human-defined procedure, and the human is the author of the imagery in each case. 2.6 Artificial Intelligence is not intelligent Unfortunately, there has been a considerable amount of media hype around AI techniques; in the news media, algorithms are often anthropomorphized, as if they have the same consciousness as humans (e.g., [72]), sometimes described as artists [51, 19]. In fact, we do not really know what consciousness is (despite many theories), or what it would mean to embody it in an algorithm. Today, the most-successful AI and machine learning algorithms are best thought of as glorified data-fitting procedures [4]. That is, these algorithms are basically like fitting a curve to a set of datapoints, except with very sophisticated ways to fit high-dimensional curves to millions of datapoints. When we as researchers speak of “training” an algorithm, or an algorithm that “learns,” it is easy to misinterpret this as being the same thing as human learning. But these words mean quite different things in the two contexts. In general, “training” a model to learn a task involves careful human effort to formulate the problem, acquire appropriate data, and test 13 different formulations. It is laborious and requires considerable expertise and experimentation. When a new task needs to be solved, the human starts over. Compared to human intelligence, these algorithms are brittle and bespoke. For example, image recognition algorithms, which has undergone breathtaking breakthroughs in the past decade, are now widely used in consumer products. Yet they often fail on inputs that suggest bizarre misunderstandings; the existence and robustness of adversarial examples [66] and procedurally-evolved images [47] demonstrates that these algorithms haven’t really learned anything like human-level understanding. The algorithm has learned no general purpose understanding of the world. It is like a tourist in a foreign country that can repeat and combine phrases from the phrasebook, but lacks true understanding of the language or culture that it is visiting. These systems have no autonomy except within the narrow scope for which they were trained, and typically failsafes must be put in place as well (e.g., Google Photos no longer classifies anything as a “gorilla” because of one high-profile failure [60]). There are, indeed, fascinating parallels between human learning and machine learning, and it does seem likely that humans are, in some way, machines for optimization of evolutionary principles [2, 39, 67]. But going from these high-level analogies to actual machine intelligence is a problem for which the solution is not even on the horizon. 3 How technology changes art Based on this history, I now make several specific claims about how technology changes art. Far from replacing artists, new technologies become new tools for artists, invigorating and changing art and culture. These claims apply equally to current developments in AI as they did to previous developments like photography and animation. 3.1 Algorithms are artists’ tools In every technology that we currently employ — whether photography, film, or software algorithm — the technologies and algorithms we use are basic tools, just like brushes and paint.4 The same is true for the new AI-based algorithms that are appearing. They are not always predictable, and the results are often surprising and delightful — but the same could be said for the way watercolor flows on the page. There is no plausible sense in which current systems reflect “true” artificial intelligence: there is always a human behind the artwork. Applying the same standard to the current research in neural networks and neural style transfer, it would seem equally perverse to assign authorship of their outputs to the software itself. The DeepDream software was authored by a human; another human then selected an 4 This view reflects, I think, the conventional wisdom in the computer graphics research field, which is my research background. This field has always had close ties with certain artistic communities, especially computer animation and visual effects, and, based on this experience, the field is often resistant to attempts to automate creative tasks. In contrast, artificial intelligence researchers use terminology much more aspirationally, historically using words like “intelligence,”” “learning,” and “expert systems” in ways that far simpler than the human versions of these things. 14 input image, and experimented with many parameter settings, running the software over and over until obtaining good results. Indeed, in a recent art exhibition meant to promote these methods and their exploration [68], human artists were credited for each of the individual works. The same process of selection of tools and inputs, adjusting settings and even modifying code, and iterating until a desirable output is produced, occurs in all current computer artworks. There have been a few cases where AI algorithms have been presented as artists or potential artists [10, 58, 19, 51]. For the above reasons, I think this claim misunderstands the nature of procedural art. In short, in our present understanding, all art algorithms, including methods based on machine learning, are tools for artists; they are not themselves artists. 3.2 Technology helps art stay vital Rather than being afraid of the new technologies, we should be enthusiastic about the new artworks that it will enable artists to produce. When we think of art of having external influences, we normally think of social or political influences, but ignore the effect of new tools. In contrast, I argue that, especially in the 19th and 20th Centuries, technological developments have played a pivotal role in advancing art, in keeping it vital and injecting fresh ideas. The stories I gave of photography and cinema include many of examples of this. However, the effect is far more widespread. One of the most important breakthroughs in the history of Western art was the invention of oil paint by Flemish painters such as Jan van Eyck in the 15th century [13]. Previously, painting had been done primarily with tempera, which lack subtle coloration, and fresco, which was very cumbersome to paint. Oil paint had existed in some form for centuries before, but van Eyck and others found new techniques and compounds that gave them a very practical new medium that was fast drying and allowed them to create richer colors, sharp edges, hard surfaces, and a much wider gamut of colors. The rich light and color that we associate with the Northern Renaissance and the Italian Renaissance are due to this technology (Figure 10). In each decade since the 1950s, many of our culturally-important works used technology that had only been invented within the previous ten years. For example, most technology used in today’s feature films did not exist ten years ago (e.g., widespread use of HD digital cameras; facial performance capture); the same goes for artworks using smartphones and crowdsourcing; artworks involving white LEDs and Arduino controllers; DJs performing on stage behind their laptops; and so on. Even the most vérité-seeming romantic comedies frequently involve recent digital video editing and digital backdrops. Conversely, artistic styles that fail to change become stale and lose their cultural relevance; the adoption and exploration of new technology is one of the main ways that art stays vibrant. For example, the introduction of synthesizer music into 1980s pop music created a new sound that was exciting and modern. The sound diversified as the tools improved, until grunge became popular and made the 80s synthpop sound seem superficial and old-fashioned. Nowadays, a recent revival of 70s and 80s instruments by bands like Daft Punk and LCD Soundsystem seems most exciting at times when they are creating new types of music using old instruments. 15 (a) (b) Figure 10: The development of the oil painting technology changed painting as an art form. (a) Fresco painting by Michaelangelo on the Sistine Chapel (ca. 1508). The fresco process was difficult and achieved limited tonal range. Today, fresco is defunct as a medium. (b) Oil painting by Jan van Eyck for the Ghent Alterpiece (ca. 1430). Much richer colors and lighting are possible with oil paint. In contrast, the swing music revival of the 1990s never went anywhere (from bands like Big Bad Voodoo Daddy and Squirrel Nut Zippers) in my opinion, because the bands aped classic styles with classic instruments, without inventing anything particular original themselves. In each era, radical technological innovations are met by artists with both enthusiasm and rejection. For example, when the Moog synthesizer became popular, it was adopted by bigname bands like Emerson, Lake, and Palmer. Other bands felt that twisting knobs to make music was cheating: Queen’s album covers proudly state that the band did not use synthesizers. Robert Moog described one New York musician who said of the instrument “This is the end of the world” [62]. It now seems silly to imagine that people might have ever categorically objected to synthesized music, or to the scratching and sampling of hip-hop DJs, just as it now seems silly that people once rejected waltzing, the Impressionists, and the Rite of Spring as invalid or immoral. In addition to stimulating professional artists, new tools make art more accessible to larger portions of society. Photography was once accessible only to the most determined early adopters, but has continually become easier, faster, and more compact, to the point where nearly everyone carries a mobile phone camera in their pocket or purse. The same goes for the tools of cinematography (from hand-cranked to heavy cameras to Steadicams to handycams to iPhones), and so on. Modern computers give nearly everyone access to digital equivalents of darkrooms, mixing studios, painting studios, and so on; these were formerly highly-specialized technologies requiring laborious effort. 16 Figure 11: Les Paul, inventor the solid-body electric guitar in 1943; Robert Moog, pioneer of the electronic synthesizer, respectively. Their technologies transformed popular music in ways they could not have foreseen. 3.3 The general story of jobs and technology Concerns of how technology displaces jobs have been around since at least the 19th century, when Luddite protesters destroyed mechanical weaving machines, and, in folk songs, John Henry competed against a steam drilling machine. These fears are real and understandable. Yet, despite many technological disruptions, we do not live in a world of massive unemployment caused by technology. This is because, as old roles are erased, many more arise in their stead. But these fears keep recurring, because, at any given time, it is easy to imagine losing specific jobs but it requires superhuman imagination to forecast what new opportunities will be created by transformative new technologies. Nowadays, most of us do jobs that would be hard to even explain in detail to a 19th-century worker. The real workforce concerns should not be about the technology itself, but whether the economic system shares the benefits of new productivity fairly across society versus concentrating wealth only among the very richest [65] and whether machine learning systems are misused to magnify existing forms of inequality [49]. When displacements due to new technology occur, their effects can be eased by social safety nets and better educational foundations (for employment flexibility and retraining). Conversely, a society which fails to distribute wealth and economic gains fairly has much bigger problems than just the impact of AI. Fears of new technology seem to be human nature. I suspect many people view the “normal” state of things as being how they were when they came of age, and they view any significant change as scary. Yet, nearly all of our familiar modern technologies were viewed as threatening by some previous generation. The fear of human-created life has been with us for a long time. Notably, 18th-century scientists discovered electricity. As they searched to understand it, they discovered the life-like effect of galvanism, that the muscles of dead frogs could be stimulated by electrical currents. Had the secret of life been discovered? This inspired Mary Shelley’s novel Frankenstein; or The Modern Prometheus, in which a student uses modern science to create new life [59]. Today, the story is vivid and evocative, but, intellectually, we recognize it as preposterous. The fear of AI is essentially the same irrational fear; SkyNet is Frankenstein’s monster, but with 17 neural networks as the Promethean spark instead of galvanism.5 At present, the Terminator’s autonomous AI is only slightly more plausible than its ability to travel backwards in time. 3.4 Future of AI as tools for artists Some general trends around the evolution of technology and art seem quite robust. As discussed above, current AI algorithms are not autonomous creators, and will not be in the foreseeable future. They are still just tools, ready for artists to explore and exploit. New developments in these tools will be enthusiastically adopted by some artists, leading to exciting new forms and styles that we cannot currently foresee. It is possible that some tasks performed by human artists will gradually fade out, but these will generally be mechanical tasks that do not require much creativity because they fill societal functions other than artistic expression. Some traditional arts may fade simply due to seeming old-fashioned. This is the nature of art: nothing is fresh forever, which is not to be blamed on technology. But, conversely, new technologies will enable new styles, aesthetics, and job descriptions. Novices will have access to new simplified tools for expression. Artistic technology is a “imagination amplifier” [8] and better technology will allow artists to see even further than before. Aside from general trends, it is hard to make specific predictions about the art of the future. Les Paul, who invented the solid-body guitar in the 1940s, himself primarily performed light pop, country, and showtunes, and could hardly have predicted how the electric guitar would be used by, say, Led Zeppelin, just as it’s hard to imagine Daguerre predicting Instagram. More generally, making predictions about how AI technologies might transform society is very hard because we have so little understanding of what these technologies might actually be [4]. Even the science fiction writers of the 1950s and 1960s completely failed to imagine the transformative power of the Internet and mobile computing [40]; for them, the computers of the future would still be room-scale monstrosities that one had to sit in front of to operate. But they did predict moon colonies and replicants by 2018. In short, we cannot predict what new inventions and ideas artists will come up with in the future, but we can predict that they will be amazing, and they will be amazing because they make use of technology in new, unpredictable ways. 4 What is an Artist? So far, I have described how computer technologies are currently accepted as tools for artists, not as artists themselves. Why is this? After all, computers can do other human tasks like speak, search, print, navigate, and, to some extent, drive cars. There are several obvious reasons why computers don’t make art, including tradition, the incentives involved, and the relatively predictable nature of existing automation. But, still one could imagine an alternate history in 5 In fact, Frankenstein is presented as a cautionary tale about the quest for knowledge in general. Victor Frankenstein tells his story as a warning when he learns that Captain Walton is himself driven by an obsessive quest for knowledge that is entirely unrelated to Frankenstein’s. 18 which some machines or computer programs had already been called artists. I believe there is a more fundamental reason, which explains not just why this has not happened, but why it is unlikely to happen anytime soon. In this section, I theorize about what are the prerequisites for being an artist. I will then apply this discussion to AI in the next section. 4.1 Art is social “What an artist is trying to do for people is bring them closer to something, because of course art is about sharing: you wouldn’t be an artist if you didn’t want to share an experience, a thought.” – David Hockney [36] Why do we create and consume art? I argue that art is primarily a social behavior: art is about communication and displays between people. For example, people often speak of art as being about personal expression, which is an act of communication. I am directly inspired by the theory, going back to Charles Darwin, that art-making is an adaptive product of our biological evolution. [17] sets out a persuasive argument for this theory, which I briefly summarize, though I cannot do it full justice. Creating art served several functions for our Pleistocene ancestors. Art-making served as a fitness signal for mating and sexual selection. Art can also be used as displays of wealth and status. Storytelling, music, and dance strengthen social bonds within a group. Storytelling additionally plays a very important role of communicating information that would otherwise be hard to share. I observe that each of these functions of art is social: art arose as forms of communication, displays, and sharing between people. Although art takes many different forms in different cultures today, each of these forms serves one or more of the same basic social functions that it did in the Pleistocene. I generalize this theory beyond humans to hypothesize: art is an interaction between social agents. A “social agent” is anything that has a status akin to personhood; someone worthy of empathy and ethical consideration. Many of our other behaviors are interactions between social agents, such as gifts, conversation, and social relationships like friendship, competition, and romance. In contrast, while we can get emotionally attached to our computers and other possessions, we feel no real empathy for their needs, and no ethical duty toward them. Possessions can participate only in shallow versions of these interactions. For example, we frequently talk about our possessions with statements like “The brakes on my bicycle were complaining so I gave it a new pair as a gift and now it’s much happier. I love my bike.” This statement indicates emotional attachment but not true empathy with the bike’s feelings, despite the anthropomorphizing language. We don’t live in a social hierarchy with our possessions: we do not compete with them for status, or try to impress them. We care about what other people have to say because we care about other people; we care about what computers have to say only insofar as it is useful to us. We generally treat conversational agents (like Siri and Alexa) as user interfaces to software, not like people. Art-making does also have non-social benefits to the artist. For example, art-making can 19 help practice skills like dexterity and problem solving. Creating art is often pleasurable or meditative in itself. But these benefits are secondary to their social benefits: they are not the reasons that evolution has produced art as a human activity. Similarly, one may also talk or sing to oneself while alone, but talking and singing are still fundamentally social activities. Note that the evolutionary argument here is optional; one can discuss whether art is fundamentally social without it. But I believe that the evolutionary view of art gives some additional understanding. 4.2 Non-Human Authors As we have seen, despite many technological advances, current algorithms are not accepted as artists. There are a few other existing examples where objects are created by authors or processes that are not human-driven. These give some support to this theory. Natural processes. Natural processes, including landscapes like the Grand Canyon or the HuangShan Mountains, are not considered art, even though they may be extraordinarily beautiful and change one’s perspective immensely. Beautiful structures made instinctively by animals, such as honeycombs and coral, are not considered art. This indicates that simply creating complex and beautiful outputs is not itself sufficient for art, since there is no creative social communication in these cases. Animals. Some higher mammals, including chimpanzees, elephants, and dolphins, have been trained to paint [14, 17]. Many writers are skeptical of animal-made art. Typically, the animal’s owner or handler steers the process, letting the animal throw paint on the canvas, then stopping the painting when they believe it is done, then selecting which works to show; the animals seem to show no interest in the artwork afterward. Animal artwork has not had any significant cultural impact or popularity; it seems to have been largely the product of media stunts. (People for the Ethical Treatment of Animals have recently tried to claim copyright in favor of a monkey, but failed [45], as US copyright law only allows humans to claim copyright.) The most interesting aspect of this discussion is not whether animals can create art, but how we decide. Discussions of whether animal-made artifacts are art are not based on a priori rules whether animals can be artists. Instead, they are attempts to study the evidence of the animal’s behavior around the artwork, and, from that, to infer whether the artwork is some form of inner expression [14], or an artifact that the animal has a special appreciation for [17]. In other words, we are open to the idea of animals creating art, because they can have social relationships with us. It’s just that we haven’t found any other creature that satisfies our criteria for creating art, whatever they are. 4.3 Judging the work instead It is tempting to judge whether a computer is an artist based solely on the merits of the work that it produces. In this hypothesis, whether or not a computer can be an artist is a judgment of the 20 Figure 12: Not art. (a) Beautiful landscapes are not considered art. (b) Pierre Brassau, the monkey painter. He was part of a 1963 hoax that satirized modern art. quality of the work that it produces, independent of the properties of the computer itself. If an algorithm outputs a continual stream of diverse, stimulating, beautiful, and/or skillful outputs, without many duds, we might be quite tempted to call this algorithm an artist. The better computer-generated art becomes, the more we will hear questions about whether computers are artists. Skill is clearly not the real requirement for someone or something to be an artist. Any human can make art, including unskilled amateurs and children. Conversely, computers can already be programmed to create infinite sequences of dazzling realistic or abstract imagery, exhibiting technical proficiency way beyond the typical human’s. I suspect that, when we look at a computer’s output and ask “is this work good enough to call the computer is an artist?”, we are not actually judging the quality of the work per se. Instead, we are really looking for evidence that the system itself is intelligent, conscious, and feeling: traits that we associate with social agents. No matter how skillful and surprising a computer’s output is, we will not accept it as an artist until we infer some sort of social being inside. 4.4 An Intent Machine Another hypothesis is as follows: in the modern art world, the role of the artist is to supply the “intent” and the “idea” for the work; it is not necessary for the artist to execute on the work, other than coordinating in its production. For humans, this is clearly true in numerous examples, such as those in Section 2.4, as well as appropriation works like Duchamp’s Readymades and Richard Prince’s questionable Instagram reproductions; artists can also employ helpers or crowdworkers, such as in Scott Draves’ Electric Sheep and Aaron Koblin’s Sheep Market [38]. Consequently, for a computer to be an artist it simply needs to supply an intent. It is easy to imagine designing a system that creates intent and even coordinates the labor of producing a work. For example, one could write a simple procedural algorithm to generate very basic intents (e.g., “portray ominous landscape”), or sample intents from a Recursive Neural 21 Network trained on artists’ statements scraped from the web. Or the method could randomly select some news item, photograph, or historical event, and randomly sample some attitude toward that thing. Starting from this intent, crowdworkers could be used to refine the idea and convert it into a new image, similar to systems like Soylent [3]. One could also automate steps of the process, e.g., using GANs [28] to generate entirely new starting images from scratch. Crowdworkers could also be used to rate and evaluate the outputs of the system, selecting just the best results and discarding the rest. Final steps of the process could also automatically hire professional designers, e.g., from sites like Upwork or 99Designs. This system could then run continuously, generating new images over time (with payment being automatically made to the crowdworkers involved). Workers could group images with common themes and intents, and create separate collections around these themes. Artist’s statements could generated around these themes. The system’s preferences could grow and adapt over time as more data are gathered or external data streams (e.g., photography blogs) change. Suppose someone were to build this system, calling it, say, The Intent Machine, and exhibits its work in an art show or gallery. Suppose, moreover, they convinced the curator or gallery owner to credit The Intent Machine with authorship of the works it’d created, but fully disclosed the procedure by which it worked. Would people credit it as the artist who had authored its works, or would they say that the system-builder is the real artist here? I believe that, in general, the consensus would be that the system-builder is the real artist here, and that this is really an artwork about probing the nature of computer-generated art, or the nature of the commercial artworld. Note that the procedure used to define the system is not fundamentally different than any other procedural computer-generated art algorithm (as in Sections 2.4 and 2.5). Even if the work itself ended up being quite good, viewers would ask why it is good, and it is doubtful that the computer’s own contribution would be judged as significant beyond those of the humans involved. Are artists just “intent machines”? If art is a social act, then the answer is no. 4.5 Creativity and Growth Finally, two related criteria that have intuitive appeal are the notions of creativity and growth. They are important for human artists, so perhaps they should be for AI artists as well. Several authors have proposed energy terms or criteria for creativity [47, 21]. These are often attempts to express the idea that the system’s output should somehow “surpass” the human programmer and/or the training data. For example, [9] proposes that we judge the creativity of a system, in part, by whether the system’s output surprises the system’s author. I believe that this is too weak a criterion, since many mechanical or algorithmic phenomena may be surprising to their own discoverer or author at first. For example, the basic algorithm that produces Mandelbrot set images can be specified in a single sentence,6 yet produces dazzling animations of infinite complexity.7 The Mandelbrot set is very surprising and produces beautiful, Color the image location (x, y) proportional to the number of steps the iteration zn+1 = zn2 + x + yi requires to reach |z| ≥ τ , starting from z1 = 0, where τ is a large constant. 7 For example: https://www.youtube.com/watch?v=PD2XgQOyCCk 6 22 unprecedented images, but we do not call its iteration equation creative, or an artist. All current procedural art systems, such as the Mandelbrot set, have a recognizable style, and, after awhile, lose their novelty. I believe that the same will be true for systems specifically designed with “creativity” objectives [21, 47]. Unlike human artists, these systems do not grow or evolve over time. Perhaps an AI artist would need to exhibit some form of growth. For example, Harold Cohen, the fine-art painter who began, in 1968, to write software to generate art, described the evolution of his views: “Ten years after [1968], I would have said ‘look, the program is doing this on its own.’ ... Another ten years on and I would have said ‘the fact that it is the program who is doing this on its own is the central issue here,’ denoting my belief in the program’s potential and growing autonomy over the whole business of art-making. ... It was producing complex images of a high quality and I could have had it go on forever without rewriting a single line of code. How much more autonomous than that can one get? ... [But] it’s virtually impossible to imagine a human being in a similar position. The human artist is modified in the act of making art. For the program to have been similarly self-modifying would have required not merely that it be capable of assessing its own output but that it had its own modifiable worldview ...” [7] In any existing system, it is easy to think of trivial ways for the system to evolve and change over time, e.g., subtly change the color palette or the training data over the years. Superficial growth is easy; meaningful growth is hard to even define for a computer AI. If someone could design a system that produces a sequence of art that is meaningful to people and also significantly evolves over time, that would be truly remarkable. It seems hard to imagine achieving this without enormous technological advances — it may not be possible without true AI or social AI in some form. 4.6 Definitions of Art For guidance about the nature of art, we could have also looked to existing definitions of art. However, there is no Royal Society that prescribes what is and what is not valid art. Instead, art is a phenomenon that results from the interplay of cultural institutions and the general population that we can analyze, and it changes over time. Philosophers have attempted to devise concise definitions of art that include all existing types (music, dance, painting, etc.) and styles of art. The Institutional Definition, originated in the 1960s in response to conceptual art, states, roughly, that art is anything in a style that is broadly accepted as art [12, 15, 42]. A more fine-grained approach is to identify attributes common to many different types of art [25, 26, 16, 17]. Each of these definitions of art is an attempt to fit the data, and draw a line between those things that we call art (like theatre) and those that we do not (like spectator sports). Understandably, these definitions all assume that the artist is always human, without exploring much whether non-humans can create art, and thus don’t provide much guidance for this discussion. 23 5 Will an AI ever be an artist? With this background, I now turn to speculating about the future. As we have seen, authorship of all current algorithmic art is assigned to the human author behind the algorithms. Will we ever say that an AI itself created art? Will we ever recognize a piece of software as the author of a work of art? Human-Level AI. If we ever develop AI with human-level artificial intelligence and consciousness, by definition, it would be able to create art, since it would have the same capacity for consciousness, emotions, and social relationships. But, as discussed in Section 2.6, this scenario is science fiction and we have no idea if this is possible or how it would be achieved. Making meaningful predictions about a world with “true AI” is impossible [4], because we have so little idea of how specifically this AI would actually operate. Moreover, this AI would transform society so much as to make it unrecognizable to us. We may as well speculate about what kind of artwork is made by aliens from outer-space — if do we ever meet them, we will have more pressing questions than what kind of music they like. Hence, the interesting question is whether there could be computer-authored artwork without human-level artificial intelligence or consciousness. Social AI. If, as I have argued, creating art is a fundamentally social act of expression and communication, then it follows that AI can be granted authorship when we view the AI as a social agent, and it is performing some communication or sharing through the art. What does it mean for us to view an AI as a social agent? We have to view the AI as deserving of empathy and ethical consideration in some way. However, the AI does not need human-level intelligence; just as we have social relationships with our pets. But we do expect that the AI has something to say socially, that suggest an inner consciousness and feeling. Short of true intelligence (the science fiction scenario), I think that the only way this can happen is through “shallow AI” agents. People are sometimes “fooled” by shallow AI. The classic example is Eliza, a simple text-based psychiatrist program developed in 1964, based on simple pattern-matching and repetition of what the user types [70]. It was meant as a demonstration of the superficiality of the AIs of the time, but, unexpectedly, many people attributed human-like emotions to the machine. Since then, there are many anecdotes of people being fooled by “chatbots” in online settings [18, 22], including the recent plague of Twitter bots [37]. But, once the veil is lifted, it is clear that these chatbots don’t exhibit real intelligence. Some software and robots have been designed to have relationships with their owners, including talking baby dolls, Tamagotchi, and Paro therapeutic baby seals. A related effect is that people behave toward their computers as if they were social agents in certain ways [53], even when they don’t believe that they are intelligent. For example, dialogue systems like Siri and Alexa all use female voices by default, based on many findings that male and female users both respond better to female voices [29, 53]. Perhaps, for many users, the system doesn’t need to be truly intelligent, it just has to be perceived as a social agent, like a Siri or Alexa that you can ask to make you an artwork 24 [73]. The day may come in which these agents are so integrated into our daily lives that we forget that they are carefully-designed software. One can easily imagine the development of AI that simulates emotion and affection toward the user; it is easy to imagine, for example, a toy doll that paints pictures for its owner along as one of many behaviors designed to display companionship and affection. Non-social AI. It seems possible that non-social algorithms could be successfully promoted as artists; there have been a few tentative forays in this direction, e.g., [10, 21]. For the reasons given above, I am skeptical that such methods will be accepted as true artists without some plausible belief about their underlying social and/or conscious attributes. Perhaps a curator at a well-known museum would download or otherwise acquire various artifacts from software “artists,” and list the software systems as the authors. There would be controversy, and discussion in newspapers and journals. Perhaps other curators and galleries would follow suit. Perhaps people would find enough value in these computer-generated artworks, while also being convinced that no human could be rightly given credit for their works. This sort of process has happened for things like abstract expressionism, and not for chimpanzee art. Could it happen for computer art? Suitcase words. The term “artist” could come to be used as having multiple meanings, just as words like “intelligence” and ”learning” have come to mean something different for humans than they do for algorithms [4]. A software program that, say, automatically stylizes your photos, could be called an “artist” in the same way that software applications like “calendar” and “mail” programs have replaced their physical-world namesakes. Unfortunately, the use of the same word to mean different things in different contexts causes endless confusion, as discussed in Section 2.6. Dangers. A continual danger of new AI technology is that human users misunderstand the nature of the AI [49]. When we call a shallow AI an “artist,” we risk seriously misleading or lying to people. I believe that, if you convince people that an AI is an artist, then they will also falsely attribute emotions, feelings, and ethical weight to that AI. If this is true, I would argue that calling such AIs “artists” is unethical. It leads to all sorts of dangers, including overselling the competence and abilities of the AI, to misleading people about the nature of art. It seems likely that some companies will not have any scruples about this. For example, Hanson Robotics has promoted (in many contexts) a social robot as a truly intelligent being, even though it is clearly nothing more than a “chatbot with a face” [27] or, in Yann LeCun’s words, a “Potemkin AI” [69]. A related concern is that we deprive the AI’s designer(s) of authorship credit. At present, we credit the author of a piece of automatic software with the output of that software. This usually acknowledges the skill and effort required to engineer and iterate with software so that it produces good outputs. Artistic credit is important for understanding the real sources of how something was made. 25 Outside of science fiction, I can see no positive benefit to calling a computer an artist, but I do see dangers. Conclusion I do not believe that any software system in our current understanding could be called an “artist.” Art is a social activity. I mean this as a warning against misleading oneself and others about the nature of art. Of course, the ambitious reader could take this as a challenge: I have laid out some of the serious objections that you must overcome if you wish to create a software “artist.” I don’t think it can be done anytime soon, but I also know that proving critics wrong is one of the ways that art and science advance. One of my main goals in this essay has been to highlight the degree to which technology contributes to art, rather than being antagonistic. We are lucky to be alive at a time when artists can explore ever-more-powerful tools. Every time I see an artist create something wonderful with new technology, I get a little thrill: it feels like a new art form evolving. Danny Rosin’s Wooden Mirror, Jason Salavon’s The Top Grossing Film of All Time, 1x1, Bob Sabiston’s Snack and Drink, Michel Gondry’s Like A Rolling Stone, Kutiman’s ThruYOU, Amon Tobin’s Permutation, Ian Bogost’s Cow Clicker, Christian Marclay’s video installations, Íñigo Quilez’s procedural renderings, and Wesley Allsbrook’s and Goro Fujita’s Virtual Reality paintings are a few examples of artworks that have affected me this way over the years. Today, through GitHub and Twitter, there is an extremely fast interplay between machine learning researchers and artists; it seems like, every day, we see new tinkerers and artists Tweeting their latest creative experiments with RNNs and GANs (e.g., @JanelleCShane, @helena, @christophrhesse, @quasimondo). Art maintains its vitality through continual innovation, and technology is one of the main engines of that innovation. Occasionally, the avant garde has tremendous cultural impact: electronic music and sampling was once the domain of experimental electronic and musique concrète pioneers, like Wendy Carlos and Delia Darbyshire. Likewise, at one time, computeranimated films could only be seen at obscure short-film festivals. Today, we are seeing many intriguing and beguiling experiments with AI techniques, and, as artists’ tools, they will surely transform the way we think about art in thrilling and unpredictable ways. Acknowledgements. Thanks to Shira Katz, Craig Kaplan, and Dani Oore for valuable comments on the manuscript. Thanks to everyone who shared discussion and/or encouragement online, including Aseem Agarwala, Mark Chen, Lyndie Chiou, Michael Cohen, James Landay, Nevena Lazic, Jason Salavon, Adrien Treuille, and many others. References [1] AG ÜERA Y A RCAS , B. Art in the Age of Machine Intelligence. Arts 6, 4 (2017). 26 [2] A LEXANDER , R. M. Optima For Animals. Princeton University Press, 1996. [3] B ERNSTEIN , M. S., L ITTLE , G., M ILLER , R. C., H ARTMANNN , B., ACKERMANN , M. S., K ARGER , D. R., C ROWELL , D., AND PANOVICH , K. Soylent: A Word Processor with a Crowd Inside. In Proc. UIST (2010). [4] B ROOKS , R. The Seven Deadly Sins of AI Predictions. MIT Technology Review (2017). [5] C ATMULL , E., AND WALLACE , A. Creativity, Inc: Overcoming the Unseen Forces that Stand in the Way of True Inspiration. Random House, 2014. [6] C OHEN , H. The further exploits of AARON, painter. Stanford Humanities Review 4, 2 (1995). [7] C OHEN , H. ACM SIGGRAPH Awards - Harold Cohen, Distinguished Artist Award for Lifetime Achievement, 2014. https://youtu.be/_Xbt8lzWxIQ?t=13m20s. [8] C OHEN , M. F. Imagination amplification. IEEE Comp. Graph. & App. (2000). [9] C OLTON , S. Creativity Versus the Perception of Creativity in Computational Systems. In Proc. AAAI spring symposium: creative intelligent systems (2008). [10] C OLTON , S. The Painting Fool: Stories from Building an Automated Painter. In Proc. Computers and Creativity (2012). [11] C OTTER , H. Now in Residence: Walls of Luscious Austerity. The New York Times (2008). [12] DANTO , A. The Artworld. The Journal of Philosophy 61, 19 (1964). [13] DE LA C ROIX , H., TANSEY, R. G., AND K IRKPATRICK , D. Gardner’s Art Through The Ages, 9 ed. Harcourt Brace, 1991. [14] D ESMOND , J. Zoos make money selling paintings made by animals. Are they art? The Washington Post (2016). [15] D ICKIE , G. Defining Art. American Philosophical Quarterly 6, 3 (1969). [16] D UTTON , D. But They Don’t Have Our Concept of Art. In Theories of Art Today, N. Carroll, Ed. University of Wisconsin Press, 2000. [17] D UTTON , D. The Art Instinct: Beauty, Pleasure, and Human Evolution. Bloomsbury Press, 2009. [18] DVORSKY, G. Computer Science Students Fooled By Artificially Intelligent TA. Gizmodo (2016). 27 [19] DVORSKY, G. This Artificially Intelligent Robot Composes and Performs Its Own Music. Gizmodo (2017). [20] E FROS , A. A., AND L EUNG , T. Texture synthesis by non-parametric sampling. In Proc. International Conference on Computer Vision (1999). [21] E LGAMMAL , A., L IU , B., E LHOSEINY, M., AND M AZZONE , M. CAN: Creative Adversarial Networks Generating “Art” by Learning About Styles and Deviating from Style Norms. In Proc. Int. Conf. on Computational Creativity (2017). [22] E PSTEIN , R. From Russia, with Love. Scientific American Mind (2007). [23] F I ŠER , J., JAMRI ŠKA , O., L UK Á Č , M., S HECHTMAN , E., A SENTE , P., L U , J., AND S ÝKORA , D. StyLit: Illumination-guided Example-based Stylization of 3D Renderings. ACM Trans. on Graphics (SIGGRAPH) 35, 4 (July 2016), 92:1–92:11. [24] G ATYS , L. A., E CKER , A. S., AND B ETHGE , M. Image Style Transfer Using Convolutional Neural Networks. In Proc. Computer Vision and Pattern Recognition (2016). [25] G AUT, B. Art as a Cluster Concept. In Theories of Art Today, N. Carroll, Ed. University of Wisconsin Press, 2000. [26] G AUT, B. The Cluster Account of Art Defended. The British Journal of Aesthetics (2005). [27] G ERSHGORN , D. Inside the mechanical brain of the worlds first robot citizen. Quartz (2017). [28] G OODFELLOW, I. J., P OUGET-A BADIE , J., M IRZA , M., X U , B., WARDE -FARLEY, D., O ZAIR , S., C OURVILLE , A., AND B ENGIO , Y. Generative Adversarial Nets. In Proc. Neural Information Processing Systems (2014). [29] G RIGGS , B. Why computer voices are mostly female. CNN (2011). [30] H AEBERLI , P. Paint By Numbers: Abstract Image Representations. In Proc. SIGGRAPH (1990). [31] H ERTZMANN , A. Painterly Rendering with Curved Brush Strokes of Multiple Sizes. In Proc. SIGGRAPH (1998). [32] H ERTZMANN , A. Algorithms for Rendering in Artistic Styles. PhD thesis, New York University, 2001. [33] H ERTZMANN , A. A Survey of Stroke-Based Rendering. IEEE Computer Graphics & Applications 23, 4 (2003). [34] H ERTZMANN , A. Non-Photorealistic Rendering and the Science of Art. In Proc. NPAR (2010). 28 [35] H ERTZMANN , A., JACOBS , C. E., O LIVER , N., C URLESS , B., Image Analogies. In Proc. SIGGRAPH (2001). AND S ALESIN , D. H. [36] H OCKNEY, D. That’s the way I see It. Chronicle, 1996. [37] K ESSLER , S. How Twitter Bots Fool You Into Thinking They Are Real People. Fast Company (2014). [38] KOBLIN , A. M. The Sheep Market. In Proc. Creativity and Cognition (2009), pp. 451– 452. [39] KOERDING , K. P., AND W OLPERT, D. M. Bayesian decision theory in sensorimotor control. Trends in Cognitive Sciences 10, 7 (2006), 319 – 326. Special issue: Probabilistic models of cognition. [40] K RAUSS , L. Why Science-Fiction Writers Couldn’t Imagine the Internet. Slate (2017). [41] L ASSETER , J. Principles of traditional animation applied to 3d computer animation. In Proc. SIGGRAPH (1987). [42] L EVINSON , J. Defining art historically. The British Journal of Aesthetics 19, 3 (1979). [43] L ITWINOWICZ , P. Processing Images and Video for an Impressionist Effect. In Proc. SIGGRAPH (1997). [44] M ETZ , C. How A.I. Is Creating Building Blocks to Reshape Music and Art. The New York Times (2017). [45] M ILLWARD , D. Monkey selfie case: British photographer settles with animal charity over royalties dispute. The Telegraph (2017). [46] M ORDVINTSEV, A., O LAH , C., AND T YKA , M. Inceptionism: Going Deeper into Neural Networks. Google Research Blog (2015). [47] N GUYEN , A., YOSINSKI , J., AND C LUNE , J. Understanding Innovation Engines: Automated Creativity and Improved Stochastic Optimization via Deep Learning. Evolutionary Computation 24, 3 (2016). [48] N ICHOLAS , G. These stunning A.I. Tools Are About to Change the Art World. Slate (2017). [49] O’N EIL , C. Weapons of Math Destruction: How Big Data Increases Inequality and Threatens Democracy. Crown, 2016. [50] PAIK , K. To Infinity and Beyond! The story of Pixar Animation Studios. Chronicle Books, 2007. [51] P EREZ , S. Microsoft’s new drawing bot is an AI artist. TechCruch (2018). 29 [52] P RICE , D. A. The Pixar Touch. Vintage, 2008. [53] R EEVES , B., AND NASS , C. The Media Equation: How People Treat Computers, Television, and New Media Like Real People and Places. CSLI, 1996. [54] ROSENBLUM , N. A World History of Photography. Abbeville Press, 1984. [55] ROSIN , P., AND C OLLOMOSSE , J. Image and Video-Based Artistic Stylisation. Springer, 2013. [56] RUBIN , M. Droidmaker: George Lucas and the Digital Revolution. Triad, 2005. [57] S CHARF, A. Art and Photography. Penguin, 1968. [58] S HEIN , E. Computing the Arts. Commun. ACM 60, 4 (2017). [59] S HELLEY, M. W. Frankenstein; or, the Modern Prometheus. Lackington, Hughes, Harding, Mavor & Jones, 1818. [60] S IMONITE , T. When it comes to gorillas, Google Photos remains blind. Wired (2018). [61] S NOW, C. P. The Two Cultures. London: Cambridge University Press, 1959. [62] S NOWDEN , D. Robert Moog: ’I wouldn’t call this music’ a classic interview to mark a Google doodle. The Guardian (2012). [63] S TERLING , B. An Essay on the New Aesthetic. WIRED (2012). [64] S TERNBERGER , P. S. Between Amateur & Aesthete: The Legimitization of Photography as Art in America, 1880-1900. University of New Mexico Press, 2001. [65] S TIGLITZ , J. E. The Price of Inequality. Norton, 2012. [66] S ZEGEDY, C., Z AREMBA , W., S UTSKEVER , I., B RUNA , J., E RHAN , D., G OODFEL LOW, I., AND F ERGUS , R. Intriguing properties of neural networks. In Proc. Int. Conf. on Learning Representations (2014). [67] T ENENBAUM , J. B., K EMP, C., G RIFFITHS , T. L., AND G OODMAN , N. D. How to Grow a Mind: Statistics, Structure, and Abstraction. Science (2011). [68] T YKA , M. Exploring the Intersection of Art and Machine Intelligence. Google Research Blog (2016). [69] V INCENT, J. Facebooks head of AI really hates Sophia the robot (and with good reason). The Verge (2018). [70] W EIZENBAUM , J. ELIZA–a computer program for the study of natural language communication between man and machine. Comm. of the ACM (1966). 30 [71] W ILBER , M. J., FANG , C., J IN , H., H ERTZMANN , A., C OLLOMOSSE , J., AND B E LONGIE , S. BAM! The Behance Artistic Media Dataset for Recognition Beyond Photography. In Proc. International Conference on Computer Vision (2017). [72] W ILSON , M. AI Is Inventing Languages Humans Can’t Understand. Should We Stop It? Fast Company (2017). [73] X U , T., Z HANG , P., H UANG , Q., Z HANG , H., G AN , Z., H UANG , X., AND H E , X. AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks, 2017. arXiv:1711.10485. 31
2cs.AI
Hypothesis Testing via Affine Detectors Anatoli Juditsky ∗ Arkadi Nemirovski † arXiv:1604.02576v4 [math.ST] 1 Oct 2016 Abstract In this paper, we further develop the approach, originating in [13], to “computation-friendly” hypothesis testing via Convex Programming. Most of the existing results on hypothesis testing aim to quantify in a closed analytic form separation between sets of distributions allowing for reliable decision in precisely stated observation models. In contrast to this descriptive (and highly instructive) traditional framework, the approach we promote here can be qualified as operational – the testing routines and their risks are yielded by an efficient computation. All we know in advance is that, under favorable circumstances, specified in [13], the risk of such test, whether high or low, is provably near-optimal under the circumstances. As a compensation for the lack of “explanatory power,” this approach is applicable to a much wider family of observation schemes and hypotheses to be tested than those where “closed form descriptive analysis” is possible. In the present paper our primary emphasis is on computation: we make a step further in extending the principal tool developed in [13] – testing routines based on affine detectors – to a large variety of testing problems. The price of this development is the loss of blanket near-optimality of the proposed procedures (though it is still preserved in the observation schemes studied in [13], which now become particular cases of the general setting considered here). 1 Introduction This paper can be considered as an extension of [13] where the following simple observation was the starting point of numerous developments: Imagine that we want to decide on two composite hypotheses about the distribution P of a random observation ω taking values in observation space Ω, i-th hypothesis stating that P ∈ Pi , where Pi , i = 1, 2, are given families of probability distributions on Ω. Let φ : Ω → R be a detector, and let the risk of detector φ be defined as the smallest ǫ⋆ such that Z Z −φ(ω) eφ(ω) P (dω) ≤ ǫ⋆ ∀P ∈ P2 . (1) e P (dω) ≤ ǫ⋆ ∀P ∈ P1 & Ω Ω K Then the test T which, given PK K i.i.d. observations ωt ∼ P ∈ P1 ∪ P2 , t = 1, ..., K, deduces that P ∈ P1 when t=1 φ(ωt ) ≥ 0, and that P ∈ P2 otherwise, accepts the true hypothesis with P -probability at least 1 − ǫK ⋆ . It was shown in [13] that ∗ LJK, Université Grenoble Alpes, B.P. 53, 38041 Grenoble Cedex 9, France, [email protected] Georgia Institute of Technology, Atlanta, Georgia 30332, USA, [email protected] The first author was supported by the CNRS-Mastodons project GARGANTUA, and the LabEx PERSYVAL-Lab (ANR-11-LABX-0025). Research of the second author was supported by NSF grants CMMI-1262063, CCF-1523768. † 1 1. the detector-based tests are “near optimal” – if the above hypotheses can be decided upon by a single-observation test T ∗ with risk δ < 1/2, there exists a detector φ with “comparable” risk p ǫ⋆ = 2 δ(1 − δ). p Note that while the risk 2 δ(1 − δ) seems to be much larger than δ, especially for small δ, we can “compensate” for risk deterioration passing from the single-observation test T 1 associated with the detector φ to the test T K based on the same detector and pusing K Kobservations. The K K risk of the test T , by the above, is upper-bounded by ǫ⋆ = [2 δ(1 − δ)] and thus is not worse than the risk δ of the “ideal” single-observation test already for a “quite moderate” value 2 ⌋ 1−ln(4(1−δ))/ ln(1/δ) ⌊ of K. 2. There are “good,” in certain precise sense, parametric families of distributions, primarily, • Gaussian N (µ, Id ) distributions on Ω = Rd , • Poisson distributions with parameters µ ∈ Rd+ on Ω = Zd ; the corresponding random variables have d independent entries, j-th of them being Poisson with parameter µj , • Discrete distributions on {1, ..., d}, the parameter µ of a distribution being the vector of probabilities to take value j = 1, ..., d, for which the optimal (with the minimal risk, and thus – near-optimal by 1) detectors can be found efficiently, provided that Pi , i = 1, 2, are convex hypotheses, meaning that they are cut off the family of distributions in question by restricting the distribution’s parameter µ to reside in a convex domain. 1 On a closer inspection, the “common denominator” of Gaussian, Poisson and Discrete families of distributions is that in all these cases the minimal risk detector for a pair of convex hypotheses is affine,2 and the results of [13] in the case of deciding on a pair of convex hypotheses stemming from a good family of distributions sum up to the following: A) the best – with the smallest possible risk – affine detector, same as its risk, can be efficiently computed; B) the smallest risk affine detector from A) is the best, in terms of risk, detector available under the circumstances, so that the associated test is near-optimal. Note that as far as practical applications of the above approach are concerned, one “can survive” without B) (near-optimality of the constructed detectors), while A) is a must. In this paper, we focus on families of distributions obeying A); this class turns out to be incomparably larger than what was defined as “good” in [13]. In particular, it includes nonparametric families of distributions. Staying within this much broader class, we still are able to construct in a computationally efficient way the best affine detectors for a pair of “convex”, in certain precise sense, hypotheses, along with valid upper bounds on the risks of the detectors. What we, in general, cannot claim anymore, is that the tests associated with the above detectors are near-optimal. This being said, we believe that investigating possibilities for building tests and quantifying their performance in a computationally friendly manner is of value even when we cannot provably guarantee near-optimality of these tests. 1 In retrospect, these results can be seen as a development of the line of research initiated by the pioneering works of H. Chernoff [9], C. Kraft [16], and L. Le Cam [17], further developed in [1, 2, 3, 4, 7, 8] among many others (see also references in [15]). 2 affinity of a detector makes sense only when Ω can be naturally identified with a subset of some Rd . This indeed is the case for Gaussian and Poisson distributions; to make it the case for discrete distributions on {1, ..., d}, it suffices to encode j ≤ d by j-th basic orth in Rd , thus making Ω the set of basic orths in Rd . With this encoding, every real valued function on {1, ..., d} becomes affine. 2 The paper is organized as follows. The families of distributions well suited for constructing affine detectors in a computationally friendly fashion are introduced and investigated in section 2. In particular, we develop a kind of fully algorithmic “calculus” of these families. This calculus demonstrates that the families of probability distributions covered by our approach are much more common commodity than “good observation schemes” as defined in [13]. In section 3 we explain how to build within our framework tests for pairs (and larger tuples) of hypotheses and how to quantify performance of these tests in a computationally efficient fashion. Aside of general results of this type, we work out in detail the case where the family of distributions giving rise to “convex hypotheses” to be tested is comprised of sub-Gaussian distributions (section 3.2.3). In section 4 we discuss an application to the now-classical statistical problem – aggregation of estimators – and show how the results of [12] can be extended to the general situation considered here. Finally, in section 5 we show how our framework can be extended in the Gaussian case to include quadratic detectors. To streamline the presentation, all proofs exceeding few lines are collected in the appendix. 2 Setup Let us fix observation space Ω = Rd , and let Pj , 1 ≤ j ≤ J, be given families of Borel probability S Pj , to distributions on Ω. Put broadly, our goal is, given a random observation ω ∼ P , where P ∈ j≤J decide upon the hypotheses Hj : P ∈ Pj , j = 1, ..., J. We intend to address the above goal in the case when the families Pj are simple – they are comprised of distributions for which moment-generating functions admit an explicit upper bound. 2.1 Regular and simple probability distributions Let • H be a nonempty closed convex set in Ω = Rd symmetric w.r.t. the origin, • M be a closed convex set in some Rn , • Φ(h; µ) : H × M → R be a continuous function convex in h ∈ H and concave in µ ∈ M. We refer to H, M, Φ(·, ·) satisfying the above restrictions as to regular data. Regular data H, M, Φ(·, ·) define a family R = R[H, M, Φ] of Borel probability distributions P on Ω such that  R ∀h ∈ H ∃µ ∈ M : ln Ω exp{hT ω}P (dω) ≤ Φ(h; µ). (2) We say that distributions satisfying (2) are regular, and, given regular data H, M, Φ(·, ·), we refer to R[H, M, Φ] as to regular family of distributions associated with the data H, M, Φ. The same regular data H, M, Φ(·, ·) define a smaller family S = S[H, M, Φ] of Borel probability distributions P on Ω such that  R ∃µ ∈ M : ∀h ∈ H : ln Ω exp{hT ω}P (dω) ≤ Φ(h; µ). (3) We say that distributions satisfying (3) are simple. Given regular data H, M, Φ(·, ·), we refer to S[H, M, Φ] as to simple family of distributions associated with the data H, M, Φ. 3 Recall that the starting point of our study is a “plausibly good” detector-based test which, given two families P1 and P2 of distribution with common observation space, and independent observations ω1 , ..., ωt drawn from a distribution P ∈ P1 ∪ P2 , decides whether P ∈ P1 or P ∈ P2 . Our interest in regular/simple families of distributions stems from the fact that when the families P1 and P2 are of this type, building such test reduces to solving a convex-concave game and thus can be carried on in a computationally efficient manner. We postpone the related construction and analysis to section 3, and continue with presenting some basic examples of simple and regular families of distributions and a simple “calculus” of these families. 2.2 2.2.1 Basic examples of simple families of probability distributions Sub-Gaussian distributions Let H = Ω = Rd , M be a closed convex subset of the set Gd = {µ = (θ, Θ) : θ ∈ Rd , Θ ∈ Sd+ }, where Sd+ is cone of positive semidefinite matrices in the space Sd of symmetric d × d matrices, and let Φ(h; θ, Θ) = θ T h + 21 hT Θh. In this case, S[H, M, Φ] contains all sub-Gaussian distributions P on Rd with sub-Gaussianity parameters from M, that is, all Borel probability distributions P on Ω admitting upper bound Eω∼P {exp{hT ω}} ≤ exp{θ T h + 21 hT Θh} ∀h ∈ Rd (4) on the moment-generating function, with parameters (θ, Θ) of the bound belonging to M. In particular, S[H, M, Φ] contains all Gaussian distributions N (θ, Θ) with (θ, Θ) ∈ M. 2.2.2 Poisson distributions Let H = Ω = Rd , let M be a closed convex subset of d-dimensional nonnegative orthant Rd+ , and let Φ(h = [h1 ; ...; hd ]; µ = [µ1 ; ...; µd ]) = d X i=1 µi [exp{hi } − 1] : H × M → R. The family S[H, M, Φ] contains all product-type Poisson distributions Poisson[µ] with vectors µ of parameters belonging to M; here Poisson[µ] is the distribution of random d-dimensional vector with independent of each other entries, i-th entry being Poisson random variable with parameter µi . 2.2.3 Discrete distributions Consider a discrete random variable taking values in d-element set {1, 2, ..., d}, and let us think of such a variable as of random variable taking values ei , i = 1, ..., d, where ei are standard basic orths in Rd ; probability distribution of such a variable can be identified with a point µ = [µ1 ; ...; µd ] from the d-dimensional probabilistic simplex ∆d = {ν ∈ Rd+ : d X νi = 1}, i=1 where µi is the probability for the variable to take value ei . With these identifications, setting H = Rd , specifying M as a closed convex subset of ∆d and setting ! d X µi exp{hi } , Φ(h = [h1 ; ...; hd ]; µ = [µ1 ; ...; µd ]) = ln i=1 4 the family S[H, M, Φ] contains distributions of all discrete random variables taking values in {1, ..., d} with probabilities µ1 , ..., µd comprising a vector from M. 2.2.4 Distributions with bounded support Consider the family P[X] of Borel probability distributions supported on a closed and bounded convex set X ⊂ Ω = Rd , and let φX (h) = max hT x x∈X be the support function of X. We have the following result (to be refined in section 2.3.5): Proposition 2.1 For every P ∈ P[X] it holds  Z 1 T d (5) exp{h ω}P (dω) ≤ hT e[P ] + [φX (h) + φX (−h)]2 , ∀h ∈ R : ln 8 Rd R where e[P ] = Rd ωP (dω) is the expectation of P , and the right hand side function in (5) is convex. As a result, setting H = Rd , M = X, Φ(h; µ) = hT µ + 1 [φX (h) + φX (−h)]2 , 8 we get regular data such that P[X] ⊂ S[H, M, Φ]. For proof, see Appendix A.1 2.3 Calculus of regular and simple families of probability distributions Regular and simple families of probability distributions admit “fully algorithmic” calculus, with the main calculus rules as follows. 2.3.1 Direct summation For 1 ≤ ℓ ≤ L, let regular data Hℓ ⊂ Ωℓ = Rdℓ , Mℓ ⊂ Rnℓ , Φℓ (hℓ ; µℓ ) : Hℓ × Mℓ → R be given. Let us set Ω = Ω1 × ... × ΩL = Rd , d = d1 + ... + dL , H = H1 × ... × HL = {h = [h1 ; ...; hL ] : hℓ ∈ Hℓ , ℓ ≤ L}, M = M1 × ... × ML = {µ = [µ1 ; ...; µL ] : µℓ ∈ Mℓ , ℓ ≤ L} ⊂ Rn , n = n1 + ... + nL , P ℓ ℓ Φ(h = [h1 ; ...; hL ]; µ = [µ1 ; ...; µL ]) = L ℓ=1 Φℓ (h ; µ ) : H × M → R. Then H is a symmetric w.r.t. the origin closed convex set in Ω = Rd , M is a nonempty closed convex set in Rn , Φ : H × M → R is a continuous convex-concave function, and clearly • the family R[H, M, Φ] contains all product-type distributions P = P1 × ... × PL on Ω = Ω1 × ... × ΩL with Pℓ ∈ R[Hℓ , Mℓ , Φℓ ], 1 ≤ ℓ ≤ L; • the family S[H, M, Φ] contains all product-type distributions P = P1 ×...×PL on Ω = Ω1 ×...×ΩL with Pℓ ∈ S[Hℓ , Mℓ , Φℓ ], 1 ≤ ℓ ≤ L. 5 2.3.2 IID summation Let Ω = Rd be an observation space, (H, M, Φ) be regular data on this space, and let λ = {λℓ }K ℓ=1 be a collection of reals. We can associate with the outlined entities a new data (Hλ , M, Φλ ) on Ω by setting L X Hλ = {h ∈ Ω : kλk∞ h ∈ H}, Φλ (h; µ) = Φ(λℓ h; µ) : Hλ × M → R. ℓ=1 Now, given a probability distribution P on Ω, we can associate withPit and with the above λ a new probability distribution P λ on Ω as follows: P λ is the distribution of ℓ λℓ ωℓ , where ω1 , ω2 , ..., ωL are drawn, independently of each other, from P . An immediate observation is that the data (Hλ , M, Φλ ) is regular, and • whenever a probability distribution P belongs to S[H, M, Φ], the distribution P λ belongs to S[Hλ , M, Φλ ]. In particular, when ω ∼ P ∈ S[H, M, Φ], then the distribution P L of the sum of L independent copies of ω belongs to S[H, M, LΦ]. 2.3.3 Semi-direct summation For 1 ≤ ℓ ≤ L, let regular data Hℓ ⊂ Ωℓ = Rdℓ , Mℓ , Φℓ be given. To avoid complications, we assume that for every ℓ, • Hℓ = Ω ℓ , • Mℓ is bounded. Let also an ǫ > 0 be given. We assume that ǫ is small, namely, Lǫ < 1. Let us aggregate the given regular data into a new one by setting H = Ω := Ω1 × ... × ΩL = Rd , d = d1 + ... + dL , M = M1 × ... × ML , and let us define function Φ(h; µ) : Ωd × M → R as follows: Φ(h = [h1 ; ...; hL ]; µ = [µ1 ; ...; µL ]) = inf λ∈∆ǫ PL ∆ǫ = {λ ∈ Rd : λℓ ≥ ǫ ∀ℓ & ℓ=1 λℓ = 1}. Pd ℓ ℓ ℓ=1 λℓ Φℓ (h /λℓ ; µ ), (6) By evident reasons, the infimum in the description of Φ is achieved, and Φ is continuous. In addition, Φ is convex in h ∈ Rd and concave in µ ∈ M. Postponing for a moment verification, the consequences are that H = Ω = Rd , M and Φ form a regular data. We claim that Whenever ω = [ω 1 ; ...; ω L ] is a Borel random variable taking values in Ω = Rd1 × ... × RdL , and the marginal distributions Pℓ , 1 ≤ ℓ ≤ L, of ω belong to the families S[Rdℓ , Mℓ , Φℓ ] for all 1 ≤ ℓ ≤ L, the distribution P of ω belongs to S[Rd , M, Φ]. bℓ ∈ Mℓ such that Indeed, since Pℓ ∈ S[Rdℓ , Mℓ , Φℓ ], there exists µ bℓ ) ∀g ∈ Rdℓ . ln(Eωℓ ∼Pℓ {exp{g T ω ℓ }}) ≤ Φℓ (g; µ Let us set µ b = [b µ1 ; ...; µ bL ], and let h = [h1 ; ...; hL ] ∈ Ω be given. We can find λ ∈ ∆ǫ such that Φ(h; µ b) = L X ℓ=1 λℓ Φℓ (hℓ /λℓ ; µ bℓ ). 6 Applying Hölder inequality, we get ( E[ω1 ;...;ωL ]∼P whence ln E[ω1 ;...;ωL ]∼P We see that ) L  n oλℓ X Y exp{ [hℓ ]T ω ℓ } ≤ , Eωℓ ∼Pℓ [hℓ ]T ω ℓ /λℓ ( ℓ ℓ=1 )! L X X ℓ T ℓ exp{ [h ] ω } ≤ λℓ Φℓ (hℓ /λℓ ; µ bℓ ) = Φ(h; µ b). ln E[ω1 ;...;ωL ]∼P ℓ ( ℓ=1 )! X exp{ [hℓ ]T ω ℓ } ≤ Φ(h; µ b) ∀h ∈ H = Rd , ℓ and thus P ∈ S[Rd , Mℓ , Φℓ ], as claimed. It remains to verify that the function Φ defined by (6) indeed is convex in h ∈ Rd and concave in µ ∈ M. Concavity in µ is evident. Further, functions λℓ Φℓ (hℓ /λℓ ; µ) (as perspective of P transformation ℓ /λ , µ). convex functions Φℓ (·; µ)) are jointly convex in λ and hℓ , and so is Ψ(λ, h; µ) = L λ Φ (h ℓ ℓ=1 ℓ ℓ Thus Φ(·; µ), obtained by partial minimization of Ψ in λ, indeed is convex. 2.3.4 Affine image Let H, M, Φ be regular data, Ω be the embedding space of H, and x 7→ Ax + a be an affine mapping ¯ from Ω to Ω̄ = Rd , and let us set ¯ H̄ = {h̄ ∈ Rd : AT h̄ ∈ H}, M̄ = M, Φ̄(h̄; µ) = Φ(AT h̄; µ) + aT h̄ : H̄ × M̄ → R. Note that H̄, M̄ and Φ̄ are regular data. It is immediately seen that Whenever the probability distribution of a random variable ω belongs to R[H, M, Φ] (or belongs to S[H, M, Φ]), the distribution P̄ [P ] of the random variable ω̄ = Aω + a belongs to R[H̄, M̄, Φ̄] (respectively, belongs to S[H̄, M̄, Φ̄]). 2.3.5 Incorporating support information Consider the situation as follows. We are given regular data H ⊂ Ω = Rd , M, Φ and are interested in the family of distribution P known to belong to S[H, M, Φ]. In addition, we know that all distributions P from P are supported on a given closed convex set X ⊂ Rd . How could we incorporate this domain information to pass from the family S[H, M, Φ] containing P to a smaller family of the same type still containing P ? We are about to give an answer in the simplest case of H = Ω. Specifically, denoting by φX (·) the support function of X and selecting somehow a closed convex set G ⊂ Rd containing the origin, let us set   b µ) = inf Φ+ (h, g; µ) := Φ(h − g; µ) + φX (g) , Φ(h; g∈G where Φ(h; µ) : Rd × M → R is the continuous convex-concave function participating in the original b is real-valued and continuous on the domain Rd × M (which definitely regular data. Assuming that Φ b is is the case when G is a compact set such that φX is finite and continuous on G), note that Φ d b convex-concave on this domain, so that R , M, Φ is a regular data. We claim that b contains P, provided the family S[Rd , M, Φ] does so, and the first The family S[Rd , M, Φ] of these two families is smaller than the second one. 7 Verification of the claim is immediate. Let P ∈ P, so that for properly selected µ = µP ∈ M and for all e ∈ Rd it holds  Z T exp{e ω}P (dω) ≤ Φ(e; µP ). ln Rd Besides this, for every g ∈ G we have φX (ω) − gT ω ≥ 0 on the support of P , whence for every h ∈ Rd one has   Z Z T T T exp{h ω + φX (g) − g ω}P (dω) ≤ φX (g) + Φ(h − g; µP ). exp{h ω}P (dω) ≤ ln ln Rd Rd Since the resulting inequality holds true for all g ∈ G, we get  Z b µP ) ∀h ∈ Rd , exp{hT ω}P (dω) ≤ Φ(h; ln Rd b since P ∈ P is arbitrary, the first part of the claim is justified. The implying that P ∈ S[Rd , M, Φ]; d d b b ≤ Φ, and the latter is due inclusion S[R , M, Φ] ⊂ S[R , M, Φ] is readily given by the inequality Φ b µ) ≤ Φ(h − 0, µ) + φX (0). to Φ(h, Illustration: distributions with bounded support revisited. In section 2.2.4, given a convex compact set X ⊂ Rd with support function φX , we checked that the data H = Rd , M = X, Φ(h; µ) = hT µ + 18 [φX (h) + φX (−h)]2 are regular and the family S[Rd , M, Φ] contains the family P[X] of all Borel probability distributions supported on X. Moreover, for every µ ∈ M = X, the family S[Rd , {µ}, Φ Rd ×{µ} ] contains all supported on X distributions with the expectations e[P ] = µ. R  T Note that Φ(h; e[P ]) describes well the behaviour of the logarithm FP (h) = ln Rd eh ω P (dω) of the moment-generating function of P ∈ P[X] when h is small (indeed, FP (h) = hT e[P ] + O(khk2 ) as h → 0), and by far overestimates FP (h) when h is large. Utilizing the above construction, we replace Φ with the real-valued, convex-concave and continuous on Rd × M function   b µ) = inf (h − g)T µ + 1 [φX (h − g) + φX (−h + g)]2 + φX (g) ≤ Φ(h; µ). Φ(h; g 8 b ·) still ensures the inclusion P ∈ S[Rd , {e[P ]}, Φ b d It is easy to see that Φ(·; ] for every distriR ×{e[P ]} bution P ∈ P[X] and “reproduces FP (h) reasonably well” for both small and large h. Indeed, since b e[P ]) ≤ Φ(h; e[P ]), for small h Φ(h; b e[P ]) reproduces FP (h) even better than Φ(h; e[P ]), FP (h) ≤ Φ(h; and we clearly have   1 2 T b Φ(h; µ) ≤ (h − h) µ + [φX (h − h) + φX (−h + h)] + φX (h) = φX (h) ∀µ, 8 and φX (h) is a correct description of FP (h) for large h. 3 3.1 Affine detectors and hypothesis testing Situation Assume we are given two collections of regular data with common Ω = Rd and H, specifically, the collections (H, Mχ , Φχ ), χ = 1, 2. We start with a construction of a specific test for a pair of hypotheses H1 : P ∈ P1 , H2 : P ∈ P2 , where Pχ = R[H, Mχ , Φχ ], χ = 1, 2. When building the test, we impose on the regular data in question the following 8 Assumption I: The regular data (H, Mχ , Φχ ), χ = 1, 2, are such that the convex-concave function Ψ(h; µ1 , µ2 ) = 1 2 [Φ1 (−h; µ1 ) + Φ2 (h; µ2 )] : H × (M1 × M2 ) → R (7) has a saddle point (min in h ∈ H, max in (µ1 , µ2 ) ∈ M1 × M2 ). We associate with a saddle point (h∗ ; µ∗1 , µ∗2 ) the following entities: • the risk ǫ⋆ = exp{Ψ(h∗ ; µ∗1 , µ∗2 )}; (8) this quantity is uniquely defined by the saddle point value of Ψ and thus is independent of how we select a saddle point; • the detector φ∗ (ω) – the affine function of ω ∈ Rd given by φ∗ (ω) = hT∗ ω + a, a = 1 2 [Φ1 (−h∗ ; µ∗1 ) − Φ2 (h∗ ; µ∗2 )] . (9) A simple sufficient condition for existence of a saddle point of (7) is Condition A: The sets M1 and M2 are compact, and the function Φ(h) = max µ1 ∈M1 ,µ2 ∈M2 Φ(h; µ1 , µ2 ) is coercive on H, meaning that Φ(hi ) → ∞ along every sequence hi ∈ H with khi k2 → ∞ as i → ∞. Indeed, under Condition A by Sion-Kakutani Theorem [14] it holds SadVal[Φ] := inf max Φ(h; µ1 , µ2 ) = sup inf Φ(h; µ1 , µ2 ), µ1 ∈M1 ,µ2 ∈M2 h∈H {z } | {z } h∈H µ1 ∈M1 ,µ2 ∈M2 | so that the optimization problems Φ(µ1 ,µ2 ) Φ(h) (P ) : Opt(P ) = min Φ(h) (D) : Opt(D) = h∈H max µ1 ∈M1 ,µ2 ∈M2 Φ(µ1 , µ2 ) have equal optimal values. Under Condition A, problem (P ) clearly is a problem of minimizing a continuous coercive function over a closed set and as such is solvable; thus, Opt(P ) = Opt(D) is a real. Problem (D) clearly is the problem of maximizing over a compact set of an upper semicontinuous (since Φ is continuous) function taking real values and, perhaps, value −∞, and not identically equal to −∞ (since Opt(D) is a real), and thus (D) is solvable. Thus, (P ) and (D) are solvable with common optimal value, and therefore Φ has a saddle point. 3.2 3.2.1 Pairwise testing regular families of distributions Main observation An immediate (and crucial!) observation is as follows: 9 Proposition 3.1 In the situation of section 3.1 and under Assumption I, one has R ΩRexp{−φ∗ (ω)}P (dω) ≤ ǫ⋆ ∀P ∈ P1 = R[H, M1 , Φ1 ] Ω exp{φ∗ (ω)}P (dω) ≤ ǫ⋆ ∀P ∈ P2 = R[H, M2 , Φ2 ]. (10) Proof. For every µ1 ∈ M1 , we have Φ1 (−h∗ ; µ1 ) ≤ Φ1 (−h∗ ; µ∗1 ), and for every P ∈ P1 , we have Z exp{−hT∗ ω}P (dω) ≤ exp{Φ1 (−h∗ ; µ1 )} Ω for properly selected µ1 ∈ M1 . Thus, Z exp{−hT∗ ω}P (dω) ≤ exp{Φ1 (−h∗ ; µ∗1 )} ∀P ∈ P1 , Ω whence also Z Ω exp{−hT∗ ω − a}P (dω) ≤ exp{ 12 [Φ1 (−h∗ ; µ∗1 ) + Φ2 (h∗ , µ∗2 )]} = ǫ⋆ ∀P ∈ P1 . Similarly, for every µ2 ∈ M2 , we have Φ2 (h∗ ; µ2 ) ≤ Φ2 (h∗ ; µ∗2 ), and for every P ∈ P2 , we have Z exp{hT∗ ω}P (dω) ≤ exp{Φ2 (h∗ ; µ2 )} Ω for properly selected µ2 ∈ M2 . Thus, Z exp{hT∗ ω}P (dω) ≤ exp{Φ2 (h∗ ; µ∗2 )} ∀P ∈ P2 , Ω whence Z Ω 3.2.2 exp{hT∗ ω + a}P (dω) ≤ exp{ 12 [Φ1 (−h∗ ; µ∗1 ) + Φ2 (h∗ , µ∗2 )]} = ǫ⋆ ∀P ∈ P2 .  Testing pairs of hypotheses Repeated observation. as follows: Given Ω = Rd , let random observations ωt ∈ Ω, t = 1, 2, ..., be generated “In the nature” there exists a random sequence ζt ∈ RN , t = 1, 2, ...,, of driving factors such that ωt is a deterministic function of ζ t = (ζ1 , ..., ζt ), t = 1, 2, ...; we refer to this situation as to case of repeated observation ω ∞ . Let now (H, M, Φ) be a regular data with observation space Ω. We associate with this data four hypotheses on the stochastic nature of observations ω ∞ = {ω1 , ω2 , ...}. Denoting by P|ζ t−1 the conditional, ζ t−1 being given, distribution of ωt , we say that the (distribution of the) repeated observation ω ∞ obeys hypothesis • HR [H, M, Φ], if P|ζ t−1 ∈ R[H, M, Φ] for all t and all ζ t−1 ; • HS [H, M, Φ], if P|ζ t−1 ∈ S[H, M, Φ] for all t and all ζ t−1 ; • HRi [H, M, Φ], if P|ζ t−1 is independent of t and ζ t−1 and belongs to R[H, M, Φ]; • HSi [H, M, Φ], if P|ζ t−1 is independent of t and ζ t−1 and belongs to S[H, M, Φ]. 10 Note that the last two hypotheses, in contrast to the first two, require from the observations ω1 , ω2 , ... to be i.i.d. Note also that HR is weaker than HS , HRi is weaker than HSi , and the “non-stationary” hypotheses HR , HS are weaker than their respective stationary counterparts HRi , HSi . The tests to be considered in the sequel operate with the initial fragment ω K = (ω1 , ..., ωK ), of a prescribed length K, of the repeated observation ω ∞ = {ω1 , ω2 , ...}. We call ω K K-repeated observation and say that (the distribution of) ω K obeys one of the above hypotheses, if ω K is cut off the repeated observation ω ∞ distributed according to the hypothesis in question. We can think of HR , HS , HRi and HSi as hypotheses about the distribution of the K-repeated observation ω K . Pairwise hypothesis testing from repeated observations. Assume we are given two collections of regular data (H, Mχ , Φχ ), χ = 1, 2, with common observation space Ω = Rd and common H. Given positive integer K and K-repeated observation ω K = (ω1 , ..., ωK ), we want to decide on the pair of hypotheses Hχ = HR [H, Mχ , Φχ ], χ = 1, 2, on the distribution of ω K . Assume that the convex-concave function (7) associated with the pair of regular data in question has a saddle point (h∗ ; µ∗1 , µ∗2 ), and let φ∗ (·), ǫ⋆ be the induced by this saddle point affine detector and its risk, see (9), (8). Let us set K X (K) K φ∗ (ωt ). φ∗ (ω ) = t=1 Consider decision rule T∗K for hypotheses Hχ , χ = 1, 2, which, given observation ω K , (K) • accepts H1 (and rejects H2 ) if φ∗ (ω K ) > 0; (K) • accepts H2 (and rejects H1 ) if φ∗ (ω K ) < 0; (K) • in the case of a tie (when φ∗ (ω K ) = 0) the test, say, accepts H1 and rejects H2 . (K) In what follows, we refer to T∗K as to test associated with detector φ∗ . Proposition 3.2 In the situation in question, we have o n (K) ∞ obeys H ; (a) Eζ K exp{−φ∗ (ω K )} ≤ ǫK 1 ⋆ , when ω o n (K) K when ω ∞ obeys H2 . (b) Eζ K exp{φ∗ (ω )} ≤ ǫK ⋆ , (11) As a result, the test T∗K accepts exactly one of the hypotheses H1 , H2 , and the risk of this test — the maximal, over χ = 1, 2, probability not to accept the hypothesis Hχ when it is true (i.e., when the K-repeated observation ω K obeys the hypothesis HR [H, Mχ , Φχ ]) — does not exceed ǫK ⋆ . Proof. The fact that the test always accepts exactly one of the hypotheses Hχ , χ = 1, 2, is evident. Let us denote Eζ t the expectation w.r.t. the distribution of ζ t , and let Eζt+1|ζ t stand for expectation w.r.t. conditional to ζ t distribution of ζt+1 . Assuming that H1 holds true and invoking the first inequality in (10), we have (1) Eζ1 {exp{−φ∗ (ω1 )}} ≤ ǫ⋆ , (t+1) Eζ t+1 {exp{−φ∗ o n (t) (ω t+1 )} = Eζ t exp{−φ∗ (ω t )}Eζt+1 |ζ t {exp{−φ∗ (ωt+1 )}} o n (t) ≤ ǫ⋆ Eζ t exp{−φ∗ (ω t )} , 1 ≤ t < K (we have taken into account that ωt+1 is a deterministic function of ζ t+1 and that we are in the case where the conditional to ζ t distribution of ωt+1 belongs to P1 = R[H, M1 , Φ1 ]), and we arrive at 11 (11.a). This inequality clearly implies that the probability to reject H1 when the hypothesis is true is (K) K K ≤ ǫK ⋆ (since φ∗ (ω ) ≤ 0 when T∗ rejects H1 ). Assuming that H2 is true and invoking the second inequality in (10), similar reasoning shows that (11.b) holds true, so that the probability to reject H2 when the hypothesis is true does not exceed ǫK  ⋆ . 3.2.3 Illustration: sub-Gaussian and Gaussian cases For χ = 1, 2, let Uχ be nonempty closed convex set in Rd , and Uχ be a compact convex subset of the interior of the positive semidefinite cone Sd+ . We assume that U1 is compact. Setting Hχ = Ω = Rd , Mχ = Uχ × Uχ , Φχ (h; θ, Θ) = θ T h + 12 hT Θh : Hχ × Mχ → R, χ = 1, 2, (12) we get two collections (H, Mχ , Φχ ), χ = 1, 2, of regular data. As we know from section 2.2.1, for χ = 1, 2, the families of distributions S[Rd , Mχ , Φχ ] contain the families SG[Uχ , Uχ ] of sub-Gaussian distributions on Rd with sub-Gaussianity parameters (θ, Θ) ∈ Uχ × Uχ (see (4)), as well as families G[Uχ , Uχ ] of Gaussian distributions on Rd with parameters (θ, Θ) (expectation and covariance matrix) running through Uχ × Uχ . Besides this, the pair of regular data in question clearly satisfies Condition A. Consequently, the test T∗K given by the above construction as applied to the collections of regular data (12) is well defined and allows to decide on hypotheses Hχ = HR [Rd , Uχ , U χ], χ = 1, 2, on the distribution of the K-repeated observation ω K . The same test can be also used to decide on stricter hypotheses HχG , χ = 1, 2, stating that the observations ω1 , ..., ωK are i.i.d. and drawn from a Gaussian distribution P belonging to G[Uχ , Uχ ]. Our goal now is to process in detail the situation in question and to refine our conclusions on the risk of the test T∗1 when the Gaussian hypotheses HχG are considered and the situation is symmetric, that is, when U1 = U2 . Observe, first, that the convex-concave function Ψ from (7) in the situation under consideration becomes 1 1 (13) Ψ(h; θ1 , Θ1 , θ2 , Θ2 ) = 12 hT [θ2 − θ1 ] + hT Θ1 h + hT Θ2 h. 4 4 We are interested in solutions to the saddle point problem – find a saddle point of function (13) – min h∈Rd max θ1 ∈U1 ,θ2 ∈U2 Θ1 ∈U1 ,Θ2 ∈U2 Ψ(h; θ1 , Θ1 , θ2 , Θ2 ) (14) From the structure of Ψ and compactness of U1 , U1 , U2 , combined with the fact that Uχ , χ = 1, 2, are comprised of positive definite matrices, it immediately follows that saddle points do exist, and a saddle point (h∗ ; θ1∗ , Θ∗1 , θ2∗ , Θ∗2 ) satisfies the relations (a) h∗ = [Θ∗1 + Θ∗2 ]−1 [θ1∗ − θ2∗ ], (b) hT∗ (θ1 − θ1∗ ) ≥ 0 ∀θ1 ∈ U1 , hT∗ (θ2∗ − θ2 ) ≥ 0 ∀θ2 ∈ U2 , (c) hT∗ Θ1 h∗ ≤ hT∗ Θ∗1 h∗ ∀Θ1 ∈ U1 , hT∗ Θ∗2 h∗ ≤ h∗ Θ∗2 h∗ ∀Θ2 ∈ U2 . (15) From (15.a) it immediately follows that the affine detector φ∗ (·) and risk ǫ⋆ , as given by (8) and (9), are φ∗ (ω) = hT∗ [ω − w∗ ] + 12 hT∗ [Θ∗1 − Θ∗2 ]h∗ , w∗ = 12 [θ1∗ + θ2∗ ]; (16) ǫ⋆ = exp{− 41 [θ1∗ − θ2∗ ]T [Θ∗1 + Θ∗2 ]−1 [θ1∗ − θ2∗ ]} 1 T ∗ ∗ = exp{− 4 h∗ [Θ1 + Θ2 ]h∗ }. Note that in the symmetric case (where U1 = U2 ), there always exists a saddle point of Ψ with Θ∗1 = Θ∗2 , and the test T∗1 associated with such saddle point is quite transparent: it is the maximum likelihood test for two Gaussian distributions, N (θ1∗ , Θ∗ ), N (θ2∗ , Θ∗ ), where Θ∗ is the common value 12 of Θ∗1 and Θ∗2 , and the bound ǫ⋆ for the risk of the test is nothing but the Hellinger affinity of these two Gaussian distributions, or, equivalently,  ∗ ∗ (17) ǫ⋆ = exp − 18 [θ1∗ − θ2∗ ]T Θ−1 ∗ [θ1 − θ2 ] . Applying Proposition 3.2, we arrive at the following result: Proposition 3.3 In the symmetric sub-Gaussian case (i.e., in the case of (12) with U1 = U2 ), saddle point problem (13), (14) admits a saddle point of the form (h∗ ; θ1∗ , Θ∗ , θ2∗ , Θ∗ ), and the associated affine detector and its risk are given by φ∗ (ω) = hT∗ [ω − w∗ ], w∗ = 21 [θ1∗ + θ2∗ ]; ǫ⋆ = exp{− 18 [θ1∗ − θ2∗ ]T Θ∗−1 [θ1∗ − θ2∗ ]}. (18) As a result, when deciding, via ω K , on “sub-Gaussian hypotheses” HS [Rd , Mχ , Mχ ], χ = 1, 2 (in fact - even on weaker hypotheses HR [Rd , Mχ , Mχ ], χ = 1, 2), the risk of the test T∗K associated with P (K) K φ∗ (ω K ) := K t=1 φ∗ (ωt ) is at most ǫ⋆ . In the symmetric single-observation Gaussian case, that is, when U1 = U2 and we apply the test T∗ = T∗1 to observation ω ≡ ω1 in order to decide on the hypotheses HχG , χ = 1, 2, the above risk bound can be improved: Proposition 3.4 Consider symmetric case U1 = U2 = U , let (h∗ ; θ1∗ ; Θ∗1 , θ2∗ , Θ∗2 ) be “symmetric” – with Θ∗1 = Θ∗2 = Θ∗ – saddle point of function Ψ given by (13), and let φ∗ be the affine detector given by (15) and (16): 1 [θ ∗ − θ2∗ ], w∗ = 12 [θ1∗ + θ2∗ ]. φ∗ (ω) = hT∗ [ω − w∗ ], h∗ = Θ−1 2 ∗ 1 Let also q q ∗ ∗ (19) δ = hT∗ Θ∗ h∗ = 12 [θ1∗ − θ2∗ ]T Θ−1 ∗ [θ1 − θ2 ], so that δ2 = hT∗ [θ1∗ − w∗ ] = hT∗ [w∗ − θ2∗ ] and ǫ⋆ = exp{− 21 δ2 }. (20) (a) ∀(θ ∈ U1 , Θ ∈ U ) : Probω∼N (θ,Θ) {φ∗ (ω) ≤ α} ≤ Erf(δ − α/δ) (b) ∀(θ ∈ U2 , Θ ∈ U ) : Probω∼N (θ,Θ) {φ∗ (ω) ≥ −β} ≤ Erf(δ − β/δ), (21) Let, further, α ≤ where δ2 , β≤ δ2 . Then Z ∞ 1 Erf(s) = √ exp{−r 2 /2}dr 2π s is the normal error function. In particular, when deciding, via a single observation ω, on Gaussian hypotheses HχG , χ = 1, 2, with HχG stating that ω ∼ N (θ, Θ) with (θ, Θ) ∈ Uχ × U , the risk of the test T∗1 associated with φ∗ is at most Erf(δ). Proof. Let us prove (a) (the proof of (b) is completely similar). For θ ∈ U1 , Θ ∈ U we have Probω∼N (θ,Θ) {φ∗ (ω) ≤ α} = Probω∼N (θ,Θ) {hT∗ [ω − w∗ ] ≤ α} = Probξ∼N (0,I) {hT∗ [θ + Θ1/2 ξ − w∗ ] ≤ α} = Probξ∼N (0,I) {[Θ1/2 h∗ ]T ξ ≤ α − hT∗ [θ − w∗ ] } ≤ Probξ∼N (0,I) {[Θ1/2 h∗ ]T ξ ≤ α − δ2 } | {z } ∗ 2 ≥hT ∗ [θ1 −w∗ ]=δ by (15.b),(20) = Erf([δ2 − α]/kΘ1/2 h∗ k2 ) 1/2 ≤ Erf([δ2 − α]/kΘ∗ h∗ k2 ) [since δ2 − α ≥ 0 and hT∗ Θh∗ ≤ hT∗ Θ∗ h∗ by (15.c)] = Erf([δ2 − α]/δ). The “in particular” part of Proposition is readily given by (21) as applied with α = β = 0. 13  3.3 Testing multiple hypotheses from repeated observations Consider the situation as follows: we are given • observation space Ω = Rd and a symmetric w.r.t. the origin closed convex set H; • J closed convex sets Mj ⊂ Rnj , j = 1, ..., J, along with J convex-concave continuous functions Φj (h; µj ) : H × Mj → R. These data give rise to J hypotheses Hj = HR [H, Mj , Φj ] on the distribution of repeated observation ω ∞ = {ωt ∈ Rd , t ≥ 1}. On the top of it, assume we are given a closeness relation – a subset C ⊂ {1, ..., J}2 which we assume to contain the diagonal ((j, j) ∈ C for all j ≤ J) and to be symmetric ((i, j) ∈ C if and only if (j, i) ∈ C). In the sequel, we interpret indexes i, j with (i, j) ∈ C (and the hypotheses Hi , Hj with these indexes) as C-close to each other. Our goal is, given a positive integer K and K-repeated observation ω K = (ω1 , ..., ωK ), to decide, “up to closeness C,” on the hypotheses Hj , j = 1, ..., J (which is convenient to be thought of as hypotheses about the distribution of ω K ). Let us act as follows3 . Let us make Assumption II For every pair i, j, 1 ≤ i < j ≤ J, with (i, j) 6∈ C, the convex-concave function Ψij (h; µi , µj ) = 1 2 [Φi (−h; µi ) + Φj (h; µj )] : H × (Mi × Mj ) → R ij has a saddle point (hij ; µij i , µj ) on H × (Mi × Mj ) (min in h, max in µi , µj ), and let us set ij ǫij = exp{Ψij (hij ; µij i , µj )}, φij (ω) = [hij ]T ω h+ aij aij = Φi (−hij ; µij i )− 1 2    i  , 1 ≤ i < j ≤ J & (i, j) 6∈ C  Φj (hij ; µij j ) (cf. (8) and (9)). We further set (22) φij (·) ≡ 0, ǫij = 1 ∀(i, j) ∈ C, and φij (ω) = −φji (ω), ǫij = ǫji , 1 ≤ j < i ≤ J & (i, j) 6∈ C, and set (K) φij (ω K ) = K X t=1 Now, by construction, (K) φij (ωt ), 1 ≤ i, j ≤ J. (K) φij (·) = −φji (·), ǫij = ǫji , 1 ≤ i, j ≤ J. Observe that for every j ≤ J such that the K-repeated observation ω K obeys hypothesis Hj = HR [H, Mj , Φj ], we have n o (K) E exp{φij (ω K )} ≤ ǫK (23) ij , i = 1, ..., J. 3 The construction we are about to present and the first related result (Proposition 3.5) originate from [13, Section 3]; we reproduce them below to make our exposition self-contained. 14 (we have used (11) along with φij ≡ −φji ). Furthermore, whenever [αij ]i,j≤J is a skew-symmetric matrix (i.e., αij = −αji ), the shifted detectors (K) (K) φbij (ω K ) = φij (ω K ) + αij (24) satisfy the scaled version of (23), specifically, for every j ≤ J such that the K-repeated observation ω K obeys hypothesis Hj = HR [Rd , Mj , Φj ], we have n o (K) E exp{φbij (ω K )} ≤ ǫK (25) ij exp{αij }, i = 1, 2, ..., J. The bottom line is as follows: Proposition 3.5 In the situation in question, given a closeness C, consider the following test TCK deciding on the hypotheses Hj , 1 ≤ j ≤ J, on the distribution of K-repeated observation ω K : given skew-symmetric shift matrix [αij ]i,j and observation ω K , TCK accepts all hypotheses Hi such that (K) φbij (ω K ) > 0 whenever (i, j) 6∈ C (∗i ) and reject all hypotheses Hi for which the predicate (∗i ) does not take place. Then (i) Test TCK accepts some of (perhaps, none of ) hypotheses Hi , i = 1, ..., J, and all accepted hypotheses, if any, are C-close to each other. Besides, TCK has C-risk at most X ǫK b ǫ = max ij exp{−αij }, i j:(i,j)6∈C meaning that for every j∗ ≤ J such that the distribution P̄K of ω K obeys the hypothesis Hj∗ (i.e., the hypothesis Hj∗ is true), the P̄K -probability of the event ”either the true hypothesis HjK∗ is not accepted, or the list of accepted hypotheses contains a hypothesis which is not C-close to Hj∗ ” does not exceed b ǫ. (ii) The infimum of b ǫ over all skew-symmetric shifts αij is exactly the spectral norm kE (K) k2,2 of the symmetric entry-wise nonnegative matrix E (K) =  (K) Eij =  ǫK 6 C ij , (i, j) ∈ 0, (i, j) ∈ C J . (26) i,j=1 This infimum is attained when the Perron-Frobenius eigenvector g of E (K) can be selected to be positive, in which case an optimal selection of αij is the selection αij = ln(gi /gj ), 1 ≤ i, j ≤ J. (K) Proof. Given ω K , the test TCK can accept hypotheses Hi and Hj with (i, j) 6∈ C only when φij (ω K ) > (K) (K) (K) 0 and φji (ω K ) > 0, which is impossible due to φij (·) = −φji (·). Thus, TCK can accept Hi and Hj only when (i, j) ∈ C. Further, let the distribution P̄K of ω K obey hypothesis Hj∗ . Invoking (25) (K) (K) and the relation φbj∗ j (·) = −φbjj∗ (·), for every j ≤ J with (j∗ , j) 6∈ C, the P̄K -probability of the (K) (K) event φb (ω K ) ≤ 0, or, which is the same, of the event φb (ω K ) ≥ 0, is at most ǫK exp{αjj } = j∗ j jj∗ 15 jj∗ ∗ ǫK j∗ j exp{−αj∗ j }. Using the union bound, the P̄K -probability of the event “Hj∗ is not accepted” is at most X X (K) ǫK Ej∗ j exp{−αj∗ j } ≤ b ǫ. j∗ j exp{−αj∗ j } = j j:(j∗ j)6∈C By construction of the test, when Hj∗ is accepted and j is not C-close to j∗ , Hj is not accepted (we have already seen that the test never accepts a pair of hypotheses which are not C-close to each other). Thus, the C-risk of TCK indeed is at most b ǫ. Now, E (K) is a symmetric entry-wise nonnegative matrix, so that its leading eigenvector g can be selected to be nonnegative. When g is positive, setting αij = ln(gi /gj ), we get for every i X (K) X (K) Eij exp{−αij } = Eij gj /gi = (E (K) g)i /gi = kE (K) k2,2 , j j and thus b ǫ = kE (K) k2,2 . The fact that this is the smallest possible, over skew-symmetric shifts αij , value of b ǫ is proved in [13]. When g is just nonnegative, consider close to E (K) symmetric matrix b with positive entries E bij ≥ E (K) ; utilizing the (automatically strictly positive) Perron-Frobenius E ij eigenvector g of this matrix, we, as was just explained, get skew-symmetric shifts αij such that X bij exp{−αij } ≤ kEk b 2,2 E j P (K) for all i; the left hand side in this inequality is ≥ j Eij exp{−αij }, and the right hand side can be b close enough to E (K) . Thus, we indeed can make b made arbitrarily close to kE (K) k2,2 by making E ǫ (K) arbitrarily close to kE k2,2 .  3.3.1 Special case: inferring colors Assume that we are given J collections (H, Mj , Φj ), 1 ≤ j ≤ J, of regular data with common observation space Ω = Rd and common H, and thus have at our disposal J hypotheses Hj = HR [H, Mj , Φj ], on the distribution of K-repeated observation ω K . Let also the index set {1, ..., J} be partitioned into L ≥ 2 non-overlapping nonempty subsets I1 , ..., IL ; it is convenient to think about ℓ, 1 ≤ ℓ ≤ L, as the common color of indexes j ∈ Iℓ , and that the colors of indexes j are inherited by the hypotheses Hj . The Color Inference (CI) problem we want to solve amounts to decide, given K-repeated observation ω K obeying one or more of the hypotheses H1 , ..., HJ , on the color of these hypotheses. Note that it may happen that the distribution of ω K obeys a pair of hypotheses Hi , Hj of different colors. If it is not the case – that is, no distribution of ω K obeys a pair of hypotheses Hi , Hj of two distinct colors – we call the CI problem well-posed. In the well-posed case, we can speak about the color of the distribution of ω K provided this distribution obeys the union, over j = 1, ..., J, of hypotheses Hj ; this is the color of (any of) the hypotheses Hj obeyed by the distribution of ω K , and the CI problem is to infer this color given ω K . In order to process the CI problem via our machinery, let us define closeness C as follows: (i, j) ∈ C ⇔ i and j are of the same color. Assuming that the resulting C ensures validity of Assumption II, we can apply the above scheme to build test TCK . We can then convert this test into a color inference as follows. Given a K-repeated observation ω K , it may happen that TCK , as applied to ω K , accepts one or more among the hypotheses Hj . In this case, by item (i) of Proposition 3.5, all accepted hypotheses are C-close to each other (in other words, are of the same color), and we claim that this is the color of the distribution of K-repeated 16 observation we are dealing with. And if TCK , as applied to ω K , accepts nothing, we claim that the color we are interested in remains undecided. Let us analyze the just described color inferring procedure, let it be denoted AK . Observe, first, that in the situation in question, assuming w.l.o.g. that the sets I1 , I2 , ..., IL are consecutive fragments in {1, ..., J}, the matrix E (K) given by (26) is naturally partitioned into L × L blocks E pq = (E qp )T , (K) 1 ≤ p, q ≤ L, where E pq is comprised of entries Eij with i ∈ Ip , j ∈ Iq . By construction of E (K) , the diagonal blocks E pp are zero, and off-diagonal blocks are entry-wise positive (since ǫij clearly is positive for all pairs i, j of different colors). It follows that Perron-Frobenius eigenvectors of E (K) are strictly positive. This implies that for properly selected shifts αij = −αji , the quantity b ǫ in Proposition 3.5 is equal to kE (K) k2,2 ; in what follows we assume that the test TCK utilizes exactly these optimal shifts, so that we are in the case of b ǫ = kE (K) k2,2 . Now, it may happen (“bad case”) that that kE (K) k2,2 ≥ 1; in this case Proposition 3.5 says nothing meaningful about the quality of the test TCK , and consequently, we cannot say much about the quality of AK . In contrast to this, we claim that Lemma 3.1 Assume that b ǫ := kE (K) k2,2 < 1. Then the CI problem is well posed, and whenever the distribution P̄K of ω K obeys one of the hypotheses Hj , j = 1, ..., J, AK recovers correctly the color of P̄K with P̄K -probability at least 1 − b ǫ. The proof is immediate. In the good case, all entries in E (K) are of magnitude < 1, whence ǫij < 1 whenever (i, j) 6∈ C, see (26), so that ǭ := max{ǫij : (i, j) 6∈ C} < 1. i,j (27) It follows that the nonzero entries in E (M) are nonnegative and ≤ ǭM , whence b ǫ(M ) := kE (M) k2,2 ≤ J ǭM → 0, as M → ∞. (28) In particular, for properly selected M we have b ǫ(M ) < 1/2. Applying Proposition 3.5 with M in the role of K, we see that if the distribution P̄K of ω K obeys hypothesis Hj∗ with some j∗ ≤ J (due the origin of our hypotheses, this is exactly the same as to say that the distribution P̄M of ω M ǫ(M ) > 1/2 the test TCM accepts hypothesis Hj∗ . obeys Hj∗ ), then with P̄M -probability at least 1 − b It follows that if P̄M obeys both Hj ′ and Hj ′′ , then TCM will accept Hj ′ and Hj ′′ simultaneously with positive P̄M -probability, and since, as we have already explained, TCM never accepts two hypotheses of different color simultaneously, we conclude that Hj ′ and Hj ′′ are of the same color. This conclusion holds true whenever the distribution of ω K obeys one or more of the hypotheses Hj , 1 ≤ j ≤ K, meaning that the CI problem is well posed. Invoking Proposition 3.5, we conclude that if the distribution P̄K of ω K obeys, for some j∗ , ǫ(K); and from hypothesis Hj∗ , then the P̄K -probability for TCK to accept Hj∗ is at least 1 − b preceding analysis, whenever TCK accepts Hj∗ such that P̄K obeys Hj∗ , AK correctly infers color of P̄K , as claimed. the the the  ǫ(K) → 0 as K → ∞, so that the CI Finally, we remark that when (27) holds, (28) implies that b problem is well posed, and for every desired risk level ǫ ∈ (0, 1) we can find efficiently observation time K = K(ǫ) such that b ǫ(K) ≤ ǫ. As a result, for this K the color inferring procedure AK recovers the color of the distribution P̄K of ω K (provided this distribution obeys some of the hypotheses H1 , ..., HJ ) with P̄K -probability at least 1 − ǫ. 4 Application: aggregating estimates by testing Let us consider the situation as follows: 17 • We are given I triples of regular data (H, Mi , Φi ), 1 ≤ i ≤ I, with common H and Ω = Rd and the parameter sets Mi sharing the common embedding space Rn ; for the sake of simplicity, assume that Mi are bounded (and thus are nonempty convex compact sets in Rn ) and the continuous convex-concave functions Φi (h; µ) : H × Mj → R are coercive in H: Φi (ht , µ) → ∞ whenever µ ∈ Mi and sequence {ht ∈ H, t ≥ 1} satisfies kht k2 → ∞, t → ∞. • We observe a realization of K-repeated observation ω K = (ω1 , ..., ωK ) with i.i.d. S ωt ’s drawn S[H, Mi , Φi ]. from unknown probability distribution P̄ known to belong to the family P = i≤I Thus, “in the nature” there exists ī ≤ I and µ̄ ∈ Mī such that  ln Eω∼P̄ {exp{hT ω}} ≤ Φī (h, µ̄) ∀h ∈ H. (29) we call µ̄ the parameter associated with P̄ , and our goal is to recover from K-repeated observation ω K the image ḡ = Gµ̄ of µ̄ under a given linear mapping µ 7→ Gµ : Rn → Rm . Undoubtedly, parameter estimation problem is a fundamental problem of mathematical statistics, and as such is the subject of a huge literature. In particular, several constructions of estimators based on testing of convex hypotheses have been studied in connection with signal reconstruction [4, 5, 6] and linear functionals estimation [10, 11]. Our actual goal to be addressed below is more modest: we assume that we are given L candidate estimates g1 , ..., gL of ḡ (these estimates could be outputs of various estimation routines applied to independent observations sampled form P̄ ), and our goal is to select the best – the k · k2 -closest to ḡ among the estimates g1 , ..., gL . This is the well-known problem of aggregating estimates, and our goal is to process this aggregation problem via the Color Inference procedure from section 3.3.1. 4.1 Aggregation procedure It should be stressed that as stated, the aggregation problem appears to be ill-posed: there could be several pairs (ī, µ̄) satisfying (29), and the values of Gµ at the µ-components of these pairs could be different for different pairs, so that ḡ not necessary is well defined. One way to resolve this ambiguity would be to assume that given P̄ ∈ P, relation (29) uniquely defines µ̄. We, however, prefer another setting: µ̄ and ī satisfying (29), same as P̄ ∈ P, are “selected by nature” (perhaps, from several alternatives), and the performance of the aggregating procedure we are about to develop should be independent of what is the nature’s selection. When processing the aggregation problem, we assume w.l.o.g. that all points g1 , ..., gL are distinct from each other. Let us split the space Rm where Gµ takes values into L Voronoi cells Vℓ = {g ∈ Rm : kg − gℓ k2 ≤ kg − gℓ′ k2 ∀ℓ′ ≤ L} = {g ∈ Rm : uTℓℓ′ g ≤ vℓℓ′ ∀(ℓ′ ≤ L, ℓ′ 6= ℓ)}, ′ ′ 1 T uℓℓ′ = kgℓ′ − gℓ k−1 2 [gℓ′ − gℓ ], vℓℓ′ = 2 uℓℓ′ [gℓ′ + gℓ ], 1 ≤ ℓ, ℓ ≤ L, ℓ 6= ℓ . (30) Note that Vℓ is comprised of all points g from Rm for which gℓ is (one of) the k · k2 -closest to g among the points g1 , ..., gL . Let us set Wℓi = {µ ∈ Mi : Gµ ∈ Vℓ }, 1 ≤ i ≤ I, 1 ≤ ℓ ≤ L, (31) so that Wℓi are convex compact sets in Rm . Observe that gℓ can be a solution to the aggregation problem (that is, the closest to ḡ point among g1 , ..., gL ) only when ḡ = Gµ̄ belongs to Vℓ , that is, only when µ̄ ∈ Wℓī for some ī, implying that at least one of the sets Wℓ1 , Wℓ2 , ..., WℓI is nonempty. Whether the latter condition is indeed satisfied for a given ℓ this can be found out efficiently via solving I convex 18 feasibility problems. If the latter condition does not hold for some ℓ (let us call the associated estimate gℓ redundant), we can eliminate gℓ from the list of estimates to be aggregated without affecting the solution to the aggregation problem. Then we can redefine the Voronoi cells for the reduced list of estimates in the role of our original list, check whether this list still contains a redundant estimate, eliminate the latter, if it exists, and proceed recursively until a list of estimates (which by construction still contains all solutions to the aggregation problem) with no redundant estimates is built. We lose nothing when assuming that this “purification” was carried out in advance, so that already the initial list g1 , ..., gL of estimates does not contain redundant ones. Of course, we lose nothing when assuming that L ≥ 2. Thus, from now on we assume that L ≥ 2 and for every ℓ ≤ L, at least one of the sets Wℓi , 1 ≤ i ≤ I, is nonempty. Note that to solve the aggregation problem to optimality is exactly the same, in terms of the sets i Wℓ , as to identify ℓ such that µ̄ ∈ Wℓi for some i. We intend to reduce this task to solving a series of Color Inference problems. We start with presenting the principal building block of our construction – Individual Inference procedure. Individual Inference procedure is parameterized by ℓ ∈ {1, ..., L} and a real δ > 0. Given ℓ and δ, we initialize the algorithm as follows: • mark as red all nonempty sets Wℓi along with their elements and the corresponding regular data (H, Wℓi , Φi H×W i ); ℓ • look one by one at all sets Wℓi′ with i ≤ I and ℓ′ 6= ℓ, and associate with these sets their chunks Wℓℓiδ′ = {µ ∈ Wℓi′ : uTℓℓ′ [Gµ] ≥ vℓℓ′ + δ}. (32) Note that the resulting sets are convex and compact. Whenever Wℓℓiδ′ is nonempty, we mark blue this set along with its elements and the corresponding regular data (H, Wℓℓiδ′ , Φi H×W iδ ) . ℓℓ′ As a result of the above actions, we get a collection of nonempty convex compact subsets Wℓsδ , sδ s = 1, ..., Sℓδ , of Rd and associated regular data Dℓsδ = (H, Wℓsδ , Φsδ ℓ ); the sets Wℓ , same as their sδ sδ elements and regular data Dℓ , are colored in red and blue. Note that the sets Wℓ of different colors do not intersect (since their images under the mapping G do not intersect), so that a point µ ∈ Rm gets at most one color. Note also that our collection definitely contains red components. δ sδ δ Individual Inference Procedure Aℓδ K infers the color of a regular data D ∈ Dℓ = {Dℓ , 1 ≤ s ≤ Sℓ } K given i.i.d. K-repeated observation ω drawn from a distribution P ∈ S[D]: when the collection Dδℓ contains both red and blue regular data, Aℓδ K is exactly Color Inference procedure from section 3.3.1 associated with this collection and our coloring4 ; if no blue regular data is present, Aℓδ K always infers that the color is red. Observe that if the collection Dδℓ of regular data we have built contains no blue data for some value δ̄ of δ, the same holds true for all δ ≥ δ̄. Let us define the risk b ǫ(ℓ, δ) of Individual Inference Procedure δ with parameters ℓ, δ as follows: when δ is such that Dℓ contains no blue regular data, b ǫ(ℓ, δ) = 0, otherwise b ǫ(ℓ, δ) is as stated in Proposition 3.5. Note that whenever δ > 0, ℓ ≤ L, s ≤ Sℓδ , µ ∈ Wℓsδ and a probability distribution P satisfies Eω∼P {exp{hT ω}} ≤ Φs (h, µ) ∀h ∈ H, 4 The procedure is well defined, since by our assumption, all convex-concave functions we need to deal with are continuous, coercive in the minimization variable, and have closed convex minimization and compact convex maximization domains, so that the required saddle points do exist. 19 the quantity b ǫ(ℓ, δ) , by construction, is an upper bound on P -probability of the event “as applied to observation ω K = (ω1 , ..., ωK ) with ω1 , ..., ωK drawn, independently of each other, from P , Aℓδ K does not recover correctly the color of µ.” Observe that b ǫ(ℓ, δ) = 0 for large enough values of δ (since for large δ the collection Dδℓ contains no blue data; recall that the parameter sets Mi are bounded). Besides this, we claim that b ǫ(ℓ, δ) is nonincreasing in δ > 0. ′′ To support the claim, assume that δ ′ ≥ δ ′′ > 0 are such that Dδℓ contains blue data, and let us show that ǫ′ := b ǫ(ℓ, δ ′ ) ≤ ǫ′′ := b ǫ(ℓ, δ ′′ ). Indeed, recall that ǫ′ and ǫ′′ are k · k2,2 -norms of respective symmetric entry-wise nonnegative matrices E ′ , E ′′ (see Proposition 3.5). When increasing δ from δ = δ ′′ to δ = δ ′ , we reduce the associated E-matrix to its submatrix5 and further reduce the entries in this submatrix6 , and thus reduce the norm of the matrix. Aggregation procedure we propose is as follows: Given tolerance ǫ ∈ (0, 12 ), for every ℓ = 1, ..., L we specify δℓ > 0, the smaller the better, ℓ in such a way that b ǫ(ℓ, δℓ ) ≤ ǫ/L 7 . Given observation ω K , we run the procedures Aℓδ K , ℓδℓ 1 ≤ ℓ ≤ L. Whenever AK returns a color, we assign it to the index ℓ and to the vector gℓ , so that after all ℓ’s are processed, some gℓ ’s get color “red,” some get color “blue”, and some do not get color. The aggregation procedure returns, as a solution ĝ(ω K ), a (whatever) red vector if one was discovered, and returns, say, g1 otherwise. Proposition 4.1 In the situation and under the assumptions described in the beginning of section 4, let ω K = (ω1 , ..., ωK ) be K-element i.i.d. sample drawn from a probability distribution P̄ which, taken along with some ī ≤ I and µ̄ ∈ Mī , satisfies (29). Then the P̄ -probability of the event kGµ̄ − ĝ(ω K )k2 ≤ min kGµ̄ − gℓ k2 + 2 max δℓ ℓ≤L ℓ (33) is at least 1 − ǫ. Simple illustration. Let I = 1, H = Ω = Rd , and let M = M1 be a nonempty convex compact subset of Rd . Further, suppose that Φ(h; µ) := Φ1 (h; µ) = hT µ + 21 hT Θh : H × M → R, where Θ is a given positive definite matrix. We are also given a K-element i.i.d. sample ω K drawn from a sub-Gaussian distribution P with sub-Gaussianity parameters (µ, Θ). Let also Gµ ≡ µ, so that the aggregation problem we are interested in reads: “given L estimates g1 , ..., gL of the expectation µ of a sub-Gaussian random vector ω with sub-Gaussianity parameters (µ, Θ), with a known Θ ≻ 0, and Krepeated i.i.d. sample ω K from the distribution of the vector, we want to select gℓ which is k · k2 -closest to the true expectation µ of ω.” From now on we assume that g1 , ..., gL ∈ M (otherwise, projecting the estimates onto M, we could provably improve their quality) and that g1 , ..., gL are distinct from each other. 5 iδ iδ ′′ The sets Wℓℓ can become empty ′ shrink as δ grows, thus some of the blue sets Wℓℓ′ which are nonempty at δ = δ when δ increases to δ ′ . 6 Indeed, by Proposition 3.5, these entries are obtained from saddle point values of some convex-concave functions by a monotone transformation; it is immediately seen that as δ grows, these functions and the domains of the minimization argument remain intact, while the domains of the maximization argument shrink, so that the saddle point values cannot increase. 7 For instance, we could start with δ = δ 0 large enough to ensure that b ǫ(ℓ, δ 0 ) = 0, and select δℓ as either the last term i i in the progression δ = κ δ0 , i = 0, 1, ..., for some κ ∈ (0, 1), such that b ǫ(ℓ, δ i ) ≤ ǫ/L, or the first term in this progression which is “negligibly small” (say, less that 10−6 ), depending on what happens first. 20 In our situation, the sets (30), (31), (32) and functions Φi become Wℓ = {µ ∈ M : uTℓℓ′ µ ≤ vℓℓ′ , ∀(ℓ′ ≤ L : ℓ′ 6= ℓ)}, g ′ −g uℓℓ′ = kg′ℓ−gℓℓk2 , vℓℓ′ = 21 [gℓ + gℓ′ ], ℓ 6= ℓ′ ; ℓ Wℓℓδ ′ = {µ ∈ M : uTℓℓ′ µ ≥ vℓℓ′ + δ}, 1 ≤ ℓ, ℓ′ ≤ L, ℓ 6= ℓ′ , Φ(h; µ) = hT µ + 21 hT Θh, (we are in the case of I = 1 and thus suppress index i in the notation for W ’s and Φ). Note that d Individual Inference Procedure Aℓδ K deals with exactly one red hypothesis, HSi [R , Wℓ , Φ], and at most L − 1 blue hypotheses HSi [Rd , Wℓℓδ ′ , Φ] associated with nonempty sets Wℓℓδ ′ and ℓ′ 6= ℓ. Applying the construction from section 3.3.1, we arrive at the aggregation routine as follows (below ′ ℓ, ℓ vary in {1, ..., L}): • We set = =   √ L L−1 uTℓℓ′ Θuℓℓ′ ; ǫK ℓ 6=ℓ 1 ′ ℓ′ ; 2 [gℓ + gℓ + δ i hℓ uℓℓ′ ] , ℓ 6= P K δℓ T ′ − ω Kw u ′ t ℓℓ T t=1 2u ′ Θuℓℓ′ ℓℓ δℓ = max ′ wℓℓ′ (K) K ψℓℓ′ (ω ) r ln ℓℓ (34) + 12 ln(L − 1), ℓ 6= ℓ′ . (K) • Given ω K , for 1 ≤ ℓ ≤ L we assign vector gℓ color “red,” if ψℓℓ′ (ω K ) > 0 for all ℓ′ 6= ℓ, otherwise we do not assign gℓ any color; • If red vectors were found, we output (any) one of them as solution to the aggregation problem; if no red vectors are found, we output, say, g1 as solution. Proposition 4.1 as applied to the situation in question states that whenever ω1 , ω2 , ...ωK are drawn, independently from each other, from a sub-Gaussian distribution P with parameters µ, Θ, then with P -probability at least 1 − ǫ the result ĝ(ω K ) of the above aggregation routine satisfies the relation kµ − ĝ(ω K )k2 ≤ min kµ − gℓ k2 + 2 max δℓ , 1≤ℓ≤L ℓ which essentially recovers the classical ℓ2 oracle inequality (cf. [12, Theorem 4]). 5 5.1 Beyond the scope of affine detectors Lifted detectors The tests developed in sections 3.2.2 and 3.3 were based on affine detectors – affine functions φ(ω) associated with pairs of composite hypotheses H1 : P ∈ P1 , H2 : P ∈ P2 on the probability distribution P of observation ω ∈ Ω = Rd . Such detectors were built to satisfy the relations R R (35) Ω exp{−φ∗ (ω)}P (dω) ≤ ǫ⋆ ∀P ∈ P1 & Ω exp{φ∗ (ω)}P (dω) ≤ ǫ⋆ ∀P ∈ P2 , with as small ǫ⋆ as possible (cf. (10)), and affinity of φ is of absolutely no importance here: all constructions in sections 3.2.2, 3.3 were based upon availability of pairwise detectors φ, affine or not, satisfying, for the respective pairs of composite hypotheses, relations (10) with some known ǫ⋆ . So far, affinity of detectors was utilized only when building detectors satisfying (35) via the generic scheme presented in section 3.1. 21 Now note that given a random observation ζ taking values in some Rd along with a deterministic function Z(ζ) : Rd → RD , we can convert an observation ζ into an observation ω = (ζ, Z(ζ)) ∈ Rd × RD . Here ω is a deterministic transformation of ζ which “remembers” ζ, so that to make statistical inferences from observations ζ is exactly the same as to make them from observations ω. However, detectors which are affine in ω can be nonlinear in ζ: for instance, for Z(ζ) = ζζ T , affine in ω detectors are exactly detectors quadratic in ζ. We see that within the framework of our approach, passing from ζ to ω allows to consider a wider family of detectors and thus to arrive at a wider family of tests. The potential bottleneck here is the necessity to bring the “augmented” observations (ζ, Z(ζ)) into the scope of our setup. Example: distributions with bounded support. Consider the case where the distribution P of our observation ζ ∈ Rd belongs to a family P of Borel probability distributions supported on a given bounded set, for the sake of simplicity – on the unit Euclidean ball B of Rd . Given a continuous function Z(·) : Rd → RD , our goal is to cover the family P + of distributions P + [P ] of ω = (ζ, Z(ζ)) induced by distributions P ∈ P of ζ by a family P[H, M, Φ] (or S[H, M, Φ]) associated with some regular data, thus making the machinery we have developed so far applicable to the family of distribution P + . Assuming w.l.o.g. that kZ(z)k2 ≤ 1 ∀(z : kzk2 ≤ 1), observe that for P ∈ P the distribution P + [P ] is sub-Gaussian with sub-Gaussianity parameters (θP , Θ = 2Id+D ), where Z θP = (ζ, Z(ζ))P (dζ). B It follows that If we can point out a convex compact set U in Rd × RD such that θP ∈ U ∀P ∈ P, (36) then, specifying regular data as H = Ω := Rd × RD , M = U, Φ(h; µ) = hT µ + hT h : H × M → R, we ensure that the family S[H, M, Φ] contains the family of probability distributions P + = {P + [P ] : P ∈ P} on Ω. How useful is this (by itself pretty crude) observation in the context of our approach depends on how much information on P can be “captured” by a properly selected convex compact set U satisfying (36). We are about to consider in more details “quadratic lifting” – the case where Z(ζ) = ζζ T . 5.1.1 Quadratic lifting, Gaussian case Consider the situation where we are given • a nonempty bounded set U in Rm ; 22 • a nonempty convex compact subset U of the positive semidefinite cone Sd+ ; • a matrix Θ∗ ≻ 0 such that Θ∗  Θ for all Θ ∈ U ; • an affine mapping u 7→ A(u) = A[u; 1] : Rm → Ω = Rd , where A is a given d × (m + 1) matrix. Now, a pair (u ∈ U, Θ ∈ U ) specifies Gaussian random vector ζ ∼ N (A(u), Θ) and thus specifies a Borel probability distribution P [u, Θ] of (ζ, ζζ T ). Let Q(U, U ) be the family of probability distributions on Ω = Rd × Sd stemming in this fashion from Gaussian distributions with parameters from U × U . Our goal is to cover the family Q(U, U ) by a family of the type S[H, M, Φ], which, as it was already explained, would allow to use the machinery developed so far in order to decide on pairs of composite Gaussian hypotheses H1 : ζ ∼ N (u, Θ) with (u, Θ) ∈ U1 × U1 H2 : ζ ∼ N (u, Θ) with (u, Θ) ∈ U2 × U2 via tests based on detectors which are quadratic in ζ. It is convenient to represent a linear form on Ω = Rd × Sd as hT z + 12 Tr(HZ), where (h, H) ∈ Rd ×Sd is the “vector of coefficients” of the form, and (z, Z) ∈ Rd ×Sd is the argument of the form. We denote by b = [0; 0; ...; 0; 1] ∈ Rm+1 the last basic orth of Rm+1 . We assume that for some δ ≥ 0 it holds −1/2 − Ik ≤ δ ∀Θ ∈ U , (37) kΘ1/2 Θ∗ −1/2 −1/2  I, whence where k · k is the spectral norm. Observe that for every Θ ∈ U we have 0  Θ∗ ΘΘ∗ −1/2 1/2 kΘ Θ∗ k ≤ 1, that is, (37) satisfied with δ = 2. Thus, we can assume w.l.o.g. that  is always  A δ ∈ [0, 2]. Finally, we set B = . bT A desired “covering” of Q(U, U ) is given by the following Proposition 5.1 In the notation and under the assumptions of this section, let γ ∈ (0, 1) and a : Wm+1,m+1 = 1} be given, and let Z convex compact computationally tractable set Z ⊂ {W ∈ Sm+1 + contain all matrices Z(u) := [u; 1][u; 1]T with u ∈ U . Denoting by φZ (·) the support function of Z: φZ (W ) = max Tr(ZW ) : Sm+1 → R, Z∈Z let us set −1 H = Hγ := {(h, H) ∈ Rd × Sd : −γΘ−1 ∗  H  γΘ∗ } M = U, 1/2 1/2 1/2 1/2 δ(2−δ) kΘ∗ HΘ∗ k2F Φ(h, H; Θ) = − 21 ln Det(I − Θ∗ HΘ∗ ) + 12 Tr([Θ − Θ∗ ]H) + 2(1−γ) +ΓZ (h, H) : H × U → R, [k · kF is the Frobenius norm]  T hbT + AT HA + B T [H, h]T [Θ−1 − H]−1 [H, h]B + A ΓZ (h, H) = 21 φZ bhT A ∗    = 1 2 φZ BT  h H hT  (38) −1 [H, h] B . + [H, h]T [Θ−1 ∗ − H] Then H, M, Φ form a regular data, and Q(U, U ) ⊂ S[H, M, Π]. (39) Besides this, function Φ(h, H; Θ) is coercive in the convex argument: whenever (hi , Hi ) ∈ H and k(hi , Hi )k → ∞ as i → ∞, we have Φ(hi , Hi ; Θ) → ∞, i → ∞, for every Θ ∈ U . 23 For proof, see Appendix A.3. Note that constraint uT Qu + 2q T u + r ≤ 0 which is valid   everyquadratic Q q Z ≤ 0 which is valid for all matrices Z(u), u ∈ U , and on U induces a linear constraint Tr T q r thus can be incorporated into the description of Z. Special case. In the situation of Proposition 5.1, let u vary in a convex compact set U . In this case, the simplest way to define Z such that Z(u) ∈ Z for all u ∈ U is to set     V u : W  0, u ∈ U . Z= W = T u 1 Let us compute the function Φ(h, 0; Θ). Setting A = [Ā, a], where a is the last column of A, direct computation yields Φ(h, 0; Θ) = =  ĀT h h Ā 2a h + hT Θ∗ h   1 max hT Au + hT Θ∗ h . u∈U 2 1 φZ 2 T T  =   V 1 max 2uT ĀT h + 2aT h + hT Θ∗ h : uT 2 V,u u 1   0, u ∈ U  Now imagine that we are given two collections (Aχ , Uχ , Uχ ), χ = 1, 2, of the (A, U, U )-data, with the same number of rows in A1 and A2 and have associated with Uχ -upper bounds Θ∗,χ on matrices Θ ∈ Uχ . We want to use Proposition 5.1 to build an affine detector capable to decide on the hypotheses H1 and H2 on the distribution of observation ω, with Hχ stating that this observation is N (Aχ [u; 1], Θ) with some u ∈ Uχ and Θ ∈ U χ. To this end, we have to solve the convex-concave saddle point problem SV = min max h Θ1 ∈U1 , Θ2 ∈U2 1 [Φ1 (−h, 0; Θ1 ) + Φ2 (h, 0; Θ2 )] , 2 where Φ1 , Φ2 are the functions associated, as explained in Proposition 5.1, with the first, respectively, with the second collection of the (A, U, U )-data. In view of the above computation, this boils down to the necessity to solve the convex minimization problem      1 1 T 1 SV = min max . h Θ∗,1 h + hT Θ∗,2 h + hT [A2 [u2 ; 1] − A1 [u1 ; 1]]  h  u1 ∈U1 , 2 2 2 u ∈U 2 2 An optimal solution h∗ to this problem induces the affine detector   1 1 T T T T h [Θ∗,1 − Θ∗,2 ]h∗ + max [−h∗ A1 [u1 ; 1]] − max h∗ A2 [u2 ; 1] , φ∗ (ω) = h∗ ω + a, a = u1 ∈U1 u2 ∈U2 2 2 ∗ and the risk of this detector on the pair of families G1 , G2 of Gaussian distributions in question is exp{SV}. On the other hand, we could build affine detector for the families G1 , G2 by the machinery from section 3.2.3, that is, by solving convex-concave saddle point problem   1 1 T 1 T T T SV = min max −h A1 [u1 ; 1] + h A2 [u2 , 1] + h Θ1 h + h Θ2 h ; h u1 ∈U1 ,Θ1 ∈U1 , 2 2 2 u ∈U ,Θ ∈U 2 2 2 2 the risk of the resulting affine detector on G1 , G2 is exp{SV}. Now assume that (!) Uχ , χ = 1, 2, have -maximal elements, and these elements are selected as Θ∗,χ . 24 ρ 0.5 0.5 0.01 σ1 2 1 1 Table unrestricted σ2 H =0 h=0 H and h 2 0.31 0.31 1.00 4 0.24 0.39 0.62 4 0.41 1.00 0.41 1: Risk of quadratic detector In this case the above computation says that SV and SV are the minimal values of identically equal to each other functions and thus are equal to each other. Thus, in the case of (!) the machinery of Proposition 5.1 produces a quadratic detector which can be only better, in terms of risk, than the affine detector yielded by Proposition 3.3.8 Numerical illustration. To get an impression of the performance of quadratic detectors as compared to affine ones in the case of (!), we present here the results of experiment where U1 = U1ρ = {u ∈ R12 : ui ≥ ρ, 1 ≤ i ≤ 12}, U2 = U2ρ = −U1ρ , A1 = A2 ∈ R8×12 , and Uχ = {Θ∗,χ = σχ2 I8 } are singletons. The risks of affine, quadratic and “purely quadratic” (with h set to 0) detectors on the pair G1 , G2 of families of Gaussian distributions, with Gχ = {N (θ, Θ∗χ ) : θ ∈ Aχ Uχρ }, ar given in Table 1. We see that • when deciding on families of Gaussian distributions with common covariance matrix and expectations varying in associated with the families convex sets, passing from affine detectors described by Proposition 3.3 to quadratic detectors, does not affect the risk (first row in the table). This is a general fact: by the results of [13], in the situation in question affine detectors are optimal in terms of risk among all possible detectors. • when deciding on families of Gaussian distributions in the case where distributions from different families can have close expectations (third row in the table), affine detectors are useless, while the quadratic ones are not, provided that Θ∗,1 differs from Θ∗,2 . This is how it should be – we are in the case where the first moments of the distribution of the observation bear no definitive information on the family this distribution belongs to, which makes affine detectors useless. In contrast, quadratic detectors are able to utilize information (valuable when Θ∗,1 6= Θ∗,2 ) “stored” in the second moments of the observation. • “in general” (second row in the table), both affine and purely quadratic components in a quadratic detector are useful; suppressing one of them can increase significantly the attainable risk. 5.1.2 Quadratic lifting: Bounded observations It is convenient to represent a “quadratically lifted observation” (ζ, ζζ T ) by the matrix  T  ζ ζζ Z(ζ) = ∈ Sd+1 . ζT 1 8 This seems to be tautology – there are more quadratic detectors than affine ones, so that the best risk achievable with quadratic detectors can be only smaller than the best risk achievable with affine detectors. The point, however, is that Proposition 5.1 does not guarantee building the best, in terms of its risk, quadratic detector, it deals with “computationally tractable approximation” of this problem. As a result, the quadratic detector constructed in the latter proposition can, in principle, be worse than the affine detector yielded by Proposition 3.3. 25 Assume that all distributions from P are supported on the solution set X of a system of quadratic constraints fℓ (ζ) := ζ T Aℓ ζ + 2aTℓ ζ + αℓ ≤ 0, 1 ≤ ℓ ≤ L, P where Aℓ ∈ Sd are such that ℓ λ̄ℓ Aℓ ≻ 0 for properly selected λ̄ℓ ≥ 0; as a consequence, X is bounded P (since f¯(ζ) := L ℓ=1 λ̄ℓ fℓ (ζ) is a strongly convex quadratic form which is ≤ 0 on X). Setting     Aℓ aℓ , Qℓ = , 1 ≤ ℓ ≤ L, Q0 = 1 aTℓ αℓ observe that the distribution P + of Z(ζ) induced by a distribution P ∈ P is supported on the closed convex set X + = {Z ∈ Sd+1 : Z  0, Tr(Q0 Z) = 1, Tr(Qℓ Z) ≤ 0, ℓ = 1, ..., L} which is bounded9 . The support function of this set is    Z  0, Zd+1,d+1 = 1 φX + (H) = max Tr(HZ) = max Tr(HZ) : Tr(Qℓ Z) ≤ 0, 1 ≤ ℓ ≤ L Z Z∈X + Recalling Example 4 in section 2.2 and section 2.3.5, we arrive at the regular data  Tr((h − g)µ) + 18 [φX+ (h − g) + φX+ (g − h)]2 + φX+ (g) H = Sd+1 , M = X + , Φ(h, µ) = inf g∈Sd+1 such that ∀P ∈ P : P + ∈ S[Sd+1 , {e[P + ]}, Φ(·, e[P + ])], where e[P + ] is the expectation of P + , and therefore P + = {P + : P ∈ P} ⊂ S[Sd+1 , M, Φ]. References [1] L. Birgé. Approximation dans les spaces métriques et théorie de l’estimation: inégalités de Cràmer-Chernoff et théorie asymptotique des tests. PhD thesis, Université Paris VII, 1980. [2] L. Birgé. Vitesses maximales de décroissance des erreurs et tests optimaux associés. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 55(3):261–273, 1981. [3] L. Birgé. Sur un théorème de minimax et son application aux tests. Probab. Math. Stat., 3:259– 282, 1982. [4] L. Birgé. Approximation dans les espaces métriques et théorie de l’estimation. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 65(2):181–237, 1983. [5] L. Birgé. Model selection via testing: an alternative to (penalized) maximum likelihood estimators. In Annales de l’Institut Henri Poincare (B) Probability and Statistics, volume 42, pages 273–325. Elsevier, 2006. [6] L. Birgé. Robust tests for model selection. In M. Banerjee, F. Bunea, J. Huang, V. Koltchinskii, , and M. Maathuis, editors, From Probability to Statistics and Back: High-Dimensional Models and Processes – A Festschrift in Honor of Jon A. Wellner, pages 47–64. Institute of Mathematical Statistics, 2013. P + indeed, for large λ0 > 0, the matrix Q = λ0 Q0 + L is contained ℓ=1 λ̄ℓ Qℓ is positive definite, and we conclude that X d+1 in the bounded set {Z ∈ S : Z  0, Tr(QZ) ≤ λ0 }. 9 26 [7] M. Burnashev. On the minimax detection of an imperfectly known signal in a white noise background. Theory Probab. Appl., 24:107–119, 1979. [8] M. Burnashev. Discrimination of hypotheses for gaussian measures and a geometric characterization of the gaussian distribution. Math. Notes, 32:757–761, 1982. [9] H. Chernoff. A measure of asymptotic efficiency for tests of a hypothesis based on the sum of observations. The Annals of Mathematical Statistics, pages 493–507, 1952. [10] D. Donoho and R. Liu. Geometrizing rate of convergence I. Technical report, Tech. Report 137a, Dept. of Statist., University of California, Berkeley, 1987. [11] D. L. Donoho and R. C. Liu. Geometrizing rates of convergence, II. The Annals of Statistics, pages 633–667, 1991. [12] A. Goldenshluger. A universal procedure for aggregating estimators. The Annals of Statistics, pages 542–568, 2009. [13] A. Goldenshluger, A. Juditsky, and A. Nemirovski. Hypothesis testing by convex optimization. Electronic Journal of Statistics, 9(2):1645–1712, 2015. [14] J.-B. Hiriart-Urruty and C. Lemarechal. Convex analysis and minimization algorithms i: Fundamentals (grundlehren der mathematischen wissenschaften). 1993. [15] Y. Ingster and I. A. Suslina. Nonparametric goodness-of-fit testing under Gaussian models, volume 169 of Lecture Notes in Statistics. Springer, 2002. [16] C. Kraft. Some conditions for consistency and uniform consistency of statistical procedures. Univ. of California Publ. Statist., 2:493–507, 1955. [17] L. Le Cam. Convergence of estimates under dimensionality restrictions. The Annals of Statistics, pages 38–53, 1973. A Proofs A.1 Proof of Proposition 2.1 All we need is to verify (5) and to check that the right hand side function in this relation is convex. The latter is evident, since φX (h) + φX (−h) ≥ 2φX (0) = 0 and φX (h) + φX (−h) is convex. To verify (5), let us fix P ∈ P[X] and h ∈ Rd and set ν = hT e[P ], so that ν is the expectation of hT ω with ω ∼ P . Note that −φX (−h) ≤ ν ≤ φX (h), so that (5) definitely holds true when φX (h) + φX (−h) = 0. Now let η := 1 2 [φX (h) + φX (−h)] > 0, and let a= 1 2 [φX (h) − φX (−h)] , β = (ν − a)/η. Denoting by Ph the distribution of hT ω induced by the distribution P of ω and noting that this distribution is supported on [−φX (−h), φX (h)] = [a − η, a + η] and has expectation ν, we get β ∈ [−1, 1] 27 and γ := for all λ ∈ R. Hence, Z T exp{h ω}P (dω) = Z a+η a−η  [es − λ(s − ν)]Ph (ds)    t ln(γ) ≤ inf ln max [e − λ(s − ν)] = a + inf ln max [e − ρ(t − [ν − a])] ρ a−η≤s≤a+η −η≤t≤η λ     t t = a + inf ln max [e − ρ(t − ηβ)] ≤ a + ln max [e − ρ̄(t − ηβ) ρ s −η≤t≤η −η≤t≤η with ρ̄ = (2η)−1 (eη − e−η ). The function g(t) = et − ρ̄(t − ηβ) is convex on [−η, η], and g(−η) = g(η) = cosh(η) + β sinh(η), which combines with the above computation to yield the relation ln(γ) ≤ a + ln(cosh(η) + β sinh(η)), (40) ∀(η > 0, β ∈ [−1, 1]) : βη + 12 η 2 − ln(cosh(η) + β sinh(η)) ≥ 0. (41) and all we need to verify is that Indeed, if (41) holds true (40) implies that ln(γ) ≤ a + βη + 21 η 2 = ν + 21 η 2 , which, recalling what γ, ν and η are, is exactly what we want to prove. Verification of (41) is as follows. The left hand side in (41) is convex in β for β > − cosh(η) sinh(η) containing, due to η > 0, the range of β in (41). Furthermore, the minimum of the left hand side of cosh(η) (41) over β > − coth(η) is attained when β = sinh(η)−η and is equal to η sinh(η) r(η) = 21 η 2 + 1 − η coth(η) − ln(sinh(η)/η). All we need to prove is that the latter quantity is nonnegative whenever η > 0. We have r ′ (η) = η − coth(η) − η(1 − coth2 (η)) − coth(η) + η −1 = (η coth(η) − 1)2 η −1 ≥ 0, and since r(+0) = 0, we get r(η) ≥ 0 when η > 0. A.2  Proof of Proposition 4.1 ℓ Let Dℓ denote the collection of regular data processed by Aℓδ K . Let, further, the K-repeated random K observation ω , the probability distribution P̄ , index ī ≤ I and vector µ̄ ∈ Mī be as in the premise of the proposition, let ḡ = Gµ̄, and let ℓ∗ ≤ L be such that kḡ − gℓ∗ k2 ≤ kḡ − gℓ k2 , ℓ = 1, ..., L. Finally, let E be the event “for every ℓ = 1, ..., L such that P̄ obeys one or more of the hypotheses HSi [D], ℓ D ∈ Dℓ , processed by procedure Aℓδ K , this procedure correctly recovers the color of these hypotheses.” By construction and due to the union bound, the P̄ K -probability of E is at least 1 − ǫ. It follows that all we need to verify the claim of the proposition is to show that when ω K ∈ E, relation (33) takes place. Thus, let us fix ω K ∈ E. ℓ δ Observe, first, that ḡ ∈ Vℓ∗ , whence µ̄ ∈ Wℓī∗ . Thus, when running AK∗ ℓ∗ , P̄ K obeys a red one ℓ δℓ∗ among the hypotheses HSi [D], D ∈ Dℓ∗ processed by AK∗ 28 , and since we are in the case of ω K ∈ E, gℓ∗ gets a color, namely, color “red.” By construction of our aggregation procedure, its output can be either gℓ∗ – and in this case (33) clearly holds true, or another vector, let it be denoted gℓ+ (ℓ+ 6= ℓ∗ ), which was also assigned red color. We claim that the vector ḡ = Gµ̄ satisfies the relation uTℓ+ ℓ∗ ḡ < vℓ+ ℓ∗ + δℓ+ . (42) īδℓ Indeed, otherwise we have µ̄ ∈ Wℓ+ ℓ+∗ , meaning that P̄ K obeys a hypothesis HSi [D] processed when ℓ+ δℓ+ running AK (i.e., with D ∈ Dℓ+ ), and this hypothesis is blue. Since we are in the case of E, this ℓ+ δℓ implies that the color inferred by AK + is “blue,” which is a desired contradiction. Now we are nearly done: indeed, gℓ∗ is the k · k2 closest to ḡ point among g1 , ..., gL , implying that uTℓ+ ℓ∗ ḡ ≥ vℓ+ ℓ∗ . (43) Recalling what uℓ∗ ℓ+ and vℓ∗ ℓ+ are, the relations (42) and (43) tell us the following story about the points ḡ, g∗ := gℓ∗ , g+ := gℓ+ and the hyperplane H = {g ∈ Rm : uℓ∗ ℓ+ g = vℓ∗ ℓ+ }: g∗ and g+ are symmetric to each other w.r.t. H, and ḡ is at most at the distance δ := δℓ+ of H. An immediate observation is that in this case kg+ − ḡk2 ≤ kg∗ − ḡk2 + 2δ, (44) and we arrive at (33). To justify (44) note that by shift and rotation we can reduce the situation to the one when g∗ , g+ , ḡ belong to the linear span of the first two basic orhts with the first two coordinates of these three vectors being, respectively, [−r; 0] (for g∗ ), [r; 0] (for g+ ) and [d; h] (for ḡ), with |d| ≤ δ. Hence kg+ − ḡk2 − kg∗ − ḡk2 = [(r−d)2 +h2 ]−[(r+d)2 +h2 ] kg+ −ḡk2 +kg∗ −ḡk2 = −4rd kg+ −ḡk2 +kg∗ −ḡk2 ≤ 4rδ kg+ −g∗ k2 = 2δ, as claimed. A.3 10 .  Proof of Proposition 5.1 For any u ∈ Rm , h ∈ Rd , Θ ∈ Sd+ and H ∈ Sd such that −I ≺ Θ1/2 HΘ1/2 ≺ I we have   Ψ(h, H; u, Θ) := ln Eζ∼N (A(u),Θ) exp{hT ζ + 12 ζ T Hζ} o n  = ln Eξ∼N (0,I) exp{hT [A(u) + Θ1/2 ξ] + 21 [A(u) + Θ1/2 ξ]T H[A(u) + Θ1/2 ξ] = − 21 ln Det(I − Θ1/2 HΘ1/2 ) +hT A(u) + 21 A(u)T HA(u) + 21 [HA(u) + h]T Θ1/2 [I − Θ1/2 HΘ1/2 ]−1 Θ1/2 [HA(u) + h]   = − 21 ln Det(I − Θ1/2 HΘ1/2 ) + 12 [u; 1]T bhT A + AT hbT + AT HA [u; 1] h i (45) + 21 [u; 1]T B T [H, h]T Θ1/2 [I − Θ1/2 HΘ1/2 ]−1 Θ1/2 [H, h]B [u; 1] (because hT A(u) = [u; 1]T bhT A[u; 1] = [u; 1]T AT hbT [u; 1] and HA(u) + h = [H, h]B[u; 1]). −1 Observe that when (h, H) ∈ Hγ , we have Θ1/2 [I−Θ1/2 HΘ1/2 ]−1 Θ1/2 = [Θ−1 −H]−1  [Θ−1 ∗ −H] , so that (45) implies that for all u ∈ Rm , Θ ∈ U , and (h, H) ∈ Hγ , Ψ(h, H; u, Θ) ≤ − 21 ln Det(I − Θ1/2 HΘ1/2 )   −1 + 12 [u; 1]T bhT A + AT hbT + AT HA + B T [H, h]T [Θ−1 ∗ − H] [H, h]B [u; 1] {z } | Q[H,h] = − 12 ln Det(I − Θ 1/2 HΘ 1/2 )+ 1 2 Tr(Q[H, h]Z(u)) ≤ − 12 ln Det(I − Θ1/2 HΘ1/2 ) + ΓZ (H, h) 29 (46) (we have taken into account that Z(u) ∈ Z when u ∈ U (premise of the proposition) and therefore Tr(Q[H, h]Z(u)) ≤ φZ (Q[H, h])). 20 . Now let us upper-bound the function G(h, H; Θ) = − 21 ln Det(I − Θ1/2 HΘ1/2 ) on the domain (h, H) ∈ Hγ , Θ ∈ U . For (h, H) ∈ Hγ and Θ ∈ U fixed we have −1/2 kΘ1/2 HΘ1/2 k = k[Θ1/2 Θ∗ ≤ kΘ 1/2 −1/2 T 1/2 1/2 ][Θ∗ HΘ∗ ][Θ1/2 Θ∗ 1/2 1/2 −1/2 Θ∗ k2 kΘ∗ HΘ∗ k ≤ ] k 1/2 1/2 kΘ∗ HΘ∗ k =: d(H) ≤ γ (47) −1/2 −1/2 (we have used the fact that 0  [Θ1/2 Θ∗ ]T [Θ1/2 Θ∗ ]  I due to 0  Θ  Θ∗ , whence −1/2 kΘ1/2 Θ∗ k ≤ 1). Denoting by k · kF the Frobenius norm of a matrix and noting that kABkF ≤ kAkkBkF , computation completely similar to the one in (47) yields 1/2 1/2 kΘ1/2 HΘ1/2 kF ≤ kΘ∗ HΘ∗ kF =: D(H). (48) Besides this, setting F (X) = − ln Det(X) : int Sd+ → R and equipping Sd with the Frobenius inner 1/2 1/2 product, we have ∇F (X) = −X −1 , so that with R0 = Θ∗ HΘ∗ , R1 = Θ1/2 HΘ1/2 , and ∆ = R1 −R0 , we have for properly selected λ ∈ (0, 1) and Rλ = λR0 + (1 − λ)R1 : F (I − R1 ) = F (I − R0 − ∆) = F (I − R0 ) + h∇F (I − Rλ ), −∆i = F (I − R0 ) + h(I − Rλ )−1 , ∆i = F (I − R0 ) + hI, ∆i + h(I − Rλ )−1 − I, ∆i. We conclude that F (I − R1 ) ≤ F (I − R0 ) + Tr(∆) + kI − (I − Rλ )−1 kF k∆kF . (49) Denoting by µi the eigenvalues of Rλ and noting that kRλ k ≤ max[kR0 k, kR1 k] = d(H) ≤ γ (see µi 1 = − 1−µ of I − (I − Rλ )−1 satisfy (47)), we have |µi | ≤ γ, and therefore eigenvalues νi = 1 − 1−µ i i |νi | ≤ |µi |/(1 − µi ) ≤ |µi |/(1 − γ), whence kI − (I − Rλ )−1 kF ≤ kRλ kF /(1 − γ). Noting that kRλ kF ≤ max[kR0 kF , kR1 kF ] ≤ D(H), see (48), we conclude that kI − (I − Rλ )−1 kF ≤ D(H)/(1 − γ), so that (49) yields F (I − R1 ) ≤ F (I − R0 ) + Tr(∆) + D(H)k∆kF /(1 − γ). −1/2 Further, by (37) the matrix D = Θ1/2 Θ∗ (50) − I satisfies kDk ≤ δ, whence 1/2 1/2 1/2 1/2 HΘ = (I + D)R0 (I + D T ) − R0 = DR0 + R0 D T + DR0 D T . ∆=Θ HΘ {z }−Θ | | ∗ {z ∗ } R1 R0 Consequently, k∆kF ≤ kDR0 kF + kR0 D T kF + kDR0 D T kF ≤ [2kDk + kDk2 ]kR0 kF ≤ δ(2 + δ)kR0 kF = δ(2 + δ)D(H). This combines with (50) and the relation 1/2 1/2 Tr(∆) = Tr(Θ1/2 HΘ1/2 − Θ∗ HΘ∗ ) = Tr([Θ − Θ∗ ]H) 30 to yield F (I − R1 ) ≤ F (I − R0 ) + Tr([Θ − Θ∗ ]H) + and we conclude that for all (h, H) ∈ Hγ and Θ ∈ U , δ(2 + δ) 1/2 1/2 kΘ∗ HΘ∗ k2F , 1−γ G(h, H; Θ) = 12 F (I − R1 ) δ(2 + δ) 1/2 1/2 1/2 1 b H; Θ) := − 1 ln Det(I − Θ1/2 ≤ G(h, kΘ∗ HΘ∗ k2F .(51) ∗ HΘ∗ ) + 2 Tr([Θ − Θ∗ ]H) + 2 2(1 − γ) b H; Θ) clearly is convex-concave and continuous on H × M = Hγ × U . Note that G(h, 30 . Combining (51), (46), (38) and the origin of Ψ, see (45), we arrive at   ∀((u, Θ) ∈ U × U , (h, H) ∈ Hγ = H) : ln Eζ∼N (u,Θ) exp{hT ζ + 12 ζ T Hζ} ≤ Φ(h, H; Θ). This is all we need, up to verification of the claim that H, M, Φ is regular data, which boils down to checking that Φ : H × M → R is convex-concave and continuous. The latter check, recalling that b H; Θ) : H × M indeed is convex-concave and continuous, reduces to verifying that Γ(h, H) is G(h, convex and continuous on Hγ . Recalling that Z is nonempty compact set, the function φZ (·) : Sd+1 is continuous, implying the continuity of Γ(h, H) = 12 φZ (Q[H, h]) on H = Hγ (Q[H, h] is defined in (46)). To prove convexity of Γ, note that Z is contained in Sm+1 , implying that φZ (·) is convex and + -monotone. On the other hand, by Schur Complement Lemma, we have S :=  {(h, H, G) : G (h, H) ∈ Hγ }     Q[H, h], G − [bhT A + AT hB + AT HA] B T [H, h]T  0, (h, H) ∈ Hγ , = (h, H, G) : [H, h]B Θ−1 ∗ −H implying that S is convex. Since ΦZ (·) is -monotone, we have {(h, H, τ ) : (h, H) ∈ Hγ , τ ≥ Γ(h, H)} = {(h, H, τ ) : ∃G : G  Q[H, h], 2τ ≥ φZ (G), (h, H) ∈ Hγ }, and we see that the epigraph of Γ is convex (since the set S and the epigraph of φZ are so), as claimed. 40 . It remains to prove that Φ is coercive in H, h. Let Θ ∈ U and (hi , Hi ) ∈ Hγ with k(hi , Hi )k → ∞ as i → ∞, and let us prove that Φ(hi , Hi ; Θ) → ∞. Looking at the expression for Φ(hi , Hi ; Θ), it is immediately seen that all terms in this expression, except for the terms coming from φZ (·), remain bounded as i grows, so that all we need to verify is that the φZ (·)-term goes to ∞ as i → ∞. Observe that Hi are uniformly bounded due to (hi , Hi ) ∈ Hγ , implying that khi k2 → ∞ as i → ∞. Denoting by e the last basic orth of Rd+1 and by b, as before, the last basic orth of Rm+1 , note that, by construction, B T e = b. Now let W ∈ Z, so that Wm+1,m+1 = 1. Taking into account that the −1 satisfy αI  [Θ−1 − H ]−1  βI for some positive α, β due to H ∈ H , matrices [Θ−1 i i γ d d ∗ ∗ − Hi ] observe that      T Hi hi T −1 −1 −1 + [Hi , hi ] [Θ∗ − Hi ] [Hi , hi ] = hTi [Θ−1 ∗ − Hi ] hi ee + Ri , T hi | {z } | {z } αi khi k2 2 Qi where αi ≥ α > 0 and kRi kF ≤ C(1 + khi k2 ). As a result, φZ (B T Qi B) ≥ Tr(W B T Qi B) = Tr(W B T [αi khi k22 eeT + Ri ]B) = αi khi k22 Tr(W bbT ) −kBW B T kF kRi kF ≥ αkhi k22 − C(1 + khi k2 )kBW B T kF , | {z } =Wm+1,m+1 =1 and the concluding quantity tends to ∞ as i → ∞ due to khi k2 → ∞, i → ∞. 31 
10math.ST
arXiv:1303.2208v2 [math.AC] 23 Jun 2014 ON THE RELATIVE COHEN-MACAULAY MODULES MAJID RAHRO ZARGAR Abstract. Let R be a commutative Noetherian local ring and let a be a proper ideal of R. In this paper, as a main result, it is shown that if M is a Gorenstein R-module with c = ht M a, then Hia (M ) = 0 for all i 6= c is completely encoded in homological properties of Hca (M ), in particular in its Bass numbers. Notice that, this result provides a generalization of a result of Hellus and Schenzel which has been proved before, as a main result, in the case where M = R. 1. introduction Throughout this paper, R is a commutative Noetherian ring, a is a proper ideal of R and M is an R-module. For a prime ideal p of R, the residue class field Rp /pRp is denoted by k(p). For each non-negative integer i, let Hia (M ) denotes the i-th local cohomology module of M with respect to a; see [1] for its definition and basic results. A Gorenstein module over a local ring R is a maximal Cohen-Macaulay module of finite injective dimension. This concept was introduced by Sharp in [7] and studied extensively by him and other authors. In the present paper, we will use the concept of relative Cohen-Macaulay modules which is a generalization of the concept of Cohen-Macaulay modules. This kind of modules has been studied in [3] under the title of cohomologically complete intersections and continued in [5]. In [3] Hellus and Schenzel, as a main result, showed that if (R, m, k) is a Gorenstein local ring and a is an ideal of R with ht R a = c and dim R/a = d such that R is relative Cohen-Macaulay in V(a) \ {m}, then the following statements are equivalent. (i) Hia (R) = 0 for all i 6= c, i.e R is relative Cohen-Macaulay with respect to a. (ii) Hd (Hc (R)) ∼ = ER (k) and Hi (Hc (R)) = 0 for all i 6= d. m a m a (iii) ExtdR (k, Hca (R)) ∼ = k and ExtiR (k, Hca (R)) = 0 for all i 6= d. (iv) µi (m, Hca (R)) = δdi . Moreover, if a satisfies the above conditions, it follows that R̂a ∼ = HomR (Hca (R), Hca (R)) and ExtiR (Hca (R), Hca (R)) = 0 for all i 6= 0, where R̂a denotes the a-adic completion of R. 2010 Mathematics Subject Classification. Primary: 13D45; Secondary: 13C14. Key words and phrases. Local cohomology, Gorenstein module, relative Cohen-Macaulay. This research was in part supported by a grant from IPM (No. 92130024). 1 2 M. R. ZARGAR As a main result, in Theorem 2.9, we generalize the above result for a Gorenstein R-module M . Indeed, it is shown that if M is a Gorenstein R-module with c = ht M a and d = dim M/aM such that M is relative Cohen-Macaulay in SuppR (M/aM ) \ {m}, then the following statements are equivalent. (i) Hia (M ) = 0 for all i 6= c, i.e M is relative Cohen-Macaulay with respect to a. (ii) Hdm (Hca (M )) ∼ = ER (k)r(M ) and Him (Hca (M )) = 0 for all i 6= d. (iii) Extd (k, Hc (M )) ∼ = kr(M ) and Exti (k, Hc (M )) = 0 for all i 6= d. R R a a (iv) µi (m, Hca (M )) = r(M )δdi . Moreover, if a satisfies the above conditions, it follows that HomR (M, M ) ⊗R R̂a ∼ = i c c c c HomR (Ha (M ), Ha (M )) and ExtR (Ha (M ), Ha (M )) = 0 for all i 6= 0, where r(M ) denotes the type of M . 2. Main results Definition 2.1. We say that a finitely generated R-module M is relative Cohen Macaulay with respect to a if there is precisely one non-vanishing local cohomology module of M with respect to a. Clearly this is the case if and only if grade (a, M ) = cd(a, M ), where cd(a, M ) denotes the cohomological dimension of M with respect to a, which is the largest integer i for which Hia (M ) 6= 0. Observe that the notion of relative Cohen-Macaulay module is connected with the notion of cohomologically complete intersection ideal which has been studied in [3]. Remark 2.2. Let M be a relative Cohen-Macaulay module with respect to a and let cd(a, M ) = n. Then, in view of [1, Theorems 6.1.4, 4.2.1, 4.3.2], it is easy to see that Supp Hna (M ) = Supp(M/aM ) and ht M a = grade (a, M ), where ht M a = inf{ dimRp Mp | p ∈ Supp(M/aM ) }. Definition 2.3. ( See [7, Theorem 3.11].) A non-zero finitely generated module M over a local ring (R, m) is said to be a Gorenstein R-module if the following equalities hold true depth M = dim M = idR M = dim R. Definition 2.4. For any prime ideal p of R, the i-th Bass number of M with respect to p is defined by µi (p, M ) := vdim k(p) ExtiRp (k(p), Mp ). If (R, m) is local and M is finitely generated of depth t, then the number µt (m, M ) is called type of M and is denoted by r(M ). Let M be a non-zero finitely generated module over a local ring (R, m) and let a be an ideal of R. Let E.R (M ) be a minimal injective resolution for M . It is a wellL i known fact that E.R (M )i = p∈Spec(R) µ (p, M )E R (R/p), where ER (R/p) denotes the injective hull of R/p. Now, let c = grade (a, M ). Then, Γa (E.R (M )i ) = 0 for all ON THE RELATIVE COHEN-MACAULAY MODULES 3 i < c. Therefore Hca (M ) = ker(Γa (E.R (M ))c −→ Γa (E.R (M ))c+1 ). This observation provides an embedding 0 −→ Hca (M )[−c] −→ Γa (E.R (M )) of complexes of R-modules where Hca (M )[−c] is considered as a complex concentrated in homological degree zero. Definition 2.5. ( See [4, Definition 4.1].) The cokernel of the embedding 0 −→ Hca (M )[−c] −→ Γa (E.R (M )) . (a) and is called the truncation complex. Therefore, there is a is denoted by CM short exact sequence . (a) −→ 0 0 −→ Hca (M )[−c] −→ Γa (E.R (M )) −→ CM . (a)) ∼ Hi (M ) for all i > c of complexes of R-modules. We observe that Hi (CM = a i . while H (CM (a)) = 0 for all i ≤ c. The following proposition is of assistance in the proof of the main result. Proposition 2.6. Assume that M is a Gorenstein module over a local ring R. Then, with the previous notation the following statements are true. (i) There is an exact sequence . . 0 → Ext0R (CM (a), M ) → HomR (M, M )⊗R R̂a → ExtcR (Hca (M ), M ) → Ext1R (CM (a), M ) → 0. i+1 c . ∼ (ii) There are isomorphisms Exti+c R (Ha (M ), M ) = ExtR (CM (a), M ) for all i > 0. (iii) Suppose that M is relative Cohen-Macaulay with respect to a. Then ∼ HomR (M, M ) ⊗R R̂a and Exti+c (Hc (M ), M ) = 0 for ExtcR (Hca (M ), M ) = a R all i 6= 0. Proof. We first notice that, since M is Gorenstein, R is Cohen-Macaulay and M̂ is a Gorenstein R̂-module. Now, let ωR̂ be a canonical module of the ring R̂. Then, in view of [2, Exercise 3.3.28], M̂ is isomorphic to a direct sum of finitely many copies of ωR̂ . Hence, one can use [2, Theorem 3.3.10(c)], [2, Theorem 3.3.4(d)] and the fact that Exti (M̂ , M̂ ) ∼ = Exti (M, M ) ⊗R R̂ for all i, to see that Exti (M, M ) = 0 for all R̂ R R i > 0 and that HomR (M, M ) is a flat R-module. (i): Let E . be a minimal injective resolution for M . Then, since E . is a bounded complex of injective R-modules, by applying the functor HomR (−, E . ) on the exact sequence of R-complexes in 2.5 we obtain the following short exact sequence of complexes . 0 −→ HomR (CM (a), E . ) −→ HomR (Γa (E . ), E . ) −→ HomR (Hca (M ), E . )[c] −→ 0. 4 M. R. ZARGAR Now, let x = x1 , . . . , xn be a generating set of the ideal a, and let Čx (R) be the ¯ ¯ Čech complex of R with respect to x. Then, in view of [6, Theorem 1.1], there ¯ exists an isomorphism RΓa (M ) ≃ Čx (R) ⊗L R M in the derived category. Now, since ¯ i ExtR (M, M ) = 0 for all i > 0, we see that HomR (M, M ) ≃ R HomR (M, M ). Thus, we get the following isomorphisms R HomR (RΓa (M ), M ) ≃ R HomR ((Čx (R) ⊗L R M ), M ) ¯ ≃ R HomR (Čx (R), R HomR (M, M )) ¯ ≃ R HomR (Čx (R), HomR (M, M )), ¯ in the derived category. Now, since HomR (M, M ) is flat, one can use [6, Theorem 1.1] and the above isomorphisms to deduce that Hi (R HomR (RΓa (M ), M ) = 0 for all i 6= 0 and that H0 (HomR (Γa (E . ), E . )) ∼ = HomR (M, M ) ⊗R R̂a . On the other hand, since Γa ((E . )i ) = 0 for all i < c = grade (a, M ) and HomR (N, X) = HomR (N, Γa (X)) for any a-torsion R-module N and for all R-modules X, one can deduce that ExtiR (Hca (M ), M ) = 0 for all i < c. Therefore, with the aid of the above considerations, the induced long exact cohomology sequence of the above exact sequence of complexes provides the statements (i) and (ii) of the claim. (iii): Assume that M is relative Cohen-Macaulay with respect to a. Then, one can . (a) is exact; and so the complex Hom (C . (a), E . ) easily check that the complex CM R M . (a), M ) = Hi (Hom (C . (a), E . )) = 0 for all i. is also exact. Therefore, ExtiR (CM R M Hence, the assertion follows from (i) and (ii).  The following lemma and definition are needed in the proof of the next result. Lemma 2.7. ( See [3, Proposition 4.1].) Let n be a non-negative integer and let M be an arbitrarily R-module over a local ring (R, m). Then the following conditions are equivalent. (i) Him (M ) = 0 for all i < n. (ii) ExtiR (R/m, M ) = 0 for all i < n. Definition 2.8. Let (R, m) be a local ring and let a be a proper ideal of R. Then, we say that a non-zero R-module M is relative Cohen-Macaulay in SuppR (M/aM )\{m}, whenever Mp is relative Cohen-Macaulay with respect to aRp and cd(aRp , Mp ) = c for all p ∈ SuppR (M/aM ) \ {m}, where c = ht M a. The following theorem extends the main result [3, Theorem 0.1]. Theorem 2.9. Let a be an ideal of a local ring (R, m, k) and M a Gorenstein Rmodule. Suppose that M is relative Cohen-Macaulay in SuppR (M/aM ) \ {m}. Set c := ht M a and d := dim M/aM . Then the following statements are equivalent. (i) Hia (M ) = 0 for all i 6= c, i.e M is relative Cohen-Macaulay with respect to a. ON THE RELATIVE COHEN-MACAULAY MODULES 5 (ii) Hdm (Hca (M )) ∼ = ER (k)r(M ) and Him (Hca (M )) = 0 for all i 6= d. (iii) Extd (k, Hc (M )) ∼ = kr(M ) and Exti (k, Hc (M )) = 0 for all i 6= d. (iv) a R c i µ (m, Ha (M )) R a = r(M )δdi . Moreover, if one of the above statements holds, then ExtiR (Hca (M ), Hca (M )) = 0 for all i 6= 0 and HomR (Hc (M ), Hc (M )) ∼ = HomR (M, M ) ⊗R R̂a , where R̂a denotes the a a a-adic completion of R. Proof. (i)⇒(ii): First, we can use [5, Proposition 2.8] and the assumption to see that Him (Hca (M )) ∼ = Hi+c m (M ) for all i ≥ 0. Now, since M is Cohen-Macaulay of d c dimension n, Hm (Ha (M )) ∼ = Hnm (M ) and Him (Hca (M )) = 0 for all i 6= d. On the other hand, in view of [5, Theorem 2.5] and the assumption, Hnm (M ) is an injective R-module. Therefore, one can use [5, Corollay 2.2] to achieve the isomorphism r(M ) Hn (M ) ∼ . = ER (k) m (ii)⇒(iii): It follows from Lemma 2.7 that ExtiR (k, Hca (M )) = 0 for all i < d. On the other hand, since Hdm (Hca (M )) is injective, one can use [5, Proposition ∼ 2.1] to see that Exti (k, Hc (M )) = 0 for all d < i and that Extd (k, Hc (M )) = R R a a HomR (k, Hdm (Hca (M ))) ∼ = kr(M ) , and hence the assertion is done. The implications (iii)⇔(iv) is clear. (iii)⇒(ii): First, in view of Lemma 2.7, Him (Hca (M )) = 0 for all i < d. Now, since dimR Hca (M ) ≤ dimR M/aM = d, one can use the vanishing theorem to see that Him (Hca (M )) = 0 for all d < i. Therefore, [5, Proposition 2.1] implies that HomR (R/m, Hd (Hc (M ))) ∼ = kr(M ) , and so it is an Artinian R-module. Hence, by m a [1, Theorem 7.1.2], Hdm (Hca (M )) is Artinian. Thus, one can use [5, Corollary 2.2] to see that µ1 (m, Hdm (Hca (M ))) = µd+1 (m, Hca (M )) = 0 and µ0 (m, Hdm (Hca (M ))) = r(M ). Hence Hdm (Hca (M )) is an injective R-module, and so we obtain the isomorphism Hd (Hc (M )) ∼ = ER (k)r(M ) . m a (ii)⇒(i): Since M is relative Cohen-Macaulay in SuppR (M/aM )\{m}, one can use [5, Proposition 2.8] to deduce that Hi (Hc (Mp )) ∼ = Hi+c (Mp ) for all prime ideals p pRp aRp pRp in SuppR (M/aM )\{m} and for all i ∈ Z. On the other hand, since M is Gorenstein, one can use [5, Theorem 2.5] and [5, Corollay 2.2] to see that Hn (M ) ∼ = ER (k)r(M ) . m Therefore, the assertion follows from [4, Theorem 4.4]. Next, one can use Proposition 2.6(iii) and [5, Proposition 2.1] to establish the final assertion.  Next, we provide an example to show that even if, for all p ∈ SuppR (M/aM )\{m}, Mp is relative Cohen-Macaulay with respect to aRp , but with different cohomological dimensions, then Theorem 2.9 is no longer true. Example 2.10. Let k be a filed and R = k[[x, y, z]]. Set a := (xy, xz). Then, we have grade (a, R) = ht a = 1. Also, one can use Mayer-Vietoris sequence to see that 6 M. R. ZARGAR cd(a, R) = 2 and H1a (R) ∼ = H1(x) (R). On the other hand, it is easy to see that, for all prime ideals p in V(a) \ {m}, aRp = (x)Rp or aRp = (y, z)Rp ; and hence Rp is relative Cohen-Macaulay with respect to aRp for all prime ideals p in V(a) \ {m} with cd(aRp , Rp ) ∈ {1, 2}. Next, since Hi(x) (R) = 0 for all i 6= 1, one can see that Him (H1(x) (R)) ∼ = Hi+1 m (R) for all i. Hence, by using the fact that R is Gorenstein, we d 1 ∼ have H (H (R)) = ER (k) and Hi (H1 (R)) = 0 for all i 6= d, where d = dim R/a. m a m a Next, we single out a certain case of the above theorem for M = ωR , where ωR denotes a canonical module of a Cohen-Macaulay ring R. Corollary 2.11. Let (R, m, k) be a local Cohen-Macaulay ring which admits a canonical R-module ωR and let a be an ideal of R with ht R a = c and dim R/a = d. Suppose that ωR is relative Cohen-Macaulay in V(a) \ {m}. Then the following statements are equivalent. (i) Hia (ωR ) = 0 for all i 6= c. ∼ ER (k) and Hi (Hc (ωR )) = 0 for all i 6= d. (ii) Hdm (Hca (ωR )) = m a i (iii) Extd (k, Hc (ωR )) ∼ k and Ext (k, Hc (ωR )) = 0 for all i 6= d. = (iv) a R c i µ (m, Ha (ωR )) R a = δdi . Moreover, if a satisfies the above conditions, then ExtiR (Hca (ωR ), Hca (ωR )) = 0 for all i 6= 0 and R̂a ∼ = HomR (Hc (ωR ), Hc (ωR )), where R̂a denotes the a-adic completion of a a R. Proof. We first notice that Supp(ωR /aωR ) = Supp(ωR ) ∩ V(a) = V(a). Therefore, dim(ωR /aωR ) = dim(R/a) and ht R a = ht ωR a. On the other hand, one can use [2, Proposition 3.3.11] to see that ωR is a Gorenstein R-module of type 1 and that HomR (ωR , ωR ) ∼ = R. Hence, the assertion follows from Theorem 2.9.  The following corollary, which is an immediate consequence of Corollary 2.11, has been proved in [3, Theorem 0.1] as a main result. Corollary 2.12. Let (R, m, k) be a local Gorenstein ring and let a be an ideal of R. Set ht R a = c and dim R/a = d. Suppose that R is relative Cohen-Macaulay in V(a) \ {m}. Then the following statements are equivalent. (i) Hia (R) = 0 for all i 6= c, i.e R is relative Cohen-Macaulay with respect to a. (ii) Hd (Hc (R)) ∼ = ER (k) and Hi (Hc (R)) = 0 for i 6= d . m a m a (iii) ExtdR (k, Hca (R)) ∼ = k and ExtiR (k, Hca (R)) = 0 for all i 6= d. (iv) µi (m, Hca (R)) = δdi . Moreover, if one of the above conditions is satisfied, then R̂a ∼ = HomR (Hca (R), Hca (R)) and ExtiR (Hca (R), Hca (R)) = 0 for all i 6= 0. ON THE RELATIVE COHEN-MACAULAY MODULES 7 Acknowledgements. I am very grateful to Professor Hossein Zakeri for his kind comments and assistance in the preparation of this paper. Also, the author is grateful to the referee for careful reading and for suggesting several improvements of the manuscript. References [1] M. P. Brodmann and R. Y. Sharp, Local cohomology: an algebraic introduction with geometric applications, Cambridge University Press, Cambridge, 1998. [2] W. Bruns and J. Herzog, Cohen-Macaulay Rings, Cambridge University Press, Cambridge, 1993. [3] M. Hellus and P. Schenzel, On cohomologically complete intersections, J. Algebra 320 (10) (2008) 3733-3748. [4] M. Hellus and P. Schenzel, Notes on local cohomology and duality, J. Algebra 401 (1) (2014) 48-61. [5] M. Rahro Zargar and H. Zakeri, On injective and Gorenstein injective dimensions of local cohomology modules, Algebar. Colloq., to appear. [6] P. Schenzel, Proregular sequences, local cohomology, and completion, Math. Scand. 92 (2) (2003) 161-180. [7] R.Y. Sharp, Gorenstein Modules, Math. Z. 115 (2) (1970) 117-139. Majid Rahro Zargar, School of Mathematics, Institute for Research in Fundamental Sciences (IPM), P.O. Box: 19395-5746, Tehran, Iran. E-mail address: [email protected]
0math.AC
Distributed Bayesian Filtering using Logarithmic Opinion Pool for Dynamic Sensor Networks ? Saptarshi Bandyopadhyay a , Soon-Jo Chung b,1 , arXiv:1712.04062v1 [cs.SY] 11 Dec 2017 a b Jet Propulsion Laboratory, California Institute of Technology, Pasadena, CA 91109, USA Graduate Aerospace Laboratories, California Institute of Technology, Pasadena, CA 91125, USA Abstract The discrete-time Distributed Bayesian Filtering (DBF) algorithm is presented for the problem of tracking a target dynamic model using a time-varying network of heterogeneous sensing agents. In the DBF algorithm, the sensing agents combine their normalized likelihood functions in a distributed manner using the logarithmic opinion pool and the dynamic average consensus algorithm. We show that each agent’s estimated likelihood function globally exponentially converges to an error ball centered on the joint likelihood function of the centralized multi-sensor Bayesian filtering algorithm. We rigorously characterize the convergence, stability, and robustness properties of the DBF algorithm. Moreover, we provide an explicit bound on the time step size of the DBF algorithm that depends on the time-scale of the target dynamics, the desired convergence error bound, and the modeling and communication error bounds. Furthermore, the DBF algorithm for linear-Gaussian models is cast into a modified form of the Kalman information filter. The performance and robust properties of the DBF algorithm are validated using numerical simulations. Key words: Bayesian filtering, distributed estimation, sensor network, data fusion, logarithmic opinion pool. 1 Introduction A network of time-varying, heterogeneous sensing agents could use a distributed estimation algorithm to estimate the states of the target dynamics in a distributed manner. Potential applications include environment and pollution monitoring, analyzing communication and social networks, and tracking mobile targets in air, land, water, and space. In this paper, we present a new, discrete-time distributed estimation algorithm based on the logarithmic opinion pool that guarantees bounded convergence to the Bayesian-optimal probability distribution of the states of the target dynamics. ? S. Bandyopadhyay and S.-J. Chung were supported in part by the AFOSR grant (FA95501210193) and the NSF grant (IIS-1253758). This research was carried out in part at the Jet Propulsion Laboratory, California Institute of Technology, under a contract with the National Aeronautics and Space Administration. c 2017 California Institute of Technology. All rights reserved. Email addresses: [email protected] (Saptarshi Bandyopadhyay), [email protected] (Soon-Jo Chung). 1 Corresponding author. Tel.: +1 626 395 6294. Preprint submitted to Automatica Discrete-time distributed estimation algorithms can be broadly classified into three categories based on their representation of the states of the target dynamics. Algorithms in the first category only estimate the mean and the covariance matrix of the target’s states [1,2,3,4,5,6,7]. These algorithms usually deal with linearized target dynamics and measurement models, and also neglect information captured by the higher-order moments of the estimated probability distribution of the target’s states. The second category aims to reach an agreement across the sensor network over a discrete set of hypotheses about the states of the target [8,9,10]. Although these algorithms use the entire information in the estimated probability distribution of the target’s states, they are only applicable in cases where the target’s states can be represented by a discrete (finite) set of hypotheses. Therefore, these algorithms are not suitable for estimation over continuous domains. The third category of algorithms estimates the posterior probability distribution of the states of the target [11,12,13,14,15,16,17,18]. This category forms the most general class of distributed estimation algorithms because these algorithms can be used for estimation over continuous domains, and can incorporate nonlinear target dynamics, heterogeneous nonlinear measure- 13 December 2017 rithm for a time-varying, heterogeneous sensor network on a communication graph that is much sparser than a complete graph so that each agent’s estimate converges to this Bayesian-optimal posterior probability distribution of the target’s states. Furthermore, we assume that the time-varying communication network topology is periodically strongly connected and each agent can only communicate once with its neighboring agents during each time instant. ment models, and non-Gaussian uncertainties. These algorithms also use the entire information (i.e., not just the mean and the covariance matrix) in the estimated probability distribution of the target’s states. In light of these advantages, this paper focuses on the development of a distributed estimation algorithm that belongs to this third category. In third-category algorithms, the agents exchange their local probability distributions with their neighboring agents and combine them using fusion or diffusive coupling rules to estimate the aggregate probability distribution. Schemes for combining probability distributions in a distributed manner, like the Linear Opinion Pool (LinOP) and the Logarithmic Opinion Pool (LogOP), were first studied in the statistics literature [19,20,21,22,23]. The LogOP scheme is deemed ideal for this purpose because of its favorable properties (e.g., externally Bayesian) [22]. In this paper, we present the Distributed Bayesian Filtering (DBF) algorithm to address this open question. During each time instant, the agents exchange their normalized likelihood functions with their neighboring agents only once and then combine them using our fusion rule. Our fusion rule for combining arbitrary probability distributions relies on the LogOP scheme and the dynamic average consensus algorithm [24,25,26,27]. We show that after finite time instants, the estimated likelihood function of each agent converges to an error ball centered on the joint likelihood function of the centralized multi-sensor Bayesian filtering algorithm. We also provide an explicit upper bound on the time step size of the DBF algorithm that depends on the time-scale of the target dynamics and the convergence error bound. Moreover, we analyze the effect of communication and modeling errors on the DBF algorithm. If the target dynamics are linear-Gaussian models, we show that the DBF algorithm can be simplified to the modified (Kalman) information filter. Finally, we show that the distributed estimation algorithms in [14,15] are special cases of the DBF algorithm. We now focus on distributed estimation algorithms that use the LogOP scheme. The first such algorithm is proposed in [11]. In particular, [12] generates informationtheoretically-optimal weights for the LogOP scheme. Combining probability distributions within the exponential family (i.e., probability distributions that can be expressed as exponential functions) is discussed in [13,14]. In the distributed estimation algorithm presented in [16] as well as in our prior work [17,18], the agents combine their local posterior probability distributions using the consensus algorithm, where the multiple consensus loops within each time step are executed much faster than the original time steps of the Bayesian filter. Moreover, [16,17,18] show that each agent’s estimated probability distribution of the target’s states converges around the pdf that minimizes the sum of Kullback–Leibler (KL) divergences from all the posterior probability distributions of the target’s states. Similar algorithms for combining local likelihood functions using the consensus algorithm are proposed in [14,15]. But the number of consensus loops within each estimator time step grows very fast with the number of agents due to the convergence properties of the consensus algorithm [24,25,26]. Hence, such algorithms are not feasible if the time-scale of the target dynamics is comparatively fast. This connection between the time-scale of the target dynamics and the time step size of the distributed estimation algorithm has not been explored in the literature. Furthermore, [16] analyzed their algorithm using linearGaussian models while [13] focused on probability distributions within the exponential family. In contrast, we present a rigorous proof technique, which was first introduced in our prior work [17,18], for the LogOP scheme that is applicable for general probability distributions. This paper is organized as follows. Section 2 presents some preliminaries and the problem statement. The LogOP scheme and some general convergence results are presented in Section 3. The DBF algorithm and its special cases are presented in Section 4. Results of numerical simulations are presented in Section 5 and the paper is concluded in Section 6. 2 If all the agents are perfectly connected by a complete communication graph (i.e., each agent could communicate instantaneously with every other agent without any loss of information in the communication links), then the agents can exchange their local likelihood functions and use the centralized multi-sensor Bayesian filtering algorithm to estimate the Bayesian-optimal posterior probability distribution of the target’s states. An open question is how to design a distributed estimation algo- Preliminaries and Problem Statement Let N and R represent the sets of natural numbers (positive integers) and real numbers respectively. The state space of the target’s states X is a closed set in Rnx , where nx is the dimension of the states of the target. Let X be the Borel σ–algebra for X . A probability space is defined by the three-tuple {X , X , P}, where P is a complete, σ-additive probability measure on all X . dP(x) Let p(x) = dµ(x) denote the Radon–Nikodým density 2 xk+1 = f k (xk , wk , ∆) , ∀k ∈ N , of the probability distribution P(x) with respect to a measure µ(x). If x ∈ X is continuous and µ(x) is a Lebesgue measure, p(x) is the probability density function (pdf) [28]. Therefore, the probability of an event A ∈ X can ´be written as the Lebesgue–Stieltjes integral P(A ) = A p(x) dµ(x). In this paper, we only deal with the continuous case where the function p(·) represents the pdf and µ(·) is the Lebesgue measure. Let Φ(X ) represent the set of all pdfs over the state space X . The L1 distance and the KL divergence between the pdfs P, Q ∈ Φ(X ) areˆdenoted by: DL1 (P, Q) = ˆX DKL (P||Q) = X (1) where f k : Rnx × Rnw → Rnx is a possibly nonlinear time-varying function of the state xk , the discretization time step size ∆, and an independent and identically distributed (i.i.d.) process noise wk , where nw is the dimension of the process noise vector. Consider a network of N heterogeneous sensing agents simultaneously tracking this target. Let y ik represent the measurement taken by the ith agent at the k th time instant. The measurement model of the agents is given by: |P(x) − Q(x)| dµ(x) ,   P(x) P(x) log Q(x) dµ(x) . y ik = hik (xk , v ik ), ∀i ∈ V = {1, . . . , N } , ∀k ∈ N , (2) where hik : Rnx × Rnvi → Rnyi is a possibly nonlinear time-varying function of the state xk and an i.i.d. measurement noise v ik , where nyi and nvi are dimensions of the measurement and measurement noise vectors respectively. Note that the measurements are conditionally independent given the target’s states. We assume that the target dynamics (1) and measurement models (2) are known. In this paper, all the algorithms are presented in discrete time. Let ∆ be the time step size between any two consecutive time instants. The time index is denoted by a right subscript. The agent index is denoted by a lowercase right superscript. Frequently used symbols are listed in the following table. Table 1: List of frequently used symbols Symbol Definition Ak Adjacency matrix b Periodicity of the communication network Jki Lik LC k Inclusive neighbors of the ith agent N Number of agents in the network Ski Prior pdf Tki Uki Wki WkC,i Estimated likelihood function X State space xk True states of the target xk|k−1 Predicted states of the target xk|k Updated states of the target y ik Measurement taken by the ith agent ∆ Time step size 2.1 2.2 Bayesian Filtering Algorithm Each agent uses the Bayesian filtering algorithm to estimate the pdf of the states of the target [29,28]. Let xk|k−1 and xk|k represent the predicted and updated states of the target at the k th time instant. Let the pdfs Ski = p(xk|k−1 ) ∈ Φ(X ) and Wki = p(xk|k ) = p(xk|k−1 |y ik ) ∈ Φ(X ) denote the ith agent’s prior and posterior pdfs of the target’s states at the k th time instant. Normalized likelihood function Normalized joint likelihood function During the prediction step, the prior pdf Ski = p(xk|k−1 ) i is obtained from the previous posterior pdf Wk−1 = p(xk−1|k−1 ) using the Chapman–Kolmogorov equation [28]: ˆ i i Sk = p(xk|k−1 |xk−1|k−1 ) Wk−1 dµ(xk−1|k−1 ), (3) Estimated KL-divergence-minimizing pdf Posterior pdf Centralized posterior pdf X where the probabilistic model of the state evolution p(xk|k−1 |xk−1|k−1 ) is obtained from the known target dynamics model (1). We assume that the prior pdf is available at the start of the estimation process. The new measurement y ik is used to compute the posterior pdf Wki = p(xk|k ) = p(xk|k−1 |y ik ) during the update step using the Bayes’ rule [28]: Wki = ´ Target Dynamics and Measurement Models X Let xk represent the true states of the target at the k th time instant, where xk ∈ X for all k ∈ N. The dynamics of the target in discrete time is given by: p(y ik |xk|k−1 ) Ski . p(y ik |xk|k−1 ) Ski dµ(xk|k−1 ) (4) The likelihood function p(y ik |xk|k−1 ) is obtained from the ith agent’s known measurement model (2). Let the 3 pdf Lik ∈ Φ(X ) represent the normalized likelihood function, i.e., Lik = ´ X p(y ik |xk|k−1 ) . p(y ik |xk|k−1 ) dµ(xk|k−1 ) Therefore, (4) is equivalent to Wki = ´ X where the convergence error is given by  DL1 Tki , LC k ≤ (1 + η)δ , ∀k ≥ κ , ∀i ∈ V , (8)  ∀i ∈ V . (9) lim DL1 Tki , LC k ≤ δ, (5) k→∞ The DBF algorithm, shown in Fig. 1 and Algorithm 1, achieves this objective. Note that the agents exchange their estimated pdfs with their neighboring agents only once during each time instant before the fusion step. Lik Ski . Lik Ski dµ(xk|k−1 ) If all the sensing agents are hypothetically connected by a complete graph, then the agents can exchange their likelihood functions. Each agent can use the centralized multi-sensor Bayesian filtering algorithm to compute the centralized posterior pdf of the target’s states WkC,i = p(xk|k ) = p(xk|k−1 |y 1k , . . . , y N k ) ∈ Φ(X ) using the Bayes’ rule [30]: i LC k Sk . C i L S dµ(xk|k−1 ) X k k QN j j=1 Lk C L k = ´ QN . j j=1 Lk dµ(xk|k−1 ) X WkC,i = ´ where Here, LC k Prior Knowledge of States Posterior pdf from previous time instant Prediction Step Compute pdf . Transmit the pdf to neighbors Exchange pdfs with neighboring agents (6) Receive pdfs . from neighbors (7) Fusion Step Compute pdfs (7) is the normalized joint likelihood function. Measurement. . Next time instant Bayesian filtering is optimal because this posterior pdf WkC,i integrates and uses all the available information expressed by probabilities [28]. Moreover, an optimal state estimate with respect to any criterion can be computed from this posterior pdf WkC,i . The minimum meansquare error (MMSE) estimate and the maximum a posteriori (MAP) estimate are given by [31]: ˆ M SE AP x̂M = x WkC,i dµ(x), x̂M = arg max WkC,i . k|k k|k X Update Step Compute pdf Fig. 1. Flowchart of the DBF algorithm (for the ith agent at the kth time instant) 2.4 Communication Network Topology x∈X The time-varying communication network topology of the sensor network is denoted by the directed graph Gk = (V, Ek ). The edge (i, j) ∈ Ek if and only if the ith agent receives information from the j th agent at the k th time instant. The inclusive neighbors of the ith agent are denoted by Jki = {j ∈ V : (i, j) ∈ Ek } ∪ {i}. The matrix Ak ∈ RN ×N represents the adjacency matrix of Gk , where Ak [i, j] 6= 0 if and only if j ∈ Jki . Other potential criteria for optimality, such as maximum likelihood, minimum conditional KL divergence, and minimum free energy, are discussed in [28,31]. The main advantage of the original Bayesian filtering formulation is that no approximation is needed during the filtering process; i.e., the complete information about the dynamics and uncertainties of the model can be incorporated in the filtering algorithm. However, direct implementation of Bayesian filtering (3)–(4) is computationally expensive. Practical implementation of these algorithms, in their most general form, is achieved using particle filtering [29,32] and Bayesian programming [33,34]. 2.3 . Assumption 1 [26,27] The digraph Gk = (V, Ek ) and its adjacency matrix Ak satisfy the following properties: (i) There exists some positive integer b ∈ N such that the directed graph (V, Ek ∪ Ek+1 ∪ . . . ∪ Ek+b−1 ) is strongly connected for all time instants k ∈ N. (ii) The matrix Ak is doubly stochastic, i.e., 1T Ak = 1T and Ak 1 = 1 for all k ∈ N, where 1 = [1, 1, . . . , 1]T . (iii) The matrix product Ak,k+b−1 is defined as: Problem Statement Let the pdf Tki ∈ Φ(X ) denote the estimated joint likelihood function of the ith agent at the k th time instant. 2 ) be positive constants. Let η ∈ (0, 1) and δ ∈ (0, 1+η Our aim is to design a discrete-time distributed estimation algorithm, over the communication network topology described in Section 2.4, so that each agent’s Tki converges to the normalized joint likelihood function LC k (7), Ak,k+b−1 = k+b−1 Y ! Aτ . (10) τ =k There exists a constant γ ∈ (0, 12 ) such that each element Ak,k+b−1 [i, j] ∈ [γ, 1] ∪ {0} for all i, j ∈ V and k ∈ N. 4 Therefore, the digraph Gk is periodically strongly connected and the matrix Ak is non-degenerate and balanced. P1 P2 0.1 0.05 Note that if b = 1, then the digraph Gk is strongly connected at all time instants k ∈ N. LinOP(P1 , P2 ) LogOP(P1 , P2 ) 0.1 α1 = 0.5 0.05 0 0 0 10 20 30 0 10 20 x 3 Logarithmic Opinion Pool and Convergence Results (a) 0.1 P3 P4 0.08 PkLinOP (x) = αki Pki (x) , 0.06 0.04 0.04 0.02 0.02 0 (11) LinOP(P3 , P4 ) LogOP(P3 , P4 ) 0.08 0.06 α1 = 0.5 0 0 N X (b) 0.1 Let the pdf Pki ∈ Φ(X ) denote the ith agent’s pdf at the k th time instant. The LinOP and LogOP schemes for combining the pdfs Pki are given by [20]: 30 x 10 20 30 40 50 0 10 20 30 x x (c) (d) 40 50 i=1 PkLogOP (x) αik i ΠN i=1 Pk (x) =´ ,  i N i (x̄) αk dµ(x̄) Π P i=1 k X Fig. 2. The pdfs in (a) and (c) are combined using LinOP and LogOP in (b) and (d). Note that the LogOP solution preserves the modal nature of the original pdfs. (12) Definition 1 Under Assumption 2, for any constant ψ ∈ X , we have Pki (ψ) > 0, ∀i ∈ V and PkLogOP (ψ) > 0. Using simple algebraic manipulation of (12), we get [23]: " # N X PkLogOP (x) LogOP αki Pki (x) , (13) = Pk (x) := ln LogOP Pk (ψ) i=1  i  P (x) k where Pki (x) := ln , ∀i ∈ V . (14) Pki (ψ) PN where the weights αki are such that i=1 αki = 1 and the integral in the denominator of (12) is finite. Thus, the combined pdf obtained using LinOP and LogOP gives the weighted algebraic and geometric averages of the individual pdfs respectively. As shown in Fig. 2, the combined pdf obtained using LogOP typically preserves the multimodal or unimodal nature of the original individual pdfs [22]. The most compelling reason for using the LogOP scheme is that it is externally Bayesian; i.e., the LogOP combination step commutes with the process of updating the pdfs by multiplying with a commonly agreed likelihood pdf Lk ∈ Φ(X ): Thus, we have represented the LogOP scheme (12) as a linear equation using these functions Pki (x) and PkLogOP (x), and removed the effect of the normalizing constants.  αik Lk Pki ´ ΠN i dµ(x̄) i=1 L P k X k . = ´ αik  LogOP i ´ L P L P dµ(x̃) k N k ´ X k k dµ(x̃) Πi=1 X Lk P i dµ(x̄) Lk PkLogOP X We now state some useful convergence results using the functions in Definition 1. The proofs are given in Appendix. k Therefore, the LogOP scheme is ideal for combining pdfs in distributed estimation algorithms. Definition 2 (Pointwise Convergence) The pdf Pki converges pointwise to the pdf P ? ∈ Φ(X ), if and only if limk→∞ Pki (x) = P ? (x) for all x ∈ X . Due to the multiplicative nature of the LogOP scheme, each agent has veto power [22]. That is, if Pki (x) = 0 for some x ∈ X and some agent i ∈ V with αki > 0, then PkLogOP (x) = 0 in the combined pdf irrespective of the pdfs of the other agents. In order to avoid this veto condition, we enforce the following assumption which has been used in the literature. Lemma 1 If the pdfs P, Q satisfy Assumption 2, then there exists ψ ∈ X such that P(ψ) = Q(ψ). i Lemma 2 If the function converges pointwise k (14) i h P ? P (x) ? to the function P := ln P ? (ψ) , then the corresponding pdf Pki also converges pointwise to the pdf P ? . Assumption 2 [10,22] (Nonzero Probability Property) In this paper, all pdfs are strictly positive everywhere in the closed set X . Definition 3 (Convergence in TV) The measure µPki is defined as the measure induced by the pdf Pki on X , ´ i where µPki (A ) = A Pk dµ(x) for any event A ∈ X . Similarly, let µP ? denote the measure induced by the pdf P ? on X . In order to analyze the LogOP scheme with general probability distributions that satisfy Assumption 2, we use the following functions. 5 The TV distance is defined as kµPki − µP ? kTV := supA ∈X |µPki (A ) − µP ? (A )|. The measure µPki converges to the measure µP ? in TV, if and only if k limk→∞ µPki − µP ? kTV = 0. The necessary conditions for satisfying (17) are   given by DKL Lik ||Lik−1 ≤ ∆θL and DKL Lik−1 ||Lik ≤ ∆θL . We now state the DBF algorithm, whose steps are shown in Fig. 1. Let the pdf Uki ∈ Φ(X ) denote the estimated KL-divergence-minimizing pdf of the ith agent at the k th time instant. The pdf Tki is defined in Section 2.3. Under Assumptions 1–3, the pseudo-code of the DBF algorithm is given in Algorithm 1. Lemma 3 If the pdf Pki converges pointwise to the pdf P ? , then the measure µPki converges in TV to the measure  µP ? . Moreover, kµPki − µP ? kTV = 12 DL1 Pki , P ? . Another reason for using the LogOP scheme is that it minimizes the information lost during the combination process, where the information loss is measured using the KL divergence. Algorithm 1. Distributed Bayesian Filtering Algorithm 1. (ith agent’s steps at k th time instant) Lemma 4 [16,17] The pdf PkKL ∈ Φ(X ) that globally minimizes the sum of KL divergences with the pdfs Pki for all agents is given by: 1 QN N i N X  i=1 Pk KL i Pk = arg min DKL ρ||Pk = ´ Q . 1 N i N dµ(x̄) ρ∈Φ(X ) i=1 i=1 Pk X 2. Compute prior pdf Ski = p(xk|k−1 ) using (3) 3. Obtain local measurement y ik 4. Compute normalized likelihood function Lik using (5) 5. j Receive pdfs Uk−1 from agents j ∈ Jki 6. Compute pdfs Uki and Tki as follows  i  L1 −1 i Λ Lik Lik−1 Uk =   ´  −1 Λ Li Lik−1 dµ(x̄) X Yk j Ak [i,j] where Λ = (Uk−1 ) , Note that the pdf PkKL is equivalent to the pdf PkLogOP (12) obtained using the LogOP scheme with weights αki = N1 for all agents. Tki = The proof of Lemma 4 is given in our prior work [17]. Note that the normalized joint likelihood function LC k (7) is also given by: QN N j LKL j=1 Lk k C Lk = ´ QN , (15) =´ N j LKL dµ(x̄) j=1 Lk dµ(x̄) X k X QN  j  N1 j=1 Lk where LKL = . (16) k ´ QN  j  N1 L dµ(x̄) j=1 k X 7. Tki Ski . Tki Ski dµ(x̄) (20) The following theorem shows that the DBF algorithm satisfies the problem statement (8)–(9) in Section 2.3. Theorem 5 Under Assumptions 1–3, if all the agents execute the DBF algorithm (Algorithm 1) and the time step size ∆ for (17) for Algorithm 1 is defined as ∆= (1 − σm ) log (δ + 1) √ , 2bN (N − 1) N θL (21) then the steady-state convergence error between the pdf Tki (19) and the pdf LC k (7) is bounded by δ:  lim max DL1 Tki , LC (22) k ≤ δ. k→∞ i∈V={1,...,N } Furthermore, the convergence error between the pdfs Tki (19) and LC k (7) after κ time instants is bounded by (1 + η)δ:  max DL1 Tki , LC k ≤ (1 + η)δ , ∀k ≥ κ , (23) Assumption 3 For any time step size ∆ > 0, there exists a time-invariant constant θL > 0 such that for all agents i ∈ V = {1, . . . , N }: ≤ e∆θL , ∀x ∈ X , ∀k ∈ N . (18) (19) X In this section, we present the main DBF algorithm, its convergence and robustness properties, and its application to special cases. We first state an assumption on the time-varying nature of the pdfs Lik (5) for all agents that directly link the target dynamics and measurement models with the time step size of the distributed estimation algorithm. e−∆θL ≤ , Compute posterior pdf Wki = p(xk|k ) as follows Distributed Bayesian Filtering Algorithm Lik (x) Lik−1 (x) if k ≥ 2 , Wki = p(xk|k ) = ´ We show that the DBF algorithm also estimates the pdf LKL k (16) in a distributed manner. 4 j∈Jki (Uki )N ´ (Uki )N dµ(x̄) X if k = 1 i∈V={1,...,N } (17) where, κ = 1 if D1 ≤ 6 log(δ+1) 3 N2 , otherwise:      b(N − 1)  log     3   κ=  log σm log   + 1 ,   eN 2 D1 log   δ+1 ! L` (x) D1 = 2 ln max max 1j . `,j∈V x∈X L (x) 1  (1+η)δ+1 δ+1 N X (24) = 1− 4(γ − γ N ) π sin2 (1 − γ) 2N j Ak [i, j]Uk−1 + N X i=1 j=1  i Lki − Lk−1 , i=1   N N X X  i i  Ak [j, i] Uk−1 + Lki − Lk−1 , N X j=1 i=1  U1i − L1i + i=1 N X Lki = N LkKL . (30) i=1 PN Note that LkKL = N1 i=1 Lki follows from (16). This shows that if the functions Uki converge towards each other, then they will converge to the function LkKL . Let us define the error vector ek as: h iT ek = Uk1 −LkKL , . . . , Uki −LkKL , . . . , UkN −LkKL .  21 < 1. N X i=1 (25) 2 Here, η ∈ (0, 1) and δ ∈ (0, 1+η ) are positive constants, and σm = maxk∈N σN −1 (Ak,k+b(N −1)−1 ), where σN −1 denotes the second largest singular value of the matrix, and σm is upper bounded by:  N X N X i=1 = σm ≤ Uki = (26) The evolution of the error vector ek is given by: Moreover, b is the periodicity of the communication network topology, γ ∈ (0, 12 ) is the smallest positive element in Ak,k+b−1 defined in Assumption 1, and θL is defined in Assumption 3. The TV error between the measures induced by the pdfs Tki and LC k is bounded by: (1 + η)δ max kµTki − µLC kTV ≤ , k i∈V 2 δ lim max kµTki − µLC kTV ≤ . k k→∞ i∈V 2 ∀k ≥ κ , where ek = Ak ek−1 + Ωk,k , ∀k ≥ 2 ,  1 1  Lk −Lk−1   11T  .. . Ωk,k = I − . N N N Lk −Lk−1 The overall evolution of the error vector ek after b ∈ N time instants is given by: (27) ek+b−1 = Ak,k+b−1 ek−1 + Ωk,k+b−1 , where Ak,k+b−1 is defined in (10) and for b ≥ 2: k+b−2 X (Aτ +1,k+b−1 Ωτ,τ ) + Ωk+b−1,k+b−1 . τ =k Proof: Using h Definition 1, we define i h C thei functions LKL Lk (x) C k (x) LkKL (x) = ln LKL , L (x) = ln , Lki (x) = C k (ψ) k h i i h i i Lk (ψ) L (x) U (x) ln Lik(ψ) , Uki (x) = ln U ki (ψ) , and Tki (x) = k h ki i T (x) ln T ki (ψ) for all i ∈ V. Since these functions are de- Note that 1Tek = 0 because of (30) and 1T Ωk,k+b−1 = 0  T because 1T I − 11 = 0. Therefore, we investigate N the convergence of ek along all directions that are orthogonal to 1T . It follows from Assumption 1 that the matrix Ak,k+b−1 is irreducible. Therefore, the matrix Ak,k+b−1 is primitive [35, Lemma 8.5.4, pp. 516] and λN −1 (Ak,k+b−1 ) < 1, where λN −1 denotes hthe secondi k fined for all x ∈ X , we henceforth drop the term (x) for brevity. largest eigenvalue of the matrix. Let Vtr = √1N 1, Vs be the orthonormal matrix of eigenvectors of the symmetric primitive matrix AT1,b A1,b . By spectral decomposition [36], we get: h i 1 01×(N −1) VtrT AT1,b A1,b Vtr = 0(N −1)×1 , T T V A A1,b Vs Step 1. We first show that the pdf Uki (18) converges to the pdf LKL k (16). Equation (18) can be re-written using these functions as: ( (32) (28) Ωk,k+b−1 = Uki = (31) L1i PN if k = 1 , (29) j i i A [i, j]U +L −L if k≥2 k k k−1 j=1 k−1 s 1,b 1 T T = 1, √1N 1T AT1,b A1,b Vs N 1 A1,b A1,b 1 01×(N −1) , and VsT AT1,b A1,b 1 √1N = 0(N −1)×1 where = are used. Since the eigenvectors are orthonormal, we have Vs VsT + N1 11T = I. Left-multiplying (32) with VsT gives: because Ak [i, j] = 0 if j 6∈ Jki , as defined in Section 2.4. Since Ak is doubly stochastic, (29) satisfies the conservation property: 7 max |Uki (x) − LkKL (x)| ≤ Ξk , VsT ek+b−1 = VsT Ωk,k+b−1 + = VsT Ak,k+b−1 VsT Ωk,k+b−1 + Vs VsT + N1 11 ek−1 , VsT Ak,k+b−1 Vs VsT ek−1 . i∈V  T (33) ≤ kVsT Ak,k+b−1 Vs k2 kVsT ek−1 k2 , LkC (x) = N LkKL (x) , max |Tki (x) − LkC (x)| ≤ N Ξk , Using Lemma 1, we select ψ ∈ X such that Tki (ψ) = LC k (ψ). Therefore,  i  T (x) max ln kC ≤ N Ξk , ∀k ∈ N , i∈V Lk (x)  i  Tk (x) ≤ eN Ξk , ∀k ∈ N . e−N Ξk ≤ max i∈V LC (x) k by (26). Moreover, it follows from Assumption 3 that √ T 1 N ,...,LkN −Lk−1 ] ≤ 2 N ∆θL because |Lki − [ Lk1 −Lk−1  C N Ξk − 1 , ∀k ∈ N . max Tki (x) − LC k (x) ≤ Lk (x) e 2 ≤ 2∆θL . Therefore, we have: i∈V Since x ∈ X can be any point, therefore: ˆ  i C Tki − LC max DL1 Tk , Lk = max k dµ(x) i∈V i∈V X ˆ   N Ξk ≤ eN Ξ k − 1 LC − 1 , ∀k ∈ N . k dµ(x) = e √ kVsT Ωk,k+b(N −1)−1 k2 ≤ 2b(N − 1) N ∆θL . Hence, in the presence of the disturbance term, we get: kVsT ek+b(N −1)−1 k2 ≤ kVsT Ωk,k+b(N −1)−1 k2 + σN −1 (Ak,k+b(N −1)−1 )kVsT ek−1 k2 √ σm kVsT ek−1 k2 + 2b(N − 1) N ∆θL . X , Hence the convergence error between the pdfs is bounded  by eN Ξk − 1 . (34)  It follows from (23)–(22) that eN Ξk − 1 ≤ (1 + η)δ for all k ≥ κ and limk→∞ eN Ξk − 1 ≤ δ. The time step size ∆ (21) is found using the steady-state error term:   √ Using the discrete Gronwall lemma [39, pp. 9] we obtain:  k−1  b(N −1) b(N −1) 1 − σm + 1 − σm kVsT e1 (x)k2 (38) Thus, the error between the function Tki and the function LkC is bounded by N Ξk . We have:  i   C  Tk (x) Lk (x) max ln ≤ N Ξk , ∀k ∈ N . − ln i∈V Tki (ψ) LC k (ψ) N kVsT e1 k2  k−1 ∀k ∈ N . i∈V bounded by γ−γ 1−γ , and we have σN −1 (Ak,k+b(N −1)−1 ) ≤  12  N ) 2 π < 1 [38]. Therefore, σm is given 1 − 4(γ−γ sin (1−γ) 2N  Tki (x) = N Uki (x) , ∀i ∈ V . Therefore, it follows from (36) that: Since the matrix Ak,k+b−1 is irreducible, the matrix Ak,k+b(N −1)−1 is a positive matrix because the maximum path length between any two agents is less than or equal to b(N − 1) [37]. Hence the measure of irreducibility of the matrix ATk,k+b(N −1)−1 Ak,k+b(N −1)−1 is lower kVsT ek k2 ≤ σm (37) Step 2. We now show that the pdf Tki (19) converges to the pdf LC k (15). For all x ∈ X , equations (15) and (19) can be re-written as: where σmax denotes the largest singular value of the matrix. Since VsT is orthonormal (i.e., VsT Vs = I) and also orthogonal to 1T (i.e., VsT 1 = 0) and the matrix ATk,k+b−1 Ak,k+b−1 is primitive, we have σmax (Ak,k+b−1 Vs ) = σN −1 (Ak,k+b−1 ) < 1, where σN −1 denotes the second largest singular value of the matrix. Therefore, the error vector VsT ek is globally exponentially stable in absence of the disturbance term. ≤ b(N −1) Thus, the error between the function Uki and the function LkKL is bounded by Ξk , which depends on time instant k. kVsT ek+b−1 k2 = kVsT Ak,k+b−1 Vs VsT ek−1 k2 i Lk−1 | √ N ∆θL σm N D1 − 2b(N −1) 1−σm √ 2b(N − 1) N ∆θL + . 1 − σm where Ξk = We first investigate the stability of this system without the disturbance term VsT Ωk,k+b−1 in (33). Let kVsT ek+b−1 k2 be a candidate Lyapunov function for this system. Therefore, we get: ≤ σmax (Ak,k+b−1 Vs )kVsT ek−1 k2 = σN −1 (Ak,k+b−1 )kVsT ek−1 k2 , √ ∀k ∈ N , (36)   k−1  √ 2b(N − 1) N ∆θL . N e (35) √ If Moreover, ≤ N D1 , where D1 is defined in (25). Therefore, it follows that for all x ∈ X : √ N D1 ≤ 2b(N −1) N ∆θL 1−σm √ 2b(N −1) N ∆θL , 1−σm (39)  then eN Ξk − 1 ≤ (1 + η)δ for all k ∈ N. Therefore, if D1 ≤ 8 −1 = δ. log(δ+1) 3 N2 , then κ = 1. Otherwise, for D1 > log(δ+1) , κ (24) is computed using 3 N2  N Ξk e − 1 ≤ (1 + η)δ. The constraint on TV error follows from Lemma 3. Note that our exponentialconvergence proof is substantially different from the asymptotic-convergence proof in [27].  4.1 In this section, we study the robustness of the DBF algorithm in the presence of communication and modeling errors. In order to implement the DBF algorithm, the j agents need to communicate their estimated pdfs Uk−1 with their neighboring agents (see line 5 in Algorithm 1). Remark 1 A key advantage of the DBF algorithm is that it does not require all the sensors to observe the target. If an agent does not observe the target, then it sets its normalized likelihood function as the uniform distribution, i.e., Lik (x) = 1. Then this agent’s likelihood function does not influence the joint likelihood function and the estimated pdfs because of the geometric nature of the fusion rule. Moreover, the DBF algorithm avoids double counting because the summation of weights from all paths is a constant due to the weights in the adjacency matrix Ak . Theorem 5 explicitly bounds the time step size ∆ of the distributed estimation algorithm with the time-scale of the target dynamics. But the effectiveness of the DBF algorithm is predicated on Assumption 3. Moreover, the upper bound on the time step size ∆max (21) decreases with increasing number of agents N . Remark 2 (Communication of pdfs) The information theoretic approach for communicating pdfs is studied in [40]. If particle filters are used to implement the Bayesian filter and combine the pdfs [32,41], then the resampled particles represent the agent’s estimated pdf. Hence communicating pdfs is equivalent to transmitting these resampled particles. Another approach involves approximating the pdf by a weighted sum of Gaussian pdfs [42, pp. 213] and then transmitting this approximate distribution. Several techniques for estimating the Gaussian parameters are discussed in the Gaussian mixture model literature [41,43,44]. Let the pdf Ûki ∈ Φ(X ) denote the pdf Uki that is corrupted with communication errors. Similarly, let the pdf L̂ik ∈ Φ(X ) represent the normalized likelihood function Lik that is corrupted with modeling errors. We first state the assumptions on these errors and then state the main result of this section. The following corollary provides sharper bounds for the special case of a static, strongly-connected communication network topology. Corollary 6 If the communication network topology is time-invariant and strongly-connected, then the time step size ∆ (21) and κ (24) in Theorem 5 are given by: (1 − σN −1 (A)) log (δ + 1) √ , 2N N θL     (1+η)δ+1    log δ+1 1    3   κ=  log σN −1 (A) log   + 1,   eN 2 D1 log   δ+1 ∆= Robustness Analysis Assumption 4 There exists time-invariant constants εU ≥ 0 and εL ≥ 0 such that for all agents i ∈ V: (40) e−εU ≤ Ûki (x) ≤ e εU , Uki (x) ∀x ∈ X , ∀k ∈ N , (43) (41) e−εL ≤ L̂ik (x) ≤ e εL , Lik (x) ∀x ∈ X , ∀k ∈ N . (44) i i ˆi ˆi Therefore, |U h k i− Uki | ≤ 2εU and |Lk −h Lik | ≤i 2εL , where L̂ (x) Û (x) and Lˆi (x) = ln k . Uˆi (x) = ln k where A is the time-invariant adjacency matrix. k Ûki (ψ) k L̂ik (ψ) Proof: In this case, (34) is written as: √ kVsT ek k2 ≤ σN −1 (A)kVsT ek−1 k2 + 2 N ∆θL . Corollary 7 Under Assumptions 1–4, the time step size ∆ (21) in Theorem 5 is given by: Using the discrete Gronwall lemma [39, pp. 9] we obtain: kVsT ek k2 ≤ (σN −1 (A)) + k−1 ∆= kVsT e1 k2 k−1 √ 1 − (σN −1 (A)) 1 − σN −1 (A) 2 N ∆θL . (1 − σm ) log (δ + 1) 2εL + εU √ − , θL 2bN (N − 1) N θL (45) where εU and εL are defined in Assumption 4. (42) Proof: Equation (18) can be written as:  ˆi  if k = 1 L P1N i ˆj Uk = , A [i, j] U k j=1,j6=i k−1  +A [i, i]U i + Lˆi − Lˆi k k−1 k k−1 if k ≥ 2 Hence, we get maxi∈V |Uki (x) − LkKL (x)| ≤ Ξk for all k ∈ N, where √ k−1 √ k−1 N −1 (A)) Ξk = (σN −1 (A)) N D1 + 1−(σ 2 N ∆θL . 1−σN −1 (A)  We get ∆ (40) and κ (41) from limk→∞ eN Ξk − 1 ≤ δ and eN Ξk − 1 ≤ (1 + η)δ for all k ≥ κ respectively.  Substituting the bounds from Assumption 4 gives: 9 (46) |U1i − L1i | ≤ 2εL , Algorithm 2. DBF-Kalman Information Filtering Algorithm N X j i |Uki − Ak [i, j]Uk−1 −Lki +Lk−1 | ≤ 2εU + 4εL . j=1 1. (ith agent’s steps at k th time instant) 2. Compute the prior pdf Ski = N (x̂ik|k−1 , P ik|k−1 ) ẑ ik−1|k−1 = (P ik−1|k−1 )−1 x̂ik−1|k−1 , The evolution of the error vector ek is now given by: ek = Ak ek−1 + Ω̂k,k , Z ik−1|k−1 = (P ik−1|k−1 )−1 , M ik−1 = (F −1 )T Z ik−1|k−1 F −1 k−1 ,  k−1 −1  i i i i Z k|k−1 = I − M k−1 M k−1 + Q−1 M k−1 , k−1    −1 T i i i i −1 −1 ẑ k|k−1 = I − M k−1 M k−1 + Qk−1 (F k−1 ) ẑ k−1|k−1 , ∀k ≥ 2 , (47) √ where kΩ̂k,k k2 ≤ kΩk,k k2 + 2 N (εU + 2εL ) . Similar to the proof of Theorem 5, we get:  k−1  kVsT ek k2 ≤ σm  k−1  b(N −1) b(N −1) + 1 − σm 1 − σm kVsT e1 k2 √ 2b(N − 1) N (∆θL + 2εL + εU ) . Obtain local measurement y ik 4. j Receive pdfs Uk−1 from agents j ∈ Jki 5. Compute the pdfs Uki and Tki as follows: k tik = N uik , 6. 4.3 In this section, we apply the DBF algorithm to the special case where the target dynamics and measurement models are given by linear systems with additive Gaussian noise: (51) (52) = (Z ik|k )−1 , Z ik|k = Z ik|k−1 + T jk , x̂ik|k = P ik|k ẑ ik|k . (50) Special Case: Multiple Consensus Loops within Each Time Instant In this section, we show that the proposed DBF algorithm can be easily extended to recursively combine local likelihood functions using multiple consensus loops within each time instant so that each agent’s estimated likelihood function converges to the joint likelihood function LC k (15). Then, the resultant DBF algorithm is equivalent to the Bayesian consensus algorithms in [14,15]. Note that multiple consensus loops within each time step significantly reduces the practicality of such i i algorithms. Let the pdfs Uk,ν ∈ Φ(X ) and Tk,ν ∈ Φ(X ) th denote to the local pdfs of the i agent during the ν th consensus loop at the k th time instant. Since the pdf Lik is not updated during the k th time instant, we define the pdfs Lik,ν = Lik for all ν ∈ N. During the ν th coni sensus loop, each agent updates its local pdfs Uk,ν and i Tk,ν using the following fusion rule:  i Lk,1 Q if ν = 1    j  (Uk,ν−1 )Ak [i,j] i j∈J i , (53) Uk,ν = Q kj ´  if ν ≥ 2  (Uk,ν−1 )Ak [i,j] dµ(x)  X  Special Case: DBF-Kalman Information Filter ∀k ∈ N , Compute the posterior pdf Wki = N (x̂ik|k , P ik|k ) P ik|k It follows from Corollary 7 that in order to generate satisfactory estimates using the DBF algorithm, the bounds εU , εL should be substantially smaller than δ. ∀k ∈ N , ∀i ∈ V , T ik = N U ik , ẑ ik|k = ẑ ik|k−1 + tjk ,  We get ∆ (45) and κ (24) from limk→∞ e −1 ≤δ and eN Ξk − 1 ≤ (1 + η)δ for all k ≥ κ respectively.  y ik = H ik xk + v ik , (49) 3. N Ξk xk+1 = F k xk + wk , (48) x̂ik|k−1 = P ik|k−1 ẑ ik|k−1 . iik = (H ik )T (Rik )−1 y ik , I ik = (H ik )T (Rik )−1 H ik , ( ii if k = 1 P , uik = 1i ik − iik−1 + j∈J i Ak [i, j]ujk−1 , if k ≥ 2 k ( if k = 1 I i1 P , U ik = I ik − I ik−1 + j∈J i Ak [i, j]U jk−1 , if k ≥ 2 Hence, we get maxi∈V |Uki (x) − LkKL (x)| ≤ Ξk for all k ∈ N, where  k−1  √ b(N −1) N D1 Ξk = σm  k−1  b(N −1) √ 1 − σm + 2b(N − 1) N (∆θL + 2εL + εU ) . 1 − σm 4.2 P ik|k−1 = (Z ik|k−1 )−1 , where the process noise wk = N (0, Qk ) and the measurement noise v ik = N (0, Rik ) are zero mean multivariate normal distributions. Therefore, we adopt the information filter-based representation [45,46]. The pseudo-code of the DBFKalman information filtering algorithm for linearGaussian models is given in Algorithm 2. The prior pdf Ski = N (x̂ik|k−1 , P ik|k−1 ), the posterior pdf Wki = N (x̂ik|k , P ik|k ), and the estimated pdfs Uki =   N (U ik )−1 uik , (U ik )−1 , Tki = N (T ik )−1 tik , (T ik )−1 are also multivariate normal distributions. j∈J i k i (Uk,ν )N Tki = ´ X 10 i )N dµ(x) (Uk,ν . (54) 5000 4000 Y Axis (m) Theorem 8 [17,18] Assuming Gk is strongly coni nected, each agent’s pdf Tk,ν globally exponentially C converges pointwise to Lk (15). After nloop consensus loops, the `2 norm of the error vector ek,ν := h iT 1 N C DL1 (Tk,ν , LC ), . . . , D (T , L ) is bounded by L 1 k k,ν k √ (nloop −1) kek,nloop k2 ≤ (σN −1 (Ak )) 2 N. Benchmark Example 0 0 3 ∆2 2 2000 3000 X Axis (m) Centralized Bayesian Filter DBF 25 20 15 10 5 0 In this subssection, we compare the performance of the DBF algorithms with the centralized multi-sensor Bayesian filtering algorithms using the benchmark example studied in [6,16,47]. The target dynamics is modeled by a linear (nearly constant velocity) model:  ∆3 ∆2  0 0 3 2 1 ∆ 0 0  2 ∆ 0  0 x + w , where Q =  2 ∆ 0 xk+1 = 00 10 01 ∆   k k ∆3 ∆2 0 1000 10-1 Time Step ∆ (sec) 10-2 30 Steady-State MSE in Position (m) Steady-State MSE in Position (m) 30 0 0 4000 5000 Fig. 3. The motion of the target, the position of sensing agents (5 TOA sensors, 5 DOA sensors, and 40 agents with no sensors), and their communication network topology are shown. Numerical Simulations 0 0 0 1 2000 0 In this section, we demonstrate the properties of the DBF algorithm using a benchmark example in Section 5.1 and a complex multi-agent estimation and control task in Section 5.2. 5.1 3000 1000 The proof follows from Theorem 2 and 4 in [17]. Thus, the distributed estimation algorithm in [14,15] is a special case of our DBF algorithm. 5 Motion of Target Agent with no sensor TOA Sensor DOA Sensor Communication Network Centralized Kalman Filter DBF-Kalman Information Filter 25 20 15 10 5 0 (a) 10-1 Time Step ∆ (sec) 10-2 (b) Fig. 4. Variation of steady-state MSE in position with respect to time step size ∆ is shown for (a) the centralized Bayesian filtering algorithm and the DBF algorithm in Scenario 1 and (b) the centralized Kalman filtering algorithm and the DBF algorithm for linear-Gaussian models in Scenario 2. 2 ∆ do not have any sensors. The measurement models for these sensors are given by: is the covariance matrix of the process noise wk , ∆ is the time step size, and the state vector xk denotes the position and velocity components along the coordinate axes, T i.e., xk = [xk , ẋk , yk , ẏk ] . As shown in Fig. 3, 50 sensing agents are distributed over the given region and are able to communicate with their neighboring agents. The undirected communication network topology is assumed to be time-invariant. Local-degree weights are used to compute the doubly stochastic adjacency matrix Ak as: hik (xk , v ik ) = ( i i i atan2(x k − x , yk − y ) + v k,DOA p (xk − xi )2 + (yk − y i )2 + v ik,T OA (55) for DOA sensor , for TOA sensor where (xi , y i ) denotes the position of the ith agent and atan2 is the 4-quadrant inverse tangent function. The DOA sensor’s measurement noise v ik,DOA = N (0, σθ ) has variance σθ = 2◦ and the TOA sensor’s measurement noise v ik,T OA = N (0, σr ) has variance σr = 10 m. 1 , ∀j ∈ Jki and i 6= j , max(di , dj ) X Ak [i, i] = 1 − Ak [i, j] , Ak [i, j] = In Scenario 1, each agent executes the DBF algorithm in Algorithm 1 using particle filters [48] with 104 particles. The comparison between the DBF algorithm and the centralized Bayesian filtering algorithm for varying time step sizes (∆) is shown in Fig. 4(a). The same target motion, shown in Fig. 3, is used for all simulations. We see that the DBF algorithm’s steady-state meansquare-error (MSE) in position converges to that of the centralized algorithm as the time step size ∆ decreases (i.e., the steady-state MSE is smaller than 5 m if the time step size ∆ ≤ 0.05 sec). Note that the MSE of the j∈V\{i} where di denotes the degree of the ith agent. In Scenario 1, five of these agents are equipped with nonlinear position sensors that can measure their distance to the target using Time of Arrival (TOA) sensors. Another five agents are equipped with Direction of Arrival (DOA) sensors that can measure the bearing angle between the target and themselves. The remaining agents 11 centralized algorithm does not change much with time step size because it is constrained by the measurement noise intensities. This shows that the performance of the DBF algorithm approaches the performance of the centralized Bayesian filter as the time step size is reduced. Moreover, Fig. 5 shows that the L1 distances between the estimated likelihood functions and the joint likelihood function are bounded by δ. approach to maintain a distance d from their nearest neighbors, i.e.: ! i,i 2 (x̂i,j − x̂ ) a d i,j i,j i,i a rk − i,j , AP F (x̂k , x̂k , d) = k i,j k rk rk i,i where rki,j = kx̂i,j k − x̂k k2 , and maintain a distance dCM = 2 cos dπ − π from the estimated center of mass (2 N) PN i,j 1 x̂i,CM = j=1 x̂k . In the propagation step of the k N DBF algorithm, the agents use their estimated positions to estimate the control input applied by other agents. Therefore, the estimation errors contribute to the process noise in the propagation step. During the fusion step at k th time instant, the ith agent communicates with the j th agent if either j ∈ Nki or i ∈ Nkj . δ (∆ = 0.025 sec) 1 0 0 10 20 30 40 50 60 70 80 90 100 Time (sec) " ! DL1 Tki , LC k 2 δ (∆ = 0.0125 sec) 1 0 0 10 20 30 40 50 60 70 80 90 100 In these simulations, we use a = 0.1, d = 1 m, ∆ = 0.1 sec, and 103 particles to execute each DBF algorithm. At the start of the estimation process, the particles are selected from a uniform distribution over the state space X = [−N, N ] × [−N, N ]. The simulation results for multiple values of N are shown in Fig. 6. Since the agents only use relative measurements, the orientation of the final N -sided regular polygon in the global frame is not fixed. Therefore, we conclude that the N agents successfully estimate their relative positions using the DBF algorithms and achieve the complex desired formations. Time (sec) Fig. 5. The trajectories of the L1 distances between the estimated likelihood functions and the joint likelihood function for the ten sensing agents are shown. In Scenario 2, the same ten agents (having DOA or TOA sensors) have linear position sensors hik (xk , v ik ) = [ 10 00 01 00 ] xk + v ik,lin , with measurement noise v ik,lin = N (0, Rki ) and covariance matrix Rki = 15I. Here, each agent executes the DBF-Kalman information filtering algorithm from Algorithm 2. Fig. 4(b) shows that the performance of the DBF-Kalman information filtering algorithm approaches the performance of the centralized Kalman filtering algorithm as the time step size is reduced. 2 1.5 Agent 1 Agent 2 Agent 3 Agent 4 Polygon 2.5 2 [m] 5.2 3 Agent 1 Agent 2 Agent 3 Polygon Muti-agent Relative Position Estimation for Formation Control [m] " ! DL1 Tki , LC k 2 1 1.5 1 0.5 0.5 0 -1 In this subsection, N agents estimate their relative positions using only range measurements, and then reconfigure to a N -sided regular polygon. Specifically, each agent can only measure the distance to its nearest two neighbors using a TOA sensor, whose measurement model is described in (55). Each agent simultaneously executes N DBF algorithms to estimate the relative positions of all the agents. The ith agent’s dynamics and control inputs are given by: -0.5 0 0.5 0 -1.5 1 -1 -0.5 [m] (a) N = 3 3 2 1 1.5 (b) N = 4 Agent 1 Agent 2 Agent 3 Agent 4 Agent 5 Polygon 3.5 3 2.5 [m] [m] 0.5 4 Agent 1 Agent 2 Agent 3 Agent 4 Polygon 2.5 1.5 2 1.5 1 xik+1 = xik + ∆uik , X i,i i,CM uik = AP F (x̂i,j , x̂i,i k , x̂k , d) + AP F (x̂k k , dCM ) 0 [m] 1 0.5 0 -1 j∈Nki 0.5 0 1 [m] (c) N = 4 where Nki denotes the two nearest neighbors of the ith th th agent and x̂i,j k is the i agent’s estimate of the j agent’s position, which is obtained using the DBF algorithms. The agents use the artificial potential field (APF) based 2 0 -2 -1 0 1 2 [m] (d) N = 5 Fig. 6. The initial position (), the final position ( ), the trajectories of all the agents, and the final regular polygon are shown for N = 3, 4, 5 agents. 12 6 Conclusions [12] N. Ahmed, J. Schoenberg, and M. Campbell, “Fast weighted exponential product rules for robust general multi-robot data fusion,” in Robotics: Science and Systems VIII (N. Roy, P. Newman, and S. Srinivasa, eds.), pp. 9–16, MIT Press, 2013. In this paper, we presented a novel, discrete-time distributed estimation algorithm, namely the DBF algorithm, that ensures that each agent’s estimated likelihood function converges to an error ball around the joint likelihood function of the centralized multi-sensor Bayesian filtering algorithm. We have rigorously proven the convergence properties of this algorithm. We have shown an explicit connection between the time step size of the distributed estimation algorithm and the timescale of the target dynamics. We also presented the DBFKalman information filtering algorithm for the special case of linear-Gaussian models. The properties of these algorithms are illustrated using complex numerical examples. We envisage that the novel proof techniques presented in this paper can also be used in other distributed estimation algorithms which rely on the LogOP scheme. [13] C. S. R. Fraser, L. F. Bertuccelli, H.-L. Choi, and J. P. How, “A hyperparameter consensus method for agreement under uncertainty,” Automatica, vol. 48, no. 2, pp. 374 – 380, 2012. [14] O. Hlinka, M. Rupp, distributed vol. 60, no. O. Sluc̆iak, F. Hlawatsch, P. M. Djuric, and “Likelihood consensus and its application to particle filtering,” IEEE Trans. Signal Process., 8, pp. 4334–4349, 2012. [15] O. Hlinka, F. Hlawatsch, and P. M. Djuric, “Consensusbased distributed particle filtering with distributed proposal adaptation,” IEEE Trans. Signal Process., vol. 62, no. 12, pp. 3029–3041, 2014. [16] G. Battistelli and L. Chisci, “Kullback–Leibler average, consensus on probability densities, and distributed state estimation with guaranteed stability,” Automatica, vol. 50, no. 3, pp. 707–718, 2014. [17] S. Bandyopadhyay and S.-J. Chung, “Distributed estimation using Bayesian consensus filtering,” in Proc. Amer. Control Conf., (Portland, OR), pp. 634–641, June 2014. References [18] S. Bandyopadhyay and S.-J. Chung, “Distributed estimation using Bayesian consensus filtering.” https://arxiv.org/ abs/1403.3117. [1] J. Speyer, “Computation and transmission requirements for a decentralized linear-quadratic-Gaussian control problem,” IEEE Trans. Autom. Control, vol. 24, no. 2, pp. 266–269, 1979. [19] M. H. DeGroot, “Reaching a consensus,” J. Amer. Statistical Assoc., vol. 69, no. 345, pp. 688 – 704, 1960. [2] V. Borkar and P. Varaiya, “Asymptotic agreement in distributed estimation,” IEEE Trans. Autom. Control, vol. 27, no. 3, pp. 650 – 655, 1982. [20] M. Bacharach, “Normal Bayesian dialogues,” J. Amer. Statistical Assoc., vol. 74, no. 368, pp. 837 – 846, 1979. [21] S. French, “Consensus of opinion,” European J. Operational Research, vol. 7, pp. 332 – 340, 1981. [3] L. Chen, P. O. Arambel, and R. K. Mehra, “Estimation under unknown correlation: covariance intersection revisited,” IEEE Trans. Autom. Control, vol. 47, no. 11, pp. 1879–1882, 2002. [22] C. Genest and J. V. Zidek, “Combining probability distributions: A critique and an annotated bibliography,” Statistical Sci., vol. 1, no. 1, pp. 114 – 135, 1986. [4] M. Kamgarpour and C. Tomlin, “Convergence properties of a decentralized Kalman filter,” in IEEE Conf. Decision Control, pp. 3205–3210, IEEE, 2008. [23] G. L. Gilardoni and M. K. Clayton, “On reaching a consensus using DeGroot’s iterative pooling,” Ann. Stat., vol. 21, no. 1, pp. 391 – 401, 1993. [5] R. Olfati-Saber, “Kalman-consensus filter : Optimality, stability, and performance,” in IEEE Conf. Decision Control, (Shanghai, China), pp. 7036–7042, December 2009. [24] R. Olfati-Saber and R. Murray, “Consensus problems in networks of agents with switching topology and time-delays,” IEEE Trans. Autom. Control, vol. 49, no. 9, pp. 1520 – 1533, 2004. [6] G. Battistelli, L. Chisci, G. Mugnai, A. Farina, and A. Graziano, “Consensus-based linear and nonlinear filtering,” IEEE Trans. Autom. Control, vol. 60, no. 5, pp. 1410–1415, 2015. [25] A. Jadbabaie, J. Lin, and A. S. Morse, “Coordination of groups of mobile autonomous agents using nearest neighbor rules,” IEEE Trans. Autom. Control, vol. 48, no. 6, pp. 988 – 1001, 2003. [7] M. Rashedi, J. Liu, and B. Huang, “Communication delays and data losses in distributed adaptive high-gain ekf,” AIChE Journal, vol. 62, no. 12, pp. 4321–4333, 2016. [26] A. Olshevsky and J. N. Tsitsiklis, “Convergence speed in distributed consensus and averaging,” SIAM Journal on Control and Optimization, vol. 48, no. 1, pp. 33–55, 2009. [8] G. Pavlin, P. Oude, M. Maris, J. Nunnink, and T. Hood, “A multi-agent systems approach to distributed Bayesian information fusion,” Inform. Fusion, vol. 11, pp. 267–282, 2010. [27] M. Zhu and S. Martı́nez, “Discrete-time dynamic average consensus,” Automatica, vol. 46, no. 2, pp. 322–329, 2010. [28] Z. Chen, “Bayesian filtering: From Kalman filters to particle filters, and beyond,” Statistics, vol. 182, no. 1, pp. 1–69, 2003. [9] A. Jadbabaie, P. Molavi, A. Sandroni, and A. TahbazSalehi, “Non-Bayesian social learning,” Games and Economic Behavior, vol. 76, pp. 210–225, 2012. [29] J. Pearl, Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. San Mateo, CA: Morgan Kaufmann, 1988. [10] A. Nedić, A. Olshevsky, and C. A. Uribe, “Fast convergence rates for distributed non-Bayesian learning,” arXiv preprint arXiv:1508.05161, 2015. [30] H. Durrant-Whyte and T. C. Henderson, Springer Handbook of Robotics, ch. Multisensor Data Fusion, pp. 585–610. Springer, 2008. [11] T. Bailey, S. Julier, and G. Agamennoni, “On conservative fusion of information with unknown non-Gaussian dependence,” in Int. Conf. Information Fusion, (Singapore), pp. 1876–1883, July 2012. [31] N. Gordon, B. Ristic, and S. Arulampalam, Beyond the Kalman Filter: Particle Filters for Tracking Applications. Artech House, London, 2004. 13 A [32] M. S. Arulampalam, S. Maskell, N. Gordon, and T. Clapp, “A tutorial on particle filters for online nonlinear/non-Gaussian Bayesian tracking,” IEEE Trans. Signal Process., vol. 50, pp. 174–188, February 2002. Proof of Lemma 1 If this claim is untrue, then either 0 < P(x) < Q(x) or ´ 0 < Q(x) < P(x) ´ for all x ∈ X ´ . Hence either P(x)dµ(x) = 1 < Q(x)dµ(x) or Q(x)dµ(x) < X X ´X P(x)dµ(x) = 1, which results in contradiction since ´X Q(x)dµ(x) = 1. Hence, such a ψ ∈ X must exist. X [33] O. Lebeltel, P. Bessiere, J. Diard, and E. Mazer, “Bayesian robot programming,” Autonomous Robots, vol. 16, pp. 49– 79, January 2004. [34] M.-H. Chen, “Bayesian computation: From posterior densities to Bayes factors, marginal likelihoods, and posterior model probabilities,” in Bayesian Thinking, Modeling and Computation (D. K. Dey and C. R. Rao, eds.), Handbook of Statistics, ch. 15, pp. 437 – 457, Amsterdam: Elsevier, 2005. B Proof of Lemma 2 Since limk→∞ Pki (x) = P ? (x),  we have limk→∞ ln Pki (x)−ln Pki (ψ) = ln P ? (x) − ln P ? (ψ). From Lemma 1, substituting limk→∞ Pki (ψ) = P ? (ψ) gives limk→∞ Pkj (x) = P ? (x) since logarithm is a monotonic function. [35] R. A. Horn and C. R. Johnson, Matrix Analysis. Cambridge, England: Cambridge University Press, 1985. [36] S.-J. Chung, S. Bandyopadhyay, I. Chang, and F. Y. Hadaegh, “Phase synchronization control of complex networks of Lagrangian systems on adaptive digraphs,” Automatica, vol. 49, pp. 1148–1161, May 2013. [37] S. Bandyopadhyay, S.-J. Chung, and F. Y. Hadaegh, “Probabilistic and distributed control of a large-scale swarm of autonomous agents,” IEEE Trans. Robotics, vol. 33, pp. 1103–1123, Oct. 2017. C Proof of Lemma 3 It follows from Scheffé’s theorem [49, pp. 84] that if the pdfs converge pointwise, then their induced measures converge in TV. The relationship between TV error and L1 distance follows from [50, pp. 48]. [38] M. Fiedler, “Bounds for eigenvalues of doubly stochastic matrices,” Linear Algebra and Its Applications, vol. 5, no. 3, pp. 299–310, 1972. [39] A. Stuart and A. R. Humphries, Dynamical Systems and Numerical Analysis. Cambridge, England: Cambridge University Press, 1998. [40] G. Kramer and S. A. Savari, “Communicating probability distributions,” IEEE Trans. Inf. Theory, vol. 53, pp. 518– 525, February 2007. [41] J. H. Kotecha and P. M. Djuric, “Gaussian sum particle filtering,” IEEE Trans. Signal Process., vol. 51, pp. 2602– 2612, Oct. 2003. [42] B. D. O. Anderson and J. B. Moore, Optimal Filtering. Mineola, New York: Dover Publications, 2005. [43] G. J. McLachlan and K. E. Basford, Mixture Models: Inference and Applications to Clustering. New York, N.Y.: M. Dekker, 1988. [44] D. A. Reynolds, “Gaussian mixture models,” Encyclopedia of Biometric Recognition, February 2008. [45] A. G. O. Mutambara, Decentralized Estimation and Control for Multisensor Systems. CRC press, 1998. [46] H. Fourati, Multisensor Data Fusion: From Algorithms and Architectural Design to Applications. Series: Devices, Circuits, and Systems, CRC Press, Taylor & Francis Group LLC, 2015. [47] Y. Bar-Shalom, X. R. Li, and T. Kirubarajan, Estimation with Applications to Tracking and Navigation: Theory, Algorithms and Software. John Wiley & Sons, 2004. [48] D. A. A. Marı́n, “Particle filter tutorial.” (http://www. mathworks.com/matlabcentral/fileexchange/ 35468-particle-filter-tutorial) [retrieved on 13 December 2017]. [49] R. Durrett, Probability: Theory and Examples. Thomson Brooks, 2005. [50] D. A. Levin, Y. Peres, and E. L. Wilmer, Markov Chains and Mixing Times. American Mathematical Soc., 2009. 14
7cs.IT
arXiv:cs/0609092v1 [cs.PL] 16 Sep 2006 Analysis of Equality Relationships for Imperative Programs Pavel Emelianov∗ Institute of Informatics Systems, 6 avenue Lavrentiev 630090 Novosibirsk, Russia [email protected] March 1, 2018 Abstract In this article, we discuss a flow–sensitive analysis of equality relationships for imperative programs. We describe its semantic domains, general purpose operations over abstract computational states (term evaluation and identification, semantic completion, widening operator, etc.) and semantic transformers corresponding to program constructs. We summarize our experiences from the last few years concerning this analysis and give attention to applications of analysis of automatically generated code. Among other illustrating examples, we consider a program for which the analysis diverges without a widening operator and results of analyzing residual programs produced by some automatic partial evaluator. An example of analysis of a program generated by this evaluator is given. Keywords: abstract interpretation, value numbering, equality relationships for program terms, formal grammars, semantic transformers, widening operator, automatically generated programs. Introduction Semantic analysis is a powerful technique for building effective and reliable programming systems. In [17, 18, 16] we presented a new kind of a semantic flow–sensitive analysis designed in the framework of abstract interpretation [9, 10, 11]. This analysis which determines an approximation of sets of invariant term equalities t1 = t2 was called the analysis of equality relationships for program terms (hereinafter referred to as ERA). Most traditional static analyses of imperative programs are interested in finding the (in)equalities of a specific kind (so–called value analyses; only they are discussed here) ∗ This work was partly done when the author was in Laboratoire d’informatique, Ecole polytechnique (Palaiseau, France) and Ecole normale supérieure d’ingenieur (Bourges, France). 1 describing regular approximations (i.e. they have simple mathematical descriptions and machine representations) of sets of values: convex polyhedrons/octahedrons/octagons [14, 27, 36, 8], affine [32, 25] and congruent [24, 34] hyper-planes, their non-relational counterparts [9, 43, 23, 35] as well, etc. They are carefully designed to be reasonable (i.e. they express non-trivial semantic properties) and effectively computed (i.e. there are polynomial algorithms to handle them1 ) but “regular” nature does not allow them to treat well programs with irregular control/data-flows. Hence of special interest is investigations of approximations based on sets of terms which can have potentially arbitrary nature, i.e. they could be powerful (due to their irregularity) but effectively computed. One well known example is the set–based analysis [29, 12]. In our case, terms represent all expressions computed in programs. This enables the analysis to take into account different aspects of program behavior in a unified way. A such unified treatment of all semantic information allows the analysis to improve its accuracy. This does not mean that ERA is a generalization of all other value analyses (except the constant propagation one), because they use different approaches (semantic domains and transformers) to extract effectively and precisely the limited classes of semantic properties. In general, the results of the analyses are not comparable. ERA provides interesting possibilities for gathering and propagating different invariant information about programs in a unified way. This information can be used both for verification and optimization purposes. The second is especially interesting for automatically generated programs: residual, i.e. obtained in the process of the partial evaluation, and synthesized from high–level specifications. Due to nature of automatic generation processes, such programs have specific control flows (for example, hierarchy of nested conditional statements with specific conditions; in the case of residual programs this hierarchy is more deep as “degree” of the partial evaluation increases) that can be successfully optimized on base of gathered invariant information. Besides the peculiarity of ERA mentioned above, let us discuss some common properties of the semantic analyses. Such taxonomic properties of the analysis algorithms as the attribute (in)dependence, context (in)sensitivity, flow (in)sensitivity, scalability and some other properties are well known. However, it is the author’s opinion that a notion of “interpretability of a semantic analysis” has not been considered adequately yet. Here the interpretability of analysis means how extensively the properties of primitive operations of the language (arithmetical, logical, etc.) and type information are allowed for analyzing and can be handled when the analysis works. One extreme point of view on the interpretability is an approach accepted in the “pure” program scheme theory where no interpretations of functional symbols or type information are allowed2 . Unfortunately, the results obtained under this approach are not reasonably strong. Nevertheless, it must be underscored that ERA dates back to V. Sabelfeld’s works in the program scheme theory [39, 40]. Another extreme leads to the complete description of the program behavior that is also not workable. Obviously, it is closely allied to its flow sensitivity (ignoring some part of semantic information 1 An example of this sort is an approximation of value sets by conic shapes that has only one “computational disadvantage”: semantic transformers involve algorithms known to be N P -hard. Proposed in [4] many years ago it did not gain ground. 2 More precisely, there exist some works in the program scheme theory where some semantic interpretations of functional symbols (like commutativity of superposition f ◦ g ≡ g ◦ f , etc.) are considered. 2 does not allow us to treat precisely some control flow constructs of analyzed programs) and its scalability (attempts to take into account large quantity of semantic properties, for example, using some theorem prover which is invoked while an semantic analyzer works and deduces new properties, can lead to combinatorial explosion for abstract computational states). It is possible that the interpretability has not been highlighted enough, because most of analysis algorithms take into account the limited classes of primitive operations and type information and they cannot be enriched in some natural way. For example, an interval analysis is not able to incorporate congruence properties in some natural way, etc3 . Essentially another case is ERA where we have a choice to handle expressiveness of the analysis. We intend to illustrate the notion of “interpretability of analysis”, its importance and usefulness on this example of analysis. Among the analyses closely related to ours we would like to point out the following. A semantic analysis for detection of equalities between program variables (and simple relationships among them) was described in [2]. It makes a list of sets of variables discovered to be equal by using the Hopcroft’s partitioning algorithm for finite–state automata. This algorithm being quite efficient is not however precise enough. Further value-numbering techniques were developed in [38, 21, 26]. These algorithms demonstrate that adequacy of value numbering is resource-consuming. For example, in the last case time complexity of the algorithm is O(k 3 jN ) where k is a number of program variables, j is a number join-points, and N is program size. Another important example is the set-based analysis [29] mentioned above. Here approximating sets of terms are found with resolving some system of set-theoretical equations. Formal grammars were used for an analysis of recursive data structures of functional languages (see, for example, [31]). Formal languages were applied to coding of memory access paths in [15, 42] and values of program variables in the set-based analysis. [12] established common foundations connecting and generalizing different approaches using formal languages to represent semantic properties. Of course, we should mention techniques from the automatic proof theory and the term rewriting theory which can be widely applied both at the analysis stage to improve its accuracy and the post-processing stage to present its results to the user. This article is organized as follows: In Sections 1.1 and 1.2 we describe the semantic properties, concrete and abstract, respectively, which are considered in ERA. In Section 1.3 we discuss some basic operations over the semantic properties used to define the semantic transformers which are next presented in Section 2. In Section 3 we consider a widening operator and the complexity of ERA is discussed. Finally, Section 4 describes processing of ERA invariants and presents some results of our experiments with ERA. In Appendix an example of analysis of some residual program is considered. 3 Of course, it is possible to use sophisticated approaches for combinations of analyses but it introduces complicated problems under implementations and it is not an enrichment of original ones. 3 1 Properties of interest 1.1 Concrete properties A usual choice for the description of the operational semantics is a specification of some transition relationship on the pairs <control point, state of program memory> (see, for example, [30, 22]) where the states of program memory are described by mapping the cells of memory into a universe of values. Here variables (groups of cells) and their values (constants) are in asymmetric roles. Another example of “asymmetry”: manipulations over the structured objects of programs (arrays, records etc.) are not so transparent as over the primary ones. To describe the operational semantics for ERA, we used another approach. All objects of a program are considered to be “identical” in the following meaning. Let CV be a set of 0–ary symbols representing variables and constants. The last ones may be of the following kinds: scalars, compositions over scalars (i.e., constant arrays, records, etc.), names of record fields, and indefiniteness. Let FP be a set of n–ary (functional) symbols which represent primitive operations of programming languages: arithmetic, logic, type casting, and all the kinds of memory addressing, as well. Let TRS be a set of well-formed terms over CV and FP, hereinafter referred to as program terms. They represent expressions computed during execution of a program. So, as a state of program memory we take a reflexive, symmetrical, and transitive relationship (i.e., equivalence relationship) over TRS. The relationship defines some set of term equalities which we use to describe the operational semantics and call a computation state. Suppose that the following code var x,i,j : integer; a : array [1..3] of integer={1,2,3}; ... i := 3; j := i-1; if odd(x) then i := i mod j; j := 1; else j := a[i]; a[i] := a[1]; a[1] := j end ... Example 1 is executed at least twice for the different parities of the variable x. In Table 1 static semantics for five control points is given. We present a minimum4 subset of term equalities concerning dynamic behavior of the piece. We shall use the property π (see Table 1) to illustrate our further reasoning. 4A set of equalities can be completed with any number of consistent equalities. 4 then-branch else-branch     (   a[1]=1,a[2]=j=2,a[3]=i=3, entry  a= 1 2 3 ,ODD(x)=TRUE     exit     (   a[1]=i=j=1,a[2]=2,a[3]=3,  a= 1 2 3 ,ODD(x)=TRUE         (   a[1]=1,a[2]=j=2,a[3]=i=3,  a= 1 2 3 ,ODD(x)=FALSE        )            (   a[1]=i=j=3,a[2]=2,a[3]=1,  a= 3 2 1 ,ODD(x)=FALSE        )           )           )        exit of if–statement π=        ) ( ) (    a[1]=i=j=1,a[2]=2,a[3]=3,  a[1]=i=j=3,a[2]=2,a[3]=1,   a= 1 2 3 ,ODD(x)=TRUE 3 2 1 ,ODD(x)=FALSE a=         , Table 1: Description of collecting semantics for Example 1 (here the constant c1 c2 c3 represents constant arrays). 5 Equality relationships a = h(y) x = f (a, y) x = f (h(y), y) f (a, y) = f (h(y), y) Grammar representation S → A1 = A1 |A2 = A2 |A3 = A3 A1 → x|f (A2 , A3 ) A2 → a|h(A3 ) A3 → y Functional net representation ✏ ✓ x f ✒ ✓❏ ✑ ✓ ❏ ✓ ❏ ❏ ❫ ✓ ✏✗✔ ✓ ✴ ✲ y a h ✒ ✑✖✕ Figure 1: Semantic properties and their representations. The set of equalities does not contain trivial equalities like x = x and equalities given by the symmetry of the equality relationship. Formally it is described as follows. Let EQS be a set of all equalities of the terms from TRS, i.e., EQS = {t1 = t2 | t1 , t2 ∈ TRS}. A set S ∈ ℘(EQS) is a computation state interpreted in the following way. For each equality ti = tj ∈ S values of the expressions represented by ti and tj must be equal at this point for some execution trace. We take the set ℘(℘(EQS)) as a set for a concrete semantic domain describing the collecting semantics of ERA. So, an element of the concrete semantic domain is a set of computation states. For a particular point in a particular program it is a set of computation states each of them corresponds to some execution trace in the program that reaches this point. Properties considered in ERA are presented by means of context–free grammars G = (N, T, P, S) where N is a finite set of nonterminals denoted by capital letters, S ∈ N is the initial symbol of the grammar G, T = CV ∪ FP ∪ { (, ), =, } is a finite set of terminal symbols, and P is a finite set of grammar rules. We do not give their precise description because we shall use quite simple machinery from formal languages theory that is not an object of considerations itself and serves for demonstrations. We could use functional nets language as well but it is rather machine–oriented and is not widely used. We expect that all these descriptive ways become apparent from the examples on Figure 1 and further ones. In that way, a state of computation is represented by a language L(G) generated by some grammar G of the described form. If for A ∈ N : + + A⇒ t1 ∧ A⇒ t2 , i.e. t1 = t2 ∈ L(G), we say that the nonterminal A and the lanG G guage L(G) know the terms t1 , t2 . Obviously, such a grammar representation has some superfluous “syntactic sugaring”. We can use S → A rules only and say about A–nonterminals as classes of equal values. Evidently we may suppose that the set of rules P does not contain rules having identical right parts. It is convenient to consider the grammars which do not contain useless and redundant nonterminals and rules. A rule is useless if it produces only one term (the language knows only a trivial equality like t = t) and this term is not an argument of other terms. A nonterminal is useless if it does not participate in derivations , 6 of sentential forms [1]. Such grammars can arise as result of operations on grammars. If nonterminals and rules are useless or redundant it is possible to remove them (see Lemma 2). This operation called state reduction consist in detecting and removing a set of useless/redundant nonterminals/rules. They are revealed with the well–known incremental markup algorithms (see, for example, [1]). For illustrating purposes we shall use special functional nets for these grammars. Here nonterminals are represented by ovals containing 0–ary and functional symbols from right parts of rules. Arcs from functional symbols to ovals represent argument dependencies ordered from left to right (see Figure 1). 1.2 Abstract properties It is an interesting peculiarity of ERA that abstract (i.e. approximate) properties have the same nature as the computation states of the operational semantics. Formally this approximation is defined as follows. 1.2.1 Functions of abstraction and concretization Given a concrete property π ∈ ℘(℘(EQS)) and an abstract property π̃ ∈ ℘(EQS), the abstraction function α : ℘(℘(EQS)) → ℘(EQS) and the concretization one γ : ℘(EQS) → ℘(℘(EQS)) are defined in the following way  if π = ∅,  EQS, \ α(π) = and γ(π̃) = ∪{ π | α(π) ⊇ π̃ } S otherwise  S∈π where ∪ is the set–theoretical union on ℘(℘(EQS)) and ⊇ and ∩ are the set–theoretical inclusion and intersection of the languages (i.e. on ℘(EQS)) respectively. We take the empty language as infimum ⊥′ (there are no computed expressions) of the semi-lattice of abstract semantic properties. The supremum ⊤′ (an inaccessible computation state) is the language containing all possible equalities of program terms. Also ⊆ is the set– theoretical inclusion on ℘(℘(EQS)) Lemma 1 The abstraction function α is monotonic. Proof The function α is monotonic iff ∀π1 , π2 ∈ ℘(℘(EQS)) : π1 ⊆π2 ⇒ α(π1 )⊇α(π2 ). Because π1 ⊆π2 , then π2 = π1 ∪(π2 \ π1 ). So, we have α(π1 )⊇ α(π1 ∪(π2 \ π1 )) = α(π1 ) ∩ α(π2 \ π1 ) = α(π1 ) ∩ (∩S∈π2 \π1 S). Q.E.D. γ(π̃) is the most imprecise element of ℘(℘(EQS)) that can be soundly approximated by π̃ ∈ ℘(EQS). For the example of Table 1, the best approximation of the concrete property π is   α(π) = a[1] = i = j, a[2] = 2 . 7 (∗) ✎ ☞ g ✍ ✌ ✡ ✡ ❙ L1 ✡ ✡ ❙ ✡ ✡ ❙ ✢ ☞ ✢ ✡ ✎ ✡ ✎ ✇ ❙ f ✍ z f ✂ ✌ ✍ x a ✎ ✁✻ g ✎ ✍ f ✂ ☞ ✍ ✌ ✡ ✡ ❙ L2 ✡ ✡ ❙ ✡ ✡ ❙ ✢ ☞ ✢ ✡ ❙ ☞ ✎ ✡ ✎ ✇ y x a f ✛ f ✌ ✍ ✌ ✍ ✂ ✁✻ y ☞ ✍ ✌ ✡ ✡ ❙ ✡ ✡ ❙ ✡ ✡ ❙ ✢ ☞ ✎✇ ✡ ✢ ✡ ✎ ❙ f g f ✌ ✍ a ✎ ✍ ❈ ✌ ✍ ✁✻ ✌ ❈ ❈ ☞ ✎ ❈❲ y ☞ z f x ☞ z ☞ ✌ L1 ∩L2 ✌ Figure 2: Intersection of computation states. 1.2.2 Intersection of ERA–languages Finding of the intersection of context–free languages is an undecidable problem in the general case. In our case, for the languages of term equalities, an algorithm exists (see an example at Fig. 2). It is similar to constructing a Cartesian product of automata. Algorithm. Intersection of two languages of term equalities. Input: grammars G1 = (N1 , T, P1 , S1 ) and G2 = (N2 , T, P2 , S2 ). Output: grammar G = (N, T, P, S) such that L(G) = L(G1 ) ∩ L(G2 ). Description: 1. Let N = {hN1 , N2 i|N1 ∈ N1 & N2 ∈ N2 } = N1 × N2 . 2. The set of rules P is defined as follows: • The rule hN1 , N2 i → t is introduced if and only if t ∈ CV & N1 → t ∈ P1 & N 2 → t ∈ P2 . • The rule hN1 , N2 i → t(hN11 , N21 i, . . . , hN1k , N2k i) is introduced if and only if t ∈ FP & N1 → t(N11 , . . . , N1k ) ∈ P1 & N2 → t(N21 , . . . , N2k ) ∈ P2 . 3. Add rules S → hN1 , N2 i = hN1 , N2 i for the initial nonterminal S of G and for all N1 ∈ N1 \ {S1 }, N2 ∈ N2 \ {S2 }. 4. Apply state reduction. The described algorithm of intersection is very “naı̈ve” and impractical. To improve it we should choose a more efficient strategy for generating functional symbols. To do this we first do a topological sorting of the functional symbols appearing in the right 8 parts of rules; intersect the 0–ary symbol sets; and then generate the next functional symbol in conformity with its topological order if and only if all arguments of this symbol already exist in the new grammar. For practical cases this intersection can be done in an linear average time with respect to grammar size and linear space. It demands quadratic time in the worst case. 1.3 Operations over semantic properties Now we shall discuss some basic operations over semantic properties {|  }| : ℘(EQS) → ℘(EQS) used to define the semantic transformers of ERA. For all {|  }| the notation L{|  }| {|  }| means (L{|  }| ){|  }| . 1.3.1 Removing terms Operations over abstract computation states use certain common transformation of the sets of term equalities which consists in removing some subset L′ . The following statement holds. Lemma 2 Removing any subset of term equalities preserves correctness of an approximation. Proof It easy to see that ∪{ π | α(π) ⊇ π̃ } = γ(π̃) ⊆ γ(π̃ \ L′ ) = ∪{ π | α(π) \ ⊇ (π̃ \ L) } = ∪{ π | (L∪L′ ) ⊇ π̃ }, L∈π which states that removing term equalities makes the approximation more rough but it does preserve its correctness. Q.E.D. For (∗), for example, γ({a[1] = i = j, a[2] = 2})⊆γ({a[1] = i}). We shall write L{| ↓ t|} and L{| ↓ T }| for single term and term set removing followed by the state reduction operation defined above. 1.3.2 Term evaluation We define the abstract semantics for an evaluation of a term in an abstract computation state. The result of the term evaluation is a state knowing the evaluated term. Term evaluation L{|t|}. 1. If t = t ∈ L, then L{|t|} = L. 2. Otherwise, if t ∈ CV, then add the new rules S → A = A and A → t to the grammar G, where A is a nonterminal which does not exist in G. 9 ✗ ✔ f ✗ x h ✖ ✗ ✌✂ y ✖ ✂ ✔ ✂ ✂ ✕ a ✔ ✕ ✖ ✑ ◗ ✕ ◗ ✑ ◗ ✑ ◗ ✑ ◗ ✑ ◗ ✑ ✗✰ ✔ ✗ ✔ ✗ s ◗ g x h f ✔ ✖ ✕ ✖ ✕ ✖ ✕ ✂ ✻ ✻ ✍ ✌ ✍ ✌ ✂ ✂ ✗❄ ✔ ✔ ✗ ✂✌ ✍ ✲ y a b ✖ ✕ ✖ ✕ L{|f (g(a, x), f (h(y), b))|} L Figure 3: Term evaluation. 3. Otherwise, if t = f (t1 , . . . , tn ) where f ∈ FP is a functional n–ary symbol and the + + tn ), t1 , . . . , An ⇒ sub-terms t1 , . . . , tn have been calculated (i.e. there exist derivations A1 ⇒ G G then add the new rules S → A = A and A → f (A1 , . . . , An ) to the grammar G, where A is a nonterminal which still does not exist in G. To improve an accuracy of analysis we can take into account, for example, the commutativity of primitive operations. If L knows f (t1 , t2 ) and f is commutative then L{|f (t2 , t1 )|} = L. 1.3.3 Identification of terms When the standard semantics defines that during program execution values of computed expressions are equal, we can incorporate this information in the computation state (but it can also be left out). Identification of terms transforms the state into a new one incorporating this information. For example, we know that a value of a term representing the conditional expression of an IF-statement coincides with 0-ary terms representing the constants TRUE or FALSE when, respectively, THEN-branch or ELSE-branch is being executed. So, identification of terms along with semantic completion considered below provides powerful facilities to take into account real control flow in programs. Identification of terms L{|t1 ≡ t2 }| . 1. If t1 = t2 ∈ L then L{|t1 ≡ t2 }| = L. + + t2 . We replace the nonterminal A2 by the nonterminal A1 t1 and A2 ⇒ 2. Let A1 ⇒ G G in all rules of P. If rules with an identical right side B1 → w, . . . , Bk → w have appeared, then a certain nonterminal from the left sides of the rules (for example B1 ) must be taken and all nonterminals B2 , . . . , Bk in the grammar must be replaced by it. 10 ✛ g a ✚ ✓ ❅ ❅ ✓ ✴ ✓ ❘ ❅ ✛ ✛✘ ✘ ✛ g a ✚ ❙ ❙ ❄ ❙✇ ✛ ✙ ✘ ✘ ✙ ✘ ☛✲ g f ✚ ✙ ✍ ✌ ❄ ❄ ✘ ✛ g f ✛ f ✚✙ ✚ ✙ ✂ ❇ ✂ ❇ ❇◆ ✂✌ ❄ ✛✘ ✛✘ x b ✚✙✚✙ x ✚ b L{|x ≡ b|} L ✙ Figure 4: Identification of values of terms. 3. Repeat step 2 until stabilization. If after that we have a state L′ containing inconsistent term equalities5 then the result is ⊤′ else it is a reduction of L′ . An example of identification is given in Figure 4. Lemma 3 Identification of values of terms is a correct transformation and the resulting state is unique. Proof Let π = { Li | Li ∈ ℘(EQS) } be a concrete semantic property which holds before identification of terms t1 and t2 . If the values of t1 and t2 are equal in the concrete semantics ∀Li : t1 = t2 ∈ Li , then they are equal in the abstract semantics t1 = t2 ∈ α(π), too. If their values are not equal, then identification gives us an inconsistent computation state which obviously includes L{|t1 ≡ t2 }| for all t1 and t2 . So, this transformation is correct. Identification is done in finite steps because the size of grammar decreases at each step. Uniqueness of the resulting state is explained by the following observation. If we have two pairs of terms which are candidates for identification, then identification of one of them does not close a possibility of it for another, because we remove a duplication of the functional symbols only. In fact, after identification of a pair of terms we obtain a new state, including the source one, and thus other existing identification possibilities remain. So, the order of “merging” of term pairs is not important for the resulting state. Q.E.D. 1.3.4 Semantic completion We have not yet considered any interpretation of constants and functional symbols. We could continue developing ERA in the same way. As a result we shall obtain a 5 There exists a wide spectrum of inconsistency conditions. The simplest of them is an equality of two different constants (see Section 1.3.4 for the further discussion). 11 ✗ x ✖ ✔ ✗ y ∗ ✕ ✖ ✚ ✻ ✚ ✡ ✠ ✚ ✚ ✚ ✚ ✗❄ ✔ ✗❄ ✚ ❂ ✚ z 0 ✖ ✕ ✖ + ✔ ✕ ✔ ✕ L ✓✏ ❄ ✔ ✗ ✛✟ x z + ✖❇ ✕ ❇ ✒✑ ❇ ❇ ✗ ◆❇ ✔ y ∗ 0 ✖ ✕ ✻ ✍ ✌ ✒ ✑ Co(L) Figure 5: Semantic completion. noninterpretational version of the analysis likewise analysis algorithms in the program scheme theory. However, it is natural to use semantics of primitive operations of the programming language of interest in order to achieve better accuracy. ERA provides us with possibilities of taking into account properties of language constructs, and, what is especially important, we can easily handle complexity of these manipulations. In fact, inclusion of these properties corresponds to carrying out some finite part of completion of the computation states by consistent equalities. This manipulation is called semantic completion (about “conjunctive/disjunctive completion” see [11]). As a basic version of semantic completion Co we take computations over constant and equal arguments. When we detect that some term t has some specific value v then Co(L)=L{|t ≡ v|}. Also, it is possible to apply identification involving dependencies among result of an operation and its arguments: if (t1 AND t2 ) = T RUE ∈ L then Co(L)=L{|t1 ≡ T RUE|}{|t2 ≡ T RUE|} etc. This identification process is iterative because new possibilities for identification can appear at the next steps. It is conceivable that in doing so we shall detect inconsistency of a computation state. In this case result of semantic completion is ⊤′ . This version can be extended by some intelligent theorem prover inferring new reasonable equalities and checking inconsistency of computation states. Such combining of analysis with proofs offers powerful facilities to the analyzer (see [28, 13]) and, as it was mentioned in the previous works, this prover is reusable for consequent (semi-)automatic processing of results of the analysis. “Size” of used completion can be tuned by options of interpretability of the analyzer. Some arithmetical errors (such as division by zero, out of type range etc.) will appear during the semantic completion. In this case the analyzer tells us about the error and sets the current computation state to ⊤′ . Notice that for the languages where incomplete Boolean evaluation is admissible semantic completion over Boolean expressions should be carefully designed especially in presence of pointers. An example of semantic completion is presented in Figure 5. Turning back to the identification example at Figure 4, we consider the following interpretation of constants 12 and functional symbols: g is the exclusive disjunction, f is the negation, a is the constant TRUE and b is the constant FALSE. It is easy to see that in this case application of semantic completion gives us L{|x ≡ b|} = ⊤′ . In our analyzer we implemented an interpretational version of ERA which uses semantic completion Co(L). Under this approach, the definitions of the basic transformations mentioned above are changed to the following: ′ L{|t|} = Co(L{|t|}), ′ L{|t1 ≡ t2 }| = Co(L{|t1 ≡ t2 }| ). In short, we shall omit this “interpretability” prime. 2 Semantic transformers In this section we describe semantic transformers [[]] : ℘(EQS) → ℘(EQS) corresponding to common statements existing in imperative programming languages. If for a statement S an input computation state is L then L[[S]] is its output computation state. For all [[]] the notation L[[]][[]] means (L[[]])[[]]. 2.1 Assignment statement Among all program terms considered in ERA we can pick out access program terms including array elm, record fld, and pointer val referencing and playing an important role in determination of effect of an assignment statement. As in [15, 42] our abstraction of program memory manipulations is storeless and based on notion of memory access paths represented by access program terms. For example, for an address expression bar[i][j]ˆ.foo the access term is fld(val(elm(elm(bar, i), j)), f oo). We shall assume that no operations other than memory addressing (for example comparisons) are allowed for structured variables such as arrays and records. So, for the previous example neither a and elm(a, i) (a[i]) nor val(elm(elm(a, i), j)) (a[i][j]ˆ) can appear as arguments for operations other than elm and fld respectively. This limitation allows us to simplify definition of our assignment statement abstraction6 . To preserve safety of the analysis we have to take into account memory aliasing appearing in programs. Two access terms are alias if they address the same memory location. In the general case ERA is inadequate itself to handle precisely all kinds of aliasing and we should use other analyses. Next it is assumed that for each access term ta we know a set A(ta ) of access terms covering a set of aliases for ta (may–alias information about ta ). Let + A(ta , L(G)) = (A(ta ) ∩ CV) ∪ {f ∈ FP | A⇒ f (. . .) ∧ f (. . .) ∈ A(ta )} G 6 Otherwise we have either to accept that each assignment to some structured variables destroys all equalities involving other components of it or to implement some strategy (for example copying) preserving useful and safe access terms. 13 (“roots” of memory access terms in A(ta )). Notice that flow–insensitive approximations of alias information may cause conservative results of ERA. Therefore ERA and alias analyses used in its implementation should have the same sensitivity to the control flow. Assignment statement L[[v := exp]]. 1. In the state L evaluate exp using evaluation transformer formally defined earlier in Section 1.3.2. Let L′ be a result of the evaluation and let E be a nonterminal such that E⇒exp. 2. Perform L′ {| ↓ A(v, L′ )|}. Do not remove E. 3. Add the term v so that E⇒v. Unfortunately, in some cases this abstraction of the assignment statement fails as before. For example, this assignment transformer corresponding to x:=x+1 and being applied to the state L = {(x > 0) = T RUE} gives only the trivial identity L[[x := x + 1]] = {x = x}. To improve accuracy of the analysis in these cases we can consider “artificial” variables associated with scalar variables of the program which will store previous values of the original ones. Under this approach between first and second steps of the assignment statement effect definition we should insert the step Let A → v and B → v ′ where v ′ is associated with v. Remove the second rule and add A → v ′ if it is needed. ... Under this approach we shall have L[[x := x + 1]] = {(x′ > 0) = T RUE, x = x′ + 1} from where we can deduce that x > 0 also. 2.2 Other transformers • Program. Given a program PROGRAM; VAR x : T; BEGIN S END. (∗ variables ∗) (∗ statements ∗) we can define the following transformer corresponding to it ⊥′ [[P ROGRAM ]] = ⊥′ [[x := ω]][[S]] where ω represents the indefinite value. Notice that ω is not a constant. • Empty statement . L[[ ]] = L • Sequence of statements. L[[S1 ; S2 ]] = L[[S1 ]][[S2 ]] 14 • Read statement . L[[READ(x)]] = L{|x|}{| ↓ A(x)|} Notice that if for read statement as well as for other statements some set of user’s pre– or post–assertions represented in the form of equalities of program terms is supplied then the analyzer can take them into consideration to check consistency and to include in the current computation state. • Write statement . L[[WRIT E(x)]] = L{|x|} • Conditional statement . IF p THEN St ELSE Sf END. If L′ = L{|p|} then L[[IF ]] = L′ {|p ≡ TRUE|}[[St ]]∩L′ {|p ≡ FALSE|}[[Sf ]]. • Cycle statement . CYCLE S (∗ body of cycle ∗) END where S is a composed statement that possibly contains occurrences of exit-ofcycle statements EXITk . When the sequence L0 = L, Ln = Ln−1 [[S]] for n > 0 becomes stabilize L[[CY CLE]] = ∩k Ek where Ek is a stationary entry state for EXITk . If this process does not become stabilize then some widening operator should be used (see Section 3). • Halt, exit and return statements. L[[EXIT ]] = L[[RET U RN ]] = ⊤′ • Call of function. We assume that return of results of function calls is implemented as an assignment to variables having the same names as invoked functions (connection with their call sites should be taken into account). The function bodies may contain RETURN statements as well. FUNCTION F(x: T1 ) : T; VAR y: T2 ; BEGIN S END. (∗ local variables ∗) (∗ statements ∗) L[[F U N CT ION ]] = L[[x := e; y := ω; F := ω]][[S]]∩R 15 ✓ x ✒ L y ✓ ✏ x ✒ ✏ ✑ ❅ ❅ ✗✔ ✗✔ ✠ ❘ ❅ ✑ y + ✖✕ F 1 ✖✕ L[[x := F (x)]] Figure 6: Function call for F (a) = a + 1. where e is a factual parameter of the function (see the note for READ statement) and R = ∩Rk is intersection of stationary entry states for return statements in S if they exist and R = ⊤′ otherwise. In the term being evaluated the result of a function call is represented by F . 3 Widening operator and convergence of the analysis Our abstract semantic domain does not satisfy the (descending) chain condition and therefore it requires some widening operator [9, 10, 11]. To guarantee the convergence of the abstract interpretation we should use a dual widening operator: ˜ & y ⊇ x▽y, ˜ • ∀x, y ∈ ℘(EQS) ⇒ x ⊇ x▽y • for all decreasing chains x0 ⊇x1 ⊇ . . ., the decreasing chains defined by y0 = x0 , . . . , yi+1 = ˜ i+1 , . . . are not strictly decreasing. yi ▽x The iteration sequence with widening is convergent and its limit is a sound approximation of the fixpoint. 3.1 Widening operator for ERA–grammars Infinite chains can appear because corresponding languages have common infinite subsets generated by cyclic derivations in grammars. The source of that in ERA is term identification. We can avoid this problem by imposing the constraint that grammars must be acyclic. Within the semilattice ℘(EQS)(⊇, EQS, ∩), the subsemilattice of finite languages7 generated by such grammars satisfies the chain condition, but such languages are not expressive enough. Our solution is the following. Grammars are not originally restricted but if in course of abstract interpretation the grammar size becomes greater than some parameter, then “harmful” cycles must be destroyed. To this end we remove grammar rules participating in cyclic derivations. Correctness of this approximation of intersection follows from Lemma 2. 7 Notice that sets of term equalities of a special form corresponding to these languages were used by V. Sabelfeld to develop effective algorithms of recognizing equivalence for some classes of program schemata [39, 40]. 16 Detecting such rules is no simpler than the “minimum-feedback-arc/vertex-set” problem (MFAS or MFVS) if we consider the grammars as directed graphs. These sets are the smallest sets of arcs or vertices, respectively, whose removal makes a graph acyclic. We suppose that the “feedback vertices” choice is more natural for our purposes. In the general case this problem is NP –hard, but there are approximate algorithms that solve this problem in polynomial [41] or even linear [37] time. Consideration of weighted digraphs makes it possible to distinguish grammar rules with respect to their worth for accuracy of the analysis algorithm. However, perspectives of this approach are not clear now for complexity/precision reasons of such algorithms. For example, [19] proposes an algorithm for weighted FVS-problem requiring O(n2 µ(n) log2 n) time where µ(n) is complexity of matrix multiplication. ✏ ✏ ✓ ✓ ✟ x a ✛ x a f f ✒ ✑ ✒ ✑ ✓ ❙ ❙ ✓ ❙ ❙ ✓ ❙ ❙ ✓ ❙ ❙ ❙ ✓ ✇ ✇ ✓ ✠ ✓ ✴ ✏ ✓ ❙ ✏ ✏ ✓ ✲ ✲ g y g y r r f h h ✒ ✑ ✒ ✑ ✒ ✑ ✒ ❅ ✓ ❙ ✻ ✻ ✡ ✠✡ ✠ ✓ ❙❅ ✓ ❙ ❅ ✓ ❙ ❅ ❅ ✓ ❙✓ ❫ ✇ ❘ ❅ ✓ ☛ ✏ ✏ ✴ ✓ ✇ ❙ z z h ✒ ✑ ✒ ✑ ✚ ✙ L(G) L(G)\fvs f g r f h f g r h Acyclic subgraph of the cyclomatic graph of the grammar h Cyclomatic graph for the grammar G Figure 7: FVS–transformation. 17 ✏ ✑ Our widening operator for the analysis of equality relationships is defined in the following way. A vertex set of the cyclomatic graph8 of the grammar G is a set of functional symbols existing in G. An arc (f, g) belongs to its arc set if G contains rules A → f (. . . , B, . . .) and B → g(. . .). A transformation of a cyclomatic graph which involves detecting some FVS (it can be an upper approximation of a minimal feedback set) and removing all vertices from the FVS is said to be an FVS–transformation (an example is shown in Figure 7). Let L\FVS be a language obtained from L by FVS–transformation applied to the grammar generating L. We define   L(G1 )\FVS ∩ L(G2 ) if |G2 | ≥ |G1 | > d, ∼ L(G1 ) ∩ L(G2 )\FVS if |G1 | > |G2 | > d, L(G1 )▽L(G 2) =  L(G1 ) ∩ L(G2 ) otherwise, where d is a user-defined parameter. It is reasonable to choose this parameter, depending on number of variables of analyzed programs, as a linear function with a small factor of proportionality. Notice that in this case the lengths of appearing chains linearly depend on number of variables living simultaneously. 3.2 Divergence of the analysis Is the widening operator, being rather complex, really needed for the analysis of equality relationships? Are there programs which, being analyzed, generate infinite chains of semantic properties? It should be mentioned that constructing such program examples has been a problem for a long time. In [18] we stated our belief that their existence seems hardly probable. These attempts failed, because they concentrated on constructing an example with completely non-interpretable functional symbols, i.e. in the frame of the “pure” theory of program schemata. As already noticed, we can widely vary the interpretability of the analysis algorithm. In order to construct an example, it will suffice to use the following rule of completion: if (t1 = t2 ) = T RUE ∈ L then Co(L) = L{|t1 ≡ t2 }| . We consider the following example: ... x:=f(y); if f(x)=f(y) then while y=f(g(y)) do y:=g(y) end end ... program scheme ... x:=sign(y); if sign(x)=sign(y) then while y=sign(abs(y)) do y:=abs(y) end end ... “real-world” program The properties computed at the body entry belong to an infinite decreasing chain. On Figure 8 a state Le describes properties valid before cycle execution; states L1 8 A graph represents cyclic derivations in the grammar. The author did not find another appropriate name for this object in the Computer Science and Discrete Mathematics literature. 18 ✓✏ ❄✔ ✗ x f f ✖ ✕ ✒✑ ❄ ✗✔ y ✖✕ Le ✓✏ ❄✔ ✗ x f f ✖ ✕ ✗❄ y f ✖ ✒✑ ✔ ✛✟ ✕ ❄ ✗✔ g ✖✕ L1 ✒✑ ✓✏ ❄✔ ✗ x f f ✖ ✕ ✒✑ ❄ ✗✔ ☛✲ f ✖✕ ✗❄ ✔ ∗ ✛ ✟ y g f ✖ ✕ ✒✑ ❄ ✗✔ g ✖✕ ✒ ✑ L2 Figure 8: The case of divergence of the analysis. and L2 describe properties at the entry of the cycle body for first and second iteration, respectively. It is easy to see that L1 ∩L2 coincides with L2 except in the equality relationships containing terms generated by g ∗ . Therefore every time we obtain the next state, the functional element g ∗ is absent and the sub-net placed in the dashed box will repeat more and more times. To obtain a “real-world” program from this program scheme, we interpret the functional symbols in the following manner: f ≡ sign and g ≡ abs. We would like to point out the following interesting property. Execution of this piece of code (i.e., its behavior determined with the standard semantics) diverges only for two values of y: 0 and 1. At the same time the analysis algorithm (i.e. execution of the piece of code under our nonstandard semantics) is always divergent on condition that a widening operator is not used and the assumption on interpretation mentioned above holds. Is this program actually real-world? The reader should decide that by himself but we would like to underline the following9 . On the one hand, the interpretability of the analysis algorithm can be varied in wide ranges and, on the other, we are not able to prove formally the impossibility of such behavior of the analyzer under the considered interpretation. So, we can choose either a lean analysis using acyclic grammars only or another one using arbitrary grammars and some widening operator. 9 The penetrating reader may notice that this program to be considered as human written is really stupid (it can be slightly intellectualized if we interpret g as “add 1”). But for automatic generators of programs such a code does not seem improbable. 19 3.3 Complexity of the analysis In [18] we pointed out the following upper bound on time for the algorithm of ERA: O(nmG2max ), where n is program size, m is maximum of number of program variables existing at a time, and Gmax is maximum of sizes of grammars appearing in course of the analysis. Due to our construction of widening operator (namely, choice of the parameter d linearly depended on m) we can assume that Gmax = O(m). This bound can be deduced with help of Theorem 6 in [5]. The theorem states that for the recursive strategy of chaotic iteration maximum complexity is X  h· δ(c) ≤ h · |C| · |W | , (∗∗) c∈C where h is maximum length of increasing chains built by a widening operator, C is set of control program points, δ(c) is depth of the control point c in hierarchy of nested strongly connected components of the control flow graph containing c, and W is set of vertices where a widening operator is applied during the analysis. For well-structured programs we can assume that maximum depth of nested loops does not depend on program size and is bounded by some constant. By (∗∗) we conclude that number of algorithm steps does not exceed O(nm). Since time complexity of all operations used in the analysis are estimated by G2max we obtain O(nmG2max ) (or O(nm3 )) upper bound. Notice that to improve the results of the analysis it is possible to use rich semantic completion and more precise FVS–algorithms that have more than quadratic time complexity. However, experimental results show that an approximation of a fixed point for the heads of cycle bodies is usually attained after at most two iterations and time complexity of the analysis is proportional to nGmax . Also, the user can turn off checking a threshold after which widening is started. In this case, he (consciously) admits some chance that the analysis diverges but we believe that this chance is not too big. It is easy to see that the space complexity of the equality relationship analysis is O(nGmax ) and it is essentially depended on the number of variables. We estimate the actual space requirements as 1.5–2.0 Mb per 1000 program lines for middle-size programs. 4 4.1 Processing of invariants and experimental results Usage of ERA–invariants ERA produces some set of invariants involving program terms which can be useful at different steps of program development and processing: debugging, verification (for that the invariants are interesting themselves), specialization, and optimization. The automatic prover mentioned above can be used at step of post-processing results of the analysis. We notice that the analyzer can tell the user useful information both at the stage of analyzing (this means that it is possible that there exist execution traces where such computational states appear; we mark with + properties which can be detected at this 20 stage) and at the stage of processing of results of the analysis (these properties hold for each execution trace leading to this program point). We shall briefly list some program properties that can be extracted from computation states Lin and Lout being for a statement S the input and output states respectively. + Variable x has an indefinite value if Lin contains x = ω. + Error in evaluation of an expression: division by zero, out of type ranges, nil–pointer dereferencing, etc. − S is inaccessible if Lin = ⊤′ . This information can correspond to different properties of program execution: potentially infinite cycles and recursive calls, dead branches of conditional statements, useless procedural definitions, etc. − Assignment statement v:=exp is redundant if Lout contains v = v ′ where v ′ is the variable associated with v. − Unused definitions (constants, variables, types). − Constant propagation. Notice that ERA can detect that an expression is constant not only when constants for all variables in this expression are known. − More general: for some expression there exists an expression that is equal to the original one and calculated more efficiently (with respect to an given criterion time/space and target computer architecture). Obviously, this list is not complete and there are many other properties which can be extracted from the invariants. For example, we can consider systems of equations/inequalities contained in the gathered invariants and try to solve them to derive more precise ranges for values of expressions or the inconsistency of this computational state. Apart from the automatic mode when invariants are processed automatically, we provide an interactive mode to visualize results of our analysis in a hypertext system. HyperCode presented in [7, 3] is an open tunable system for visualization of properties of syntactic structures. There are two cases: visualization of all properties detected in the automatic mode and the user-driven processing and visualization of properties. The experiments show that not all program properties of interest can be automatically extracted out of the computed invariants. It is not judicious to consider many particular cases and to hardly embed them into the system. Instead, the system facilitates the specification of the user request with some friendly interface. He chooses a program point and an expression and obtains those and only those equality relationships, valid at this point, where this expression occurs as a super- or sub-term. 4.2 Program examples An example of a program is presented below. The properties detected by the analyzer are indicated in comments. 21 program KMP Lambert Automaton IntF ib Ackerman length (lines) M2Mix 167 361 37 87 64 ERA 133 326 35 77 62 average improv. 20.35% 9.7% 5.4% 11.5% 3.1% 10.01% size (bytes) M2Mix 2996 6036 969 1647 1384 ERA 2205 2564 926 1432 1322 average improv. 26.4% 57.5% 4.5% 13.05% 4.5% 21.19% Table 2: Comparison ERA and M2Mix. var x,y,z: integer; procedure P(a,b: integer):integer; begin (*parameters are always equal*) return a+b (*expression can be simplified: 2*a*) end P; begin Read(x); while x≤0 do Read(x); x := x+1; z := x+z; (*variable z might be uninitialized*) y := x+1; if x=0 then z := y; (*r-value can be simplified: z:=1*) else z := x+1; (*r-value can be simplified: z:=y*) x := y; end; Write( P(y,z) ) (*call can be transformed: Write(2*y)*) end; x := z div (y - z); (*arithmetical error*) Write(x) (*inaccessible point*) end. On basis of the analysis, this program can be transformed into the following: var x:integer; begin Read(x); while x≤0 do Read(x); x := x+2; Write(2*x) end ERROR EXCEPTION; end. In Table 2 we present some results of optimization based on our analysis of residual programs generated by M2Mix specializer [6, 33]. To compile these examples, we 22 used XDS Modula/Oberon compiler v.2.30 [20]. The following programs have been investigated: • KMP — the “naı̈ve” matching algorithm specialized with respect to some pattern; the residual program is comparable to Knuth, Morris, and Pratt’s algorithm in efficiency. (see also Appendix). • Lambert — a program drawing Lambert’s figure and specialized with respect to number of points. • Automaton — an interpreter of a deterministic finite-state automaton specialized with respect to some language. • IntF ib — an interpreter of MixLan [33] specialized with respect to a program computing Fibonacci numbers. • Ackerman — a program computing some values of Akcerman’s function and specialized with respect to its first argument. Let us comment briefly on the obtained results. Reducing length of a program can be considered as reducing number of operators and declarations. In these examples the optimizing effect was typically attained by the removal of redundant assignments, dead operators, unused variables and the reduction of operator strength. The only exception is KMP program characterized by high degree of polyvariance (roughly speaking it means presence of deep–nested conditional statements) and an active usage of array references. Here some IF–statements with constant conditions and redundant range checks were eliminated. Notice that the last optimizing transformation is very important for Modula–like languages where such checks are defined by the language standard. Such notable optimizing effect for the Lambert program is explained by deep reduction of power of floating-point operations which cannot be achieved by optimizing techniques now used in compilers. Since Automaton and Ackerman programs are quite small, their optimization gives conservative results. However, they would be better for the Ackerman program if the implementation of ERA were context-sensitive. Substantial speed-up of these optimized programs was not obtained (it was less than 2%) and this is not surprising since the great bulk of specializers take it as a criterion of optimality. These experiments show that an average reduction of size of residual programs is 20– 25%. Because the case of KMP program seems to be the most realistic10 , we suppose that such improvement can be achieved in practice for real–world programs and it will be increased for large residual programs with a high degree of polyvariance and active usage of arrays and float-point arithmetics. It is the author opinion that the analysis of automatically generated (from high–level specifications as well) programs is the most promising direction of its application, especially in the context-sensitive implementation of ERA. 10 Unfortunately our experiments were not exhaustive enough since the partial evaluation is not involved yet in real technological process of the software development and hence finding large resudial programs is a hard problem. 23 Acknowledgement The author wishes to thank M.A. Bulyonkov, P. Cousot, R. Cousot, and V.K. Sabelfeld for support, useful discussions and remarks. References [1] A. Aho and J. Ullman. The theory of parsing, translation and compilation, volume 1. Prentice-Hall Inc., 1972. [2] B. Alpern, M.N. Wegman, and F.K. Zadeck. Detecting equality of variables in programs. In Proc. of the 15th Annual ACM Symposium Principles of Programming Languages, pages 1–11. ACM Press, 1988. [3] D. Baburin, M. Bulyonkov, P. Emelianov, and N. Filatkina. Visualization facilities in program reengineering. Programmirovanie, 27(2):21–33, 2001. [4] L. Berman and G. Markowsky. Linear and non-linear approximate invariants. Research Report RC7241, T.J. Watson Research Center of IBM, Yorktown, NY, 1976. [5] F. Bourdoncle. Efficient chaotic iteration strategies with widenings. In Proc. of the International Conference on Formal Methods in Programming and Their Applications, volume 735 of Lecture Notes in Computer Science, pages 129–141. SpringerVerlag, 1993. [6] M. Bulyonkov and D. Kochetov. Practical aspects of specialization of Algol-like programs. In Proc. of the International Seminar on Partial Evaluation, volume 1110 of Lecture Notes in Computer Science, pages 17–32. Springer-Verlag, 1996. [7] M. Bulyonkov and D. Kochetov. Visualization of program properties. Research Report 51, Institute of Informatics Systems, Novosibirsk, Russia, 1998. [8] R. Clarisó and J. Cortadella. The octahedron abstract domain. In Proc. of the 11th International Static Analysis Symposium, volume 3148 of Lecture Notes in Computer Science, pages 312–327. Springer–Verlag, 2004. [9] P. Cousot and R. Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Rec. of the 4th ACM Symposium on Principles of Programming Languages, pages 238–252. ACM Press, 1977. [10] P. Cousot and R. Cousot. Abstract interpretation and application to logic program. Journal of Logic Programming, 13(2–3):103–180, 1992. [11] P. Cousot and R. Cousot. Abstract interpretation frameworks. Journal of Logic and Computation, 2(4):511–547, 1992. 24 [12] P. Cousot and R. Cousot. Formal languages, grammar and set–constraint–based program analysis by abstract interpretation. In Rec. of the Conference on Functional Programming Languages and Computer Architecture, pages 170–181. ACM Press, 1995. [13] P. Cousot and R. Cousot. Software analysis and model checking. In Proceedings of the 14th International Conference on Computer Aided Verification, volume 2404 of Lecture Notes in Computer Science, pages 37–56. Springer-Verlag, 2002. [14] P. Cousot and N. Halbwachs. Automatic discovery of linear restraints among variables of a program. In Records of the 5th annual ACM Symposium on Principles of Programming Languages, pages 84–96. ACM, ACM Press, January 1978. [15] A. Deutsch. Interprocedural may–alias analysis for pointers: beyond k-limiting. SIGPLAN Notices, 29(6):230–241, 1994. Proc. of the ACM SIGPLAN’94 Conference on Program Language Design and Implementation. [16] P.G. Emelianov and D.E. Baburin. Semantic analyzer of Modula-programs. In Proc. of the 4th International Static Analysis Symposium, volume 1302 of Lecture Notes in Computer Science, pages 361–363. Springer–Verlag, 1997. [17] P.G. Emelianov and V.K. Sabelfeld. Analyzer of semantic properties of Modulaprogramms. In Software intellectualization and quality, pages 100–107. Institute of Informatics Systems, Novosibirsk, Russia, 1994. [18] P.G. Emelianov. Analysis of the equality relation for the program terms. In Proc. of the Third International Static Analysis Symposium, volume 1145 of Lecture Notes in Computer Science, pages 174–188. Springer–Verlag, 1996. [19] G. Even, J. Naor, B. Schieber, and M. Sudan. Approximating minimum feedback sets and multi-cuts. In Proc. of the 4th International Conference on Integer Programming and Combinatorial Optimization, volume 920 of Lecture Notes in Computer Science, pages 14–28. Springer–Verlag, 1995. [20] Excelsior LLC. Native xds-x86 modula-2/oberon-2 development toolset. [21] K. Gargi. A sparse algorithm for predicated global value numbering. In Proceedings of the ACM SIGPLAN 2002 Conference on Programming Language Design and Implementation, pages 45–56, 2002. [22] A.D. Gordon and A.M. Pitts, editors. High Order Operational Techniques in Semantics. Publications of Newton Institute. Cambridge University Press, 1998. [23] Ph. Granger. Static analysis of arithmetical congruences. International Journal of Computer Mathematics, 30:165–199, 1989. [24] Ph. Granger. Static analysis of linear congruence equalities among variables of a program. In Proceedings of the International Joint Conference on Theory and Practice of Software Developement, volume 493 of Lecture Notes in Computer Science, pages 169–192. Springer–Verlag, 1991. 25 [25] S. Gulwani and G.C. Necula. Discovering affine equalities using random interpretation. In Proc. of the ACM SIGPLAN-SIGACT 2003 Principles of Programming Languages, pages 74–84, 2003. [26] S. Gulwani and G.C. Necula. A polynomial-time algorithm for global value numbering. In Proc. of the 11th International Static Analysis Symposium, volume 3148 of Lecture Notes in Computer Science, pages 212–227. Springer–Verlag, 2004. [27] N. Halbwachs, Y.-E. Proy, and P. Roumanoff. Verification of real-time systems using linear relation analysis. Formal Methods in System Design, 11(2):157–185, 1997. [28] Nevin Heintze, Joxan Jaffar, and Răzvan Voicu. A framework for combining analysis and verification. In Records of the 27th Annual ACM Symposium on Principles of Programming Languages, pages 26–39, 2000. [29] N. Heintze and J. Jaffar. Set constraint and set–based program analysis. In A. Borning, editor, Principles and Practice of Constraint Programming, volume 874 of Lecture Notes in Computer Science, pages 281–298. Springer–Verlag, 1994. [30] N.D. Jones and S.S. Muchnick, editors. Program Flow Analysis: Theory and Applications. Prentice-Hall, 1981. [31] N.D. Jones. Flow analysis of lazy higher–order functional programs. In S. Abramsky and C. Hankin, editors, Abstract Interpretation of Declarative Languages, pages 103–122. Ellis Horwood, 1987. [32] M. Karr. Affine relationships among variables of a program. Acta Informatica, 6:133–151, 1976. [33] D.V. Kochetov. Effective specialization of Algol–like programs. Ph.D. Thesis, Institute of Informatics Systems, Novosibirsk, Russia, 1995. [34] F. Masdupuis. Array operations abstraction using semantic analysis of trapezoid congruences. In Proceedings of the International Conference on Supercomputing, pages 226–235. ACM Press, 1992. [35] F. Masdupuis. Semantic analysis of interval congruences. In Proceedings of the International Conference Formal Methods in Programming and Their Applications, volume 735 of Lecture Notes in Computer Science, pages 142–155. Springer–Verlag, 1993. [36] A. Miné. A new numerical abstract domain based on difference-bound matrices. In Proceedings of the Second Symposium on Programs as Data Objects, volume 2053, pages 155–169, 2001. [37] B.K. Rosen. Robust linear algorithms for cutsets. Journal Algorithms, 3:205–217, 1982. 26 [38] O. Rüthing, J. Knoop, and B. Steffen. Detecting equalities of variables: Combining efficiency with precision. In Proc. of the 6th International Static Analysis Symposium, volume 1694 of Lecture Notes in Computer Science, pages 232–247. Springer–Verlag, 1999. [39] V. Sabelfeld. Polynomial upper bound for the complexity of the logic-termal equivalence decision. Doklady Akademii Nauk, Matematika, 249(4):793–796, 1979. [40] V. Sabelfeld. The logic–termal equivalence is polynomial–time decidable. Information Processing Letters, 10(2):102–112, 1980. [41] E. Speckenmeyer. On feedback problems in digraphs. In Proceedings of the 15th International Workshop on Graph–Theoretic Concepts in Computer Science, volume 411 of Lecture Notes in Computer Science, pages 218–231. Springer–Verlag, 1990. [42] A. Venet. Automatic analysis of pointer aliasing for untyped programs. Science of Computer Programming, 35(2-3):223–248, 1999. [43] M. Wegman and F.K. Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Language and Systems, 13(2):181–210, 1991. 27 Appendix. Analysis of KMP The appendix presents results of application of ERA to KMP program generated by the specializer M2Mix. This program is a specialization of a program implementing the naı̈ve pattern matching Match(p,str) with respect to the pattern p=”ababb”. The invariants are written as comments at program points where they hold. We can conclude that: • The target string necessarily ends with ”#” and the variable ls is equal to the string length (line 10). • Every time when some element of str (lines 20, 31, 42, 53, 58, 67, 72, 78, 86, 108, 113, 129, 140, 151, 162) is used in second LOOP, the value of its index expression does not exceed the value of the variable ls. The same is true for the value of a variable before the increment statements INC(s) (lines 23, 34, 45, 62, 81, 89, 94, 98, 103, 116, 120, 132, 143, 154, 165). Therefore, it suffices to check that a value of ls is not beyond the ranges determined by the type TYPE354a04 during input of the target string (line 8). So, in the second cycle all range checks can be eliminated. • The assignment cfg counter:=0 is redundant (line 24). • Conditions str[s+2]=’a’ and str[s]=’a’ are always false (lines 78 and 86, respectively) because two different constants are equal. So, the code of THEN–branches is dead. • The conditions at the lines 63, 68, 74, 82, 104, 109 are false, too. However, automatic detection of these properties are not as easily as the previous. Using this semantic information, it is possible to build a new program functionally equivalent to Match(”ababb”,str). In text of the program given below the underlined code can be eliminated. MODULE Match; FROM FIO IMPORT File,Open,ReadChar,WriteInt,stdout; VAR cfg counter : CARDINAL; str file : File; TYPE TYPE354a04 = [0..20]; TYPE TYPE355004 = ARRAY TYPE354a04 OF CHAR; VAR str : TYPE355004; ls,s : TYPE354a04; BEGIN 1: str file := Open(”target.dat”); 2: ls := 0; 3: LOOP 4: str[ls] := ReadChar(str file); 5: IF (str[ls]=’#’) THEN (∗str[ls] =′#′ ∗) 6: EXIT 7: ELSE (∗str[ls] 6=′#′ ∗) 8: INC(ls) 9: END 10: END; (∗str[ls] =′#′ ∗) 11: s := 0; cfg counter := 0; (∗s = cf g counter = 0∗) 12: 28 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: LOOP CASE cfg counter OF |0: IF ((s+0)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+0)]=’a’) THEN cfg counter := 1 ELSE INC(s); cfg counter := 0 END |1: IF ((s+1)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+1)]=’b’) THEN cfg counter := 2 ELSE INC(s); cfg counter := 0 END |2: IF ((s+2)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+2)]=’a’) THEN cfg counter := 3 ELSE INC(s); cfg counter := 4 END |3: IF ((s+3)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+3)]=’b’) THEN IF ((s+4)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+4)]=’b’) THEN WriteInt(stdout,s,0); EXIT ELSE INC(s); IF ((s+0)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+0)]=’a’) THEN IF ((s+1)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; 29 (∗ cf g counter = 0∗) (∗s ≥ ls∗) (∗0 < ls, s < ls∗) (∗str[s] =′a′ , 0 < ls, s < ls∗) (∗0 < ls, s < ls, str[0] 6=′a′ ∗) (∗ cf g counter = 0∗) (∗0 < ls, s < ls∗) (∗ cf g counter = 1∗) (∗s + 1 ≥ ls∗) (∗s + 1 < ls∗) (∗str[s + 1] =′b′ ∗) (∗str[s + 1] 6=′b′ ∗) (∗str[s] 6=′b′ , s < ls∗) (∗ cf g counter = 2∗) (∗s + 2 ≥ ls∗) (∗s + 2 < ls∗) (∗str[s + 2] =′a′ ∗) (∗str[s + 2] = 6 ′a′ ∗) (∗str[s + 1] = 6 ′a′ , s + 1 < ls∗) (∗ cf g counter = 3∗) (∗s + 3 ≥ ls∗) (∗s + 3 < ls∗) (∗str[s + 3] =′b′ ∗) (∗s + 4 ≥ ls, s + 3 < ls∗) (∗s + 4 < ls∗) (∗str[s + 3] = str[s + 4] =′b′ ∗) (∗str[s + 3] =′b′ , str[s + 4] = 6 ′b′ , s + 4 < ls∗) (∗str[s + 2] =′b′ , str[s + 3] = 6 ′b′ , s + 3 < ls∗) (∗s ≥ ls, s + 3 < ls∗) (∗str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗str[s] =′a′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗s + 1 ≥ ls, s + 3 < ls∗) (∗the same as at line 67∗) 72: IF (str[(s+1)]=’b’) THEN 73: 74: 75: 76: 77: 78: 79: 80: IF ((s+2)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+2)]=’a’) THEN cfg counter := 3 ELSE 81: INC(s); 82: IF ((s+0)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; 83: 84: 85: IF (str[(s+0)]=’a’) THEN cfg counter:=14 ELSE 86: 87: 88: 89: INC(s); 90: cfg counter:=4 END END 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: ELSE INC(s); cfg counter := 12 END ELSE INC(s); cfg counter := 12 END END ELSE INC(s); IF ((s+0)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; IF (str[(s+0)]=’a’) THEN IF ((s+1)≥ls) THEN WriteInt(stdout,(-1),0); EXIT END; 30 (∗str[s] =′a′ , str[s + 1] =′b′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗s + 2 ≥ ls, s + 3 < ls∗) (∗str[s] =′a′ , str[s + 1] =′b′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗inaccessible point∗) (∗str[s] =′a′ , str[s + 1] =′b′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗str[s − 1] =′a′ , str[s] =′b′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗s ≥ ls, s + 2 < ls∗) (∗str[s − 1] =′a′ , str[s] =′b′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗inaccessible point∗) (∗str[s − 1] =′a′ , str[s] =′b′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s − 2] =′a′ , str[s − 1] =′b′ , str[s] =′b′ , str[s + 1] 6=′b′ , s + 1 < ls∗) (∗str[s − 2] =′a′ , str[s − 1] =′b′ , str[s] =′b′ , str[s + 1] 6=′b′ , s + 1 < ls∗) (∗str[s] =′a′ , str[s + 1] 6=′b′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗str[s − 1] =′a′ , str[s] 6=′b′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s] =′a′ , str[s + 2] =′b′ , str[s + 3] 6=′b′ , s + 3 < ls∗) (∗str[s − 1] =′a′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s + 3] 6=′b′ , s + 3 < ls∗) (∗str[s + 2] 6=′b′ , s + 2 < ls∗) (∗s ≥ ls, s + 2 < ls∗) (∗str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s] =′a′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗s + 1 ≥ ls, s + 2 < ls∗) (∗str[s] =′a′ , str[s + 2] 6=′b′ , s + 2 < ls∗) 113: IF (str[(s+1)]=’b’) THEN cfg counter := 2 ELSE 116: INC(s); cfg counter := 10 117: 118: END 119: ELSE 120: INC(s); cfg counter := 10 121: 122: END 123: END 124: |4: 125: IF ((s+0)≥ls) THEN 126: WriteInt(stdout,(-1),0); 127: EXIT 128: END; 129: IF (str[(s+0)]=’a’) THEN cfg counter := 1 130: 131: ELSE 132: INC(s); 133: cfg counter := 0 134: END 135: | 10: 136: IF ((s+0)≥ls) THEN 137: WriteInt(stdout,(-1),0); 138: EXIT 139: END; 140: IF (str[(s+0)]=’a’) THEN cfg counter := 1 141: 142: ELSE 143: INC(s); 144: cfg counter := 0 145: END 146: | 12: 147: IF ((s+0)≥ls) THEN 148: WriteInt(stdout,(-1),0); 149: EXIT 150: END; 151: IF (str[(s+0)]=’a’) THEN cfg counter := 14 152: 153: ELSE 154: INC(s); cfg counter := 4 155: 156: END 157: | 14: 158: IF ((s+1)≥ls) THEN 159: WriteInt(stdout,(-1),0); 160: EXIT 161: END; 162: IF (str[(s+1)]=’b’) THEN 163: cfg counter := 2 164: ELSE 165: INC(s); cfg counter := 4 166: 167: END 168: END END END Match. (∗str[s] =′a′ , str[s + 1] =′b′ , str[s + 2] 6=′b′ , s + 2 < ls∗) 114: (∗str[s] =′a′ , str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s − 1] =′a′ , str[s + 1] 6=′b′ , s + 1 < ls∗) 115: (∗str[s + 2] 6=′b′ , s + 2 < ls∗) (∗str[s + 1] 6=′b′ , s + 1 < ls∗) (∗ cf g counter = 4∗) (∗s ≥ ls∗) (∗s < ls∗) (∗str[s] =′a′ , s < ls∗) (∗str[s] 6=′a′ , s < ls∗) (∗str[s − 1] 6=′a′ , s ≤ ls∗) (∗ cf g counter = 10∗) (∗s ≥ ls∗) (∗s < ls∗) (∗str[s] =′a′ , s < ls∗) (∗str[s] 6=′a′ , s < ls∗) (∗str[s − 1] 6=′a′ , s ≤ ls∗) (∗ cf g counter = 12∗) (∗s ≥ ls∗) (∗s < ls∗) (∗str[s] =′a′ , s < ls∗) (∗str[s] 6=′a′ , s < ls∗) (∗str[s − 1] 6=′a′ , s ≤ ls∗) (∗ cf g counter = 14∗) (∗s + 1 ≥ ls∗) (∗s + 1 < ls∗) (∗str[s + 1] =′b′ , s + 1 < ls∗) (∗str[s + 1] 6=′b′ , s + 1 < ls∗) (∗str[s] 6=′b′ , s < ls∗) 31
2cs.AI
arXiv:1605.05448v1 [cs.NE] 18 May 2016 The Bees Algorithm for the Vehicle Routing Problem Aish Fenton Department of Computer Science University of Auckland Auckland, New Zealand Colophon: Typeset in LATEX using typefaces Computer Modern. Title-page image is courtesy of [1]. Preface This MSc. thesis has been prepared by Aish Fenton at the University of Auckland, Department of Computer Science. It has been supervised by Dr. Michael Dinneen. The work undertaken in this thesis has grown out of a research project sponsored by New Zealand Trade and Enterprise (NZTE) for the company vWorkApp Inc. to research vehicle route optimisation for use within their software product. Acknowledgements I’d like to thank my partner in crime, Anna Jobsis, for her encouragement, cajoling, threatening, bribing, doing my dishes, proof reading, guilt tripping, grammar policing, comforting. . . doing whatever it took to help me get it done. Also, I’d like to thank my mum and dad for their encouragement and for always making me feel like higher education was within my reach. Thanks to Steve Taylor and Steve Harding for holding down the fort at work while I disappeared to do this thesis. And likewise thanks to my team, Jono, Rash, Elena, Bob, Marcus, Yuri, and Robin for being on the ball (as always) despite my absence. Thanks to Brendon Petrich and vWorkApp Inc. for providing me with time off work and being supportive of me undertaking this. And lastly, I especially owe Dr. Michael Dinneen, my supervisor, a big thank you for persevering with me even though he must have doubted that I’d ever finish. iii Abstract In this thesis we present a new algorithm for the Vehicle Routing Problem called the Enhanced Bees Algorithm. It is adapted from a fairly recent algorithm, the Bees Algorithm, which was developed for continuous optimisation problems. We show that the results obtained by the Enhanced Bees Algorithm are competitive with the best meta-heuristics available for the Vehicle Routing Problem—it is able to achieve results that are within 0.5% of the optimal solution on a commonly used set of test instances. We show that the algorithm has good runtime performance, producing results within 2% of the optimal solution within 60 seconds, making it suitable for use within real world dispatch scenarios. Additionally, we provide a short history of well known results from the literature along with a detailed description of the foundational methods developed to solve the Vehicle Routing Problem. Contents 1 Introduction 1.1 Content Outline 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Background 2.1 7 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 6 8 TSP Introduction and History . . . . . . . . . . . . . . . . . . 10 2.2 Exact Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.3 Classic Heuristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.1 Constructive Heuristics . . . . . . . . . . . . . . . . . . . . . . 13 2.3.2 Two-phase Heuristics . . . . . . . . . . . . . . . . . . . . . . . 15 2.3.3 Iterative Improvement Heuristics . . . . . . . . . . . . . . . . . 17 Meta-heuristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.4.1 Simulated Annealing . . . . . . . . . . . . . . . . . . . . . . . . 19 2.4.2 Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.4.3 Tabu Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.4.4 Large Neighbourhood Search . . . . . . . . . . . . . . . . . . . 25 Swarm Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.4 2.5 1 2.5.1 Ant Colony Optimisation . . . . . . . . . . . . . . . . . . . . . 28 2.5.2 Bees Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 3 Problem Definition 35 3.1 Capacitated Vehicle Routing Problem . . . . . . . . . . . . . . . . . . 35 3.2 Variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 3.2.1 Multiple Depot Vehicle Routing Problem . . . . . . . . . . . . 37 3.2.2 Vehicle Routing with Time Windows . . . . . . . . . . . . . . . 37 3.2.3 Pickup and Delivery Problem . . . . . . . . . . . . . . . . . . . 38 4 Algorithm 39 4.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 4.2 Problem Representation . . . . . . . . . . . . . . . . . . . . . . . . . . 40 4.3 Enhanced Bees Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 41 4.3.1 Bee Movement . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 4.3.2 Search Space Coverage . . . . . . . . . . . . . . . . . . . . . . . 44 Search Neighbourhood . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.4.1 Destroy Heuristic . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.4.2 Repair Heuristic . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.4.3 Neighbourhood Extent . . . . . . . . . . . . . . . . . . . . . . . 46 4.4 5 Results 49 5.1 Enhanced Bees Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.2 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3 5.3 5.2.1 Bees Algorithm versus Enhanced Bees Algorithm . . . . . . . . 52 5.2.2 Large Neighbourhood Search . . . . . . . . . . . . . . . . . . . 53 5.2.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6 Conclusion 63 4 Chapter 1 Introduction In this thesis we present a new algorithm to solve the Vehicle Routing Problem. The Vehicle Routing Problem describes the problem of assigning and ordering geographically distributed work to a pool of resources. The aim is minimise the travel cost required to complete the work, while meeting any specified constraints, such as a maximum shift duration. Often the context used is that of a fleet of vehicles delivering goods to their customers, although the problem can equally be applied across many different industries and scenarios, and has been applied to non-logistics applications, such as microchip layout. Interest in the Vehicle Routing Problem has increased over the last two decades as the cost of transporting and delivering goods has become a key factor of most developed economies. Even a decrease of a few percent on transportation costs can offer a savings of billions for an economy. In the context of New Zealand (our home country) virtually every product grown, made, or used is carried on a truck at least once during its lifetime [33]. The success of New Zealand’s export industries are inextricably linked to the reliability and cost effectiveness of our road transport. Moreover, a 1% growth in national output requires a 1.5% increase in transport services [33]. The Vehicle Routing Problem offers real benefits to transport and logistics companies. Optimisation of the planning and distribution process, such as modelled by the Vehicle Routing Problem, can offer savings of anywhere between 5% to 20% of the transportation costs [52]. Accordingly, the Vehicle Routing Problem has been the focus of intense research since its first formal introduction in the fifties. The Vehicle Routing Problem is one of the most studied of all combinatorial optimisation problems, with hundreds of papers covering it and the family of related problems since its introduction fifty years ago. The challenge of the Vehicle Routing Problem is that it combines two (or more, in the case of some of its variants) combinatorially hard problems that are themselves 5 6 CHAPTER 1. INTRODUCTION known to be N P-hard. Its membership in the family of N P-hard problems makes it very unlikely that an algorithm exists, with reasonable runtime performance, that is able to solve the problem exactly. Therefore heuristic approaches must be developed to solve all but the smallest sized problems. Many methods have been suggested for solving the Vehicle Routing Problem. In this thesis we develop a new meta-heuristic algorithm that we call the Enhanced Bees Algorithm. We adapt this from another fairly recent algorithm, named the Bees Algorithm, that was developed for solving continuous optimisation problems. We show that the results obtained by the Enhanced Bees Algorithm are competitive with the best modern meta-heuristics available for the Vehicle Routing Problem. Additionally, the algorithm has good runtime performance, producing results within 2% of the optimal solution within 60 seconds. This makes the Enhanced Bees Algorithm suitable for use within real world dispatch scenarios where often the dispatch process is dynamic and hence it is impractical for a dispatcher to wait minutes (or hours) for an optimal solution1 . 1.1 Content Outline We start in Chapter 2 by providing a short history of the Vehicle Routing Problem, as well as providing background material necessary for understanding the Enhanced Bees Algorithm. In particular, we review the classic methods that have been brought to bear on the Vehicle Routing Problem along with the influential results achieved in the literature. In Chapter 3 we provide a formal definition of the Vehicle Routing Problem and briefly describe the variant problems that have been developed in the literature. In Chapter 4 we provide a detailed description of the Enhanced Bees Algorithm and its operation, along with a review of the objectives that the algorithm is designed to meet, and a description of how the algorithm internally represents the Vehicle Routing Problem. In Chapter 5 we provide a detailed breakdown of the results obtained by the Enhanced Bees Algorithm. The algorithm is tested against the well known set of test instances due to Christofides, Mingozzi and Toth [11] and is contrasted with some well known results from the literature. Finally, in Chapter 6 we provide a summary of the results achieved by the Enhanced Bees Algorithm in context of the other methods available for solving the Vehicle Routing Problem from the literature. Additionally, we offer our thoughts on future directions and areas that warrant further research. 1 The Enhanced Bees Algorithm was developed as part of a New Zealand Trade and Enterprise Research and Development grant for use within the dispatch software product, vWorkApp. Hence more consideration has been given to its runtime performance than is typically afforded in the literature. Chapter 2 Background This chapter provides a short history and background material on the Vehicle Routing Problem. In particular we review the solution methods that have been brought to bear on the Vehicle Routing Problem and some of the classic results reported in the literature. This chapter is laid out as follows. We start in Section 2.1 by informally defining what the Vehicle Routing Problem is and by providing a timeline of the major milestones in its research. We also review a closely related problem, the Traveling Salesman Problem, which is a cornerstone of the Vehicle Routing Problem. We then review in Section 2.2 the Exact Methods that have been developed to solve the Vehicle Routing Problem. These are distinguished from the other methods we review in that they provide exact solutions, where the globally best answer is produced. We follow this in Section 2.3 by reviewing the classic Heuristics methods that have been developed for the Vehicle Routing Problem. These methods are not guaranteed to find the globally best answer, but rather aim to produce close to optimal solutions using algorithms with fast running times that are able to scale to large problem instances. In Section 2.4 we review Meta-heuristic methods that have been adapted for the Vehicle Routing Problem. These methods provide some of the most competitive results available for solving the Vehicle Routing Problem and are considered state-of-the-art currently. Lastly, in Section 2.5 we review a modern family of meta-heuristics called Swarm Intelligence that has been inspired by the problem solving abilities exhibited by some groups of animals and natural processes. These last methods have become a popular area of research recently and are starting to produce competitive results to many problems. This thesis uses a Swarm Intelligence method for solving the Vehicle Routing Problem. 7 8 CHAPTER 2. BACKGROUND 2.1 Overview The Vehicle Routing Problem (commonly abbreviated to VRP) describes the problem of assigning and ordering work for a finite number of resources, such that the cost of undertaking that work is minimised. Often the context used is that of a fleet of vehicles delivering goods to a set of customers, although the problem can equally be applied across many different industries and scenarios (including non-logistics scenarios, such as microchip layout). The aim is to split the deliveries between the vehicles and to specify an order in which each vehicle undertakes its work, such that the distance travelled by the vehicles is minimised and any pre-stated constraints are met. In the classic version of the VRP the constraints that must be met are: 1. Each vehicle must start and end its route at the depot. 2. All goods must be delivered. 3. The goods can only be dropped off a single time and by a single vehicle. 4. Each good requires a specified amount of capacity. However, each vehicle has a finite amount of capacity that cannot be exceeded. This adds to the complexity of the problem as it necessarily influences the selection of deliveries assigned to each vehicle. Figure 2.1: An example of customers being assigned to three different vehicle routes. The depot is the black dot in the centre. More formally, the VRP can be represented as a graph, (V, E). The vertices of the graph, V , represent all locations that can be visited; this includes each customer location and the location of the depot. For convenience let v d denote the vertex that represents the depot. We denote the set of customers as C = {1, 2, . . . , n}. Next let the set of edges, E, correspond to the valid connections between customers and connections to the depot—typically for the VRP all connections are possible. Each edge, (i, j) ∈ E, has a corresponding cost cij . This cost is typically the travel distance between the two locations. 2.1. OVERVIEW 9 A solution to a given VRP instance can be represented as a family of routes, denoted by S. Each route itself is a sequence of customer visits that are performed by a single vehicle, denoted by R = [v1 , v2 , . . . , vk ] such that vi ∈ V , and v1 , vk = v d . Each customer has a demand di , i ∈ C, and q is the maximum demand permissible for any route (i.e. its maximum capacity). The cost of the solution, and the value we aim to minimise, is given by the following formula: X X cvi ,vi+1 R∈S vi ∈R We can now formalise the VRP constraints as follows: [ =V (2.1) R∈S (Ri − v d ) ∩ Rj = ∅ (2.2) d vi = vj v0 , vk ∈ Ri = v X dv < q ∀Ri , Rj ∈ S d ∀Ri ∈ S, ¬∃vi , vj ∈ (Ri − v ) (2.3) ∀Ri ∈ S (2.4) ∀Ri ∈ S (2.5) v∈Ri Equation (2.1) specifies that all customers are included in at least one route. Equations (2.2) and (2.3) ensure that each customer is only visited once, across all routes. Equation (2.4) ensures that each route starts and ends at the depot. Lastly, Equation (2.5) ensures that each route doesn’t exceed its capacity. This version of the problem has come to be known as the Capacitated Vehicle Routing Problem (often appreciated to CVRP in the literature). See Chapter 3 for an alternative formation, which states the problem as an Integer Linear Programming problem, as is more standard in the VRP literature1 . VRP was first formally introduced in 1959 by Dantzig and Ramser in their paper, the Truck Scheduling Problem [14]. The VRP has remained an important problem in logistics and transport, and is one of the most studied of all combinatorial optimisation problems. Hundreds of papers have been written on it over the intervening fifty years. From the large number of implementations in use today it is clear that the VRP has real benefits to offer transport and logistics companies. Anywhere from 1 We believe that the formation provided in this chapter is simpler and more precise for understanding the algorithmic methods described in this chapter. However, we do provide a more standard formation in Chapter 3. 10 CHAPTER 2. BACKGROUND 5% to 20% savings have been reported where a vehicle routing procedure has been implemented [52]. From the VRP comes a family of related problems. These problems model other constraints that are encountered in real world applications of the VRP. Classic problems include: VRP with Time Windows (VRPTW), which introduces a time window constraint against each customer that the vehicle must arrive within; VRP with Multiple Depots (MDVRP), where the vehicles are dispatched from multiple starting points; and the Pickup and Delivery Problem (PDP), where goods are both picked up and delivered during the course of the route (such as a courier would do). 2.1.1 TSP Introduction and History The VRP is a combination of two problems that are combinatorial hard in themselves: the Traveling Salesman Problem (more precisely the Multiple Traveling Salesman Problem), and the Bin Packing Problem. The Traveling Salesman Problem (TSP) can informally be defined as follows. Given n points on a map, provide a route through each of the n points such that each point is only used once and the total distance travelled is minimised. The problem’s name, the Traveling Salesman, comes from the classic real world example of the problem. A salesman is sent on a trip to visit n cities. They must select the order in which to visit the cities, such that they travel the least amount of distance. Although the problem sounds like it might be easily solvable, it is in fact N P-hard. The best known exact algorithms for solving the TSP still require a running time of O(2n ). Karp’s famous paper, Reducibility Among Combinatorial Problems [26], in 1972 showed that the Hamiltonian Circuit problem is N P-complete. This implied the NP-hardness of TSP, and thus supplied the mathematical explanation for the apparent difficulty of finding optimal traveling salesman tours. TSP has a history reaching back many years. It is itself related to another classic graph theory problem, the Hamiltonian circuit. Hamiltonian circuits have been studied since 1856 by both Hamilton [24] and Kirkman [27]. Whereas the TSP has been informally discussed for many years [46], it didn’t become actively studied until after 1928, where Menger, Whitney, Flood and Robinson produced much of the early results in the field. Robinson’s RAND report [43] is probably the first article to call the problem by the name it has since become known as, the Traveling Salesman Problem. 2.1. OVERVIEW 11 From Robinson’s RAND report: The purpose of this note is to give a method for solving a problem related to the traveling salesman problem. One formulation is to find the shortest route for a salesman starting from Washington, visiting all the state capitals and then returning to Washington. More generally, to find the shortest closed curve containing n given points in the plane. Figure 2.2: Shown is an example of a 16 city TSP tour. This tour is one of 20,922,789,888,000 possible tours for these 16 cities. An early result was provided by Dantzig, Fulkerson, and Johnson [13]. Their paper gave an exact method for solving a 49 city problem, a large number of cities for the time. Their algorithm used the cutting plane method to provide an exact solution. This approach has been the inspiration for many subsequent approaches, and is still the bedrock of algorithms that attempt to provide an exact solution. A generalisation of the TSP is Multiple Traveling Salesman Problem (MTSP), where multiple tours are constructed (i.e. multiple salesman can be used to visit the cities). The pure MTSP can trivially be turned into a TSP by constructing a graph G with n − 1 additional copies of the starting vertex and by forbidding travel directly between the n starting vertices. However, the pure formulation of MTSP places no additional constraints on how the routes are constructed. Real life applications of the MTSP typically require additional constraints, such as limiting the size or duration of each route (i.e. one salesman shouldn’t be working a 12 hour shift, while another has no work). MTSP leads us naturally into the family of problems given by the VRP. VRP, and its family of related problems, can be understood as being a generalisation of MTSP that incorporates additional constraints. Some of these constraints, such as capacity limits, introduce additional dimensions to the problem that are in themselves hard combinatorial problems. 12 2.2 CHAPTER 2. BACKGROUND Exact Methods The first efforts at providing a solution to the VRP were concerned with exact methods. These started by sharing many of the techniques brought to bear on TSP. We follow Laporte and Nobert’s survey [29] and classify exact methods for the VRP into three families: Direct Tree Search methods, Dynamic Programming, and Integer Linear Programming. The first classic Direct Tree Search results are due to Christolds and Ellison. Their 1969 paper provided the first branch and bound algorithm for exactly solving the VRP [10]. Unfortunately its time and memory requirements were large enough that it was only able to solve problems of up to 13 customers. This result was later improved upon by Christolds in 1976 by using a different branch model. This improvement allowed him to solve for up to 31 customers. Christofides, Mingozzi, and Toth [11], provide a lower bound method that is sufficiently quick (in terms of runtime performance) to be used as a lower bound for excluding nodes from the search tree. Using this lower bound they were able to provide solutions for problems containing up to 25 customers. Laporte, Mercure and Nobert [28] used MTSP as a relaxation of the VRP within a branch and bound framework to provide solutions for more realistically sized problems, containing up to 250 customers. A Dynamic Programming approach was first applied to the VRP by Eilon, WatsonGandy and Christofides [16]. Their approach allowed them to solve exactly for problems of 10 to 25 customers. Since then, Christofides has made improvements to this algorithm to solve exactly for problems up to fifty customers. A Set Partitioning method was given by Balinski, and Quandt in 1964 [5] to produce exact VRP solutions. However, the problem sets they used were very small, only containing between 5 to 15 customers; and even then they were not able to produce solutions for some of the problems. However, taking their approach as a starting point, many authors have been able to produce more powerful methods. Rao and Zionts [40], Foster and Ryan [18], and Desrochers, Desrosiers and Solomon [15] have all extended the basic set partitioning algorithm using the Column Generation method from Integer Programming. These later papers have produced some of the best exact results. Notwithstanding the preceding discussion, exact methods have been of more use in advancing the theoretical understanding of the VRP than they have been in providing solutions to real life routing problems. This can mostly be attributed to the fact that real life VRP instances often involve at least tens of customers (and often hundreds), and involve richer constraints than are modelled in the classic VRP. 2.3. CLASSIC HEURISTICS 2.3 13 Classic Heuristics In this section we review the classic heuristic methods that have been developed for the VRP. These methods are not guaranteed to find the globally best answer, but rather aim to produce close to optimal solutions using algorithms with fast running times that are able to scale to large problem instances. Classic heuristics for the VRP can be classified into three families: constructive heuristics; two-phase heuristics, which can again be divided into two subfamilies, cluster first and then route, and route first and then cluster; and finally improvement methods. 2.3.1 Constructive Heuristics We start by looking at the Constructive Heuristics. Constructive heuristics build a solution from the ground up. They typically provide a recipe for building each route, such that the total cost of all routes is minimised. A trivial but intuitive constructive heuristic is the Nearest Neighbour method. In this method routes are built up sequentially. At each step the customer nearest to the last routed customer is chosen. This continues until the route reaches its maximum capacity, at which point a new route is started. In practice the Nearest Neighbour algorithm tends to provide poor results and is rarely used. j i Figure 2.3: Shown is an example of the Nearest Neighbour method being applied. A partially constructed route selects customer j to add, as its closest to the last added customer, i. An early and influential result was given by Clarke and Wright in their 1964 paper [12]. In their paper they present a heuristic extending Dantzig and Ramser’s earlier work, which has since become known as the Clarke Wright Savings heuristic. The heuristic is based on the simple premise of iteratively combining routes in order of those pairs that provide the largest saving. 14 CHAPTER 2. BACKGROUND j i R' Figure 2.4: Clark Wright Savings Algorithm. Customers i, j are selected as candidates to merge. The merge results in a new route R0 . The algorithm works as follows: Algorithm 1: Clark Write Savings Algorithm initialiseRoutes() M = savingsMatrix(V ) L = sortBySavings(SM ) for lij ← L do Ri , Rj = findRoutes(lij ) if feasibleMerge(Ri , Rj ) then combineRoute(Ri , Rj ) end end The algorithm starts by initialising a candidate solution. For this it creates a route R = [v d , vi , v d ] for all v ∈ V . It then calculates a matrix M that contains the savings sij = ci0 + cj0 − cij for all edges (i, j) ∈ E. It then produces a list, L, that enumerates each cell i, j of the matrix in descending order of the savings. For each entry in the list, lij ∈ L, it selects the two routes, Ri , Rj , that contain customers i, j ∈ V and tests to see if the two routes can be merged. A merge is permissible if and only if: 1. Ri 6= Rj . 2. i, j are the first or last vertices (excluding the depot v d ) of their respective routes. 3. The combined demand of the two routes doesn’t exceed the maximum allowed, q. The heuristic comes in two flavours, sequential and parallel. The sequential version adds the additional constraint that only one route can be constructed at a time. In this case one of the two routes considered, Ri , Rj , must be the route under construction. If 2.3. CLASSIC HEURISTICS 15 neither of the routes are the route under construction then the list item is ignored and processing continues down the list. If the merge is permissible then we merge routes Ri , Rj such that R0 = [v0 , . . . , i, j, . . . , vk ]. In the parallel version, once the entire list of savings has been enumerated then the resulting solution is returned as the answer. In the sequential version the for loop is repeated until no feasible merges remain. The Clark Write Savings heuristic has been used to solve problems of up to 1000 customers with results often within 10% of the optimal solution using only a 180 seconds of runtime [52]. The parallel version of the Clark Write Savings Algorithm outperforms the sequential version in most cases [30] and is typically the one employed. The heuristic has proven to be surprisingly adaptable and has been extended to deal with more specialised vehicle routing problems where additional objectives and constraints must be factored in. Its flexibility is a result of its algebraic treatment of the problem [30]. Unlike many other VRP heuristics that exploit the problem’s spatial properties (such as many of the two-phase heuristics, see Section 2.3.2), the savings formula can easily be adapted to take into consideration other objectives. An example of this is Solomon’s equally ubiquitous algorithm [48] which extends the Clark Wright Savings algorithm to cater for time constraints. This classic algorithm has been extended by Gaskell [19], Yellow [55] and Paessens [37], who have suggested alternatives to the savings formulas used by Clarke and Wright. These approaches typically introduce additional parameters to guide the algorithm towards selecting routes with geometric properties that are likely to produce better combinations. Altinkemer and Gavish provide an interesting variation on the basic savings heuristic [4]. They use a matching algorithm to combine multiple routes in each step. To do this they construct a graph such that each vertex represents a route, each edge represents a feasible saving, and the edges’ weights represent the savings that can be realised by the merge of the two routes. The algorithm proceeds by solving a maximum cost weighted matching of the graph. 2.3.2 Two-phase Heuristics We next look at two-phase heuristics. We start by looking at the cluster first, route second subfamily. One of the foundational algorithms for this method is given to us by Gillett and Miller who provided a new approach called the Sweep Algorithm in their 1974 paper [22]. This popularised the two-phase approach, although a similar method was suggested earlier by Wren in his 1971 book, and subsequently in Wren and Holliday’s 1972 paper [54]. In this approach, an initial clustering phase is used to cluster the customers into a base set of routes. From here the routes are treated as separate TSP instances and optimised accordingly. The two-phase approach typically doesn’t prescribe a method for how the TSP is solved and assumes that already developed TSP methods can be used. The classic Sweep algorithm uses a simple geometric method to cluster the customers. Routes are built by sweeping a ray, centered at 16 CHAPTER 2. BACKGROUND the depot, clockwise around the space enclosing the problem’s locations. The Sweep method is surprisingly effective and has been shown to solve several benchmark VRP problems to within 2% to 9% of the best known solutions [52]. i Figure 2.5: This diagram shows an example of the Sweep process being run. The ray is swept clockwise around the geographic area. In this example one route has already been formed, and a second is about to start at customer i. Fisher and Jaikumars’s 1981 paper [17] builds upon the two-phase approach by providing a more sophisticated clustering method. They solve a General Assignment Problem to form the clusters instead. A limitation of their method is that the amount of vehicle routes must be fixed up front. Their method often produces results that are 1% to 2% better than results produced by the classic Sweep algorithm [52]. Christofides, Mingozzi, and Toth expanded upon this approach in [11] and proposed a method that uses a truncated branch and bound technique (similar to Christofides’s Exact method). At each step it builds a collection of candidate routes for a particular customer, i. It then evaluates each route by solving it as a TSP, from which it then selects the shortest TSP as the route. The Petal algorithm is a natural extension to the Sweep algorithm. It was first proposed by Balinski and Quandt [5] and then extended by Foster and Ryan [18]. The basic process is to produce a collection of overlapping candidate routes (called petals) and then to solve a set partitioning problem to produce a feasible solution. As with other two-phase approaches it is assumed that the order of the customers within each route is solved using an existing TSP heuristic. The petal method has produced competitive results for small solutions, but quickly becomes impractical where the set of candidate routes that must be considered is large. Lastly, there are route first, cluster second methods. The basic premise of these techniques are to first construct a ‘grand’ TSP tour such that all customers are visited. The second phase is then concerned with splitting this tour into feasible routes. Route first, cluster second methods are generally thought to be less competitive than other methods [30], although interestingly, Haimovich and Rinnooy Kan have shown that if all customers have unit demand then a simple shortest path algorithm (which can be solved in polynomial time) can be used to produce a solution from a TSP tour that 2.3. CLASSIC HEURISTICS 17 is asymptotically optimal [23]. 2.3.3 Iterative Improvement Heuristics Iterative Improvement methods follow an approach where an initial candidate solution is iteratively improved by applying an operation that improves the candidate solution, typically in a small way, many thousands of times. The operations employed are typically simple and only change a small part of the candidate solution, such as the position of a single customer or edge within the solution. The set of solutions that are obtainable from the current candidate solution, S, by applying an operator Op is known as S’s neighbourhood. Typically, with Iterative Improvement heuristics, a new solution S 0 is selected by exhaustively searching the entire neighbourhood of S for the best improvement possible. If no improvement can be found then the heuristic terminates. The initial candidate solution (i.e. the starting point of the algorithm) can be randomly selected or can be produced using another heuristic. Constructive Heuristics are typically used for initially seeding an improvement heuristic, see Section 2.3.1 for more information on these. Probably one of the best known improvement operators is 2-Opt. The 2-Opt operator takes two edges (i, j), (k, l) ∈ T , where T are the edges traversed by a particular route R = [v1 , . . . , vi , vj , . . . , vk , vl , . . . , vn ], and removes these from the candidate solution. This splits the route into two disconnected components, D1 = [vj , . . . , vk ], D2 = [v1 , . . . , vi , vl , . . . , vn ]. A new candidate solution is produced by reconnecting D1 to D2 using the same vertices i, j, l, k but with alternate edges, such that (i, j), (j, l) ∈ T . j j l l k k i R i R' Figure 2.6: This diagram shows 2-Opt being applied to a candidate solution R and producing a new solution R0 . In this example edges (i, j), (k, l) are exchanged with edges (i, k), (j, l). The rationale behind 2-Opt is that, due to the triangle inequality, edges that cross themselves are unlikely to be optimal. 2-Opt aims to detangle a route. 18 CHAPTER 2. BACKGROUND There are a number of other operations suggested in the literature. Christofides and Eilon give one of the earliest iterative improvement methods in their paper [10]. In the paper they make a simple change to 2-Opt to increase the amount of edges removed from two to three—the operation fittingly being called 3-Opt. They found that their heuristic produced superior results than 2-Opt. In general, operations such as 3-Opt, that remove edges and then search for a more optimal recombination of components take O(ny ) where y is the number of edges removed. A profitable strain of research has focused on producing operations that reduce the amount of recombinations that must be searched. Or presents an operation that has since come to be known as Or-Opt [35]. Or-Opt is a restricted 3-Opt. It searches for a relocation of all sets of 3 consecutive vertices (which Or calls chains), such that an improvement is made. If an improvement cannot be made then it tries again with chains of 2 consecutive vertices, and so on. Or-Opt has been shown to produce similar results to that of 3-Opt, but with a running time of O(n2 ). More recently Renaud, Boctor, and Laptorte [42] have presented a restricted version of 4Opt, called 4-Opt*, that operates in a similar vein to Or-Opt. 4-Opt* has a running time of O(wn2 ) where w denotes the number of edges spanned by 4-Opt* when building a chain. Iterative improvement heuristics are often used in combination with other heuristics. In this case they are run on the candidate solution after the initial heuristic has completed. However, if used in this way there is often a fine balance between producing an operation that improves a solution, and one that is sufficiently destructive enough to escape a local minimum. Interest in Iterative Improvement heuristics has grown as the operations developed for them, such as Or-Opt, are directly applicable to more modern heuristics, such as the family known as meta-heuristics presented in the next section. 2.4 Meta-heuristics Meta-heuristics are a broad collection of methods that make few or no assumptions about the type of problem being solved. They provide a framework that allows for individual problems to be modelled and ‘plugged in’ to the meta-heuristic. Typically, meta-heuristics take an approach where a candidate solution (or solutions) is initially produced and then is iteratively refined towards the optimal solution. Intuitively meta-heuristics can be thought of searching a problem’s search space. Each iteration searches the neighbourhood of the current candidate solution(s) looking for new candidate solutions that move closer to the global optimum. A limitation of meta-heuristics is that they are not guaranteed to find an optimal solution (or even a good one!). Moreover, the theoretical underpinnings of what makes one meta-heuristic more effective than another are still poorly understood. 2.4. META-HEURISTICS 19 1 0.8 0.6 0.4 0.2 0 -0.2 -0.4 10 10 5 5 0 0 -5 -5 -10 -10 Figure 2.7: This diagram shows an example of a search space that a metaheuristic moves through. In this example the peak at the centre of the figure is the globally best answer, but there are also hills and valleys that the metaheuristic may become caught in. These are called local minima and maxima. Meta-heuristics within the literature tend to be tuned for specific problems and then validated empirically. There have been a number of meta-heuristics produced for the VRP in recent years and many of the most competitive results produced in the last ten years are due to them. We next review some of the more well known meta-heuristic results for the VRP. 2.4.1 Simulated Annealing Simulated Annealing is inspired by the annealing process used in metallurgy. The algorithm starts with a candidate solution (which can be randomly selected) and then moves to nearby solutions with a probability dependent on the quality of the solution and a global parameter T , which is reduced over the course of the algorithm. In classic implementations the following formula is used to control the probability of a move: e− f (s0 )−f (s) T Where f (s) and f (s0 ) represent the solution quality of the current solution, and the new solution respectively. By analogy with the metallurgy process, T represents the current temperature of the solution. Initially T is set to a high value. This lets the algorithm free itself from any local optima that it may be caught in. It is then cooled over the course of the algorithm forcing the search to converge on a solution. 20 CHAPTER 2. BACKGROUND One of the first Simulated Annealing results for the VRP was given by Robuste, Daganzo and Souleyrette [44]. They define the search neighbourhood as being all solutions that can be obtained from the current solution by applying one of two operations: relocating part of a route to another position within the same route, or exchanging customers between routes. They tested their solution on some large real world instances of up to 500 customers. They reported some success with their approach, but as their test cases were unique, no direct comparison is possible. Osman has given the best known Simulated Annealing results for the VRP [36]. His algorithm expands upon many areas of the basic Simulated Annealing approach. The method starts by using the Clark and Wright algorithm to produce an initial position. It defines its neighbourhood as being all candidate solutions that can be reached by applying an operator he names the λ-interchange operation. λ-interchange works by selecting two sequences (i.e. chains) of customers Cp , Cq from two routes, Rp and Rq , such that |Cp |, |Cq | < λ (note that the chains are not necessarily of the same length). The customers within each chain are then exchanged with each other in turn, until an exchange produces an infeasible solution. As the neighbourhood produced by λ-interchange is typically quite large, Osman restricts λ to being less than 2 and suggests that the first move that provides an improvement is used rather than exhaustively searching the entire neighbourhood. Rq Rp Rq Rp Figure 2.8: This diagram shows an example of λ-interchange being applied to a candidate solution. Two sequences of customers Cp and Cq are selected from routes Rp , Rq respectively. Customers from Cp are then swapped with Cq where feasible. Osman also uses a sophisticated cooling schedule. His main change being that the temperature is cooled only while improvements are found. If no improvement is found he then resets the temperature using Ti = max( T2r , Tb ), where Tr is the reset temperature, and Tb is temperature of the best solution found so far. Although Simulated Annealing has produced some good results, and in many cases outperforms classic heuristics (compare [30] with [21]), it is not competitive with the Tabu Search methods discussed in Section 2.4.3. 2.4. META-HEURISTICS 2.4.2 21 Genetic Algorithms Genetic Algorithms were first proposed in [25]. They have since been applied to many problem domains and are particularly well suited to applications that must work across a number of different domains. In fact they were the first evolutionary-inspired algorithm to be applied to combinatorial problems [39]. The basic operation of a Genetic Algorithm is as follows: Algorithm 2: Simple Genetic Algorithm Generate the initial population while termination condition not met do Evaluate the fitness of each individual Select the fittest pairs Mate pairs and produce next generation Mutate (optional) end In a classic Genetic Algorithm each candidate solution is encoded as a binary string (i.e. chromosome). Each individual (i.e. candidate solution) is initially created randomly and used to seed the population. A technique often employed in the literature is to initially ‘bootstrap’ the population by making use of another heuristic to produce the initial population. However, special care must be taken with this approach to ensure that diversity is maintained across the population, as you risk premature convergence by not introducing enough diversity in the initial population. Next, the fittest individuals are selected from the population and are mated in order to produce the next generation. The mating process uses a special operator called a crossover operator that takes two parents and produces offspring from these by combining parts of each parent. Optionally, a mutation operation is also applied, that introduces a change that doesn’t exist in either parent. The classic crossover operation takes two individuals encoded as binary strings and splits these at one or two points along the length of the string. The strings are then recombined to form a new binary string, which in turn encodes a new candidate solution. The entire process is continued until a termination condition is met (often a predetermined running time), or until the population has converged on a single solution. Special consideration needs to be given to how problems are encoded and to how the crossover and mutation operators work when using Genetic Algorithms to solve discrete optimisation problems, such as the VRP. For example, the classic crossover operation, which works on binary strings, would not work well on a TSP tour. When two components of two tours are combined in this way they are likely to contain duplicates. Therefore, it is more common for the VRP (and the TSP) to use a direct representation and to use specially designed crossover operators. In this instance the VRP is represented as a set of sequences, each holding an ordered list of customers. 22 CHAPTER 2. BACKGROUND The crossover operators are then designed so that they take into consideration the constraints of the VRP. Two crossover operators commonly used with combinatorial problems are the Order Crossover (OX) and the Edge Assembly Crossover (EAX). OX [34] operates by selecting two cut points within each route. The substring between the two cut points is copied from the second parent directly into the offspring. Likewise, the string outside the cut points is copied from the first parent into the offspring, but with any duplicates removed. This potentially leaves a partial solution, where not all customers have been routed. The partial solutions is then repaired by inserting any unrouted customers into the child in the same order that they appeared in the second parent. 3 2 1 4 5 6 7 3 2 6 7 1 4 5 2 5 6 7 1 3 4 Figure 2.9: This diagram shows the OX crossover operator being applied to two tours from a TSP. A child is produced by taking customers at position 3, 4, 5 from the second parent and injecting these into the same position in the first parent, removing any duplicates. This leaves customers 4, 5 unrouted, so they are reinserted back into the child in the order that they appear in the first parent. Another common crossover operator is EAX. EAX was originally designed for the TSP but has been adapted to the VRP by [32]. EAX operates using the following process: 1. Combine the two candidate solutions into a single graph by merging each solution’s edge sets. 2. Create a partition set of the graph’s cycles by alternately selecting an edge from each graph. 3. Randomly select a subset of the cycles. 4. Generate a (incomplete) child by taking one of the parents and removing all edges from the selected subset of cycles, then add back in the edges from the parent that wasn’t chosen. 5. Not all cycles in the child are connected to the route. Repair them by iteratively merging the disconnected cycles to the connected cycles. An alternative and interesting approach found in the literature is to instead encode a set of operations and parameters that are fed to another heuristic, that in turn 2.4. META-HEURISTICS 23 P1 P2 Figure 2.10: This diagram shows an example of of EAX being applied on two parent solutions, P 1 and P 2. The parents are first merged together. Then a new graph is created by selecting alternate edges from each parent P 1, P 2. A subset of cycles are then taken and applied to P 1, such that any edges from P 1 are removed. The child solution produced is infeasible (it contains broken routes). These would need to be repaired. produces a candidate solution. A well known example of this approach was suggested in [7] which encoded an ordering of the customers. The ordering is then fed into an insertion heuristic to produce the actual candidate solutions. An influential result that uses Genetic Algorithms to solve VRPTW is given in [50] with their GIDEON algorithm. GIDEON uses an approach inspired by the Sweep method (an overview of the Sweep method is provided in Section 2.3.2). It builds routes by sweeping a ray, centered at the depot, clockwise around the geographic space enclosing the customer’s locations. Customers are collected into candidate routes based on a set of parameters that are refined by the Genetic Algorithm. GIDEON uses the Genetic Algorithm to evolve the parameters used by the algorithm, rather than to operate on the problem directly. Finally, GIDEON uses a local search method to optimise customers within each route, making use of the λ-interchange operator (A description of this operator is provided in Section 2.4.1). Generally speaking, Genetic Algorithms are not as competitive as other meta-heuristics 24 CHAPTER 2. BACKGROUND at solving the VRP. However, more recently there have been two very promising applications of Genetic Algorithms being used to solve the VRP. Nagata [32] has adapted the EAX operator for use with the VRP. And Berger and Barkaoui have presented a Hybrid Genetic Algorithm called HGA-VRP in [6]. HGA-VRP adapts a construction heuristic for use as a crossover operator. The basic premise is to select a set of routes from each parent that are located close to one another. Customers are then removed from one parent and inserted into the second using an operation inspired by Solomon’s construction heuristic for VRPTW [48]. Both methods have reached the best known solution for a number of the classic VRP benchmark instances by Christofides, Mingozzi and Toth [11] and are competitive with the best Tabu Search methods. 2.4.3 Tabu Search Tabu Search follows the general approach shared by many meta-heuristics; it iteratively improves a candidate solution by searching for improvements within the current solution’s neighbourhood. Tabu search starts with a candidate solution, which may be generated randomly or by using another heuristic. Unlike Simulated Annealing, the best improvement within the current neighbourhood is always taken as the next move. This introduces the problem of cycling between candidate solutions. To overcome this Tabu Search introduces a list of solutions that have already been investigated and are forbidden as next moves (hence its name). The first instance of Tabu Search being used for VRP is by Willard [53]. Willard’s approach made use of the fact that VRP instances can be transformed into MTSP instances and solved. The algorithm uses a combination of simple vertex exchange and relocation operations. Although opening the door for further research, its results weren’t competitive with the best classic heuristics. Osman gives a more competitive use of Tabu Search in [36]. As with his Simulated Annealing method he makes use of the λ-interchange operation to define the search neighbourhood. Osman provides two alternative methods to control how much of the neighbourhood is searched for selecting the next move: Best-Improvement (BI) and First-Improvement (FI). Best-Improvement searches the entire neighbourhood and selects the move that is the most optimal. First-Improvement searches only until a move is found that is more optimal than the current position. Osman’s heuristic produced competitive results that outperformed many other heuristics. However, it has since been refined and improved upon by newer Tabu Search methods. Toth and Vigo introduced the concept of Granular Tabu Search (GTS) [51]. Their method makes use of a process that removes moves from the neighbourhood that are unlikely to produce good results. They reintroduce these moves back into the process if the algorithm is stuck in a local minimum. Their idea follows from an existing idea 2.4. META-HEURISTICS 25 known as Candidate Lists. Toth and Vigo’s method has produced many competitive results. Taillard has provided one of the most successful methods for solving the VRP in his Tabu Search method in [49]. Talliard’s Tabu Search uses Or’s λ-interchange as its neighbourhood structure. It borrows two novel concepts from [20]: the use of a more sophisticated tabu mechanism, where the duration (or number of iterations) that an item is tabu for is chosen randomly; and a diversification strategy, where vertices that are frequently moved without giving an improvement are penalised. A novel aspect of Taillard’s algorithm is its decomposition of the problem into sub-problems. Each problem is split into regions using a simple segmentation of the region centred about the depot (Taillard also provides an alternative approach for those problems where the customers are not evenly distributed around the depot). From here each subproblem is solved individually, with customers being exchanged between neighbouring segments periodically. Taillard observes that exchanging customers beyond geographically neighbouring segments is unlikely to produce an improvement, so these moves are safely ignored. Taillard’s method has produced some of the currently best known results for the standard Christofides, Mingozzi and Toth problem sets [11]. 2.4.4 Large Neighbourhood Search Large Neighbourhood Search (commonly abbreviated to LNS) was recently proposed as a heuristic by Shaw [47]. Large Neighbourhood Search is a type of heuristic belonging to the family of heuristics known as Very Large Scale Neighbourhood search (VLSN)2 . Very Large Scale Neighbourhood search is based on a simple premise; rather than searching within a neighbourhood of solutions that can be obtained from a single (and typically quite granular) operation, such as 2-opt, it might be profitable to consider a much broader neighbourhood—a neighbourhood of candidate solutions that are obtained from applying many simultaneous changes to a candidate solution. What distinguishes these heuristics from others is that the neighbourhoods under consideration are typically exponentially large, often rendering them infeasible to search. Therefore much attention is given to providing methods that can successfully traverse these neighbourhoods. 2 LNS is somewhat confusingly named given that it a type of VLSN, and not a competing approach. 26 CHAPTER 2. BACKGROUND Large Neighbourhood Search uses a Destroy and Repair metaphor for how it searches within its neighbourhood. Its basic operation is as follows: Algorithm 3: Large Neighbourhood Search x = an initial solution while termination condition not met do xt = x destroy(xt ) repair(xt ) if xt better than current solution then x = xt end end Result: x It starts by selecting a starting position. This can be done randomly or by using another heuristic. Then for each iteration of the algorithm a new position is generated by destroying part of the candidate solution and then by repairing it. If the new solution is better than the current solution, then this is selected as the new position. This continues until the termination conditions are met. Large Neighbourhood Search can be seen as being a type of Very Large Scale Neighbourhood search because at each iteration the number of neighbouring solutions is exponentially large, based on the number of items removed (i.e. destroyed). Obviously the key components of this approach are the functions used to destroy and repair the solution. Care must be given to how these functions are constructed. They must pinpoint an improving solution from a very large neighbourhood of candidates, while also providing enough degrees of freedom to escape a local optimum. Empirical evidence in the literature shows that even surprisingly simple destroy and repair functions can be effective [47] [45]. In applications of Large Neighbourhood Search for VRP a pair of simple operations are commonly used (often alongside more complex ones too) for the destroy and repair functions. Specifically, the solution is destroyed by randomly selecting and removing n customers. It is then repaired by finding the least cost reinsertion points back into the solution of the n customers. Shaw applied Large Neighbourhood Search to VRP in his original paper introducing the method [47]. In this he introduced a novel approach for his destroy and repair functions. The destroy function removes a set of ‘related’ customers. He defines a related customer to be any two customers that share a similar geographic location, that are sequentially routed, or that share a number of similar constraints (such as overlapping time windows if time constraints are used). The idea of removing related customers, over simply removing random customers, is that related customers are more likely to be profitably exchanged—or stated another way, unrelated customers are more likely to be reinserted back in their original positions. Shaw’s repair func- 2.5. SWARM INTELLIGENCE 27 tion makes use of a simple branch and bound method that finds the minimum cost reinsertion points within the partial solution. His results were immediately impressive and reached many of the best known solutions on the Christofides, Mingozzi and Toth problems [11]. More recently Ropke proposed an extension to the basic Large Neighbourhood Search process in [45]. His method adds the concept of using a collection of destroy and repair functions, rather than using a single pair. Which function to use is selected at each iteration based on its previous performance. In this way the algorithm adapts itself to use the most effective function to search the neighbourhood. Ropke makes use of several destroy functions. He uses a simple random removal heuristic, Shaw’s removal heuristic, and a worst removal heuristic, which removes the most costly customers (in terms of that customer’s contribution to the route’s overall cost). Likewise, he makes use of several different insertion functions. These include a simple greedy insertion heuristic, and a novel insertion method he calls the ‘regret heuristic’. Informally, the regret heuristic reinserts those customers first who are most impacted (in terms of increased cost) by not being inserted into their optimum positions. Specifically, let U be the set of customers to be reinserted and let xik be a variable that gives the k’th lowest cost for inserting customer i ∈ U into the partial solution. Now let c∗i = xi2 − xi1 , in other words the cost difference between inserting customer i into its second best position and its first. Now in each iteration of the repair function choose a customer that maximises: max c∗i i∈U Ropke presents a series of results that show that his Large Neighbourhood Search is very competitive for solving the VRP and its related problems (i.e. VRPTW, PDPTW, and DARP). Considering that Large Neighbourhood Search was only proposed in 1998, it has been very successful. In a short space of time it has attracted a large amount of research and has produced some of the most competitive results for solving the VRP. 2.5 Swarm Intelligence A recent area of research is in producing heuristics that mimic certain aspects of swarm behaviour. Probably the most well known heuristics in this family are Particle Swarm Optimisation (PSO) and Ant Colony Optimisation (ACO). Real life swarm intelligence is interesting to combinatorial optimisation researchers as it demonstrates a form of emergent intelligence, where individual members with limited reasoning capability and simple behaviours, are still able to arrive at optimal solutions to complex resource allocation problems. 28 CHAPTER 2. BACKGROUND In the context of combinatorial optimisation, these behaviours can be mimicked and exploited. Algorithms that make use of this approach produce their solutions by simulating behaviour across a number of agents, who in themselves, typically only perform rudimentary operations. A feature of this class of algorithms is the ease with which they can be parallelised, making them more easily adaptable to large scale problems. Swarm Intelligence algorithms have been employed to solve a number of problems. We look at two examples here, Ant Colony Optimisation and the Bees Algorithm, which this thesis makes use of. 2.5.1 Ant Colony Optimisation Ant Colony Optimisation is inspired by how ants forage for food and communicate promising sites back to their colony. Real life ants initially forage for food randomly. Once they find a food source they return to the colony and in the process lay down a pheromone trail. Other ants that then stumble upon the pheromone trail follow it with a probability dependent on how strong (and therefore how old) the pheromone trail is. If they do follow it and find food, they then return to the colony, thus also strengthening the pheromone trail. The strength of the pheromone trail reduces over time meaning that younger and shorter pheromone trails, that do not take as long to traverse, attract more ants. Figure 2.11: This diagram depicts how ants make use of pheromone trails to optimise their exploitation of local food sources. Ant Colony Optimisation mimics this behaviour on a graph by simulating ants marching along a graph that represents the problem being solved. The basic operation of 2.5. SWARM INTELLIGENCE 29 the algorithm is as follows: Algorithm 4: Ant Colony Optimisation Data: A graph representing the problem while termination condition not met do positionAnts() while solution being built do marchAnts() end updatePheromones() end At each iteration of the algorithm the ants are positioned randomly within the graph. The ants are then stochastically marched through the graph until they have completed a candidate solution (in the case of a TSP this would be a tour of all vertices). At each stage of the march each ant selects their next edge based on the following probability formula: pkij = P β [τijα ][ηij ] β α l∈N k [τil ][ηil ] Where pkij is the probability that ant k will traverse edge (i,j), N k is the set of all edges that haven’t been traversed by ant k yet, τ is the amount of pheromone that has been deposited at an edge, η is the desirability of an edge (based on a priori knowledge specific to the problem), and α and β are global parameters that control how much influence each term has. Once the march is complete and a set of candidate solutions have been constructed (by each ant, k), pheromone is deposited on each edge using the following equation: τij = (1 − ρ)τij + m X ∆τijk k=1 Where 0 < ρ ≤ 1 is the pheromone persistence, and ∆τijk is a function that gives the amount of pheromone deposited by ant k. The function is defined as: ∆τijk =  1/C k 0 if edge (i, j) is visited by ant k otherwise 30 CHAPTER 2. BACKGROUND Where C k represents the total distance travelled through the graph by ant k. This ensures that shorter paths result in more pheromone being deposited. As an example of Ant Colony Optimisation’s use in combinatorial problems, we show how it can be applied to the TSP. We build a weighted graph with i ∈ V representing each city to be visited and (i, j) ∈ E and wij representing the cost of travel between each city. Then at each step of the iteration we ensure that the following constraints are met: • Each city is visited at most once. • We set ηij to be equal to wij . When the Ant Colony Optimiser starts, it positions each ant at a randomly selected vertex (i.e. city) within the graph. Each step of an ant’s march then builds a tour through the cities. Once an ant has completed a tour it serves as a candidate solution for the TSP. Initially the solutions will be of low quality, so we use the length of the tours to ensure that more pheromone is deposited on the shorter tours. At the end of n iterations the ants will have converged on a near optimal solution (but like all meta-heuristics there’s no guarantee that this will be the global optimum). Figure 2.12: Shown is an example of ACO being used to solve a TSP. Initially the ants explore the entire graph. At the end of each iteration the more optimal tours will have more pheromone deposited on them, meaning in the next iteration the ants are more likely to pick these edges when constructing their tour. Eventually the ants converge on a solution. Ant Colony Optimisation has been applied to VRP by Bullnheimer, Hartl, and Strauss in [8] [9]. They adapted the straightforward implementation used for the TSP, detailed in the preceding discussion, by forcing the ant to create a new route each time it exceeds the capacity or maximum distance constraint. They also use a modified edge selection rule that takes into account the vehicle’s capacity and its proximity to the depot. Their updated rule is given by: 2.5. SWARM INTELLIGENCE pkij =P 31 β [τijα ][ηij ][sij ][κij ] β α l∈N k [τil ][ηil ][sil ][κil ] Where s represents the proximity of customers i, j to the depot, and κ = (Qi +q j )/Q— Q, giving the maximum capacity, Qi giving the capacity already used on the vehicle, and q j is the additional load to be added. κ influences the ants to take advantage of the available capacity. Bullnheimer et al.’s implementation of Ant Colony Optimisation for VRP produces good quality solutions for the Christofides, Mingozzi and Toth problems [11], but is not competitive with the best modern meta-heuristics. More recently Reimann, Stummer, and Doerner have presented a more competitive implementation of Ant Colony Optimisation for VRP [41]. Their implementation operates on a graph where (i, j) ∈ E represent the savings of combining two routes, as given by the classic Clark and Wright Savings heuristic (see Section 2.3.1 for more on this heuristic). Each ant selects an ordering of how the merges are applied. This implementation is reported to be competitive with the best meta-heuristics [39]. 2.5.2 Bees Algorithm Over the last decade, and inspired by the success of Ant Colony Optimisation, there have been a number of algorithms proposed that aim exploit the collective behaviour of bees. This includes: Bee Colony Optimisation, which has been applied to many combinatorial problems, Marriage in Honey Bees Optimization (MBO) that has been used to solve propositional satisfiability problems, BeeHive that has been used for timetabling problems, the Virtual Bee Algorithm (VBA) that has been used for function optimisation problems, Honey-bee Mating Optimisation (HBMO) that has been used for cluster analysis, and finally, the Bees Algorithm that is the focus of this thesis. See [31] for a bibliography and high level overview on many of these algorithms. The Bees Algorithm was first proposed in [38]. It is inspired by the foraging behaviour of honey bees. Bee colonies must search a large geographic area around their hive in order to find sites with enough pollen to sustain a hive. It is essential that the colony makes the right choices in which sites are exploited and how much resource is expended on a particular site. They achieve this by sending scout bees out in all directions from the hive. Once a scout bee has found a promising site it then returns to the hive and recruits hive mates to forage at the site too. The bee does this by performing a waggle dance. The dance communicates the location and quality of the site (i.e. fitness). Over time, as more bees successfully forage at the site, more are recruited to exploit the site—in this aspect bee behaviour shares some similarities with ant foraging behaviour. 32 CHAPTER 2. BACKGROUND Figure 2.13: Shown is the waggle dance performed by a honey bee (image courtesy of [3]). The direction moved by the bee indicates the angle that the other bees must fly relative to the sun to find the food source. And the duration of the dance indicates its distance. Informally the algorithm can be described as follows. Bees are initially sent out to random locations. The fitness of each site is then calculated. A proportion of the bees are reassigned to those sites that had the highest fitness values. Here each bee searches the local neighbourhood of the site looking to improve the site’s fitness. The remainder of the bees are sent out scouting for new sites, or in other words, they are set to a new random position. This process repeats until one of the sites reaches a satisfactory level of fitness—or a predetermined termination condition is met. More formally, the algorithm operates as follows: Algorithm 5: Bees Algorithm B = {b1 , b2 , . . . , bn } setToRandomPosition(B) while termination condition not met do sortByFitness(B) E = {b1 , b2 , . . . , be } R = {be+1 , be+2 , . . . , bm } searchNeighbourhood(E ∪ {c1 , . . . , cnep }) searchNeighbourhood(R ∪ {d1 , . . . , dnsp }) setToRandomPosition(B − (E ∪ R)) end B is the set of bees that are used to explore the search space. Initially the bees are set to random positions. Function sortByF itness sorts the bees in order of maximum fitness. It then proceeds by taking the m most promising sites found by the bees. It does this by partitioning these into two sets, E, N ⊂ B. E is the first e best sites, and represents the so called elite bees. N is the m − e next most promising sites. The searchN eighbourhood function explores the neighbourhood around a provided set of bees. Each site in E and N is explored. nep bees are recruited for the search of each 2.5. SWARM INTELLIGENCE 33 b ∈ E, and nsp are recruited for the search of each b ∈ N . In practice this means that nep and nsp number of positions are explored within the neighbourhoods of E and N ’s sites, respectively. These moves are typically made stochastically, but it is possible for a deterministic approach to be used too. The remaining n − m bees (in other words, those not in E and N ) are set to random positions. This is repeated until the termination condition is met, which may be a running time threshold or a predetermined fitness level. The advantage promised by the Bees Algorithm over other meta-heuristics is its ability to escape local optima and its ability to navigate search topologies with rough terrain (such as in Figure 2.14). It achieves this by scouting the search space for the most promising sites, and then by committing more resources to the exploration of those sites that produce better results. 2.5 2 1.5 1 0.5 0 10 10 5 5 0 0 -5 -5 -10 -10 Figure 2.14: Shown is a search space with many valleys and hills. These search spaces provide a challenge to meta-heuristic approaches as there are many local minima and maxima to get caught in. The Bees Algorithm ameliorates this by searching in many different areas simultaneously. The Bees Algorithm has been applied to manufacturing cell formation, training neural networks for pattern recognition, scheduling jobs for a production machine, data clustering, and many others areas. See [2] for more examples and a comprehensive bibliography. However, to the best of our knowledge, the Bees Algorithm hasn’t been adapted for the Vehicle Routing Problem until now. 34 CHAPTER 2. BACKGROUND Chapter 3 Problem Definition In this chapter we provide a formal definition of the VRP and briefly describe the variant problems that have arisen in the literature. The Capacitated Vehicle Routing Problem (CVRP) is the more correct name for the VRP that distinguishes it from its variants. We start in Section 3.1 by providing a formal definition of the CVRP. We formulate it as an integer linear programming problem, as has become standard in the VRP literature. And follow this in Section 3.2 by an overview of the VRP variants that are commonly used. 3.1 Capacitated Vehicle Routing Problem We formulate the CVRP here as an integer linear programming problem. Although it is possible to solve the CVRP using an integer programming solver, this is uncommon in practice as the best solvers are still only able to solve for small problem sizes. We provide this formulation as it has become the lingua franca of combinatorial problems. We start the formation by specifying the variables used within it. We represent the CVRP on a weighted graph, G = (V, E). The vertices of the graph V represent all locations that can be visited, this includes each customer location and the location of the depot. For convenience we let v d denote the vertex that represents the depot, and we denote the set of customers as C = {1, 2, . . . , n}. Thus the set of vertices is given by V = v d ∪ C. We now let the set of edges, E, correspond to the valid connections between customers and connections to the depot. For the CVRP all connections are possible, in other words, we set G to be a clique. Each edge (i, j) ∈ E has a correspondingpcost cij . We let the cost be the euclidian distance between the two locations cij = (xj − xi )2 + (yj − yi )2 . Where xi and yi for i ∈ V represent the coordinates of the customer’s location. 35 36 CHAPTER 3. PROBLEM DEFINITION We use K to denote the set of vehicles that are used to visit customers, such that |K| = m and m is the maximum number of vehicles allowed. We define q and t to be the maximum capacity and the maximum work duration, respectively, allowable for a vehicle. The demand (i.e. required capacity) for each customer is denoted by di , i ∈ C. Likewise, we denote the service time required by each customer as ti , i ∈ C. We then use the decision variable Xijk to denote if a particular edge (i, j) ∈ E is traversed by vehicle k ∈ K, in other words, k travels between customers i, j ∈ C. Where this is true we let Xijk = 1, and Xijk = 0 where it is not. We use ui , i ∈ C as a sequencing variable that gives the position of customer i within the route of the vehicle that visits it. We are now able to define the problem as follows: Minimise: X X cij Xijk (3.1) k∈K (ij)∈E Subject to: XX Xijk = 1 ∀i ∈ C (3.2) ∀k ∈ K (3.3) ∀k ∈ K (3.4) Xvkd j = 1 ∀k ∈ K (3.5) k Xjv d = 1 ∀k ∈ K (3.6) ∀c ∈ C and ∀k ∈ K (3.7) ui − uj + |V |Xijk ≤ |V | − 1 ∀(i, j) ∈ E − v d and ∀k ∈ K (3.8) Xijk ∀(i, j) ∈ E and ∀k ∈ K (3.9) k∈K j∈V X di i∈C X i∈C X X Xijk ≤ q j∈C ti X Xijk + j∈C X cij Xijk ≤ t (ij)∈E j∈V X j∈V X i∈V k Xic − X k Xcj =0 j∈V ∈ {0, 1} The objective function (3.1) minimises the costs cij . Constraint (3.2) ensures that each customer can only be serviced by a single vehicle. Constraint (3.3) enforces the capacity constraint; each vehicle cannot exceed its maximum vehicle capacity q. Likewise Constraint (3.4) enforces the vehicle’s work duration constraint. A vehicle’s work duration is the sum of its service times (ti , i ∈ C where customer i is visited by the vehicle) and its travel time. By convention the travel time is taken to be equal to 3.2. VARIANTS 37 the distance traversed by the vehicle, which in turn is equal to the costs, cij , of the edges it traverses. Constraints (3.5) and (3.6) ensure that each vehicle starts at the depot and finishes at the depot, and that they do this exactly once. Constraint (3.7) and Constraint (3.8) are flow constraints that ensure that the number of vehicles entering a customer is equal to the number of vehicles leaving, and that sub-tours are eliminated. Lastly, Constraint (3.9) ensures the integrality conditions. Constraint (3.4), which enforces a maximum vehicle work duration, t, is often left out of the traditional CVRP formation but is included here as it is present in the problem instances we use for benchmarks in Chapter 5. 3.2 Variants In this section we provide an overview of the common variations of the VRP that are used. These variations have arisen from real world vehicle routing scenarios, where the constraints are often more involved than is modelled in the CVRP. 3.2.1 Multiple Depot Vehicle Routing Problem A simple extension to the CVRP is to allow each vehicle to start from a different depot. Part of the problem now becomes assigning customers to depots, which in itself is a hard combinatorial problem. The CVRP formation can easily be relaxed to allow this. There are two variations of the problem. One constrains each vehicle to finish at the same depot that it starts from. The other allows vehicles to start and finish at any depot, as long as the same number of vehicles return to the depot as left from it. 3.2.2 Vehicle Routing with Time Windows The Vehicle Routing Problem with Time Windows (VRPTW) adds the additional constraint to the classic VRP that each customer must be visited within a time window specified by the customer. More formally, for VRPTW each customer i ∈ C also has a corresponding time window [ai , bi ] in which the goods must be delivered. The vehicle is permitted to arrive before the start time, ai . However, in this case the vehicle must wait until time ai adding to the time it takes to complete the route. However, it is not permitted for the job to start after time bi . An additional constraint is added to the formation of CVRP to ensure that time window constraints are met: ai ≤ Sik ≤ bi where the decision variable Sik provides the time that each vehicle k ∈ K arrives at customer i ∈ V . 38 CHAPTER 3. PROBLEM DEFINITION 3.2.3 Pickup and Delivery Problem The Pickup and Delivery Problem (PDP) generalises the VRP. In this problem goods are both picked up and delivered by the vehicle along its route. The vehicle’s work now comes in two flavours: pickup jobs, P = {p1 , p2 , . . . , pk }, and delivery jobs, D = {d1 , d2 , . . . , dl }, such that C = P ∪ D. Additional constraints are added to the CVRP formation to ensure that: 1. Pickup and deliver jobs are completed by the same vehicle, that is pi ∈ Rk ⇒ di ∈ Rk where Rk represents a sequence of jobs undertaken by a vehicle k. 2. The pickup job, pi , appears before its corresponding delivery job, di , in the sequence of jobs undertaken by a vehicle. 3. The vehicles capacity is not exceeded as goods are loaded and unloaded from it. This requires the use of an intermediate variable, yik , i ∈ V, k ∈ K that represents the load of vehiclePk at customer i. It adds constraints: y0k = 0, Xijk = 1 ⇒ yjk = yik + di , and i∈V yik ≤ q for all k ∈ K, to enforce this. There is also a variation on PDP that adds time windows, called PDPTW. In this case the extra constraints from the VRPTW problem are merged with those given here. PDP is a much harder problem computationally than CVRP, as its extra constraints add new dimensions to the problem. Because of its complexity PDP has only been actively researched in the last decade. Chapter 4 Algorithm This chapter provides a detailed description of the Enhanced Bees Algorithm, the algorithm developed for this thesis, and its operation. We start by reviewing the objectives that the algorithm was designed to meet in Section 4.1. In Section 4.2 we provide a description of how the algorithm internally represents the VRP problem and its candidate solutions. Next in Section 4.3 we provide a detailed description of the operation of the algorithm. Finally, in Section 4.4 we describe the neighbourhood structures that are used by the algorithm to define its search space. 4.1 Objectives The Enhanced Bees Algorithm was built for use in a commercial setting. It was developed as part of a New Zealand Trade and Enterprise grant for the company vWorkApp Inc.’s scheduling and dispatch software. Accordingly, different objectives were aimed for with its design (such as runtime performance) than are typically sought in the VRP literature. The algorithm’s objectives, in order of priority, are as follows: 1. Ensure that all constraints are met. Specifically that the route’s maximum duration is observed. 2. Have a good runtime performance. It is more desirable for the algorithm to produce a reasonable quality result quickly (within 60 seconds), than for it to produce a better result but require a longer processing time. Specifically if the algorithm could reach 5% of the optimum value within 60 seconds then this would be sufficient. 3. Produce good quality results. Notwithstanding objective 2, the results produced must be close to the global optimum. 39 40 CHAPTER 4. ALGORITHM 4. Have a design that lends itself to parallelisation and is able to make use of the additional processing cores available within modern hardware. 4.2 Problem Representation The Enhanced Bees Algorithm represents the problem in a direct and straightforward manner. It directly manipulates a candidate solution S, where S is a set of routes R ∈ S, and each route contains an ordered sequence of customers vi ∈ R starting and ending at the depot vertex v d . = R1 = 1 5 3 R2 = 2 4 7 11 R3 = 9 8 10 6 R1 3 1 5 Figure 4.1: Shown is an example of a simple VRP candidate solution as represented internally by the Enhanced Bees Algorithm. More general representations are sometimes used for meta-heuristics, as is commonly seen with Genetic Algorithms, as they allow the algorithm to be easily adapted to other combinatorial problems. However, this often comes at a cost of added complexity and inferior results1 . This algorithm was designed specifically for solving instances of the VRP so a direct representation was chosen. The algorithm makes use of a fitness concept, common to many meta-heuristics, to describe the cost of the solution. The fitness function f () includes terms for the distance (i.e. cost) of the solution and penalties for breaking the capacity and maximum route duration constraints. The Enhanced Bees Algorithm uses penalties to encourage feasible solutions to be produced. Rather than outright barring infeasible solutions, the fitness function allows the algorithm some wriggle room to traverse through these on its way towards a feasible solution. 1 This occurs because the operators that act on the problem representation can no longer exploit information that is specific to the problem domain and must rely on general purpose operations instead. 4.3. ENHANCED BEES ALGORITHM 41 Specifically f () is defined as follows: X c(R) = ci,i+1 (4.1) i∈R ! d(R) = max X di − q, 0 (4.2) i∈R ! X ti + c(R) − t, 0 (4.3) (αc(R) + βd(R) + γc(R)) (4.4) t(R) = max i∈R f (S) = X R∈S Function c(R) calculates the cost (i.e distance) of a given route, and function d(R) calculates how overcapacity the given route is. We define overcapacity to be how much larger the sum of the route’s demands, di , i ∈ R, are than the stated maximum allowable capacity q. Likewise function t(R) calculates the overtime of a given route. A route’s duration is calculated as being the sum of its customer’s service times, ti , i ∈ R, and its travel time. By convention the travel time is equal to the distance of the route. Function t(R) then returns how much over the maximum allowable route duration, t, the duration is. Lastly, the fitness function f () is the weighted sum of these three terms. Parameters α, β, and γ are used used to control how much influence each term has on determining the candidate solution’s fitness. For the purposes of benchmarking our algorithm (see Chapter 5) we use a travel cost that is equal to the 2D Euclidian distance2 between the two points. For real life problems we have found that using a manhattan distance3 often provides superior results. This is presumably due to the manhattan distance better modelling the road system we tested on (Auckland, New Zealand), which although not a strict grid, is still closer to this than the Euclidian distance models. 4.3 Enhanced Bees Algorithm Our Algorithm is based on the Bees Algorithm (see Section 2.5.2 for an overview of the standard Bees Algorithm). The Enhanced Bees Algorithm makes some changes to adapt the Bees Algorithm to the VRP domain. An interesting aspect of the Bees Algorithm is that it covers a broad search area, minimising the risk of being stuck in a local optimum. It achieves this by randomly probing (or in the Bees Algorithm parlance, ‘scouting’) many areas of the search space through its entire run. However, this approach is not well suited to hard combinatorial problems, where a newly constructed p Specifically, we use: cij = (xj − xi )2 + (yj − yi )2 3 Specifically, we use: cij = (xj − xi ) + (yj − yi ) 2 42 CHAPTER 4. ALGORITHM solution, let alone a randomly generated one, is often far from optimal (for instance, the Clark Wright Savings heuristic still produces solutions that are up to 15% from the global optimum and would require many operations to get close to optimal). We have adapted the Bees Algorithm such that many of its unique characteristics, like its relative robustness, are maintained while working well with hard combinatorial problems, such as the VRP. The Enhanced Bees Algorithm can be summarised, at a high level, as follows: Algorithm 6: Enhanced Bees Algorithm S = seedSites() while termination condition not met do for si ∈ S do explore(si , d) if i < λ then removeWorstSite end end end The algorithm maintains a collection of sites S, and each site si ∈ S maintains a collection of bees, Bi . Each bee is a proxy to the problem domain that we are trying to solve. In our case this is the VRP problem representation covered in Section 4.2. Initially each site is seeded, such that each site, si ∈ S, contains a collection of bees Bi , and each bee has a corresponding VRP candidate solution, S. Each candidate solution is initialised by seeding each route with a randomly chosen customer, which is then filled out using the insertion heuristic outlined in Section 4.4.2. Each site is then in turn improved upon. This is achieved by iteratively exploring the neighbourhood of each site. The process used to explore each site is where the majority of the algorithm’s processing takes place and where the interesting aspects of the algorithm come into play. The exploration process is covered in detail in Sections 4.3.1, 4.3.2, and 4.4. The number of sites explored is reduced over the run of the algorithm. This borrows from the idea of a cooling schedule used in Simulated Annealing. Sites are reduced using the formula: S = S − sw if i mod λ ≡ 0 (4.5) Where sw represents the worst site, in terms of fitness, i represents the current iteration of the algorithm, and λ represents the period of iterations with which the number of sites are reduced. Once the algorithm is complete the solution, S, with the best 4.3. ENHANCED BEES ALGORITHM 43 overall fitness is returned as the answer. In the next section we review in more detail each aspect of the algorithm. 4.3.1 Bee Movement Bees are moved around the search space to look for improvements to the collection of candidate solutions being maintained. Each bee represents a candidate solution, S, so a valid bee move is any new candidate solution S0 that can be reached within the neighbourhood of S (see Section 4.4 for the operations under which the neighbourhood is defined). Neighbourhood Site1 Best site position Last x best positions Sitek Sitei Figure 4.2: Three sites are shown along with their neighbourhoods. Site i shows in more detail that each site maintains a list of the last  most promising positions for exploration. A feature of the Enhanced Bees Algorithm is that two Bees cannot occupy the same position. The algorithm maintains a register of the current positions occupied by each bee. We use the current fitness, f (S), as a quick and simple representation of a bee’s current position4 . If a bee tries to occupy the same position as another bee (i.e. they share the same candidate solution) then the bee trying to occupy that position is forced to explore the neighbourhood again and find another position. 4 This obviously will not work in circumstances where there is a reasonable likelihood of two candidate solutions, Si and Sj having f (Si ) = f (Sj ). While this is not the case with the problem instances we have used in this thesis, this may need to be modified if the algorithm is to be used on more general problem instances. 44 CHAPTER 4. ALGORITHM Enforcing the constraint that each bee must occupy a unique position has two benefits: it forces diversification between the bees and sites, hence encouraging a greater proportion of the search space to be explored; and it increases the chance of a local optimum being escaped, as a bee ensnared in the local optimum now forces the remainder of the hive to explore alternative positions. This feature has a similar intent and effect to the tabu lists used by Tabu Search. Another feature of the Enhanced Bees Algorithm is the role that sites play in concentrating exploration on certain areas of the search space. Each site maintains a list, M = [S1 , . . . , S ], of the last  best positions. Each Si ∈ M is then taken as a launching point for a site’s bees to explore. θ bees are recruited for the exploration of each Si ∈ M . Once all positions in M have been explored then the best  positions are again taken and used as the launching points for the site’s next round of exploration. This exploration method has two purposes: firstly, it allows for a simple type of branching, as  of the most promising positions that were traversed through on the way to the current position are also explored; secondly, it prevents cycling between promising solutions that are in close vicinity to each other. Conversely, sites do not interact with each other, as each site maintains its own unique list of  promising positions. The constraint that no two bees can occupy the same position ensures that each site covers a non overlapping area of the search space. In practice we have found that this is sufficient to encourage sites to diverge and explore distinct areas of the search space. 4.3.2 Search Space Coverage As mentioned, one of the unique aspects of the Bees Algorithm is its ability to produce robust results through probing a large area of the search space. However, this doesn’t work well with hard combinatorial problems, where it cannot be ascertained quickly if an area in the search space shows promise or not. To overcome this limitation we instead use an approach inspired by Simulated Annealing’s use of a cooling schedule. Bees are initially divided equally between each site si ∈ S, ensuring that each site is explored equally. Then every λ period of iterations we reduce the number of sites maintained, such that S = S − sw , where sw is the site with lowest fitness. We measure each site’s fitness from the fitness of its best position found to date. This process continues until a single site remains. We show experimentally in Chapter 5 that this process improves the robustness of the algorithm and produces better results overall than the standard Bees Algorithm. 4.4. SEARCH NEIGHBOURHOOD 4.4 45 Search Neighbourhood As already discussed, each bee seeks to improve upon its current fitness by exploring the local neighbourhood of the solution it represents. The Enhanced Bees Algorithm does this by applying a Large Neighbourhood Search (LNS) operator to its candidate solution S. The LNS operator differs from the more common VRP operators in that a single operation applies many changes to the candidate solution S. This widens the neighbourhood of S to encompass exponentially many candidate solutions. LNS navigates through the vast space it spans by selecting only those changes that have a high likelihood of improving the solution. The LNS operation is comprised of two-phases: a destroy phase, and a repair phase. LNS’s destroy phase, when used for the VRP, typically involves removing a proportion of the customers from the solution. The Enhanced Bees Algorithm’s destroy phase uses two heuristics along those lines: a somewhat intelligent heuristic that attempts to remove those customers that are more likely to be able to be recombined in a profitable way; and a simple random selection. These heuristics are covered in more detail in Section 4.4.1. The second phase of LNS is used to repair the partial solution. The Enhanced Bees Algorithm uses a simple insertion heuristic that inserts the customers into those locations that have the lowest insertion cost. This heuristic is covered more formally in Section 4.4.2. 4.4.1 Destroy Heuristic The Enhanced Bees Algorithm employs two destroy heuristics. The first simply selects l customers randomly from a solution S and removes these from their routes. The second is slightly more complicated and is due to Shaw [47]. Shaw’s removal heuristic stochastically selects customers such that there is a higher likelihood of customers that are related to one another being removed. For our purposes we define related to mean that for any two customers, vi , vj ∈ V , then either vi , vj are geographically close to one another (i.e. cij is small), or they share an adjacent position within the same route, R = [. . . , vi , vj , . . .]. The rationale to removing related customers is that they are the most likely to be profitably exchanged with one another. Conversely, unrelated customers are more likely to be reinserted back into the same positions that they were removed from. 4.4.2 Repair Heuristic The repair heuristic used by the Enhanced Bees Algorithm randomly selects one of the removed customers vj , and calculates a cost for reinserting vj between each pair 46 CHAPTER 4. ALGORITHM of jobs vi , vk ∈ Ri for all Ri ∈ S (actually not all reinsertion positions are considered, see Section 4.4.3 for a description of which positions are considered). The reinsertion cost is calculated as follows: c∗ = cij + cjk − cik ∗ 0 (4.6) 0 cost = c + d(R ) − d(R) + t(R ) − t(R) (4.7) Where c∗ calculates the cost difference in terms of travel distance. R and R0 are defined as the route before and after the customer is inserted, respectively. And functions d(R) and t(R) are all defined as they are in Section 4.2. The final cost is the sum of the added travel distance and the two extra penalties, if the route is now overcapacity or over its maximum duration. The algorithm selects the position with the lowest insertion cost to reinsert the customer. This is repeated until all customers are reinserted into the solution. The reason that customers are reinserted in a random order is that it adds a beneficial amount of noise to the heuristic. This ensures that a healthy diversity of solutions are generated from the heuristic. 4.4.3 Neighbourhood Extent We use two techniques to adjust the extent of the neighbourhood being searched. The first technique that we use allows the algorithm some flexibility in selecting infeasible solutions. As can be seen from our formulation of the candidate solutions’ fitness values (see Section 4.2) violations of the problem’s capacity and duration constraints are penalised rather than forbidden. This allows the bees to navigate through infeasible solutions, where other aspects of that solution are sufficiently attractive enough to outweigh the penalties. However, only feasible solutions are allowed to be counted as final solutions returned by the algorithm. The second technique that we use is to adjust the number of insertion positions considered as part of the repair heuristic. The number of insertion positions considered starts with both sides of the three closest customers and increases as the site ages. More formally, let vi ∈ V be the customer that is being inserted. An ordered sequence of candidate insertion points, Lvi = [v1 , . . . , vn ] such that vj ∈ V − vi , is kept that lists customers in increasing geographic distance from vi , that is cij ∀j ∈ V − i. The LNS repair operator tests µ positions from Lvi to find the cheapest insertion point. The repair operator tests both possible insertion points represented by vj ∈ Lvi , that is, it tests both the insertion cost of inserting vi immediately before and after vj in the route R that contains vj . 4.4. SEARCH NEIGHBOURHOOD 47 For each site si ∈ S we also maintain a counter ai , i ∈ S that denotes the age of the site. A site’s age is incremented for each iteration that a site doesn’t improve upon its currently best known solution (as defined by the solution’s fitness, f (S)). Whenever a site improves upon its best known solution then the counter is reset, such that ai = 0. initial neighbourhood final neighbourhood Figure 4.3: The diagram shows a vertex being considered for reinsertion back into a solution. It starts by only considering insertion points that are geographically close to its position. The search area is widened over the course of the algorithm to take into consideration a larger set of insertion points. We then use the following formula to increase how much of Lvi is considered as the site ages. µ = |Lvi | min a i k ,1  Where k is a constant that controls the rate at which the search area is expanded. As this process extends the number of insertion positions that are considered by the repair heuristic, this also serves to extend the neighbourhood of solutions surrounding a candidate solution S. In this way the algorithm also dynamically extends the size of a neighbourhood surrounding a site, si ∈ S, if si becomes stuck in a local optimum. 48 CHAPTER 4. ALGORITHM Chapter 5 Results In this chapter we provide a detailed breakdown of the results obtained by the Enhanced Bees Algorithm. The algorithm is tested against the well known set of test instances from Christofides, Mingozzi and Toth [11]. We start in Section 5.1 by presenting the results obtained by running the algorithm in its two standard configurations: the first configuration is optimised to produce the best overall results, regardless of the runtime performance; the second configuration is optimised to produce the best results possible within a 60 second runtime threshold. We follow this in Section 5.2 by providing contrasting results on the same problem instances instead using a standard Bees Algorithm and a LNS local search. Here we aim to demonstrate that the enhancements suggested in this thesis do in fact improve the solution quality. Finally, we end in Section 5.3 by comparing and ranking how the Enhanced Bees Algorithm performs compared to the results in the literature. 5.1 Enhanced Bees Algorithm The results depicted in Figures 5.1, 5.2, 5.3 and 5.4 show the algorithm’s performance on two configurations. The first configuration is optimised to produce the best overall results, that is, the minimum travel distance that meets all capacity and duration constraints. No consideration is made for the algorithm’s runtime performance in this configuration. This configuration is denoted as Best in the following diagrams and tables. The second configuration is optimised to produce the best results possible within a 60 second runtime window. This configuration is denoted as Fast in the following diagrams and tables. The results depicted in Figures 5.1, 5.2, 5.3 and 5.4 are for the standard 14 VRP problem instances due to Christofides, Mingozzi and Toth [11] and were all obtained 49 50 CHAPTER 5. RESULTS 1 Percentage of Best Known 0.8 0.6 0.4 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.2 0 0 200 400 600 800 Time (secs) 1000 1200 1400 1600 Figure 5.1: Best. Shown are the results obtained on the standard 14 Christofides, Mingozzi and Toth problem instances when the algorithm is optimised for producing the best overall results. The algorithm was left to run for 30 minutes. The lefthand axis shows the relative percentage compared to the best known result for the same problem instance. The bottom axis shows the elapsed runtime in seconds. Infeasible solutions are shown as being 0% of the best known result. The average result obtained across all problem instances is shown in red. on a MacBook Pro 2.8 GHz Intel Core 2 Duo. The best result for each problem instance was selected from 10 runs of the algorithm. In Figures 5.1 and 5.2 (i.e. the Best configuration) the algorithm was set to start with |S| = 100 (i.e. 100 sites), and reduce this number each 50 iterations (λ = 50) by 1% until only |S| = 3. The number of promising solutions remembered by each site was set to |M | = 5. The algorithm was left to run for 30 minutes on each problem before being terminated. Infeasible solutions (i.e. solutions over their capacity or duration constraints) were allowed to be traversed through, but were scored as being 0% of the best known solution. Conversely, in Figures 5.3 and 5.4 (i.e. the Fast configuration) the algorithm was set to start with |S| = 25 (i.e. 25 sites), and reduce this number each iteration (λ = 1) by 1% until only |S| = 1. The number of promising solutions remembered by each site was set to |M | = 5. The algorithm was left to run for 60 seconds on each problem before 5.2. EXPERIMENTS 51 1 0.98 0.96 Percentage of Best Known 0.94 0.92 0.9 0.88 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.86 0.84 0.82 0.8 0 200 400 600 800 Time (secs) 1000 1200 1400 1600 Figure 5.2: Best—Blow up. Shown are the same results as are depicted in Figure 5.1, but with the area between 0.8 and 1.0 of the left axis blown up. being terminated. The LNS improvement heuristic was set to destroy between 0% and 80% (with a mean of 40%) of the solution at each step. The repair operator initially only considers the first 3 closest customers as reinsertion points, but it increases this to 50% of the closest customers as the site ages. Infeasible solutions (i.e. solutions over duration or service time constraints) were allowed to be traversed through, but were scored as being 0% of the best known solution. Table 5.1 provides a tabular summary of the results covered in this section. 5.2 Experiments In this section we review the results obtained by implementing the standard Bees Algorithm and a LNS local search. The aim of these experiments is to prove that the algorithmic enhancements suggested in this thesis do in fact produce better results than would have been obtained if we had used a standard Bees Algorithm. We also demonstrate that the combination of the Bees Algorithm with the LNS local search produces better results than if either algorithm were used separately. 52 CHAPTER 5. RESULTS 1 Percentage of Best Known 0.8 0.6 0.4 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.2 0 0 10 20 30 Time (secs) 40 50 60 Figure 5.3: Fast. Shown are the results obtained on the standard 14 Christofides, Mingozzi and Toth problem instances when the algorithm is optimised for producing the best results within a 60 second runtime limit. The lefthand axis shows the relative percentage compared to the best known result for the same problem instance. The bottom axis shows the elapsed runtime in seconds. Infeasible solutions are shown as being 0% of the best known result. 5.2.1 Bees Algorithm versus Enhanced Bees Algorithm We start in Figures 5.5 and 5.6 by showing the results obtained by using the standard Bees Algorithm as described by Pham et al. in [38]. The same problem instances as Section 5.1 are used, so that the results can be compared directly. The results depicted in Figures 5.5 and 5.6 were obtained on a MacBook Pro 2.8 GHz Intel Core 2 Duo. The best result for each instance was selected from 10 runs of the algorithm. The algorithm was configured with the following parameters. It used 25 sites, and selected the best 6 sites as being elite. Each elite site had 3 bees recruited for the search. Another 6 sites were selected as being non-elite, and had 2 bees recruited for the search. The bees from the remaining 13 sites were left to search randomly. The algorithm was left to run for 60 seconds on each problem before being terminated. Infeasible solutions (i.e. solutions over their capacity or duration constraints) were allowed to be traversed through, but were scored as being 0% of the 5.2. EXPERIMENTS 53 1 0.98 0.96 Percentage of Best Known 0.94 0.92 0.9 0.88 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.86 0.84 0.82 0.8 0 10 20 30 Time (secs) 40 50 60 Figure 5.4: Fast—Blow up. Shown are the same results as are depicted in Figure 5.3, but with the area between 0.8 and 1.0 of the left axis blown up. best known solution. A λ-interchange (with λ = 2) improvement heuristic was used for the improvement phase of each bee (see Chapter 2 for an overview on how this heuristic works). 5.2.2 Large Neighbourhood Search Next we show in Figures 5.7 and 5.8 the results obtained by using a standalone LNS search embedded within a hill climb meta-heuristic. The LNS search used in this section is the same one that is employed by the Enhanced Bees Algorithm. It should be noted that there are more sophisticated LNS algorithms available than the comparatively simple one used here. And that these would most probably produce better results than the LNS results presented here. However, we believe one of the attractive features of the Enhanced Bees Algorithm is that it uses a fairly simple local search procedure. Moreover, our aim in this experiment was to demonstrate that the limitations of our simple local method are offset by it being embedded within a Bees Algorithm. The results depicted in Figures 5.7 and 5.8 were obtained on a MacBook Pro 2.8 GHz Intel Core 2 Duo. The best result for each problem instance was selected from 10 runs 54 CHAPTER 5. RESULTS Table 5.1: Enhanced Bees Algorithm. Given are the results obtained by running the Enhanced Bees Algorithm using two different configurations on the standard 14 Christofides, Mingozzi and Toth problem problem instances. The fast configuration is optimised to produce results within a 60 second runtime limit. Conversely, the best configuration is optimised for producing the best results within the much longer period of 30 minutes. Instance Fast1 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 1 2 3 Best Known3 Results 524.61 835.77 826.14 1057.40 1360.85 555.43 913.37 865.94 1196.32 1490.49 1080.20 819.56 1555.30 866.37 100.00% 99.94% 100.00% 97.26% 94.90% 100.00% 99.60% 100.00% 97.18% 93.65% 96.47% 100.00% 99.09% 100.00% Best2 524.61 835.26 826.14 1036.12 1327.48 555.43 909.68 865.94 1169.24 1428.54 1048.24 819.56 1545.19 866.37 98.44% 100.00% 100.00% 100.00% 99.26% 97.29% 100.00% 100.00% 100.00% 99.43% 97.71% 99.42% 100.00% 99.74% 100.00% 524.61 835.26 826.14 1028.42 1291.45 555.43 909.68 865.94 1162.55 1395.85 1042.11 819.56 1541.14 866.37 99.49% Run for 60 seconds. Run for 30 minutes. As reported by Gendreau, Laporte, and Potvin in [21]. of the algorithm. The algorithm was initialised to a starting position generated by a simple insertion heuristic. The LNS heuristic was set to destroy between 0% and 80% (with a mean of 40%) of the solution at each step. The repair enumerated all customers when deciding the best reinsertion point. Infeasible solutions (i.e. solutions over their capacity or duration constraints) were allowed to be traversed through, but were scored as being 0% of the best known solution. 5.2.3 Summary Table 5.2 provides a summary of the results obtained by the Bees Algorithm and LNS experiments, alongside the results obtained by our Enhanced Bees Algorithm. The Bees Algorithm is the worst of the three. This is not surprising given that the Bees Algorithm was devised to solve continuous problems, rather than discrete problems. 5.2. EXPERIMENTS 55 1 Percentage of Best Known 0.8 0.6 0.4 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.2 0 0 10 20 30 Time (secs) 40 50 60 Figure 5.5: Standard Bees Algorithm. Shown are the results obtained on the standard 14 Christofides, Mingozzi and Toth instances when the algorithm is optimised for producing the best results within a 60 second runtime limit. The lefthand axis shows the relative percentage compared to the best known result for the same problem instance. The bottom axis shows the elapsed runtime in seconds. Infeasible solutions are shown as being 0% of the best known result. The average result obtained across all problem instances is shown in red. Where the Bees Algorithm has been used for discrete problems in the literature it has been adapted to incorporate more sophisticated local search techniques, much as the Enhanced Bees Algorithm has been here. Also of note is that two of the problem instances didn’t produce feasible solutions at all within the 60 second runtime threshold. We believe that given a longer running time the algorithm would most probably have found a feasible solution. However, one of the objectives of the Enhanced Bees Algorithm is to produce robust results reliably; in this count the standard Bees Algorithm is not competitive. The LNS improvement heuristic produced much stronger results. This shows that the LNS improvement plays an important part in the results obtained by the Enhanced Bees Algorithm. The LNS heuristic is a fairly new heuristic (in the VRP research at least); nevertheless it has produced some of the most competitive results. This is borne out by the results obtained here and in Section 5.1. However, the LNS local search did fail to find a feasible solution for one of the problem instances. Again this 56 CHAPTER 5. RESULTS 1 0.98 0.96 Percentage of Best Known 0.94 0.92 0.9 0.88 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.86 0.84 0.82 0.8 0 10 20 30 Time (secs) 40 50 60 Figure 5.6: Standard Bees Algorithm—Blow up. Shown are the same results as are depicted in Figure 5.5, but with the section between 0.8 and 1.0 of the left axis blown up. Note that the average is not shown on the blow up because it is below 80% percent. is probably due to the limited runtime permitted. If this problem instance is removed from the results, then the LNS search’s average result becomes 96.39%, getting us much closer to the results obtained by the Enhanced Bees Algorithm. 5.3 Comparison Lastly, in Table 5.3 and Figure 5.9 we provide a comparison of the Enhanced Bees Algorithm along with other well known results from the literature. As can be seen from Table 5.3 and Figure 5.9 some of the best results known are due to Taillard’s Tabu Search heuristic. He reaches 12 of the best known solutions from the set of 14 problems. The Enhanced Bees Algorithm, by comparison, finds 8 of the 14 best known solutions. However, the Enhanced Bees Algorithm is still very competitive. The runtime duration required to find a best known solution is smaller than many of the other meta-heuristics (although a direct comparison is hard to make as many of the reported results were run on significantly older hardware). Additionally, the solutions produced by the Enhanced Bees Algorithm are within 0.5% of the best known 5.3. COMPARISON 57 1 Percentage of Best Known 0.8 0.6 0.4 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.2 0 0 10 20 30 Time (secs) 40 50 60 Figure 5.7: LNS algorithm. Shown are the results obtained on the standard 14 Christofides, Mingozzi and Toth instances when the algorithm is optimised for producing the best results within a 60 second runtime limit. The lefthand axis shows the relative percentage compared to the best known result for the same problem instance. The bottom axis shows the elapsed runtime in seconds. Infeasible solutions are shown as being 0% of the best known result. The average result obtained across all problem instances is shown in red. solutions on average, meaning that the algorithm is very competitive with the best meta-heuristics available for the VRP. 58 CHAPTER 5. RESULTS 1 0.98 0.96 Percentage of Best Known 0.94 0.92 0.9 0.88 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Average 0.86 0.84 0.82 0.8 0 10 20 30 Time (secs) 40 50 Figure 5.8: LNS algorithm—Blow up. Shown are the same results as are depicted in Figure 5.7, but with the area between 0.8 and 1.0 of the left axis blown up. 60 5.3. COMPARISON 59 Table 5.2: Experiments. Given are results that contrast the standard Bees Algorithm, a LNS local search, and the Enhanced Bees Algorithm with one another. Each algorithm was run for 60 seconds and used the standard 14 Christofides, Mingozzi and Toth problem instances. Instance Bees Algorithm1 P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 557.17 925.97 873.75 1203.47 1520.89 565.21 1153.57 941.34 1356.43 2153.48 1091.42 825.38 1662.70 903.25 Average 1 2 3 94.16% 90.20% 94.55% 85.45% 84.91% 98.27% 00.00% 91.99% 85.71% 00.00% 95.48% 99.30% 92.69% 95.92% 79.18% LNS2 543.16 854.35 866.13 1061.75 1360.85 560.24 1215.12 890.93 1196.31 1515.32 1168.91 826.14 1555.29 879.69 96.58% 97.77% 95.38% 96.86% 94.90% 99.14% 00.00% 97.19% 97.18% 92.12% 89.15% 99.20% 99.09% 98.49% 89.50% Run for 60 seconds and configured as described in Section 5.2.1. Run for 60 seconds and configured as described in Section 5.2.2. Run for 60 seconds and configured as described in Section 5.1. Enhanced Bees3 524.61 835.77 826.14 1057.40 1360.85 555.43 913.37 865.94 1196.32 1490.49 1080.20 819.56 1555.30 866.37 100.00% 99.94% 100.00% 97.26% 94.90% 100.00% 99.60% 100.00% 97.18% 93.65% 96.47% 100.00% 99.09% 100.00% 98.44% CHAPTER 5. RESULTS 60 1 2 3 4 5 6 7 8 9 584.64 900.26 886.83 1133.43 1395.74 618.40 975.46 973.94 1287.64 1538.66 1071.07 833.51 1596.72 875.75 CW1 532 874 851 1079 1389 560 933 888 1230 1518 1266 937 1776 949 Sweep2 524 857 833 1014 1420 560 916 885 1230 1518 824 876 GenAsgn3 578.56 888.04 878.70 1128.24 1386.84 616.66 974.79 968.73 1284.64 1538.66 1049.43 824.42 1587.93 868.50 3-Opt4 528 (167) 838.62 (6434) 829.18 (9334) 1058 (5012) 1378 (1291) 555.43 (3410) 909.68 (626) 866.75 (957) 1164.12 (84301) 1417.85 (5708) 1176 (315) 826 (632) 1545.98 (7622) 890 (305) SA5 524.61 (360) 835.26 (3228) 826.14 (1104) 1028.42 (3528) 1298.79 (5454) 555.43 (810) 909.68 (3276) 865.94 (1536) 1162.55 (4260) 1397.94 (5988) 1042.11 (1332) 819.56 (960) 1541.14 (3552) 866.37 (3942) TS6 524.61 (6) 844.31 (78) 832.32 (228) 1061.55 (1104) 1343.46 (5256) 560.24 (6) 916.21 (102) 866.74 (288) 1195.99 (1650) 1451.65 (4908) 1065.21 (552) 819.56 (300) 1559.92 (660) 867.07 (348) ACO7 524.61 (5) 835.26 (225) 826.14 (50) 1036.12 (1215) 1327.48 (785) 555.43 (5) 909.68 (175) 865.94 (20) 1169.24 (1610) 1428.54 (1540) 1048.24 (960) 819.56 (35) 1545.19 (1500) 866.37 (40) EBA8 524.61 835.26 826.14 1028.42 1291.45 555.43 909.68 865.94 1162.55 1395.85 1042.11 819.56 1541.14 866.37 Best Known9 Table 5.3: Results Comparison. Given is a comparison of the Enhanced Bees Algorithm alongside other well known results from the literature. The results are for the standard 14 Christofides, Mingozzi and Toth problem instances commonly used in the VRP literature. Running times are given in parenthesis where known. Instance P01E51K05 P02E76K10 P03E101K08 P04E151K12 P05E200K17 P06D51K06 P07D76K11 P08D101K09 P09D151K14 P10D200K18 P11E121K07 P12E101K10 P13D121K11 P14D101K11 Clark Write’s Savings (Parallel) algorithm. Implemented by Laporte and Semet [30]. Sweep Algorithm due to Gillett and Miller [22]. Implemented by Christofides, Mingozzi and Toth [11]. Reported in [30]. Generalised Assignment due to Fisher and Jaikumar [17]. Reported in [30]. 3-Opt local search applied after Clark Write’s Savings (Parallel) algorithm. First improvement taken. Implemented by Laporte and Semet [30]. Simulated Annealing due to Osman [36]. Runtime duration is given in parentheses and is reported in seconds on a VAX 86000. Tabu Search due to Taillard [49]. Runtime duration is given in parentheses and is reported in seconds on a Sillicon Graphics Workstation, 36Mhz. Ant Colony Optimisation Bullnheimer, Hartl, Strauss [9]. Bullnheimer et al. provided two papers on Ant Colony Optimisation for VRP, the better of the two is used. Runtime duration is given in parentheses and is reported in seconds on a Pentium 100. Enhanced Bees Algorithm. Results are shown from the best configuration in Section 5.1. Runtime duration is given in parentheses and is reported in seconds on a MacBook Pro 2.8 GHz Intel Core 2 Duo. Best known results as reported by Gendreau, Laporte, and Potvin in [21]. 5.3. COMPARISON 61 1 TS 0 . 99 ACO SA 0 . 98 Gen Assign Percent of best known solution 0 . 97 0 . 96 0 . 95 0 . 94 3-Opt Sweep CW 0 . 93 0 . 92 0 . 91 EBA Average 0.9 0 2 00 4 00 6 00 8 00 1 000 1 200 1 400 1 600 Time (seconds) Figure 5.9: Results Comparison. Shown are the average results across all problem instances obtained by the Enhanced Bees Algorithm (shown in red) mapped against the results listed in Table 5.3. 62 CHAPTER 5. RESULTS Chapter 6 Conclusion In this thesis we have described a new meta-heuristic for the VRP called the Enhanced Bees Algorithm. The results obtained are competitive with the best meta-heuristics available for the Vehicle Routing Problem. Additionally, the algorithm has good runtime performance, producing results within 2% of the optimal solution within 60 seconds. We took the Bees Algorithm as our starting point. The Bees Algorithm was originally developed for solving continuous optimisation problems, so part of the work undertaken for this thesis was to adapt it for use on the VRP (although, it could be argued that the Enhanced Bees Algorithm is more ‘inspired by’ than ‘adapted from’). The approach developed for the Enhanced Bees Algorithm could equally be applied to other combinatorial optimisation problems, such as the Traveling Salesman Problem, the Job Shop Scheduling Problem, or the Cutting Stock Problem. We showed empirically that the quality of the solutions obtained by the Enhanced Bees Algorithm are competitive with the best modern meta-heuristics available for the VRP. Additionally, we showed that the algorithm has good runtime performance, producing results within 2% of the optimal solution within 60 seconds. The runtime performance of the algorithm makes it suitable for use within real world dispatch scenarios, where often the dispatch process is fluid and hence it is impractical for the optimisation to take minutes (or hours). In these environments, it is acceptable to trade a fraction of a percent off the solution quality for quicker runtime performance. We also gave results that demonstrated that the algorithmic enhancements suggested in this thesis did in fact produce better results than would have been obtained by using a standard Bees Algorithm. We also demonstrated that the combination of the Bees Algorithm with a LNS local search heuristic produced better results than if the algorithms had been used separately. 63 64 CHAPTER 6. CONCLUSION Additionally, we provided a comprehensive survey of the VRP literature. In this we provided a short history of the results that have been foundational to VRP research, as well as providing in depth material and descriptions for some of the classic algorithms developed for the VRP. There are a number of areas where the research undertaken in this thesis could be continued. These include: • Introduce a mating process to generate new sites. An interesting extension to the Enhanced Bees Algorithm would be to incorporate a crossover operation for generating new sites. In our version of the Enhanced Bees Algorithm unpromising sites are simply culled off. An alternative approach, borrowing a concept from Genetic Algorithms and Tabu Search (in this case, Taillard’s Adaptive Memory), would be to replace the site with a recombination of two other successful sites. The advantage to this approach is that it would open a new area of the search space to exploration; an area that should be promising as it combines components from two already successful sites. The crossover process could be as simple as using an existing VRP crossover operator, such as OX, on the two fittest solutions from each site. Although much more sophisticated crossover operations are imaginable. • Extend to other combinatorial problems. It should be possible to follow a similar approach that we have taken in adapting the Bees Algorithm to the VRP and apply this to other combinatorial problems. The Bees Algorithm is especially strong at providing robust solutions where the search space contains many local optima. We imagine that there are many other combinatorial problems where this would be an advantage. An obvious starting point would be to apply it to the Job Shop Scheduling Problem, which shares many characteristics with the VRP. • Include more real world constraints. Although the literature is filled with variations of the VRP that add additional constraints (i.e. VRPTW, PDP, etc), the focus has been on tackling the computationally hard constraints, such as time windows, multiple deploys, etc. An area that is not often addressed in the literature is how to deal with soft constraints, such as, on the day disruptions, differing skill sets across a fleet, or factoring in a dispatcher’s assignment preferences. Unfortunately, these constraints are a barrier to vehicle route optimisation being adopted in many logistics companies. An interesting line of research would be to extend the optimisation methods developed for the VRP to include feedback from a dispatcher—we envision an interactive process where the dispatcher can feedback into the optimisation process the soft constraints that are not modelled within the algorithm. It would also be very interesting to see if the supervised learning methods from artificial intelligence, such as the Naive Bayes classifier, could be incorporated into the optimisation process. Bibliography [1] Bee image. http://etc.usf.edu/clipart/27800/27890/bee 27890.htm. [2] The bees algorithm website. http://www.bees-algorithm.com. [3] Biodidac, a bank of digital http://biodidac.bio.uottawa.ca/. resources for teaching biology. [4] K. Altinkemer and B. Gavish. Parallel savings based heuristic for the delivery problem. Operations Research, 39:456–469, 1991. [5] M.L. Balinski and R.E. Quandt. On an integer program for a delivery problem. Operations Research, 12(2):300–304, 1964. [6] Jean Berger and Mohamed Barkaoui. A hybrid genetic algorithm for the capacitated vehicle routing problem. In Genetic and Evolutionary Computation— GECCO 2003, volume 2723 of Lecture Notes in Computer Science, pages 198–198. 2003. [7] J.L. Blanton and R.L. Wainwright. Multiple vehicle routing with time and capacity constraints using genetic algorithms. Proceedings of the 5th International Conference on Genetic Algorithms, pages 451–459, 1993. [8] B. Bullnheimer, R. F. Hartl, and C. Strauss. Applying the ant system to the vehicle routing problem. Meta-heuristics: Advances and trends in local search paradigms for optimization, pages 285–296, 1999. [9] B. Bullnheimer, R. F. Hartl, and C. Strauss. An improved ant system algorithm for the vehicle routing problem. Annals of Operations Research, 89:319328, 1999. [10] N. Christofides and S. Eilon. An algorithm for the vehicle dispatching problem. ORQ, 20:309–318, 1969. [11] N. Christofides, A. Mingozzi, and P. Toth. Exact algorithms for the vehicle routing problem, based on spanning tree and shortest path relaxations. Mathematical Programming, 20:255–282, 1981a. [12] G. Clark and J.W. Wright. Scheduling of vehicles from a central depot to a number of delivery points. Operations Research, 12:568–581, 1964. 65 66 BIBLIOGRAPHY [13] Dantzig, Fulkerson, and Johnson. Solution of a large-scale traveling salesman problem. Operations Research, (2):393410, 1954. [14] G. B. Dantzig and J. H. Ramser. The truck dispatching problem. Management Science, 6(1):80–91, Oct, 1959. [15] Martin Desrochers, Jacques Desrosiers, and Marius Solomon. A new optimization algorithm for the vehicle routing problem with time windows. Operations Research, 40:342–354, March 1992. [16] S. Eilon, C.D. Watson-Gandy, and N. Christofides. Distribution management: Mathematical modelling and practical analysis. Griffin (London), 1971. [17] M.L. Fisher and R. Jaikumar. A generalized assignment heuristic for solving the vrp. Networks, 11:109–124, 1981. [18] B. A. Foster and D.M. Ryan. An integer programming approach to the vehicle scheduling problem. Operations Research, 27:367384, 1976. [19] T. Gaskell. Bases for vehicle fleet scheduling. Operational Research Quarterly, 18:281–295, 1967. [20] M. Gendreau, A. Hertz, and G. Laporte. A tabu search heuristic for the vehicle routing problem. Management Science, 40:1276–1290, 1994. [21] M Gendreau, G Laporte, and J Potvin. Metaheuristics for the vehicle routing problem. Technical report, Les Cahiers du Gerad, 1998, revised 1999. [22] B.E. Gillett and L.R. Miller. A heuristic algorithm for the vehicle dispatch problem. Operations Research, 22:340–349, 1974. [23] M Haimovich and A H G R Kan. Bounds and heuristics for capacitated routing problems. Mathematics of Operations Research, 10:527–542, 1985. [24] W.R. Hamilton. Memorandum respecting a new system of roots of unity (the icosian calculus). Philosophical Magazine, 12, 1856. [25] J. H. Holland. Adaptation in natural and artificial systems. The University of Michigan Press, 1975. [26] R. Karp. Reducibility among combinatorial problems. In R. Miller and J. Thatcher, editors, Complexity of Computer Computations, pages 85–103. Plenum Press, 1972. [27] T.P. Kirkman. On the representation of polyhedra. Philosophical Transactions of the Royal Society of London Series A, 146:413–418, 1856. [28] G. Laporte, H. Mercure, and Y. Nobert. An exact algorithm for the asymmetrical capacitated vehicle routing problem. Networks, 16:33–46, 1986. [29] G. Laporte and Y. Nobert. Surveys in Combinatorial Optimization, chapter Exact algorithms for the vehicle routing problem. 1987. BIBLIOGRAPHY 67 [30] G. Laporte and F. Semet. Classical heuristics for the vehicle routing problem. Technical report, Les Cahiers du Gerad, 1999. [31] Chee Peng Lim, Lakhmi C. Jain, and Satchidananda Dehuri, editors. Innovations in Swarm Intelligence, volume 248 of Studies in Computational Intelligence. Springer, 2009. [32] Y. Nagata. Edge assembly crossover for the capacitated vehicle routing problem. EvoCOP, LNCS, 4446:142–153, 2007. [33] Road Transport Forum NZ. Road transport forum nz—transport facts. Website. http://www.rtfnz.co.nz/cm-transport-facts.php. [34] I.M Oliver, D.J. Smith, and J.R.C Holland. A study of permutation crossover operators on the traveling salesman problem. Grefenstette—Proceedings of the Second International Conference on Genetic Algorithms and Their Applications, pages 224–230, 1987. [35] I Or. Traveling salesman-type combinatorial problems and their relation to the logistics of regional blood banking. PhD thesis, Evanston, IL: Northwestern University, 1976. [36] I. H. Osman. Metastrategy simulated annealing and tabu search algorithm for the vehicle routing problem. Annals of Operations Research, 41:421–451, 1993. [37] H. Paessens. The savings algorithm for the vehicle routing problem. European Journal of Operational Research, 34:336–344, 1988. [38] Pham, Ghanbarzadeh, Koc, S. Otri, S. Rahim, and M. Zaidi. The bees algorithm. Technical report, 2005. [39] Jean-Yves Potvin. A review of bio-inspired algorithms for vehicle routing. In Bio-inspired Algorithms for the Vehicle Routing Problem, pages 1–34. 2009. [40] M. R. Rao and S. Zionts. Allocation of transportation units to alternative tripsa column generation scheme with out-of-kilter subproblems. Operations Research, 16:52–63, 1968. [41] M. Reimann, M. Stummer, and K. Doerner. A savings-based ant system for the vehicle routing problem. Proceedings of the Genetic and Evolutionary Computation Conference, pages 1317–1325, 2002. [42] J Renaud, F F Boctor, and G Laporte. A fast composite heuristic for the symmetric traveling salesman problem. INFORMS Journal on Computing, 8:134–143, 1996. [43] J. Robinson. On the hamiltonian game (a traveling salesman problem). Research Memorandum RM-303, 1949. [44] F. Robuste, C.F. Daganzo, and R. Souleyrette II. Implementing vehicle routing models. Transportation Research, 24B:263–286, 1990. 68 BIBLIOGRAPHY [45] Stefan Ropke. Heuristic and exact algorithms for vehicle routing problems. PhD thesis, Department of Computer Science, University of Copenhagen (DIKU), 2005. [46] Alexander Schrijver. On the history of combinatorial optimization (till 1960). In Operations Research and Management. Elsevier, 2005. [47] P. Shaw. Using constraint programming and local search methods to solve vehicle routing problems. pages 417–431. 1998. [48] M. M. Solomon. Algorithms for the vehicle routing and scheduling problems with time window constraints. Oper. Res., 35(2):254–265, 1987. [49] E. D. Taillard. Parallel iterative search methods for vehicle routing problems. Networks, 23:661–673, 1993. [50] S.R. Thangiah, K.E. Nygard, and P.L. Juell. Gideon: A genetic algorithm system for vehicle routing with time windows. Proceedings of 7th IEEE Conference on Artificial Intelligence Applications, pages 322–328, 1991. [51] P. Toth and D. Vigo. The granular tabu search (and its application to the vehicle routing problem). Technical report, 1998. [52] Paolo Toth and Daniele Vigo, editors. The vehicle routing problem. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 2001. [53] J. A. G. Willard. Vehicle routing using r-optimal tabu search. Master’s thesis, The Management School, Imperial College, London, 1989. [54] A. Wren and A. Holliday. Computer scheduling of vehicles from one or more depots to a number of delivery points. Operations Research Quarterly, pages 333–344, 1972. [55] P. Yellow. A computational modification to the savings method of vehicle scheduling. Operational Research Quarterly, 21:281–283, 1970.
9cs.NE
An Extreme Learning Machine Approach to Predicting Near Chaotic HCCI Combustion Phasing in Real-TimeI Adam Vaughana,*, Stanislav V. Bohaca a Dept. of Mechanical Engineering, University of Michigan, Ann Arbor, MI 48109, USA arXiv:1310.3567v3 [cs.LG] 5 May 2015 Abstract Fuel efficient Homogeneous Charge Compression Ignition (HCCI) engine combustion timing predictions must contend with non-linear chemistry, non-linear physics, period doubling bifurcation(s), turbulent mixing, model parameters that can drift day-to-day, and air-fuel mixture state information that cannot typically be resolved on a cycle-to-cycle basis, especially during transients. In previous work, an abstract cycle-to-cycle mapping function coupled with 𝜖-Support Vector Regression was shown to predict experimentally observed cycle-to-cycle combustion timing over a wide range of engine conditions, despite some of the aforementioned difficulties. The main limitation of the previous approach was that a partially acausual randomly sampled training dataset was used to train proof of concept offline predictions. The objective of this paper is to address this limitation by proposing a new online adaptive Extreme Learning Machine (ELM) extension named Weighted Ring-ELM. This extension enables fully causal combustion timing predictions at randomly chosen engine set points, and is shown to achieve results that are as good as or better than the previous offline method. The broader objective of this approach is to enable a new class of real-time model predictive control strategies for high variability HCCI and, ultimately, to bring HCCI’s low engine-out NOx and reduced CO2 emissions to production engines. Keywords: non-linear, non-stationary, time series, chaos theory, dynamical system, adaptive extreme learning machine 1. Introduction Since the 1800s, gasoline engines have largely been operated by (1) controlling power output with a throttle that restricts airflow, (2) using a simple spark to control burn timing, and (3) operating close to fuel-air stoichiometry for reliable spark ignition and so catalysts can reduce NOx , HC, and CO emissions. The throttle hurts fuel efficiency with pumping losses (especially at low-load), and the stoichiometric mixtures used are thermodynamically less fuel efficient than mixtures diluted with air or exhaust gases. With the broad availability of enabling technologies (e.g. variable valve timing), a relatively new type of combustion called Homogeneous Charge Compression Ignition (HCCI) has received increased research interest over the past decade. HCCI uses autoignition to burn lean (excess air) mixtures and can produce ultra-low NOx quantities that do not require expensive catalyst aftertreatment. Instead of a spark, combustion timing is controlled by the thermodynamic trajectory of the mixture and complex chemical kinetics. With both ultra-low NOx production and freedom from the stoichiometric shackles of spark igI There are no fundamental changes in this updated version of the original October, 2013 pre-print paper [1]. This version includes algebraic simplifications, minor corrections, and improved body text. * Corresponding author Email addresses: [email protected] (Adam Vaughan), [email protected] (Stanislav V. Bohac) Preprint submitted to Elsevier nition, HCCI achieves greater fuel efficiency through thermodynamically ideal lean mixtures and unthrottled operation. This improved fuel economy, has real-world relevance to near-term sustainability, national oil independence, and greenhouse gas initiatives that seek to curb petroleum usage. The primary challenge of HCCI autoignition is to ensure that the burn timing is synchronized against the motion of the piston. This is important for efficient extraction of mechanical work from the fuel-air mixture and to avoid unsafe, noisy combustion or unstable (near chaotic) combustion oscillations. This synchronization is so important that combustion researchers do not use normal units of time. Instead, they use the angle of the crank, which (1) describes the position of the piston, and (2) represents time because each crank angle takes a certain amount of time at a fixed crank rotation speed. The thermodynamic trajectory of the air-fuel mixture is driven by the piston varying the cylinder volume as function of crank angle (Fig. 1). These angles are measured relative to when the piston is at the top of the cylinder, or Top Dead Center (TDC). In a four-stroke engine, TDC occurs twice per cycle. In different regions, the piston may be compressing or expanding the mixture, or, if a valve is open, moving the mixture into or out of the intake or exhaust manifolds. Highlighted on the cylinder volume curve are two regions, one for when the exhaust valve is open and the other for when the intake valve is open. Note that the two May 7, 2015 Cylinder Pressure (P) Cylinder Volume to as high Cyclic Variability (CV) and it severely constrains the available load limits of HCCI. CA50n+1 function( CA90n , …) = CA50n+1 CA90n Mean pressures from air and residual gases 1.1. Motivation and goals A primary constraint for HCCI is the need to keep combustion timing between the ringing and combustion stability limits [12]. At the ringing limit, excessive pressure rise rates are encountered, and at the stability limit, high CV in combustion timing is observed [12]. Since these limits play a key role in constraining HCCI’s usable operating range, it is desirable to explore new methods to predict the behavior at and beyond these constraints. In particular, the ability to predict and correct for high CV might enable the use of late phased combustion to mitigate the excessive pressure rise rates that currently constrain HCCI’s highload operation [13], while also potentially addressing the high CV experienced at low-load. Towards the end goal of expanding the HCCI load envelope, this paper builds on previous work [6] by describing a new online adaptive machine learning method that enables fully causal cycleto-cycle combustion timing predictions across randomly chosen engine set point transients that include both the stable and near chaotic bifurcation behavior. Start of fuel injection timing Quantity of fuel PNVO 330º to 358º PEVO PIVC -50º to -30º 55º to 75º 48 milliseconds at 2,500 RPM Exhaust partially out -180 0 TDC NVO 180 360 TDC 540 Crank angle [°CA] Air in 720 TDC 900 Figure 1: A schematic of key engine cycle variables. valve events are separated by a number of crank angle degrees, termed Negative Valve Overlap or NVO. Unlike conventional engines, NVO prevents some of the hot exhaust gases from leaving the cylinder (typically 20-60% [2, 3]). This stores “residual gases” for the next cycle, offering a practical way to raise the mixture temperature to ensure HCCI autoignition [4]. By changing the amount of NVO, one can affect the mixture temperature and dilution and ultimately control the chemical kinetics behind combustion timing. Temperature and dilution work in opposite directions, but typically temperature dominates [5]. NVO is not instantly adjustable with common variable valve timing systems, and the reader is cautioned that many researchers publish results with fully variable (lift and timing) electric or hydraulic valve actuation systems that are expensive to implement in production engines. The use of NVO residual gases introduces strong cycleto-cycle coupling on top of the already non-linear chemistry and physics that occur throughout a complete engine cycle [6]. Further compounding the issues with residual gases is that neither the airflow to the cylinder(s) nor the quantity of residual gases in the cylinder can be accurately resolved before a burn happens on a cycle-to-cycle (not mean value) basis with commonly available sensors, especially during transients. Beyond residual gas influences, there are also complex secondary influences on combustion behavior such as turbulent mixing, manifold resonance effects, combustion deposits, different varieties of fuel and even ambient temperature variations [7, 8]. While HCCI is already a significant challenge given the above complexity, the combustion mode also exhibits a period doubling bifurcation cascade to chaos [6, 9, 10], similar to what is seen in high residual spark ignition engines [11]. When nearly chaotic, HCCI is still deterministic, but becomes oscillatory and very sensitive to parameter variations (e.g. residual gas fraction fluctuations [9, 10]). This oscillatory “stability limit” behavior is commonly referred 1.2. Experimental Observations In the authors’ previous publication [6], an abstract mapping function for engine combustion was created within the framework of a discrete dynamical system: 𝑛𝑒𝑥𝑡 𝑐𝑜𝑚𝑏𝑢𝑠𝑡𝑖𝑜𝑛 = 𝑓 𝑢𝑛𝑐𝑡𝑖𝑜𝑛( 𝑝𝑟𝑒𝑣𝑖𝑜𝑢𝑠 𝑐𝑜𝑚𝑏𝑢𝑠𝑡𝑖𝑜𝑛, 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟𝑠) (1) This simple abstraction is intended to convey a conceptual understanding of the experimental cycle-to-cycle behavior seen in Fig. 2’s return maps. These return maps show the experimentally observed combustion timing for a given cycle 𝑛 along the abscissa and the next cycle 𝑛 + 1 along the ordinate under random engine actuator set points [6]. The value CA90 is the time in Crank Angle Degrees (∘ CA) where 90% of the fuel’s net heat release is achieved, and thus measures the timing of the end of the burn in relation to piston’s position as the crank rotates.1 The reader should note that there is structure to the cycle-to-cycle behavior despite the random actuator set points used to generate Fig. 2. This structure shows a deterministic transition to oscillatory high CV behavior as combustion moves towards later combustion timing that can be viewed as at least a single period doubling bifurcation with sensitive dependence on the engine set point [6, 9, 10]. While mathematically interesting, this oscillatory high CV structure undesirably constrains practical HCCI engine operation. A more thorough description of these data is provided in [6]. 1 While it is not shown here, there is similar structure in the CA10 and CA50 percent burn metrics, although less pronounced (especially in CA10, see [6]). 2 −4 CA50 CA10 15 0 −15 −15 45 0 15 30 CA10 n [°ATDC] 45 (a) Cyl. 1 High CV −5 −15 −15 −3 45 −4 next = function(previous) 0 15 30 CA90 n [°ATDC] 45 (c) Cyl. 3 CA90 n+1 CA90 n+1 45 (b) Cyl. 2 −5 “predictive” in the sense that when injected with random (i.e. unpredictable) noise could it generate a qualitative return map shape similar to what is seen experimentally. Time series predictions were not shown, only a cloud of possible combustion timings ranging from stable to oscillatory. This fact was highlighted in an extension of the work [18] that again used random residual noise because “the actual time series of disturbances to the experiments are unknown.” That said, these models are useful for showing that a period doubling cascade to chaos driven by residual gas fraction can explain the observed high CV behavior. In the context of the above, machine learning provides a computationally efficient way to capture complex combustion patterns while simultaneously avoiding explicit knowledge of the underlying mixture state and composition (provided an appropriate abstract mapping function is chosen). While there are clearly benefits to this machine learning approach, a key issue is that machine learning is data driven, and relatively large quantities of data are needed to adequately cover large dimensional spaces. As shown conceptually in Fig. 3, these high dimensional data might be viewed as a “porcupine” [19]. Each engine operating condition might be viewed as a “quill” of Eq. 2’s six-dimensional “porcupine,” and machine learning algorithms know nothing about the ideal gas law or chemical kinetics, so their ability to extrapolate between “quills” is limited, especially when provided sparse data. Previous work [6] used a random sampling of cycle time series for training to ensure the data driven model had data to fit the “quills,” and then assessed the model’s ability to predict on the remaining (randomly chosen) cycles. Thus, the training dataset was partially acausual and that the model itself wasn’t shown to adapt to new conditions. −3 15 −5 −15 −15 −3 45 −4 0 15 30 CA90 n [°ATDC] 45 (d) Cyl. 4 −5 −3 30 15 −4 0 CA90 n+1 CA90 n+1 45 0 30 −15 −15 0 15 30 CA50 n [°ATDC] 30 15 −15 −15 −4 0 30 0 15 15 −4 0 0 15 30 CA90 n [°ATDC] 45 −5 −15 −15 0 15 30 CA90 n [°ATDC] 45 −5 Figure 2: Return map probability histograms of CA90 generated from 129,964 cycles and 2,221 random engine set points. Outliers are omitted and total only ∼3% of the data. The colormap is 𝑙𝑜𝑔10 to show order of magnitude differences. [6] 1.3. Modeling Approaches In [6], a skeletal functional form for the abstract mapping function was built out using measurable quantities, thermodynamics, and known correlations. Then, unlike the physics-based approaches that are usually discussed in the engine literature, the machine learning technique of 𝜖-Support Vector Regression (𝜖-SVR) was combined with the abstract functional form to provide quantitative predictions. The primary motivation for this machine learning approach was not that existing chemical kinetics with Computational Fluid Dynamics (CFD) cannot capture engine behavior (see [14] and gasoline mechanism validation [15]) but that the methods are: Six-dimensional offline mapping function fit with original β0 ∙ Too computationally intensive for real-time predictions. ∙ Subject to experimental uncertainties in the cycleto-cycle (not mean value) mixture state and composition. Online adaptation to move between the “quills” and also adjust for parameter variation with updated β1 Figure 3: High dimensional data might be viewed conceptually as a “porcupine” [19]. The primary goal of this paper is to design an online adaptive algorithm to fit new data between the “quills.” As a point of reference, the simulation time of a 2,500 RPM, 48 millisecond engine cycle is measured in ∼day(s) for a single core of a modern computer. At the other computational complexity extreme, loworder approximation models of HCCI for control have been developed since at least the early 2000s [16], based on spark ignition engine knock models developed in the 1950s [17]. Recently, efforts have been made to extend this type of model to the high CV regions of HCCI by injecting random residual gas fraction noise to capture uncertainties in the mixture state and composition [10]. This model was tuned for a limited set of steady-state conditions and only 1.4. Contribution The primary contribution of this work is the development of a new online learning method to provide real-time adaptive, fully causal predictions of near chaotic HCCI combustion combustion timing. This method, called Weighted Ring - Extreme Learning Machine (WR-ELM), 3 enables robust online updates to an Extreme Learning Machine (ELM) model that is trained to fit the “quills” of offline data. WR-ELM is developed in this work as a weighted least squares extension to Online Sequential - ELM [20]. While developed independently, a similar derivation is available in [22]. The difference between this work and the classification application in [22] is the use of a ring buffer data structure “chunk” for online updates to an offline trained regression model. The data in the WR-ELM ring buffer can be weighted more heavily than the data originally used to fit the offline model. This allows emphasis to be placed on recent measurements that might be between the “quills” of Fig. 3’s offline trained model or the result of day-to-day engine parameter variation. Thus, this approach allows one to prescribe a partitioned balance between the offline model fit against the need to adapt to the most recent conditions. It also explicitly avoids over adaptation to the local conditions (that could compromise global generality) by “forgetting” old ring buffer data that eventually exit the buffer. Fig. 4 gives a schematic representation of this approach. 2. Methods 2.1. Mapping Function Modifications In previous work [6], engine combustion was abstracted to the following mapping function: 𝐶𝐴50𝑛+1 = 𝑓 𝑢𝑛𝑐𝑡𝑖𝑜𝑛( 𝐶𝐴90𝑛 , 𝑇 𝐼, 𝑆𝑂𝐼, 𝑃𝐼𝑉 𝐶 , 𝑃𝐸𝑉 𝑂 , 𝑃𝑁 𝑉 𝑂 ) (2) where 𝑛 is the cycle iteration index, CA50 is the time in ∘ CA where 50% of net heat release has occurred, CA90 is the time in ∘ CA when 90% of net heat release has occured, 𝑇 𝐼 is the injection pulse width in milliseconds, 𝑆𝑂𝐼 is Start of Injection in ∘ CA Before Top Dead Center (∘ BTDC), and the pressure variables measurements are mean pressures during specific regions of the combustion cycle (see Fig. 1).2 Details of the simplified net heat release algorithm are available in [6]. Fuel rail pressure is constant; however, the reader should note that the pressure drop to cylinder pressure during NVO injections varies with each transient step and during high CV regions. The cylinder pressure variables 𝑃𝐼𝑉 𝐶 , 𝑃𝐸𝑉 𝑂 , and 𝑃𝑁 𝑉 𝑂 were chosen to capture cycle-to-cycle residual coupling and air flow without the difficulties of explicitly modeling those quantities. To meet real-time engine controller timing requirements, 𝑃𝐼𝑉 𝐶 and 𝑃𝑁 𝑉 𝑂 have been modified from [6]. 𝑃𝐼𝑉 𝐶 has been moved to the previous cycle, and the range of 𝑃𝑁 𝑉 𝑂 ’s mean has been shortened. 𝑃𝐼𝑉 𝐶 has also been moved closer to TDC to take advantage of the inherent signal amplification provided by the compression process. The subscripts IVC, EVO, and NVO refer to the general timing regions Intake Valve Close, Exhaust Valve Open, and Negative Valve Overlap, respectively. You want to predict the future output CA50n+2 … and you have the input vector xn+1 Cycle timeline: n-8 n-7 forget n-6 n-5 n-4 n-3 n-2 n-1 n n+1 n+2 Weighted ring buffer of previous input-output data pairs Figure 4: A schematic of overview WR-ELM. 2.2. WR-ELM Overview Other differences from [20, 22] are that the derivation below lacks a bias vector 𝑏, uses the Gaussian distribution for a, drops the unnecessary logistic function exponential negative, and uses a Padé approximant for 𝑒𝑥𝑝(𝑥). It was found empirically that the computation of the bias 𝑏 addition step could be removed with no loss of fitting performance if a’s elements were drawn from the Gaussian distribution 𝒩 (0, 1). ELM theory only requires the distribution to be continuous [21], although the ability to remove the bias is likely problem specific. The primary benefits of an ELM approach over the 𝜖-SVR method used in [6] are: 2.3. WR-ELM Core Algorithm The basic goal of an Extreme Learning Machine (ELM) is to solve for the output layer weight vector 𝛽 that scales the transformed input H to output T: ∙ An ELM is easily adapted to online adaptation [20]. ∙ An ELM provides good model generalization when the data are noisy [21]. H𝛽 = T ∙ An ELM is extremely computationally efficient [20, 21]. (3) where H is the hidden layer output matrix of a given input matrix and T is the target vector. ̃︀ neurons For a set of 𝑛 input-output data pairs and 𝑁 at the 𝑛th cycle timestep, these variables are given by ⎡ ⎤ 𝐺(a1 , x1 ) . . . 𝐺(a𝑁̃︀ , x1 ) ⎢ ⎥ .. .. .. H(a, x) = ⎣ (4) ⎦ . . . 2 Since CA90 is a stronger indicator of the oscillatory behavior seen in Fig. 2, it is used as the model input. CA50 is more commonly encountered in the engine literature and is thus used as the model output. The two are related quantities, and in terms of model fit statistics there was no significant benefit of using one over the other. That said, a few isolated instances were observed where CA90 did a better job predicting large oscillations. 𝐺(a1 , x𝑛 ) . . . 4 𝐺(a𝑁̃︀ , x𝑛 ) ̃︀ 𝑛×𝑁 where 𝐺(a𝑖 , x) is the neuron activation function, chosen to be a commonly used logistic function, but without the unnecessary negative: 𝐺(a𝑖 , x) = 1 . 1 + 𝑒𝑥𝑝(x · a𝑖 ) The solution can then be split between an offline and online “chunk” of recent input-output data pairs to avoid both the computational and storage burden of using offline data directly. To do this, the matrices are partitioned with subscript 0 and 1 denoting the offline and online updated components, respectively: [︂ ]︂ [︂ ]︂ H0 W0 0 H= W= H1 𝑛×𝑁̃︀ 0 W1 𝑛×𝑁 [︂ ]︂ (13) T0 T= . T1 𝑛×1 (5) Using a random input weight vector a𝑖 that is composed of random variable (r.v.) samples from a Gaussian distribution for each of the 𝑧 input variables gives ⎤ ⎡ 𝑟.𝑣. ∼ 𝒩 (0, 1) ⎥ ⎢ .. . (6) a𝑖 = ⎣ ⎦ . 𝑟.𝑣. ∼ 𝒩 (0, 1) Then, following a similar derivation in [20] for recursive least squares but adding the weight matrix, the inversion portion H⊤ WH of the weighted normal equations Eq. 12 can be re-written in terms of K0 and K1 : 𝑧×1 ̃︀ The use of a random a𝑖 that is re-sampled for each of the 𝑁 individual neurons during initialization is the main difference of an Extreme Learning Machine versus conventional neural networks that iteratively train each a𝑖 [21]. These a𝑖 vectors can then be collected into a single input weight matrix a, which is held fixed across all 𝑛 input row vectors x x= (7) [𝐶𝐴90𝑛 𝑇 𝐼 𝑆𝑂𝐼 𝑃𝐼𝑉 𝐶 𝑃𝐸𝑉 𝑂 𝑃𝑁 𝑉 𝑂 ]𝑛×𝑧 K1 = = H⊤ WH [︂ ]︂⊤ [︂ ]︂ [︂ ]︂ H0 W0 0 H0 = H1 0 W1 H1 [︂ ]︂ [︂ ]︂ [︀ ]︀ W0 0 H0 ⊤ = H⊤ H 0 1 0 W 1 H1 [︂ ]︂ [︀ ]︀ H0 ⊤ = H⊤ W H W 0 1 0 1 H1 and 𝑛 output values [︀ ]︀ T = 𝐶𝐴50𝑛+1 𝑛×1 . (8) ⊤ = H⊤ 0 W0 H0 + H1 W1 H1 = K0 + H⊤ 1 W1 H1 . While the above logistic works well, one modification improves the computational efficiency on processors without a dedicated 𝑒𝑥𝑝(𝑥) instruction, such as the Raspberry R Pi○ . The modification is to replace the exponential with the following Padé approximant: 2 𝑒𝑥𝑝(𝑦) ≈ 𝑝(𝑦) = The non-inverted portion of the normal equations can similarly be re-written using existing relations: H⊤ WT = [︂ ]︂⊤ [︂ ]︂ [︂ ]︂ H0 W0 0 T0 = H1 0 W1 T1 [︂ ]︂ [︂ ]︂ [︀ ⊤ ]︀ W0 0 T0 ⊤ = H0 H1 0 W1 T1 [︂ ]︂ [︀ ⊤ ]︀ T0 ⊤ = H0 W0 H1 W1 T1 3 120 + 60𝑦 + 12𝑦 + 𝑦 , 120 − 60𝑦 + 12𝑦 2 − 𝑦 3 (9) which has the following simple logistic relations: 1 1 (120 + 12𝑦 2 ) − 60𝑦 − 𝑦 3 ≈ = (10) 1 + 𝑒𝑥𝑝(𝑦) 1 + 𝑝(𝑦) 2 · (120 + 12𝑦 2 ) The small number of floating point operations used, reused intermediate terms, known boundedness of the normalized inputs, and known a weights make this approximant work well in this application. No significant degradation in model performance was found, and as such it is used in all implementations described hereafter. The normal equations can then be used to solve for the least squares solution 𝛽 of Eq. 3 with 𝛽 = (H⊤ H)−1 H⊤ T . = = = (15) ⊤ H⊤ 0 W0 T0 + H1 W1 T1 ⊤ ⊤ K0 K−1 0 H0 W0 T0 + H1 W1 T1 K0 𝛽 0 + H⊤ 1 W1 T1 (︁ )︁ ⊤ = K1 − H⊤ 1 W1 H1 𝛽 0 + H1 W1 T1 ⊤ = K1 𝛽 0 − H⊤ 1 W1 H1 𝛽 0 + H1 W1 T1 . Substituting Eq. 15 into the full online solution (11) 𝛽1 = )︁ (︀ )︀ (︁ ⊤ = K−1 H WT 1 To extend this to a weighted least squares solution, one can incorporate a diagonal weight matrix W to the normal equations [23]: 𝛽 = (H⊤ WH)−1 H⊤ WT . (14) ⊤ −1 ⊤ = 𝛽 0 − K−1 1 H1 W1 H1 𝛽 0 + K1 H1 W1 T1 ⊤ = 𝛽 0 + K−1 1 H1 W1 (T1 − H1 𝛽 0 ) (12) 5 (16) A = P0 H ⊤ 1 , B = H1 A (︀ −1 )︀−1 𝛽 1 = 𝛽 0 + A W1 + B (T1 − H1 𝛽 0 ) yields the online solution without the need for the offline ̃︀ × 𝑁 ̃︀ dataset. To trade the computational burden of the 𝑁 sized K inverse for an inverse that scales with a smaller sized ring buffer, one can let P = K−1 (︁ )︁−1 ⊤ P0 = K−1 (17) 0 = H0 W0 H0 )︁−1 (︁ ⊤ −1 (18) P1 = K−1 1 = P0 + H1 W1 H1 ONLINE PREDICTIONS CA50𝑛+2 = T𝑛+1 = H(a, x𝑛+1 )𝛽 1 P1 = ⊤ −1 P0 − P0 H⊤ 1 W1 + H1 P0 H1 )︁−1 (19) H1 P0 . Unlike OS-ELM and WOS-ELM [20, 22], additional simplification is possible because the WR-ELM algorithm does not propagate P1 in time. To begin, append the ⊤ H⊤ 1 W1 portion of Eq. 16 to Eq. 19 and distribute H1 to give: P1 H ⊤ 1 W1 = [︂ )︁−1 (︁ −1 ⊤ ⊤ W + H P H − P H P0 H ⊤ 1 0 0 1 1 1 1 ]︂ ·H1 P0 H⊤ 1 W1 . 2.4. Usage procedure 1. Scale x and T columns between zero and unity for each variable. For the combustion implementation, column variable values below the 0.1% and above the 99.9% percentile were saturated at the respective percentile value, and then normalized between zero and unity between these percentile based saturation limits. This was done to both adequately represent the distribution tails and avoid scaling issues. 2. The random non-linear transformation that enables the low computational complexity of the WR-ELM algorithm may result in ill-conditioned matrices. All numerical implementations should use double precision. Additionally, one should consider using Singular Value Decomposition for ill-conditioned matrix inversions. 3. Using the 𝒩 (0, 1) Gaussian distribution, initial̃︀ ELM input weights a and hold ize the 𝑧 × 𝑁 them fixed for all training / predictions. For the combustion implementation, this was done with R MATLAB○ ’s built-in 𝑟𝑎𝑛𝑑𝑛() function and the Mersenne Twister pseudo random number generator ̃︀ of 64 was used based with seed 7,898,198. An 𝑁 on initial trials, and each cylinder’s individually computed WR-ELM model used an identical input weight matrix a. 4. Build H0 (a, x0 ) from previously acquired samples that cover a wide range of conditions with Eq. 4 using an input matrix x0 and output target vector T0 (the formats of these are given in Eqs. 7 and 8, respectively). For the combustion implementation, the initial training data were ∼40 minutes of random engine set points covering 53,884 cycles and 1,179 random engine set points at a single engine speed; however, it appears that only ∼20 minutes of data may be sufficient. Pruning the training data to only (20) Eq. 20 can then be simplified with the substitutions A = P0 H⊤ 1 , B = H1 A and then distributing W1 to provide: P1 H ⊤ 1 W1 = [︁ ]︁ (︀ −1 )︀−1 A W1 − W1 + B BW1 . (21) Transforming Eq. 21 with the identity (X + Y)−1 Y = X−1 (X−1 + Y−1 )−1 [24] gives: P1 H ⊤ 1 W1 = [︁ ]︁ (︀ )︀−1 A W1 − W1 W1 + B−1 W1 . (22) Eq. 22 is then in a form where the identity X − X(X + Y)−1 X = (X−1 + Y−1 )−1 [24] can be applied to yield a substantially simpler form with a ring buffer sized inverse: (︀ −1 )︀−1 P1 H ⊤ . 1 W1 = A W1 + B (23) −1 ⊤ Finally, noting that P1 H⊤ 1 W1 = K1 H1 W1 , one can then substitute Eq. 23 into Eq. 16 and arrive at the following algorithm summary: OFFLINE TRAINING [︂(︁ )︁−1 ]︂ ⊤ P0 = H0 W0 H0 ̃︀ ×𝑁 ̃︀ 𝑁 𝛽0 = [︁ P0 H⊤ 0 W0 T0 (26) The reader should note that only P0 and 𝛽 0 are needed for online adaptation, and the size of these matrices scales ̃︀ . None of only with an increasing number of neurons 𝑁 the original offline data are needed. Additionally, note that Eq. 26 is simply the reverse of Eq. 3 with the most recent x𝑛+1 cycle vector and 𝛽 1 updated from the weighted ring buffer. Finally, it should mentioned that the resulting update law Eq. 25 is structurally similar that of the steady-state Kalman filter [23], which also uses recursive least squares. Future work should look at applying Kalman filtering algorithm improvements (e.g. square root filtering) to WR-ELM. and use the matrix inversion lemma on Eq. 18 to yield: (︁ (25) (24) ]︁ ̃︀ ×1 𝑁 ONLINE ADAPTATION 6 include ∼6 cycles before and ∼9 cycles after a transient set point step provided a small model fitting performance improvement. 5. Specify a weight matrix W0 for offline measurements. For the combustion implementation, a simple scalar value W0 = 3.5 × 10−3 was chosen using a design of experiments. While this weight works well as a proof of concept, future work should more rigorously determine the weight(s), perhaps with optimization techniques. Note that W0 allows weighting to be applied offline and that a small offline weighting is equivalent to a large online weighting. 6. Solve for the offline solution P0 and 𝛽 0 using Eqs. 24 and hold these values constant for all future predictions. 7. Populate a ring buffer of size 𝑟 with recently completed input-output pairs using: ⎤ ⎡ x𝑛−𝑟+1 input ⎥ ⎢ = x1 = ⎣ ... ⎦ ring buffer x𝑛 𝑟×𝑧 (27) ⎡ ⎤ 𝐶𝐴50𝑛−𝑟+2 output ⎢ ⎥ .. = T1 = ⎣ . ⎦ . ring buffer 𝐶𝐴50𝑛+1 𝑟×1 was solved at an average rate of 1.1 𝜇𝑠 per combustion R cycle per cylinder on an Intel○ i7 860 2.8 GHz desktop R computer running Gentoo GNU/Linux○ . The online predictions from Eqs. 25, 27, and 26 were recast into a 𝑝𝑎𝑟𝑓 𝑜𝑟 loop that automatically parallelized the code across four worker threads to provide predictions at an average rate of 66 𝜇𝑠 per combustion cycle per cylinder. This level of performance is more than adequate for real-time. Although algorithm development is the main focus of this paper, a real-time implementation of the WRELM algorithm has been built using custom, 18-bit RaspR berry Pi○ data acquisition hardware. A two-minute video demonstrating both predictions and control is available at [25]. The software for this system is comprised of: Then execute the WR-ELM update algorithm between combustion cycle 𝑛 + 1 and 𝑛 + 2 as shown in Fig. 4. For the combustion implementation, 𝑟 was taken to be 8 cycles after tuning with existing datasets. If desired, 𝑟 can vary cycle-to-cycle. As with the offline data, build H1 (a, x1 ) with Eq. 4 using an input matrix x1 and output target vector T1 . Specify a weight matrix W1 . For the combustion implementation the identity matrix (W1 = I) was chosen since weighting was already applied to the offline data in step 5. Gradually increased weighting on the most recent time steps in the ring buffer was explored; however, it did not net a significant improvement to model fitting performance over a simple scalar value on offline data. Although not explored in the current implementation, W1 can vary cycle-to-cycle. Solve for the updated 𝛽 1 solution using Eqs. 25. After cycle 𝑛 + 1’s input vector x𝑛+1 is fully populated, transform vector into H𝑛+1 using Eq. 4 and solve for a predicted target value T𝑛+1 or CA50𝑛+2 using Eq. 26. Repeat steps 7-10 for each new time step, caching results (e.g. hidden layer outputs) from previous time steps to reduce computational requirements. R ∙ A multi-threaded Linux○ user space application that runs heat release calculations and WR-ELM. This software leverages the Eigen C++ matrix library and a custom assembly code matrix multiply3 for the Raspberry Pi 1’s VFPv2 double precision floating point unit. Asynchronous fasync notification is used for specific crank angle events published from the FIQ code to synchronize the user space software’s execution against the crank’s rotation. 8. 9. 10. 11. R kernel with mi∙ A PREEMPT RT patched Linux○ nor patches to completely disable Fast Interrupt reQuest (FIQ) usage by the USB driver. ∙ ARM assembly code for high-speed pressure data acquisition using the FIQ (up to ∼240 kilosamples per second, total all cylinder channels). R ∙ A C code Linux○ kernel module that contains the FIQ assembly code with page-based memory allocation and standard mmap, ioctl, and fasync hooks to R user space. Linux○ ∙ A low-priority second user space thread that uses standard WebSockets from the libwebsockets C code library to stream processed data to a web-based user interface coded in JavaScript with the d3.js library. R ∙ A minimal Raspbian GNU/Linux○ distribution [26]. After the adaptation routine is run, it is possible to perform 11 model predictive control predictions within a worst case task context switch and calculation latency window of ∼300 𝜇𝑠. This level of real-time performance is needed to ensure control authority with the 𝑆𝑂𝐼 actuator immediately after 𝑃𝑁 𝑉 𝑂 is measured. 2.6. Experimental Setup Table 1 provides a summary of the experimental setup and conditions visited. In-cylinder pressure was acquired 2.5. Real-Time Implementation R A collection of unoptimized MATLAB○ software routines was developed using the techniques described in the previous sections. The offline solution provided by Eqs. 24 3 This code was benchmarked to be 29% faster than OpenBLAS’s VFPv2 GEneric Matrix Multiply (GEMM) and 126% faster than Eigen C++. 7 on a 1.0 ∘ CA basis and pegged thermodynamically for each cycle after IVC using a polytropic exponent of 1.35. This exponent was chosen to most closely match the pegging results achieved using the single intake runner high speed pressure sensor on cylinder 1. For the purpose of computing cycle-to-cycle net Indicated Mean Effective Pressure (IMEP), a cycle was defined as starting at 360 ∘ BTDC firing and ending at 359 ∘ ATDC firing. The reference cam lift for timing and duration in Table 1 is 0.5 mm. The airfuel ratio range indicated in Table 1 was measured postturbine, and represents a mixture from all four cylinders. Fuel mass per cycle was estimated using the fuel’s lower heating value, assuming that the gross heat release was 20% greater than the net heat release, and that the combustion efficiency was 100%. with 𝑆𝑂𝐼 fixed is only used as part of Fig. 2, and not during the model training and testing presented here. Total cycle counts are reported after outliers are removed. The outlier criteria (detailed in [6]) are intended to remove misfires and partial burns. These criteria are fairly permissive and remove only ∼3% of the data. The offline solution was trained using ∼40 minutes of test cell time covering 53,884 cycles and 1,179 random engine set points at 2,500 rpm (two random subsequences). These subsequences are comprised of random, transient set point steps occurring approximately every 0.5 - 10 seconds with occasional misfires covering the nominal variable ranges given in Table 1. The training data were pruned to only include 6 cycles before and 9 cycles after a transient set point step for a small model fitting performance improvement. The online solution was run with a separate random subsequence and fed unseen cycles one-by-one, similar to what would be experienced in a real-time implementation. This online dataset is comprised of 25,323 consecutive cycles with 521 random engine set points. Longer online sequences were also tested, and achieved similar results. 2.7. Dataset Description The full collection of 129,964 cycles is comprised of five ∼20 minute random test subsequences. Each random subsequence covers the same nominal ranges listed in Table 1; however, one subsequence holds 𝑆𝑂𝐼 fixed. The sequence Table 1: Experimental setup and test conditions 3. Results and Discussion Engine The fitting performance on a 25,323 cycle dataset (excluding outliers as defined in [6]) is shown in Table 2 and in Figs. 5, 6, and 7. The minimum coefficient of determination (𝑅2 ) given in Table 2 shows that at least 80% of the cycle-to-cycle variance can be explained by the model as it is currently defined for a dataset with random transient steps occurring approximately every 0.5 - 10 seconds and occasional misfires. This is better than the 76% achieved with 𝜖-Support Vector Regression (𝜖-SVR) on the same dataset in [6]. However, this is not a 1:1 comparison because WR-ELM is fully predicting the entire 25,323 cycle dataset, whereas 𝜖-SVR’s training strategy ensured the data-driven model had partially seen the operating points it was trying to predict. Steady-state Root Mean Squared Error (RMSE) in Table 2 was assessed at a single set point with a mean CA50 of 3.9 ∘ ATDC and a net Indicated Mean Effective Pressure (IMEP) of 2.8 bar before the transient sequence started. Make / model GM / LNF Ecotec Cylinder layout in-line 4 Overall displacement 2.0 L Bore / stroke 86 / 86 mm Geometric compression ratioa 11.2 : 1 Cam lifta 3.5 mm Cam durationa 93 ∘ CA Cam phaser type hydraulic Fuel injector type direct, side mounted, wall guided Fuel Designation Haltermann HF0437, EPA Tier II EEE Description U.S. Federal Emission Cert. Gasoline Research Octane Number 97.0 Motor Octane Number 88.1 ASTM D240 heating value 42.8 MJ / kg Aromatic / olefin / saturate fractions 28 / 1 / 71 % volume Test conditions Throttle position Turbocharger Supercharger Residual retention strategy IVO set point rangeb EVC set point rangeb 𝑆𝑂𝐼 set point rangeb 𝑇 𝐼 set point rangeb Net IMEP values visitedb Air-fuel ratios visitedb Estimated fuel per cycleb Intake runner temps., all cyls. Fuel injection pressure Coolant temperature Engine speed wide open wastegate open bypassed negative valve overlap 78.6 / 128 ∘ ATDC -118 / -83.0 ∘ ATDC 272 / 378 ∘ BTDC 0.582 / 1.01 ms 1.85 / 3.62 bar 0.90 / 1.6 6 / 11 mg 𝜇 = 52.6 ∘ C, 𝜎 = 1.6 ∘ C 𝜇 = 70.0 bar, 𝜎 = 0.85 bar 𝜇 = 89.5 ∘ C, 𝜎 = 3.4 ∘ C 𝜇 = 2, 500 RPM, 𝜎 = 6 RPM Table 2: WR-ELM model of Eq. 2 error statistics Cylinder # 1 2 3 4 c a b Overall𝑐 𝑅2 0.81 0.81 0.80 0.83 Overall RMSE [∘ CA] 1.85 2.06 2.17 1.64 Steady-State RMSE [∘ CA] 0.84 0.97 0.97 0.86 25,323 consecutive cycles with random transient steps occurring approx. every 0.5 - 10 sec. and occasional misfires. Modified from stock engine First to 99th percentile 8 µ = 0.3 σ = 1.8 1500 0 −8 −6 −4 −2 0 2 4 6 8 CA50 model error [deg] (c) Cyl. 3 4500 µ = 0.3 σ = 2.2 3000 1500 0 −8 −6 −4 −2 0 2 4 6 8 CA50 model error [deg] 4500 Frequency [# of cycles] 3000 (a) Cyl. 1 Frequency [# of cycles] Frequency [# of cycles] Frequency [# of cycles] 4500 3000 (b) Cyl. 2 under predicted and that the positive bias is largely from the midrange values of CA50. Fig. 7a-d shows the cycleto-cycle time series predictions, which can be computed as early as 358 ∘ BTDC firing. Missing segments are the outliers described earlier. Fig. 7e-h provide qualitative insight into the model’s 𝛽 1 weights under online adaptation. The neurons are sorted by the 2-norm of their respective input weight vector a𝑖 . The same non-linear transformation specified by a is used for each cylinder, and any cylinderto-cylinder differences in the cycle-to-cycle 𝛽 1 are due to different characteristics of each cylinder. Fig. 7i shows the IMEP and Fig. 7j-l shows the random engine actuator inputs that are driving each engine set point transient. The model predictions of Fig. 7a-d generally show good agreement; however, there are occasional tracking errors. It is unclear what the source of these tracking errors is (e.g. is it a fundamental model limitation, the need for more inputs,4 the influence of other misfiring cylinders going through a harsh reignite, the need for more weight tuning or offline training data, or perhaps something else?). Future work will try to answer these questions. Overall, however, the authors believe the level of fit shown in Table 2 and in Figs. 5, 6, and 7 is very good considering that the dataset includes both transients and operating points with high CV, right up to complete engine misfire. µ = 0.4 σ = 2.0 1500 0 −8 −6 −4 −2 0 2 4 6 8 CA50 model error [deg] (d) Cyl. 4 4500 µ = 0.2 σ = 1.6 3000 1500 0 −8 −6 −4 −2 0 2 4 6 8 CA50 model error [deg] Figure 5: Error histograms for WR-ELM model of Eq. 2 across 25,323 consecutive cycles with random transient steps occurring approx. every 0.5 - 10 seconds and occasional misfires. (a) Cyl. 1 CA50 20 10 0 −10 30 Model predicted Model predicted 30 20 10 0 −10 −20 −20 −10 0 10 20 30 Measured [°ATDC] 20 4. Summary and Conclusion 10 This work presents a new online adaptation algorithm named Weighted Ring - Extreme Learning Machine. The approach uses a weighted ring buffer data structure of recent measurements to recursively update an offline trained Extreme Learning Machine solution. It is shown that WRELM can be used to approximate the combustion mapping function developed in [6] and provide reasonably accurate, causal predictions of near chaotic combustion behavior. In the combustion application only in-cylinder pressure and crank encoder sensors are needed for predictions, and these predictions can be computed as early as 358 ∘ BTDC firing. The algorithm is fast, and has been implemented in R real-time on the low-cost Raspberry Pi○ platform (a twominute video demonstrating this is available at [25]). Future work will explore optimal selection of weight(s) and try to better understand the situations that lead to the occasional model tracking errors. Finally, the broader objective of this new modeling approach is to enable a new class of cycle-to-cycle model predictive control strategies that could potentially bring HCCI’s low engine-out NOx and reduced CO2 emissions (higher fuel efficiency) to production gasoline engines. 0 −10 −20 −20 −10 0 10 20 30 Measured [°ATDC] (d) Cyl. 4 CA50 30 Model predicted Model predicted −20 −20 −10 0 10 20 30 Measured [°ATDC] (c) Cyl. 3 CA50 30 (b) Cyl. 2 CA50 20 10 0 −10 −20 −20 −10 0 10 20 30 Measured [°ATDC] Figure 6: Predicted versus measured WR-ELM model of Eq. 2 across 25,323 consecutive cycles with random transient steps occurring approximately every 0.5 - 10 seconds and occasional misfires. Late combustion timing is under predicted, but almost all prediction outliers capture the correct directionality. Fig. 5 shows the distribution of model errors. It is clear that there is a slight positive bias to the predictions. Fig. 6 provides insight into the tails of Fig. 5 and shows that model errors still generally capture the correct directionality. Fig. 6 also shows that late combustion timing is 4 Adding additional inputs is not necessarily practical computationally, experimentally, or even advisable given Occam’s razor. 9 −10 The model can track near chaotic, high CV (c) Cyl. 3 Model predicted 5 Sorted Neuron # 10 Measured 20 misfire region... −10 −25 35 The model tracks harsh Each cyl. is different transients up to misfire (d) Cyl. 4 despite same set-points Measured Model predicted 20 5 −10 −25 11,375 11,420 11,465 Cycle # 11,510 11,555 Cyl. 1 2 3 4 3 4 3 4 4.5 3 1.5 0 −25 (f) WR−ELM β Weight for Cyl. 2 64 55 46 37 28 19 10 1 25 (j) Injection Pulse Width 1.1 Cyl. 1 2 0 TI [ms] 0.95 0.8 0.65 (g) WR−ELM β Weight for Cyl. 3 64 55 46 37 28 19 10 1 64 55 46 37 28 19 10 1 IMEP [bar] 0 (i) Indicated Mean Effective Pressure 6 25 −25 0.5 25 380 0 (h) WR−ELM β Weight for Cyl. 4 SOI [°BTDC] Sorted Neuron # 5 Sorted Neuron # −25 The model often tracks Tracking errors CA50 cycle-to-cycle (b) Cyl. 2 occur occasionally 35 Measured Model predicted 20 Sorted Neuron # CA50 [°ATDC] CA50 [°ATDC] −10 35 CA50 [°ATDC] Model predicted 5 −25 CA50 [°ATDC] Measured 20 (e) WR−ELM β Weight for Cyl. 1 64 55 46 37 28 19 10 1 (k) Start of Injection Cyl. 1 320 290 260 25 150 (l) Approx. EVC [ °BTDC] and IVO [ °ATDC] EVC Cyl. 1 2 130 0 2 350 −25 [°CA] (a) Cyl. 1 35 IVO Cyl. 1 3 4 110 90 11,375 11,420 11,465 Cycle # 11,510 11,555 −25 70 11,375 11,420 11,465 Cycle # 11,510 11,555 Figure 7: The WR-ELM CA50 model of Eq. 2 can track CA50 through transients every 0.5 - 10 seconds, operating points with near chaotic high CV, and at steady-state during a particularly harsh region of the 25,323 cycle dataset that includes misfires. The colormaps (linearly scaled) provide qualitative insight into the level of cycle-to-cycle adaptation and into cylinder-to-cylinder model differences. Acknowledgments [10] E. Hellström, A. G. Stefanopoulou, L. Jiang, Cyclic Variability and Dynamical Instabilities in Autoignition Engines with High Residuals, IEEE Transactions on Control Systems Technology 21 (5) (2013) 1527–1536. [11] J. C. Kantor, A Dynamical Instability of Spark Ignited Engines, Science 224 (4654) (1984) 1233–1235. [12] L. Manofsky, J. Vavra, D. Assanis, A. Babajimopoulos, Bridging the Gap between HCCI and SI: Spark-Assisted Compression Ignition SAE Paper 2011-01-1179, 2011. [13] M. Sjöberg, J. E. Dec, A. Babajimopoulos, D. Assanis, Comparing Enhanced Natural Thermal Stratification Against Retarded Combustion Phasing for Smoothing of HCCI Heat-Release Rates SAE Paper 2004-01-2994, 2004. [14] M. Mehl, W. J. Pitz, M. Sjöberg, J. E. Dec, Detailed Kinetic Modeling of Low-Temperature Heat Release for PRF Fuels in an HCCI Engine SAE Paper 2009-01-1806, 2009. [15] Experimental and surrogate modeling study of gasoline ignition in a rapid compression machine, Combustion and Flame 159 (10) (2012) 3066 – 3078. [16] G. M. Shaver, Physics-Based Modeling and Control of Residual-Affected HCCI Engines using Variable Valve Actuation, Ph.D. thesis, Stanford University, 2005. [17] J. Livengood, P. Wu, Correlation of autoignition phenomena in internal combustion engines and rapid compression machines, Symposium International on Combustion 5 (1) (1955) 347–356. [18] S. Jade, J. Larimore, E. Hellström, A. Stefanopoulou, L. Jiang, Controlled Load and Speed Transitions in a Multicylinder Recompression HCCI Engine, Control Systems Technology, IEEE Transactions on PP (99) (2014) 1–1. [19] V. Cherkassky, F. Mulier, Learning from Data: Concepts, Theory, and Methods, Wiley, 2007. [20] N.-Y. Liang, G.-B. Huang, P. Saratchandran, N. Sundararajan, A fast and accurate online sequential learning algorithm for feedforward networks, Neural Networks, IEEE Transactions on 17 (6) (2006) 1411–1423. [21] G.-B. Huang, Q.-Y. Zhu, C.-K. Siew, Extreme learning machine: Theory and applications, Neurocomputing 70 (1-3) (2006) 489 – 501. [22] B. Mirza, Z. Lin, K.-A. Toh, Weighted Online Sequential Extreme Learning Machine for Class Imbalance Learning, Neural Processing Letters (2013) 1–22. [23] D. Simon, Optimal State Estimation: Kalman, H Infinity, and Nonlinear Approaches, Wiley-Interscience, 2006. [24] John Halleck’s Matrix Identities (also Ring Identities), URL: http://www.cc.utah.edu/∼nahaj/math/matrix-identities.html, [Online; accessed 12/31/2014], 2014. [25] Version 0.1 Raspberry Pi Engine Control with Real-Time Adaptive Extreme Learning Machine, URL: https://www.youtube.com/watch?v=qQG7ocnE3EA, [Online; accessed 1/8/2015], 2015. [26] Minimal Raspbian unattended netinstaller, URL: https://github.com/debian-pi/raspbian-ua-netinst, [Online; accessed 9/5/2014], 2014. This material is based upon work supported by the Department of Energy [National Energy Technology Laboratory] under Award Number(s) DE-EE0003533. This work is performed as a part of the ACCESS project consortium (Robert Bosch LLC, AVL Inc., Emitec Inc., Stanford University, University of Michigan) under the direction of PI Hakan Yilmaz and Co-PI Oliver Miersch-Wiemers, Robert Bosch LLC. The authors thank Vijay Janakiraman for providing the raw data analyzed in this paper. The authors also thank Jeff Sterniak for both his test cell and project support. A. Vaughan thanks Nisar Ahmed for many helpful discussions, and his advisors S. V. Bohac and Claus Borgnakke for the freedom to explore the interesting topic of near chaotic combustion. Conflict of Interest The University of Michigan has filed a provisional patent on the work described in this publication. A. Vaughan is named as the inventor, which includes royalty rights. S. V. Bohac declares no conflict of interest. References [1] A. Vaughan, S. V. Bohac, An Extreme Learning Machine Approach to Predicting Near Chaotic HCCI Combustion Phasing in Real-Time, arXiv pre-print (1310.3567), 2013. [2] A. Babajimopoulos, V. Challa, G. Lavoie, D. Assanis, Model-Based Assessment of Two Variable CAM Timing Strategies for HCCI Engines: Recompression vs. Rebreathing, in: Proceedings of the ASME Internal Combustion Engine Division 2009 Spring Technical Conference, ICES2009-76103, 2009. [3] E. A. O. Soto, J. Vavra, A. Babajimopoulos, Assessment of Residual Mass Estimation Methods for Cylinder Pressure Heat Release Analysis of HCCI Engines With Negative Valve Overlap, Journal of Engineering for Gas Turbines and Power 134 (8) (2012) 082802. [4] L. M. Olesky, J. Vavra, D. Assanis, A. Babajimopoulos, Effects of Charge Preheating Methods on the Combustion Phasing Limitations of an HCCI Engine With Negative Valve Overlap, Journal of Engineering for Gas Turbines and Power 134 (11) 112801. [5] S. Saxena, I. D. Bedoya, Fundamental phenomena affecting low temperature combustion and HCCI engines, high load limits and strategies for extending these limits, Progress in Energy and Combustion Science 39 (5) (2013) 457 – 488. [6] A. Vaughan, S. V. Bohac, A Cycle-to-Cycle Method to Predict HCCI Combustion Phasing, in: Proceedings of the ASME Internal Combustion Engine Division 2013 Fall Technical Conference, ICEF2013-19203, 2013. [7] J. S. Lacey, The effects of advanced fuels and additives on homogeneous charge compression ignition combustion and deposit formation, Ph.D. thesis, University of Michigan, 2012. [8] A. Vaughan, G. Delagrammatikas, A High Performance, Continuously Variable Engine Intake Manifold SAE Paper 2011-01-0420, 2011. [9] Understanding the transition between conventional spark-ignited combustion and HCCI in a gasoline engine, Proceedings of the Combustion Institute 31 (2) (2007) 2887 – 2894. DISCLAIMER: This report was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor any agency thereof, nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof. 11
5cs.CE
arXiv:1611.02851v2 [math.PR] 24 Jan 2018 Vol. 0 (0000) Regularity Properties and Simulations of Gaussian Random Fields on the Sphere cross Time Jorge Clarke De la Cerda ∗ Departamento de Matemática, Universidad Técnica Federico Santa Marı́a. Avda. España 1680, Valparaı́so, Chile. CEREMADE, UMR CNRS 7534 Université Paris-Dauphine, PSL Research university, Place du Maréchal de Lattre de Tassigny 75016 Paris, FRANCE. e-mail: [email protected] Alfredo Alegrı́a † Newcastle University, School of Mathematics and Statistics. e-mail: [email protected] and Emilio Porcu‡ Newcastle University, School of Mathematics and Statistics. Chair of Spatial Analytics Methods Center. Departamento de Matemática, Universidad Técnica Federico Santa Marı́a. Avda. España 1680, Valparaı́so, Chile. e-mail: [email protected] url: eporcu.mat.utfsm.cl Abstract: We study the regularity properties of Gaussian fields defined over spheres cross time. In particular, we consider two alternative spectral decompositions for a Gaussian field on Sd × R. For each decomposition, we establish regularity properties through Sobolev and interpolation spaces. We then propose a simulation method and study its level of accuracy in the L2 sense. The method turns to be both fast and efficient. MSC 2010 subject classifications: Primary 60G60, 60G17, 41A25; secondary 60G15, 33C55, 46E35, 33C45. Keywords and phrases: Gaussian random fields, Global data, Big data, Space-time covariance, Karhunen-Loève expansion, Spherical harmonics functions, Schoenberg’s functions. ∗ supported by Proyecto FONDECYT Post-Doctorado No 3150506. by Beca CONICYT-PCHA / Doctorado Nacional / 2016-21160371. ‡ supported by Proyecto FONDECYT Regular No 1170290. † supported 0 J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 1 1. Introduction Spatio-temporal variability is of major importance in many fields, in particular for anthropogenic and natural processes, such as earthquakes, geographic evolution of diseases, income distributions, mortality fields, atmospheric pollutant concentrations, hydrological basin characterization and precipitation fields, among others. For many natural phenomena involving, for instance, climate change and atmospheric variables, many branches of applied sciences have been increasingly interested in the analysis of data distributed over the whole sphere representing planet Earth and evolving through time. Hence the need for random fields models where the spatial location is continuously indexed through the sphere, and where time can be either continuous or discrete. It is common to consider the observations as a partial realization of a spatio-temporal random field which is usually considered to be Gaussian (see [6, 7, 10]). Thus, the dependence structure in space-time is governed by the covariance of the spatiotemporal Gaussian field, and we refer the reader to [13, 24, 27] for significant contributions in this direction. Specifically, let d be a positive integer, and let Sd = {x ∈ Rd+1 , kxk = 1} be the d-dimensional unit sphere in the Euclidean space Rd+1 , where k · k denotes the Euclidean norm of x ∈ Rd+1 . We denote Z = {Z(x, t), (x, t) ∈ Sd × R} a Gaussian field on Sd × R. The tour de force in [17] characterizes isotropic Gaussian random fields on the sphere Sd through Karhunen–Loève expansions with respect to the spherical harmonics functions and the angular power spectrum. They show that the smoothness of the covariance is connected to the decay of the angular power spectrum and then discuss the relation to sample Hölder continuity and sample differentiability of the random fields. The present paper extends part of the work of [17] to space-time. Such extension is non-trivial and depends on two alternative spectral decompositions of a Gaussian field on spheres cross time. In particular, we propose either Hermite or classical Karhunen-Loève expansions, and show how regularity properties can evolve dynamically over time. The crux of our arguments rely on recent advances on the characterization of covariance functions associated to Gaussian fields on spheres cross time (see [3] and [21]). Notably, the Berg-Porcu representation in terms of Schoenberg functions inspires the proposal of alternative spectral decompositions for the temporal part, which become then crucial to establish the regularity properties of the associated Gaussian field. The second part of the paper is devoted to simulation methods which should be computationally fast while keeping a reasonable level of accuracy, resulting in a notable step forward. Efficient simulation methods for random fields defined on the sphere cross time are, currently, almost unexplored. Cholesky decomposition is an appealing alternative since it is an exact method. However, the method has an order of computation of O(N 3 ), with N denoting the sample size. This J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 2 makes its implementation computationally challenging for large scale problems (the so called Big “n”problem). It is therefore mandatory to investigate efficient simulation methods. Here, we propose a simulation method based on a suitable truncation of the proposed double spectral decompositions. We establish its accuracy in the L2 sense and illustrate how the model keeps a reasonable level of accuracy while being considerably fast, even when the number of spatiotemporal locations is very high. The remainder of the article is as follows. Section 2 provides the basic material for a self-contained exposition. The expansions for the kernel covariances and the random field are presented in Section 3. Section 4 presents the regularity results for the kernel covariance functions in terms of weighted Sobolev spaces and weighted bi-sequence spaces. In Section 5 our simulation method is developed and its accuracy is studied. Also, we provide some numerical experiments for illustrative purposes. In Appendix 7.1 we also provide a rather general version of the Karhunen-Loève theorem. The manuscript is intended for complex-valued random fields over Sd × R with d ∈ N, except for Section 5 where the simulations considered are for real-valued random fields over S2 × R. 2. Preliminaries This section is largely expository and devoted to the illustration of the framework and notations that will be of major use throughout the manuscript. All the tools presented in this section are valid in Sd , for any d ∈ N. Some particular references to the case d = 2 are exposed, as they will be of use in Section 5. 2.1. Spherical Harmonics Functions and Gegenbauer Polynomials Spherical harmonics are restrictions to the unit sphere Sd of real harmonics polynomials in Rd+1 . They are also the eigenfunctions of the Laplace-Beltrami operator on Sd . A deeper overview on spherical harmonics along with the properties listed in this subsection can be found in [9]. For d ∈ N, let L2 (Sd , σd ; C) = L2 (Sd ) denote the space of complex-valued square integrable functions over Sd , where σd denotes the surface area measure, and kσd k denotes the surface area of Sd , Z kσd k := dσd = Sd with Γ being the Gamma function. 2π (d+1)/2 , Γ((d + 1)/2) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 3 For j = 0, 1, . . . , let Hjd denote the linear space of spherical harmonics of degree j over Sd . For different degrees, spherical harmonics are orthogonal with respect to the inner product of L2 (Sd ). If Yj,m,d ∈ Hjd and Yj 0 ,m,d ∈ Hjd0 , then Z hYj,m,d , Yj 0 ,m,d iL2 (Sd ) := Yj,m,d (x)Yj 0 ,m,d (x) dσd (x) Sd = δj,j 0 · kσd k; j, j 0 ∈ N, m = 0, . . . , dim(Hjd ), where δj,j 0 is the Kronecker delta function, being identically equal to one if j = j 0 , and zero otherwise. Corollary 1.1.4 in [9] shows that dim(Hjd ) = (2j + d − 1)(j + d − 2)! , j!(d − 1)! j ≥ 1, dim H0d = 1. (2.1)  Let Yj,m,d : m = 1, . . . , dim(Hjd ) be any orthonormal basis of Hjd . Then, the  family Sd := Yj,m,d : j ∈ N0 , m = 1, . . . , dim(Hjd ) constitutes an orthonormal basis of L2 (Sd ) and Theorem 2.42 of [19] shows that L2 (Sd ) = +∞ M Hjd . j=0 Besides, the addition formula for spherical harmonics states dim(Hd j) X Yj,m,d (x)Yj,m,d (y) = m=1 (2j + d − 1) (d−1)/2 Cj (hx, yiRd+1 ), (d − 1) j ∈ N, (2.2) where h·, ·iRd+1 denotes the inner product in Rd+1 . Here Cjr (·) are the Gegenbauer (or ultraspherical) polynomials of degree j and order r, defined by Cjr (x) = (2r)j (r−1/2),(r−1/2) P (x), (r + 1/2)j j r > −1/2, x ∈ [−1, 1], (α,β) where Pj (·) denotes the Jacobi polynomial of parameters α, β > −1 and degree j, and (·)j denotes the Pochhammer symbol (rising factorial) defined by (r)j := r(r + 1) · . . . · (r + j − 1), r ∈ R, j ∈ N0 , where (r)j = Γ(r + j)/Γ(r), provided r is not a negative integer. Gegenbauer polynomials constitute a basis of L2 (−1, 1) and satisfy the orthogonality relation (section 3.15 in [2]) Z 1 π21−2r Γ(j + 2r) Cjr (x)Cjr0 (x)(1 − x2 )r−1/2 dx = δj,j 0 . (2.3) j!(j + r)Γ(r)2 −1 J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 4 By Stirling’s inequalities, for n ∈ N fixed, there exists constants c1 (n) and c2 (n) such that π21−n Γ(j + n) ≤ c2 (n)j n−2 . c1 (n)j n−2 ≤ j!(j + n/2)Γ(n/2)2 Hence, assuming 2r ∈ N, relation (2.3) becomes Z 1 Cjr (x)Cjr0 (x)(1 − x2 )r−1/2 dx ' j 2r−2 δj,j 0 . (2.4) −1 Besides, for n ≤ j we observe that (see section 10.9 in [2]) ∂n r r+n r+n C (x) = 2n (r)n Cj−n (x) ' Cj−n (x), x ∈ [−1, 1] ∂xn j (2.5) In what follows cj (d, x) denotes the standardized Gegenbauer polynomial, being identically equal to one for x = 1 and r = (d − 1)/2, that is (d−1)/2 cj (d, x) = Cj (x) (d−1)/2 Cj (1) = j! (d−1)/2 C (x), (d − 1)j j x ∈ [−1, 1]. (2.6) It is straightforward to see that dim(Hjd ) (d−1)/2 Cj (1) = 2j + d − 1 ' j. d−1 (2.7) 1/2 Remark 2.1. When d = 2, i.e., the S2 case, Cj (·) = Pj (·), where Pj (·) is the Legendre polynomial of degree j [9]. See [9] and [19] for a deeper overview of spherical harmonics, and [2] for a detailed description of Gegenbauer, Jacobi and Legendre polynomials. 2.2. Isotropic Stationary Gaussian Random Fields on the Sphere cross Time Let (Ω, F, P) be a complete probability space. Consider Sd and Sd × R as manifolds contained in Rd+1 and in Rd+2 respectively. Definition 2.1. The geodesic distance θ on Sd (“great circle” or “spherical” distance) is defined by θ(x, y) = arccos(hx, yiRd+1 ), x, y ∈ Sd . The geodesic distance ρ on Sd × R is defined through q 2 ρ((x, s), (y, t)) = θ (x, y) + (t − s)2 , (x, s), (y, t) ∈ Sd × R. (2.8) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 5 Throughout, unless it is explicitly presented in a different way, we write Sd instead of (Sd , σd ), σd being the surface area measure, which is equivalent to other uniformly distributed measures on Sd , such as the Haar measure or the Lebesgue spherical measure [8]. Analogously, we write R instead of (R, µ), for µ being the Lebesgue measure. Definition 2.2. A F ⊗ B(Sd × R)-measurable mapping, Z : Ω × Sd × R 7→ C, is called a complex-valued random field on Sd × R.  A complex-valued random field Z = Z(x, t) : x ∈ Sd , t ∈ R is called Gaussian if for all k ∈ N, (x1 , t1 ), . . . , (xk , tk ) ∈ Sd × R, the random vector > (ReZ(x1 , t1 ), . . . , ReZ(xk , tk ), ImZ(x1 , t1 ), . . . , ImZ(xk , tk )) , is multivariate Gaussian distributed. Here, > denotes the transpose operator. A function h : Sd × R × Sd × R −→ C is positive definite if n X n X ci cj h(xi , ti , xj , tj ) ≥ 0, (2.9) i=1 j=1 n for all finite systems of pairwise distinct points {(xk , tk )}k=1 ⊂ Sd × R and constants c1 , . . . , cn ∈ C. A positive definite function h is strictly positive definite if the inequality (2.9) is strict, unless c1 = · · · = cn = 0. We call a function h : Sd × R × Sd × R −→ C spatially isotropic and temporally stationary if there exists a function ψ : [−1, 1] × R −→ C such that h(x, t, y, s) = ψ (cos θ(x, y), t − s) , (x, t), (y, s) ∈ Sd × R. (2.10) Hence, a spatially isotropic and temporally stationary function depends on its arguments via the great circle distance θ(x, y) and the time lag, or equivalently, via the inner product hx, yiRd+1 and the time  lag. Definition 2.3. We call a random field Z = Z(x, t) : x ∈ Sd , t ∈ R 2-weakly isotropic stationary if E [Z(x, t)] is constant for all (x, t) ∈ Sd × R, and if the covariance h is a spatially isotropic and temporally stationary function on (Sd × R)2 . The associated function ψ in (2.10) is called the covariance kernel or simply kernel. Remark 2.2. A Gaussian random field (GRF) which is 2-weakly isotropic stationary on Sd ×R, is in fact isotropic in the spatial variable and stationary in the time variable (see [18]), hence, it has an invariant distribution under rotations on the spatial variable, and under translations on the temporal variable. Throughout the manuscript we work with zero-mean random fields, with no loss of generality. 2.3. Kernel Covariance Functions on the Sphere cross Time In his seminal paper, [23] characterized the class of continuous functions f : [−1, 1] 7→ R such that f (cos θ) is positive definite over the product space J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 6 Sd × Sd , with θ defined in equation (2.8). Recently, [3] extended Schoenberg’s characterization by considering the product space Sd × G, with G being a locally compact group. They defined the class P(Sd , G) of continuous functions ψ : [−1, 1] × G 7→ C such that ψ(cos θ, u−1 · v) is positive definite on (Sd × G)2 . In particular, the case G = R offers a characterization of spatio-temporal covariance functions of centred 2-weakly isotropic stationary random fields over the sphere cross time. Let P(R) denote the set of continuous and positive definite functions on R. For d = 1, 2, . . . , we consider the class P(Sd , R) of continuous functions ψ : [−1, 1]×R 7→ C such that the associated spatially isotropic temporally stationary function h in (2.10) is positive definite. The following result, rephrased from [3], allows to identify the class P(Sd , R) with the covariances functions of 2-weakly isotropic stationary random fields on Sd × R. Theorem 2.1. Let d ∈ N and let ψ : [−1, 1] × R 7→ C be a continuous mapping. Then, ψ ∈ P(Sd , R) if and only if there exists a sequence {ϕj,d }j∈N ∈ P(R) with ∞ X ϕj,d (0) < +∞ such that j=0 ψ (cos θ, t) = ∞ X ϕj,d (t)cj (d, cos θ) dim(Hjd ), θ ∈ [0, π], t ∈ R, (2.11) j=0 where ϕj,d (t) = kσd k kσd+1 k Z 1 ψ(x, t)cj (d, x)(1 − x2 )d/2−1 dx, (2.12) −1 are called Schoenberg’s functions, dim(Hjd ) is given by (2.6), and cj (·, ·) by (2.1). For (θ, t) ∈ [0, π] × R, the series in (2.11) is uniformly convergent. Remark 2.3. Some comments are in order: • For ε1 = (1, 0, . . . , 0) a unit vector in Rd+1 , we may consider the mapping ψε1 : Sd × R 7→ C given by ψε1 (y, t) = ψ(hε1 , yiRd+1 , t), (y, t) ∈ Sd × R. Then, arguments at page 13 of [3], show that Z ϕj,d (t) = ψ(hε1 , yiRd+1 , t)cj (d, hε1 , yiRd+1 ) dσd (y) Sd = hψε1 (·, t), cj (d, hε1 , ·iRd+1 )iL2 (Sd ) . Hence, for each t ∈ R, the Schoenberg’s functions ϕj,d (t) given by (2.12) may be understood as the orthogonal projection of ψε1 (·, t) onto Hjd . • We note that, in comparison with the representation of covariance functions for 2-weakly isotropic random fields on the sphere, representation (3.1) does not consider Schoenberg coefficients ϕj,d but Schoenberg functions ϕj,d (·), which will play a fundamental role subsequently. J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 7 3. Expansions for Isotropic Stationary GRFs and Kernel Covariance Functions According to Theorem 2.1, the kernel ψ of an isotropic stationary GRF Z on Sd × R admits the following representation: ψ(x, u) = ∞ X ϕj,d (u)cj (d, x) dim(Hjd ), x ∈ [−1, 1], u ∈ R, (3.1) j=0 where {ϕj,d }j∈N is a sequence of functions in P(R), such that the series is uniformly convergent. Expression (3.1) allows to consider different expansions for the kernel. Before introducing these representations, we present the expansion for the random field which motivates the simulation methodology. 3.1. Karhunen-Loève Expansions for Isotropic Stationary GRFs on the Sphere cross Time In [15], the following Karhunen-Loève representation for an isotropic stationary GRF Z over S2 × R is proposed, Z(x, t) = j ∞ X X Xj,m (t)Yj,m (x), (x, t) ∈ S2 × R, (3.2) j=0 m=−j where {Xj,m (t)}j,m is a sequence of one-dimensional complex-valued mutually independent stochastic processes. The set of all Xj,m (t) forms a denumerable infinite dimensional stochastic process which completely defines the process on the sphere, and Yj,m (x) are the elements of an orthonormal basis of Hj2 . Representations (3.1) for the spatio-temporal covariance and (3.2) for the random field, allow us to introduce the following family of GRFs on Sd × R for any d ∈ N. Definition 3.1. Let Z be a random field on Sd × R defined, in the mean square sense, as dim(Hd ) Z(x, t) = ∞ X Xj j=0 Xj,m,d (t)Yj,m,d (x). (3.3) m=0 Here, for each j, m and d, {Xj,m,d (t), t ∈ R} is a complex-valued zero-mean stationary Gaussian process such that cov{Xj,m,d (t), Xj 0 ,m0 ,d (s)} := E{Xj,m,d (t) Xj 0 ,m0 ,d (s)} = ϕj,d (t − s)δj,j 0 δm,m0 , where {ϕj,d }j∈N represents the Schoenberg’s functions associated to the mapping ψ in Equation (3.1). J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 8 Remark 3.1. Examples of random field satisfying Definition (3.1) are found in the Appendix of [21]. Proposition 3.1. Let Z be a random field as in Definition 3.1. Then, Z is an isotropic stationary GRF, with zero-mean and covariance function given by ψ as in (3.1). Proof. The proof follows straight by using the properties of the process Xj,m,d , and the addition formula in Equation (2.2). For each j, m, d, the process {Xj,m,d (t), t ∈ R} has the following KarhunenLoève expansion (see Appendix 7.1), Xj,m,d (t) = ∞ X λj,k,d ζk (t), t ∈ R, (3.4) k=0 where for each j, m, d ∈ N, {λj,k,m,d }k is a sequence of independent complexvalued random variables defined by Z λj,k,m,d := Xj,m,d (t)ζk (t)dµ(t). R Also, λj,k,m,d ∼ N (0, aj,k,d ), where {aj,k,d }k and {ζk }k are the eigenvalues and eigenfunctions (respectively) of the integral operator Kϕ : L2 (R) 7→ L2 (R) associated to ϕj,d , defined by Z Kϕ (f )(t) := ϕj,d (t − s)δj,j 0 δm,m0 f (s)dµ(s), f ∈ L2 (R) R Remark 3.2. By (3.4), an alternative way to write (3.3) is: dim(Hd ) Z(x, t) = ∞ ∞ X Xj X j=0 m=1 λj,k,m,d ζk (t)Yj,m,d (x), (x, t) ∈ Sd × R. (3.5) k=0 Expressions (3.3) or (3.5) represent a way to construct isotropic stationary GRFs on the sphere cross time, and suggest a spectral simulation method. However, it is not yet proved that any isotropic stationary GRF on the sphere cross time can be written in this way. 3.2. Double Karhunen-Loève Expansion of Kernel Covariance Functions By stationarity of the process X and Karhunen-Loève theorem we have, J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 9 ϕj,d (u)δj,j 0 δm,m0 = cov{Xj,m,d (u), Xj 0 ,m0 ,d (0)} ∞ X = aj,k,d ζk (u)ζk (0), u ∈ R. k=0 Hence, a slight abuse of notation allows to reformulate the last expression to ϕj,d (u) = ∞ X aj,k,d ζk (u), u ∈ R. k=0 Therefore, the kernel covariance function ψ in (3.1) also admits the expansion ψ (x, t) = ∞ X dim(Hjd ) j=0 ∞ X aj,k,d ζk (t)cj (d, x) , (x, t) ∈ [−1, 1] × R. (3.6) k=0 Following [17], we call the series {aj,k,d }j,k∈N ⊂ R the spatio-temporal angular power spectrum. P∞ Theorem 2.1 implies that { k=0 aj,k,d ζk (·)}j∈N is a sequence of continuous and positive definite functions. Further, ∞ X ∞ X aj,k,d ζk (0) < +∞. j=0 k=0 3.3. Hermite Expansion of Kernel Covariance Functions It is well known that any ϕ ∈ P(R) satisfies |ϕ(t)| ≤ ϕ(0) (see [22]). Therefore, ϕ ∈ P(R), ensures that ϕ ∈ L2 (R, ν) for any finite measure ν, in particular, any Gaussian measure. Let ν be the standard Gaussian measure. As the Schoenberg’s functions {ϕj,d }j∈N associated to ψ in Equation (3.1) belong to the class P(R) ⊂ L2 (R, ν), they can be expanded in terms of normalized Hermite polynomials. For each j, d ∈ N there exist constants {αj,k,d }k ∈ C such that ϕj,d (u) = ∞ X αj,k,d Hk (u), u ∈ R. k=0 The series converges in L2 (R, ν), and each Hk is a normalized Hermite polynomial of degree k given by Hk (u) = k −u2 u2 d (−1)k 2 , √ e2 e duk (k! 2π)1/2 k = 0, 1, 2, . . . J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 10 Consequently, the kernel ψ in (3.1) can be reformulated as ψ(x, t) = ∞ X j=0 dim(Hjd ) ∞ X αj,k,d Hk (t)cj (d, x), (x, t) ∈ [−1, 1] × R. (3.7) k=0 We call the series {αk,j,d }j,k∈N ⊂ C the spatio-temporal Hermite power spectrum. 4. Regularity Properties This section is devoted to study the behaviour of the kernel covariance functions associated to an isotropic stationary GRF Z. It will be shown that the regularity of such kernels is closely related to the decay of the Hermite power spectrum or the angular power spectrum. Moreover, the latter characterizes also the (K −J)term truncation of a GRF Z as in Equation (3.5). We recall that we have introduced two expansions for the kernel covariance function of an isotropic stationary GRF Z: i.- The Spatio-temporal power spectrum, by using a double Kaurhunen-Loève expansion according to formula (3.6), valid for the kernel covariancefunction of any isotropic stationary GRF as in (3.5) over Sd × R, σd ⊗ µ with µ the Lebesgue measure. ii.- The Hermite power spectrum, by using Hermite polynomials according to formula (3.7), valid for the kernel covariance function of any isotropic  stationary GRF Z over Sd × R, σd ⊗ ν with ν the standard Gaussian measure. We recall that, for all x, y ∈ Sd and t, s ∈ R, cov (Z(x, t), Z(y, s)) = ψ(cos θ(x, y), t − s) = ψ(hx, yiRd+1 , t − s). Remark 4.1. Considering the relations between Gegenbauer and Legendre polynomials, in the case d = 2, the kernel (3.1) turns out to be ∞ X ϕj,2 (t − s)(2j + 1)Pj (hx, yiR3 ) = ψ(hx, yiR3 , t − s), x, y ∈ S2 , t, s ∈ R. j=0 In what follows we present the regularity analysis of the kernel in terms of the behaviour of the two proposed expansions (3.6) and (3.7). We address first the relation with the Hermite power spectrum (3.7). 4.1. Regularity analysis for the Hermite expansion In this part of the manuscript we consider the measure space (R, ν) with ν the standard Gaussian measure. J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 11 For n, m ∈ N let the spaces H n (−1, 1) ⊂ L2 (−1, 1) and H m (R) ⊂ L2 (R) be the standard Sobolev spaces. We extend the proposal in [17] and consider the function spaces W n,m := W n,m ((−1, 1)×R) as the closure of H n (−1, 1)×H m (R) with respect to the weighted norm k · kW n,m ((−1,1)×R) given by kf k2W n,m := n X m X |f |2W j,k , j=0 k=0 where for j, k ∈ N |f |2W j,k Z Z 2 1 ∂k ∂j f (x, t) (1 − x2 )d/2−1+j dx dν(t). ∂tk ∂xj := −1 R Note that (W n,n , n ∈ N) is a decreasing scale of separable Hilbert spaces, i.e. L2 ((−1, 1) × R) ∼ = L2 (−1, 1) ⊗ L2 (R) = W 0,0 ⊃ W 1,1 ⊃ . . . ⊃ W n,n ⊃ . . . We abuse of notation by writing L2 instead of L2 ((−1, 1) × R), and we consider the canonical partial order relation in N2 : (n, m) ≤ (n0 , m0 ) if and only if [n ≤ n0 and m ≤ m0 ]. By Theorem 5.2 in [1], the norm of W n,n is equivalent to the first and the last element of the sum, i.e. kf k2W n,n ' kf k2L2 + |f |2W n,n , f ∈ W n,n . We now derive another equivalent norm of W n,n in terms of summability of the spectrum. We first observe that, as the normalized Hermite polynomials {Hk }k∈N constitute a orthonormal basis of L2 (R), and that for any fixed r > −1/2 the Gengenbauer polynomials {Cjr }j∈N a basis for L2 (−1, 1), it is apparent that {Hk ·Cjr }j,k∈N is a basis for L2 ((−1, 1)×R) ∼ = L2 (−1, 1)⊗L2 (R). Therefore, 2 any f ∈ L can be expanded in the series f (x, t) = ∞ X bk,j Hk (t)Cjr (x), (x, t) ∈ [−1, 1] × R, k,j=0 with Z Z 1 bk,j := R Putting αj,k := f (x, t) = 2j+d−1 d−1 bk,j , ∞ X j=0 f (x, t)Hk (t)Cjr (x)dxdν(t), k, j ∈ N0 . −1 we get dim(Hjd ) ∞ X αj,k Hk (t)cj (d, x), (x, t) ∈ [−1, 1] × R, k=0 that is, f can be written as a covariance kernel ψ of the type (3.7). (4.1) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 12 This allows to tackle the problem in a different way. Instead of using spectral techniques, regularity of kernels might be shown through an isomorphism between the spaces W n,m ((−1, 1) × R) and the weighted square summable bisequence spaces   (kj)m,n := `2 k m/2 · j (d−1)/2+n ; k, j ∈ N , (4.2)  where k m/2 · j (d−1)/2+n ; k, j ∈ N denotes the sequence of weights. From now on, for the sake of simplicity, we only consider weighted Sobolev spaces W n := W n,n , and the weighted square summable bi-sequence spaces (kj)n := (kj)n,n , obtained as a special case of Equation (4.2) when n = m. In order to extend the isomorphism to spaces W η with η being not an integer, following [26] we now introduce the interpolation spaces W η := W η ((−1, 1)×R) for n < η < n + 1, defined through:  W η := W n , W n+1 η−n,2 , equipped with the norm kf kW η given by Z ∞ dζ kf k2W η = ζ −2(η−n) |J(r, f )|2 , ζ 0 where the functional J is defined by J(r, f ) = inf f =v+w v∈W n , w∈W n+1 (kvkW n + ζ · kwkW n+1 ) , ζ > 0. The definition of the interpolation spaces (kj)η for η non-integer is carried out in analogous way. The interpolation property (see section 2.4.1 in [25]), implies that, if the spaces W n and (kj)n are isomorphic for all n ∈ N, then they are isomorphic for all η ∈ R+ . Theorem 4.1. Let f ∈ L2 having expansion (4.1) and η ∈ R+ be given. Then, f ∈ W η if and only if ∞ X |bk,j |2 k η · j d−1+2η < ∞, k,j=0 i.e. kf k2W η ' ∞ X k,j=0 η is an equivalent norm in W . |bk,j |2 k η · j d−1+2η J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 13  For ψ ∈ W n , n ∈ N, the equivalence is reduced to: αk,j k n/2 j (d−1)/2+n , k, j ∈ N ∂n ∂n 2 (d−2)/4+n/2 is in `2 (N2 ) if and only if ∂t is in L2 ((−1, 1) × R), n ∂xn ψ(x, t)(1−x ) where {αk,j }k,j∈N is the space-time Hermite power-spectrum. Rephrased, ∞ X |αk,j |2 k n · j d−1+2n < +∞ k,j=n if and only if Z Z R 1 −1 2 ∂n ∂n ψ(x, t) (1 − x2 )d/2−1+n dx dν(t) < +∞. ∂tn ∂xn Proof. Assume first that the claim is already proved for η ∈ N, i.e., W n is isomorphic to the weighted bi-sequence space (kj)n for all n ∈ N. Fix n ∈ N, let n < η < n + 1 and set κ := η − n. By the interpolation theorem of Stein-Weiss (see Theorem 5.4.1 in [4]), the weights of (kj)η are given by 1−κ  n+1 d−1+2(n+1) κ = k η j d−1+2η . k n j d−1+2n · k j Now, we prove the isomorphism between W n and (kj)n for n ∈ N, which is equivalent to prove the second formulation of the theorem. We have that, 2 1 ∂n ∂n ψ(x, t) (1 − x2 )d/2−1+n dx dν(t) n n R −1 ∂t ∂x Z Z 1 X ∞ ∞ 2 X ∂n ∂n αk,j n Hk (t) n cj (d, x) (1 − x2 )d/2−1+n dx dν(t) = dim(Hjd ) ∂t ∂x R −1 j=0 k=0 Z ∞ X ∂n ∂n αk,j αk0 ,j 0 = H (t) Hk0 (t) dν(t) k n ∂tn R ∂t k,k0 ,j,j 0 =0 Z 1 n ∂ ∂n · cj (d, x) dim(Hjd ) n cj 0 (d, x) dim(Hjd0 )(1 − x2 )d/2−1+n dx n ∂x −1 ∂x ∞ X (4.3) = αk,j αk0 ,j 0 · Ik,k0 · Iej,j 0 , Z Z k,k0 ,j,j 0 =0 where Z Ik,k0 = R ∂n ∂n H (t) Hk0 (t) dν(t) k ∂tn ∂tn and Z 1 Iej,j 0 = −1 n ∂n d ∂ c (d, x) dim(H ) cj 0 (d, x) dim(Hjd0 )(1 − x2 )d/2−1+n dx. j j ∂xn ∂xn J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 14 Standard properties of normalized Hermite polynomials show that Ik,k0 = 0 if k < n, and k! δk,k0 ; k ≥ n. Ik,k0 = (k − n)! On one hand, Stirling inequality √ 2π k k+1/2 e−k ≤ k! ≤ k k+1/2 e−k+1 , implies that √ 2π e−(n+1) k k+1/2 k! e−n+1 k k+1/2 √ ≤ ≤ . (k − n)! (k − n)k−n+1/2 2π (k − n)k−n+1/2 On the other hand, kk kn = , k−n (k − n) (1 − n/k)k(1−n/k) where for k ≥ n, 1 −−−−→ e−n . (1 − n/k)k−n k→∞ Hence, for k ≥ n, there exists constants c1 (n) and c2 (n) such that c1 (n)k n ≤ k! ≤ c2 (n)k n . (k − n)! Therefore, Ik,k0 ' k n δk,k0 , k ≥ n. (4.4) For Ij,j 0 (x), expressions (2.4), (2.5), (2.6) and (2.7) allow to conclude that Ij,j 0 (x) = 0 if j < n, and Ij,j 0 (x) ' j d−1+2n δj,j 0 , j ≥ n. Therefore, from (4.3), (4.4) and (4.5) we deduce that Z Z R ' 1 −1 ∞ X 2 ∂n ∂n ψ(x, t) (1 − x2 )d/2−1+n dx dν(t) ∂tn ∂xn |αk,j |2 k n j d−1+2n , k,j=n which concludes the proof. (4.5) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 15 4.2. Regularity analysis for the double Karhunen-Loève expansion With the exception of minor details on the definitions of the spaces, this part of the manuscript follows similarly to Section 4.1. On the other hand, we now consider the measure space (R, µ) with µ the Lebesgue measure. For n ∈ N consider the function spaces VTn := VTn ((−1, 1) × R) as the closure of H n (−1, 1) × L2 (R) with respect to the weighted norms k · kVTn given by kf k2V n ((−1,1)×R) := n X T |f |2V j ((−1,1)×R) , j=0 T where for j ∈ N |f |2V j := T (VTn )n∈N Z Z R 2 1 ∂j f (x, t) (1 − x2 )d/2−1+j dx dµ(t). ∂xj −1 is a decreasing sequence of separable Hilbert spaces, and kf k2VTn ' kf k2L2 + |f |2VTn , f ∈ VTn . Now we look at the weighted square summable bi-sequence spaces   (kj)T,n := `2 j (d−1)/2+n ; k, j ∈ N . As in Section 4.1, we consider the interpolation spaces VTη for n < η < n+1. The proof of next result follows exactly the same lines as the Theorem 4.1, hence it is omitted. Theorem 4.2. Let f ∈ L2 and η ∈ R+ be given. Then, f ∈ VTη if and only if ∞ X b2k,j j d−1+2η < ∞, k,j=0 i.e. kf k2V η T ' ∞ X b2k,j j d−1+2η k,j=0 is an equivalent norm in VTη .  For ψ ∈ VTn , n ∈ N, the equivalence is reduced to: ak,j j (d−1)/2+n , k, j ∈ N ∂n 2 (d−2)/4+n/2 is in `2 (N2 ) if and only if ∂x is in L2 ((−1, 1) × R), n ψ(x, t)(1 − x ) where {ak,j }k,j∈N is the space-time angular power-spectrum. Rephrased, ∞ X ∞ X j=n k=0 a2k,j j d−1+2n < +∞ J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 16 if and only if Z Z R 1 −1 2 ∂n ψ(x, t) (1 − x2 )d/2−1+n dx dν(t) < +∞. ∂xn Remark 4.2. By taking into account the normalizing constants, all the previous results encompasses the results in Section 3 of [17]. 5. Spatio-Temporal Spectral Simulation We now study a spectral simulation method for random fields on S2 × [0, T ], where T denotes the time horizon. For a neater exposition, along this section, we omit the subscripts associated to the spatial dimension d = 2. We must first introduce some notation. Let j ∈ N0 and m ∈ {0, . . . , j}. For x ∈ [−1, 1], the associated Legendre polynomials Pj,m are defined through dm (Pj (x)), dxm m+1/2 = (2m − 1)!!(−1)m (1 − x2 )m/2 Cj−m (x). Pj,m (x) = (−1)m (1 − x2 )m/2 The spherical harmonic basis functions, Yj,m : S2 7→ C, are defined by s 2j + 1 (j − m)! Yj,m (x) = Pj,m (cos β1 ) exp(imβ2 ), j ∈ N0 , m ∈ {0, . . . , j} 4π (j + m)! Yj,m (x) = (−1)m Yj,−m (x), j ∈ N, m ∈ {−j, . . . , −1}. where (β1 , β2 ) ∈ [0, π] × [0, 2π) represents the spherical coordinates of x ∈ S2 . On the other hand, let {Xj,m (t), j ∈ N0 , m ∈ {−j, . . . , j}} be a collection of stochastic processes. Thus, we consider the space-time random field Z(x, t) = j ∞ X X Xj,m (t)Yj,m (x), x ∈ S2 , t ∈ [0, T ]. (5.1) j=0 m=−j In order to obtain a real-valued field, we must impose some conditions on the stochastic processes {Xj,m (t), j ∈ N0 , m ∈ {0, . . . , j}}. Throughout, we assume that {Xj,m (t), j ∈ N0 , m ∈ {0, . . . , j}} are mutually independent, with Im(Xj,0 (t)) being identically equal to zero, and for j ∈ N and m ∈ {−j, . . . , −1}, Xj,m (t) = (−1)m Xj,−m (t). (5.2) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 17 Note that, using standard algebra of complex numbers, coupled with condition (5.2), Equation (5.1) can be written as Z(x, t) = ∞ X Xj,0 (t)Yj,0 (x) j=0 + j  X ! Xj,m (t)Yj,m (x) + (−1) Xj,m (t)(−1) Yj,m (x) m m m=1 = ∞ X (5.3) Xj,0 (t)Yj,0 (x) j=0 +2 j  X ! Re(Xj,m (t))Re(Yj,m (x)) − Im(Xj,m (t))Im(Yj,m (x)) . m=1 We consider Re(Xj,m (t)) and Im(Xj,m (t)) as independent processes with the following Fourier expansions Re(Xj,m (t)) Im(Xj,m (t)) = = A1j,0,m A2j,0,m + + ∞  X k=1 ∞  X A1j,k,m A2j,k,m  cos  cos k=1 πkt 2T  πkt 2T  + 1 Bj,k,m + 2 Bj,k,m  sin  sin πkt 2T  πkt 2T  , . q Here, {Aqj,k,m } and {Bj,k,m }, for q = 1, 2, are sequences of independent centred real-valued Gaussian random variables, such that 1 var(A1j,k,0 ) = var(Bj,k,0 ) = aj,k and q var(Aqj,k,m ) = var(Bj,k,m ) = aj,k /2, for m 6= 0, where {aj,k }k,j∈N is a summable bi-sequence of non-negative coefficients. A direct calculation shows that the covariance function of Z(x, t) is spatially isotropic and temporally stationary. More precisely, we have that cov{Z(x, t), Z(y, s)} = ∞ X ∞ X (2j + 1) j=0 k=0 4π  aj,k cos πk(t − s) 2T  cj (hx, yiR3 ), x, y ∈ S2 . Finally, given two positive integers J and K, we truncate expression (5.3) in the index j and k, respectively. Thus, we simulate a space-time Gaussian random J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 18 field on S2 × [0, T ] using the explicit approximation b t) = Z(x, J X A1j,0,0 Pej,0 (cos β1 ) j=0 j X +2   1 2 e Pj,m (cos β1 ) Aj,0,m cos(mβ2 ) − Aj,0,m sin(mβ2 ) m=1 K  X    πkt πkt 1 (5.4) + Bj,k,0 sin 2T 2T k=1     j K  X X πkt πkt 1 + Bj,k,m sin +2 Pej,m (cos β1 ) cos(mβ2 ) A1j,k,m cos 2T 2T m=1 k=1     ! j K  X X πkt πkt 2 2 Aj,k,m cos , −2 Pej,m (cos β1 ) sin(mβ2 ) + Bj,k,m sin 2T 2T m=1 +Pej,0 (cos β1 ) A1j,k,0 cos  k=1 where Pej,m (·) = p (2j + 1)(j − m)!/(4π(j + m))!Pj,m (·). We assess the L2 (Ω × S2 × [0, T ]) error associated to the truncated expansion b t) given in Equation (5.4), in terms of the positive integers J and K. We Z(x, follow the scheme used by [17] in the spatial context and extend their result to the space-time case. Next, we state the main result of this section. Theorem 5.1. Let ν1 , ν2 ≥ 2. Suppose that there exist positive constants Ci , for i = 1, 2, 3, and positive integers j0 and k0 , such that aj,0 ≤ C1 j −ν1 , a0,k ≤ C2 k −ν2 and aj,k ≤ C3 j −ν1 k −ν2 , for all j ≥ j0 and k ≥ k0 . Then, the following inequality holds b t)k2 2 e −(ν1 −2) + C e2 JK −(ν2 −1) , kZ(x, t) − Z(x, L (Ω×S2 ×[0,T ]) ≤ C1 J (5.5) e1 and C e2 . for some positive constants C b t) in Equation (5.4) into two independent Proof. We decompose Z(x, t) − Z(x, terms, b t) = T1 (x) + T2 (x, t), Z(x, t) − Z(x, where  X ∞ T1 (x) = A1j,0,0 Pej,0 (cos β1 ) j=J+1 +2 j X   Pej,m (cos β1 ) A1j,0,m cos(mβ2 ) − A2j,0,m sin(mβ2 ) m=1 and T2 (x, t) = ∞ X ∞ X j=J+1 k=1 ∆j,k (x, t) + J ∞ X X j=0 k=K+1 ∆j,k (x, t), J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 19 with ∆j,k (x, t) defined as      πkt πkt 1 1 e ∆j,k (x, t) = Pj,0 (cos β1 ) Aj,k,0 cos + Bj,k,0 sin 2T 2T      j X πkt πkt 1 1 e +2 Pj,m (cos β1 ) cos(mβ2 ) Aj,k,m cos + Bj,k,m sin 2T 2T m=1      j X πkt πkt 2 −2 Pej,m (cos β1 ) sin(mβ2 ) A2j,k,m cos + Bj,k,m sin . 2T 2T m=1 For the second term, we have used the identity ∞ X ∞ X j=0 k=1 ξj,k − J X K X ∞ X ∞ X ξj,k = j=0 k=1 ξj,k + j=J+1 k=1 J ∞ X X ξj,k , j=0 k=K+1 which is satisfied for any summable bi-sequence {ξj,k }j,k∈N . The independence of T1 (x) and T2 (x, t) implies that 2 2 b t)k2 2 kZ(x, t) − Z(x, L (Ω×S2 ×[0,T ]) = kT1 (x)kL2 (Ω×S2 ) + kT2 (x, t)kL2 (Ω×S2 ×[0,T ]) . In [17] it is shown that there exists a positive constant L1 , depending on C1 , such that kT1 (x)k2L2 (Ω×S2 ) ≤ L1 J −(ν1 −2) . On the other hand, since k cos(πkt/(2T ))k2L2 ([0,T ]) + k sin(πkt/(2T ))k2L2 ([0,T ]) = T, kPej,0 (cos β1 )k2L2 (S2 ) = 1 and kPej,m (cos β1 ) cos(mβ2 )k2L2 (S2 ) + kPej,m (sin β1 ) cos(mβ2 )k2L2 (S2 ) = 1, we have that k∆j,k (x, t)k2L2 (Ω×S2 ×[0,T ]) = T (2j + 1)aj,k . Therefore,  X ∞ ∞ X 2 kT2 (x, t)kL2 (Ω×S2 ×[0,T ]) ≤ T (2j + 1) aj,k j=J+1 k=1   ∞ J X X + a0,k + (2j + 1)aj,k j=1 k=K+1  X  X  ∞ ∞ ≤T C3 k −ν2 (2j + 1)j −ν1 j=J+1 k=1   X  J ∞ X + C2 + C3 (2j + 1)j −ν1 k −ν2 j=1 ≤ L2 J −(ν1 −2) + L3 JK k=K+1 −(ν2 −1) , J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 20 where L2 and L3 are positive constants depending on C2 and C3 . In particular, the last inequality follows from the integral bounds of the corresponding series (see [17]): ∞ X  −ν1 ≤ k −ν2 ≤ (2j + 1)j j=J+1 ∞ X k=K+1 2 1 + ν1 − 2 ν1 − 1  J −(ν1 −2) 1 K −(ν2 −1) . ν2 − 1 The proof is completed. Simple examples can be generated from the following space-time angular power spectrum 1 aj,k = , (5.6) 1 + (1 + j)ν1 (1 + k)ν2 with νi > 2, for i = 1, 2. We illustrate space-time realizations on S2 × {1, 2}, over 24000 spatial locations, with coefficients (5.6), in two cases: (a) ν1 = 3 and ν2 = 5, and (b) ν1 = ν2 = 5. Figures 1 and 2 show the corresponding realizations for Scenarios (a) and (b), respectively. For each case, we truncate the series using K = J = 50. Note that the parameter ν1 is the responsible of the spatial scale and smoothness of the realization. In [17], some realizations are illustrated using a similar spectrum, in a merely spatial context. We now compare the empirical and theoretical convergence rates for the cases (a) and (b) described above. In our experiment, we consider J = K and study the (Log) error in terms of (Log) J, taking as the exact solution J = 50. Note that, under this choice, the bound (5.5) implies that the order of convergence is min{(ν1 − 2)/2, (ν2 − 2)/2}. Following [17], instead of calculating the L2 -error, we take the maximum error over all the points on the space-time grid. The empirical errors are calculated on the basis of 100 independent samples. Our studies reflect the theoretical results (see Figure 3). J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 21 Figure 1. Space-time realization on S2 × {1, 2}, with spectrum (5.6), with ν1 = 3 and ν2 = 5. Figure 2. Space-time realization on S2 × {1, 2}, with spectrum (5.6), with ν1 = ν2 = 5. J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 22 Figure 3. Empirical versus theoretical (Log) L2 -error of the simulation method, in terms of (Log) J, with K = J. We consider the spectrum (5.6) in two cases: (a) ν1 = 3 and ν2 = 5, and (b) ν1 = ν2 = 5. 6. Conclusions and discussion The present work has provided a deep look at the regularity properties of Gaussian fields evolving temporally over spheres. We hope this effort will put the basis for facing important challenges related to space-time processes. There are in fact many open problems related to mathematical modeling as well as to statistical inference and to optimal prediction. A list of open problems is included in the recent survey [20]. Amongst them, our paper is certainly related to Problem 1, that is to the construction of non-stationary processes on spheres cross time. Our work could also put the basis to solve Problem 2, related to the construction of multivariate space-time processes. It might be interesting to extend the study of regularity properties to the vector valued case. This would imply the use of a pretty different machinery. Problem 10 is closely related to our approach, because regularity properties are crucial to study Gaussian fields under infill asymptotics. On the other hand, a question arise naturally: is it possible to make inference with a representation like (3.5) ? Or with its respective spectral decomposition? The answer is, a priori, no. Establishing a clear relation between the parameters of any random field and its spectrum is not an obvious task, in fact, up today the only familiar stochastic process with known spectrum is Brownian motion, and his closer generalization, the fractional Brownian motion, doesn’t have yet a known spectrum. However, under relatively weak hypotheses, the covariance kernel of a GRF turns out to be a Mercer kernel. This opens an alternative to the negative answer previously mentioned, by considering the eigenvalue problem associated to the integral operator induced by the kernel. J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 23 7. Appendix 7.1. Karhunen-Loève Theorem Recent results on functional analysis (see [11] and [12]) allow to construct Mercer’s kernels in more general contexts. A proper interpretation of these results allows to generalize the classic Karhunen-Loève theorem in a very neat way. We first introduce the framework and basics notations from [11]. Let S be a nonempty set and K a positive definite kernel on S, i.e., a function K : S × S −→ C satisfying the inequality n X ci cj K(xi , xj ) ≥ 0, i,j whenever n ≥ 1, {x1 , x2 , . . . , xn } is a subset of S and {c1 , c2 , . . . , cn } is a subset of C. The set of all positive definite kernels over S is denoted by PD(S). If S is endowed with a measure υ, denote by L2 PD(S, υ) the class of kernels such that the associated integral operator Z K(f )(x) := K(x, y)f (y)dυ(y), f ∈ L2 (S, υ), x ∈ S, S is positive, that is, when the following conditions holds  Z Z K(x, y)f (y)dυ(y) f (x)dυ(x) ≥ 0, f ∈ L2 (S, υ), S S i.e., hK(f ), f iL2 (S,υ) ≥ 0, f ∈ L2 (S, υ). Finally we define what is a Mercer’s kernel according to [12]: A continuous kernel K on S is a Mercer’s kernel when it possesses a series representation of the form K(x, y) = ∞ X aj (K)ζj (x)ζj (y), x, y ∈ S, j=1 where {ζj }j∈N is an L2 (S, υ)-orthonormal basis of continuous functions on S, {aj (K)}j∈N decreases to 0 and the series converges uniformly and absolutely on compact subsets of S × S. For the rest of this manuscript we will consider S to be a topological space endowed with a strictly positive measure υ, that is, a complete Borel measure on S for which two properties hold: every open nonempty subset of S has positive measure and every x ∈ S belongs to an open subset of S having finite measure. Besides, as in Section 2, (Ω, F, P) denotes a complete probability space. J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 24 Theorem 7.1. Let (Xs )s∈S be a complex-valued centred stochastic process with continuous covariance function and such that Z E(|Xs |2 )dυ(s) < +∞. (7.1) S Then, the kernel K associated with the covariance function of X is a Mercer’s Kernel. Therefore, X admits a Karhunen-Loève expansion X= +∞ X λj ζj (7.2) j=1 where {ζj }j∈N is an orthonormal basis of L2 (S, υ), Z Xs ζj (s) dυ(s), λj = S with E[λj ] = 0, and there exists a sequence {aj }j∈N of non-negative real numbers such that E[λj λk ] = δjk aj and Var[λj ] = aj . The series expansion (7.2) converges in L2 (Ω × S; C), i.e.,    2 Z J X   lim E  Xs − λj ζj (s) dυ(s) = 0. J→+∞ S j=1 The series expansion (7.2) converges in L2 (Ω; C) for all s ∈ S, i.e., for all s ∈ S  2  J X   lim E Xs − λj ζj (s)  = 0. J→+∞ j=1 The convergence of the series expansion (7.2) is absolute and uniform on compact subsets of S in the mean-square sense. Proof. Let K be the kernel associated to the covariance of the stochastic process X, i.e. K :S×S −→ (t, s) −→ C K(t, s) = E(Xt Xs ), and let K be it’s associated integral operator. From hypothesis (7.1) it is direct to see that the mapping κ, such that s ∈ S 7→ C 3 κ(s) := K(s, s), belongs to L1 (S, υ). Since K is positive definite in the usual sense, K(s, t) = K(t, s) and the matrix   K(s, s) K(s, t) K(s, t) K(t, t) J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 25 is positive definite, hence its determinant K(s, s)K(t, t) − K(s, t)K(s, t) is nonnegative. Thus Z Z |K(s, t)|2 d(υ ⊗ υ)(s, t) ≤ K(s, s)K(t, t)d(υ ⊗ υ)(s, t) S×S S×S Z = 2 < ∞, κ(s)dυ(s) S that is, K ∈ L2 (S × S, υ ⊗ υ). Now, consider f, g ∈ L2 (S, υ) and the classic tensor product of functions, i.e., (f ⊗ g)(s, t) = f (s)g(t), s, t ∈ S, with inner product given by hf1 ⊗ f2 , g1 ⊗ g2 iL2 (S×S,υ×υ) = hf1 , g1 iL2 (S,υ) hf2 , g2 iL2 (S,υ) . Apparently, f ⊗ g ∈ L2 (S × S, υ ⊗ υ), and thus, by Cauchy-Schwarz inequality we obtain K · f ⊗ g ∈ L1 (S × S, υ ⊗ υ). This last condition allows to use Fubini’s theorem, so for f ∈ L2 (S, υ)  Z Z hK(f ), f i2 = K(s, t)f (t) dυ(t) f (s) dυ(s) ZS Z S = K(s, t)f (t)f (s) dυ(t)d υ(s) S S Z Z = E(Xs Xt )f (t)f (s) dυ(t) dυ(s) S S Z Z = E Xs f (s) Xt f (t) dυ(t) dυ(s) S S = E hX, f i2 hf, Xi2 = E hX, f i2 hX, f i2 = E| hX, f i2 |2 ≥ 0, hence, K ∈ L2 PD(S, υ). In conclusion, the kernel K is continuous and L2 (S, υ)-positive definite on S, and the mapping κ belongs to L1 (S, υ). Then, by theorem 3.1 in [12] K is a Mercer’s kernel. The rest of the proof concerns the Karhunen-Loève expansion of the process X and it follows well-known arguments that we reproduce for the convenience of the reader. We have that K has a L2 (S × S, υ ⊗ υ)-convergent series representation in the form +∞ X K(t, s) = aj (K)ζj (t)ζj (s), t, s ∈ S, j=1 J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 26 {aj (K)}j∈N decreases to 0, {ζj }j∈N is a L2 (S, υ)-orthonormal basis. The convergence of the series is absolute and uniform on compact subsets of S × S. From condition (7.1) there exists a set Ω0 ⊆ Ω with P(Ω0 ) = 1 such that for all ω ∈ Ω0 , the mapping s ∈ S 7→ Xs (ω) is in L2 (S, υ). Define the random coefficients Z λj = Xt ζj (t) dυ(t) = hX, ζj iL2 (S,υ) . S E(λ2j ) 2 Note that = hK(ζj ), ζj i2 , hence Cauchy-Scharwz inequality guarantees that λj ∈ L (Ω) for all j. Also, Fubini’s theorem allows to see that E[λj ] = 0, E[λj λk ] = δjk aj and Var[λj ] = aj . Now, for any fixed ω ∈ Ω0 it is clear that  Z Xs (ω) − fJ (ω) := S J X 2 λj (ω)ζj  dυ(s) −−−−−→ 0. J→+∞ j=1 By orthogonality of the (ζj ) we observe that Z 0 ≤ fJ (ω) Xs (ω) − := S Z = J X 2 λj (ω)ζj dυ(s) j=1 |Xs (ω)|2 dυ(s) − S Z ≤ J X |λj (ω)|2 j=1 |Xs (ω)|2 dυ(s) − S J−1 X |λj (ω)|2 := fJ−1 (ω), j=1 therefore, Z |fJ (ω)| ≤ |f0 (ω)| := |Xs (ω)|2 dυ(s), J ∈ N. S By condition (7.1) is clear that E(|f0 |) < ∞, hence, the dominated convergence theorem allows us to conclude that   Z J 2 X E(|fJ |) = E  Xs (ω) − λj (ω)ζj dυ(s) −−−−−→ 0. S j=1 J→+∞ J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 27 Now, fix s ∈ S. Again by Fubini’s theorem we observe that, E Xt − n X 2 λj ζj (t) j=1 n X = E|Xt |2 − n n X  X   ζj (t)E Xt λj − ζj (t)E Xt λj + ζj (t)ζk (t)E λj λk j=1 = E|Xt |2 − n X j=1  ζj (t)E Xt n X   Z n X Xs ζj (s) dυ(s) + ζj (t)ζk (t)δkj ak ζj (t)E Xt S j=1 = E|Xt |2 − n X Z − S Z  ζj (t) E Xt Xs ζj (s) dυ(s) + S j=1 = K(t, t) − n X − ζj (t) K(s, t)ζj (s) dυ(s) + S = K(t, t) − n X K(t, s)ζj (s) dυ(s) S Z = K(t, t) − K(t, s)ζj (s) dυ(s) + S n X = K(t, t) − 2 n X |ζj (t)|2 aj j=1 ζj (t)Kζj (t) − j=1 n X = K(t, t) − |ζj (t)|2 aj j=1 ζj (t) ζj (t) j=1 n X Z j=1 − K(t, s)ζj (s) dυ(s) S ζj (t) n X |ζj (t)|2 aj j=1 Z j=1 n X Z j=1 n X j,k=1  E Xt Xs ζj (s) dυ(s) ζj (t) j=1 n X Xs ζj (s) dυ(s) S j=1 − j,k=1  Z n X ζj (t)Kζj (t) + j=1 |ζj (t)|2 aj + j=1 n X |ζj (t)|2 aj j=1 n X n X |ζj (t)|2 aj j=1 |ζj (t)|2 aj j=1 −−−−−→ 0. n→+∞ Thus, the proof is concluded. Remark 7.1. Karhunen-Loève expansion (or Karhunen-Loève theorem), usually require extra hypothesis, like compactness of the associated space S or some kind of invariance of the field. In that line the Stochastic Peter-Weyl theorem (theorem 5.5 introduced in [18]) may be understood as a Karhunen-Loève theorem for 2-weakly isotropic fields over G a topological compact group with associated J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 28 Haar measure of unit mass. Theorem 7.1 only require condition (7.1) and the continuity of the covariance function. Acknowledgments We are indebted to the Editor and to three Referees, whose thorough reviews allowed for a considerably improved version of the manuscript. References [1] Adams, R. A. and Fournier, J. F. (2003), Sobolev Spaces. Second edition. Pure and Applied Mathematics (Amsterdam). MR2424078 [2] Bateman, H. and Erdélyi, A. (1953), Higher Transcendental Functions. Vol. I - II. McGraw-Hill, New York. [3] Berg, C. and Porcu, E. (2016), From Schoenberg coefficients to Schoenberg functions. Constr. Approx., 1–25. [4] Bergh, J. and Löfström J. (1976), Interpolation Spaces. An introduction. Grundlehren der Mathematischen Wissenschaften, No. 223. Springer-Verlag, BerlinNew York. MR0482275 [5] Bonan, S. S. and Clark, D. S. (1990), Estimates of the Hermite and the Freud polynomials. J. Approx. Theory, 63, 210–224. MR1079851 [6] Christakos, G. (2005), Random Field Models in Earth Sciences. Elsevier [7] Christakos, G. and Hristopulos, T. (1998), Spatiotemporal Environmental Health Modelling: a Tractatus Stochasticus. (With a foreword by William L. Roper). Kluwer Academic Publishers, Boston, MA. MR1648348 [8] Christensen, J. P. R. (1970), On some measures analogous to Haar measure. Math. Scand., 26, 103–106. MR0260979 [9] Dai, F. and Xu, Y. (2013), Approximation Theory and Harmonic Analysis on Spheres and Balls. Springer Monographs in Mathematics. Springer, New York. MR3060033 [10] Dimitrakopoulos, R. (1994) Geostatistics for the Next Century. Springer Netherlands. [11] Ferreira, J. C. and Menegatto, V. A. (2009), Eigenvalues of integral operators defined by smooth positive definite kernels. Integral Equations Operator Theory, 64, 61–81. MR2501172 [12] Ferreira, J. C. and Menegatto, V. A. (2013), Positive definiteness, reproducing kernel Hilbert spaces and beyond. Ann. Funct. Anal. 4, 64–88. MR3004212 [13] Gneiting, T. (2002), Nonseparable, stationary covariance functions for SpaceTime data. J. Amer. Statist. Assoc., 97, 590–600. MR1941475 [14] Gneiting, T. (2013), Strictly and non-strictly positive definite functions on spheres. Bernoulli, 19, 1327–1349. MR3102554 [15] Jones, R. H. (1963), Stochastic processes on a sphere. Ann. Math. Statist., 34, 213–218. MR3102554 [16] Kozachenko, Yu. V. and Kozachenko, L. F. (2001), Modelling Gaussian isotropic random fields on a sphere. J. Math. Sci., 2, 3751–3757. MR1874654 J. Clarke et al./Regularity and simulations of GRFs on Spheres cross Time. 29 [17] Lang, A. and Schwab, C. (2015), Isotropic Gaussian random fields on the sphere: regularity, fast simulation and stochastic partial differential equations. Ann. Appl. Probab., 25, 3047–3094. MR3404631 [18] Marinucci, D. and Peccati, G. (2011), Random Fields on the Sphere. Representation, Limit Theorems and Cosmological Applications. London Mathematical Society Lecture Note Series, 389. Cambridge University Press, Cambridge. MR2840154 [19] Morimoto, Mitsuo (1998), Analytic Functionals on the Sphere. Translations of Mathematical Monographs, 178. American Mathematical Society, Providence, RI. MR1641900, [20] Porcu, E. Alegrı́a, A. and Furrer R. (2017), Modeling temporally evolving and spatially globally dependent data. arXiv:1706.09233v1 [21] Porcu, E. Bevilacqua, M. and Genton, M. (2015), Spatio-Temporal covariance and cross-covariance functions of the great circle distance on a sphere. J. Amer. Statist. Assoc., 111, 888–898. [22] Sasvári, Z. (1994), Positive Definite and Definitizable Functions. Mathematical Topics, 2. Akademie Verlag, Berlin. MR1270018 [23] Schoenberg, I. J. (1942), Positive definite functions on spheres. Duke Math. J., 9, 96–108. MR0005922 [24] Stein, M. (2005), Space-time covariance functions. J. Amer. Statist. Assoc., 100, 310–321. MR2156840 [25] Triebel, H. (1983), Theory of Function Spaces. Monographs in Mathematics, 78. Birkhäuser Verlag, Basel. MR0781540 [26] Triebel, H. (1999), Interpolation Theory, Function Spaces, Differential Operators. Wiley. [27] Zastavnyi, V. P. and Porcu, E. (2011), Characterization theorems for the Gneiting class of space-time covariances. Bernoulli, 17, 456–465. MR2797999
10math.ST
arXiv:1701.03308v2 [cs.DS] 6 Sep 2017 Sampling and Reconstruction Using Bloom Filters Neha Sengupta IIT-Delhi [email protected] Amitabha Bagchi IIT-Delhi [email protected] Srikanta Bedathur IBM-IRL [email protected] Maya Ramanath IIT-Delhi [email protected] Abstract In this paper, we address the problem of sampling from a set and reconstructing a set stored as a Bloom filter. To the best of our knowledge our work is the first to address this question. We introduce a novel hierarchical data structure called BloomSampleTree that helps us design efficient algorithms to extract an almost uniform sample from the set stored in a Bloom filter and also allows us to reconstruct the set efficiently. In the case where the hash functions used in the Bloom filter implementation are partially invertible, in the sense that it is easy to calculate the set of elements that map to a particular hash value, we propose a second, more space-efficient method called HashInvert for the reconstruction. We study the properties of these two methods both analytically as well as experimentally. We provide bounds on run times for both methods and sample quality for the BloomSampleTree based algorithm, and show through an extensive experimental evaluation that our methods are efficient and effective. 1 Introduction Bloom filters, introduced by Bloom in the 1970’s [1], are space-efficient structures for the setmembership problem. They have found numerous applications in a diverse array of settings because of the tremendous advantages they offer in terms of space. Broder and Mitzenmacher surveyed a host of these applications in 2003 [2], and, since then, the usage of Bloom filters has grown and diversified. Typically, these applications rely on the set-membership query being answered correctly with good probability, and are able to deal with the drawback that with some probability a false positive will occur. However, one fundamental question has not yet been addressed: How do we sample an element from a set stored in a Bloom filter? A related question – How do we retrieve the set stored in the Bloom filter? – has also not been addressed. We believe addressing these two problems will open up the possibility of using Bloom filters in applications that need to store, retrieve and/or sample from a large number of sets. For example, storing and subsequently sampling from a large number of dynamic, online communities that form on social networks such as Twitter, Flickr, etc. ([3], [4], [5]), that could help advertisers determine where to target their products. Or storing and retrieving all call records associated with specific locations in crime-related investigations [6]. We note that other compact structures, such as sketches, have been used as compact storage structures from which samples can later be obtained [7, 8, 9]. However, a limitation of this approach is that the sketches that are proposed to be created are specifically for the problem of sampling and tend to be output sensitive in their design (and do not support reconstruction). Our work, on the other hand, shows how to draw samples as well as reconstruct sets from a widely-used generic synopsis structure, the Bloom filter, that is also useful for several other applications. Problem Statement. Formally speaking, if we are given a set S, drawn from a universe or name space U , that is stored in a Bloom filter B (referred to as the query Bloom filter ), if we denote by 1 S(B) those elements of U \ S that are false positives of B (i.e., the query “Is x ∈ S?” answered by B returns YES for all x ∈ S ∪ S(B)), then: 1. an algorithm that samples from B is one that returns an element chosen uniformly at random from S ∪ S(B), and, 2. an algorithm that reconstructs the set stored in B returns the set S ∪ S(B). Since Bloom filters hide information about the elements stored in them providing only (partially correct) answers to membership queries, the natural way of trying to sample from a set stored in a Bloom filter is to fire membership queries with different elements of the name space at the Bloom filter. Such a method, referred to as a Dictionary Attack is not scalable since its running time is linear in the size of the name space, which may be huge. Solution Overview. In this paper, we outline a method that approaches this task much more efficiently. Conceptually, we design a data structure, the BloomSampleTree, that organizes the namespace as a binary search tree. That is, each node of the tree stores a subset of the namespace, but at each level of the tree, the union of these subsets yields the entire namespace. While the root of the tree, by itself, stores all the elements of the namespace, each leaf stores only a small subset of this namespace. Once this binary search tree is constructed, the key idea is to now locate only those leaves which potentially contain elements present in the given query Bloom filter B. This is done by intersecting B starting from the root of the search tree and working our way towards the leaves. Entire subtrees are pruned away because they yield empty intersections, thus eliminating large parts of the namespace. Once we identify the relevant leaves, we can efficiently sample or reconstruct the original set using the dictionary attack method explained above. Note that this search tree needs to be constructed only once and will be repeatedly used for different query Bloom filters. A drawback in this approach is that we are storing the entire namespace in the BloomSampleTree, even though only a small part of it may be actually occupied. Sparse occupancy of a namespace is a regular occurence, especially when we consider non-numeric keys such as strings, where the namespace is typically of the order of 264 , but the actual occupancy is likely to be of the order of 230 (a little over 1 billion) or perhaps less. Therefore, it is space-inefficient to construct a tree for the entire namespace, when a large number of the nodes are going to be empty. In order to address this we present a dynamic version of the BloomSampleTree, we call it Pruned-BloomSampleTree which takes into account the occupancy and can dynamically change its size and structure as the occupancy changes. The BloomSampleTree-based algorithms we provide for sampling and reconstruction have one very important feature: they do not require the hash functions used by the Bloom filter to be invertible. Our method only needs to be able to use those hash functions and will work if we are given the implementation of the Bloom filter used to store the set. It is also important to note that we do not distinguish between true elements of the set stored in the Bloom filter and the false positives that are created in the process of insertion. We approach the Bloom filter as is without any prior knowledge of what has been inserted in it, and without any method of distinguishing true elements from false positives. In summary, our method is designed to work efficiently in a scenario where: i) the namespace is potentially large, even dynamic, ii) the no. of interesting subsets is large (in the millions or billions) and may continue to grow indefinitely, iii) we need to either sample from or reconstruct a subset(s) from the set of interesting subsets, stored in the form of Bloom filters (specifically, these are our query Bloom filters). We present our methods as an aid to the engineer who has chosen to use Bloom filters for a particular application and has optimised parameters to achieve a given level of accuracy (ie. ratio of true elements to all the elements that return a true answer to a membership query) and who has a way of dealing with false positives. Contributions (i) We introduce a novel data-structure called BloomSampleTree that can be used sample from a set stored in a Bloom filter as well as reconstruct that set. The BloomSampleTree takes into account the occupancy of the namespace and can change size as the occupancy changes, 2 (ii) We provide theoretical bounds on the runtime and on the quality of samples generated by our BloomSampleTree-based algorithm, show them to be near-uniform. (iii) We show through extensive evaluations that our BloomSampleTree-based algorithms are efficient and provide good quality samples. Organization In Section 2 we review the literature. We provide a brief background on Bloom filters and outline the framework in which our methods operate in Section 3. Section 4 outlines two baseline techniques for sampling from Bloom filters, along with a discussion on their limitations and the need for our BloomSampleTree method. The BloomSampleTree for sampling and reconstruction are described in detail in Sections 5 and 6. The results of our detailed experimental analysis are presented in Sections 7 and 8. 2 Related Work Bloom filters are one of the most widely used data structures for approximately answering set membership queries. Their compact storage and efficient querying through simple bit operators has made them valuable in many different settings. A thorough survey of Bloom filters and their applications are available in [2, 10]. Despite their widespread use, we are not aware of any work that systematically addresses the problems of generating provably uniform samples using Bloom filters and reconstruct the original set at a given level of accuracy in an efficient way. The problem of identifying at least one true positive from the Bloom filter has been considered in an adverserial setting to study how resilient the Bloom filters are for dictionary-based attacks [11, 12]. Given a Bloom filter, an adversary can mount an attack to obtain some elements of the original set by repeatedly posing queries on the Bloom filter – potentially obtaining a large number of false positives, but also some true positive elements. In our work, we do not operate in an adversarial setting–we assume complete knowledge of the domain of values represented by the Bloom filter and the hash functions used. Given an accuracy level, our aim is to efficiently generate provably uniform random samples from the original set as well as to reconstruct the set as per the accuracy requirements. We systematically solve these problems and back up our solutions with detailed analysis of time complexity and accuracy. Sketches for Handling Large Datasets Bloom filters belong to a general class of approximation datastructures called sketches or data synopses, which compactly represent massive volumes of data while preserving some vital properties of the data needed for further analysis [13]. Some of the sketches used frequently in databases community include histograms, wavelets, samples, frequency and distinct-value based sketches, and so on. However, most of these synopses datastructures are used under the assumption that the underlying database is always accessible (e.g., in the case of histograms and samples) or not required (e.g., streaming scenarios). Reconstructing the underlying set of data values at a given level of accuracy in an efficient manner is not their objective to begin with. Only recently, there have been some results which show how sketches can be used for generating samples, called Lp -samplers [8, 9] which generalize earlier work on inverse sampling [7]. In these, the goal is to maintain a synopses structure for a stream of updates (i.e., addition and deletion of counts) over a given domain of size M , such that at any time it is possible to sample with high accuracy the elements in probability proportional to their number of occurrances. Unlike these techniques, our approaches are not focused on streaming setting, and are not designed for specific forms of sampling. The proposed BloomSampleTree approach can be used to generate uniform samples from Bloom filters, a widely-used and generic synopsis structure. Trees and Bloom filters In this paper we present the BloomSampleTree that comprises a complete binary tree with Bloom filters stored in every node for the purposes of sampling and reconstruction. Yoon et. al. [14] also propose a structure that comprises a complete d-ary tree with Bloom 3 filters at every node to address the multiset membership problem. Similar in flavor to Yoon et. al.’s structure is Bloofi proposed by Crainiceanu and Lemire who also address the multiset membership problem by representing each set as a Bloom filter stored at a leaf of a tree, and building the tree by combining these Bloom filters hierarchically [15]. While the flavour of both these structures is similar to our BloomSampleTree but their concern is the problem of multiset membership testing and so the principle on which their trees are built is completely different from the principle on which we build our tree and the contents of the Bloom filters stored at each node both bear no relationship to what we store in each node. Another work that combines Bloom filters and trees is by Athanassoulis and Ailamaki [16] where the authors modify B+ -trees by placing Bloom filters at their leaves to create approximate tree indexes that seek to exploit data ordering to improve storage performance. Their structure is completely different from ours in intent and design. 3 Preliminaries In this section, we briefly provide the necessary background in Bloom filters, and subsequently describe the framework which our methods operate in. 3.1 Bloom Filters A Bloom filter is a probabilistic data structure used to space-efficiently store the elements of a set. It comprises a bit array of m bits, along with k independent hash functions, h1 . . . hk . An empty set is represented by a Bloom filter each of whose bits is 0. For each element x in a non-empty set, the k array positions indicated by h1 (x) . . . hk (x) are set to 1. A Bloom filter supports membership queries, i.e. a Bloom filter B(S) storing a set S can answer queries of the form “is x ∈ S” for any x, with a false positive probability that depends on the number of bits in B(S) and S. x is hashed using each of the k hash functions to obtain k array positions. If the bit at each of these positions is set, then the result is positive. Since these bits could have been set due to the insertion of other elements, the probability of a false positive is non-zero and evaluates to ≈ (1 − e(−kn/m) )k . A Bloom filter is incapable of false negatives. Other than the membership query, the operation of union and intersection on a pair of Bloom filters is also supported and can be implemented using bitwise OR and AN D operations respectively. If B(A), B(B), and B(A ∪ B) use the same m, the same set of hash functions, and are over the same namespace of values then, B(A ∪ B) = B(A) ∪ B(B). Also, if B(A), B(B), and B(A ∩ B) use the same m and the same set of hash functions, then B(A ∩ B) = B(A) ∩ B(B), with probability 1 k2 |A−A∩B||B−A∩B| (1 − m ) [17]. For two fixed, disjoint sets S1 , S2 ⊂ U , each represented by Bloom filters of m bits and hash functions h, the false set overlap predicate F SO∩ (S1 , S2 , h) is true if B(S1 ) ∩ B(S2 ) 6= φ even though S1 ∩ S2 = φ. A false set overlap of S1 and S2 by Bloom filter intersection of B(S1 ) and B(S2 ) is reported with probability [18], k2 |S1 ||S2 |  1 P[F SO∩ |h] = 1 − 1 − m 3.2 (1) Framework Our methods operate on a database D = {Xi | i = 1, . . .} of Xi = {xj |xj ∈ M} which are subsets of elements drawn from a namespace M of size M . Instead of operating on the D directly,we assume we are only given with a compact approximation D̄ where each Xi is represented by a Bloom filter B(Xi ), for a given length of the filter (in bits), m, and the set of hash functions used in its construction, H. Such collections of subsets of elements are commonly seen in many application settings including graph databases – to represent the adjacency list of each vertex, information retrieval – to represent the list of documents where a keyword occurs, etc. 4 The first task we are interested in tackling in this setting is that of generating a random sample given D̄. Specifically, given information about other parameters used in building this approximation viz., m, H and M, we would like to obtain a provably uniform random sample from a given X ∈ D - the original database. Since we are operating on an approximate representation, it is also expected that a fixed amount of inaccuracy (measured as the probability of sampling an element which is not in X) is tolerable and is specified as an input to the system to begin with. It should be noted that this inaccuracy is naturally linked to the probability of false positives in Bloom filters, and thus for a given level of inaccuracy (or accuracy) the Bloom filters used in D̂ have to be designed. The second task, a natural extension of the above, is to reconstruct the original entry X in the database with high accuracy. 4 Sampling and Reconstruction We describe two approaches to sample an element from a set and reconstruct a set stored as a Bloom filter. The first of these is a simple ”dictionary attack”-based method (DictionaryAttack). The second uses the weakly invertible property of certain types of hash functions to do sampling (HashInvert). While both methods can be used to sample from as well as reconstruct a Bloom filter, the DictionaryAttack method suffers from high runtime inefficiencies, while the HashInvert method provides no guarantees on the quality of the sample. We compare our BloomSampleTree algorithm against these two baselines and highlight the advantages and disadvantages of each approach in detail in Section 7. DictionaryAttack: Sampling with Membership Queries The DictionaryAttack algorithm relies on reservoir sampling to guarantee a uniform sample. This is equivalent to reconstructing the input set and sampling an element from it. It proceeds as follows. A membership query is fired on the input set for each element in the namespace. When a positive is reported for an element, that element is retained as the sample with diminishing probability proportional to the size of the set reconstructed so far [19]. In particular, if n0 is the number of positives reported until now, then the (n0 + 1)th positive is retained as the sample with probability 1/(n0 + 1). Clearly, the complexity of this algorithm is O(M ), where M is the size of the namespace. Note that it is straightforward to use this method to reconstruct the original set. HashInvert - Sampling with Invertible Hash Functions This method assumes that the hash functions are weakly invertible. A hash function h is weakly invertible if given the value of h(x), one can find a set of values S such that ∀y ∈ S, h(y) = h(x). An example of a weakly invertible hash function is h(x) = (ax + b)%c, where a, b, and c are constants. Knowing the namespace M , it is straightforward to find a set of elements that all hash to h(x). Given a Bloom filter B, it exploits the weak invertibility of the hash functions to invert a randomly sampled SET bit s into k candidate sets P1 (s), P2 (s) . . . Pk (s), each obtained using a different hash function. The k candidate sets are subsequently pruned using the membership queries on the Bloom filter to obtain Sk P10 (s), P20 (s) . . . , Pk0 (s). A value sampled uniformly at random from i=1 Pi0 (s) is the final sample returned. Analysis When sampling from the obtained candidate sets is done using a method such as reservoir sampling, the HashInvert method occupies no extra space. Sampling a set bit takes O(m) time, where m is the size of the Bloom filter. Once a set bit is chosen, inversion using a hash function takes O M m time. The overall time taken for sampling is  O m + kM . m Note that, in contrast to DictionaryAttack, which provides uniformly random samples, no bounds are given regarding the quality of the samples in the case of HashInvert. However, the algorithm can be used to reconstruct the original set by exhaustively running the HashInvert algorithm on all set bits of the Bloom filter. 5 A simple trick gives us more benefits from the HashInvert algorithm. If the Bloom filter is dense, then the number of UNSET bits (0-bits) are potentially less than the number of SET bits. Therefore, instead of inverting the set bits, we can invert the unset bits. This results in a set of elements which are not present in the original set. Therefore, the original set can be recovered from a set difference operation. 5 Bloom Sample Tree In this section we define the BloomSampleTree data structure that will help us sample from and reconstruct a set stored in a Bloom filter. The BloomSampleTree basically organises the entire namespace. Note that the BloomSampleTree is built once and is then used repeatedly to sample from any given query Bloom filter B. 5.1 Definition The BloomSampleTree is a complete binary tree, denoted as T , with log M/M⊥ levels, where M⊥ is a threshold whose choice we discuss later in this section. Every node in the BloomSampleTree has a Bloom filter that stores a subset of the namespace. Every level of the tree contains the entire namespace partitioned uniformly amongst the nodes of that level. Hierarchically speaking the organisation is laminar in the sense that the union of the subsets of the namespace stored in two sibling nodes gives us the set stored in their parent node. All the Bloom filters used in the BloomSampleTree have the same parameters – viz., m, the number of bits and, H, the set of hash functions, as the Bloom filters used for the sets we are sampling from (or trying to reconstruct). The reason for this is that we will be frequently intersecting the Bloom filter B of the set of interest with the Bloom filters Bi stored at various nodes in the BloomSampleTree. We now present a more formal definition. Definition 5.1. Given a namespace M of size M , the size of the Bloom filter m, a set of hash functions used for construction H of the form h : M → {0, 1, . . . , m − 1}, and an integer parameter M⊥ < M the BloomSampleTree, T (M, m, H, M⊥ ), is a collection of Bloom filters   M Bi,j : 0 ≤ i ≤ log , 0 ≤ j < 2i , M⊥ such that each of these Bloom filters uses a bit vector of size m and the hash functions H, and with the property that the Bloom filter Bi,j stores the elements   M M ` : j · i ≤ ` < (j + 1) · i . 2 2 Note that, • The collection of Bloom filters forms a tree structure. Since the portion of the name space stored in Bi,j is partitioned equally amongst the nodes Bi+1,2j and Bi+1,2j+1 , Bi,j is the parent of these two nodes in the tree. • The leaves of the tree all store sets of size M⊥ . The namespace is not further subdivided. Figure 1 shows an example BloomSampleTree for a namespace of M = 16. Each node in the tree, except for the root, consist of Bloom filters of size m = 10 storing the range of elements depicted at the node. A set S = {4, 6}, stored as Bloom filter b is the query set that we need to sample from or reconstruct. Note that the Bloom filters in T are constructed with the same m and H as the Bloom filter b for set S. 6 Bloom Sample Tree bT (M = 16, m = 10, k = 2) (0..15) 1111101101 1111111110 (0..7) (8..15) (0..3) (4..7) (8..11) (12..15) 1101101100 1011011001 0110111010 1000011100 Bloom filter b 0011100001 S = {4,6} Figure 1: A BloomSampleTree T with 3 levels and the query Bloom filter b representing the set S from which we want to sample 5.2 Pruned-BloomSampleTree As mentioned in the introduction, even though the namespace itself may be large, it is likely that only a small portion of it is occupied. Therefore, building a complete BloomSampleTree as explained in the previous section potentially wastes a huge amount of space. For example the real-world data set on which we experimented (see Section 8) is taken from Twitter and contains 7.2 million user ids distributed in a namespace of size 2.2 billion, i.e., the fraction of the namespace occupied is of the order of 10−1 . Therefore, in practice we build the tree only for those portions of the namespace that are actually occupied; we call this condensed version the “Pruned-BloomSampleTree”. This tree can dynamically change its structure, based on the change in the occupancy of the namespace. That is, if more of the namespace is assigned, then the tree potentially contains more nodes to reflect that. An overview of the algorithm to build this tree is as follows: Let M0 ⊆ M be the set of identifiers that are currently in use (M is the namespace, M 0 = |M0 | ). • Initialise queue with Node(0, log M ). • Repeat until the queue is empty – Dequeue Node(a, b). /* b is the level, a is the offset within that level */ – Check if the range (a, a + 2b − 1) has a non-empty intersection with M 0 . 7 ∗ If yes, then create Bb,a/2b and attach in the tree; insert elements from M0 in the range (a, b) in Bb,a/(2b ) ; if b > log M⊥ then enqueue Node(a, b − 1), Node((a + 2b−1 ), b − 1). /* Create the Bloom filter corresponding to the subrange and grow the next level at this point */ ∗ If no, then do nothing. The above algorithm essentially goes down the tree building subtrees where required to accommodate elements of M 0 and ignoring subtrees corresponding to ranges that have no overlap with M 0 . Although this algorithm constructs the search tree when the M 0 is known ahead of time, it is easy to see how to evolve the Pruned-BloomSampleTree when M 0 grows (e.g. when new Twitter accounts are made)–either we need to insert this new element into already existing nodes in the tree, or we need to create a new node (and potentially its subtree). The time taken to build the Pruned-BloomSampleTree offline is proportional to the size of the final tree constructed multiplied by the time for the range query on M 0 . The time taken to update the tree is proportional to the height of the tree. 5.3 Sampling with the BloomSampleTree Given a query Bloom filter B to sample from, the algorithm proceeds from the root in the following recursive manner and relies on the pruning of the search space for performance gains. • At a given (non-leaf) node, compute the intersection of the Bloom filters stored in the left and right children of this node with b. If for both child nodes, the intersection is empty, then b does not contain any element belonging in the range associated with this node. Therefore the subtree rooted at this node is pruned from the search. • If intersection with only one child is non empty, then the search proceeds along that child node. The other child node and the subtree rooted at it are pruned from the search. • If intersection with both child nodes is non empty, then one of the child nodes is selected with probability directly proportional to the estimated number of elements in their corresponding intersections and the search proceeds along that child. Note that it is possible that the intersection was a false positive and this is discovered further down this subtree. In that case, the search then backtracks and proceeds along the other child node. The estimated number of elements in the intersection of two Bloom filters B1 and B2 is given by the following expression [20]:   ∧ ×m−t1 ×t2 ln m − tm−t − ln(m) 1 −t2 +t∧  Ŝ −1 (t1 , t2 , t∧ ) = 1 k × ln 1 − m where t1 is the number of bits set in B1 , t2 is the number of bits set in B2 , m is the size of both Bloom filters, k is number of hash functions used in both, and t∧ is the number of bits set in the bitwise AND of B1 and B2 . We recall that Equation (1) gives us the probability that this intersection is incorrectly estimated to be non-empty when the two sets stored in B1 and B2 are disjoint. We discuss this issue further in Section 5.6. • At a leaf node, every element in the range of the node is checked for membership in b. The sample at this leaf node is a value sampled uniformly at random from the set of values that satisfy the membership test of b. If none of the elements within this range satisfy the membership query it indicates that the search has reached this leaf node due to a (string of) false set overlap(s). In this case, the sample at this node is N U LL. This algorithm is called BSTSample, and a formal description is in Algorithm 1 Figure 2 shows a typical scenario that is encountered when sampling with the BloomSampleTree. The numbers to the side of the node indicate the order in which the nodes are traversed. As shown, the algorithm ultimately generates a sample from a leaf node by following one ”true” path out of several false positive paths that may branch out at multiple places. Note, for example, that node 7, is ultimately determined to have led to several false positive paths discovered subsequently in 8 False Positive Path Empty Intersection Potential Path True Path (1 ... 10M) 1 3 2 4 5 7 6 8 9 10 14 12 Subtree pruned from search 11 15 25 13 Subtree not visited at all 37 38 Figure 2: A typical scenario: Sampling with BloomSampleTree. A False Positive Path is chosen because of errors in determining the empty intersection. The Empty Intersection immediately results in the pruning of a subtree. Potential paths are left unexplored when there is choice of following either subtree. The True Path is the path actually taken by the algorithm to generate the sample. its subtree. In contrast, the whole subtree at node 4 is immediately pruned from the search space. Once the search reaches a leaf, a brute force search is conducted and there is no scope of a false set overlap due to Bloom filter intersection. Sampling multiple items The algorithm presented for sampling outputs a single sample. To sample multiple items we could run this algorithm multiple times. However, these multiple runs can be done together in one pass down the BloomSampleTree as we now explain. Given an integer r that is less than the size of the set stored, we send r independent search paths down the BloomSampleTree according to the algorithm BSTSample. These paths are sent down the BloomSampleTree in a single pass since all the paths arriving at any internal node or leaf can be processed at the node or leaf before we move on. If at a node we find that the Bloom filters at both its children intersect with the query Bloom filter, we take each of these r paths and, independently of the other paths choose one of the children at random as in BSTSample and send the path down to that child. This continues till each of the r paths reaches a leaf. Let us take a concrete example to illustrate this process: Assume we are given a query Bloom filter B and r = 3. We intersect B with the Bloom filters B1,1 and B1,2 stored in the left and right child of the root of BloomSampleTree and estimate the size of both intersections, let us say they are k1 and k2 . Now throw three independent coins biased to come up heads with probability k1 /(k1 + k2 ). Suppose two of these coins come up heads and one comes up tails, recursively call two instances of the multiple sampling method with B on B1,1 with r = 2 and on B1,2 with r = 1. It is easy to see that given the tree structure of the BloomSampleTree, such an extension of the algorithm BSTSample will, in general, perform better than r times the running time for the case when we ask for a single sample as output. Since all the paths behave like a single sampling path of BSTSample the guarantee on sample quality is maintained. Finally, if two or more paths happen to reach the same leaf we can sample at that leaf with or without replacement depending on whether the r samples are to be generated with or without replacement. 5.4 Summary of Analyses Given the BloomSampleTree structure and the algorithm for sampling, we briefly summarise the analyses we performed and the effect of the various parameters. Quality of samples The first question we answer is whether our method generates a uniformly random sample. The answer is that a uniformly random sample in indeed generated with high probability. We prove this property in Section 5.5 and show this empirically as well in Section 7.2. 9 Accuracy Given that Bloom filters are approximate data structures, it is possible that the samples we generate do not actually belong to the original set (recall that a sample is generated by membership queries at a leaf). We quantify the accuracy of our samples as follows: acc = n n + (M − n) ∗ F P where n is the number of elements in the query set, M is the size of the namespace and F P is the probability of false positives in our Bloom filter implementation. The accuracy defined here simply computes the ratio of correct outcomes to all potential outcomes of the algorithm. Clearly the size of the Bloom filter m has an effect on accuracy and we can determine m based on the desired accuracy. We show the performance of our method for various values of accuracy in Section 7. Runtime analysis The runtime of the algorithm depends on the number of false paths it may follow. We analytically show the expected number of nodes visited in Section 5.5, given a BloomSampleTree. However, we also address a practical issue here with regard to runtime – the cost of performing intersections at a node as opposed to the cost of performing a number of membership queries. Note that it is possible that based on the hash function used, the cost of membership queries may be cheaper or more expensive than the cost of intersections. These two costs are directly related M to the no. of elements stored at the leaf, M⊥ and the height of the BloomSampleTree is log M . We ⊥ tradeoff the costs as follows: If mcost is the cost of one membership query to a Bloom filter of size m with k hash functions, and icost is the cost of an intersection between a pair of bloom filters of size m, then, at a current node N , storing N⊥ values, we would like to determine whether it is better to perform membership queries over N or perform intersections until the leaf which is at most at level log N⊥ below N . If performing membership queries is preferred over traversing further down in the tree, we can truncate the tree such that N is the leaf of the tree. Hence, we determine M⊥ = max N⊥ , such that N⊥ icost ≤ . log N⊥ mcost We empirically show the runtime costs throughout Section 7. Memory requirements The memory required to store the BloomSampleTree (which is constructed only once and used repeatedly) depends on the size of the Bloom filter m and the number M of levels in the tree, log M . An interesting observation here is that, in our framework, there is no ⊥ tradeoff between memory and accuracy or memory and runtime. The tradeoff is between accuracy and runtime, as explained in the previous paragraphs. Therefore, while we set the best possible M m and log M in order to optimize the runtime, the memory required may actually reduce for in⊥ creased accuracy. The cause for this is that while we will need to use a larger Bloom filter in the BloomSampleTree for increased accuracy, we would potentially reduce the number of levels so as to reduce the intersection cost (as described in the previous paragraph). The effect of this is that we end up reducing the space used, while increasing accuracy, but also increasing the runtime. We discuss empirical results about this in more detail in Section 7.2. 5.5 Sample quality and running time The first question that arises is: what is the distribution of samples BSTSample produces? Our aim is to produce a uniform distribution from the set stored in the Bloom filter. We present a theoretical result that shows that the samples produced are near uniform. We first state the result and then discuss its implications. Proposition 5.2. Given a set S with |S| = n taken from a name space of size M , if we run BSTSample on S with a BloomSampleTree T (M, m, H, M⊥ ) such that |H| = k, define (m) = √ 2nk(log m+log log m+log n) . Then the probability that the sampling algorithm finally samples from m an L ⊆ S of size ` that is stored in a Bloom filter in a leaf of the BloomSampleTree lies between 10 M (1−(m))· n` and (1+(m))· n` with probability at least 1− log4 m , as long as f (m) = 2·(m)·log M →0 ⊥ as m → ∞.  1 n . Let ẑ be a random Proof. Probability of a bit being zero after insertion of n elements = 1 − m variable indicating the number of zero bits. We have that,  nk 1 E(ẑ) = m 1 − m or that, E(ẑ) = mp, where p = 1 −  1 nk . m From Theorem 1 of [21], we have that P [|ẑ − mp| > m] < 2e √ We set  = 2nk(log m+log log m+log n) . m −2 m2 2nk The estimated size of the population of a bloom filter is n̂ = c= 1 . 1 k log(1− m ) 2 nm log m = o(1). log (ẑ/m) , or n̂ = 1 k log(1− m ) Then P[|ẑ − mp| > m] < c log(ẑ/m), where Also, from the above bound, we have that with probability at least 1 − 2/nm log m, mp − m ≤ ẑ ≤ mp + m. Therefore, with probability at least 1 − 2/nm log m, c log(p − ) ≤ n̂ ≤ c log(p + ). For small values of , Substituing c = 1 1 k log(1− m ) c (1 − ) log p ≤ n̂ ≤ c(1 + ) log p.  1 nk , and p = log 1 − m , n (1 − ) ≤ n̂ ≤ n (1 + ) , with probability at least 1 − 2/nm log m. Returning to the setting of the BloomTree, let the number of elements in the intersection of the query Bloom filter with the root node be K. Similarly, let the number of elements in the intersection of the query Bloom filter with the left and right child of the root node be K1 and K −K1 respectively. In the sampling process, the probability of proceeding along the left child is directly proportional to the estimated number of elements in the intersection of the left child and the query Bloom filter. Let n̂l and n̂r be the estimated number of elements in the left and right child of the root node respectively. n̂l P[selecting the left child] = n̂l + n̂r With probability at least 1 − 4/nm log m, n̂l (1 − ) K1 ≤ , (1 + ) K1 + (1 + ) (K − K1 ) n̂l + n̂r and n̂l (1 + ) K1 ≤ , n̂l + n̂r (1 − ) K1 + (1 − ) (K − K1 ) i.e., (1 − ) K1 n̂l (1 + ) K1 ≤ ≤ . (1 + ) K n̂l + n̂r (1 − ) K 11 Now, for || < 1/2, (1 − )/(1 + ) ≥ 1 − 2 and (1 + )(1 − ) ≤ 1 + 4 and so (1 − 2) K1 n̂l K1 ≤ ≤ (1 + 4) K n̂l + n̂r K Consider now a given leaf node L of the Bloom Tree that contains a subset S 0 of size `. The probability that an unbiased process of sampling should reach this leaf is `/n. We now estimate what the probability of reaching this leaf is in the BloomTreeSample method. Consider the path down the BloomTree to the given leaf: L0 , L1 , . . . Llog M/M⊥ = L and the sequence of subsets of S stored in these nodes be S = S0 , S1 , . . . , Slog M/M⊥ = S 0 . Then we have that |Slog M/M⊥ | |S1 | |S2 | ` · ··· = . |S0 | |S1 | |Slog M/M⊥ −1 | n Now, using the analysis done above, we can argue that for the choice of  above, the probability of moving from Si to Si+1 is at least (1 − 2)|Si+1 |/|Si | and at most (1 + 4)|Si+1 |/|Si | with probability 1 − 4/nm log m. Repeating this argument over log M/M⊥ levels we get that (1 − 2)log M/M⊥ · ` ≤ P[BloomTreeSample reaches L], n and P[BloomTreeSample reaches L] ≤ (1 + 4)log M/M⊥ · ` , n with probability at least 1− 4 log M/M⊥ 4 ≥1− . nm log m n log m , where the last inequality applies because log M/M⊥ < m whenever f (m) → 0 as m → ∞. Since the set S can be present in at most n such leaf nodes, hence for any leaf node containing an element of S, the probability that BloomTreeSample reaches that leaf node is at least 1− 4 . log m Now, we recall that (1 + x) < ex and for x < 1/2, e−x/2 < (1 − x) and so In other words, with high probability ` e− log M/M⊥ · ≤ P[BloomTreeSample reaches L], n and ` P[BloomTreeSample reaches L] ≤ e4 log M/M⊥ · , n for any leaf L that contains an element of S. Now, whenever  log M/M⊥ is o(1), i.e., it goes to 0 as m grows, both the bounds go to 1 proving the result. Discussion on sample quality We note that since f (m) grows faster than (m), the condition that f (m) → 0 as m → ∞ implies that (m) → 0 as m → ∞. The import of Proposition 5.2 is that the eventual leaf that BSTSample selects for sampling is chosen with probability that is very close to being proportional to the number of elements of the set S that belong to the segment of the name space stored in that leaf. In the absence of false positives, which happens in the limit as the size of the Bloom filter m → ∞, this would lead to perfectly uniform sampling. We now move on to analysing the running time of the algorithm. Clearly the running time depends on a number of factors. We provide a theoretical analysis of the number of nodes that BSTSample visits as it moves down the tree to reach a leaf from where it generates a sample. Clearly the lower bound for this number is the height of the tree, i.e., log M/M⊥ . We are not able to match 12 this lower bound but we are able to control the number of extra nodes visited and give a result which can guide us on how to choose our system’s parameters to ensure a good asymptotic running time. We show the following result: Proposition 5.3. The expected number of BloomSampleTree nodes visited by the algorithm BSTSample when sampling from a set of size n using a BloomSampleTree T (M, m, H, M⊥ ) where |H| = k is   M M k2 n . O log + M⊥ m of Proposition 5.3. The path BloomTreeSample takes down to the leaf node from which it generates a sample has length equal to the height of the tree, i.e., log(M/M⊥ ). Along this way, there are many branches that are caused by false set overlaps, i.e., the intersection Bloom filter has at least k bits set but no element of the name space has all k of its bits set in this Bloom filter. These branches need to be followed since it is not possible to distinguish them from the branch that takes us to genuine true or false positives of the set stored in the Bloom filter that we are sampling from. In order to estimate the number of nodes visited over and above the log(M/M⊥ ) in the true path, we need to estimate how many such false set overlap nodes we visit. We proceed by showing that below a certain depth in the BloomTree a false set overlap branch leads to a constant number of false set overlap nodes being visited below it. Hence, below that depth the number of extra nodes being visited is just a constant factor more than the necessary nodes being visited along the true path. Above that level, however, we cannot make any such claim so we just assume we visit every node. Formally, we proceed by making the following claim: Claim 5.4. Given a node u of depth d in a BloomTree T in which M⊥ names are stored at every leaf, and a query set S such that S ∩ M [u] = ∅ where M [u] denotes the subset of the namespace M that is represented in the subtree of T rooted at u, if the probability that the intersection of two Bloom filters of size m containing S and M [u], i.e., the quantity  k2 n|M [u]| 1 αS (d) = 1 − 1 − , m is at most 1/2, and if L(d) is the number of nodes that algorithm BloomTreeSample visits in the subtree of u conditioned on the event that it reaches u, then E(L(d)) = αS (d) . 1 − 2αS (d) √ Proof. The proof of the claim follows by noting that if αS (d) = 1 − x, then αS (d − 1) = 1 − x, since the number of names stored in any node of a child is exactly half of those stored by its parent in the BloomTree. Noting further that it is only if the sampling algorithm finds an overlap at u that it goes into the subtrees of u’s children, we get E(L(d)) = αS (d) [1 + 2L(d − 1)] , Taking expectations repeatedly we get 1 1 1 E[L(d)] = (1 − x) + 2(1 − x)(1 − x 2 ) + 4(1 − x)(1 − x 2 )(1 − x 4 ) . . . , √ summed till the leaf level, where x = 1 − αS (d). Since x < 1, 1 − x < 1 − x, which allows us to say that log(M/M⊥ )−d X 1 E[L(d)] = (2αS (d))i , 2 i=1 from where the result follows whenever αS (d) < 1/2. Note that this argument is basically the same as saying that the sampling algorithms visits to nodes below a level d for which αS (d) < 1/2 is dominated by a subcritical branching process, which goes extinct with probability 1 and yields 1/(1 − µ) nodes in expectation, where µ is the mean of the progeny distribution (c.f. [22]) 13 Noting that since |M [u]| = M/2d whenever the depth of u is d, the condition that αS (d) < 1/2 is satisfied whenever   M k2 n d > d∗ = log , m ln 2 ∗ and that the BloomTree up to d∗ levels contains 2d +1 − 1 nodes, we get the result. Discussion on running time Looking at the result we note that the ratio of name space to Bloom filter size is a critical element in the number of nodes visited, i.e., raising the number of bits in the Bloom filter will benefit the running time (at least up to the point where the second term in the running time analysis continues to dominate the first term). The number of hash functions used and the size of the set being sampled from are also correlated with the running time, which follows intuition. 5.6 Determining the empty intersection The BloomSampleTree data structure and the algorithm for sampling are both straightforward to implement. However, one practical problem we encounter is that at each node that the algorithm visits, a set intersection needs to be performed that determines whether to prune that branch or not. Unfortunately, there is no reliable way to determine that the size of a set intersection is empty, since even a single set bit results in a non-zero size estimation. Therefore, we use thresholding to overcome this problem. That is, if the estimated size of the set intersection is below a particular threshold, we consider the intersection to be NULL. Note that this heuristic can potentially affect the theoretical guarantee offered in Proposition 5.2, but in effect it will not since the probability of making a wrong decision here, i.e. assuming a set if empty when in fact it is not, is very small if we choose the correct threshold. A wrong decision here implies that certain elements of the set are never presented as samples, but, as we see in Section 7.2, this does not happen in practice. 6 Reconstruction with BloomSampleTree A recursive traversal of the tree results in a reconstruction of the set. Given a Bloom filter B, if the intersection with B at a non-leaf node is empty, then the reconstructed set at this node is the empty set, and the subtree rooted at this node can be pruned from the search. However, if the intersection is not empty, then the search continues along the left and the right children and the final reconstructed set at this node is the UNION of the reconstructed sets obtained from the two child nodes. If the intersection with B at a leaf node is not empty, we conduct a brute force search on the range of this node as before. However, instead of sampling a value from the set of elements thus obtained, we return the set itself as the reconstructed set at this node. We note that the expected number of nodes of the BloomSampleTree visited by the reconstruction algorithm can be analysed in a manner similar to BloomTreeSample. This expected number will come to    M M⊥ k 2 O n · log + . M⊥ m We note that extracting a single element of a set from the treelike structure of the BloomSampleTree would take log M/M⊥ and, in the worst case, assuming the different elements of the set are widely distributed in the name space, the worst case number of nodes visited for reconstruction will be n log M/M⊥ at least. Our algorithm is, unlike in the case of sampling, able to meet this lower bound exactly in an asymptotic sense. Also, since the second term above is directly proportional to k 2 and M⊥ and inversely proportional to the size of the Bloom filters used, m, we can choose these parameters appropriately to minimize the time taken. 14 7 Experimental Evaluation with Static Namespace In this section, we describe several experiments that we conducted to determine the effectiveness of our techniques for both sampling as well as reconstruction when the namespace is static. In Section 8, we describe our experiments where only a fraction of the namespace is actually used. 7.1 Setup We experimented with both synthetic as well as real datasets. We made extensive use of synthetic datasets to generate controlled micro-benchmarks. We varied the namespace size (M ), from which the elements are drawn, between 105 -107 . We also varied the size of the sets (n) between 100 to 50, 000, and generated them either by uniformly sampling from the namespace or by forming random local clusters (details below). As we pointed out earlier in Section 5.4, the desired accuracy levels can be used to determine the size of the Bloom filter m to construct the BloomSampleTree. We varied the accuracy requirements between 0.5 – 1.0 and accordingly designed the Bloom filters. For simplicity of experiments we kept the number of hash functions to 3, although we experimented with different classes of hash functions viz., simple, Murmur3 and MD5. Table 1 summarizes the parameter choices used in our experiments. Unless mentioned explicitly, the default values of parameters mentioned in this table were used in our experimental evaluations. Generating clustered and uniform query sets We report results on two kinds of randomly generated query sets. Uniform sets are constructed by generating elements uniformly at random, without replacement, from a given range. The idea for generating clustered query sets comes from the observations in Web graphs where neighbour sets of vertices typically have their ids clustered around a few nodes [23]. To generate clustered query sets, n elements were iteratively sampled from the namespace using a pdf that is updated after each sample is drawn. Initially, the pdf begins as that of the uniform distribution. After a sample s is drawn, we identify x = max{i|i < s, pdf (i) > 0} and y = min{i|i > s, pdf (i) > 0} as the neighbors of s. We divide the pdf (s) equally into pdf (x) and pdf (y), and set pdf (s) = 0. To generate more aggressively clustered sets, one can subtract p% from the probability of each element and equally divide the accumulated probability into x and y. Here, p controls the degree of clustering. For our experiments, we have used p = 10. Algorithms Our baseline method is the brute-force dictionary attack (referred to as DA). Additionally, for evaluating the performance of set reconstruction we use HashInvert (HI). Both these baselines are described in Section 4. These methods are compared against our BloomSampleTree (BST ) approach. Metrics and Methodology We report on the following: • Number of intersections and set membership operations: This is our main metric of interest. We compute the depth of BloomSampleTree and the size of the Bloom filters based on accuracy and the relative costs of intersection and membership operations, as discussed in Section 5.4. For uniform and clustered query sets, we report the average number of intersection and membership operations on Bloom filters over 10, 000 samples. • Average time taken: With the same setup as above, we report on the average time over 10, 000 samples. • Memory: We analytically computed the overall size required by the BloomSampleTree based on the size of the Bloom filters used and the tree depth. • Quality of uniform samples: We report the χ2 -statistic for the samples generated. In addition, we also show the empirically observed distribution of samples. 15 7.2 Sampling Experiments Figures 3 and 4 show the number of intersections and membership operations over uniformly random and clustered query sets respectively. The DA method always uses M membership operations and no intersection operations. On the other hand, BloomSampleTrees try to offset a large number of membership operations with few intersections of Bloom filters. Note that as the sampling accuracy increases, the size of Bloom filters, m, increases as well resulting in more expensive intersection operations. Runtime Performance Both intersection and membership operations become more expensive – intersections more so than membership operations – as the Bloom filter size increases. The Bloom filter size, in turn, is determined by the namespace size as well as the accuracy requirements. Thus, the overall efficiency of BloomSampleTree depends on careful balance of the number of these operations. Figure 5 shows the average time taken by BloomSampleTree and DA methods, for a namespace size of 10-million. As these plots show, BloomSampleTrees achieve improvements in efficiency over DA for a single sampling round. Another implementation choice which can significantly affect the performance numbers is that of hash functions. Figure 7 shows the time taken to generate samples with different hash function families. The Dictionary Attack suffers most when the cost of computing the hash function increases – for instance with MD5-based hash functions the performance goes down by almost an order of magnitude. On the other hand, the BloomSampleTree sampling procedure defers membership queries to lower levels of the tree, by which time most of the tree has already been pruned from the search. When using fast hash functions like Murmur3 or Simple, BloomSampleTree automatically leverages their efficiency to reduce the overall time taken. Memory requirement Finally, we turn our attention to the amount of memory footprint needed by each method. The memory requirements (in MBs) are shown in Tables 2 and 3 when the number of elements in the query set is n = 103 . In the Tables 2 and 3, Depth is log M/M⊥ where M⊥ is computed as discussed in Section 5.4, and memory is analytically computed using m∗ number of nodes in the BloomSampleTree. The memory of the BloomSampleTree thus computed was further affirmed by empirical measurement during program execution. It is evident from this table that memory requirement might actually reduce with increasing accuracy. This is primarily because when the depth of the BloomSampleTree decreases, the total memory occupied reduces. This is in spite of increased Bloom filter sizes, since lower levels have much larger memory footprint than higher ones. Since memory can reduce with increasing accuracy, the overall trade-off is between accuracy and memory on one hand, and running time on the other. While the BloomSampleTree allows for very fast sampling, it requires small additional storage than the other methods described in this paper. Moreover, one does not need to store a BloomSampleTree for each possible query set. There is only one BloomSampleTree for a given size of namespace, Bloom filter size, and choice of hash functions. Quality of Sampling We use the Pearson’s chi-squared test, which we briefly describe here, to empirically validate the sample quality. We conduct T sampling rounds from a Bloom filter B storing a set S = (S1 , S2 , . . . Sn ). Now, ∀i ∈ [1, n], let oi be the number of times element Si is sampled. Similarly, let ei be the expected number of times element Si should be sampled. Our null hypothesis, H0 , is that the sampling is uniform, or restated, that ∀i ∈ [1, n], ei = Tn . The goal of the chi-squared test would be to see if the null hypothesis should be rejected given the observations oi . We define a 2 Pn i) random variable Q = i=1 (oi −e . Then Q follows a χ2 distribution with n − 1 degrees of freedom. ei Given an observation (o1 , o2 , . . . on ), we compute the value of Q. Let this value be q. The p-value is defined as P (Q ≥ q|H0 ). Clearly, smaller the p-value, higher is the value of q, indicating greater deviation from the expectation. In other words, a smaller p-value indicates that the observation has lesser support for H0 . If the p-value falls below a threshold s, known as the significance level, then 16 H0 is rejected, otherwise it is not. The significance level is typically set around 0.05. We set it to 0.08 and use T = 130 × n, the recommended sample size for this significance level [24]. For M = 106 , the p-values thus obtained are reported for sets of different sizes in Table 5. All of the entries in this table are > 0.08, and therefore the null hypothesis is not rejected in any case. For higher values of accuracy, it is clear that the distribution of the elements is close to the uniform distribution. Accuracy While the value of m was determined based on accuracy, we verified the accuracy obtained from the sampling process using the expression for measured accuracy in Table 1. For all cases, measured accuracy was found to be close to the expected value. Table 6 shows measured accuracy values for n = 1000. Creation Time: In Table 4, we measure the time taken to create the BloomSampleTree for different sizes of the namespace and desired accuracy. Note, for the case of M = 105 , with increased accuracy from 0.5 to 0.6, the required value of m increases, resulting in a decreased depth of the BloomSampleTree (Section 5.4), and consequently lower creation time. For M = 107 and desired accuracy 0.9, creation takes < 2.5s. In the application scenarios the BloomSampleTree works with, the number of sets that must be constructed in Bloom filters is assumed to be massive, and changing Bloom filter parameters requires creating each of the sets in the database again which is prohibitively expensive, overshadowing the time taken to create the BloomSampleTree. 17 Algorithm 1: Sampling with BloomTrees 1 Algorithm BSTSample(bST :BloomSampleTree, b:Query Bloom filter ) 2 [s, e] ← bST.range; 3 /* At a leaf, exhaustively check the interval of the leaf for membership in b */ 4 if bST is leaf then 5 S←φ; 6 for i in (s, e) do 7 if i ∈ b then 8 S ← S ∪ {i} ; 9 end 10 end 11 x ← uniformly sampled from S ; 12 return x ; 13 else 14 lFlag = EstimatedSize(bST.lef t ∩ b); 15 rFlag = EstimatedSize(bST.right ∩ b); 16 /* If no child intersects, we have reached here due to a false positive and should return N U LL */ 17 if (not lFlag and not rFlag) then 18 return N U LL ; 19 else 20 /* Randomly select one to proceed search along, with probability proportional to estimated number of elements */ 21 z = uniform(0, 1); 22 if z < lF lag/(lF lag + rF lag) then 23 sample ← BSTSample(bST.lef t, b) ; 24 /* In case no sample is found from that child, search along the other child - Backtracking */ 25 if sample = N U LL then 26 sample ← BSTSample(bST.right, b); 27 return sample; 28 else 29 sample ← BSTSample(bST.right, b) ; 30 if sample = N U LL then 31 sample ← BSTSample(bST.lef t, b); 32 return sample; 33 end 34 end Table 1: Parameters of our experiments Parameter Range (Default value) Size of the namespace (M ) Size of the query set (n) Sampling accuracy(s) Hash families 105 – 107 (107 ) 100 – 50, 000 (1000) 0.5 – 1.0 (0.9) Simple ((ax + b)%m), Murmur3, MD5 18 Intersection 20 100-BST 1K-BST 10K-BST 50K-BST DA 0 1010 1000 Membership (x103) 990 15 10 5 0 0.5 0.6 0.7 0.8 Sampling Accuracy 0.9 1.0 (a) M = 105 10K-BST 50K-BST DA Membership (x103) Intersection 40 30 20 10 0 1010 100-BST 1K-BST 1000 990 10 0 0.5 0.6 0.7 0.8 Sampling Accuracy 0.9 1.0 400 300 200 100 0 1010 Membership (x104) Intersection (b) M = 106 100-BST 1K-BST 10K-BST 50K-BST DA 1000 990 10 0 0.5 0.6 0.7 0.8 Sampling Accuracy 0.9 1.0 (c) M = 107 Figure 3: No. of intersections and set membership queries for uniformly random query sets. XXXBST in the legend refers to the cardinality of the query sets. 19 Intersection 50 100-BST 1K-BST 10K-BST 50K-BST DA Membership (x103) 0 1010 1000 990 0 100 0.6 100-BST 1K-BST 0.7 0.8 Sampling Accuracy (a) M = 105 10K-BST 50K-BST 0.9 1.0 DA 50 0 1010 1000 990 20 10 0 Membership (x103) Intersection 0.5 0.5 0.6 0.7 0.8 Sampling Accuracy 0.9 1.0 500 400 300 200 100 0 1010 1000 990 20 10 0 100-BST 1K-BST 10K-BST 50K-BST DA Membership (x104) Intersection (b) M = 106 0.5 0.6 0.7 0.8 Sampling Accuracy 0.9 1.0 (c) M = 107 Figure 4: No. of intersections and set membership queries for clustered query sets. XXX-BST in the legend refers to the cardinality of the query sets. 20 10K-BST 50K-BST 100-BST 1K-BST 100-DA 1K-DA 10K-DA 50K-DA Time (ms) 625.0 125.0 25.0 5.0 1.0 0.5 0.6 0.7 0.8 0.9 1.0 Sampling Accuracy (a) Uniformly random query set 10K-BST 50K-BST 100-BST 1K-BST 100-DA 1K-DA 10K-DA 50K-DA Time (ms) 625.0 125.0 25.0 5.0 1.0 0.5 0.6 0.7 0.8 0.9 1.0 Sampling Accuracy (b) Clustered query set Figure 5: Avg. time taken for sampling with M = 107 Accuracy 0.5 0.6 0.7 0.8 0.9 1 m 28465 32808 38259 46000 60870 137230 Depth 10 10 10 9 9 6 M⊥ 976 976 976 1953 1953 15625 Memory= m∗ #nodes 3.467 3.997 2.326 2.706 3.7 1.03 Table 2: Various parameters settings in Bloom Sample Tree implementation for n = 103 and M = 106 (Memory in MBs) Accuracy 0.5 0.6 0.7 0.8 0.9 1.0 m 63120 72475 84215 101090 132933 297485 Depth 13 13 13 13 12 10 M⊥ 1220 1220 1220 1220 2441 9765 Memory= m∗ #nodes 61.62 70.75 82.22 98.69 64.87 36.27 Table 3: Various parameters settings in Bloom Sample Tree implementation for n = 103 and M = 107 (Memory in MBs) 21 100-BST 1K-BST 10K-BST 50K-BST 100-DA 1K-DA 10K-DA 50K-DA 625.0 Time (ms) 125.0 25.0 5.0 1.0 0.2 0.0 0.5 0.6 0.7 0.8 0.9 1.0 Sampling Accuracy (a) Uniformly random query set 100-BST 1K-BST 10K-BST 50K-BST 100-DA 1K-DA 10K-DA 50K-DA 625.0 Time (ms) 125.0 25.0 5.0 1.0 0.2 0.0 0.5 0.6 0.7 0.8 0.9 1.0 Sampling Accuracy (b) Clustered query set Figure 6: Avg. time taken for sampling with M = 106 BST-MD5 DA-MD5 BST-Murmur DA-Murmur Time (mS) 625.0 125.0 25.0 5.0 1.0 0.5 0.6 0.7 0.8 0.9 1.0 Sampling Accuracy Figure 7: Effect of different hash function families on performance 22 a 0.5 0.6 0.7 0.8 0.9 M=10ˆ5 M=10ˆ6 M=10ˆ7 m #Levels STime UTime m #Levels STime Utime m #Levels Stime Utime 12317 14334 16863 20494 27340 4 3 3 3 3 0.12 0.04 0.28 0.12 0.12 18.4 14.4 14.8 15.6 15.9 28464 32807 38258 46090 60869 6 6 6 5 5 0.96 0.68 0.64 0.72 0.56 156.5 161.7 165.2 158.9 163.4 63119 72474 84214 101088 132932 8 8 8 8 8 78.72 223.52 311 426.52 590.64 1603.8 1625 1616.3 1646.3 1720.2 Table 4: System and User Time taken (in mS) to create BloomSampleTree for different values of M and desired accuracy Accuracy / n 100 1K 10K 50K 0.5 1 0.99 0.52 0.78 0.6 1 0.92 0.75 0.88 0.7 0.99 0.15 0.87 0.63 0.8 0.93 0.49 0.51 0.12 0.9 0.93 0.75 0.28 0.47 1.0 0.84 0.48 0.43 0.64 Table 5: p-values for M = 106 7.3 Reconstruction Experiments The setup of the reconstruction experiments follow that of the sampling experiments only adding HashInvert as a baseline. Figures 9 and 10 show the number of intersections and set membership queries to reconstruct sets which are uniformly random and clustered, drawn from namespaces of size M = 106 and M = 107 respectively. For the number of intersections with sampling accuracy, we see a trend that is similar to the ones in the sampling experiments, and for the same reasons. One may note that the HashInvert procedure performs more membership queries than the BloomSampleTree, but fewer than the Dictionary Attack. Despite this, the overall cost for HashInvert is the most as can be seen in Figures 11 and 12, which show the time taken for reconstruction. The overall cost for HashInvert essentially depends on the number of set or reset bits in the Bloom filter. If the Bloom filter is extremely dense, then reconstructing with the help of only reset bits efficiently reconstructs the set, whereas if it is very sparse, then one can reconstruct using the set bits. However, HashInvert is inefficient if neither of these cases apply, as is evident from the line for ’HI-10K’, which sets about 50% of the bits in the Bloom Filter. The cause for this is the fact that HashInvert iterates through an inverted set for each set or reset bit in the Bloom filter. Since some of these values may already have been checked, it does save some membership queries. However, given that the membership query is very fast for simple hash functions, this does not directly translate into smaller running times. Accuracy / M 0.5 0.6 0.7 0.8 0.9 1.0 105 0.522 0.692 0.710 0.823 0.921 0.970 106 0.497 0.621 0.691 0.793 0.907 0.997 107 0.535 0.591 0.696 0.810 0.906 0.948 Table 6: Measured Accuracies for Uniform query sets of size n = 103 23 Intersection (x100) Membership (x105) 10 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 0 4 0 0.5 0.6 0.7 0.8 0.9 1.0 Membership Intersection (x103) Precision (a) Uniformly Random Query Set 500 400 300 200 100 0 120 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 90 60 30 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (b) Clustered Query Set Figure 8: Avg. No. of operations in reconstructing for M = 105 8 Experiments with Real-world Data with Low-Occupancy Namespace So far we presented results for the settings when the namespace is a contiguous and fixed. Now we turn our attention to more practical settings where the size of the namespace we need to handle is only a small fraction of a much larger domain and potentially spread throughout it. 8.1 Setup Dataset We made use of a 34-day Twitter crawl consisting of 144 million tweets. There are a  total of 7.2 million user ids in this tweet set, but they are distributed in a namespace of 0, 2 × 109 (a little over 2.2 billion). Varying the namespace fractions Note that even though there are only 7.2 million unique ids in our dataset, they could be distributed across the entire namespace of 2.2 billion. Suppose, for example, we built a BloomSampleTree with 256 leaves – that is, the range of 2.2 billion is effectively divided into 256 equal-sized ranges (of which some could be empty depending on the distribution of the unique ids). From this hypothetical BloomSampleTree, we construct namespaces of different namespace fractions as follows: 24 Intersection (x100) Membership (x105) 40 30 20 10 0 15 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 10 5 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision Membership Intersection (x100) (x105) (a) Uniformly Random Query Set 40 30 20 10 0 15 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 10 5 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (b) Clustered Query Set Figure 9: Avg. No. of operations in reconstructing for M = 106 • Uniform Namespace: Following our example above, suppose we want to construct a namespace of namespace fraction 0.2, we uniformly sample 52 of 256 leaves. This gives us a set of ranges, the union of which only occupy 0.2 fraction of the total namespace. • Clustered Namespace: Again, for a namespace fraction of 0.2, we need to sample 52 of 256 leaves, but in a clustered way. We use the same technique as explained in Section 7 (in that case, we were generating clustered query sets). We fixed the desired accuracy, as discussed in section 5.4, at 0.8. Therefore, our hypothetical BloomSampleTree has a depth of 7, with a Bloom filter size m = 1.2 × 106 . Correspondingly, the pruned-BloomSampleTree has the same depth and Bloom filter size, but the number of nodes (and therefore the space occupancy) is much smaller. Query Bloom filters We identified 24, 000 unique hash tags that occurred at least 1, 000 times in our dataset. The sets of users tweeting a particular hashtag is used to construct a query Bloom filter. We therefore constructed 24,000 query Bloom filters. However, when experimenting with varying namespace fractions, we simply ignore ids which do not belong in the namespace currently under consideration and construct query Bloom filters without them. Metrics We report the following metrics. 25 Membership Intersection (x100) (x106) 90 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 60 30 0 15 10 5 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision Membership Intersection (x100) (x106) (a) Uniformly Random Query Set 90 100-BST 1K-BST 10K-BST 50K-BST HI-100 HI-1K HI-10K HI-50K DA 60 30 0 15 10 5 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (b) Clustered Query Set Figure 10: Avg. No. of operations in reconstructing for M = 107 • Average Time taken. At each namespace fraction, we run 1,000 sampling rounds on randomly chosen query Bloom filters and report the average time taken to generate a sample. • Memory. The Pruned-BloomSampleTree occupies much less space than the full BloomSampleTree. We report on space usage at each namespace fraction. • Accuracy. While the value of m, the Bloom filter size, was based on a desired accuracy for the BloomSampleTree, the actual accuracy in a Pruned-BloomSampleTree is expected to be better, since only those elements which occupy the namespace are stored. We report this accuracy for various namespace fractions. 8.2 Sampling Experiments Average time taken Figure 13 shows the average time taken to generate samples from our query Bloom filters. At namespace fractions less than 0.1, the time taken is an order of magnitude smaller than at full namespace occupancy. It is also expected that the sampling time in case of the clustered namespace is smaller, since more leaves share common ancestors and there are far less paths in the BloomSampleTree for the sampling algorithm to follow. The Dictionary Attack requires 100 seconds on average for one sample to be drawn. This is natural since the size of the namespace is extremely large in this case. As a result, we have not included the result of DA in Figure 13 to ensure that the finer variations in the sampling time taken for random and clustered namespaces are clearly visible. 26 HI-100 HI-10K BST-100 BST-10K DA-100 DA-10K 600 Time (ms) 500 400 300 200 100 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (a) Uniform Random Query Set HI-100 HI-10K BST-100 BST-10K DA-100 DA-10K 600 Time (ms) 500 400 300 200 100 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (b) Clustered Query Set Figure 11: Avg. time taken for reconstruction with M = 106 for uniformly random and clustered query sets. Memory Figure 14 shows the memory usage at varying namespace fractions. Note that, if we built the full BloomSampleTree for a namespace of 2.2 billion, the memory required would be approximately 36M B. In contrast, at a lower namespace fraction of 0.5, the memory usage of the BloomSampleTree is about 71% for the uniform case, and much lower at 21.7% for the clustered case. For the same reason as for sampling time, we expect the memory requirement of the BloomSampleTree to be smaller for a clustered namespace. Accuracy Figure 15 shows the sampling accuracy at various namespace fractions. Recall that we had optimized the BloomSampleTree for an accuracy of 0.8. But, with our Pruned-BloomSampleTree, we uniformly see a higher accuracy. Accuracy depends on the size of the namespace, as mentioned in section 5.4, and the size of the effective namespace at a lower namespace fraction is smaller. This shows that the BloomSampleTree is capable of producing higher accuracy results when the overall namespace is large but the actually occupied effective namespace is small. 9 Conclusions In this paper we described an efficient method to do sampling and reconstruction of sets stored in Bloom filters. In particular, we described the BloomSampleTree data structure and analyzed its 27 BST-100 BST-10K HI-100 HI-10K DA-100 DA-10K Time (ms) 2500 2000 1500 1000 500 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (a) Uniform Random Query Set BST-100 BST-10K HI-100 HI-10K DA-100 DA-10K Time (ms) 2500 2000 1500 1000 500 0 0.5 0.6 0.7 0.8 0.9 1.0 Precision (b) Clustered Query Set Figure 12: Avg. time taken for reconstruction with M = 107 for uniformly random and clustered query sets. properties both theoretically and experimentally. We compared our technique to the brute force approach (Dictionary Attack) as well as HashInvert (useful when using invertible hash functions to reconstruct sets). An extensive evaluation of our algorithm in various settings demonstrated its wide applicability and significant advantages. References [1] B. H. Bloom, “Space/time trade-offs in hash coding with allowable errors,” Commun. ACM, vol. 13, no. 7, pp. 422–426, 1970. [2] A. Z. Broder and M. Mitzenmacher, “Network applications of bloom filters: A survey,” Internet Math., vol. 1, no. 4, pp. 485–509, 2003. [3] D. M. Romero, B. Meeder, and J. Kleinberg, “Differences in the mechanics of information diffusion across topics: idioms, political hashtags, and complex contagion on twitter,” in WWW, 2011. [4] R. Ghosh and K. Lerman, “A framework for quantitative analysis of cascades on networks,” in WSDM, 2011. 28 Uniform Time(s) 8 Clustered 4 0 -4 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Namespace Fraction Memory (MB) Figure 13: Time taken to generate a uniform sample for varying namespace fractions 36 32 28 24 20 16 12 8 4 0 Uniform 0 Clustered 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Namespace Fraction Figure 14: Memory usage at varying namespace fractions Uniform 1.1 Clustered Accuracy 1 0.9 0.8 0.7 0.6 0.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Namespace Fraction Figure 15: Sampling accuracy at varying namespace fractions 29 [5] J. Cheng, L. A. Adamic, P. A. Dow, J. M. Kleinberg, and J. Leskovec, “Can cascades be predicted?” in WWW, 2014. [6] J. E. R. MacMillan, W. B. Glisson, and M. Bromby, “Investigating the increase in mobile phone evidence in criminal activities,” in HICSS, 2013, pp. 4900–4909. [7] G. Cormode, S. Muthukrishnan, and I. Rozenbaum, “Summarizing and mining inverse distributions on data streams via dynamic inverse sampling,” in VLDB, 2005. [8] M. Monemizadeh and D. P. Woodruff, “1-pass relative-error lp -sampling with applications,” in SODA, 2010. [9] H. Jowhari, M. Saglam, and G. Tardos, “Tight bounds for lp samplers, finding duplicates in streams, and related problems,” in PODS, 2011. [10] S. Tarkoma and C. E. Rothenberg and E. Lagerspetz, “Theory and Practice of Bloom Filters for Distributed Systems,” IEEE Comm. Surveys and Tutorials, vol. 14, no. 1, 2012. [11] S. Bellovin and W. Cheswick, “Privacy-Enhanced Searches using Encrypted Bloom Filters,” Columbia University, Tech. Rep. CUCS-034-07, 2007. [12] M. Naor and E. Yogev, “Bloom filters in adversarial environments,” CoRR, vol. abs/1412.8356, 2014. [Online]. Available: http://arxiv.org/abs/1412.8356 [13] G. Cormode, M. N. Garofalakis, P. J. Haas, and C. Jermaine, “Synopses for massive data: Samples, histograms, wavelets, sketches,” Found. Trends. Databases, vol. 4, no. 1-3, 2012. [14] M. Yoon, J. Son, and S.-H. Shin, “Bloom tree: A search tree based on Bloom filters for multipleset membership testing,” in Proc. 2014 IEEE Conference on Computer Communications (INFOCOM ’14), 2014, pp. 1429–1437. [15] A. Crainiceanu and D. Lemire, “Bloofi: Multidimensional bloom filters,” Inf. Syst., vol. 54, pp. 311–324, 2015. [16] M. Athanassoulis and A. Ailamaki, “Bf-tree: approximate tree indexing,” Proc. VLDB, vol. 7, no. 14, pp. 1881–1892, October 2014. [17] D. Guo, J. Wu, H. Chen, Y. Yuan, and X. Luo, “The dynamic bloom filters,” IEEE Trans. Knowl. Data Eng., vol. 22, no. 1, pp. 120–133, 2010. [18] M. C. Jeffrey and J. G. Steffan, “Understanding bloom filter intersection for lazy address-set disambiguation,” in SPAA. New York, NY, USA: ACM, 2011, pp. 345–354. [19] J. Vitter, “Random sampling with a reservoir,” ACM Trans. Math. Softw., vol. 11, no. 1, pp. 37–57, 1985. [Online]. Available: http://doi.acm.org/10.1145/3147.3165 [20] O. Papapetrou, W. Siberski, and W. Nejdl, “Cardinality estimation and dynamic length adaptation for bloom filters,” Dist. and Parallel Databases, vol. 28, no. 2-3, pp. 119–156, 2010. [Online]. Available: http://dx.doi.org/10.1007/s10619-010-7067-2 [21] M. Mitzenmacher, “Compressed bloom filters,” in PODC. [22] K. B. Athreya and P. E. Ney, Branching Processes. New York, NY, USA: ACM, 2001. Springer, 1972. [23] P. Boldi, “Algorithmic gems in the data miner’s cave,” in Proc. Fun with Algorithms. Springer, 2014, pp. 1–15. [Online]. Available: http://dx.doi.org/10.1007/978-3-319-07890-8_1 [24] D. H. Stamatis, Six sigma and beyond: design for six sigma. 30 CRC Press, 2002, vol. 6.
8cs.DS
Degree-constrained 2-partitions of graphs J. Bang-Jensen∗ Stéphane Bessy† arXiv:1801.06216v1 [cs.DS] 18 Jan 2018 January 22, 2018 Abstract A (δ ≥ k1 , δ ≥ k2 )-partition of a graph G is a vertex-partition (V1 , V2 ) of G satisfying that δ(G[Vi ]) ≥ ki for i = 1, 2. We determine, for all positive integers k1 , k2 , the complexity of deciding whether a given graph has a (δ ≥ k1 , δ ≥ k2 )-partition. We also address the problem of finding a function g(k1 , k2 ) such that the (δ ≥ k1 , δ ≥ k2 )-partition problem is N P-complete for the class of graphs of minimum degree less than g(k1 , k2 ) and polynomial for all graphs with minimum degree at least g(k1 , k2 ). We prove that g(1, k) = k for k ≥ 3, that g(2, 2) = 3 and that g(2, 3), if it exists, has value 4 or 5. Keywords: N P-complete, polynomial, 2-partition, minimum degree. 1 Introduction A 2-partition of a graph G is a partition of V (G) into two disjoint sets. Let P1 , P2 be two graph properties, then a (P1 , P2 )-partition of a graph G is a 2-partition (V1 , V2 ) where V1 induces a graph with property P1 and V2 a graph with property P2 . For example a (δ ≥ k1 , δ ≥ k2 )-partition of a graph G is a 2-partition (V1 , V2 ) where δ(G[Vi ]) ≥ ki , for i = 1, 2 There are many papers dealing with vertex-partition problems on (di)graphs. Examples (from a long list) are [1, 2, 4, 6, 7, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 26, 27, 28, 29, 30, 31, 33, 34]. Examples of 2-partition problems are recognizing bipartite graphs (those having has a 2-partition into two independent sets) and split graphs (those having a 2-partition into a clique and an independent set) [15]. It is well known and easy to show that there are linear algorithms for deciding whether a graph is bipartite, respectively, a split graph. It is an easy exercise to show that every graph G has a 2-partition (V1 , V2 ) such that the degree of each vertex in G[Vi ], i ∈ [2] is at most half of its original degree. Furthermore such a partition can be found efficiently by a greedy algorithm. In [16, 17] and several other papers the opposite condition for a 2-partition was studied. Here we require the that each vertex has at least half of its neighbours inside the set it belongs to in the partition. This problem, known as the satisfactory partition problem, is N P-complete for general graphs [5]. A partition problem that has received particular attention is that of finding sufficient conditions for a graph to possess a (δ ≥ k1 , δ ≥ k2 )-partition. Thomassen [31] proved the existence of a function f (k1 , k2 ) so that every graph of minimum degree at least f (k1 , k2 ) has a (δ ≥ k1 , δ ≥ k2 )-partition. He proved that f (k1 , k2 ) ≤ 12 · max{k1 , k2 }. This was later improved by Hajnal [19] and Häggkvist (see [31]). Thomassen [31, 32] asked whether it would hold that f (k1 , k2 ) = k1 + k2 + 1 which would be best possible because of the complete graph Kk1 +k2 +1 . Stiebitz [29] proved that indeed we have f (k1 , k2 ) = k1 + k2 + 1. Since this result was published, several groups of researchers have tried to find extra conditions on the graph that would allow for a smaller minimum degree requirement. Among others the following results were obtained. Theorem 1.1 [20] For all integers k1 , k2 ≥ 1 every triangle-free graph G with δ(G) ≥ k1 + k2 has a (δ ≥ k1 , δ ≥ k2 )-partition. ∗ Department of Mathematics and Computer Science, University of Southern Denmark, Odense DK-5230, Denmark (email:[email protected]). This work was done while the first author was visiting LIRMM, Université de Montpellier, France. Hospitality is gratefully acknowledged. The research of Bang-Jensen was supported by the Danish research council under grant number 7014-00037B. † LIRMM, Université de Montpellier, France (email: [email protected]). 1 Theorem 1.2 [26] For all integers k1 , k2 ≥ 2 every graph G with no 4-cycle and with δ(G) ≥ k1 +k2 −1 has a (δ ≥ k1 , δ ≥ k2 )-partition. Theorem 1.3 [23] • For all integers k1 , k2 ≥ 1, except for K3 , every graph G with no K4 − e and with δ(G) ≥ k1 + k2 has a (δ ≥ k1 , δ ≥ k2 )-partition. • For all integers k1 , k2 ≥ 2 every triangle-free graph G in which no two 4-cycles share an edge and with δ(G) ≥ k1 + k2 − 1 has a (δ ≥ k1 , δ ≥ k2 )-partition. The original proof that f (k1 , k2 ) = k1 + k2 + 1 in [29] is not constructive and neither are those of Theorems 1.2 and 1.3. In [7] Bazgan et al. gave a polynomial algorithm for constructing a (δ ≥ k1 , δ ≥ k2 )-partition of a graph with minimum degree at least k1 + k2 + 1 or at least k1 + k2 when the input is triangle-free. The main result of this paper is a full characterization of the complexity of the (δ ≥ k1 , δ ≥ k2 )partition problem. Theorem 1.4 Let k1 , k2 ≥ 1 with k1 ≤ k2 be integers. When k1 + k2 ≤ 3 it is polynomial to decide whether a graph has a 2-partition (V1 , V2 ) such that δ(G[Vi ]) ≥ ki for i = 1, 2. For all other values of k1 , k2 it is NP-complete to decide the existence of such a partition. A result in [13] implies that (δ ≥ 3, δ ≥ 3)-partition is N P-complete already for 4-regular graphs and there are other results about the complexity of finding partitions with lower and/or upper bounds on the degrees inside each partition, such as [5, 6, 16, 17, 34], but we did not find anything which implies Theorem 1.4. The result of Stiebitz [29] insures that if the minimum degree of the input graph is large enough, at least k1 + k2 + 1, then the (δ ≥ k1 , δ ≥ k2 )-partition always exists. We conjecture that if this minimum degree is large but less than k1 + k2 + 1 then the (δ ≥ k1 , δ ≥ k2 )-partition is not always trivial but can be solved in polynomial time. Conjecture 1.5 There exists a function g(k1 , k2 ) so that for all 1 ≤ k1 ≤ k2 with k1 + k2 ≥ 3 the (δ ≥ k1 , δ ≥ k2 )-partition problem is N P-complete for the class of graphs of minimum degree less than g(k1 , k2 ) and polynomial for all graphs with minimum degree at least g(k1 , k2 ). In the next section we introduce notions and tools that will be used later. In Section 3 we give the proof of Theorem 1.4 and in Section 4 we provide some partial results concerning Conjecture 1.5. In particular we prove that g(1, k) = k for k ≥ 3, that g(2, 2) = 3 and that g(2, 3), if it exists, has value 4 or 5. Finally in Section 5 we address some other partition problems mainly dealing with (edge-)connectivity in each part of the partition. Notice that regarding the results that we establish in this paper the first open case of Conjecture 1.5 is the following problem. Problem 1.6 What is the complexity of the (δ ≥ 2, δ ≥ 3)-partition problem for graphs of minimum degree 4? 2 Notation, definitions and preliminary results Notation is standard and follows [3, 12]. In this paper graphs have no parallel edges and no loops. We use the shorthand notation [k] for the set {1, 2, . . . , k}. 2.1 Special Graphs We first define some graphs that will be used frequently in our proofs to ensure that certain vertices have a sufficiently high degree. For all k ≥ 3 we let Xk,2 be the graph we obtain from Kk+1 by subdividing one edge by a vertex x. Let X3,1 be obtained from X3,2 by adding a vertex x0 adjacent to the degree 2 vertex x of X3,2 . 2 Let Y4,1 be the graph on 7 vertices which we obtain from a 5-wheel by adding a new edge e linking 2 non adjacent vertices of the outer cycle of the 5-wheel, a new vertex joined to the 3 vertices of this outer cycle not incident to e and to another new vertex y. For k = 3 let Zk be the graph X3,1 that we defined above and let z = x0 . For k ≥ 4 let Zk be the graph that we obtain from Kk−2,k−1 by adding a cycle on the k − 1 vertices of degree k − 2 and then adding a new vertex z adjacent to all the k − 2 vertices of degree k − 1. And finally let Wk be the graph we obtain from Kk+1 by deleting one edge u0 v 0 and the adding two new vertices u, v and the edges uu0 , vv 0 . All these graphs are depicted in Figure 1. y x0 x Y4,1 X3,1 X3,2 x z u v 0 v0 u k − 2 vertices Xk,2 Zk Kk+1 Wk Kk+1 k − 1 vertices Figure 1: The graphs Y4,1 , X3,2 , X3,1 , Zk , Xk,2 and Wk . 2.2 Connected instances of 3-SAT For a given instance F of 3-SAT with clauses C1 , C2 , . . . , Cm and variables x1 , . . . , xn , where each variable xi occurs at least once as the literal xi and at least once as x̄i , we define the bipartite graph B(F) as the graph with vertex set {v1 , v¯1 , v2 , v̄2 , . . . , vn , v̄n } ∪ {c1 , c2 , . . . , cm }, where the first set corresponds to the literals and the second one to the clauses, and edge set containing an edge between the vertex cj and each of the 3 vertices corresponding to the literals of Cj for every j ∈ [m]. We say that F is a connected instance if B(F) is connected. Lemma 2.1 3-SAT is N P-complete for instances F where B(F) is connected Proof: Suppose B(F) has connected components X1 , X2 , . . . , Xk , where k ≥ 2. Fix a literal 0 vertex `i ∈ Xi for each i ∈ [k], add a new variable y and k − 1 new clauses C10 , . . . , Ck−1 where 0 0 Cj = (`j−1 ∨ y ∨ `j ), j ∈ [k − 1]. Let F be the new formula obtained by adding the variable y and the 0 . It is easy to check that F 0 is equivalent to F and that B(F 0 ) is connected.  clauses C10 , . . . , Ck−1 By adding a few extra variables, if necessary, we can also obtain an equivalent connected instance in which each literal occurs at least twice. We leave the easy details to the interested reader. 2.3 Ring graphs and 3-SAT We first introduce an important class of graphs that will play a central role in our proofs. The directed analogue of these graphs was used in [2, 4]. A ring graph is the graph that one obtains by taking two or more copies of the complete bipartite graph on 4 vertices {a1 , a2 , b1 , b2 } and edges {a1 b1 , a1 b2 , a2 b1 , a2 b2 } and joining these in a circular manner by adding a path Pi,1 from the vertex 3 bi,1 to ai+1,1 and a path Pi,2 from bi,2 to ai+1,2 where bi,1 is the ith copy of b1 etc and indices are ’modulo’ n (bn+1,j = b1,j for j ∈ [2] etc). Our proofs are all reductions from N P-complete variants of the 3-SAT problems. We call the copies of {a1 b1 , a1 b2 , a2 b1 , a2 b2 } switch vertices. We start by showing how we can associate a ring graph to a given 3-SAT formula. Let F = C1 ∧ C2 ∧ . . . ∧ Cm be an instance of 3-SAT consisting on m clauses C1 , . . . , Cm over the same set of n boolean variables x1 , . . . , xn . Each clause Ci is of the form Ci = (`i,1 ∨ `i,2 ∨ `i,3 ) where each `i,j belongs to {x1 , x2 , . . . , xn , x̄1 , x̄2 , . . . , x̄n } and x̄i is the negation of variable xi . By adding extra clauses to obtain an equivalent formula, if necessary, we can ensure that every literal occurs at least twice in F. We shall use this fact in one of our proofs. For each variable xi the ordering of the clauses above induces an ordering of the occurrences of xi , resp x̄i , in the clauses. Let qi (resp. pi ) denote the number of times xi (resp. x̄i ) occurs in the clauses Let R(F) = (V, E) be the ring graph defined as follows. Its vertex set is V = {a1,1 , . . . an,1 , a1,2 . . . , an,2 } ∪ {b1,1 , . . . , bn,1 , b1,2 , . . . , bn,2 } ∪ n [ 0 0 {vi,1 , . . . , vi,qi , vi,1 , . . . , vi,p } i i=1 Its edge set E consists of the following edges: Sn • i=1 {ai,1 bi,1 , ai,1 bi,2 , ai,2 bi,1 , ai,2 bi,2 } • the edges of the paths Pi,1 , Pi,2 , i ∈ [n] where Pi,1 = bi,1 vi,1 . . . vi,qi ai+1,1 and 0 0 Pi,2 = bi,2 vi,1 . . . vi,p a . i i+1,2 For 1 ≤ j ≤ m, we associate the clause Cj = (`j,1 ∨ `j,2 ∨ `j,3 ) with the set Oj consisting of three vertices of R(F) representing the occurrences of the literals of Cj in F: if `j,1 = xi for some i ∈ [n] and this is the r’th occurrence of xi in the clauses, then Oj contains the vertex vi,r . If `j,1 = x̄i for 0 some i ∈ [n] and this is the r’th occurrence of x̄i in the clauses, then Oj contains the vertex vi,r . The other two vertices of Oj are defined similarly. In our proofs below we will often add a vertex ci adjacent to all the vertices of Oi for i ∈ [n]. An example is depicted in Figure 2. a2,1 b2,1 v1,2 v2,1 v1,1 b1,1 0 v1,1 a2,2 b2,2 b1,2 c2 c1 a1,1 c4 a1,2 0 v2,1 c3 a3,2 a3,1 b3,2 b3,1 0 v3,1 v4,2 0 v4,1 0 v3,2 a4,2 b4,2 0 v3,3 v3,1 v4,1 b4,1 a4,1 Figure 2: The ring graph R(F) corresponding to the formula F = (x1 ∨ x4 ∨ x̄3 ) ∧ (x1 ∨ x̄2 ∨ x̄3 ) ∧ (x2 ∨ x̄3 ∨ x4 ) ∧ (x̄1 ∨ x3 ∨ x̄4 ). The grey boxes contain the switch vertices, the white vertices are the variable vertices and we added the clauses vertices c1 , c2 , c3 and c4 (these are not part of the ring graph R(F)). 4 The following observation which forms the base of many of our proofs is easy to prove (for a proof of result a very similar to this see [4]). Theorem 2.2 Let F be a 3-SAT formula and let R(F) be the corresponding ring graph. Then R = R(F) contains a cycle C which intersects all the sets O1 , . . . , Om so that R − C is a cycle C 0 if and only if F is a ‘Yes’-instance of 3-SAT. 3 Proof of Theorem 1.4 3.1 The case k1 + k2 ≤ 3 We start with a trivial observation. Proposition 3.1 Every graph G with δ(G) ≥ 1 and at least 4 vertices has a (δ ≥ 1, δ ≥ 1)-partition except if G is a star. Proposition 3.2 There is a polynomial algorithm for testing whether a graph has a (δ ≥ 1, δ ≥ 2)partition Proof: We try for every choice of adjacent vertices u, v whether there is a solution with u, v ∈ V1 . Clearly G is a ’yes’-instance if and only if at least one of these O(n2 ) attempts will succeed. Hence by starting with V1 = {u, v} and then moving vertices with at most one neighbour in V − V1 to V1 we either end with a good partition or V1 = V in which case no partition exists for that choice {u, v}.  3.2 The case k1 = 1 and k2 ≥ 3 The following variant of satisfiability, which we call ≤ 3-SAT(3), is known to be NP-complete: Given a boolean CNF formula F consisting of clauses C1 , C2 , . . . , Cm over variables x1 , x2 , . . . , xn such that each clause has 2 or 3 literals, no variable occurs in more than 3 clauses and no literal appears more than twice; decide whether F can be satisfied. As we could not find a proper reference for a proof that ≤ 3-SAT(3) is N P-complete, we give one here as it is presented on pages 281-283 in a set of course notes1 by Prof. Yuh-Dauh Lyuu, National Taiwan University: Assume that F is an instance of 3-SAT in which the variable x occurs a total of r ≥ 4 times in the formula (as x or x̄) in clauses Ci1 , . . . , Cir . Introduce new variables x1 , . . . , xr and replace the first occurrence of x (in Ci1 ) by x1 is x is not negated in Ci1 and otherwise replace it by x̄1 in Ci1 . Similarly we replace the occurrence of x in Cij , j ≥ 2 by xj or x̄j . Finally we add the new clauses (x̄1 ∨ x2 ) ∧ (x̄2 ∨ x3 ) ∧ . . . ∧ (x̄r ∨ x1 ). These clauses (which have size 2) will force all the variables x1 , . . . , xr to take the same value under any satisfying truth assignment. Repeating this replacement for all variables of the original formula F we obtain an equivalent instance F 0 of ≤ 3-SAT(3). Below we will need another variant which we call ≤ 3-SAT(5) where clauses still have size 2 or 3 and each variable is allowed to occur at most 5 times and at most 3 times as the same literal. By following the scheme above and for each original variable occurring at least 4 times adding r extra clauses (x1 ∨ x̄2 ) ∧ (x2 ∨ x̄3 ) ∧ . . . ∧ (xr ∨ x̄1 ) we obtain an equivalent instance F 00 and because the 2r new clauses will form a cycle in the bipartite graph B(F 00 ) of F 00 it is easy to see that F 00 is a connected instance of ≤ 3-SAT(5) if F is a connected instance of 3-SAT. Hence, by Lemma 2.1, connected ≤ 3-SAT(5) is N P-complete. Theorem 3.3 For all k ≥ 3 it is N P-complete to decide whether a graph has a (δ ≥ 1, δ ≥ k)partition. Proof: We show how to reduce an instance of connected ≤ 3-SAT(5) to (δ ≥ 1, δ ≥ k)-partition where k ∈ {3, 4} in polynomial time and then show how to extend the construction to higher values of k. We start the construction for k = 3. Below we will use several disjoint copies of the graphs X3,1 and X3,2 to achieve our construction. Let F be a connected instance of ≤ 3-SAT(5) with clauses C1 , . . . , Cm and variables x1 , . . . xn . We 1 https://www.csie.ntu.edu.tw/ ~lyuu/complexity/2008a/20080403.pdf 5 may assume that each of the 2n literals occur at least once in F (this follows from the fact that we may assume this for any instance of normal 3-SAT and the reduction above to ≤ 3-SAT(5) preserves this property). We will construct G = G(F) as follows: • For each variable xi , i ∈ [n] we introduce three new vertices yi , vi , v¯i and two the edges yi vi , yi v̄i . • For each i ∈ [n]: if the literal xi (x̄i ) occurs precisely once in F, then we identify vi (v̄i ) with the vertex x in a private copy of X3,2 . If xi (x̄i ) occurs precisely twice, then we identify vi (v̄i ) with the vertex x0 in a private copy of X3,1 . • Now we add new vertices c1 , . . . , cm , where ci corresponds to the clause Ci , i ∈ [m], and join each cj by an edge to those (2 or 3) vertices from {v1 , . . . , vn , v̄1 , . . . , v̄n } which correspond to its literals. If cj gets only two edges this way, we identify it with the vertex x0 in a private copy of X3,1 . • Add 2m new vertices z1 , z2 , . . . , z2m and the edges of the 2m-cycle z1 z2 , z2 z3 , . . . , z2m−1 z2m , z2m z1 . • Finally we add, for each j ∈ [m] the edges cj z2j−1 , cj z2j . We claim that G(F) has a (δ ≥ 1, δ ≥ 3)-partition if and only if F can be satisfied. Suppose first that t is a satisfying truth assignment. Then it is easy to check that (V1 , V2 ) is a good 2-partition if we take V1 to be the union of {y1 , . . . , yn } and the n vertices from {v1 , . . . , vn , v̄1 , . . . , v̄n } which corresponds to the false literals. Note that if a vertex vi (v̄i ) is in V2 then it will have degree 3 via its private copy of one of the graphs X1 , X2 or because the corresponding literal occurred 3 times in F. Conversely assume that (V1 , V2 ) is a (δ ≥ 1, δ ≥ 3)-partition. Then we claim that we must have all the vertices z1 , z2 , . . . , z2m in V2 : If one of these is in V1 , then they all are as they have degree exactly 3. Clearly we also have {y1 , . . . , yn } ⊂ V1 . However, by construction, the literal and clause vertices all have degree 3 and they induce a connected graph (here we use that the instance F has a connected bipartite graph B(F)). Thus all of these vertices must be in V2 , but then each vertex yi is isolated, contradiction. Hence all the vertices z1 , z2 , . . . , z2m are in V2 and this implies that all of c1 , . . . , cm are also in V2 . The vertices y1 , . . . , yn are in V1 and hence, for each i ∈ [n], at least one of the vertices vi , v̄i is also in V1 . Now define a truth assignment a follows. For each i ∈ [n]: If both vi and v̄i are in V1 , or vi is in V2 we put xi true; otherwise we put xi false. Since each cj must have a neighbour from {v1 , . . . , vn , v̄1 , . . . , v̄n } in V2 this is a satisfying truth assignment. To obtain the construction for k = 4 we replace each copy of X3,1 above by a copy of Y4,1 , each copy of X3,2 by a copy of X4,2 and identify each of the literal and clause vertices with the vertex y in an extra private copy of Y4,1 . Finally we identify each vertex zt , t ∈ [2m] with the vertex y in a private copy of Y4,1 . Now it is easy to see that we can complete the proof as we did for the case k = 3. For all k ∈ {3 + 2a, 4 + 2a|a ≥ 1} we can increase the degree of all literal, clause and zj vertices by 2a by identifying these with the x vertices of a private copies of Xk,2 and repeat the proof above.  Corollary 3.4 The (δ ≥ 1, δ ≥ k)-partition problem is N P-complete for graphs of minimum degree k − 1. Proof: Recall that in our proof above the vertices corresponding to clauses must always belong to V2 in any good partition (V1 , V2 ) hence if we connect each vertex yi , i ∈ [n] to c1 , . . . , ck−3 by edges we obtain a graph of minimum degree k − 1 which has a good partition if and only if F is satisfiable (The vertices yi , i ∈ [n] must belong to V1 as they have degree k − 1).  3.3 (δ ≥ k1 , δ ≥ k2 )-partition when 2 ≤ k1 ≤ k2 Theorem 3.5 For every choice of natural numbers 2 ≤ k1 ≤ k2 it is N P-complete to decide whether a graph has a (δ ≥ k1 , δ ≥ k2 )-partition. Proof: We show how to reduce 3-SAT to (δ ≥ k1 , δ ≥ k2 )-partition. Given an instance F of 3-SAT with clauses C1 , C2 , . . . , Cm and variables x1 , . . . , xn we proceed as follows. Start from a copy of the ring graph R = R(F) and then add the following: 6 • If k2 ≥ 3 we identify each vertex of R with the vertex z in a private copy of Zk2 . • For each i ∈ [n] add a new vertex ui and join it by edges to the vertices ai,1 , ai,2 . If k1 ≥ 3 we identify ui with the vertex z in a private copy of Zk1 . • For each i ∈ [n] add a new vertex u0i and join it by edges to the vertices bi,1 , bi,2 . If k1 ≥ 3 we identify u0i with the vertex z in a private copy of Zk1 . • For each j ∈ [m] we add a new vertex cj , identify cj with the vertex z in a private copy of Zk1 if k1 ≥ 3 and add three edges from cj to the three vertices of R which correspond to the literals of Cm . • Finally add a new vertex r and join this to all of the vertices in {u1 , . . . , un , u01 , . . . , u0n , c1 , . . . , cm } via private copies of Wk1 by identifying the vertex u with r and v with the chosen vertex from {u1 , . . . , un , u01 , . . . , u0n c1 , . . . , cm }. We claim that the final graph G has a (δ ≥ k1 , δ ≥ k2 )-partition if and only if F is satisfiable. First we make some observations about G: • Every vertex v of R which is not a switch vertex has degree exactly k2 + 1 as it has degree 2 in R(F), is adjacent to exactly one cj , j ∈ [m] and if k2 ≥ 3 then v has been identified with one vertex z of a private copy of Zk2 . • Switch vertices all have degree exactly k2 + 2. • The vertices u1 , . . . , un , u01 , . . . , u0n have degree exactly k1 + 1. • All vertices in copies of Za have degree exactly a when a ≥ 3. • All vertices in copies of Wk1 have degree exactly k1 • All vertices cj , j ∈ [m] have degree k1 + 2. • The vertex r has degree m + 2n which we may clearly assume is at least k1 . For convenience in writing, below we define Z2 to be the empty graph so that we can talk about Za ’s without having to condition this on a being at least 3. Suppose first that F is satisfiable. By Theorem 2.2 this means that R(F) has a cycle C which intersects the neighbourhood of each cj , j ∈ [m] and so that R − C is another cycle C 0 . Now we let V1 consist of the vertices of C, their corresponding private copies of Zk2 , all the vertices {u1 , . . . , un , u01 , . . . , u0n , c1 , . . . , cm } along with their private copies of Zk1 and finally the vertex r and the vertices of all copies of Wk1 that we used. Let V2 = V (G) − V1 , that is V2 contains the vertices of C 0 and their private copies of Zk2 . It is easy to check that δ(G[V1 ]) ≥ k1 and that δ(G[V2 ]) ≥ k2 so (V1 , V2 ) is a good partition. Now assume that G has a good 2-partition (V1 , V2 ). The way we connected r to the vertices in {u1 , . . . , un , u01 , . . . , u0n , c1 , . . . , cm } via copies of Wk1 implies that these must belong to the same set Vi as r. If k1 < k2 this must be V1 and otherwise we can rename the sets so that i = 1. Since each cj , j ∈ [m] has degree k1 + 2 at least one of the vertices corresponding to a literal of Cj must belong to V1 . Suppose that some vertex corresponding a literal ` is in V1 , then all the vertices of the path in R corresponding to that literal, including the two end vertices which are switch vertices, must belong to V1 . This follows from the fact that all these vertices have degree k2 + 1 and have a neighbour in {u1 , . . . , un , u01 , . . . , u0n , c1 , . . . , cm } ⊂ V1 . Moreover if ai,j (resp. bi,j ) belongs to V2 then, as ai,j (resp. bi,j ) has degree k2 + 2 and ui (resp. u0i ) belongs to V1 , at least one of the vertices of {bi,1 , bi,2 } (resp. {ai,1 , ai,2 }) belongs to V2 . And as ui (resp. u0i ) belongs to V1 , one of {ai,1 , ai,2 } (resp. {bi,1 , bi,2 }) must lie in V1 . So since V2 is not empty this implies that the restriction of V2 to R is a cycle consisting of paths Q1 , . . . , Qn where Qi is either the path Pi,1 or the path Pi,2 . Hence R[V (R) ∩ V1 ] is a cycle intersecting each of the neighbourhoods of the vertices cj , j ∈ [m] and hence F is satisfiable by Theorem 2.2.  Combining the results of this section concludes the proof of Theorem 1.4. 7 4 Higher degrees We study the borderline between polynomial and N P-complete instances of the partition problems. That is, we try to see how close we can get to the bound k1 + k2 + 1 on the minimum degree and still have an N P-complete instance. For k1 = 1 we can give the precise answer by combining Corollary 3.4 and the result below. Proposition 4.1 There is a polynomial algorithm for checking whether a graph G of minimum degree at least k has a (δ ≥ 1, δ ≥ k)-partition. Proof: It suffices to see that we can test for a given edge uv of G whether there is a (δ ≥ 1, δ ≥ k)partition (V1 , V2 ) with u, v ∈ V1 . This is done by starting with V1 = {u, v} and then moving vertices from V − V1 to V1 when these vertices do not have at least k neighbours in V − V1 . Note that this process preserves the invariant that δ(G[V1 ]) ≥ 1. Hence if the process terminates before V1 = V we have found the desired partition and otherwise we proceed to the next choice for an edge to start from.  For the (δ ≥ 2, δ ≥ 2)-partition problem we can also give the precise borderline between polynomial and N P-complete instances. Proposition 4.2 There exists a polynomial algorithm for checking whether a given graph of minimum degree at least 3 has a (δ ≥ 2, δ ≥ 2)-partition. Proof: First test whether G has two disjoint cycles C1 , C2 . This can be done in polynomial time [9, 25]. If no such pair exists G is a ’no’-instance, so assume that we found a pair of disjoint cycles C1 , C2 . Now put the vertices of C1 in V1 and continue to move vertices of V − V1 − V (C2 ) to V1 if they have at least two neighbours in the current V1 . When this process stops the remaining set V2 = V − V1 induces a graph of minimum degree at least 2, since the vertices we did not move have at most one neighbour in V1 .  We now proceed to partitions where 2 ≤ k1 ≤ k2 and try to raise the minimum degree above k1 to see whether we can still prove N P-completeness. Theorem 4.3 For every a ≥ 3 it is N P-complete to decide whether a graph of minimum degree a + 1 has a (δ ≥ a, δ ≥ a)-partition. Proof: We give the proof for a = 3 and then explain how to extend it to larger a. Let F be an instance of 3-SAT with n variable and m clauses C1 , . . . , Cm . Let R0 = R0 (F) be obtained from R(F) by adding, for all i ∈ [n], an edge between all vertices at distance 2 in one of the paths Pi,1 , Pi,2 , i ∈ [n] (that is, we replace each of these paths by their square). Now we construct the graph H = H(F) starting from R0 as follows: • For each j ∈ [m]: add two vertices cj,1 , cj,2 and join them to the vertices in R0 which correspond to the literals of Cj . • add the vertices of a 2m -cycle y1 y2 . . . y2m y1 . • For each j ∈ [m] add the two edges y2j−1 cj,1 , y2j−1 cj,2 and the two edges y2j cj,2 , y2j , cj+1,1 , where cm+1,1 = c1,1 . The resulting graph H has minimum degree 4 and we claim that H has a (δ ≥ 3, δ ≥ 3)-partition if and only if F is satisfiable, which we know, by Theorem 2.2 and the previous proofs, where we used the same approach, is if and only if the vertex set of R (which is the same as that of R0 ) can be partitioned into two cycles C, C 0 so that C contains a neighbour of each of the vertices cj,1 , cj,2 , j ∈ [m]. Again the proof is easy when F is satisfiable: Let C, C 0 be as above and let V2 = V (C 0 ) and V1 = V (H) − V2 . It is easy to check that δ(H[Vi ]) ≥ 3 for i = 1, 2, because C contains a neighbour of each cj,1 , cj,2 , j ∈ [m] (and we assume that each literal appears at least twice in F to insure that δ(H[V2 ]) ≥ 3). Suppose now that H has a (δ ≥ 3, δ ≥ 3)-partition (V1 , V2 ). Since adjacent vertices in {y1 , y2 , . . . , y2m } have degree 4 and share a neighbour they must all belong to the same set Vi , i ∈ [2] 8 and this set must also contain all the vertices cj,1 , cj,2 , j ∈ [m]. Without loss of generality we have i = 1. Thus V2 is a subset of V (R0 ). The vertices of R have degree at most 4 in R0 and the initial and terminal vertex of each path Pi,1 or Pi,2 has degree 3. Using this is not difficult to see that if some vertex of a path Pi,1 or Pi,2 is in V2 then all the vertices of that path and the two adjacent switch vertices are in V2 . If there is some i ∈ [n] so that both of the vertices ai,1 , ai,2 or both of the vertices bi,1 , bi,2 are in in V2 , then, using the observation we just made, all vertices of R0 would be in V2 which is impossible. Similarly we can show that V1 cannot contain both of the vertices ai,1 , ai,2 or both of the vertices bi,1 , bi,2 for some i ∈ [n]. Hence for each switch {ai,1 , ai,2 , bi,1 , bi,2 }, exactly one of the vertices ai,1 , ai,2 and exactly one of the vertices bi,1 , bi,2 is in V2 . Now we see that the vertices in V1 and V2 both induces a cycle in R and as the vertices cj,1 , cj,2 have degree 2 outside R, the cycle in R which is in V1 must contain a neighbour of each of cj,1 , cj,2 , j ∈ [m]. Hence, by Theorem 2.2, F is satisfiable. We obtain the result for higher values of a by induction where we just proved the base case a = 3 above. Assume we have already constructed Ha = Ha (F) with δ(Ha ) ≥ a + 1 such that Ha has a (δ ≥ a, δ ≥ a)-partition if and only if F is satisfiable. Construct Ha+1 from two copies of Ha by joining copies of the same vertex by an edge. It is easy to check that Ha+1 has a (δ ≥ a+1, δ ≥ a+1)-partition if and only if Ha has a (δ ≥ a, δ ≥ a)-partition.  Theorem 4.4 Deciding whether a graph of minimum degree 3 has a (δ ≥ 2, δ ≥ 3)-partition is N Pcomplete. Proof: Let X = X(F) be the graph we obtain by starting from the ring graph R(F) and then adding the following: • Add the vertices of a tree T whose internal vertices have all degree 3 and which has 2m + 4n leaves denoted by u1,1 , u1,2 . . . , un,1 , un,2 , u01,1 , u01,2 , . . . , u0n,1 , u0n,2 , c1,1 , c1,2 , c2,1 , c2,2 , . . . , cm,1 , cm,2 , where the pairs ui,1 , ui,2 and u0i,1 , u0i,2 have the same parent in T for i ∈ [n] and so do each of the pairs cj,1 , cj,2 , j ∈ [m]. Here the vertices cj,1 , cj,2 correspond to the clause Cj • Join each vertex cj,1 , cj,2 , j ∈ [m] to the 3 vertices in R which correspond to the literals which correspond to Cj and add the edge cj,1 cj,2 . 0 0 0 0 • Add 4n new vertices wi,1 , wi,2 , wi,1 , wi,2 , i ∈ [n]. Add the edges wi,1 wi,2 , wi,1 wi,2 , i ∈ [n]. 0 0 • For each i ∈ [n] add the edges wi,1 ai,1 , wi,2 ai,2 , wi,1 bi,1 , wi,2 bi,2 . • For each i ∈ [n] join each of ui,1 and ui,2 by edges to the vertices wi,1 , wi,2 and add the edge ui,1 ui,2 . 0 0 • For each i ∈ [n] join each of u0i,1 and u0i,2 by edges to the vertices wi,1 , wi,2 and add the edge u0i,1 u0i,2 . We first prove that in any (δ ≥ 2, δ ≥ 3)-partition (V1 , V2 ) of X all the vertices of T must be in the same set Vi . Note that we can not have cj,1 and cj,2 in different sets of the partition because then one of their 3 neighbours in V (R) must be in both sets. By a similar argument, for each i ∈ [n] the vertices ui,1 and ui,2 must belong to the same set in the partition and the vertices u0i,1 and u0i,2 must belong to the same set in the partition. It is easy to check that this implies our claim for T . If F is satisfiable, then by Theorem 2.2, we can find vertex disjoint cycles C, C 0 in R such that C contains a vertex corresponding to a literal of Cj for each j and V (R) = V (C) ∪ V (C 0 ). Now we let V1 = V (C 0 ) and V2 = V (X) − V1 . It is easy to check that this is a (δ ≥ 2, δ ≥ 3)-partition because C must contain exactly one of the vertices ai,1 , ai,2 and exactly one of the vertices bi,1 , bi,2 for each i ∈ [n]. Suppose now that (V1 , V2 ) is a good partition of X. By the argument above we have V (T ) ⊂ Vi for i = 1 or i = 2. This must be i = 2 since in the graph X − V (T ) all vertices except the switch vertices have degree 2. Thus we have V (T ) ⊂ V2 and each of the vertices cj,1 , cj,2 , j ∈ [m] have a neighbour in 9 V (R) which is also in V2 . As in earlier proofs it is easy to check that if some vertex of one of the paths Pi,1 , Pi,2 is in V2 then all vertices of that path are in V2 . As in the proof of the previous theorem, we now conclude that for each switch {ai,1 , ai,2 , bi,1 , bi,2 }, exactly one of the vertices ai,1 , ai,2 and exactly one of the vertices bi,1 , bi,2 is in V2 . Now we see that the vertices in V1 and V2 both induce a cycle in R and as the vertices cj,1 , cj,2 have degree 2 outside R, the cycle in R which is in V2 must contain a neighbour of each of cj,1 , cj,2 , j ∈ [m]. Hence, by Theorem 2.2, F is satisfiable.  Corollary 4.5 For every k ≥ 2 it is N P-complete to decide if a given graph with minimum degree at least k + 1 has a (δ ≥ k, δ ≥ k + 1)-partition. Proof: This follows by induction on k with Theorem 4.4 as the base case in the same way as we proved the last part of Theorem 4.3.  Proposition 4.6 There is a polynomial algorithm for deciding whether a given graph of minimum degree 5 has a (δ ≥ 2, δ ≥ 3)-partition. Proof: Let G have δ(G) ≥ 5. By Theorem 1.1 and the algorithmic version of this result from [7] we may assume that G has a 3-cycle C. Denote its vertex set by {a, b, c}. If δ(G[V − V (C)] ≥ 3) we are done as we can take V1 = V (C), so assume there is a vertex d which adjacent to all vertices of C. Then {a, b, c, d} induce a K4 . If δ(G[V − {a, b, c, d}) ≥ 2 we can take V2 = {a, b, c, d}, so we can assume that there is a vertex e which is adjacent to all 4 vertices in {a, b, c, d} and now {a, b, c, d, e} induce a K5 . Now if G[V − {a, b, c, d, e}] contains a cycle C 0 we can conclude by starting with V2 = {a, b, c, d, e} and adding vertices of V − V (C 0 ) − {a, b, c, d, e} to V2 as long as there is one with at least 3 neighbours in V2 . When the process stops (V − V2 , V2 ) is a good partition. Hence we can assume that G[V − {a, b, c, d, e}] is acyclic. If one connected component of G[V − {a, b, c, d, e}] is non trivial with a spanning tree T , then two leaves u, v of T will share a neighbour in {a, b, c, d, e}. Without loss of generality this is e and now the K4 induced by a, b, c, d and the cycle formed by e, u, v and the path between u and v in T are disjoint and we can find a good partition as we did above. Hence if we have not found the partition yet we must have that G[V − {a, b, c, d, e}] is an independent set I, all of whose vertices are joined to all vertices in {a, b, c, d, e}. If |I| ≥ 2 it is easy to find a good partition consisting of a 3-cycle on a, b and one vertex from I as V1 and the remaining vertices as V2 . Finally if |I| = 1 there is no solution.  5 Further 2-partition problems In [31] Thomassen proved that every graph G of connectivity at least k1 + k2 − 1 and minimum degree at least 4k1 + 4k2 + 1 has a 2-partition (V1 , V2 ) so that G[Vi ] is ki -connected for i = 1, 2. It is natural to ask about the complexity of deciding whether a graph has a 2-partition (V1 , V2 ) with prescribed lower bounds on the (edge-)connectivity of G[Vi ], i ∈ [2]. We start with a simple observation. Proposition 5.1 There exits a polynomial algorithm for deciding whether a given graph has a 2partition (V1 , V2 ) such that G[V1 ] is connected and G[V2 ] is 2-edge-connected. Proof: Suppose first that G is not 2-edge-connected. If G has more than two connected components it is a ’no’-instance. If it has two components, it is a ’yes’-instance if and only if one of these is 2-edge-connected. Hence we can assume that G is connected but not 2-edge-connected. Now it is easy to see that there is a good partition if and only if the block-cutvertex tree of G has a nontrivial block which is a leaf in the block-cutvertex tree. Thus assume below that G is 2-edge-connected. Now consider an ear-decomposition (sometimes called a handle-decomposition) of G where we start from an arbitrary cycle C. Let P be the last non-trivial ear that we add and let u, v be the end vertices of P . Then V1 = V (P ) − {u, v} and V2 = V − V1 is a good partition.  Perhaps a bit surprisingly, if we require just a bit more for the connected part, the problem becomes N P-complete. Both N P-completeness proofs below use reductions from a given 3-SAT formula F so we only describe the necessary modifications of R(F). 10 Theorem 5.2 It is N P-complete to decide whether an undirected graph G = (V, E) has a vertex partition (V1 , V2 ) so that G[V1 ] is 2-edge-connected and G[V2 ] is connected and non-acyclic. Proof: We add vertices and edges to R = R(F) as follows: • For each clause Cj , j ∈ [m] we add a vertex cj and join it by three edges to the three literal vertices of R corresponding to Cj (as we did in several proofs above). • Add new vertices c01 , c02 , . . . , c0m and edges cj c0j , j ∈ [m]. • Add new vertices α1 , . . . , αn , α01 , . . . , α0n and the edges αi ai,1 , αi ai,2 , αi α0i , i ∈ [n] • Add new vertices β1 , . . . , βn , β 01 , . . . , β 0n and the edges βi bi,1 , βi bi,2 , β i βi0 , i ∈ [n]. We claim that the resulting graph G has a vertex partition (V1 , V2 ) such that G[V1 ] is 2-edgeconnected and G[V2 ] is connected and non-acyclic if and only if F is satisfiable. Note that, by construction, for every good partition every vertex of G which is not in R must belong to V2 . In particular if a path Pi,j contains a vertex of V2 then all the vertices of Pi,j are in V2 . Since we want G[V2 ] to be connected, the edges between αi , βi , i ∈ [n] and R imply that for every i ∈ [n] at most one of the vertices ai,1 , ai,2 and a most one of the vertices bi,1 , bi,2 can belong to V1 . This implies that exactly one of ai,1 , ai,2 and exactly one of the vertices bi,1 , bi,2 belong to V1 as otherwise V1 would be empty. Now it is easy to check that the desired partition exists if and only if R contains a cycle C 0 which uses precisely one of the paths Pi,1 , Pi,2 for i ∈ [n] and avoids at least one literal vertex for every clause of F. Thus, by Theorem 2.2, F is satisfiable if and only if G has a good partition.  Since we can decide whether a graph has two vertex disjoint cycles in polynomial time [9, 25] the following result, whose easy proof we leave to the interested reader, implies that it is polynomial to decide whether a graph has a 2-partition into two connected and non-acyclic graphs. Proposition 5.3 A graph G has a 2-partition (V1 , V2 ) such that G[Vi ] is connected and has a cycle for i = 1, 2 if and only if G has a pair of disjoint cycles and either G is connected or it has exactly two connected components, each of which contain a cycle. Theorem 5.4 It is N P-complete to decide whether a graph G = (V, E) has a vertex partition (V1 , V2 ) so that each of G[V1 ] and G[V2 ] are 2-edge-connected. Proof: Let F be a 3-SAT formula and let G = G(F) be the graph we constructed in the proof above. Let G1 be the graph obtained by adding the following vertices and edges to G: • add new vertices c00j , j ∈ [m], qj , j ∈ {0} ∪ [m] and γ • add the edges c00j c0j , j ∈ [m] • add the edges of the path q0 c001 q1 c002 q2 . . . c00m qm • complete this path into a cycle W by adding the edges γq0 , γqm • add an edge from γ to all vertices in {α01 , . . . , α0n , β 01 , . . . , β 0n }. We claim that G0 has a vertex-partition into two 2-edge-connected graphs if and only if F is satisfiable. First observe that in any good partition (V1 , V2 ) we must have all vertices of W inside V1 or V2 . This follows from the fact that each qi has degree 2 so it needs both its neighbours in the same set. Without loss of generality, W is a cycle in V2 . After deleting the vertices of W we have exactly the graph G in the proof of Theorem 5.2 above and it is easy to see that all vertices not in V (R) must belong to V2 in any good partition. This implies that G0 has the desired vertex-partition if and only if the graph G has a partition (V1 , V20 ) so that G[V1 ] is 2-edge-connected and G[V20 ] is connected and non-acyclic. This problem is N P-complete by Theorem 5.2 so the proof is complete.  By inspecting the proof above it is not difficult to see that the following holds. Theorem 5.5 It N P-complete to decide whether a graph has a 2-partition (V1 , V2 ) such that each of the graphs G[Vi ], i = 1, 2 are 2-connected. It may be worth while to try and extend the results of this section to higher (edge)-connectivities. 11 References [1] N. Alon. Splitting digraphs. Combin. Prob. Comput., 15:933–937, 2006. [2] J. Bang-Jensen, N. Cohen, and F. Havet. Finding good 2-partitions of digraphs II. Enumerable properties. Theor. Comput. Sci., 640:1–19, 2016. [3] J. Bang-Jensen and G. Gutin. Digraphs: Theory, Algorithms and Applications. Springer-Verlag, London, 2nd edition, 2009. [4] J. Bang-Jensen and F. Havet. Finding good 2-partitions of digraphs I. Hereditary properties. Theor. Comput. Sci., 636:85–94, 2016. [5] C. Bazgan, Z. Tuza, and D.Vanderpooten. The satisfactory partition problem. Discrete Appl. Math., 154(8):1236–1245, 2006. [6] C. Bazgan, Z. Tuza, and D. Vanderpooten. Degree-constrained decompositions of graphs: Bounded treewidth and planarity. Theor. Comput. Sci., 355(3):389–395, 2006. [7] C. Bazgan, Z. Tuza, and D. Vanderpooten. Efficient algorithms for decomposing graphs under degree constraints. Discrete Applied Mathematics, 155(8):979 – 988, 2007. [8] J. Bensmail. On the complexity of partitioning a graph into a few connected subgraphs. J. Combin. Optim., 30:174–187, 2015. [9] B. Bollobás. Extremal Graph Theory. Academic Press, London, 1978. [10] M. Bonamy, K.K. Dabrowski, C. Feghali, M. Johnson, and D. Paulusma. Recognizing graphs close to bipartite graphs. In 42nd International Symposium on Mathematical Foundations of Computer Science, MFCS 2017, August 21-25, 2017 - Aalborg, Denmark, pages 70:1–70:14, 2017. [11] M. Bonamy, K.K. Dabrowski, C. Feghali, M. Johnson, and D. Paulusma. Independent feedback vertex sets for graphs of bounded diameter. Information Proc. Letters., 131:26–32, 2018. [12] J.A. Bondy and U.S.R. Murty. Graph Theory, volume 244 of Graduate Texts in Mathematics. Springer-Verlag, Berlin, 2008. [13] V. Chvátal. Recognizing decomposable graphs. J. Graph Theory, 8(1):51–53, 1984. [14] M.E. Dyer and A.M. Frieze. On the complexity of partitioning graphs into connected subgraphs. Discrete. Appl. Math., 10:139–153, 1985. [15] S. Földes and P. Hammer. Split graphs. Congress. Numer., 19:311–315, 1977. [16] M. Gerber and D. Kobler. Algorithmic approach to the satisfactory graph partitioning problem. European J. of Operation Research, 125:283–291, 2000. [17] M.U. Gerber and D. Kobler. Classes of graphs that can be partitioned to satisfy all their vertices. Australasian J. of Combin., 29:201–214, 2004. [18] A. Grigoriev and R. Sitters. Connected feedback vertex set in planar graphs. In WG 2009: Graph Theoretical concepts in Computer Science, volume 5911 of Lect. Notes Comp. Sci., pages 143–153. Springer Verlag, Berlin, 2009. [19] P. Hajnal. Partition of graphs with condition on the connectivity and minimum degree. Combinatorica, 3:95–99, 1983. [20] A. Kaneko. On decomposition of triangle-free graphs under degree constraints. J. Graph Theory, 27(1):7–9, 1998. [21] D. Kühn and D. Osthus. Partitions of graphs with high minimum degree or connectivity. J. Combin. Theory Ser. B, 88:29–43, 2003. 12 [22] H.-O. Le, V.B. Le, and H. Müller. Splitting a graph into disjoint induced paths or cycles. Discrete. Appl. Math., 131:199–212, 2003. [23] M. Liu and B. Xu. On partitions of graphs under degree constraints. Disc. Appl. Math., 226:87–93, 2017. [24] M.H. Liu and B.G. Xu. Bipartition of graph under degree constraints. Science China Mathematics, 58:869–874, 2015. [25] L. Lovasź. On graphs not containing independent circuits (in Hungarian). MatLapok, 16:289299, 1965. [26] J. Ma and T. Yang. Decomposing C4 -free graphs under degree constraints. arXiv:1706.07292, 2017. [27] N. Misra, G. Philip, V. Raman, S. Saurabh, and S. Sikdar. FPT algorithms for connected feedback vertex set. J. Combin. Optim., 24:131–146, 2012. [28] M. Stiebitz. Decomposition of graphs and digraphs. In KAM Series in Discrete MathematicsCombinatorics-Operations Research-Optimization 95-309. Charles University Prague, 1995. [29] M. Stiebitz. Decomposing graphs under degree constraints. J. Graph Theory, 23:321–324, 1996. [30] H. Suzuki, N. Takahashi, and T. Nishizeki. A linear algorithm for bipartion of biconnected graphs. Inform. Process. Lett., 33:227–231, 1990. [31] C. Thomassen. Graph decomposition with constraints on the connectivity and minimum degree. J. Graph Theory, 7:165–167, 1983. [32] C. Thomassen. Paths, circuits and subdivisions. In Selected topics in graph theory Vol. 3, pages 97–131. Academic Press, 1988. [33] P. van’t Hof, D. Paulusma, and G.J. Woeginger. Partitioning graphs into connected parts. Theor. Comput. Sci., 410:4834–4843, 2009. [34] M. Xiao and H. Nagamochi. Complexity and kernels for bipartition into degree-bounded induced graphs. Theor. Comput. Sci., 659:72–82, 2017. 13
8cs.DS
How Crossover Speeds Up Building-Block Assembly in Genetic Algorithms arXiv:1403.6600v2 [cs.NE] 26 Nov 2014 Dirk Sudholt Department of Computer Science, University of Sheffield, United Kingdom Abstract We re-investigate a fundamental question: how effective is crossover in Genetic Algorithms in combining building blocks of good solutions? Although this has been discussed controversially for decades, we are still lacking a rigorous and intuitive answer. We provide such answers for royal road functions and O NE M AX, where every bit is a building block. For the latter we show that using crossover makes every (µ+λ) Genetic Algorithm at least twice as fast as the fastest evolutionary algorithm using only standard bit mutation, up to small-order terms and for moderate µ and λ. Crossover is beneficial because it effectively turns fitness-neutral mutations into improvements by combining the right building blocks at a later stage. Compared to mutation-based evolutionary algorithms, this makes multi-bit mutations more useful. Introducing crossover changes the optimal mutation rate on O NE M AX from 1/n √ to (1 + 5)/2 · 1/n ≈ 1.618/n. This holds both for uniform crossover and k-point crossover. Experiments and statistical tests confirm that our findings apply to a broad class of building-block functions. Keywords Genetic algorithms, crossover, recombination, mutation rate, runtime analysis, theory. 1 Introduction Ever since the early days of genetic algorithms (GAs), researchers have wondered when and why crossover is an effective search operator. It has been folklore that crossover is useful if it can combine building blocks, i. e., schema of high fitness, to give better solutions [30]. But, as Watson and Jansen [50] put it, there has been a considerable difficulty in demonstrating this rigorously and intuitively. Many attempts at understanding crossover have been made in the past. Mitchell, Forrest, and Holland [30] presented so-called royal road functions as an example where, supposedly, genetic algorithms outperform other search algorithms due to the use of crossover. Royal roads divide a bit string into disjoint blocks. Each block makes a positive contribution to the fitness in case all bits therein are set to 1. Blocks thus represent schemata, and all-ones configurations are building blocks of optimal solutions. However, the same authors later concluded that simple randomized hill climbers performed better than GAs [17, 31]. The role of crossover has been studied from multiple angles, including algebra [42], Markov chain models [49], infinite population models and dynamical systems (see [7, Chapter 6] for an overview) and statistical mechanics (see, e. g. [15, Chapter 11]). Also in biology the role of crossover is far from settled. In population genetics, exploring the advantages of recombination, or sexual reproduction, is a famous open question [5] and has been called “the queen of problems in evolutionary biology” by Graham Bell [6] and others. Evolutionary processes were found to be harder to analyze than those using only asexual reproduction as they represent quadratic dynamical systems [2, 40]. Recent work in population genetics has focussed on studying the “speed of adaptation”, which describes the efficiency of evolution, in a similar vein to research in evolutionary computation [52, 53]. Furthermore, a new theory of mixability has been proposed recently from the perspective of theoretical computer science [28, 29], arguing that recombination favours individuals that are good “mixers”, that is, individuals that create good offspring when being recombined with others. Several researchers recently and independently reported empirical observations that using crossover improves the performance of evolutionary algorithms (EAs) on Pn the simple function O NE M AX (x) = i=1 xi [24, 41], but were unable to explain why. The fact that even settings as simple as O NE M AX are not well understood demonstrates the need for a solid theory and serves as motivation for this work. Runtime analysis has become a major area of research that can give rigorous evidence and proven theorems [35, 3, 18]. However, studies so far have eluded the most fundamental setting of building-block functions. Crossover was proven to be superior to mutation only on constructed artificial examples like Jumpk [20, 23] and “Real Royal Road” functions [21, 43], the H-IFF problem [8], coloring problems inspired by the Ising model from physics [16, 44]1 , computing unique input-output sequences for finite state machines [26], selected problems from multi-objective optimization [39], and the allpairs shortest path problem [11, 48, 34]. H-IFF [8] and the Ising model on trees [44] consist of hierarchical building blocks. But none of the above papers addresses singlelevel building blocks in a setting as simple as royal roads. Watson and Jansen [50] presented a constructed building-block function and proved exponential performance gaps between EAs using only mutation and a GA. However, the definition of the internal structure of building blocks is complicated and artificial, and they used a tailored multi-deme GA to get the necessary diversity. With regard to the question on how GAs combine building blocks, their approach does not give the intuitive explanation one is hoping for. This paper presents such an intuitive explanation, supported by rigorous analyses. We consider royal roads and other functions Pn composed of building blocks, such as monotone polynomials. O NE M AX(x) = i=1 xi is a special case where every bit is a building block. We give rigorous proofs for O NE M AX and show how the main proof arguments transfer to broader classes of building-block functions. Experiments support the latter. Our main results are as follows. 1. We show in Section 3 that on O NE M AX every (µ+λ) GA with uniform crossover and standard bit mutation is at least twice as fast as every evolutionary algorithm (EA) that only uses standard bit mutations (up to small-order terms). More precisely, the dominating term in the expected number of function evaluations decreases from e·n ln n to e/2·n ln n. This holds provided that the parent population and offspring population sizes µ and λ are moderate, so that the inertia of a large population does not slow down exploitation. The reason for this speedup is that the GA can store a neutral mutation (a mutation not altering the parent’s fitness) in the population, along with the respective parent. It can then use crossover to combine the good building blocks between these two individuals, improving the current best fitness. 1 For bipartite graphs, the problem is equivalent to the classical Graph Coloring problem with 2 colors. 2 In other words, crossover can capitalize on mutations that have both beneficial and disruptive effects on building blocks. 2. The use of uniform crossover leads to a shift in the optimal mutation rate on O NE M AX. We demonstrate this in Section 4 for a simple “greedy” (2+1) GA that always selects parents among the current best individuals. While for mutation-based EAs 1/n is the optimal mutation rate [55], the greedy (2+1) GA has an optimal mutation √ rate of (1 + 5)/2 · 1/n ≈ 1.618/n (ignoring small-order terms). This is because introducing crossover makes neutral mutations more useful and larger mutation rates increase the chance of a neutral mutation. Optimality is proved by means of a matching lower bound on the expected optimization time of the greedy (2+1) GA that applies to all mask-based crossover operators (where each bit value is taken from either parent). Using the optimal mutation rate, the expected number of function evaluations is 1.19n ln n ± O(n log log n). 3. These results are not limited to uniform crossover or the absence of linkage. Section 5 shows that the same results hold for GAs using k-point crossover, for arbitrary k, under slightly stronger conditions on µ and λ, if the crossover probability pc is set to an appropriately small value. 4. The reasoning for O NE M AX carries over to other functions with a clear building block structure. Experiments in Section 6 reveal similar performance differences as on O NE M AX for royal road functions and random polynomials with unweighted, positive coefficients. This is largely confirmed by statistical tests. There is evidence that findings also transfer to weighted building-block functions like linear functions, provided that the population can store solutions with different fitness values and different building blocks until crossover is able to combine them. This is not the case for the greedy (2+1) GA, but a simple (5+1) GA is significantly faster on random linear functions than the optimal mutation-based EA for this class of functions, the (1+1) EA [55]. The first result, the analysis for uniform crossover, is remarkably simple and intuitive. It gives direct insight into the working principles of GAs. Its simplicity also makes it very well suited for teaching purposes. This work extends a preliminary conference paper [46] with parts of the results, where results were restricted to one particular GA, the greedy (2+1) GA. This extended version presents a general analytical framework that applies to all (µ+λ) GAs, subject to mild conditions, and includes the greedy (2+1) GA as a special case. To this end, we provide tools for analyzing parent and offspring populations in (µ+λ) GAs, which we believe are of independent interest. Moreover, results for k-point crossover have been improved. The leading constant 2c larger in the upper bound for k-point crossover in [46] was by an additive term of 3+3c than that for uniform crossover, for mutation rates of c/n. This left open the question whether k-point crossover is as effective as uniform crossover for assembling building blocks in O NE M AX. Here we provide a new and refined analysis, which gives an affirmative answer, under mild conditions on the crossover probability. 1.1 Related Work Kötzing, Sudholt, and Theile [23] considered the search behaviour of an idealized GA on O NE M AX, to highlight the potential benefits of crossover under ideal circumstances. 3 If a GA was able to recombine two individuals with equal fitness that√result from independent evolutionary lineages, the fitness gain can be of order Ω( n). The √ idealized GA would therefore be able to optimize O NE M AX in expected time O( n) [23]. However, this idealization cannot reasonably be achieved in realistic EAs with common search operators, hence the result should be regarded an academic study on the potential benefit of crossover. A related strand of research deals with the analysis of the Simple GA on O NE M AX. The Simple GA is one of the best known and best researched GAs in the field. It uses a generational model where parents are selected using fitness-proportional selection and the generated offspring form the next population. Neumann, Oliveto and Witt [33] showed that the Simple GA without crossover with high probability cannot optimize O NE M AX in less than exponential time. The reason is that the population typically contains individuals of similar fitness, and then fitness-proportional selection is similar to uniform selection. Oliveto and Witt [38] extended this result to uniform crossover: the Simple GA with uniform crossover and population size µ ≤ n1/8−ε , ε > 0, still needs exponential time on O NE M AX. It even needs exponential time to reach a solution of fitness larger than (1 + c) · n/2 for an arbitrary constant c > 0. In [37] the same authors relaxed their condition on the population size to µ ≤ n1/4−ε . Their work does not exclude that crossover is advantageous, particularly since under the right circumstances crossover may lead to a large increase in fitness (cf. [23]). But if there is an advantage, it is not noticeable as the Simple GA with crossover still fails badly on O NE M AX. One year after [46] was published, Doerr, Doerr, and Ebel [9] presented a groundbreaking result: they designed an EA that was √ proven to optimise O NE M AX (and any simple transformation thereof) in time O(n log n). This is a spectacular result as all black-box search algorithms using only unbiased unary operators—operators modifying one individual only, and not exhibiting any inherent search bias—need time Ω(n log n) as shown by Lehre and Witt [27]. So their EA shows that crossover can lower the expected running time by more than a constant factor. They call their algorithm a (1+(λ, λ)) EA: starting with one parent, it first creates λ offspring by mutation, with a random and potentially high mutation rate. Then it selects the best mutant, and crosses it λ times with the original parent, using parameterized uniform crossover (the probability of taking a bit from the first parent √ is not always 1/2, but a parameter of the algorithm). This leads to a number of O(n log n) expected function evaluations, which can be further decreased to O(n) with a scheme adapting λ according to the current fitness. The (1+(λ, λ)) EA from [9] is very cleverly designed to work efficiently on O NE M AX and similar functions. It uses a non-standard EA design because of its two phases of environmental selection. Other differences are that mutation is performed before crossover, and mutation is not fully independent for all offspring: the number of flipping bits is a random variable determined as for standard bit mutations, but the same number of flipping bits is then used in all offspring. The focus of this work is different as our goal is to understand how standard EAs operate, and how crossover can be used to speed up building-block assembly in commonly used (µ+λ) EAs. 2 Preliminaries We measure the performance of the algorithm with respect to the number of function evaluations performed until an optimum is found, and refer to this as optimization time. For steady-state algorithms this equals the number of generations (apart from the initialization), and for EAs with offspring populations such as (µ+λ) EAs or (µ+λ) GAs the optimization time is by a factor of λ larger than the number of generations. Note 4 that the number of generations needed to optimize a fitness function can often be easily decreased by using offspring populations or parallel evolutionary algorithms [25]. But this significantly increases the computational effort within one generation, so the number of function evaluations is a more fair and widely used measure. Looking at function evaluations is often motivated by the fact that this operation dominates the execution time of the algorithm. Then the number of function evaluations is a reliable measure for wall clock time. However, the wall clock time might increase when introducing crossover as an additional search operator. Also when increasing the mutation rate, more pseudo-random numbers might be required. Jansen and Zarges [22] point out a case where this effect leads to a discrepancy between the number of function evaluations and wall clock time. This concern must be taken seriously when aiming at reducing wall clock time. However, each implementation must be checked individually in this respect [22]. Therefore, we keep this concern in mind, but still use the number of function evaluations in the following. 3 Uniform Crossover Makes (µ+λ) EAs Twice as Fast We show that, under mild conditions, every (µ+λ) GA is at least twice as fast as its counterpart without crossover. For the latter, that is, evolutionary algorithms using only standard bit mutation, the author recently proved the following lower bound on the running time of a very broad class of mutation-based EAs [47]. It covers all possible selection mechanisms, parent or offspring populations, and even parallel evolutionary algorithms. We slightly rephrase this result. Theorem 1 (Sudholt [47]). Let n ≥ 2. Every EA that uses only standard bit mutation with mutation rate p to create new solutions has expected optimization time at least min{ln n, ln(1/(p2 n))} − ln ln n − 3 p(1 − p)n on O NE M AX and every other function with a unique optimum, if 2−n/3 ≤ p ≤ p = c/n, c > 0 constant, this is at least √ 1 . n log n If c · ec · n ln n · (1 − o(1)). In fact, for O NE M AX the author proved that among all evolutionary algorithms that start with one random solution and only use standard bit mutations the expected number of function evaluations is minimized by the simple (1+1) EA [47, Theorem 13]. Also the mutation rate p = 1/n is the best possible choice for O NE M AX, leading to a lower bound of en ln n − en ln ln n − 3en. For the special case of p = 1/n, Doerr, Fouz, and Witt [10] recently improved the above bound towards en ln n − O(n). We show that for a range of (µ+λ) EAs, as defined in the following, introducing uniform crossover can cut the dominant term of the running time in half, for the standard mutation rate p = 1/n. The only requirement on the parent selection mechanism is that selection does not favor inferior solutions over fitter ones. Formally, for maximizing a fitness function f , ∀x, y : f (x) ≥ f (y) ⇒ Prob(select x) ≥ Prob(select y). 5 (1) This in particular implies that equally fit solutions are selected with the same probability. Condition (1) is satisfied for all common selection mechanisms: uniform selection, fitness-proportional selection, tournament selection, cut selection, and rank-based mechanisms. The class of (µ+λ) EAs covered in this work is defined in Algorithm 1. All (µ+λ) EAs therein create λ offspring through crossover and mutation, or just mutation, and then pick the best out of the µ previous search points and the λ new offspring. Algorithm 1: Scheme of a (µ+λ) GA with mutation rate p and uniform crossover with crossover probability pc for maximizing f : {0, 1}n → R. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Initialize population P of size µ ∈ N u. a. r. while true do Let P 0 = ∅. for i = 1, . . . , λ do With probability pc do Select x1 , x2 with an operator respecting (1). Let y := uniform crossover(x1 , x2 ). otherwise do Select y with an operator respecting (1). end Flip each bit in y independently with probability p. Add y to P 0 . end Let P contain the µ best individuals from P ∪ P 0 ; break ties towards including individuals with the fewest duplicates in P ∪ P 0 . end In the case of ties, we pick solutions that have the fewest duplicates among the considered search points. This strategy has already been used by Jansen and Wegener [21] in their groundbreaking work on Real Royal Roads; it ensures a sufficient degree of diversity whenever the population contains different search points of the same fitness. Before stating the main result of this section, we provide two lemmas showing how to analyse population dynamics. Both lemmas are of independent interest and may prove useful in other studies of population-based EAs. The following lemma estimates the expected time until individuals with fitness at least i take over the whole population. It generalizes Lemma 3 in [45], which in turn goes back to Witt’s analysis of the (µ+1) EA [54]. Note that the lemma applies to arbitrary fitness functions, arbitrary values for µ and λ, and arbitrary crossover operators; it merely relies on fundamental and universal properties of cut selection and standard bit mutations. Lemma 2. Consider any (µ+λ) GA implementing Algorithm 1, with any crossover operator, on any n-bit fitness function. Assume the current population contains at least one individual of fitness i. The expected number of function evaluations needed for the (µ+λ) GA before all individuals in its current population have fitness at least i is at most O((µ + λ) log µ) . (1 − pc )(1 − p)n 6 This holds for any tie-breaking rule used in the environmental selection. Proof. Call an individual fit if it has fitness at least i. We now estimate the expected number of generations until the population is taken over by fit individuals, which we call the expected takeover time. As fit individuals are always preferred to non-fit individuals in the environmental selection, the expected takeover time equals the expected number of generations until µ fit individuals have been created, starting with one fit individual. For each offspring being created, there is a chance that the (µ+λ) GA will simply create a clone of a fit individual. This happens if, during the creation of an offspring, the (µ+λ) GA decides not to perform crossover, it selects a fit individual as parent to be mutated, and mutation does not flip any bit. The probability for this event is at least (1 − pc ) · (1 − p)n · number of fit individuals in population µ since each fit individual is selected as parent with probability at least 1/µ. Now we divide the run of the (µ+λ) GA into phases in order to get a lower bound on the number of fit individuals at certain time steps. The j-th phase, 0 ≤ j ≤ dlog5 µe − 1, starts with the first offspring creation in the first generation where the number of fit individuals is at least 5j . It ends in the first generation where this number is increased to min{5j+1 , µ}. Let Tj describe the random number of generations spent in the j-th phase. Starting with a new generation with µ ≥ 5j fit individuals in the parent population, we now consider a phase of 8µ/((1 − pc )(1 − p)n ) offspring creations, disregarding generation bounds. Let Ni denote the random number of new fit offspring created in the phase, then E(Ni ) ≥ i 8µ n 5 = 8 · 5i · (1 − p )(1 − p) · c (1 − pc )(1 − p)n µ and by classical Chernoff bounds (see, e. g. [32, Chapter 4]) i Prob(Ni < 4 · 5i ) ≤ e−E(Ni )/8 ≤ e−5 ≤ e−1 . If Ni < 4 · 5i the phase is called unsuccessful and we consider another phase of 8µ/((1 − pc )(1 − p)n ) offspring creations. The expected waiting time for a successful phase is at most 1/(1 − e−1 ) and the expected number of offspring creations until Ni ≥ 4 · 5i is at most 8µ/((1 − pc )(1 − p)n (1 − e−1 )). Since phases start at generation bounds, we may need to account for up to λ − 1 further offspring creations in between phases. This implies E(Ti ) ≤ 8µ +λ (1 − pc )(1 − p)n (1 − e−1 ) and the expected takeover time is at most dlog5 µe−1 X i=0  E(Ti ) ≤ dlog5 µe · =  8µ + λ (1 − pc )(1 − p)n (1 − e−1 ) O((µ + λ) log µ) . (1 − pc )(1 − p)n 7 We also provide the following simple but handy lemma, which relates success probabilities for created offspring to the expected number of function evaluations needed to complete a generation where such an event has first happened. Lemma 3. Consider any (µ+λ) GA implementing Algorithm 1, and assume that in each offspring creation there is a probability at least q that some specific event occurs. Then the expected number of function evaluations to complete a generation where this event first occurs is at most 1 λ−1+ . q Proof. The expected number of trials for an event with probability q to occur is 1/q. To complete the generation, at most λ − 1 further function evaluations are required. Now we are able to prove the main result of this section. Theorem 4. The expected optimization time of every (µ+λ) GA implementing Algorithm 1 with 0 < pc < 1 constant, mutation probability 0 < p < 1 and µ ≥ 2 on O NE M AX is at most O((µ + λ)n log µ) ln(n2 p + n) + 1 + p + . n−1 p(1 − p) · (1 + np) (1 − p)n (2) If p = c/n, c > 0 constant, and µ, λ = o((log n)/(log log n)), this bound simplifies to n ln n · (1 + o(1)). c · e−c · (1 + c) (3) Both statements hold for arbitrary initial populations. The main difference between the upper bound for (µ+λ) GAs and the lower bound for all mutation-based EAs is an additional factor of 1 + pn in the denominator of the upper bound. This is a factor of 2 for p = 1/n and an even larger gain for larger mutation rates. For the default value of p = 1/n, this shows that introducing crossover makes EAs at least twice as fast as the fastest EA using only standard bit mutation. It also implies that introducing crossover makes EAs at least twice as fast as their counterparts without crossover (i. e. where pc = 0). Proof of Theorem 4. Bound (3) can be derived from (2) using (1−1/x)x−1 ≥ 1/e for x > 1 to estimate    c n−1  c (n/c−1)·c  c c−1 1 c2 1− = 1− · 1− ≥ c · 1− = e−c − O(1/n) n n n e n as well as ln(cn + n) + 1 + c/n = (ln n) + O(1). Note that (µ + λ)n log µ = o(n log n) by conditions on µ, λ, hence this and all other small-order terms are absorbed in the term o(1). In order to prove the general bound (2), we consider canonical fitness levels, i. e., the i-th fitness level contains all search points with fitness i. We estimate the time spent on each level i, i. e., when the best fitness in the current population is i. For each fitness level we consider three cases. The first case applies when the population contains individuals on fitness levels less than i. The second case is when the population only contains copies of a single individual on level i. The third case occurs when the population contains more than one individual on level i; then the population contains different “building blocks” that can be recombined effectively by crossover. 8 All these cases capture the typical behaviour of a (µ+λ) GA, albeit some of these cases, and even whole fitness levels, may be skipped. We obtain an upper bound on its expected optimization time by summing up expected times the (µ+λ) GA may spend in all cases and on all fitness levels. Case i.1: The population contains an individual on level i and at least one individual on a lower fitness level. A sufficient condition for leaving this case is that all individuals in the population obtain fitness at least i. Since the (µ+λ) GA never accepts worsenings, the case is left for good. The time for all individuals reaching fitness at least i has already been estimated in Lemma 2. Applying this lemma to all fitness levels i, the overall time spent in all cases i.1 is at most O((µ + λ)n log µ) O((µ + λ)n log µ) = . n (1 − pc )(1 − p) (1 − p)n Case i.2: The population contains µ copies of the same individual x on level i. In this case, each offspring created by the (µ+λ) GA will be a standard mutation of x. This is obvious for offspring where the (µ+λ) GA decides not to use crossover. If crossover is used, the (µ+λ) GA will pick x1 , x2 = x, create y = x by crossover, and hence perform a mutation on x. The (µ+λ) GA leaves this case for good if either a better search point is created or if it creates another search point with i ones. In the latter case we will create a population with two different individuals on level i. Note that due to the choice of the tie-breaking rule in the environmental selection, the (µ+λ) GA will always maintain at least two individuals on level i, unless an improvement with larger fitness is found. The probability of creating a better search point in one mutation is at least (n − i) · p(1 − p)n−1 as there are n − i suitable 1-bit flips. The probability of creating a different search point on level i is at least i(n − i) · p2 (1 − p)n−2 as it is sufficient to flip one of i 1-bits, to flip one of n − i 0-bits, and not to flip any other bit. The probability of either event happening in one offspring creation is thus at least (n − i) · p(1 − p)n−1 + i(n − i) · p2 (1 − p)n−2 ≥ p(1 − p)n−1 · (n − i)(1 + ip). By Lemma 3, the expected number of function evaluations in Case i.2 is at most λ+ 1 . p(1 − p)n−1 · (n − i)(1 + ip) The expected number of functions evaluations made in all cases i.2 is hence at most λn + n−1 X i=0 = λn + 1 p(1 − p)n−1 · (n − i)(1 + ip) n−1 X 1 1 · . n−1 p(1 − p) (n − i)(1 + ip) i=0 9 (4) The last sum can be estimated as follows. Separating the summand for i = n − 1, n−2 X 1 1 + (n − i)(1 + ip) 1 + (n − 1)p i=0 n−1 ≤ Z i=0 1 1+p di + . (n − i)(1 + ip) 1 + np We use equation 3.3.20 in [1] to simplify the integral and get  n−1  1+p 1 + ip 1 · ln + 1 + np n−i 1 + np 0 ln(np + 1 − p) + ln(n) 1+p = + 1 + np 1 + np ln(n2 p + n) + 1 + p ≤ . 1 + np Plugging this into (4) yields that the expected time in all cases i.2 is at most λn + ln(n2 p + n) + 1 + p . p(1 − p)n−1 · (1 + np) Case i.3: The population only contains individuals on level i, not all of which are identical. In this case we can rely on crossover recombining two different individuals on level i. As they both have different “building blocks”, i. e., different bits are set to 1, there is a good chance that crossover will generate an offspring with a higher number of 1-bits. The probability of performing a crossover with two different parents in one offspring creation is at least µ−1 pc · µ2 as in the worst case the population contains µ − 1 copies of one particular individual. Assuming two different parents are selected for crossover, let these have Hamming distance 2d and let X denote the number of 1-bits among these positions in the offspring. Note that X is binomially distributed with parameters 2d and 1/2 and its expectation is d. We estimate the probability of getting a surplus of 1-bits as this leads to an improvement in fitness. This estimate holds for any d ∈ N. Since Prob(X < d) = Prob(X > d), we have    1 1 1 −2d 2d Prob(X > d) = (1 − Prob(X = d)) = 1−2 ≥ . 2 2 d 4 Mutation keeps all 1-bits with probability at least (1 − p)n . Together, the probability of increasing the current best fitness in one offspring creation is at least pc · µ − 1 (1 − p)n · . µ2 4 By Lemma 3, the expected number of function evaluations in Case i.3 is at most λ+ 4µ2 . pc · (µ − 1) · (1 − p)n 10 The total expected time spent in all cases i.3 is hence at most λn + O(µn) 4µ2 n = λn + n pc · (µ − 1) · (1 − p) (1 − p)n as pc = Ω(1). Summing up all expected times yields a total time bound of ln(n2 p + n) + 1 + p O(µn) + O((µ + λ)n log µ) + 2λn + p(1 − p)n−1 · (1 + np) (1 − p)n 2 ln(n p + n) + 1 + p O((µ + λ)n log µ) = . + p(1 − p)n−1 · (1 + np) (1 − p)n Remark 1 (On conditions for µ and λ). The second statement of Theorem 4 requires µ, λ = o((log n)/(log log n)) in order to establish the upper bound in (3). This condition seems necessary as for larger values of µ and λ the inertia of a large population slows down exploitation, at least in the absence of crossover. Note not all EAs covered by Theorem 4 (after removing crossover) optimize O NE M AX in time O(n log n). Witt [54] showed that a (µ+1) EA with uniform parent selection has an expected optimization time of Ω(µn + n log n) on O NE M AX. For µ = ω(log n), this lower bound is ω(n log n). Jansen, De Jong, and Wegener [19] showed that a (1+λ) EA needs time ω(n log n) on O NE M AX if λ = ω((log n)(log log n)/(log log log n)). Badkobeh, Lehre, and Sudholt [4] showed that every black-box algorithm creating λ offspring, using only standard bit mutation or other unary unbiased operators, needs time ω(n log n) on O NE M AX for λ = ω((log n)(log log n)). This indicates that the threshold in the condition µ, λ = o((log n)/(log log n)) is tight up to polynomials of log log n. Remark 2 (On conditions for pc ). Theorem 4 assumes 0 < pc < 1 constant, which reflects the most common choices in applications of EAs. The theorem can be extended towards smaller or larger values as follows. If pc = o(1) the upper bound on the time spent in Cases i.3 increases as it contains a factor of 1/pc . The other cases remain unaffected, and if ((µ + λ) log µ)/pc = o(log n) we still get the upper bound from (3). For high crossover probabilities, that is, pc = 1 − o(1) or pc = 1, only Cases i.1 need to be revisited. The time in those cases was derived from Lemma 2, which can be adapted as follows: the probability for increasing the number of fit individuals is at least (number of fit individuals in population)2 pc · (1 − p)n · 2µ2 as it suffices to select two fit individuals and generate an average or above-average number of 1-bits in the offspring, which happens with probability at least 1/2. The time bound from Lemma 2 then becomes O(µ2 + λ log µ) (1 − p)n and the time bound in Theorem 4 becomes ln(n2 p + n) + 1 + p O(n(µ2 + λ log µ)) . + n−1 p(1 − p) · (1 + np) (1 − p)n √ For p = c/n, c > 0 constant, and µ, λ = o( log n), this also establishes the upper bound from (3). 11 It is remarkable that the waiting time for successful crossovers in Cases i.3 is only of order O((µ + λ)n). For small values of µ and λ, e. g. µ, λ = O(1), the time spent in all Cases i.3 is O(n), which is negligible compared to the overall time bound of order Θ(n log n). This shows how effective crossover is in recombining building blocks. Also note that the proof of Theorem 4 is relatively simple as it uses only elementary arguments and, along with Lemmas 2 and 3, it is fully self-contained. The analysis therefore lends itself for teaching purposes on the behavior of evolutionary algorithms and the benefits of crossover. Our analysis has revealed that fitness-neutral mutations, that is, mutations creating a different search point of the same fitness, can help to escape from the case of a population with identical individuals. Even though these mutations do not immediately yield an improvement in terms of fitness, they increase the diversity in the population. Crossover is very efficient in exploiting this gained diversity by combining two different search points at a later stage. This means that crossover can capitalize on mutations that have both beneficial and disruptive effects on building blocks. An interesting consequence is that this affects the optimal mutation rate on O NE M AX. For EAs using only standard bit mutations Witt [55] recently proved that 1/n is the optimal mutation rate for the (1+1) EA on all linear functions. Recall that the (1+1) EA is the optimal mutation-based EA (in the sense of Theorem 1) on O NE M AX [47]. For mutation-based EAs on O NE M AX neutral mutations are neither helpful nor detrimental. With crossover neutral mutations now become helpful. Increasing the mutation rate increases the likelihood of neutral mutations. In fact, we can easily derive better upper bounds from Theorem 4 for slightly larger mutation rates, thanks to the additional term 1 + np in the denominator of the upper bound. The dominant term in (3), n ln n −c c · e · (1 + c) √ is minimized for c being the golden ratio c = ( 5 + 1)/2 ≈ 1.618. This leads to the following. Corollary√5. The asymptotically best running time bound from Theorem 4 is obtained for p = (1 + 5)/(2n). For this choice the dominant term in (3) becomes √ e( 5+1)/2 √ · n ln n ≈ 1.19n ln n. 5+2 4 The Optimal Mutation Rate Corollary 5 gives the mutation rate that yields the best upper bound on the running time that can be obtained with the proof of Theorem 4. However, it does not establish that this mutation rate is indeed optimal for any GA. After all, we cannot exclude that another mutation rate leads to a smaller expected optimization time. In the following, we show for a simple (2+1) GA (Algorithm 2) that the upper bound from √ Theorem 4 is indeed tight up to small-order terms, which establishes p = (1+ 5)/(2n) as the optimal mutation rate for that (2+1) GA. Proving lower bounds on expected optimization times is often a notoriously hard task, hence we restrict ourselves to a simple “bare-bones” GA that captures the characteristics of GAs covered by Theorem 4 and is easy to analyze. The latter is achieved by fixing as many parameters as possible. 12 As the upper bound from Theorem 4 grows with µ and λ, we pick the smallest possible values: µ = 2 and λ = 1. The parent selection is made as simple as possible: we select parents uniformly at random from the current best individuals in the population. In other words, if we define the parent population as the set of individuals that have a positive probability to be chosen as parents, the parent population only contains individuals of the current best fitness. We call this parent selection “greedy” because it is a greedy strategy to choose the current best search points as parents. In the context of the proof of Theorem 4 greedy parent selection implies that Cases i.1 are never reached as the parent population never spans more than one fitness level. So the time spent in these cases is 0. This also allows us to eliminate one further parameter by setting pc = 1, as lower values for pc were only beneficial in Cases i.1. Setting pc = 1 minimizes our estimate for the time spent in Cases i.3. So Theorem 4 extends towards this GA (see also Remark 2). We call the resulting GA “greedy (2+1) GA” because its main characteristics is the greedy parent selection. The greedy (2+1) GA is defined in Algorithm 22 . Algorithm 2: Greedy (2+1) GA with mutation rate p for maximizing f : {0, 1}n → R. 1 2 3 4 5 6 7 Initialize population P of size 2 u. a. r. while true do Select x1 , x2 u. a. r. from {x ∈ P | ∀y ∈ P : f (x) ≥ f (y)}. Let y := crossover(x1 , x2 ). Flip each bit in y independently with probability p. Let P contain the 2 best individuals from P ∪ {y}; break ties towards including individuals with the fewest duplicates in P ∪ {y}. end The following result applies to the greedy (2+1) GA using any kind of mask-based crossover. A mask-based crossover is a recombination operator where each bit value is taken from either parent; that is, it is not possible to introduce a bit value which is not represented in any parent. All common crossovers are mask-based crossovers: uniform crossover, including parameterized uniform crossover, as well as k-point crossovers for any k. The following result even includes biased operators like a bit-wise OR, which induces a tendency to increase the number of 1-bits. √ Theorem 6. Consider the greedy (2+1) GA with mutation rate 0 < p ≤ 1/( n log n) using an arbitrary mask-based crossover operator. Its expected optimization time on O NE M AX is at least min{ln n, ln(1/(p2 n))} − O(log log n) . k n (1 + maxk { (pn) k!k! }) · p(1 − p) Before giving the proof, note that for p = c/n with 0 < c ≤ 4 constant, k i+1 i i (pn) (pn) (pn) pn maxk { (pn) k!k! } = pn as for 0 < pn ≤ 4 and i ∈ N (i+1)!(i+1)! = (i+1)2 · i!i! ≤ i!i! , hence a maximum is attained for k = 1. Then the lower bound from Theorem 6 is n ln n − O(n log log n). c · e−c · (1 + c) 2 Note that in [46] the greedy (2+1) GA was defined slightly differently as there duplicate genotypes are always rejected. Algorithm 2 is equivalent to the greedy (2+1) GA from [46] for the following reasons. If the current population contains two different individuals of equal fitness and a duplicate of one of the parents is created, both algorithms reject a duplicate genotype. If the population contains two individuals of different fitness, both behave like the population only contained the fitter individual. 13 This matches the upper bound (3) up to small order terms, showing for the greedy (2+1) GA that the new term 1 + c in the denominator of the bound from Theorem 4 was not a coincidence. For p > 4/n, the lower bound is at least (e + Ω(1)) · n ln n. Together, this establishes the optimal mutation rate for the greedy (2+1) GA on O NE M AX. Theorem√7. For the greedy (2+1) GA with uniform crossover on O NE M AX mutation rate p = (1 + 5)/(2n) minimizes the expected number of function evaluations, up to small-order terms. For the proof of Theorem 6 we use the following lower-bound technique based on fitness levels by the author [47]. Theorem 8 (Sudholt [47]). Consider a partition of the search space into non-empty sets A1 , . . . , Am . For a search algorithm A we say that it is in Ai or on level i if the best individual created so far is in Ai . If there are χ, ui , γi,j for i < j where 1. the probability of traversing from level i to level j in one step is at most ui γi,j for all i < j, Pm 2. j=i+1 γi,j = 1 for all i, and Pm 3. γi,j ≥ χ k=j γi,k for all i < j and some 0 ≤ χ ≤ 1, then the expected hitting time of Am is at least m−1 X i=1 Prob(A starts in Ai ) · χ m−1 X j=i 1 . uj (5) Proof of Theorem 6. We prove a lower bound for the following sped-up GA instead of the original greedy (2+1) GA. Whenever it creates a new offspring with the same fitness, but a different bit string as the current best individual, we assume the following. The algorithm automatically performs a crossover between the two. Also, we assume that this crossover leads to the best possible offspring in a sense that all bits where both parents differ are set to 1 (i. e., the algorithm performs a bit-wise OR). That is, if both search points have i 1-bits and Hamming distance 2k, then the resulting offspring has i + k 1-bits. Due to our assumptions, at the end of each generation there is always a single best individual. For this reason we can model the algorithm by a Markov chain representing the current best fitness. The analysis follows a lower bound for EAs on O NE M AX [47, Theorem 9]. As in [47] we consider the following fitness-level partition that focuses only on the very  last fitness values. Let ` = n − min{n/log n, 1/(p2 n log n)} . Let Ai = {x | |x|1 = i} for i > ` and A` contain all remaining search points. We know from [47] that the GA is initialized in A` with probability at least 1 − 1/ log n if n is large enough. The probability pi,i+k that the sped-up GA makes a transition from fitness i to fitness i + k equals pi,i+k = Prob(k more 0-bits than 1-bits flip) + Prob(k 0-bits and k 1-bits flip) 14 According to [47, Lemma 2], for the considered fitness levels i > ` the former probability is bounded by pk (1 − p)n−k ·   3 i(n − i)p2 (n − i)k . · 1+ · k! 5 (1 − p)2 The latter probability is bounded by Prob(k 0-bits flip) · Prob(k 1-bits flip) (n − i)k k ik k · p (1 − p)n−i−k · · p (1 − p)i−k k! k! (n − i)k k (pn)k ≤ · p (1 − p)n · . k! (1 − p)2k · k! ≤ Together, pi,i+k is at most   (pn)k 3 i(n − i)p2 . + (p(n − i))k (1 − p)n 1 + · 5 (1 − p)2+k (1 − p)2k · k!k! We need to find variables ui and γi,i+k along with some 0 ≤ χ ≤ 1 such that all conditions of Theorem 8 are fulfilled. Define    1 (pn)k 3 i(n − i)p2 u0i := p(1 − p)n (n − i) 1 + · + · max k 5 (1 − p)3 (1 − p)2 k!k! and 0 γi,i+k := Observe that, for every k ∈ N,  p(n − i) (1 − p)2 k−1 .   3 i(n − i)p2 1 (pn)k 0 u0i γi,i+k ≥ pk (1 − p)n (n − i)k 1 + · + · 5 (1 − p)1+2k (1 − p)2k k!k!   (pn)k 3 i(n − i)p2 + ≥ pk (1 − p)n (n − i)k 1 + · 5 (1 − p)2+k (1 − p)2k · k!k! ≥ pi,i+k . In order to fulfill the second condition in Theorem 8, we consider the following norPn γ0 0 0 malized variables: ui := u0i · j=i+1 γi,j and γi,j := Pn i,j γ 0 . As ui γi,j = u0i γi,j ≥ pi,j , j=i+1 i,j this proves the first condition of Theorem 8. Following the proof of Theorem Pm 9 in [47], it is easy to show that for χ := 1 − (1−p)12 log n we get γi,j ≥ χ k=j γi,k for all i, j with j > i (the calculations on [47, pp. 427–428] carry over by replacing “(1 − p)” with “(1 − p)2 ”). This establishes the third and last Pcondition. Pm m 0 0 As γi,j ≥ χ k=j γi,k is equivalent to γi,j ≥ χ k=j γi,k , we get n X j=i+1 0 γi,j ≤ 0 γi,i+1 1 ≤ , χ χ 15 which implies, using i(n − i)p2 ≤ n(n − `)p2 ≤ log1 n [47, (12)] as well as 1 + x ≤ 1/(1 − x) for x < 1,    1 (pn)k 3 i(n − i)p2 1 + · max ui ≤ p(1 − p)n · (n − i) · · 1 + · k χ 5 (1 − p)3 (1 − p)2 k!k!    k 1 3 (pn) ≤ p(1 − p)n−3 · (n − i) · · 1 + + max k χ 5 log n k!k!  ! (pn)k 1 1 n−3 + max ≤ p(1 − p) · (n − i) · · 3 k χ k!k! 1 − 5 log n   k (pn) 1 1 + maxk k!k! n−3 . ≤ p(1 − p) · (n − i) · · 3 χ 1 − 5 log n Invoking Theorem 8 and recalling that the first fitness level is reached with probability at least 1 − 1/ log n, we get a lower bound of  n−1 X 1 χ ui i=`   3 n−1 1 − 5 log (1 − p)3 X 1 1  n k · χ2 · ≥ 1− log n p(1 − p)n n−i 1 + maxk (pn) i=` k!k!    n−1 X 1 1 1 1   ≥ 1−O · · k log n p(1 − p)n n−i 1 + maxk (pn) i=` k!k!  1− 1 log n   3 1 where in the last step we used that all factors χ, 1 − 5 log , and 1 − p are 1 − O n log n ,  d P n−1 1 cd and 1 − logc n ≥ 1 − log i=` n−i ≤ n for any positive constants c, d. Bounding ln(min{n, 1/(p2 n)}) − ln(log n) as in [47] and absorbing all small-order terms in the −O(log log n) term from the statement gives the claimed bound. We also ran experiments to see whether the outcome matches our inspection of the dominating terms in the running time bounds for realistic problem dimensions. We chose n = 1000 bits and recorded the average optimization time over 1000 runs. The mutation rate p was set to c/n with c ∈ {0.1, 0.2, . . . , 4}. The result is shown in Figure 1. One can see that for every mutation rate the greedy (2+1) GA has a lower average optimization time. As predicted, the performance difference becomes larger as the mutation rate increases. The optimal mutation rates for both algorithms match with minimal average optimization times. Note that also the variance/standard deviation was much lower for the GA for higher mutation rates. Preliminary runs for n = 100 and n = 10000 bits gave very similar results. More experiments and statistical tests are given in Section 6.1. 5 k-Point Crossover The k-point crossover operator picks k cutting points from {1, . . . , n − 1} uniformly at random without replacement. These cutting points divide both parents into segments that are then assembled from alternating parents. That is, for parents x, y and cutting 16 number of evaluations ·104 (1+1) EA (2+1) GA+uniform 8 6 4 2 0 0 1 √ 5+1 2 2 3 mutation rate 4 ·1/n Figure 1: Average optimization times for the (1+1) EA and the greedy (2+1) GA with uniform crossover on OneMax with n = 1000 bits. The mutation rate p is set to c/n with c ∈ {0.1, 0.2, . . . , 4}. The thin lines show mean ± standard deviation. points 1 ≤ `1 < `2 < · · · < `k ≤ n − 1 the offspring will be: x1 . . . x`1 y`1 +1 . . . y`2 x`2 +1 . . . x`3 y`3 +1 . . . y`4 ... the suffix being y`k +1 . . . yn if k is odd and x`k +1 . . . xn if k is even. For uniform crossover we have seen that populations containing different search points of equal fitness are beneficial as uniform crossover can easily combine the good “building blocks”. This holds regardless of the Hamming distance between these different individuals, and the position of bits where individuals differ. The (µ+λ) GA with k-point crossover is harder to analyse as there the probability of crossover creating an improvement depends on the Hamming distance of parents and the position of differing bits. Consider parents that differ in two bits, where these bit positions are quite close. Then 1-point crossover has a high probability of taking both bits from the same parent. In order to recombine those building blocks, the cutting point has to be chosen in between the two bit positions. A similar effect occurs for 2-point crossover also if the two bit positions are on opposite ends of the bit string. The following lemma gives a lower bound on the probability that k-point crossover combines the right building blocks on O NE M AX, if two parents are equally fit and differ in two bits. The lemma and its proof may be of independent interest. Lemma 9. Consider two search points x, y with xi = 1, xi+d = 0, yi = 0, yi+d = 1 for 1 ≤ i < i + d ≤ n and xs = ys for s ∈ / {i, i + d}. The probability of k-point crossover of x and y, for any 1 ≤ k ≤ N − 1, where N := n − 1 ≥ 4 is the number of possible cutting points, creating an offspring with a larger number of 1-bits is at least d(N − d) N (N − 1) and exactly d/N for k = 1. 17 Proof. We identify cutting points with bits such that cutting point a results in two strings x1 . . . xa and xa+1 . . . xn . We say that a cutting point a separates i and i + d if a ∈ {i, . . . , i + d − 1}. Note that the prefix is always taken from x. The claim now follows from showing that the number of separating cutting points is odd with the claimed probability. Let XN,d,k be the random variables that describes the number of cutting points separating i and i+d. This variable follows a hypergeometric distribution Hyp(N, d, k), illustrated by the following urn model with red and white balls. The urn contains N balls, d of which are red. We draw k balls uniformly at random, without replacement. Then XN,d,k describes the number of red balls drawn. We define the probability of XN,d,k being odd, for 1 ≤ d ≤ N − 1 and 1 ≤ k ≤ N − 1 as   d N −d k k X X x k−x P (N, d, k) := Prob(XN,d,k = x) =  . N x=1, x odd x=1, x odd Note that for k = 1 P (N, d, 1) = and for k = 2 d 1  P (N, d, 2) = d 1 N −d 0 N 1   N −d 1 N 2  = = k d N 2d(N − d) . N (N − 1) For all 1 ≤ d ≤ N − 1 and all 1 ≤ k ≤ N − 1 the following recurrence holds. Imagine drawing the first cutting point separately. With probability d/N , the cutting point is a separating cutting point, and then we need an even number of further separating cutting points among the remaining k − 1 cutting points, drawn from a random variable XN −1,d−1,k−1 . With the remaining probability (N − d)/N , the number of remaining cutting points must be even, and this number is drawn from a random variable XN −1,d,k−1 . Hence d N −d · (1 − P (N − 1, d − 1, k − 1)) + · P (N − 1, d, k − 1). N N Assume for an induction that for all 2 ≤ k 0 < k P (N, d, k) = d(N − d) d(N − d) ≤ P (N, d, k 0 ) ≤ 1 − . N (N − 1) N (N − 1) This is true for k 0 = 2 as, using 3d(N − d) ≤ 3 · (N/2)2 ≤ N (N − 1) for N ≥ 4, P (N, d, 2) = 2d(N − d) 3d(N − d) − d(N − d) d(N − d) = ≤1− . N (N − 1) N (N − 1) N (N − 1) For k > 2, combining (6) and (7) yields d N −d · (1 − P (N − 1, d − 1, k − 1)) + · P (N − 1, d, k − 1) N N d (d − 1)(N − d) N −d d(N − d − 1) ≥ · + · N (N − 1)(N − 2) N (N − 1)(N − 2) d(N − d)(d − 1 + N − d − 1) = N (N − 1)(N − 2) d(N − d) = . N (N − 1) P (N, d, k) = 18 (6) (7) The upper bound follows similarly:     d (d − 1)(N − d) N −d d(N − d − 1) P (N, d, k) ≤ · 1− + · 1− N (N − 1)(N − 2) N (N − 1)(N − 2) d(N − d)(d − 1 + N − d − 1) =1− N (N − 1)(N − 2) d(N − d) =1− . N (N − 1) By induction, the claim follows. In the setting of Lemma 9, the probability of k-point crossover creating an improvement depends on the distance between the two differing bits. Fortunately, for search points that result from a mutation of one another, this distance has a favourable distribution. This is made precise in the following lemma. Lemma 10. Let x0 result from x by a mutation flipping one 1-bit and one 0-bit, where the positions i, j of these bits are chosen uniformly among all 1-bits and 0-bits, respectively. Then for d := |i−j| the random variable min{d, n−d} stochastically dominates the uniform distribution on {1, . . . , n/4}. Proof. We first show the following. For any fixed index i and any integer 1 ≤ z < n/2 there are exactly two positions j such that min{d, n − d} = z. If i ∈ {1, . . . , n} and z ∈ N are fixed, the only values for j that result in either |i − j| = z or n − |i − j| = z are i + z, i − z, i + z − n, and i − z + n. Note that at most two of these values are in {1, . . . , n}. Hence, there are at most 2 feasible values for j for every d ∈ N. Let ` denote the number of 1-bits in x. If ` ≥ n/2, we assume that first the 0-bit is chosen uniformly at random, and then consider the uniform random choice of a corresponding 1-bit. Without loss of generality assume xi = 0 and xj = 1. When i has been fixed and j is chosen uniformly at random, a worst case distribution for min{|i − j|, n − |i − j|} is attained when the 1-bits are distributed such that for each 1 ≤ d ≤ b`/2c both feasible bit positions are 1. The worst case is hence a uniform distribution on {1, . . . , b`/2c}, which stochastically dominates the uniform distribution on {1, . . . , n/4}. The case ` < n/2 is symmetrical: exchanging the roles of xj and xi as well as the roles of zeros and ones yields a uniform distribution on the set {1, . . . , b(n − `)/2c} as worst case, which again stochastically dominates the uniform distribution on {1, . . . , n/4}. Taken together, Lemma 9 and Lemma 10 indicate that k-point crossover has a good chance of finding improvements through recombining the right “building blocks”. However, this is based on the population containing potential parents of equal fitness that only differ in two bits. The following analysis shows that the population is likely to contain such a favourable pair of parents. However, such a pair might get lost again if other individuals of the same fitness are being created, after all duplicates have been removed from the population. For parents that differ in more than 2 bits, Lemma 9 does not apply, hence we do not have an estimate of how likely such a crossover will find an improvement. In order to avoid this problem, we consider a more detailed tie-breaking rule. As before, individuals with fewer duplicates are being preferred. In case there are still ties 19 number of evaluations ·104 6 (2+1) GA +1-point, dup-rnd (2+1) GA +2-point, dup-rnd (2+1) GA +1-point, dup-old (2+1) GA +2-point, dup-old 4 2 0 1 2 mutation rate 3 4 ·1/n Figure 2: Average optimization times on O NE M AX with n = 1000 bits over 1000 runs for the greedy (2+1) GA with 1- and 2-point crossover using different tie-breaking rules if individuals are tied with regard to fitness and the number of duplicates. “dup-rnd” breaks these ties randomly, whereas “dup-old” (Algorithm 3) prefers older individuals. The mutation rate p is set to c/n with c ∈ {0.1, 0.2, . . . , 4}. after considering the number of duplicates, the (µ+λ) GA will retain older individuals. This refined tie-breaking rule is shown in Algorithm 3. As will be shown in the remainder, it implies that once a favourable pair of parents with Hamming distance 2 has been created, this pair will never get lost. Algorithm 3: Refined tie-breaking rule “dup-old”. 14 Let P contain the µ best individuals from P ∪ P 0 ; break ties towards including individuals with the fewest duplicates in P ∪ P 0 . If there are still ties, break them towards including older individuals. This tie-breaking rule, called “dup-old” differs from the one used for the experiments in Figure 1 and those in Section 6. There, we broke ties uniformly at random in case individuals are tied with respect to both fitness and the number of duplicates. We call the latter rule “dup-rnd”. Experiments for the greedy (2+1) GA comparing tie-breaking rules dup-old and dup-rnd over 1000 runs indicate that performance differences are very small, see Figure 2.3 Note, however, that on functions with plateaus, like royal road functions, retaining the older individuals prevents the (µ+λ) GA from performing random walks on the plateau, once the population has spread such that there are no duplicates of any individual. In this case we expect that performance will deteriorate when breaking ties towards older individuals. With the refined tie-breaking rule, the performance of (µ+λ) GAs is as follows. 3 Even though differences are small, one-sided Mann-Whitney U tests reveal some statistically significant differences: for 1-point crossover dup-rnd is significantly faster than dup-old on a significance level of 0.001 for mutation rates at least 2.4/n (with two exceptions, 2.8/n and 3.6/n, with p-values still below 0.003). Contrarily, dup-old was significantly faster for 2-point crossover for mutation rates in the range of 0.8/n to 3/n. 20 Theorem 11. The expected optimization time of every (µ+λ) GA implementing Algorithm 1 with tie-breaking rule dup-old from Algorithm 3, 2 ≤ µ = O(1), λ < µ, pc = o(1) and pc = ω(1/ log n), p = c/n for some constant c > 0, and k-point crossover with any 1 ≤ k ≤ n − 2, on O NE M AX is at most n ln n · (1 + o(1)). −c c · e · (1 + c) This bound equals the upper bound (3) for (µ+λ) GAs with uniform crossover. It improves upon the previous upper bound for the greedy (2+1) GA from [46, Theo2c · n ln n larger. The reason rem 8], whose dominant term was by an additive term of 3+3c was that for the (2+1) GA favourable parents could get lost, which is now prevented by the dup-old tie-breaking rule and conditions on pc . The conditions pc = o(1) as well as µ, λ = O(1) are useful because they allow us to estimate the probability that a single good individual takes over the whole population with copies of itself. In the remainder of this section we work towards proving Theorem 11 and assume that n ≥ n0 for some n0 chosen such that all asymptotic statements that require a large enough value of n hold true. For n < n0 there is nothing to prove, as the statement holds trivially for bounded n. We again estimate the time spent on each fitness level i, i. e., when the best fitness in the current population is i. To this end, we focus on the higher fitness levels i ≥ n − n/ log n where the probability of creating an offspring on the same level can be estimated nicely. The time for reaching these higher fitness levels only constitutes a small-order term, compared to the claimed running time bound. The following lemma proves this claim in a more general setting than needed for the proof of Theorem 11. In particular, it holds for arbitrary tie-breaking rules and crossover operators. Lemma 12. For every (µ+λ) GA implementing Algorithm 1 with µ, λ = O(1), pc = 1 − Ω(1), and p = c/n for a constant c > 0, using any initialization and any crossover operator, the expected time until a fitness level i ≥ n − n/ log n is reached for the first time is o(n log n). A proof is given in the appendix. In the remainder of the section we focus on higher fitness levels i ≥ n − n/ log n and specify the different cases on each such fitness level. The cases i.1, i.2, and i.3 are similar to the ones for uniform crossover, with additional conditions on the similarity of individuals in Cases i.2 and i.3. We also have an additional error state that accounts for undesirable and unexpected behavior. We pessimistically assume that the error state cannot be left towards other cases on level i. Case i.1: The population contains an individual on level i and at least one individual on a lower fitness level. Case i.2: The population contains µ copies of an individual x on level i. Case i.3: The population contains two search points x, y with current best fitness i, where y resulted from a mutation of x and the Hamming distance of x and y is 2. Case i.error: An error state reached from any Case i.· when the best fitness is i and none of the prior cases applies. The difference to the analysis of uniform crossover is that in Case i.2 we rely on the population collapsing to copies of a single individual. This helps to estimate the probability of creating a favourable parent-offspring pair in Case i.3 as the (µ+λ) GA effectively only performs mutations of x while being in Case i.2. Lemma 13. Consider any (µ+λ) GA as defined in Theorem 11, with parameters 2 ≤ µ = O(1), λ < µ, pc = o(1) and pc = ω(1/ log n), p = c/n for some constant c > 0. The total expected 21 time spent in all Cases i.1, i.2, and i.3 across all i ≥ n − n/ log n is at most n ln n + o(n log n). c · e−c · (1 + c) Proof. We have already analyzed the expected time in Cases i.1 and i.2, across all fitness levels. As in the proof of Theorem 4, we use Lemma 2 and get that the expected time spent in all Cases i.1 is at most O((µ + λ)n log µ) = O(n). (1 − pc )(1 − p)n In Case i.2 the algorithm behaves like the one using uniform crossover described in Theorem 4 as both crossover operators are working on identical individuals. As before, Case i.2 is left if either a better offspring is created, or if a different offspring with i ones is created. In the latter case, either Case i.3 or the error state i.error is reached. By the proof of Theorem 4 we know that the expected time spent in Cases i.2 across all levels i is bounded by λn + ln(n2 p + n) + 1 + p n ln n = + O(n). p(1 − p)n−1 · (1 + np) c · e−c · (1 + c) Now we estimate the total time spent in all cases i.3. As this time turns out to be comparably small, we allow ourselves to ignore that fact that not all these cases are actually reached. Case i.3 implies that the population contains a parent-offspring pair x, y with Hamming distance 2. Consider the mutation that has created this offspring and note that this mutation flips each 1-bit and each 0-bit with the same probability. If a, b with a < b denote the bit positions where x and y differ, then D := b − a is a random variable with support {1, . . . , n − 1}. By the law of total expectation, E(Ti.3 ) = n−1 X d=1 E(Ti.3 | D = d) · Prob(D = d). (8) We first bound the conditional expectation by considering probabilities for improvements. If D = d then by crossover is successful if crossover is performed (probability pc ), if the search point where bit a is 1 is selected as first parent (probability at least 1/µ), if the remaining search point in {x, y} is selected as second parent (probability at least 1/µ), and if cutting points are chosen that lead to a fitness improvement. The latter event has probability at least d(N − d)/(N (N − 1)) by Lemma 9, with N := n − 1. Finally, we need to assume that the following mutation does not destroy any fitness improvements (probability at least (1 − p)n ). The probability of a successful crossover is then at least, using d(N − d) = min(d, N − d) · max(d, N − d) ≥ min(d, N − d) · N/2, pc (1 − p)n d(N − d) pc (1 − p)n min(d, (N − d)) pc (1 − p)n min(d, n − d) − 1 · ≥ · ≥ · . 2 2 µ N (N − 1) µ 2(N − 1) µ2 2n Another means of escaping from Case i.3 is by not using crossover, but having mutation create an improvement. The probability for this is at least (1 − pc ) · (n − i)p(1 − p)n−1 ≥ γ · 22 n−i n (9) for a constant γ > 0. Applying Lemma 3, we have E(Ti.3 | D = d) ≤ λ + 1 pc (1−p)n µ2 · min(d,n−d)−1 2n +γ· n−i n . (10) Note that this upper bound is non-increasing with min(d, n − d). We are therefore pessimistic when replacing min(d, n − d) by a different random variable that is stochastically dominated by it. According to Lemma 10, min{d, n − d} dominates the uniform distribution on {1, . . . , n/4} (assume w. l. o. g. that n is a multiple of 4). Combining this with (8) and (10) yields E(Ti.3 ) ≤ λ + n/4 X 1 · n/4 d=1 1 pc (1−p)n µ2 2 ≤ λ + O(µ /pc ) · n/4 X d=1 · d−1 2n +γ· n−i n 1 . d−1+n−i The last sum is estimated as follows. n/4−1 n/4−1 X X 1 1 1 1 = = + d−1+n−i d+n−i n−i d+n−i d=0 d=1 d=1 Z n/4 1 dd ≤1+ d=0 d + n − i   n/4 = 1 + ln 1 + . n−i n/4 X Along with λ = O(1), n/4 ≤ n, and O(µ2 /pc ) = o(log n), we get    n . E(Ti.3 ) ≤ o(log n) · 1 + ln 1 + n−i Pn−1 For the sum T·,3 = i=0 Ti,3 we then have the following. E(T·.3 ) ≤ o(n log n) + o(log n) · n−1 X i=0 n X  ln 1 + n n−i   n ln 1 + i i=1 Z n  n ≤ o(n log n) + o(log n) · ln 1 + di i i=0 = o(n log n) = o(n log n) + o(log n) · as the integral is 2 ln(2)n. This completes the proof. The remainder of the proof is devoted to estimating the expected time spent in the error state. To this end we need to consider events that take the (µ+λ) GA “off course”, that is, deviating from situations described in Cases i.1, i.2, and i.3. Since Case i.3 is based on offspring with Hamming distance 2 to their parents, one potential failure is that an offspring with fitness i, but Hamming distance greater than 2 to its parent is being created. This probability is estimated in the following lemma. 23 Lemma 14. For i ∈ {1, . . . , n − 1} let p(i) denote the probability that standard bit mutation with mutation rate 0 < p ≤ 1/2 of a search point with i 1-bits creates a different offspring with i 1-bits. If i(n − i)p2 (1 − p)−2 ≤ 1/2 then 2 n−2 i(n − i)p (1 − p) ≤ p (i) 2 ≤ i(n − i)p (1 − p) n−2 2i(n − i)p2 · 1+ (1 − p)2   . The probability that, additionally, the offspring has Hamming distance larger than 2 to its parent is at most 2i2 (n − i)2 p4 (1 − p)n−4 . The proof is found in the appendix. Another potential failure occurs if the population does not collapse to copies of a single search point, that is, the transition from Case i.1 to Case i.2 is not made. We first estimate the probability of mutation unexpectedly creating an individual with fitness i. Lemma 15. The probability that a standard bit mutation with mutation probability 0 < p < 1 creates a search point with i ones out of a parent with less than i ones, is at most 2 p(n − i + 1) · e(pn) /4+1 . Note that for the special case p = 1/n Lemma 13 in [12] gives an upper bound of (n − i + 1)/n as the highest probability for a jump to fitness level i is attained if the parent is on level i − 1. However, for larger mutation probabilities this is no longer true in general; there are cases where the probability of jumping to level i is maximized for parents on lower fitness levels. Hence, a closer inspection of transition probabilities between different fitness levels is required, see the proof in the Appendix. Using Lemma 15, we can now estimate the probability of the (µ+λ) GA not collapsing to copies of a single search point as described in Case i.2. Lemma 16. Consider any (µ+λ) GA as defined in Theorem 11, with parameters 2 ≤ µ = O(1), λ < µ, pc = o(1) and pc = ω(1/ log n), p = c/n for some constant c > 0 and fix a fitness level i < n. The probability that the (µ+λ) GA will reach a population containing different individuals with fitness i before either reaching a population containing only copies of the same individual on level i or reaching a higher fitness level, is at most   n−i . O(µ log µ) · pc + n Proof. We show that there is a good probability of repeatedly creating clones of individuals with fitness i (or finding an improvement) and avoiding the following bad event. A bad event happens if an individual on fitness level i is created in one offspring creation by means other than through cloning an existing individual on level i. The probability of a bad event is bounded as follows. In case crossover is being used, which happens with probability pc , we bound the probability of a bad event by the trivial bound 1. Otherwise, such an individual needs to be created through mutation from either a worst fitness level, or by mutating a parent on level i. The probability for the former is bounded from above by Lemma 15. The probability for the latter is at most p(n − i) as it is necessary to flip one out of n − i 0-bits. Using n − i + 1 ≤ 2(n − i), the probability of a bad event on level i is hence bounded from 24 above by   2 pc + (1 − pc ) · p(n − i + 1) · e(pn) /4+1 + p(n − i)   2c(n − i) c2 /4+1 c(n − i) n−i ≤ pc + ·e + = pc + κ · , n n n 2 where κ := 2c · ec /4+1 + c is a constant. The (µ+λ) GA will only reach a population containing different individuals with fitness i as stated if a bad event happens before the population has collapsed to copies of a single search point or moved on to a higher fitness level. Consider the first generation where an individual of fitness i is reached for the first time. Since it might be possible to create several such individuals in one generation, we consider all offspring creations being executed sequentially and consider the possibility of bad events for all offspring creations following the first offspring on level i. Let X be the number of function evaluations following this generation, before all individuals in the population have fitness at least i. By Lemma 2 we have   (µ + λ) log µ = O(µ log µ). E(X) = O (1 − pc )(1 − p)n Considering up to λ further offspring creations in the first generation leading to level i, and completing the generation at the end of the X function evaluations, we have less than X + 2λ trials for bad events. The probability that one of these is bad is bounded by !     X X n−i n−i t · Prob(X = t) + 2λ · pc + κ · = (E(X) + 2λ) · pc + κ · n n t=1   n−i = O(µ log µ) · pc + κ · . n Absorbing κ in the O-term yields the claimed result. Now we are prepared to estimate the expected time spent in all error states i.error for i ≥ n − n/ log n. Lemma 17. Consider any (µ+λ) GA as defined in Theorem 11, with parameters 2 ≤ µ = O(1), λ < µ, pc = o(1) and pc = ω(1/ log n), p = c/n for some constant c > 0. The expected time spent in all states i.error, for i ≥ n − n/ log n, is at most O(n + pc · n ln n) = o(n log n). Proof. The (µ+λ) GA only spends time in an error state if it is actually reached. So we first calculate the probability that state i.error is reached from either Case i.1, i.2, or i.3. Lemma 16 states that the probability of reaching a population with different individuals on level i before reaching Case i.2 or a better fitness level is     n−i n−i O(µ log µ) · pc + = O pc + . n n We pessimistically ignore the possibility that Case i.3 might be reached if this happens; thus the above is an upper bound for the probability of reaching i.error from Case i.1. 25 Recall that in Case i.2 all individuals are identical, so crossover has no effect and the (µ+λ) GA only performs mutations. First consider the case λ = 1. Note that i ≥ n − n/ log n, along with p = c/n, implies that i(n − i)p2 (1 − p)−2 ≤ 1/2, hence Lemma 14 is in force. According to Lemma 14 the probability of leaving Case i.2 by creating a different individual with fitness i is at least i(n − i)p2 (1 − p)n−2 . The probability of doing this with an offspring of Hamming distance greater than 2 to its parent is at most 2i2 (n − i)2 p4 (1 − p)n−4 (second statement of Lemma 14). So the conditional probability of reaching the error state when leaving Case i.2 towards another case on level i is at most 2i2 (n − i)2 p4 (1 − p)n−4 = 2i(n − i)p2 (1 − p)−2 . (11) i(n − i)p2 (1 − p)n−2 In case λ > 1 note that Case i.3 is reached in case there is a single offspring with fitness i and Hamming distance 2 to its parent. Such an offspring is guaranteed to survive as we assume λ < µ and offspring with many duplicates are removed first. Thus, in case several offspring with fitness i and differing from their parent are created, all of them need to have Hamming distance larger than 2 in order to reach i.error from Case i.2. This probability decreases with increasing λ, hence the probability bound (11) also holds for λ > 1. Finally, Case i.3 implies that there exists a parent-offspring pair x, y with Hamming distance 2. In a new generation these two offspring – or at least one copy of each – will always survive: individuals with multiple duplicates are removed first, and in case among current parents and offspring more than µ individuals exist with no duplicates, x and y will be preferred over newly created offspring. So the probability of reaching the error state from Case i.3 is 0. In case the error state is reached, according to (9) we have a probability of at least γ · n−i of finding a better individual in one offspring creation, for a constant γ > 0. Using n n Lemma 3 as before, this translates to at most λ + γ1 · n−i expected function evaluations. So the expected time spent in Case i.error is at most    1 n n−i · · λ + 2i(n − i)p2 (1 − p)−2 + O pc + n γ n−i    2 n =λ+ · inp2 (1 − p)−2 + O pc · +1 γ n−i   n = O pc · + O(1) n−i as both λ = O(1) and inp2 (1 − p)−2 ≤ (pn)2 · (1 − p)−2 = O(1). The total expected time across all error states is at most ! n−1 X 1 = O(n + pc · n ln n). O n + pc · n · n−i i=0 Now Theorem 11 follows from all previous lemmas. Proof of Theorem 11. The claimed upper bound now follows from adding the upper bounds on the expected time on the smaller fitness levels (Lemma 12) to the expected times spent in all considered cases (Lemma 13 and Lemma 17). We believe that some of the technical conditions from Theorem 11 involving µ, λ, and pc could be relaxed if it was possible to generalize Lemmas 9 and 10 towards more than 2 differing bits between individuals of equal fitness. 26 8 ·104 (1+1) EA (2+1) GA+uniform (2+1) GA+1-point (2+1) GA+2-point 6 4 2 0 1 2 3 4 ·1/n mutation rate (a) O NE M AX ·105 ·104 (1+1) EA GA+uniform GA+1-point GA+2-point 5 4 (1+1) EA GA+uniform GA+1-point GA+2-point 8 6 3 4 2 2 1 0 1 2 mutation rate 3 4 ·1/n (b) Royal road 0 1 2 3 mutation rate 4 ·1/n (c) Random polynomials Figure 3: Average optimization times over 1000 runs for (1+1) EA and the greedy (2+1) GA with various crossover operators on functions with n = 1000 bits: O NE M AX, a royal road function with block size 5, and random polynomials with 1000 unweighted monomials of degree 5. The mutation rate is c/n with c ∈ {0.1, 0.2, . . . , 4}. Figure 3, discussed in the following Section 6, presents further experiments and statistical tests, which includes a comparison of uniform crossover and k-point crossover in the greedy (2+1) GA. 6 6.1 Extensions to Other Building-Block Functions Royal Roads and Monotone Polynomials So far, our theorems and proofs have been focused on O NE M AX only. This is because we do have very strong results about the performance of EAs on O NE M AX at hand. However, the insights gained stretch far beyond O NE M AX. Royal road functions generally consist of larger blocks of bits. All bits in a block need to be set to 1 in order to contribute to the fitness; otherwise the contribution is 0. All blocks contribute the same amount to the fitness, and the fitness is just the sum of all contributions. 27 O NE M AX Royal road Random Polynomial uniform 1-point 2-point uniform 1-point 2-point uniform 1-point 2-point (1+1) EA p < 10−3 p < 10−3 p < 10−3 p < 10−3 p < 10−3 p < 10−3 p < 10−3 p < 10−3 p < 10−3 for c ≥ 0.6 for c ≥ 0.6 for c ≥ 0.6 (1 ex.) for c ≥ 0.3 (3 ex.) for c ≥ 0.4 (1 ex.) uniform 1-point p < 10−3 for c ≥ 0.4 p < 10−3 for c ≥ 0.3 p > 10−3 (11 ex.) p < 10−3 for c ≥ 0.8 (1 ex.) p < 10−3 for c ≥ 1.4 (5 ex.) p > 10−3 (6 ex.) p > 10−3 (13 ex.) p > 10−3 (6 ex.) p > 10−3 (6 ex.) Table 1: Summary of the results of two-sided Mann-Whitney U tests on the data from Figure 3. For each function the table shows pairwise comparisons between the (1+1) EA and the greedy GA with uniform, 1-point, and 2-point crossover, resp. Here p is the p-value output by the statistics package R (version 2.8.1) and c is the constant in the mutation rate c/n. Each cell describes a rule for p subject to a minimum value of c and gives the number of exceptions from this rule where applicable. The fundamental insight we have gained for neutral mutations also applies to royal road functions. If there is a mutation that completes one block, but destroys another block, this is a neutral mutation and the offspring will be stored in the population of a (µ+λ) GA. Then crossover can recombine all finished blocks in the same way as for O NE M AX. The only difference is that the destroyed block may evolve further. More neutral mutations can occur that only alter bits in the destroyed block. Then the population can be dominated by many similar solutions, and it becomes harder for crossover to find a good pair for recombination. However, as crossover has generally a very high probability of finding improvements, the last effect probably plays only a minor role. A theoretical analysis of general royal roads up to the same level of detail as for O NE M AX is harder, but not impossible. So far results on royal roads and monotone polynomials have been mostly asymptotic [51, 14]. Only recently, Doerr and Künnemann [13] presented a tighter runtime analysis of offspring populations for royal road functions, which may lend itself to a generalization of our results on O NE M AX in future work. For now, we use experiments to see whether the performance is similar to that on O NE M AX. We use royal roads with n = 1000 bits and block size 5, i. e., we have 200 pairwise disjoint blocks of 5 bits each. We also consider random monotone polynomials. Instead of using disjoint blocks, we use 1000 monomials of degree 5 (conjunctions of 5 bits): each monomial is made up of 5 bit positions chosen uniformly at random, without replacement. This leads to a function similar to royal roads, but “blocks” are broken up and can share bits; bit positions are completely random. Figure 3 shows the average optimization times in 1000 runs on all these functions, for the (1+1) EA and the greedy (2+1) GA with uniform, 1-point, and 2-point crossover. We chose the last two because k-point crossovers for odd k treat ends of bit strings differently from those for even k: for odd k two bits close to opposite ends of a bitstring have a high probability to be taken from different parents, whereas for even k there is a high chance that both will be taken from the same parent (cf. Lemma 9 for k = 2 and the special case of k = 1). For consistency and simplicity, we use pc = 1 and the tie-breaking rule dup-rnd in all settings, that is, ties in fitness are broken towards minimum numbers of duplicates and any remaining ties are broken uniformly at random. For O NE M AX this does not perfectly match the conditions of Theorem 11 as they require a lower crossover proba28 bility, pc = o(1), and tie-breaking rule dup-old. But the experiments show that k-point crossover is still effective when these conditions are not met. On O NE M AX both k-point crossovers are better than the (1+1) EA, but slightly worse than uniform crossover. This is in accordance with the observation from our analyses that improvements with k-point crossover might be harder to find, in case the differing bits are in close proximity. For royal roads the curves are very similar. The difference between the (1+1) EA and the greedy (2+1) GA is just a bit smaller. For random polynomials there are visible differences, albeit smaller. Mann-Whitney U tests confirm that wherever there is a noticeable gap between the curves, there is a statistically significant difference on a significance level of 0.001. The outcome of Mann-Whitney U tests is summarized in Table 1. For very small mutation rates c/n the tests were not significant. For mutation rates no less than 0.6/n all differences between the (1+1) EA and all greedy (2+1) GAs were statistically significant, apart from a few exceptions on random polynomials. For O NE M AX the difference between uniform crossover vs. k-point crossover was significant for c ≥ 0.4. For royal roads the majority of such comparisons showed statistical significance, with a number of exceptions. However, for random polynomials the majority of comparisons were not statistically significant. Most comparisons between 1-point and 2-point crossover did not show statistical significance. These findings give strong evidence that the insights drawn from the analysis on O NE M AX transfer to broader classes of functions where building blocks need to be assembled. 6.2 Linear Functions Another interesting question is in how far the theoretical analyses in this work extend to cases where building blocks have different weights. The simplest such case is the class of linear functions, defined as f (x) = n X wi xi i=1 where wi > 0 are positive real-valued weights. Doerr, Doerr, and Ebel [9] provided empirical evidence that their (1+(λ, λ)) EA is faster than the (1+1) EA on linear functions with weights drawn uniformly at random from [1, 2]. It is an open question whether this also holds for more common GAs, that is, those implementing Algorithm 1. Experiments in [9] on the greedy (2+1) GA found that on random linear functions “no advantage of the (2+1) GA over the (1+1) EA is visible”. We provide an explanation for this observation and reveal why the (2+1) GA is not well suited for weighted building blocks, whereas other GAs might be. The reason why the (2+1) GA behaves like the (1+1) EA in the presence of weights is that in case the current population of the (2+1) GA contains two members with different fitness, the (2+1) GA ignores the inferior one. So it behaves as if the population only contained the fitter individual. Since the (2+1) GA will select the fitter individual twice for crossover, followed by mutation, it essentially just mutates the fitter individual. This behavior of the (2+1) GA then equals that of a (1+1) EA working on the fitter individual. The (2+1) GA is more efficient than the (1+1) EA on O NE M AX (and other buildingblock functions where all building blocks are equally important) as it can easily gen29 8 ·104 8 (1+1) EA (5+1) GA+uniform (5+1) GA+1-point (5+1) GA+2-point 6 ·104 (1+1) EA (5+1) GA+uniform (5+1) GA+1-point (5+1) GA+2-point 6 4 4 2 2 0 1 2 mutation rate 3 4 ·1/n 0 1 2 3 mutation rate (a) O NE M AX 4 ·1/n (b) Random linear functions [1, 2] Figure 4: Average optimization times over 1000 runs for (1+1) EA and a (5+1) GA with uniform parent selection and various crossover operators on functions with n = 1000 bits: O NE M AX and random linear functions with weights drawn independently, uniformly at random from [1, 2], and anew for each run. erate and store individuals with equal fitness in the population, and recombine their different building blocks. However, in the presence of weights, chances of creating individuals of equal fitness might be very slim, and then the (2+1) GA behaves like the (1+1) EA. Theorem 18. As long as the population of the (2+1) GA does not contain two different individuals with the same fitness, the (2+1) GA is equivalent to the (1+1) EA. On functions where all search points have different fitness values, the (2+1) GA is equivalent to the (1+1) EA. This includes linear functions with extreme weights like BinVal(x) := n X 2n−i xi i=1 Pn and, more generally, functions where w(i) > j=i+1 w(j) for all 1 ≤ i ≤ n, where w(i) denotes the i-th largest weight. It also includes, almost surely, random linear functions with weights being drawn from some real-valued interval [a, b] with a < b. Proof. The first two statements have Pn been established in the preceding discussion. For functions where w(i) > j=i+1 w(j) for all 1 ≤ i ≤ n, all search points with a 1 on the bit of weight w(i) have a higher fitness than all search points where this bit is 0, provided that all bits with larger weights are being fixed. It follows inductively that all search points have different fitness values. For random linear functions consider the function being constructed sequentially by adding new bits with randomly drawn weights. Assume that after adding i bits, all 2i bit patterns have different fitness values. This is trivially true for 0 bits. When adding a new bit i + 1, a fitness value can only be duplicated with these i + 1 bits if the i + 1-st weight is equal to any selection of weights from the first i bits. Since there are at most 2i selections, which is finite, the i + 1-st weight will almost surely be different from all of these. The statement then follows by induction. 30 In a sense, the (2+1) GA is not able to benefit from crossover in the settings from Theorem 18 since its greedy parent selection suppresses diversity in the population. So, in order for a GA to benefit from crossover, the population needs to be able to maintain and select individuals with different building blocks and slightly different fitness values for long enough, so that crossover has a good chance of combining those building blocks. The (1+(λ, λ)) EA [9] achieves this using a cleverly designed twostage offspring creation process: mutation first creates diversity and the best among λ mutants is retained and recombined with its parent λ times. However, this does not explain why crossover is beneficial in common GA designs. A promising common GA design does not need to be sophisticated – Figure 4 shows that already a simple (5+1) GA with uniform parent selection performs significantly better than the (1+1) EA (and hence the greedy (2+1) GA). The benefit of crossover is smaller than that on O NE M AX, but the main qualitative observations are the same: the average optimization time is smaller with crossover, and mutation rates slightly larger than 1/n further improve performance. One-sided Mann-Whitney U tests on a significance level of 0.001 showed that the (5+1) GA with uniform crossover was significantly faster than the (1+1) EA on random linear functions, for mutation rates no less than 0.6/n. Both k-point crossovers gave mixed results: they were slower than the (1+1) EA for low mutation rates (0.4 ≤ c ≤ 1.2, except for c = 0.6, for 1-point crossover and 0.9 ≤ c ≤ 1.1 for 2-point crossover), but faster for high mutation rates (c = 2.3 and c ≥ 2.6 for 1-point crossover, c = 2.0 and c ≥ 2.2 for 2-point crossover). This shows that uniform crossover can speed up building-block assembly for weighted building blocks – albeit not for all (µ+λ) GAs, and in particular not for the greedy (2+1) GA. Proving this rigorously for random or arbitrary linear functions remains a challenging open problem, and so is identifying characteristics of (µ+λ) GAs for which crossover is beneficial in these cases. 7 Conclusions and Future Work We have demonstrated rigorously and intuitively that crossover can speed up building block assembly on O NE M AX, with evidence that the same holds for a broad class of functions. The basic insight is that mutations that create new building blocks while destroying others can still be useful: mutants can be stored in the population and lead to a successful recombination with their parents in a later generation. This effect makes every (µ+λ) GA with cut selection and moderate population sizes twice as fast as every mutation-based EA on O NE M AX. In other words, adding crossover to any such (µ+λ) EA halves the expected optimization time (up to small-order terms). This applies to uniform crossover and to k-point crossover, for arbitrary values of k. Furthermore, we have demonstrated how to analyze parent and offspring populations as in (µ+λ) EAs and (µ+λ) GAs. As long as both µ and λ are moderate, so that exploitation is not slowed down, we obtained essentially the same results for arbitrary (µ+λ) GAs as for the simple greedy (2+1) GA analyzed in [46]. This work provides novel techniques for the analysis of (µ+λ)-type algorithms, including Lemmas 2 and 3, which may prove useful in further studies of EAs. Another intriguing conclusion following naturally from our analysis is that the optimal √ mutation rate for GAs such as the greedy (2+1) GA changes from 1/n to (1 + 5)/2 · 1/n ≈ 1.618/n when using uniform crossover. This is simply because neutral mutations and hence multi-bit mutations become more useful. Experiments are in perfect accordance with the theoretical results for O NE M AX. For other functions 31 like royal roads and random polynomials they indicate that the performance differences also hold in a much more general sense. We have empirical evidence that this might also extend to linear functions, and weighted building blocks in general, albeit this does not apply to the greedy (2+1) GA. The discussion from Section 6.2 has shown that the population must be able to store individuals with different building blocks for long enough so that crossover can combine them, even though some individuals might have inferior fitness values and be subject to replacement. Our results give novel, intuitive and rigorous answers to a question that has been discussed controversially for decades. There are plenty of avenues for future work. We would like to extend the theoretical analysis of (µ+λ) GAs to royal road functions and monotone polynomials. Also investigating weighted building blocks, like in linear functions, is an interesting and challenging topic for future work. Our (µ+λ) GAs benefit from crossover and an increased mutation rate because cut selection removes offspring with inferior fitness. As such, cut selection counteracts disruptive effects of crossover and an increase of the mutation rate. The situation is entirely different in generational GAs, where Ochoa, Harvey, and Buxton reported that introducing crossover can decrease the optimal mutation rate [36]. Future work could deal with complementing these different settings and investigating the balance between selection pressure for replacement selection and the optimal mutation rate. Acknowledgments The author was partially supported by EPSRC grant EP/D052785/1 while being a member of CERCIA, University of Birmingham, UK. The research leading to these results has received funding from the European Union Seventh Framework Programme (FP7/2007-2013) under grant agreement no 618091 (SAGE). The author would like to thank the reviewers for their detailed and constructive comments that helped to improve the manuscript. References [1] M. Abramowitz and I. A. Stegun. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Dover, New York, ninth Dover printing, tenth GPO printing edition, 1964. [2] S. Arora, Y. Rabani, and U. V. Vazirani. Simulating quadratic dynamical systems is PSPACE-complete. In Proceedings of the 26th ACM Symposium on the Theory of Computing (STOC), pages 459–467, 1994. [3] A. Auger and B. Doerr, editors. Theory of Randomized Search Heuristics – Foundations and Recent Developments. Number 1 in Series on Theoretical Computer Science. World Scientific, 2011. [4] G. Badkobeh, P. K. Lehre, and D. Sudholt. Unbiased black-box complexity of parallel search. In 13th International Conference on Parallel Problem Solving from Nature (PPSN 2014), volume 8672 of LNCS, pages 892–901. Springer, 2014. [5] N. H. Barton and B. Charlesworth. 281(5385):1986–1990, 1998. Why sex and recombination? Science, [6] G. Bell. The masterpiece of nature the evolution and genetics of sexuality. Univ. of California Press, 1982. 32 [7] K. A. De Jong. Evolutionary Computation – A Unified Approach. MIT press, 2006. [8] M. Dietzfelbinger, B. Naudts, C. Van Hoyweghen, and I. Wegener. The analysis of a recombinative hill-climber on H-IFF. IEEE Transactions on Evolutionary Computation, 7(5):417–423, 2003. [9] B. Doerr, C. Doerr, and F. Ebel. Lessons from the black-box: fast crossover-based genetic algorithms. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO ’13), pages 781–788. ACM, 2013. [10] B. Doerr, M. Fouz, and C. Witt. Sharp bounds by probability-generating functions and variable drift. In Proceedings of the 13th Annual Genetic and Evolutionary Computation Conference (GECCO ’11), pages 2083–2090. ACM Press, 2011. [11] B. Doerr, E. Happ, and C. Klein. Crossover can provably be useful in evolutionary computation. Theoretical Computer Science, 425(0):17–33, 2012. [12] B. Doerr, D. Johannsen, and C. Winzen. Multiplicative drift analysis. Algorithmica, 64:673–697, 2012. [13] B. Doerr and M. Künnemann. Royal road functions and the (1+λ) evolutionary algorithm: Almost no speed-up from larger offspring populations. In IEEE Congress on Evolutionary Computation (CEC 2013), pages 424–431, 2013. [14] B. Doerr, D. Sudholt, and C. Witt. When do evolutionary algorithms optimize separable functions in parallel? In Foundations of Genetic Algorithms (FOGA 2013), pages 51–64. ACM, 2013. [15] A. E. Eiben and J. E. Smith. Introduction to Evolutionary Computing. Springer, 2007. [16] S. Fischer and I. Wegener. The one-dimensional Ising model: Mutation versus recombination. Theoretical Computer Science, 344(2–3):208–225, 2005. [17] S. Forrest and M. Mitchell. Relative building block fitness and the building block hypotheses. In Proc. of FOGA 2, pages 198–226. Morgan Kaufmann, 1993. [18] T. Jansen. Analyzing Evolutionary Algorithms – The Computer Science Perspective. Springer, 2013. [19] T. Jansen, K. A. De Jong, and I. Wegener. On the choice of the offspring population size in evolutionary algorithms. Evolutionary Computation, 13:413–440, 2005. [20] T. Jansen and I. Wegener. On the analysis of evolutionary algorithms—a proof that crossover really can help. Algorithmica, 34(1):47–66, 2002. [21] T. Jansen and I. Wegener. Real royal road functions—where crossover provably is essential. Discrete Applied Mathematics, 149:111–125, 2005. [22] T. Jansen and C. Zarges. Analysis of evolutionary algorithms: from computational complexity analysis to algorithm engineering. In Proceedings of the 11th Workshop on Foundations of Genetic Algorithms (FOGA ’11), pages 1–14. ACM, 2011. [23] T. Kötzing, D. Sudholt, and M. Theile. How crossover helps in pseudo-Boolean optimization. In Proceedings of the 13th annual conference on Genetic and evolutionary computation (GECCO ’11), pages 989–996. ACM Press, 2011. 33 [24] J. Lässig. Personal communication, 2009. [25] J. Lässig and D. Sudholt. General upper bounds on the running time of parallel evolutionary algorithms. Evolutionary Computation, 22(3):405–437, 2014. [26] P. Lehre and X. Yao. Crossover can be constructive when computing unique input– output sequences. Soft Computing, 15(9):1675–1687, 2011. [27] P. K. Lehre and C. Witt. Black-box search by unbiased variation. Algorithmica, 64(4):623–642, 2012. [28] A. Livnat, C. Papadimitriou, J. Dushoff, and M. W. Feldman. A mixability theory for the role of sex in evolution. Proceedings of the National Academy of Sciences, 105(50):19803–19808, 2008. [29] A. Livnat, C. Papadimitriou, N. Pippenger, and M. W. Feldman. Sex, mixability, and modularity. Proceedings of the National Academy of Sciences, 107(4):1452–1457, 2010. [30] M. Mitchell, S. Forrest, and J. H. Holland. The royal road function for genetic algorithms: fitness landscapes and GA performance. In Proc. of the 1st European Conference on Artificial Life, pages 245–254. MIT Press, 1992. [31] M. Mitchell, J. H. Holland, and S. Forrest. When will a genetic algorithm outperform hill climbing? In Advances in Neural Information Processing Systems, pages 51–58. Morgan Kaufmann, 1994. [32] M. Mitzenmacher and E. Upfal. Probability and Computing. Cambridge University Press, 2005. [33] F. Neumann, P. S. Oliveto, and C. Witt. Theoretical analysis of fitness-proportional selection: landscapes and efficiency. In Genetic and Evolutionary Computation Conference (GECCO’09), pages 835–842. ACM Press, 2009. [34] F. Neumann and M. Theile. How crossover speeds up evolutionary algorithms for the multi-criteria all-pairs-shortest-path problem. In 11th International Conference on Parallel Problem Solving from Nature (PPSN 2010), pages 667–676. Springer, 2010. [35] F. Neumann and C. Witt. Bioinspired Computation in Combinatorial Optimization – Algorithms and Their Computational Complexity. Springer, 2010. [36] G. Ochoa, I. Harvey, and H. Buxton. Error thresholds and their relation to optimal mutation rates. In D. Floreano, J.-D. Nicoud, and F. Mondada, editors, Advances in Artificial Life, volume 1674 of Lecture Notes in Computer Science, pages 54–63. Springer, 1999. [37] P. S. Oliveto and C. Witt. Improved runtime analysis of the simple genetic algorithm. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO ’13), pages 1621–1628. ACM, 2013. [38] P. S. Oliveto and C. Witt. On the runtime analysis of the simple genetic algorithm. Theoretical Computer Science, 545:2–19, 2014. [39] C. Qian, Y. Yu, and Z.-H. Zhou. An analysis on recombination in multi-objective evolutionary optimization. Artificial Intelligence, 204:99–119, 2013. 34 [40] Y. Rabani, Y. Rabinovich, and A. Sinclair. A computational view of population genetics. Random Structures and Algorithms, 12(4):313–334, 1998. [41] J. E. Rowe. Genetic algorithms. In J. Kacprzyk and W. Pedrycz, editors, Handbook of Computational Intelligence. Springer, 2015. To appear. [42] J. E. Rowe, M. D. Vose, and A. H. Wright. Group properties of crossover and mutation. Evolutionary Computation, 10(2):151–184, 2002. [43] T. Storch and I. Wegener. Real royal road functions for constant population size. Theoretical Computer Science, 320:123–134, 2004. [44] D. Sudholt. Crossover is provably essential for the Ising model on trees. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO ’05), pages 1161–1167. ACM Press, 2005. [45] D. Sudholt. The impact of parametrization in memetic evolutionary algorithms. Theoretical Computer Science, 410(26):2511–2528, 2009. [46] D. Sudholt. Crossover speeds up building-block assembly. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO 2012), pages 689–696. ACM Press, 2012. [47] D. Sudholt. A new method for lower bounds on the running time of evolutionary algorithms. IEEE Transactions on Evolutionary Computation, 17(3):418–435, 2013. [48] D. Sudholt and C. Thyssen. Running time analysis of ant colony optimization for shortest path problems. Journal of Discrete Algorithms, 10:165–180, 2012. [49] M. D. Vose. The Simple Genetic Algorithm: Foundations and Theory. MIT press, 1999. [50] R. A. Watson and T. Jansen. A building-block royal road where crossover is provably essential. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO ’07), pages 1452–1459. ACM, 2007. [51] I. Wegener and C. Witt. On the optimization of monotone polynomials by simple randomized search heuristics. Combinatorics, Probability and Computing, 14:225– 247, 2005. [52] D. B. Weissman and N. H. Barton. Limits to the rate of adaptive substitution in sexual populations. PLoS Genetics, 8(6):e1002740, 2012. [53] D. B. Weissman, M. W. Feldman, and D. S. Fisher. The rate of fitness-valley crossing in sexual populations. Genetics, 186(4):1389–1410, 2010. [54] C. Witt. Runtime analysis of the (µ+1) EA on simple pseudo-Boolean functions. Evolutionary Computation, 14(1):65–86, 2006. [55] C. Witt. Tight bounds on the optimization time of a randomized search heuristic on linear functions. Combinatorics, Probability and Computing, 22:294–318, 2 2013. 35 A Appendix The appendix contains proofs of lemmas omitted from the main part. Proof of Lemma 12. If the current population has a best individual of fitness j < i, by Lemma 2 after an expected number of O((µ + λ) log µ) = O(1) function evaluations all individuals will have fitness at least j. Then one offspring creation results in an improvement if no crossover is being used, and mutation flips exactly one out of n − j 0-bits. The probability for this event is (1 − pc ) · (n − j)p(1 − p)n−1 ≥ γ · n−j n for some constant γ > 0, due to our conditions for p and pc . Using Lemma 3, the expected time until a fitness level i ≥ n − n/ log n is reached for the first time is therefore at most  n−(n/ log n)−1  n X X n 1 n = O(n) + · O(1) + λ + γ(n − j) γ j j=0 j=(n/ log n)+1 Z n n 1 ≤ O(n) + · dj γ j=n/ log n j n = O(n) + · (ln n − ln(n/ log n)) γ n = O(n) + · ln(log n) γ = o(n log n). Proof of Lemma 14. In order to create a different search point on the same fitness level, there must be some integer ` ∈ {1, . . . , min{i, n − i}} such that ` 1-bits flip to 0 and ` 0-bits flip to 1. This is a necessary and sufficient condition, so p(i) = min{i,n−i}  X `=1   i n − i 2` p (1 − p)n−2` . ` ` (12) The case ` = 1 yields  the claimed lower bound. For the upper bound we bound the above term, using nk ≤ nk /(k!) to bound both binomial coefficients: p (i) min{i,n−i} ` X i (n − i)` 2` · p (1 − p)−2` `!`! `=1 ` ∞  X i(n − i)p2 ≤ (1 − p)n (1 − p)2 ≤ (1 − p) n `=1 = (1 − p) Applying yields 1 1−x = 1+ x 1−x n 1 i(n−i)p2 (1−p)2 2 − i(n−i)p (1−p)2 . ≤ 1 + 2x for x ≤ 1/2 to x := i(n−i)p2 (1−p)2   i(n − i)p2 2i(n − i)p2 (1 − p) · · 1+ (1 − p)2 (1 − p)2 n 36 in the above formula and hence the claimed upper bound. The second statement follows from the upper bound and the fact that the offspring has Hamming distance 2 in the case ` = 1, i. e., with probability i(n−i)p2 (1−p)n−2 . Proof of Lemma 15. A search point with i ones is created from a parent with i − d < i ones if there is a value ` such that d + ` 0-bits flip to 1 and ` 1-bits flip to 0. The sought probability therefore is ! X n − i + di − d d+2` n−d−2` max p (1 − p) d≥1 d+` ` `=0 ! X (n − i + d)d+` (i − d)` d+2` ≤ max · ·p d≥1 (d + `)! `! `=0 ! X (p(n − i + d))d (p2 · (i − d)(n − i + d))` · = max d≥1 (d + `)! `! `=0   X ((pn)2 /4)` (p(n − i + d))d ≤ max · d≥1 d! `! `=0   2 (p(n − i + d))d · e(pn) /4 . = max d≥1 d! Using 1/(d!) ≤ (e/d)d , we bound the max term as  max d≥1 (p(n − i + d))d d!   ≤ max d≥1 (ep(n − i + d)) d d d ≤ max (ep(n − i + 1)) . d≥1 Now, if ep(n − i + 1) ≤ 1, the maximum is attained for d = 1, in which case we get a 2 probability bound of ep(n − i + 1) · e(pn) /4 as claimed. If ep(n − i + 1) > 1 we trivially bound the sought probability by 1 < ep(n − i + 1) ≤ ep(n − i + 1) · e(pn) 37 2 /4 .
9cs.NE
Modeling Musical Context Using Word2vec D. Herremans∗1 and C.-H. Chuan†2 1 Queen Mary University of London, London, UK University of North Florida, Jacksonville, USA arXiv:1706.09088v2 [cs.SD] 29 Jun 2017 2 We present a semantic vector space model for capturing complex polyphonic musical context. A word2vec model based on a skip-gram representation with negative sampling was used to model slices of music from a dataset of Beethoven’s piano sonatas. A visualization of the reduced vector space using t-distributed stochastic neighbor embedding shows that the resulting embedded vector space captures tonal relationships, even without any explicit information about the musical contents of the slices. Secondly, an excerpt of the Moonlight Sonata from Beethoven was altered by replacing slices based on context similarity. The resulting music shows that the selected slice based on similar word2vec context also has a relatively short tonal distance from the original slice. Keywords: music context, word2vec, music, neural networks, semantic vector space 1 Introduction In this paper, we explore the semantic similarity that can be derived by looking solely at the context in which a musical slice appears. In past research, music has often been modeled through Recursive Neural Networks (RNNs) combined with Restricted Bolzmann Machines [Boulanger-Lewandowski et al., 2012], Long-Short Term RNN models [Eck and Schmidhuber, 2002, Sak et al., 2014], Markov models [Conklin and Witten, 1995] and other statistical models, using a representation that incorporates musical information (i.e., pitch, pitch class, duration, intervals, etc.). In this research, we focus on modeling the context, over the content. Vector space models [Rumelhart et al., 1988] are typically used in natural language processing (NLP) to represent (or embed) words in a continuous vector space [Turney and Pantel, 2010, McGregor et al., 2015, Agres et al., 2016, Liddy et al., 1999]. Within this space, semantically similar words are represented geographically close to each other [Turney and Pantel, 2010]. A recent very efficient approach to creating these vector spaces for natural language processing is word2vec [Mikolov et al., 2013c]. ∗ † [email protected] [email protected] D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 Although music is not the same as language, it possesses many of the same types of characteristics. Besson and Schön [2001] discuss the similarity of music and language in terms of, among others, structural aspects and the expectancy generated by both a word and a note. We can therefore use a model from NLP: word2vec. More specifically a skip-gram model with negative sampling is used to create and train a model that captures musical context. There have been only few attempts at modeling musical context with semantic vector space models. For example, Huang et al. [2016] use word2vec to model chord sequences in order to recommend chords other than the ‘ordinary’ to novice composers. In this paper, we aim to use word2vec for modeling musical context in a more generic way as opposed to a reduced representation as chord sequences. We represent complex polyphonic music as a sequence of equal-length slices without any additional processing for musical concepts such as beat, time signature, chord tones and etc. In the next sections we will first discuss the implemented word2vec model, followed by a discussion of how music was represented. Finally, the resulting model is evaluated. 2 Word2vec Word2vec refers to a group of models developed by Mikolov et al. [2013c]. They are used to create and train semantic vector spaces, often consisting of several hundred dimensions, based on a corpus of text [Mikolov et al., 2013a]. In this vector space, each word from the corpus is represented as a vector. Words that share a context are geographically close to each other in this space. The word2vec architecture can be based on two approaches: a continuous bag-ofwords, or a continuous skip-gram model (CBOW). The former uses the context to predict the current word, whereas the latter uses the current word to predict surrounding words [Mikolov et al., 2013b]. Both models have a low computational complexity, so they can easily handle a corpus with a size ranging in the billions of words in a matter of hours. While CBOW models are faster, it has been observed that skip-gram performs better on small datasets [Mikolov et al., 2013a]. We therefore opted to work with the latter model. Skip-gram with negative sampling The architecture of a skip-gram model is represented in Figure 1. For each word wt in a corpus of size T at position t, the network tries to predict the surrounding words in a window c (c = 2 in the figure). The training objective is thus defined as: T 1X T X log p(wt+i |wt ), (1) t=1 −c≤i≤c,i6=0 whereby the term p(wt+i |wt ) is calculated by a softmax function. Calculating the gradient of this term is, however, computationally very expensive. Alternatives to circumvent this problem include hierarchical softmax [Morin and Bengio, 2005] and noise contrastive estimation [Gutmann and Hyvärinen, 2012]. The word2vec model used in this research implements a variant of the latter, namely negative sampling. Figure 1: A skip-gram model with n-dimensions for word wt at position t. D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 The idea behind negative sampling is that a well trained model should be able to distinguish between data and noise [Goldberg and Levy, 2014]. The original training objective is thus approximated by a new, more efficient, formulation that implements a binary logistic regression to classify between data and noise samples. When the model is able to assign high probabilities to real words and low probabilities to noise samples, the objective is optimized Mikolov et al. [2013c]. Cosine similarity was used as a similarity metric between two musical-slice vectors in our vector space. For two non-zero vectors A and B in n dimensional space, with an angle θ, it is defined as [Tan et al., 2005]: Pn Ai × Bi Similarity(A, B) = cos(θ) = Pn i=12 Pn (2) 2 i=1 Ai × i=1 Bi In this research, we port the above discussed model and techniques to the field of music. We do this by replacing ‘words’ with ‘slices of polyphonic music’. The manner in which this is done is discussed in the next section. 3 Musical slices as words In order to study the extend to which word2vec can model musical context, polyphonic musical pieces are represented with as little injected musical knowledge as possible. Each piece is simply segmented into equal-length, non-overlapping slices. The duration of these slices is calculated for each piece based on the distribution of time between note onsets. The smallest amount of time between consecutive onsets that occurs in more than 5% of all cases is selected as the slice-size. The slices capture all pitches that sound in a slice: those that have their onset in the slice, and those that are played and held over the slice. The slicing process does not depend on musical concepts such as beat or time signature; instead, it is completely data-driven. Our vocabulary of words, will thus consist of a collection of musical slices. In addition, we do not label pitches as chords. All sounding pitches, including chord tones, non-chord tones, and ornaments, are all recorded in the slice. We do not reduce pitches into pitch classes either, i.e., pitches C4 and C5 are considered different pitches. The only musical knowledge we use is the global key, as we transpose all pieces to either C major or A minor before segmentation. This enables the functional role of pitches in tonality to stay the same across compositions, which in turn causes there to be more repeated slices over the dataset and allows the model to be better trained on less data. In the next section, the performance of the resulting model is discussed. 4 Results In order to evaluate how well the proposed model captures musical context, a few experiments were performed on a dataset consisting of Beethoven’s piano sonatas. The resulting dataset consists of 70,305 words, with a total of 14,315 unique occurrences. As discussed above, word2vec models are very efficient to train. Within minutes, the model was trained on the CPU of a MacBook Pro. We trained the model a number of times, with a different number of dimensions of the vector space (see Figure 2a). The more dimensions there are, the more accurate the model becomes, D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 however, the time to train the model also becomes longer. In the rest of the experiments, we decided to use 128 dimensions. In a second experiment, we varied the size of the skip window, i.e., how many words to consider to the left and right of the current word in the skip-gram. The results are displayed in Figure 2b, and show that a skip window of 1 is most ideal for our dataset. (a) Results for varying the number of dimen- (b) Results for varying the size of the skip sions of the vector space. window. Figure 2: Evolution of the average loss during training. A step represents 2000 training windows. 4.1 Visualizing the semantic vector space In order to better understand and evaluate the proposed model, we created visualizations of selected musical slices in a dimensionally reduced space. We use t-Distributed Stochastic Neighbor Embedding (t-SNE), a technique developed by Maaten and Hinton [2008] for visualizing high-dimensional data. t-SNE has previously been used in a music analysis context for visualizing clusters of musical genres based on musical features [Hamel and Eck, 2010]. In this case, we identified the ‘chord’ to which each slice of the dataset belongs based on a simple template-matching method. We expect that tonally close chords occur together in the semantic vector space. Figure 3 confirms this hypothesis. When examining slices that contain C and G chords (a perfect fifth apart), the space looks very dispersed, as they often co-occur (see Figure 3c). The same occurs for the chord pair Eb and Bb in Figure 3d. On the other hand, when looking at the tonally distant chord pair E and Eb (Figure 3a), we see that clusters appear in the reduced vector space. The same happens for the tonally distant chords Eb , Bb and B in Figure 3b. 4.2 Content versus context In order to further examine if word2vec captures semantic meaning in music via the modeling of context, we modify a piece by replacing some of its original slices with the most similar one as captured by the cosine similarity in the vector space model. If word2vec is really able to D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 (a) E (green) and Eb (blue). (b) Eb (black), Db (green) and B (gray). (c) C (green) and G (blue). (d) Eb (green) and Bb (blue). Figure 3: Reduced vector space with t-SNE for different slices (labeled by the most close chord) capture this, the modified piece should sound similar to the original. This allows us to evaluate the effectiveness of using word2vec for modeling music. Figure 4 shows the first 17 measures of Beethoven’s piano sonata Op. 27 No. 2 (Moonlight), 2nd movement in (a) and the measures with modified pitch slices in the dashed box in (b). An audio version of this score is available online1 . The modified slices in (b) are produced by replacing the original with the slice that has the highest cosine similarity based on the word2vec embeddings. The tonal distance between the original and modified slices is presented below each slice pair. This is calculated as the average of the number of steps between each pair of pitches in the two slices in a tonnetz representation [Cohn, 1997], extended with pitch register. It can be observed that even thought the cosine similarity is around 0.5, the tonal distance of 1 http://dorienherremans.com/word2vec D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 the selected slice remains relatively low in most of the cases. For example, the tonal distance in the third dashed box between the modified slice (Db major triad with pitches Db 4 , F4 , and Ab 4 ) and the original slice of a single pitch Ab 4 is 1.25. However, we notice that word2vec does not necessarily model musical context for voice leading. For example, better voice leading can be achieved if the pitch D4 in the last dashed box is replaced with pitch D5 . Figure 4: (a) An excerpt of Beethoven’s piano sonata Op. 27 No. 2, 2nd movement with (b) modified measures by replacing with slices that report the highest word2vec cosine similarity. In Figure 4b, a number of notes are marked in a different color (orange). These are the held notes, i.e., their onsets are played previously and the notes remain being played over the current slice. These notes create a unique situation in music generation using word2vec. For example, the orange note (pitch Db 5 ) in the first dashed box is a held note, which indicates that the pitch should have been played in the previous slice. However, word2vec does not capture this relation; it only considers the similarity between the original and modified slices. 5 Conclusions A skip-gram model with negative sampling was used to build a semantic vector space model for complex polyphonic music. By representing the resulting vector space in a reduced twodimensional graph with t-SNE, we show that musical features such as a notion of tonal proximity are captured by the model. Music generated by replacing slices based on word2vec context similarity also presents close tonal distance compared to the original. In the future, an embedded model that combines both word2vec with, for instance, a longshort term memory recurrent neural network based on musical features, would offer a more complete way to more completely model music. The TensorFlow code used in this research is D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 available online2 . Acknowledgements This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 658914. References Kat R Agres, Stephen McGregor, Karolina Rataj, Matthew Purver, and Geraint A Wiggins. Modeling metaphor perception with distributional semantics vector space models. In Workshop on Computational Creativity, Concept Invention, and General Intelligence. Proceedings of 5 th International Workshop, C3GI at ESSLI, pages 1–14, 2016. Mireille Besson and Daniele Schön. Comparison between language and music. Annals of the New York Academy of Sciences, 930(1):232–258, 2001. Nicolas Boulanger-Lewandowski, Yoshua Bengio, and Pascal Vincent. Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. arXiv preprint arXiv:1206.6392, 2012. Richard Cohn. Neo-riemannian operations, parsimonious trichords, and their” tonnetz” representations. Journal of Music Theory, 41(1):1–66, 1997. Darrell Conklin and Ian H Witten. Multiple viewpoint systems for music prediction. Journal of New Music Research, 24(1):51–73, 1995. Douglas Eck and Juergen Schmidhuber. Finding temporal structure in music: Blues improvisation with lstm recurrent networks. In Neural Networks for Signal Processing, 2002. Proceedings of the 2002 12th IEEE Workshop on, pages 747–756. IEEE, 2002. Yoav Goldberg and Omer Levy. word2vec explained: Deriving mikolov et al.’s negativesampling word-embedding method. arXiv preprint arXiv:1402.3722, 2014. Michael U Gutmann and Aapo Hyvärinen. Noise-contrastive estimation of unnormalized statistical models, with applications to natural image statistics. Journal of Machine Learning Research, 13(Feb):307–361, 2012. Philippe Hamel and Douglas Eck. Learning features from music audio with deep belief networks. In ISMIR, volume 10, pages 339–344. Utrecht, The Netherlands, 2010. Cheng-Zhi Anna Huang, David Duvenaud, and Krzysztof Z Gajos. Chordripple: Recommending chords to help novice composers go beyond the ordinary. In Proceedings of the 21st International Conference on Intelligent User Interfaces, pages 241–250. ACM, 2016. Elizabeth D Liddy, Woojin Paik, S Yu Edmund, and Ming Li. Multilingual document retrieval system and method using semantic vector matching, December 21 1999. US Patent 6,006,221. 2 http://dorienherremans.com/word2vec D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18 Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of Machine Learning Research, 9(Nov):2579–2605, 2008. Stephen McGregor, Kat Agres, Matthew Purver, and Geraint A Wiggins. From distributional semantics to conceptual spaces: A novel computational method for concept creation. Journal of Artificial General Intelligence, 6(1):55–86, 2015. Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013a. Tomas Mikolov, Quoc V Le, and Ilya Sutskever. Exploiting similarities among languages for machine translation. arXiv preprint arXiv:1309.4168, 2013b. Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in neural information processing systems, pages 3111–3119, 2013c. Frederic Morin and Yoshua Bengio. Hierarchical probabilistic neural network language model. In Aistats, volume 5, pages 246–252. Citeseer, 2005. David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by back-propagating errors. Cognitive modeling, 5(3):1, 1988. Hasim Sak, Andrew W Senior, and Françoise Beaufays. Long short-term memory recurrent neural network architectures for large scale acoustic modeling. In Interspeech, pages 338–342, 2014. Pang-Ning Tan, Michael Steinbach, and Vipin Kumar. Introduction to Data Mining, (First Edition). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2005. ISBN 0321321367. Peter D Turney and Patrick Pantel. From frequency to meaning: Vector space models of semantics. Journal of artificial intelligence research, 37:141–188, 2010. D. Herremans, and C.H. Chuan. 2017. Modeling Musical Context Using Word2vec. Proceedings of the First International Workshop on Deep Learning and Music joint with IJCNN. Anchorage, US. May, 2017. 1(1). pp 11-18
9cs.NE
arXiv:1711.02002v1 [math.AC] 6 Nov 2017 REGULARITY AND H-POLYNOMIALS OF MONOMIAL IDEALS TAKAYUKI HIBI AND KAZUNORI MATSUDA A BSTRACT. Let S = K[x1 , . . . , xn ] denote the polynomial ring in n variables over a field K with each deg xi = 1 and I ⊂ S a homogeneous ideal of S with dim S/I = d. The Hilbert series of S/I is of the form hS/I (λ )/(1 − λ )d , where hS/I (λ ) = h0 + h1 λ + h2λ 2 + · · · + hs λ s with hs 6= 0 is the h-polynomial of S/I. It is known that, when S/I is Cohen–Macaulay, one has reg(S/I) = deg hS/I (λ ), where reg(S/I) is the (Castelnuovo–Mumford) regularity of S/I. In the present paper, given arbitrary integers r and s with r ≥ 1 and s ≥ 1, a monomial ideal I of S = K[x1 , . . . , xn ] with n ≫ 0 for which reg(S/I) = r and deg hS/I (λ ) = s will be constructed. Furthermore, we give a class of edge ideals I ⊂ S of Cameron–Walker graphs with reg(S/I) = deghS/I (λ ) for which S/I is not Cohen–Macaulay. I NTRODUCTION Let S = K[x1 , . . . , xn ] denote the polynomial ring in n variables over a field K with each deg xi = 1 and I ⊂ S a homogeneous ideal of S with dim S/I = d. The Hilbert series HS/I (λ ) of S/I is of the form HS/I (λ ) = (h0 + h1 λ + h2 λ 2 + · · · + hs λ s )/(1 − λ )d , where each hi ∈ Z ([2, Proposition 4.4.1]). We say that hS/I (λ ) = h0 + h1 λ + h2 λ 2 + · · · + hs λ s with hs 6= 0 is the h-polynomial of S/I. Let reg(S/I) denote the (Castelnuovo–Mumford ) regularity [2, p. 168] of S/I. A well-known fact (e.g., [3, Lemma 2.5]) is that, when S/I is Cohen–Macaulay, one has reg(S/I) = deg hS/I (λ ). Its converse is false. The following example was found by Jürgen Herzog. Let I ⊂ S = K[x1 , x2 , x3 , x4 ] be the monomial ideal (x32 , x22 x3 , x2 x23 , x33 , x21 , x1 x2 , x1 x3 , x1 x4 ), which is strongly stable ([7, p. 103]). Then dim S/I = 1, depth S/I = 0, reg(S/I) = 2 and hS/I (λ ) = 1 + 3λ + 2λ 2 . At this stage, it is reasonable to discover a natural class of monomial ideals I ⊂ S = K[x1 , . . ., xn ] for which S/I is not Cohen–Macaulay with reg(S/I) = deg hS/I (λ ). Furthermore, one cannot escape from the temptation to present the following Conjecture 0.1. Given arbitrary integers r and s with r ≥ 1 and s ≥ 1, there exists a strongly stable ideal I of S = K[x1 , . . . , xn ] with n ≫ 0 for which reg(S/I) = r and deg hS/I (λ ) = s. It follows from [2, Lemma 4.1.3] that if I has a pure resolution ([2, p. 153]), then deg hS/I (λ ) − reg(S/I) = dim S/I − depth S/I. 2010 Mathematics Subject Classification. 05E40, 13H10. Key words and phrases. Castelnuovo–Mumford regularity, h-polynomial, Cameron–Walker graph. 1 As a result, when 1 ≤ r ≤ s, a desired ideal can be found in the class of squarefree lexsegment ideals ([1], [7, p. 124]). The purpose of the present paper is to give an affirmative answer to a weak version of Conjecture 0.1, that is to say, a monomial ideal I of S = K[x1 , . . ., xn ] for which reg(S/I) = r and deg hS/I (λ ) = s will be constructed. Theorem 0.2. Given arbitrary integers r and s with r ≥ 1 and s ≥ 1, there exists a monomial ideal I of S = K[x1 , . . . , xn ] with n ≫ 0 for which reg(S/I) = r and deg hS/I (λ ) = s. When r > s, a basic process in order to obtain a required ideal of Theorem 0.2 is to find a monomial ideal I = IN ⊂ S with reg(S/I) = N + 1 and deg hS/I (λ ) = 1 for an arbitrary integer N > 0. A proof of Theorem 0.2 will be achieved in Section 1. On the other hand, in Section 2, we give a class of edge ideals I ⊂ S of Cameron–Walker graphs ([8]) with reg(S/I) = deg hS/I (λ ) for which S/I is not Cohen–Macaulay. 1. P ROOF OF T HEOREM 0.2 Before giving a proof of Theorem 0.2, several lemmata will be prepared. Let, as before, S = K[x1 , . . ., xn ] denote the polynomial ring in n variables over a field K with each deg xi = 1. Lemma 1.1 below follows immediately from the definition of regularity in terms of graded Betti numbers ([7, p. 48]). Lemma 1.1. Let I ⊂ S be a proper homogeneous ideal. Then reg(S/I) = reg(I) − 1. Lemma 1.2 ([9, Lemma 3.2]). Let S1 = K[x1 , . . ., xm ] and S2 = K[y1 , . . . , yn ] be polynomial rings over a field K. Let I1 be a nonzero homogeneous ideal of S1 and I2 that of S2 . Write S for S1 ⊗K S2 = K[x1 , . . ., xm , y1 , . . ., yn ] and regard I1 + I2 and I1 I2 as homogeneous ideals of S. Then (1) reg(I1 I2 ) = reg(I1 ) + reg(I2 ) ; (2) reg(I1 + I2 ) = reg(I1 ) + reg(I2 ) − 1 ; (3) reg(S/(I1 + I2 )) = reg(S1 /I1 ) + reg(S2 /I2 ). Lemma 1.3 ([6, Lemma 2.10]). Let I ⊂ S be a monomial ideal and xi a variable of S which appears in a monomial belonging to the unique minimal system of monomial generators of I. Then reg(I) ≤ max{ reg(I : (x)) + 1, reg(I + (x)) }. In the first step of a proof of Theorem 0.2, given integers 1 ≤ r ≤ s, we construct a monomial ideal I ⊂ S with reg(S/I) = r and hS/I (λ ) = s. As was mensioned in Introduction, a desired ideal I can be found in the class of squarefree lexsegment ideals. Let <lex denote the lexicographic order ([7, p. 24]) on S = K[x1 , . . ., xn ] induced from x1 > x2 > · · · > xn . A monomial ideal I ⊂ S is called squarefree lexsegment if I is generated by squarefree monomials and if, for all squarefree monomials u ∈ I and for all squarefree monomials v ∈ S with deg u = deg v and u <lex v, one has v ∈ I. 2 Fix integers r and s with 1 ≤ r ≤ s and consider the squarefree lexsegment ideal Ir,s = (u1 u2 · · · ur ur+1 , u1 u2 · · · ur ur+2 , . . . , u1 u2 · · · ur us+1 ) of the polynomial ring K[u1 , . . ., us+1 ] in (s + 1) variables over a field K. Proposition 1.4. One has (1) reg(K[u1, . . . , us+1 ]/Ir,s ) = r ; 1 + λ + · · · + λ r−1 + λ r (1 − λ )s−r (2) HK[u1 ,...,us+1 ]/Ir,s (λ ) = . (1 − λ )s Thus, in particular, deg hK[u1 ,...,us+1 ]/Ir,s (λ ) = s. Proof. (1) Since Ir,s = (u1 u2 · · · ur )(ur+1, . . . , us+1 ), it follows from Lemma 1.2 (1) that reg(Ir,s ) = r + 1. Hence Lemma 1.1 says that reg(K[u1 , . . ., us+1 ]/Ir,s) = r, as desired. (2) Let u = u1 u2 · · · ur . Then Ir,s + (u) = (u) and Ir,s : (u) = (ur+1 , . . . , us+1 ). Thus the short exact sequence K[u1, . . . , us+1 ] K[u1 , . . . , us+1 ] ×u K[u1 , . . . , us+1 ] (−r) −−→ → → 0, 0→ Ir,s : (u) Ir,s Ir,s + (u) yields HK[u1 ,...,us+1 ]/Ir,s (λ ) = HK[u1 ,...,us+1 ]/(u) (λ ) + λ r · HK[u1,...,us+1 ]/(ur+1 ,...,us+1 ) (λ ) = λr 1 + λ + · · · + λ r−1 + (1 − λ )s (1 − λ )r = 1 + λ + · · · + λ r−1 + λ r (1 − λ )s−r , (1 − λ )s as required.  Proposition 1.4 guarantees that, when 1 ≤ r ≤ s, Conjecture 0.1 is true. Now, in the second step of a proof of Theorem 0.2, we turn to the discussion of finding a desired monomial ideal for 1 ≤ s < r. Let n ≥ 2 and Sn = K[x, y1 , . . . , yn , z1 , . . . , zn+1 ] the polynomial ring in 2(n + 1) variables over a field K. We then introduce the monomial ideals In , Jn , Kn and Ln defined as follows: 3 n−2 In = (xy1 y2 · · · yn , xz1 z2 · · · zn+1 ) + ∑ (y1 , . . ., yi , yi+1 · · · yn )(zi ) i=1 + (y1 , . . . , yn )(zn−1 , zn , zn+1 ), n−1 Jn = (xz1 z2 · · · zn+1 ) + ∑ (zi , . . . , zn+1 )(yi ), i=1 n−2 Kn = (xy1 y2 · · · yn−1 ) + ∑ (y1 , . . ., yi , yi+1 · · · yn−1 )(zi ), i=1 n−1 Ln = ∑ (zi, . . ., zn)(yi). i=1 Remark 1.5. One has (1) In + (yn ) = (yn ) + Jn ; (2) In : (yn ) = (zn−1 , zn , zn+1 ) + Kn ; (3) Jn + (zn+1 ) = (zn+1 ) + Ln ; (4) Jn : (zn+1 ) = (xz1 z2 · · · zn ) + (y1 , . . . , yn−1 ) ; (5) Kn + (yn−1 ) = (yn−1 ) + ∑n−2 i=1 (y1 , . . ., yi )(zi ) if n ≥ 3 ; (6) Kn : (yn−1 ) = (zn−2 ) + Kn−1 if n ≥ 3 ; (7) Ln can be regarded as the edge ideal ([7, p. 156]) of the Ferrers graph associated with the partition (n − 1, n − 1, n − 2, . . . , 2, 1) and ∑n−2 i=1 (y1 , . . ., yi )(zi ) appearing in (5) can be regarded as that with the partition (n − 2, n − 1, . . ., 2, 1)), see [4]. By using [4, Theorem 2.1], one has ! n−2 reg(Ln ) = reg ∑ (y1, . . . , yi)(zi) = 2, i=1 1 + (n − 1)λ − (n − 1)λ 2 , (1 − λ )n 1 + (n − 2)λ . HK[y1 ,...,yn−2 ,z1 ,...,zn−2 ]/ ∑n−2 (y1 ,...,yi )(zi ) (λ ) = i=1 (1 − λ )n−2 HK[y1 ,...,yn−1 ,z1 ,...,zn]/Ln (λ ) = Lemma 1.6. One has (1) reg(Jn ) = n + 2 ; (2) HK[x,y1 ,...,yn−1 ,z1 ,...,zn+1 ]/Jn (λ ) = 1 + nλ − (n − 2)λ 2 + λ 3 + · · · + λ n+1 . (1 − λ )n+1 4 Proof. (1) Since xz1 z2 · · · zn+1 belongs to the unique minimal system of monomial generators of Jn , it follows that n + 2 ≤ reg(Jn ). We claim reg(Jn ) ≤ n + 2. By using Lemma 1.2 (2) together with Remark 1.5 (3) and (7), one has reg(Jn + (zn+1 )) = reg((zn+1 ) + Ln )) = reg(Ln ) = 2. Furthermore, Lemma 1.2 (2) together with Remark 1.5 (4) says that reg(Jn : (zn+1 )) = n + 1. Hence, reg(Jn ) ≤ n + 2 follows from Lemma 1.3. (2) Let T = K[x, y1 , . . ., yn−1 , z1 , . . . , zn+1 ] and consider the short exact sequence T T ×zn+1 T (−1) −−−−→ → → 0. 0→ Jn : (zn+1 ) Jn Jn + (zn+1 ) Remark 1.5 (3) and (7) yield HT /Jn +(zn+1 ) (λ ) = HT /(zn+1 )+Ln (λ ) = HK[y1,...,yn−1 ,z1 ,...,zn ]/Ln (λ ) · 1 (1 − λ ) 1 + (n − 1)λ − (n − 1)λ 2 . = (1 − λ )n+1 Furthermore, Remark 1.5 (4) yeilds HT /Jn :(zn+1 ) (λ ) = HT /(xz1 z2 ···zn )+(y1 ,...,yn−1 ) (λ ) = HK[x,z1,...,zn ]/(xz1 z2 ···zn ) (λ ) · = 1 (1 − λ ) 1+λ +···+λn . (1 − λ )n+1 Hence HT /Jn (λ ) = HT /Jn +(zn+1 ) (λ ) + λ · HT /Jn :(zn+1 ) (λ ) = 1 + nλ − (n − 2)λ 2 + λ 3 + · · · + λ n+1 , (1 − λ )n+1 as desired.  Lemma 1.7. One has (1) reg(Kn ) = n; (2) HK[x,y1 ,...,yn−1 ,z1 ,...,zn−2 ]/Kn (λ ) = i 1 + ∑n−1 i=1 (n − i)λ . (1 − λ )n−1 5 Proof. Since xy1 y2 · · · yn−1 belongs to the unique minimal system of monomial generators of Jn , one has n ≤ reg(Kn ). We claim reg(Kn ) ≤ n and (2) by using induction on n. Since K2 = (xy1 ), each of the assertion is trivial for n = 2. Let n > 2. Lemma 1.2 (2) together with Remark 1.5 (5) and (7) guarantees that ! n−2 reg(Kn + (yn−1 )) = reg (yn−1 ) + ∑ (y1 , . . ., yi )(zi ) = 2. i=1 Moreover, by virtue of Lemma 1.2 (2), Remark 1.5 (6) as well as the induction hypothesis, it follows that reg(Kn : (yn−1 )) = reg((zn−2 ) + Kn−1 ) = reg(Kn−1 ) = n − 1. Hence, Lemma 1.3 says that reg(Kn ) ≤ n. Now, consider the short exact sequence 0→ ′ T′ T′ ×yn−1 T (−1) −−−−→ → → 0, Kn : (yn−1 ) Kn Kn + (yn−1 ) where T ′ = K[x, y1 , . . . , yn−1 , z1 , . . ., zn−2 ]. It follows from Remark 1.5 (5) and (7) that HT ′ /Kn +(yn−1 ) (λ ) = HT ′ /(yn−1 )+∑n−2 (y1 ,...,yi )(zi ) (λ ) i=1 = HK[y1 ,...,yn−2 ,z1 ,...,zn−2 ]/ ∑n−2 (y1 ,...,yi )(zi ) (λ ) · i=1 1 1−λ 1 + (n − 2)λ . (1 − λ )n−1 Furthermore, Remark 1.5 (6) as well as the induction hypothesis guarantees that = HT ′ /Kn :(yn−1 ) (λ ) = KT ′ /(zn−2 )+Kn−1 (λ ) = HK[x,y1,...,yn−2 ,z1 ,...,zn−3 ]/Kn−1 (λ ) · i 1 + ∑n−2 i=1 (n − 1 − i)λ . = (1 − λ )n−1 6 1 1−λ Hence, one has HT ′ /Kn (λ ) = HT ′ /Kn +(yn−1 ) (λ ) + λ · HT ′ /Kn :(yn−1 ) (λ ) i 1 + (n − 2)λ + λ + λ · ∑n−2 i=1 (n − 1 − i)λ = (1 − λ )n−1 i+1 1 + (n − 1)λ + ∑n−2 i=1 (n − 1 − i)λ = (1 − λ )n−1 = i 1 + (n − 1)λ + ∑n−1 i=2 (n − i)λ (1 − λ )n−1 = i 1 + ∑n−1 i=1 (n − i)λ , (1 − λ )n−1 as desired.  The monomial ideal In plays an important role in our proof of Theorem 0.2. Proposition 1.8. One has (1) reg(Sn /In ) = n + 1 ; 1 + (n + 1)λ . (2) HSn /In (λ ) = (1 − λ )n+1 Thus, in particular, deg hSn /In (λ ) = 1. Proof. (1) By virtue of Lemma 1.1, it is sufficient to show that reg(In ) = n + 2. Since xz1 z2 · · · zn+1 belongs to the unique minimal system of monomial generators of In , one has n + 2 ≤ reg(In ). We claim reg(In ) ≤ n + 2. It follows from Lemma 1.2 (2), Remark 1.5 (1) together with Lemma 1.6 (1) that reg(In + (yn )) = reg((yn ) + Jn ) = reg(Jn ) = n + 2. By using Lemma 1.2 (2), Remark 1.5 (2) together with Lemma 1.7 (1), one has reg(In : (yn )) = reg((zn−1 , zn , zn+1 ) + Kn ) = reg(Kn ) = n. Hence Lemma 1.3 says that reg(In ) ≤ n + 2, as desired. (2) Considering the short exact sequence 0→ Sn Sn ×yn Sn (−1) −−−→ → → 0. In : (yn ) In In + (yn ) 7 Remark 1.5 (1) together with Lemma 1.6 (2) yields HSn /In +(yn ) (λ ) = HSn /(yn )+Jn (λ ) = HK[x,y1 ,...,yn−1 ,z1 ,...,zn+1 ]/Jn (λ ) 1 + nλ − (n − 2)λ 2 + λ 3 + · · · + λ n+1 . = (1 − λ )n+1 Furthermore, Remark 1.5 (2) together with Lemma 1.7 (2) yields HSn /In :(yn ) (λ ) = HSn /(zn−1 ,zn ,zn+1 )+Kn (λ ) = HK[x,y1,...,yn−1 ,z1 ,...,zn−2 ]/Kn (λ ) · = 1 1−λ i 1 + ∑n−1 i=1 (n − i)λ . (1 − λ )n It then follows that HSn /In (λ ) = HSn /In +(yn ) (λ ) + λ · HSn/In :(yn ) (λ ) i+1 1 + nλ − (n − 2)λ 2 + λ 3 + · · · + λ n+1 t + ∑n−1 i=1 (n − i)λ = + (1 − λ )n+1 (1 − λ )n = i+1 1 + nλ − (n − 2)λ 2 + λ 3 + · · · + λ n+1 + λ (1 − λ ) + (1 − λ ) ∑n−1 i=1 (n − i)λ (1 − λ )n+1 = i+1 − n−1 (n − i)λ i+2 1 + (n + 1)λ − (n − 1)λ 2 + ∑ni=2 λ i+1 + ∑n−1 ∑i=1 i=1 (n − i)λ n+1 (1 − λ ) = i+1 − n (n − i + 1)λ i+1 1 + (n + 1)λ − (n − 1)λ 2 + ∑ni=2 λ i+1 + ∑n−1 ∑i=2 i=1 (n − i)λ n+1 (1 − λ ) = 1 + (n + 1)λ − (n − 1)λ 2 + ∑ni=2 λ i+1 + (n − 1)λ 2 − ∑ni=2 λ i+1 (1 − λ )n+1 1 + (n + 1)λ , (1 − λ )n+1 as required. =  We are now in the position to finish a proof of Theorem 0.2. 8 Proof. (Proof of Theorem 0.2.) Let r and s be positive integers with r, s ≥ 1. By virtue of Proposition 1.4, only the case of r > s ≥ 1 will be discussed. Let S1 = K[x, y1 , z1 , z2 ] and 1+2λ I1 = (xy1 , xz1 z2 , y1 z1 , y1 z2 ). It then follows that reg(S1 /I1 ) = 2 and HS1 /I1 (λ ) = (1− . λ )2 By virtue of this example and of Proposition 1.8, one has reg(Sr−s /Ir−s) = r − s + 1, HSr−s /Ir−s (λ ) = 1 + (r − s + 1)λ . (1 − λ )r−s+1 Let S = Sr−s ⊗K K[u1, . . . , us ] and I = Ir−s + (u1 u2 · · · us ). Lemma 1.2 (3) together with Proposition 1.4 yields reg(S/I) = r − s + 1 + s − 1 = r and {1 + (r − s + 1)λ }(1 + λ + · · · + λ s−1 ) . (1 − λ )r Hence deg hS/I (λ ) = s and I is a desired monomial ideal. HS/I (λ ) =  2. E XAMPLES The purpose of this section is to give a class of edge ideals I ⊂ S of Cameron–Walker graphs ([8]) with reg(S/I) = deg hS/I (λ ) for which S/I is not Cohen–Macaulay. Let G be a finite simple graph on the vertex set [n] = {1, . . ., n} and E(G) its edge set. (A finite graph is called simple if it possesses no loop and no multiple edge.) The edge ideal I(G) of G is the monomial ideal of S = K[x1 , . . . .xn ] generated by those quadratic monomials xi x j with {i, j} ∈ E(G): I(G) = ( xi x j : {i, j} ∈ E(G) ) ⊂ S. In general, it is quite difficult to compute the regularity of an edge ideal. However, one can compute reg(I(G)) easily if G is a Cameron–Walker graph. The notion of CameronWalker graph was introduced by [5]. We refer the reader to [8, p. 258] for a classification of Cameron–Walker graphs. Example 2.1. Fix m ≥ 1 and write G1m for the star triangle joining m triangles at one common vertex. Then S/I(G1m) is Cohen–Macaulay if and only if m = 1 ([8, Theorem 1.3]). Hence • If m = 2k, then reg(S/I(G1m)) = 2k > 2k − 1 = deg hS/I(G1m ) (λ ). • If m = 2k + 1, then reg(S/I(G1m)) = deg hS/I(G1m ) (λ ) = 2k + 1. 9 Example 2.2. Fix m ≥ 1 and write G2m for the graph drawn below on the vertex set [2m + 3]: G2m = 1  2m + 3  2m + 2 ❄▲▲2m + 1 r⑧r⑧r⑧ ❄❄▲❄▲▲▲ r r ❄❄ ▲▲ rr ⑧⑧ ❄❄ ▲▲▲ rrr ⑧⑧⑧ · · · ❄❄ ▲ r ❄ r❄ ⑧⑧ ❄❄ ⑧ ⑧ ⑧  ⑧ 2m 2m − 1 2 Then [8, Theorem 1.3] says that G2m is not Cohen–Macaulay if m ≥ 2. However, reg(S/I(G2m)) = deg hS/I(G2m ) (λ ) = m + 1. On the other hand, this graph is of interest from the viewpoint of h-vector (h0 , h1 , . . ., hs ), which is the sequence of coefficients of h-polynomial. It is known [10, Theorem 4.4] that the h-vector of Gorenstein ring is symmetric, but the converse is false. A routine computation shows that hS/I(G2m ) (λ ) = (1 + λ )m+1 + λ (1 − λ )m−1 . Hence h-vector of S/I(G2m) is symmetric if m is odd, but not necessary unimodal. For example, the h-vector of S/I(G23) is (1, 5, 4, 5, 1), which is not unimodal. In general, the h-vector of S/I(G2m ) is not unimodal if m = 4k + 3. Acknowledgment. The first author was partially supported by JSPS KAKENHI 26220701. The second author was partially supported by JSPS KAKENHI 17K14165. R EFERENCES [1] A. Aramova, J. Herzog and T. Hibi, Squarefree lexsegment ideals, Math. Z. 228 (1998), 353–378. [2] W. Bruns and J. Herzog, Cohen-Macaulay Rings, Revised ED., Cambridge Stud. Adv. Math., vol. 39, Cambridge University Press, Cambridge, 1998. [3] B. Benedetti and M. Varbaro, On the dual graph of Cohen-Macaulay algebras, Int. Math. Res. Not. IMRN 17 (2015), 8085–8115. [4] A. Corso and U. Nagel, Monomial and toric ideals associated to Ferrers graphs, Trans. Amer. Math. Soc. 361 (2009), 1371–1395. [5] K. Cameron and T. Walker, The graphs with maximum induced matching and maximum matching the same size, Discrete Math. 299 (2005), 49–55. [6] H. Dao, C. Huneke and J. Schweig, Bounds on the regularity and projective dimension of ideals associated to graphs, J. Algebraic Combin. 38 (2013), 37–55. [7] J. Herzog and T. Hibi, Monomial ideals, Graduate Texts in Mathematics 260, Springer, London, 2010. 10 [8] T. Hibi, A. Higashitani, K. Kimura and A. B. O’Keefe, Algebraic study on Cameron–Walker graphs, J. of Algebra 422 (2015), 257–269. [9] L. T. Hoa and N. D. Tam, On some invariants of a mixed product of ideals, Arch. Math. (Basel) 94 (2010), 327–337. [10] R. Stanley, Hilbert functions of graded algebras, Adv. Math. 28 (1978), 57–83. TAKAYUKI H IBI , D EPARTMENT OF P URE AND A PPLIED M ATHEMATICS , G RADUATE S CHOOL OF I NFORMATION S CIENCE AND T ECHNOLOGY, O SAKA U NIVERSITY, S UITA , O SAKA 565-0871, JAPAN E-mail address: [email protected] K AZUNORI M ATSUDA , D EPARTMENT OF P URE AND A PPLIED M ATHEMATICS , G RADUATE S CHOOL OF I NFORMATION S CIENCE AND T ECHNOLOGY, O SAKA U NIVERSITY, S UITA , O SAKA 565-0871, JAPAN E-mail address: [email protected] 11
0math.AC
1 Correntropy Maximization via ADMM – Application to Robust Hyperspectral Unmixing – arXiv:1602.01729v1 [stat.ML] 4 Feb 2016 Fei Zhu, Abderrahim Halimi, Paul Honeine, Badong Chen, Nanning Zheng Abstract In hyperspectral images, some spectral bands suffer from low signal-to-noise ratio due to noisy acquisition and atmospheric effects, thus requiring robust techniques for the unmixing problem. This paper presents a robust supervised spectral unmixing approach for hyperspectral images. The robustness is achieved by writing the unmixing problem as the maximization of the correntropy criterion subject to the most commonly used constraints. Two unmixing problems are derived: the first problem considers the fully-constrained unmixing, with both the non-negativity and sum-to-one constraints, while the second one deals with the non-negativity and the sparsity-promoting of the abundances. The corresponding optimization problems are solved efficiently using an alternating direction method of multipliers (ADMM) approach. Experiments on synthetic and real hyperspectral images validate the performance of the proposed algorithms for different scenarios, demonstrating that the correntropy-based unmixing is robust to outlier bands. Index Terms Correntropy, maximum correntropy estimation, alternating direction method of multipliers, hyperspectral image, unmixing problem. F. Zhu is with the Institut Charles Delaunay (CNRS), Université de Technologie de Troyes, France. ([email protected]) A. Halimi is with the School of Engineering and Physical Sciences, Heriot-Watt University, U.K. ([email protected]) P. Honeine is with the LITIS lab, Université de Rouen, France. ([email protected]) Badong Chen and Nanning Zheng are with the Institute of Artificial Intelligence and Robotics, Xi’an Jiaotong University, Xi’an, China. (chenbd; [email protected]) 2 I. I NTRODUCTION S Pectral unmixing is an essential issue in many disciplines, including signal and image processing, with a wide range of applications, such as classification, segmentation, material identification and target detection. Typically, a hyperspectral image corresponds to a scene taken at many continuous and narrow bands across a certain wavelength range; namely, each pixel is a spectrum. Assuming that each spectrum is a mixture of several pure materials, the unmixing problem consists in two tasks: (i) identifying these pure materials (the so-called endmembers); (ii) estimating their proportions (the so-called abundances) at each pixel [1]. In practice, these two steps can be performed either sequentially or simultaneously [2]. Wellknown endmember extraction algorithms include the pure-pixel-based ones, e.g., the vertex component analysis (VCA) [3] and the N-FINDR [4], as well as the minimum-volume-based ones, e.g., the minimum simplex analysis [5] and the minimum volume constrained nonnegative matrix factorization [6]. While the endmember extraction is relatively easy from geometry, the abundance estimation remains an open problem. Indeed, the abundances can be estimated using least-squares methods, geometric approaches [2], or by tackling recently-raised issues such as nonlinearity [7], [8]. In this paper, we consider the abundance estimation problem. The linear mixture model (LMM) is the most investigated over the past decades [6], [9], [10]. Its underlying premise is that each pixel/spectrum is a linear combination of the endmembers. To be physically interpretable, two constraints are often enforced in the estimation problem: the abundance non-negativity constraint (ANC) and the abundance sum-to-one constraint (ASC) for each pixel [11]. Considering both constraints, the fully-constrained least-squares method (FCLS) was presented in [9]. A more recently proposed unmixing algorithm is the so-called SUnSAL, for Sparse Unmixing by variable Splitting and Augmented Lagrangian [12]. It addresses the same optimization problem by taking advantage of the alternating direction method of multipliers (ADMM) [13]. A constrained-version of SUnSAL was also proposed to solve the constrained sparse regression problem, where the sum-to-one constraint (ASC) is relaxed and the ℓ1 -norm regularizer is added. All these unmixing algorithms hugely suffer from noisy data and outliers within bands. Indeed, in real hyperspectral images for remote sensing, a considerable proportion (about 20%) of the spectral bands are noisy with low SNR, due to the atmospheric effect such as water absorption [14]. These bands need to be removed prior to applying any existing unmixing method; otherwise, the unmixing quality drastically decreases. Such sensitivity to outliers is due to the investigated ℓ2 -norm as a cost function in the FCLS and SUnSAL algorithms, as well as all unmixing algorithms that explore least-squares solutions. It is worth noting that nonlinear unmixing algorithms also suffer from this drawback, including the kernel-based fully-constrained least-squares (KFCLS) [15], nonlinear fluctuation methods [7] and post-nonlinear methods [16]. Information theoretic learning provides an elegant alternative to the conventional minimization of the ℓ2 -norm in least-squares 3 problems, by considering the maximization of the so-called correntropy [17], [18]. Due to its stability and robustness to noise and outliers, the correntropy maximization is based on theoretical foundations and has been successfully applied to a wide class of applications, including cancer clustering [19], face recognition [20], and recently hyperspectral unmixing [21], to name a few. In these works, the resulting problem is optimized by the half-quadratic technique [22], either in a supervised manner [20] or as an unsupervised nonnegative matrix factorization [19], [21]. In this paper, we consider the hyperspectral unmixing problem by defining an appropriate correntropy-based criterion, thus taking advantage of its robustness to large outliers, as opposed to the conventional ℓ2 -norm criteria. By including constraints commonly used for physical interpretation, we propose to solve the resulting constrained optimization problems with alternating direction method of multipliers (ADMM) algorithms. Indeed, the ADMM approach splits a hard problem into a sequence of small and handful ones [13]. Its relevance to solve nonconvex problems was studied in [13, Section 9]. We show that ADMM provides a relevant framework for incorporating different constraints raised in the unmixing problem. We present the socalled CUSAL (for Correntropy-based Unmixing by variable Splitting and Augmented Lagrangian), and study in particularly two algorithms: CUSAL-FC to solve the fully-constrained (ANC and ASC) correntropy-based unmixing problem, and the CUSAL-SP to solve the sparsity-promoting correntropy-based unmixing problem. The rest of the paper is organized as follows. We first provide a succinct survey on the classical unmixing problems in Section II. In Section III, we propose the correntropy-based unmixing problems subject to the aforementioned constraints, and study the robustness. The resulting optimization problems are solved by the ADMM algorithms described in Section IV. Experiments on synthetic and real hyperspectral images are presented in Sections V and VI, respectively. Finally, Section VII provides some conclusions and future works. II. C LASSICAL U NMIXING P ROBLEMS The linear mixture model (LMM) assumes that each spectrum can be expressed as a linear combination of a set of pure material spectra, termed endmembers [1]. Consider a hyperspectral image and let Y ∈ RL×T denote the matrix of the T pixels/spectra of L spectral bands. Let y ∗t be its t-th column and y l∗ its l-th row, representing the l-th band of all pixels. For notation simplicity, we denote y t = y ∗t , for t = 1, . . . , T . The LMM can be written as yt = R X xrt mr + nt = M xt + nt , (1) r=1 where M = [m1 · · · mR ] ∈ RL×R is the matrix composed by the R endmembers with mr = [m1r · · · mLr ]⊤ , xt = [x1t · · · xRt ]⊤ is the abundance vector associated with the t-th pixel, and nt ∈ RL is the additive noise. In matrix form for all pixels, we have Y = M X + N , where X = [x1 · · · xT ] ∈ RR×T and N is the noise matrix. 4 In the following, the endmembers are assumed known, either from ground-truth information or by using any endmember extraction technique. The spectral unmixing problem consists in estimating the abundances for each pixel, often by solving the least-squares optimization problem min kyt − M xt k22 , xt (2) for each t = 1, . . . , T , where k · k2 denotes the conventional ℓ2 -norm. The solution to this conventional least-squares problem is given by the pseudo-inverse of the (tall) endmember matrix, with xt = (M ⊤ M )−1 M ⊤ y t . The least-squares optimization problems (2), for all t = 1, . . . , T , are often written in a single optimization problem using the following matrix formulation min kY − M Xk2F , X (3) where k · k2F denotes the Frobenius norm. Its solution is X LS = (M ⊤ M )−1 M ⊤ Y . (4) Finally, this optimization problem can be also tackled by considering all the image pixels at each spectral band, which yields the following least-squares optimization problem min X L X l=1 ky l∗ − (M X)l∗ k22 , where (·)l∗ denotes the l-th row of its argument. While all these problem formulations have a closed-form solution, they suffer from two major drawbacks. The first one is that several constraints need to be imposed in order to have a physical meaning of the results. The second drawback is its sensitivity to noise and outliers, due to the use of the ℓ2 -norm as a fitness measure. These two drawbacks are detailed in the following. To be physically interpretable, the abundances should be nonnegative (ANC) and satisfy the sum-to-one constraint (ASC). Considering both constraints, the fully-constrained least-squares problem is formulated as, for each t = 1, . . . , T , min kyt − M xt k22 , subject to xt  0 and 1⊤ xt = 1, xt where 1 ∈ RR×1 denotes the column vector of ones and  0 is the non-negativity applied element-wise; In matrix form: min kY − M Xk2F , subject to X  0 X and 1⊤ xt = 1, for t = 1, . . . , T. Since there is no closed-form solution when dealing with the non-negativity constraint, several iterative techniques have been proposed, such as the active set scheme with the Lawson and Hanson’s algorithm [23], the multiplicative iterative strategies [24], and the fully-constrained least-squares (FCLS) technique [9]. More recently, the alternating direction method of multipliers (ADMM) was applied with success for hyperspectral unmixing problem, with the SUnSAL algorithm [12]. 5 Recent work in hyperspectral unmixing have advocated the sparsity of the abundance vectors [12], [25], [26]. In this case, each spectrum is fitted by a sparse linear mixture of endmembers, namely only the abundances with respect to a small number of endmembers are nonzero. To this end, the sparsity-promoting regularization with the ℓ1 -norm is included in the cost function, yielding the following constrained sparse regression problem [12], for each t = 1, . . . , T , min kyt − M xt k22 + λkxt k1 , subject to xt  0, xt where the parameter λ balances the fitness of the least-squares solution and the sparsity level. It is worth noting that the ASC is relaxed when the ℓ1 -norm is included. This problem is often considered by using the following matrix formulation min kY − M Xk2F + λ X T X t=1 kxt k1 , subject to X  0. Sensitivity to outliers All the aforementioned algorithms rely on solving a (constrained) least-squares optimization problem, thus inheriting the drawbacks of using the ℓ2 -norm as the fitness measure. A major drawback is its sensitivity to outliers, where outliers are some spectral bands that largely deviate from the rest of the bands. Indeed, considering all the image pixels, the least-squares optimization problems take the form min X L X l=1 ky l∗ − (M X)l∗ k22 , (5) subject to any of the aforementioned constraints. From this formulation, it is easy to see how the squared ℓ2 -norm gives more weight to large residuals, namely to outliers in which predicted values (M X)l∗ are far from actual observations y l∗ . Moreover, it is common for hyperspectral images to present up to 20% of unusable spectral bands due to low signal-to-noise ratio essentially from atmospheric effects, such as water absorption. In the following section, we overcome this difficulty by considering the correntropy maximization principle from the information theoretic learning, which yields an optimization problem that is robust to outliers. III. C ORRENTROPY- BASED U NMIXING P ROBLEMS In this section, we examine the correntropy and write the unmixing problems as correntropy maximization ones. Algorithms for solving these problems are derived in Section IV. A. Correntropy The correntropy, studied in [17], [18], is a nonlinear local similarity measure. For two random variables, Y and its estimation Yb using some model/algorithm, it is defined by b IE[κ(Y, Y)], (6) 6 where IE[·] is the expectation operator, and κ(·, ·) is a shift-invariant kernel satisfying the Mercer theorem [27]. In practice, while the joint distribution function of Y and Yb is unavailable, the sample estimator of correntropy is adopted instead. Employing a b l∗ )}L finite number of data {(y l∗ , y l=1 , it is estimated by L 1X b l∗ ), κ(y l∗ , y L (7) l=1 up to a normalization factor. The Gaussian kernel is the most commonly-used kernel for correntropy [17], [20], [28]. This leads to the following expression for the correntropy L 1X exp L l=1 −1 2σ2 ky l∗ where σ denotes the bandwidth of the Gaussian kernel.  b l∗ k22 , −y (8) The maximization of the correntropy, given by L max b1∗ ,...,b y yL∗ 1X b l∗ ), κ(y l∗ , y L l=1 is termed the maximum correntropy criterion [17]. It is noteworthy that well-known second-order statistics, such as the mean square error (MSE) depends heavily on the Gaussian and linear assumptions [17]. However, in presence of non-Gaussian noise and in particular large outliers, i.e., observations greatly deviated from the data bulk, the effectiveness of the MSE-based algorithms will significantly deteriorate [29]. By contrast, the maximization of the correntropy criterion is appropriate for non-Gaussian signal processing, and is robust in particular against large outliers, as shown next. B. The underlying robustness of the correntropy criterion In this section, we study the sensitivity to outliers of the correntropy maximization principle, by showing the robustness of the underlying mechanism. To this end, we examine the behavior of the correntropy in terms of the residual error defined by bl∗ k2 . Thus, the correntropy (8) becomes ǫl = ky l∗ − y L 1X exp L l=1 −1 2 2σ2 ǫl  . Compared with second-order statistics, e.g. MSE, the correntropy is more robust with respect to the outliers, as shown in Fig. 1 illustrating the second-order and the correntropy objective functions in terms of the residual error. As the residual error increases, the second-order function keeps increasing dramatically. On the contrary, the correntropy is only sensitive within a region of small residual errors, this region being controlled by the kernel bandwidth. For large magnitudes of residual error, the correntropy falls to zero. Consequently, the correntropy criterion is robust to large outliers. 7 1.5 second-order function correntropy (σ = 0.5) correntropy (σ = 2) correntropy (σ = 5) 1 0.5 0 1 2 3 4 5 6 residual error Fig. 1. Illustration of second-order objective function (solid line) and the correntropy objective function (dashed lines) with different values of the kernel bandwidth. C. Correntropy-based unmixing problems The correntropy-based unmixing problem consists in estimating the unknown abundance matrix X, by minimizing the objective function C (the negative of correntropy), given by C(X) = − L X exp l=1 −1 2σ2 ky l∗  − (M X)l∗ k22 , (9) where the Gaussian kernel was considered, or equivalently C(X) = − L X exp −1 2σ2 T  X t=1 l=1 ylt − R X r=1 xrt ml r 2 ! . (10) Considering both the ANC and ASC constraints, the fully-constrained correntropy unmixing problem becomes min C(X), subject to X  0 X (11) ⊤ and 1 xt = 1, for t = 1, . . . , T. For the sake of promoting sparse representations, the objective function (9)-(10) can be augmented by the ℓ1 -norm penalty on the abundance matrix X, leading to the following problem min C(X) + λ X T X t=1 kxt k1 , subject to X  0. (12) 8 IV. ADMM FOR S OLVING THE C ORRENTROPY- BASED U NMIXING P ROBLEMS We first briefly review the alternating direction method of multipliers (ADMM), following the expressions in [13, Chap. 3]. Consider an optimization problem of the form min f (x) + g(x), x where the functions f and g are closed, proper and convex. The ADMM solves the equivalent constrained problem min f (x) + g(z) subject to Ax + Bz = c, (13) x,z such as having the particular constraint x = z for instance. While this formulation may seem trivial, the optimization problem can now be tackled using the augmented Lagrangian method where the objective function is separable in x and z. By alternating on each variable separately, the ADMM repeats a direct update of the dual variable. In its scaled form, the ADMM algorithm is summarized in Algorithm 1. Algorithm 1 The ADMM algorithm [13] Input: functions f and g, matrices A and B, vector c, parameter ρ 1: Initialize k = 0, x0 , z 0 and u0 2: repeat 3: xk+1 = arg minx f (x) + ρ2 kAx + Bz k − c + uk k22 ; 4: z k+1 = arg minz g(z) + ρ2 kAxk+1 + Bz − c + uk k22 ; 5: uk+1 = uk + Axk+1 + Bz k+1 − c; 6: k = k + 1; 7: until stopping criterion A. Correntropy-based unmixing with full-constraints In the following, we apply the ADMM algorithm to solve the correntropy-based unmixing problem in the fully-constrained case, presented in (11). The main steps are summarized in Algorithm 2. Rewrite the variables to be optimized in a vector ⊤ ⊤ x ∈ RRT ×1 , which is stacked by the columns of the matrix X, namely x = [x⊤ 1 · · · xT ] . Rewrite also the following vectors ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ in RRT ×1 : z = [z ⊤ 1 · · · z T ] and u = [u1 · · · uT ] , where, for t = 1, . . . , T , z t = [z1t · · · zRt ] and ut = [u1t · · · uRt ] . 9 By following the formulation of the ADMM in Algorithm 1, we set f (x) = C(x) + T X ι{1} (1⊤ xt ) (14) t=1 g(z) = ιRRT (z) + A = −I, B = I and c = 0, where I is the identity matrix, 0 ∈ RRT ×1 is the zero vector and ιS (u) is the indicator function of the set S defined by     0 if u ∈ S; ιS (u) =    ∞ otherwise. In this case, the subproblem of the x-update (in line 3 of Algorithm 1) addresses a nonconvex problem without any closed- form solution. To overcome this difficulty, we apply an inexact ADMM variant in lines 3-5 of Algorithm 2, which solves the subproblem iteratively using the gradient descent method, instead of solving it exactly and explicitly. Before that, we eliminate the T equality constraints, i.e., the sum-to-one constraints, by replacing xRt with xRt = 1 − R−1 X xrt , r=1 for t = 1, . . . , T . Let x ∈ R(R−1)T ×1 be the reduced vector of (R − 1) unknowns to be estimated, stacked by  ⊤ xt = x1t · · · x(R−1)t , for t = 1, . . . , T . By this means, the objective function in (14) is transformed from (10) into the reduced-form ! L T X −1 X f1 (x) = − exp ǫl (xt )2 , 2σ 2 t=1 (15) l=1 where ǫl (xt ) = ylt − mlR − where ∂f1 ∂xt = h ∂f1 ∂x1t ··· PR−1 p=1 ∂f1 ∂x(R−1)t (mlp − mlR )xpt , for l = 1, . . . , L. The gradient of (15) with respect to x is stacked as #⊤ " ∂f1 ∂f1 ⊤ ∂f1 ⊤ ∈ R(R−1)T ×1 , ··· = ∂x ∂x1 ∂xT i⊤ , with the entries given by L T   X ∂f1 (x) 1 X −1 = σ2 (mlR − mlr ) exp 2σ ǫl (xs )2 ǫl (xt ), 2 ∂xrt s=1 l=1 for all r = 1, . . . , (R − 1) and t = 1, . . . , T . Similarly, the function ρ2 kx − z k − uk k22 is expressed with respect to x as φ(x) = with the entries in its gradient T R−1 2 R−1 X ρ X X 2 1− xpt − zRt,k − uRt,k + (xpt − zpt,k − upt,k ) 2 t=1 p=1 p=1 ∂φ ∂x given by R−1   X ∂φ(x) = ρ xrt + xpt − 1 + zRt,k − zrt,k + uRt,k − urt,k , ∂xrt p=1 (16) 10 for all r = 1, . . . , R − 1 and t = 1, . . . , T . The solution of the z-update in line 4 Algorithm 1 becomes the projection of xk+1 − uk onto the first orthant, as shown in line 7 of Algorithm 2. Algorithm 2 Correntropy-based unmixing with full-constraints (CUSAL-FC) 1: Initialize k = 0, ρ > 0, η > 0, σ > 0; x0 , z 0 and u0 ; 2: 3: 4: repeat repeat 1 + xk+1 = xk+1 − η( ∂x∂fk+1 5: until convergence 6: reform xk+1 using xk+1 ; 7: z k+1 = max(0, xk+1 − uk ); 8: uk+1 = uk − (xk+1 − z k+1 ); 9: k = k + 1; 10: ∂φ ∂xk+1 ); until stopping criterion B. Sparsity-promoting unmixing algorithm In order to apply the ADMM algorithm, we express the constrained optimization problem (12) as follows f (x) = C(x) (17) g(x) = ιRRT (x) + λkxk1 + A = −I, B = I and c = 0. By analogy with the previous case, the x-update in line 3 of Algorithm 1 is solved iteratively with the gradient descent method and is given in Algorithm 3 lines 3-5. The gradient of (17) with respect to xis stacked by ! L T ∂f 1 X −1 X 2 =− 2 ǫl (xt ) exp (ǫl (xs )) m⊤ l , ∂xt σ 2σ 2 s=1 ∂f ∂xt , where l=1 for t = 1, . . . , T , where ǫl (xt ) = ylt − PR r=1 xrt mlr . The z-update in line 4 Algorithm 1 involves solving 1 z k+1 = arg min ιRRT (z) + (λ/ρ)kzk1 + kz − xk+1 − uk k22 . + z 2 (18) In [13], the ADMM has been applied to solve various ℓ1 -norm problems, including the well-known LASSO [30]. The only difference between (18) and the z-update in LASSO is that in the latter, no non-negativity term ιR+RT (z) is enforced. In this 11 case, the z-update in LASSO is the element-wise soft thresholding operation z k+1 = Sλ/ρ (xk+1 − uk ), where the soft thresholding operator [13] is defined by     ζ −b     Sb (ζ) = 0       ζ + b if ζ > b; if kζk < b; if ζ < −b. Following [12], it is straightforward to project the result onto the nonnegative orthant in order to include the non-negativity constraint, thus yielding z k+1 = max(0, Sλ/ρ (xk+1 − uk )), where the maximum function is element-wise. All these results lead to the correntropy-based unmixing algorithm with sparsitypromoting, as summarized in Algorithm 3. Algorithm 3 Correntropy-based unmixing with sparsity-promoting (CUSAL-SP)) 1: Initialize k = 0, ρ > 0, σ > 0, η > 0, λ > 0; x0 , z 0 and u0 ; 2: 3: 4: repeat repeat xk+1 = xk+1 − η ∂f ∂xk+1  + ρ(xk+1 − z k − uk ) ; 5: until convergence 6: z k+1 = max(0, Sλ/ρ (xk+1 − uk )); 7: uk+1 = uk − (xk+1 − z k+1 ); 8: k = k + 1; 9: until stopping criterion C. On the initialisation and the bandwidth determination We apply a three-fold stopping criterion for Algorithms 2 and 3, according to [13], [12]: (i) the primal and dual residuals are small enough, namely kxk+1 − z k+1 k2 ≤ ǫ1 and ρkz k+1 − z k k2 ≤ ǫ2 , where ǫ1 = ǫ2 = √ RT × 10−5 as in [12], (ii) the primal residual starts to increase, i.e., kxk+1 − z k+1 k2 > kxk − z k k2 , or (iii) the maximum iteration number is attained. The bandwidth σ in the Gaussian kernel should be well-tuned. Note that a small value for this parameter punishes harder the outlier bands, thus increasing the robustness of the algorithm to outliers [20]. Note that, in this study, the ADMM is applied to 12 address a nonconvex objective function, thus no convergence is guaranteed theoretically, according to [13]. Considering these issues, we propose to fix the bandwidth empirically as summarized in Algorithm 4 and described next. Following [20], [21], we first initialize the bandwidth parameter as a function of the reconstruction error, given by σ02 = R kY − M X LS k2F , 8L (19) where X LS is the least-squares solution (4). In the case of a result too apart from that of least-squares solution, the parameter is augmented by σ = 1.2σ, until that the condition kY −M XkF kY −M X LS kF < 2 is satisfied. The algorithm divergence occurs if the stopping criterion (ii) is satisfied, namely the primal residual increases over iterations. In this case, either the parameter is too large due to an overestimated initialization, or it is too small. Accordingly, we either decrease it by σ = σ0 /p, or increase it by σ = 1.2σ, until that the ADMM converges. Algorithm 4 Tuning the bandwidth parameter σ 1: Initialize σ = σ0 using (19); p = 1; 2: Do CUSAL with Algorithm 2 or Algorithm 3; 3: if stopping criterion (i) or (iii) is satisfied then 4: if condition else increase σ = 1.2σ, and go to line 2 7: 8: 9: 10: < 2 is satisfied, then σ ∗ = σ (optimal value) 5: 6: kY −MXk2 kY −M X LS k2 end if else if σ > 1000σ0 (due to the overestimated σ0 ) then 11: p = p + 1; 12: decrease σ = σ0 /p, and go to line 2 13: 14: 15: 16: else increase σ = 1.2σ, and go to line 2 end if end if 13 V. E XPERIMENTS WITH S YNTHETIC DATA In this section, the performance of the proposed fully-constrained (CUSAL-FC) and sparsity-promoting (CUSAL-SP) algorithms is evaluated on synthetic data. A comparative study is performed considering six state-of-the-art methods proposed for linear and nonlinear unmixing models. • Fully-Constrained Least-Squares (FCLS) [9]: The FCLS is developed for the linear model. Enforcing both ANC and ASC constraints, this technique yields the optimal abundance matrix in the least-squares sense. • Sparse Unmixing by variable Splitting and Augmented Lagrangian (SUnSAL) [12]: This method is based on the ADMM. Several variants are developed by including different constraints, with the fully-constrained SUnSAL-FCLS and the sparsity-promoting SUnSAL-sparse. • The Bayesian algorithm for Generalized Bilinear Model (BayGBM) [31], [32]: This method estimates the abundances with the generalized bilinear model (GBM), which adds second-order interactions between endmembers to the linear model, yielding the model y t = M xt + R−1 X R X i=1 j=i+1 γij,t xit xjt (mi ⊙ mj ) + nt , where 0 ≤ γij,t ≤ 1 controls the interactions between endmembers mi and mj , and ⊙ is the element-wise product. The BayGBM considers both ANC and ASC. • The Bayesian algorithm for Polynomial Post-Nonlinear Mixing Model (BayPPNMM) [33]: This algorithm estimates the parameters by assuming that the pixel reflectances are nonlinear functions of endmembers using y t = M xt + bt (M xt ) ⊙ (M xt ) + nt , (20) where the nonlinear terms are characterized by bt ∈ R, and both ANC and ASC are required. • Kernel Fully-Constrained Least-Squares (KFCLS) [15]: This method generalizes FCLS, by replacing the inner product with a kernel function. In the following, the Gaussian kernel is applied for simulation. • Robust nonnegative matrix factorization (rNMF) [34]: To capture the nonlinear effect (outliers), this NMF-based method introduces a group-sparse regularization term into the linear model. Accounting for both constraints, the problem is optimized by a block-coordinate descent strategy. For fair comparison in this paper, the endmembers are fixed with the real ones. The regularization parameter is set with the degree of sparsity as suggested in [33]. We first compare the fully-constrained CUSAL-FC, presented in IV-A, with the state-of-the-art methods. A series of experiments are performed, mainly considering the influences of four aspects: (i) mixture model, (ii) noise level, (iii) number of corrupted bands and (iv) number of endmembers. 14 0.9 1 0.8 0.9 0.8 0.7 0.7 Reflectance Reflectance 0.6 0.5 0.4 0.3 0.4 0.2 0.1 0.1 0 50 100 150 200 Bands Fig. 2. 0.5 0.3 0.2 0 0.6 0 0 50 100 150 200 Bands The R = 3 (left) and 6 (right) USGS signatures chosen for simulation. Each image, of 50 × 50 pixels, is generated using either the linear mixing model (1) or the polynomial post-nonlinear mixing model (PPNMM) (20), where nt is a Gaussian noise of SNR ∈ {15, 35}dB. The R ∈ {3, 6} endmembers, as shown in Fig. 2, are drawn from the USGS digital spectral library [35]. These endmembers are defined over L = 244 continuous bands with the wavelength ranging from 0.2µm to 3.0µm. The abundance vectors xt are uniformly generated using a Dirichlet distribution as in [35], [36]. For PPNMM, the values of bt are generated uniformly in the set (−3, 3) according to [33]. To imitate the noisy bands in the real hyperspectral images, several bands in the generated data are corrupted by replacing the corresponding rows of Y with random values within [0, 1]. The number of corrupted bands varies in the set {0, 20, 40, 60}. The unmixing performance is evaluated using the abundance root mean square error (RMSE) [31], [37], defined by v u T u 1 X b t k2 , kxt − x RMSE = t RT t=1 b t is the estimated abundance vector. Fig. 3 and 4 illustrates the average of RMSE over 10 Monte-Carlo realizations, where x respectively on the LMM and PPNMM data. It is easy to see that, in presence of outlier bands, the proposed CUSAL-FC algorithm outperforms all the comparing methods in terms of RMSE, for different mixture models, noise levels and numbers of endmembers. It is also shown that the performance of the proposed algorithm improves when increasing the SNR. The performance of the proposed the sparsity-promoting CUSAL-SP, presented in IV-B, is compared with the sparsitypromoting SUnSAL-sparse, as well as the FCLS, on a series of data with sparse abundance matrices. The influences of (i) the number of corrupted bands and (ii) the sparsity level of the abundances, are studied. Each image, of 15 × 15 pixels, is generated by the linear mixture model. The endmember matrix is composed by R = 62 USGS signatures, where the angle between any two different endmembers is larger than 10◦ [25]. The K nonzero entries in each abundance vector xt are generated by a Dirichlet distribution. The value of K (i.e., the indicator of sparsity level) ranges from 4 to 20, while the number of 15 0.18 0.14 0.12 0.1 0.09 RMSE 0.16 RMSE 0.11 CUSAL-FC SUnSAL-FCLS FCLS BayGBM BayPPNMM KFCLS rNMF 0.1 0.08 0.07 0.08 0.06 0.06 0.04 0 20 40 0.05 60 0 20 Number of corrupted bands 40 60 Number of corrupted bands (a) SNR = 15, R = 3 (b) SNR = 15, R = 6 0.12 0.16 0.1 0.14 0.12 RMSE RMSE 0.08 0.1 0.08 0.06 0.06 0.04 0.04 0.02 0.02 0 Fig. 3. 0 20 40 0 60 0 20 40 Number of corrupted bands Number of corrupted bands (c) SNR = 35, R = 3 (d) SNR = 35, R = 6 60 LMM data: The root mean square error (RMSE) with respect to the number of corrupted bands, averaged over ten Monte-Carlo realizations, for different number of endmembers and SNR. corrupted bands varies in {0, 20, 40, 60}. We set the Gaussian noise by SNR = 30dB, a level that that is commonly present in real hyperspectral images according to [25]. For both sparsity-promoting algorithms, the regularization parameter λ is adjusted using the set {10−5 , 5 · 10−5 , 10−4 , 5 · 10−4 , 10−3 , 10−2 , 10−1 }. The unmixing performance with the sparsity-promoting algorithms is evaluated using the signal-to-reconstruction error, measured in decibels, according to [12], [25]. It is defined by SRE = 10 log10 PT PT t=1 t=1 kxt k22 b t k22 kxt − x ! . The results, averaged over ten Monte-Carlo realizations, are illustrated in Fig. 5. Considering that the abundance matrix under estimation is sparse at different levels, we conclude the following: Concerning the case without outlier bands, the CUSAL-SP outperforms the SUnSAL-SAL for K > 8 and FCLS for K > 12. When the number of outlier bands is increases, the proposed CUSAL-SP algorithm generally provides the best unmixing quality with the highest SRE value, especially for K > 6. 16 0.18 0.14 0.12 0.1 0.09 RMSE 0.16 RMSE 0.11 CUSAL-FC SUnSAL-FCLS FCLS BayGBM BayPPNMM KFCLS rNMF 0.1 0.08 0.07 0.08 0.06 0.06 0.04 0 20 40 0.05 60 0 Number of corrupted bands 20 40 60 Number of corrupted bands (b) SNR = 15, R = 6 (a) SNR = 15, R = 3 0.2 0.12 0.18 0.1 0.16 0.08 0.12 RMSE RMSE 0.14 0.1 0.06 0.08 0.04 0.06 0.04 0.02 0.02 0 Fig. 4. 0 20 40 0 60 0 20 40 Number of corrupted bands Number of corrupted bands (c) SNR = 35, R = 3 (d) SNR = 35, R = 6 60 PPNMM data: The root mean square error (RMSE) with respect to the number of corrupted bands, averaged over ten Monte-Carlo realizations, for different number of endmembers and SNR. VI. E XPERIMENTS WITH R EAL DATA This section presents the performance of the proposed algorithms on a real hyperspectral image. We consider a 250 × 190 sub-image taken from the Cuprite mining image, acquired by the AVIRIS sensor when flying over Las Vegas, Nevada, USA. The image has been widely investigated in the literature [7], [25]. The raw data contains L = 224 bands, covering a wavelength range 0.4 − 2.5µm. Among, there are 37 relatively noisy ones with low SNR, namely the bands 1 − 3, 105 − 115, 150 − 170, and 223 − 224. The geographic composition of this area is estimated to include up to 14 minerals [3]. Neglecting the similar signatures, we consider 12 endmembers as often investigated in the literature [7], [38]. The VCA technique is first applied to extract these endmembers on the clean image with L = 187 bands. Starting from L = 187 bands, the noisy bands, randomly chosen from the bands 1 − 3, 105 − 115, 150 − 170, and 223 − 224, are gradually included to form a series of input data. Therefore, the experiments are conducted with L = 187, 193, 199, 205, 211, 217, 223 and 224 bands. 17 3.5 CUSAL-SP 9 SUnSAL-sparse 3 FCLS 7 SRE(dB) SRE(dB) 8 6 2.5 2 5 1.5 4 1 3 4 6 8 10 12 14 16 18 0.5 20 4 6 8 10 K 12 14 16 18 20 16 18 20 K (a) 0 corrupted band (b) 20 corrupted bands 2 1.6 1.5 1.3 1 SRE(dB) SRE(dB) 1.9 1 0.7 0.5 0 0.4 −0.5 0.1 −0.2 4 6 8 10 12 14 16 18 20 −1 4 6 K 10 12 14 K (c) 40 corrupted bands Fig. 5. 8 (d) 60 corrupted bands LMM data: The averaged signal-to-reconstruction error (SRE) with respect to the sparsity level K, averaged over ten Monte-Carlo realizations. Comparison for various number of corrupted bands at SNR = 30. Since ground-truth abundances are unknown, the performance is measured with the averaged spectral angle distance (SAD) b t , as illustrated in Fig. 6, where the SAD is defined by between the input spectra y t and the reconstructed ones y T 1 X SAD = arccos T t=1 ! bt y⊤ t y . ky t kkb yt k The estimated abundance maps using 187, 205 and 224 bands are given in Fig. 7, Fig. 8, and Fig. 9, respectively. In absence of noisy bands (i.e., L = 187 bands), all the considered methods lead to satisfactory abundance maps, with BayPPNMM providing the smallest SAD. As the number of noisy bands increases, especially from L = 199 to L = 224, the unmixing performance of the state-of-the-art methods deteriorates drastically, while the proposed CUSAL yields stable SAD. The obtained results confirm the good behavior of the proposed CUSAL algorithms and their robustness in presence of corrupted spectral bands. 18 7 6.5 6 5.5 SAD 5 CUSAL-FC SUnSAL−FCLS FCLS BayGBM BayPPNMM KFCLS rNMF 4.5 4 3.5 3 2.5 2 187 Fig. 6. 193 199 205 211 Number of bands 217 224 Cuprite image: The averaged spectral angle distance (SAD) using different number of bands, computed without the noisy bands 1 − 3, 105 − 115, 150 − 170, and 223 − 224. VII. C ONCLUSION This paper presented a supervised unmixing algorithm based on the correntropy maximization principle. Two correntropybased unmixing problems were addressed, the first with the non-negativity and sum-to-one constraints, and the second with the non-negativity constraint and a sparsity-promoting term. The alternating direction method of multipliers (ADMM) was investigated in order to solve the correntropy-based unmixing problems. The effectiveness and robustness of the proposed unmixing method were validated on synthetic and real hyperspectral images. Future works include the generalization of the correntropy criterion to account for the multiple reflection phenomenon [31], [39], as well as incorporating nonlinear models [40]. ACKNOWLEDGMENT This work was supported by the French ANR, grant HYPANEMA: ANR-12BS03-0033. 19 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 Fig. 7. Cuprite image: Estimated abundance maps using 187 clean bands. Left to right: sphene, alunite, buddingtonite, kaolinite, chalcedony, highway. Top to bottom: SUnSAL-FCLS, FCLS, BayGBM, BayPPNMM, KFCLS, rNMF, CUSAL-FC. 20 1 0.8 0.6 0.4 0.2 10 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 Fig. 8. Cuprite image: Estimated abundance maps using 205 bands, with 187 clean bands. Same legend as Fig. 7. 21 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 1 0.8 0.6 0.4 0.2 0 Fig. 9. Cuprite image: Estimated abundance maps using all the 224 bands, with 187 clean bands. Same legend as Fig. 7. 22 R EFERENCES [1] N. Keshava and J. F. Mustard, “Spectral unmixing,” IEEE Signal Processing Magazine, vol. 19, no. 1, pp. 44–57, Jan 2002. [2] P. Honeine and C. Richard, “Geometric unmixing of large hyperspectral images: a barycentric coordinate approach,” IEEE Transactions on Geoscience and Remote Sensing, vol. 50, no. 6, pp. 2185–2195, Jun. 2012. [3] J. Nascimento and J. M. Bioucas-Dias, “Vertex component analysis: a fast algorithm to unmix hyperspectral data,” IEEE Transactions on Geoscience and Remote Sensing, vol. 43, no. 4, pp. 898–910, Apr. 2005. [4] M. Winter, “N-FINDR: an algorithm for fast autonomous spectral end-member determination in hyperspectral data: an algorithm for fast autonomous spectral end-member determination in hyperspectral data,” Proc. of SPIE: Imaging Spectrometry V, vol. 3753, no. 10, 1999. [5] J. Li, A. Agathos, D. Zaharie, J. Bioucas-Dias, A. Plaza, and X. Li, “Minimum volume simplex analysis: A fast algorithm for linear hyperspectral unmixing,” IEEE Transactions on Geoscience and Remote Sensing, vol. 53, no. 9, pp. 5067–5082, Sept 2015. [6] L. Miao and H. Qi, “Endmember extraction from highly mixed data using minimum volume constrained nonnegative matrix factorization,” IEEE Transactions on Geoscience and Remote Sensing, vol. 45, no. 3, pp. 765–777, March 2007. [7] J. Chen, C. Richard, and P. Honeine, “Nonlinear unmixing of hyperspectral data based on a linear-mixture/nonlinear-fluctuation model,” IEEE Transactions on Signal Processing, vol. 61, no. 2, pp. 480–492, Jan. 2013. [8] ——, “Nonlinear estimation of material abundances of hyperspectral images with ℓ1 -norm spatial regularization,” IEEE Transactions on Geoscience and Remote Sensing, vol. 52, no. 5, pp. 2654–2665, May 2014. [9] D. Heinz and C. Chang, “Fully constrained least squares linear spectral mixture analysis method for material quantification in hyperspectral imagery,” IEEE Transactions on Geoscience and Remote Sensing, vol. 39, no. 3, pp. 529–545, Mar. 2001. [10] A. Huck, M. Guillaume, and J. Blanc-Talon, “Minimum dispersion constrained nonnegative matrix factorization to unmix hyperspectral data,” IEEE Transactions on Geoscience and Remote Sensing, vol. 48, no. 6, pp. 2590–2602, Jun. 2010. [11] J. M. Bioucas-Dias, A. Plaza, N. Dobigeon, M. Parente, Q. Du, P. Gader, and J. Chanussot, “Hyperspectral unmixing overview: Geometrical, statistical, and sparse regression-based approaches,” IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 5, no. 2, pp. 354–379, 2012. [12] J. M. Bioucas-Dias and M. A. Figueiredo, “Alternating direction algorithms for constrained sparse regression: Application to hyperspectral unmixing,” in IEEE Workshop on Hyperspectral Image and Signal Processing: Evolution in Remote Sensing (WHISPERS), 2010, pp. 1–4. [13] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Eckstein, “Distributed optimization and statistical learning via the alternating direction method of multipliers,” Foundations and Trends R in Machine Learning, vol. 3, no. 1, pp. 1–122, 2011. [14] A. Zelinski and V. Goyal, “Denoising hyperspectral imagery and recovering junk bands using wavelets and sparse approximation,” in IEEE International Conference on Geoscience and Remote Sensing Symposium (IGARSS), July 2006, pp. 387–390. [15] J. Broadwater, R. Chellappa, A. Banerjee, and P. Burlina, “Kernel fully constrained least squares abundance estimates,” in IEEE International Geoscience and Remote Sensing Symposium (IGARSS), 2007, pp. 4041–4044. [16] J. Chen, C. Richard, and P. Honeine, “Estimating abundance fractions of materials in hyperspectral images by fitting a post-nonlinear mixing model,” in Proc. IEEE Workshop on Hyperspectral Image and Signal Processing : Evolution in Remote Sensing, Jun. 2013. [17] W. Liu, P. Pokharel, and J. C. Prı́ncipe, “Correntropy: properties and applications in non-gaussian signal processing,” IEEE Transactions on Signal Processing, vol. 55, no. 11, pp. 5286–5298, 2007. [18] J. C. Principe, Information theoretic learning: Renyi’s entropy and kernel perspectives. Springer Science & Business Media, 2010. [19] J. J. Wang, X. Wang, and X. Gao, “Non-negative matrix factorization by maximizing correntropy for cancer clustering,” BMC bioinformatics, vol. 14, no. 1, p. 107, 2013. 23 [20] R. He, W. Zheng, and B. Hu, “Maximum correntropy criterion for robust face recognition,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 33, no. 8, pp. 1561–1576, 2011. [21] Y. Wang, C. Pan, S. Xiang, and F. Zhu, “Robust hyperspectral unmixing with correntropy-based metric,” IEEE Transactions on Image Processing, vol. 24, no. 11, pp. 4027–4040, Nov 2015. [22] M. Nikolova and M. Ng, “Analysis of half-quadratic minimization methods for signal and image recovery,” SIAM Journal on Scientific computing, vol. 27, no. 3, pp. 937–966, 2005. [23] C. L. Lawson and R. J. Hanson, Solving Least Squares Problems (Classics in Applied Mathematics). Society for Industrial Mathematics, 1987. [24] H. Lantéri, M. Roche, O. Cuevas, and C. Aime, “A general method to devise maximum-likelihood signal restoration multiplicative algorithms with non-negativity constraints,” Signal Processing, vol. 81, pp. 945–974, May 2001. [25] M. D. Iordache, J. M. Bioucas-Dias, and A. Plaza, “Sparse unmixing of hyperspectral data,” IEEE Transactions on Geoscience and Remote Sensing, vol. 49, no. 6, pp. 2014–2039, June 2011. [26] ——, “Total variation spatial regularization for sparse hyperspectral unmixing,” IEEE Transactions on Geoscience and Remote Sensing, vol. 50, no. 11, pp. 4484–4502, Nov. 2012. [27] V. Vapnik, The Nature of Statistical Learning Theory. New York, NY, USA: Springer-Verlag, 1995. [28] B. Chen and J. C. Prı́ncipe, “Maximum correntropy estimation is a smoothed map estimation,” IEEE Signal Processing Letters, vol. 19, no. 8, pp. 491–494, 2012. [29] Z. Wu, S. Peng, B. Chen, and H. Zhao, “Robust hammerstein adaptive filtering under maximum correntropy criterion,” Entropy, vol. 17, no. 10, p. 7149, 2015. [30] R. Tibshirani, “Regression shrinkage and selection via the lasso,” Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996. [31] A. Halimi, Y. Altmann, N. Dobigeon, and J. Y. Tourneret, “Nonlinear unmixing of hyperspectral images using a generalized bilinear model,” IEEE Transactions on Geoscience and Remote Sensing, vol. 49, no. 11, pp. 4153–4162, Nov. 2011. [32] ——, “Unmixing hyperspectral images using the generalized bilinear model.” in IEEE International Conference on Geoscience and Remote Sensing Symposium (IGARSS), 2011, pp. 1886–1889. [33] Y. Altmann, A. Halimi, N. Dobigeon, and J. Y. Tourneret, “Supervised nonlinear spectral unmixing using a postnonlinear mixing model for hyperspectral imagery,” IEEE Transactions on Image Processing, vol. 21, no. 6, pp. 3017–3025, 2012. [34] C. Fevotte and N. Dobigeon, “Nonlinear hyperspectral unmixing with robust nonnegative matrix factorization,” IEEE Transactions on Image Processing, vol. 24, no. 12, pp. 4810–4819, Dec 2015. [35] J. M. Bioucas-Dias and J. M. P. Nascimento, “Hyperspectral subspace identification,” IEEE Transactions on Geoscience and Remote Sensing, vol. 46, no. 8, pp. 2435–2445, Aug 2008. [36] A. Halimi, N. Dobigeon, and J.-Y. Tourneret, “Unsupervised unmixing of hyperspectral images accounting for endmember variability,” IEEE Transactions on Image Processing, vol. 24, no. 12, pp. 4904–4917, december 2015. [37] N. Yokoya, J. Chanussot, and A. Iwasaki, “Nonlinear unmixing of hyperspectral data using semi-nonnegative matrix factorization,” IEEE Transactions on Geoscience and Remote Sensing, vol. 52, no. 2, pp. 1430–1437, Feb. 2014. [38] X. Lu, H. Wu, Y. Yuan, P. Yan, and X. Li, “Manifold regularized sparse nmf for hyperspectral unmixing,” IEEE Transactions on Geoscience and Remote Sensing, vol. 51, no. 5, pp. 2815–2826, 2013. [39] W. Fan, B. Hu, J. Miller, and M. Li, “Comparative study between a new nonlinear model and common linear model for analysing laboratory simulatedforest hyperspectral data,” International Journal of Remote Sensing, vol. 30, no. 11, pp. 2951–2962, 2009. [40] A. Halimi, P. Honeine, and J. Bioucas-Dias, “Hyperspectral unmixing in presence of endmember variability, nonlinearity or mismodelling effects,” http://arxiv.org/abs/1511.05698, pp. 1–32, Nov. 2015.
9cs.NE
arXiv:1502.04893v3 [math.CO] 10 Sep 2015 DETECTING BINOMIALITY CARSTEN CONRADI AND THOMAS KAHLE Abstract. Binomial ideals are special polynomial ideals with many algorithmically and theoretically nice properties. We discuss the problem of deciding if a given polynomial ideal is binomial. While the methods are general, our main motivation and source of examples is the simplification of steady state equations of chemical reaction networks. For homogeneous ideals we give an efficient, Gröbner-free algorithm for binomiality detection, based on linear algebra only. On inhomogeneous input the algorithm can only give a sufficient condition for binomiality. As a remedy we construct a heuristic toolbox that can lead to simplifications even if the given ideal is not binomial. Contents 1. Introduction 2. Gröbner-free criteria for binomiality 3. The homogeneous case 4. Heuristics for the inhomogeneous case References 1 4 7 10 15 1. Introduction Non-linear algebra is a mainstay in modern applied mathematics and across the sciences. Very often non-linearity comes in the form of polynomial equations which are much more flexible than linear equations in modeling complex phenomena. The price to be paid is that their mathematical theory—commutative algebra and algebraic geometry—is much more involved than linear algebra. Fortunately, polynomial systems in applications often have special structures. In this paper we focus on sparsity, that is, polynomials having few terms. The sparsest polynomials are monomials. Systems of monomial equations are a big topic in algebraic combinatorics, but in the view of modeling they are not much help. Date: August 2015. 2010 Mathematics Subject Classification. Primary: 13P15, 37N25; Secondary: 92C42, 13P25, 13P10. Key words and phrases. polynomial systems in biology, binomial ideal, steady states, chemical reaction networks. The authors are supported by the research focus dynamical systems of the state Saxony-Anhalt. 1 2 CARSTEN CONRADI AND THOMAS KAHLE Their solution sets are unions of coordinate hyperplanes. The next and more interesting class are binomial systems in which each polynomial is allowed to have two terms. Binomials are flexible enough to model many interesting phenomena, but sparse enough to allow a specialized theory [8]. The strongest classical results about binomial systems require one to seek solutions in algebraically closed field such as the complex numbers. However, for the objects in applications (think of concentrations or probabilities) this assumption is prohibitive. One often works with non-negative real numbers and this leads to the fields of real and semi-algebraic geometry. New theory in combinatorial commutative algebra shows that for binomial equations field assumptions can be skirted and that the dependence of binomial systems on their coefficients is quite weak [14]. For binomial equations one can hope for results that do not depend on the explicit values of the parameters and are thus robust in the presence of uncertainty. The main theme of this paper is how to detect binomiality, that is, how to decide if a given polynomial system is equivalent to a binomial system. The common way to decide binomiality is to compute a Gröbner basis since an ideal can be generated by binomials if and only if any reduced Gröbner basis is binomial [8, Corollary 1.2]. For polynomial systems arising in applications, however, computing a reduced Gröbner basis is often too demanding: as parameter values are unknown, computations have to be performed over the field of rational functions in the parameters. Even though this is computationally feasible, it is time consuming and usually yields an output that is hard to digest for humans. This added complexity comes from the fact that Gröbner bases contain a lot more information than what may be needed for a specific task such as deciding binomiality of a polynomial system. Hence Gröbner-free methods are desirable. Gröbner-free methods. Gröbner bases started as a generalization of Gauss elimination to polynomials. They have since come back to their roots in linear algebra by the advent of F4 and F5 type algorithms which try to arrange computations so that sparse linear algebra can exploited [7]. Our method draws on linear algebra in bases of monomials too, and is inspired by these developments in computer algebra. Deciding if a set of polynomials can be brought into binomial form using linear algebra is the question whether the coefficient matrix has a partitioning kernel basis (Definition 2.1 and Proposition 2.5). Deciding this property requires only row reductions and hence is computationally cheap compared to Gröbner bases. It was shown in [18] that, if the coefficient matrix of a suitably extended polynomial system admits a partitioning kernel basis, then the polynomial system is generated by binomials. As a first insight we show that the converse of this need not hold (Example 2.8). In general computer algebra profits from homogeneity. This is true for Gröbner bases where, for example, Hilbert function driven algorithms can be used to convert a basis for a term-order that is cheap to compute into one for an expensive order, such as lex. We also observe this phenomenon in our Gröbner-free approach: a satisfying answer DETECTING BINOMIALITY 3 to the binomial detection problem can be found if the given system of polynomials is homogeneous. In Section 3 we discuss this case which eventually leads to Algorithm 3.3. In the inhomogeneous case things are more complicated. Gröbner basis computations can be reduced to the homogeneous case by an easy trick. Detection of binomiality can not (Example 4.1). We address this problem by collecting heuristic approaches that, in the best case, establish binomiality without Gröbner bases (Recipe 4.5). Our approaches can also be used if the system is not entirely binomial, but has some binomials. In Example 4.4 we demonstrate this on a polynomial system from [5]. Binomial steady state ideals. While binomiality detection can be applied to any polynomial system, our motivation comes from chemical reaction network theory where ordinary differential equations with polynomial right-hand sides are used to model dynamic processes in systems biology. The mathematics of these systems is extremely challenging, in particular since realistic models are huge and involve uncertain parameters. As a consequence of the latter, studying dynamical systems arising in biological applications often amounts to studying parameterized families of polynomial ODEs. The first order of business (and concern of a large part of the work in the area) is to determine steady states which are thus the non-negative real zeros of families of parameterized polynomial equations. Moreover, the structure of the polynomial ODEs entails the existence of affine linear subspaces that are invariant for solutions. Hence questions concerning existence and uniqueness of steady states or existence of multiple steady states are equivalent to questions regarding the intersection of the zero set of a parameterized family of polynomials with a family of affine linear subspaces. If the polynomial equations describing steady states are equivalent to binomial equations (that is, generate a binomial ideal), then their mathematical analysis becomes much easier. This is the main theme of [18]. If a system is binomial, then, for instance, one can decide efficiently if positive steady states exist. If so, then a monomial parametrization can be found using only linear algebra over the integers [8, Section 2], and the steady states are toric: they are the positive real part of a toric variety. A sufficient criterion for toric steady states appears in [13, Theorem 4.1]. Since zero sets of general polynomial systems need not have parametrizations at all, we view the task of detecting binomiality as an important step in analyzing polynomials—in systems biology, or other areas like algebraic statistics, control theory, economics, etc. A frequent and challenging problem in the analysis of dynamical systems in biology is to decide multistationarity, that is, the existence of parameter values leading to more than one isolated steady state. A variety of results for precluding multistationarity has appeared in recent years. See, for instance, [12, 21, 3, 1] for methods employing the Jacobian. Similarly, several sufficient criteria for multistationarity have emerged (for example [4, 5]). In general this problem remains very hard. However, in the case of binomial steady state equations, the question of multistationarity can often be answered 4 CARSTEN CONRADI AND THOMAS KAHLE effectively, for example positively by [18, Theorem 5.5], or negatively by [17, Theorem 1.4]. Both of these results require only the study of systems of linear inequalities. Notation. In this paper we work with the polynomial ring k[x1 , . . . , xn ] in n variables. The coefficient field k is usually R, or the field of real rational functions in a set of parameters. Our methods are agnostic towards the field. A system of polynomial equations f1 = f2 = · · · = fs = 0 in the variables x1 , . . . , xn is encoded in the ideal hf1 , . . . , fs i ⊂ k[x1 , . . . , xn ]. A polynomial is homogeneous if all its terms have the same total degree, and an ideal is homogeneous if it can be generated by homogeneous polynomials. A binomial is a polynomial with at most two terms. In particular, a monomial is a binomial. It is important to distinguish between binomial ideals and binomial systems. A binomial system f1 = · · · = fs = 0 is a polynomial system such that each fi is a binomial. In contrast, an ideal hf1 , . . . , fs i is a binomial ideal if there exist binomials that generate the same ideal. Thus general non-binomials do not form a binomial system, even if they generate a binomial ideal. For the sake of brevity we will not give an introduction to commutative algebra here, but refer to standard text books like [6, 2]. The very modest amount of matroid theory necessary in Section 2 can be picked up from the first pages of [20]. Acknowledgment. We thank David Cox for discussions on the role of homogeneity in computer algebra. We are grateful to Alicia Dickenstein for pointing out a crucial error in an earlier version of this paper. TK is supported by CDS the Center for Dynamical Systems at Otto-von-Guericke University. 2. Gröbner-free criteria for binomiality The most basic criterion to decide if an ideal is binomial is to compute a Gröbner basis. This works because the Buchberger algorithm is binomial-friendly: an S-pair of binomials is a binomial. Since the reduced Gröbner basis is unique and must be computable from the binomial generators, it consists of binomials if and only if the ideal is binomial. However, Gröbner bases can be very hard to compute, so other criteria using only linear algebra are also desirable. Linear algebra enters, when we write a polynomial system as AΨ(x), the product of a coefficient matrix A with entries in k, and a vector of monomials Ψ(x). Clearly, if we use row operations on the matrix to bring it into a form where each row has at most two non-zero entries, then the ideal is generated by binomials and monomials. This criterion is too naive to detect all binomial ideals since it allows only k-linear combinations of the given polynomials. We show in Section 3 that, at least for homogeneous ideals, it can be extended to a characterization. Before we embark into the details, we formalize the condition on the matrix. Definition 2.1. A matrix A has a partitioning kernel basis if its kernel admits a basis of vectors with disjoint supports, that is, if there exists a basis b(1) , . . . , b(d) of ker(A) such that supp(b(i) ) ∩ supp(b(j) ) = ∅ for all i 6= j. DETECTING BINOMIALITY 5 The following proposition allows one to check for a partitioning kernel basis with linear algebra. The underlying reason is the very restricted structure of the kernel, expressed best in matroid language. Proposition 2.2. The following are equivalent for any matrix A. 1) A has a partitioning kernel basis. 2) The column matroid of A is a direct sum of uniform matroids Ur−1,r of corank one, and possibly several coloops U1,1 . 3) The reduced row echelon form of A has at most two non-zero entries in each row. Proof. 1 ⇒ 2: Let b1 , . . . , bk be the partitioning kernel basis. The supports of this basis satisfy the circuit axioms and are thus equal to the circuits of the column matroid of A. Indeed, non-containment and circuit elimination are satisfied trivially because there is no overlap between any two circuits. For any non-zero element b̃ ∈ ker(A), we have P S b̃ = i λi bi . By the partitioning kernel basis property supp(b̃) = i {supp(bi ) : λi 6= 0}, so either b̃ is proportional to one of the bi , or its support properly contains the support of a circuit, so it cannot be a circuit. The columns of A which do not appear in any circuit are coloops and the remaining columns form a direct sum of k uniform matroids of corank one. 2 ⇒ 3: If the column matroid of A is a direct sum of matroids, then the unique reduced row echelon form has block structure corresponding to the direct sum decomposition. Therefore it suffices to consider a single block which has one-dimensional kernel of full support (the coloops are (1 × 1)-identity blocks). Ignoring zero rows, the reduced row r−1 echelon form of such a matrix is (Ir−1 |c) where r − 1 is the rank and c ∈ k6= 0 . 3 ⇒ 1: Rows of the reduced row echelon form with exactly one non-zero entry correspond to positions where every element of the kernel has a zero. Thus we can assume that there are none and each row of A has exactly two non-zero entries. Let c be a non-pivotal column with r − 1 non-zero entries. The restriction of A to c and the corresponding pivotal columns yields a block containing (Ir−1 |c) and some zero rows. The unique kernel vector corresponding to the dependencies in this block is orthogonal to the kernel of the remaining columns. This procedure can be applied to any non-pivotal column. The thus constructed basis is a partitioning kernel basis.  Remark 2.3. Proposition 2.2 shows that the complexity of deciding if a matrix has a partitioning kernel basis is essentially the same as that of Gauss-Jordan elimination. One needs O(n3 ) field operations where n is the larger of the dimensions of the matrix. Remark 2.4. A direct sum of (arbitrary) uniform matroids is called a partition matroid. We now translate Proposition 2.2 to polynomial systems. Proposition 2.5. If A has a partitioning kernel basis, and Ψ(x) is a vector of monomials of appropriate length, then the ideal hAΨ(x)i ⊂ k[x1 , . . . , xn ] is binomial. If 6 CARSTEN CONRADI AND THOMAS KAHLE AΨ(x) is any system that can be transformed into a binomial system using only k-linear combinations, then A has a partitioning kernel basis. Proof. Up to coloops the first part is [18, Theorem 3.3] and the coloops only give monomials. The second statement is clear since k-linear combinations of polynomials are row operations on the coefficient matrix and those do not change the kernel.  Our general strategy is to suitably extend a given system AΨ(x) with redundant polynomials such that Proposition 2.5 yields binomiality of an extended system A′ Ψ′ (x). This happens in the following example. Example 2.6. Let f1 = x − y, f2 = z − w, and f3 = x(f1 + f2 ) = x2 − xy + xz − xw. Ordering the monomials ΨT = (x, y, z, w, x2, xy, xz, xw), the system linearizes as   1 −1 0 0 0 0 0 0 f = (f1 , f2 , f3 ) = 0 0 1 −1 0 0 0 0  · Ψ. 0 0 0 0 1 −1 1 −1 The coefficient matrix is in reduced row echelon form and does not have a partitioning kernel basis by Proposition 2.2. Algorithm 3.3 takes this problem into account, working degree by degree. The ideal is binomial since f3 is a binomial (in fact, zero) in the quotient ring k[x, y, z]/hx − y, z − wi. The first hint into how to extend A and Ψ(x) is the following theorem due to Pérez Millán et al. Theorem 2.7 ([18, Theorem 3.19]). Let f1 = f2 = · · · = fs = 0 be a polynomial system. If there exist monomials xα1 , . . . , xαm such that, for some i1 , . . . , im ∈ [s], the system (2.1) f1 = f2 = · · · = fs = xα1 fi1 = · · · = xαm fim = 0 has a coefficient matrix with a partitioning kernel basis, then hf1 , . . . , fs i is binomial. Theorem 2.7 is true since the additional generators in (2.1) do not change the ideal that the system generates. This together with the explicit description of the binomial generators in the case of a partitioning kernel basis [18, Theorem 3.3] yields the result. If the condition in Theorem 2.7 were also necessary, then a test for binomiality could be built on trying to systematically identify the monomials xα . However, the converse of Theorem 2.7 is not true. Example 2.8. Let I = hf1 , f2 i be the homogeneous binomial ideal generated by the non-binomials f1 = x − y + x2 + y 2 + z 2 , f2 = x2 + y 2 + z 2 . For no choice of monomials m11 , . . . , m1r , m21 , . . . , m2s ∈ k[x, y, z] does the coefficient matrix of the system (2.2) f1 = m11 f1 = · · · = m1r f1 = f2 = m21 f2 = · · · = m2s f2 = 0 have a partitioning kernel basis. For the proof Example 2.8 we first need the following curious little fact. DETECTING BINOMIALITY 7 Lemma 2.9. The ideal I = hx2 + y 2 + z 2 i ⊂ k[x, y, z] does not contain a non-zero binomial. Proof. We can assume that k is algebraically closed, since if I contains a non-zero binomial, then so does its extension to the algebraic closure. Assume that for some f ∈ k[x, y, z], the product b = f (x2 + y 2 + z 2 ) ∈ I is a binomial. We can assume that b is not divisible by any variable. Indeed, if a variable divides b, then it divides f and we find a lower degree binomial in I. Since I is homogeneous, we can also assume that b is homogeneous. Potentially renaming the variables, we can assume b = xd − λy s z d−s for some 0 ≤ s < d and λ ∈ k. Since k is algebraically closed, there is a solution ξ to the equation x2 = −1. The generator x2 + y 2 + z 2 vanishes at (ξ, 1, 0) but b does not vanish there. This contradiction shows that I cannot contain a binomial.  Proof of Example 2.8. Let d be the highest total degree among monomials in the system (2.2) and consider the restriction of all involved polynomials to degree d. Since the highest degree part of both f1 and f2 equals (x2 + y 2 + z 2 ), only monomial multiples of (x2 + y 2 + z 2 ) can contribute to the degree d part of the system (2.2). If the whole coefficient matrix of (2.2) had a partitioning kernel basis, then also the submatrix with only the columns for degree d monomials had one (Proposition 2.2). In this case row reductions on the submatrix would yield a binomial in degree d in the ideal generated  by (x2 + y 2 + z 2 ). This is impossible by Lemma 2.9. Example 2.8 may seem contrived, but this kind of “trivial obfuscation” of binomials does happen in applications. Of course, for humans it is obvious that one should first isolate the linear binomial x − y and then search for implied quadratic binomials which reduce the trinomial. Our next aim is Algorithm 3.3 which implements this idea, at least in the homogeneous case. The homogeneity assumption cannot be skirted, unfortunately. It is true that an ideal is binomial if and only if its homogenization is binomial [8, Corollary 1.4], but the homogenization is not accessible without a Gröbner basis. It would be superb for our purposes if homogenizing the generators of a binomial ideal would always yield a binomial ideal. Unfortunately this is not the case as Example 4.1 shows. 3. The homogeneous case If a given ideal I is homogeneous, the graded vector space structure of the quotient k[x1 , . . . , xn ]/I allows one to check binomiality degree by degree. For this we need some basic facts about quotients modulo binomials (see [8, Section 1] for details). Any set of binomials B in k[x1 , . . . , xn ] induces an equivalence relation on the set of monomials in k[x1 , . . . , xn ] under which m1 ∼ m2 if and only if m1 −λm2 ∈ hBi for some non-zero λ ∈ k. As a k-vector space the quotient ring k[x1 , . . . , xn ]/hBi is spanned by the equivalence classes of monomials and those are all linearly independent [8, Proposition 1.11]. If the binomials are homogeneous, then the situation is particularly nice. For example, the 8 CARSTEN CONRADI AND THOMAS KAHLE equivalence classes are finite and elements of the quotient have well-defined degrees. The notions of monomial, binomial, and polynomial are extended to the quotient ring. For example, a binomial is a polynomial that uses at most two equivalence classes of monomials. The unified mathematical framework to treat quotients modulo binomials are monoid algebras, but we refrain from introducing this notion here. As a consequence of the discussion above, a polynomial system f1 = · · · = fs = 0 can be considered modulo binomials, and the coefficient matrix of the quotient system is well-defined. It arises from the coefficient matrix of the original system by summing columns for monomials in the same equivalence class. Example 3.1. In k[x, y], let b = x2 −y 2. Among monomials of total degree three, x3 and xy 2 , as well as x2 y and y 3 become equal in k[x, y]/hbi. Thus the degree three part in the quotient is two-dimensional with one basis vector per equivalence class. Consequently, the trinomial f = x3 + xy 2 + y 3 maps to a binomial with coefficient matrix [2, 1]. This matrix arises from the matrix [1, 1, 1, 0] by summing the columns corresponding to x3 and xy 2 , as well as those for x2 y and y 3. The reduction modulo lower degree binomials in Example 3.1 can be done in general. Lemma 3.2. Let f1 , . . . , fs ∈ k[x1 , . . . , xn ] be homogeneous polynomials of degree d, and B ⊂ k[x1 , . . . , xn ] a set of homogeneous binomials of degree at most d. Then in the quotient ring k[x1 , . . . , xn ]/hBi the ideal hf1 , . . . , fs i/hBi is binomial if and only if the coefficient matrix of the images of f1 , . . . , fs in k[x1 , . . . , xn ]/hBi has a partitioning kernel basis. Proof. The graded version of Nakayama’s lemma (see Corollary 4.8b together with Exercise 4.6 in [9]) implies that the ideal hf1 , . . . , fs i/hBi ⊂ k[x1 . . . , xn ]/hBi has a welldefined number of minimal generators in each degree. Therefore any minimal generating set consists only of degree d polynomials and Proposition 2.5 applied to the finitedimensional vector space of degree d polynomials correctly decides binomiality.  Lemma 3.2 is the basis for the following binomial detection algorithm. Algorithm 3.3. Input: Homogeneous polynomials f1 , . . . , fs ∈ k[x1 , . . . , xn ]. Output: Yes and a binomial generating set of hf1 , . . . , fs i if one exists, No otherwise. 1) Let • B := ∅, • R := k[x1 , . . . , xn ], • F := {f1 , . . . , fs }. 2) While F is not empty, a) Let Fmin be the set of elements of minimal degree in F . b) Redefine F := F \ Fmin . c) Compute the reduced row echelon form A of the coefficient matrix of Fmin . DETECTING BINOMIALITY 9 d) If A has a row with three or more non-zero entries, output No and stop. e) Find a set B ′ of binomials in k[x1 , . . . , xn ] whose images in R generate hFmin i and redefine B := B ∪ B ′ . f ) Redefine R := k[x1 , . . . , xn ]/hBi. g) Redefine F as its image in R. 3) Output Yes and B. Proof of correctness and termination. Termination is obvious. In fact, the maximum number of iterations in the while loop equals the number of distinct total degrees among f1 , . . . , fs . Step 2.d relies on Proposition 2.2. In step 2.e, binomials that generate hFmini in R can be read off the reduced row echelon form via Proposition 2.2. Then any preimages in k[x1 , . . . , xn ] of those binomials suffice for B ′ . Lemma 3.2 shows that the while loop either exhausts F if hf1 , . . . , fs i is binomial, or stops when this is not the case.  Remark 3.4. In the homogeneous case there is a natural choice of finite-dimensional vector spaces to work in: polynomials of a fixed degree. In each iteration of the while loop in Algorithm 3.3, the rows of A span the vector space of polynomials of degree d in the ideal (modulo the binomials in hBi). In the general inhomogeneous situation extra work is needed to construct a suitable finite-dimensional vector space. In particular, one needs to select from the infinite list of binomials in the ideal not too many, but enough to reduce all given polynomials to binomials whenever this is possible. An interesting problem for the future is to adapt one of the selection strategies from the F4 algorithm for Gröbner bases [10] for this task. Remark 3.5. Coefficient matrices of polynomial systems are typically very sparse. An efficient implementation of Algorithm 3.3 has to take this into account. Remark 3.6. Algorithm 3.3 could also be written completely in the polynomial ring without any quotients. Then in each new degree, one would have to consider the coefficient matrix of Fmin together with all binomials of degree d in the ideal hBi. This list grows very quickly and so does the list of monomials appearing in these binomials. Thus it is not only more elegant to work with the quotient, but also more efficient. To implement Algorithm 3.3 completely without Gröbner bases some refinements are necessary. Simply using R = k[x1 , . . . , xn ]/B in Macaulay2 will make it compute a Gröbner basis of B to effectively work with the quotient. For our purposes, however, this is not necessary. Proposition 3.7. Algorithm 3.3 can be implemented without Gröbner bases. Proof. The critical step is 2.g, when the algorithm reduces F modulo the binomials already found. For the following step 2.c elements of Fmin need to be written in terms of a basis of the finite-dimensional vector space Rdeg(Fmin ) of degree deg(Fmin ) monomials modulo the binomials in B. The equivalence relation introduced in the beginning of this 10 CARSTEN CONRADI AND THOMAS KAHLE section can also be thought of as a graph on monomials, and thus these reductions can be carried out with graph enumeration algorithms like breadth first search. Restricting to monomials of degree deg(Fmin), the connected components are a vector space basis  of Rdeg(Fmin ) and can thus be used to gather coefficients in step 2.g. Remark 3.8. The feasibility of graph-theoretic computations in cases where Gröbner bases cannot be computed has been demonstrated in [15]. Example 4.9 there contains a binomial ideal whose Gröbner basis cannot be computed, but whose non-radicality was proved using a graph-theoretic computation. This yielded a negative answer to the question of radicality of conditional independence ideals in algebraic statistics. Remark 3.9. Using Gröbner bases one represents each connected component of the graph defined by hBi by its least monomial with respect to the term order. Our philosophy is that this is not necessary: one should work with the connected components per se. Why bother with picking and finding a specific representative in each component if any representative works? In an implementation one could choose a data structure that for each monomial stores an index of the connected component it belongs to. Remark 3.10. It is trivial to generate classes of examples where Gröbner bases methods fail, but Algorithm 3.3 is quick. For example, take any set of binomials whose Gröbner basis cannot be computed and add any polynomial in the ideal. Algorithm 3.3 immediately goes to work on reducing the polynomial modulo the binomials, while any implementation of Gröbner bases embarks into its hopeless task. Remark 3.11. Remark 3.10 highlights the Gröbner-free spirit of our method. The Gröbner basis of an ideal contains much more information than binomiality. One should avoid expensive computation to decide this simple question. 4. Heuristics for the inhomogeneous case The ideals one encounters in chemical reaction network theory are often not homogeneous, so that the results from Section 3 do not apply. The first idea one may have for the inhomogeneous case is to work with some (partial) homogenization. Gröbner bases are quite robust in relation to homogenization. For example, to compute a Gröbner basis of a non-homogeneous ideal it suffices to homogenize the generators, compute a Gröbner basis of this homogeneous ideal, and then dehomogenize. Although the intermediate homogeneous ideal is generally not equal to the homogenization of the original ideal, the dehomogenized Gröbner basis is a Gröbner basis of the dehomogenized ideal [2, Exercise 1.7.8]. Unfortunately the notion of binomiality does not lend itself to that kind of tricks. Geometrically, homogenizing (all polynomials in) an ideal yields the projective closure and dehomogenizing restricts to one affine piece. Homogenizing only the generators creates extra components at infinity and these components need not be binomial. Even DETECTING BINOMIALITY 11 if they are binomial, the intersection need not be binomial (see also [14, Problem 17.1]). This is the case in the following example. Example 4.1. The ideal hab − x, ab − y, x + y + 1i ⊂ k[a, b, x, y] is binomial as it equals h2y + 1, 2x + 1, 2ab + 1i. Homogenizing the generators, however, yields the non-binomial ideal hab − xz, ab − yz, x + y + zi. We now present some alternatives that do not give complete answers but are quick to check. They can be applied before resorting to an expensive Gröbner basis computation. The quickest (but least likely to be successful) approach is to try linear algebraic manipulations of the given polynomials. Equivalently one applies row operations to the coefficient matrix, for instance, computing the reduced row echelon form. If it has a partitioning kernel basis, then the ideal is binomial and all non-binomial generators are k-linear combinations of the binomials. While it may seem very much to ask for this, it does happen for the family of networks in [18, Section 4]. If just linear algebra is not successful, one can homogenize the generators and run Algorithm 3.3. If the resulting homogeneous ideal comes out binomial, then the original ideal was binomial by the following simple fact, proven for instance in [2, Corollary A.4.16]. Proposition 4.2. Let I ⊂ k[x1 , . . . , xn ] be an ideal and I ′ ⊂ k[x0 , x1 , . . . , xn ] the homogeneous ideal generated by the homogenizations of the generators of I (using variable x0 ). Then I is generated by the dehomogenization of any generating set of I ′ . We now illustrate a phenomenon leading to failure of the above heuristics. Example 4.3. Consider the network from [18, Example 3.15]. The steady states are non-negative real zeros of the following polynomials. f1 f2 f3 f4 f5 = −k12 x1 + k21 x2 − k1112 x1 x7 + (k1211 + k1213 )x9 , = k12 x1 − k21 x2 − k23 x2 + k32 x3 + k67 x6 , = k23 x2 − k32 x3 − k34 x3 − k89 x3 x7 + k910 x8 + k98 x8 , = k34 x3 − k56 x4 x5 + k65 x6 , = −k56 x4 x5 + k65 x6 + k910 x8 + k1213 x9 , f6 = k56 x4 x5 − (k65 + k67 )x6 , f7 = k67 x6 − k1112 x1 x7 − k89 x3 x7 + k98 x8 + k1211 x9 , f8 = k89 x3 x7 − (k910 + k98 )x8 , f9 = k1112 x1 x7 − (k1211 + k1213 )x9 . The binomials f6 , f8 , and f9 can be used to eliminate one of every pair (x6 , x4 x5 ), (x8 , x3 x7 ), and (x9 , x1 x7 ). We eliminate x4 x5 , x8 , and x9 . It can be checked that eliminating x1 x7 instead of x9 does not lead to binomials immediately (although it leads to 12 CARSTEN CONRADI AND THOMAS KAHLE linear trinomials). f1′ = −k12 x1 + k21 x2 , f2′ = k12 x1 − (k21 + k23 )x2 + k32 x3 + k67 x6 , f3′ = k23 x2 − (k32 + k34 )x3 , f4′ = k34 x3 − k67 x6 , k1112 k1213 x1 x7 k89 k910 x3 x7 f5′ = −k67 x6 + + , k1211 + k1213 k910 + k98 (k1112 k1213 (k910 + k98 )x1 + (k1211 + k1213 )k89 k910 x3 )x7 . f7′ = k67 x6 − (k1211 + k1213 )(k910 + k98 ) Using the linear relations f1′ and f3′ the remaining system is recognized to consist of only two independent binomials: f2′′ = −k34 x3 + k67 x6 f4′′ = k34 x3 − k67 x6 ,   k1112 k1213 k21 k23 k89 k910 ′′ f5 = −k67 x6 + x2 x7 , + k12 (k1211 + k1213 ) (k32 + k34 )(k910 + k98 )   k23 k89 k910 k1112 k1213 k21 ′′ x2 x7 . − f7 = k67 x6 + − k12 (k1211 + k1213 ) (k32 + k34 )(k910 + k98 ) This analysis shows that the steady state ideal under consideration equals the binomial ideal hf1′ , f2′′ , f3′ , f5′′ , f6 , f8 , f9 i. The Gröbner basis computation in [18, Example 3.15] also yields the result, but it is arguably less instructive. Note also that naive homogenization does not yield binomiality. The element f2 is linear. After homogenization, Algorithm 3.3 would pick only this element as Fmin and stop since it is not a binomial. The effect in Example 4.3 motivates our final method: term replacements using known binomials. We expect this to be very useful in applications from system biology for the following reasons. • It often happens that non-binomial generators are linear combinations of binomials as in Example 4.3 where f1 = f1′ + f9 . • Steady state ideals of networks with enzyme-substrate complexes always have some binomial generators. These complexes are produced by only one reaction and thus their rate of change is binomial. • In MAPK networks, which describe certain types of cellular signaling, one often finds binomials of the form kxa xb − k ′ xc . • Frequently binomials in steady state ideals are linear. Equivalently some of the concentrations are equal up to a scaling (which may depend on kinetic parameters). This happens for all examples in [19]. DETECTING BINOMIALITY 13 We now illustrate term replacements in a larger example which comes from the network for ERK activation embedded in two negative feedback loops (see [5, Section 5] for pointers to the relevant biology). Example 4.4. Consider the following steady state ideal generated by 29 polynomials. f1 = −k1 x1 x2 + k2 x3 + k6 x6 , f2 = −k1 x1 x2 + k2 x3 + k3 x3 , f3 = k1 x1 x2 − k2 x3 − k3 x3 , f4 = k11 x10 + k12 x10 + k38 x25 + k42 x27 + k3 x3 − k37 x18 x4 , − k4 x4 x5 + k5 x6 − k7 x4 x7 + k8 x8 + k9 x8 − k10 x4 x9 f5 = k14 x12 + k15 x12 + k17 x13 + k18 x13 + k35 x24 + k36 x24 + k41 x27 + k42 x27 − k13 x11 x5 − k34 x16 x5 − k40 x26 x5 − k4 x4 x5 + k5 x6 + k6 x6 − k16 x5 x9 , f6 = k4 x4 x5 − k5 x6 − k6 x6 , f7 = k18 x13 − k7 x4 x7 + k8 x8 , f9 = k11 x10 + k15 x12 + k17 x13 + k9 x8 − k10 x4 x9 − k16 x5 x9 , f8 = k7 x4 x7 − k8 x8 − k9 x8 , f10 = −k11 x10 − k12 x10 + k10 x4 x9 , f11 = k12 x10 + k14 x12 − k19 x11 x14 + k20 x15 + k21 x15 − k22 x11 x16 + k23 x17 + k24 x17 − k13 x11 x5 , f12 = −k14 x12 − k15 x12 + k13 x11 x5 , f13 = −k17 x13 − k18 x13 + k16 x5 x9 , f14 = −k19 x11 x14 + k20 x15 + k30 x21 + k36 x24 , f15 = k19 x11 x14 − k20 x15 − k21 x15 , f16 = k21 x15 − k22 x11 x16 + k23 x17 − k28 x16 x19 + k27 x20 + k29 x21 + k33 x23 + k35 x24 − k34 x16 x5 , f17 = k22 x11 x16 − k23 x17 − k24 x17 , f18 = k24 x17 − k25 x18 x19 + k26 x20 − k31 x18 x22 + k32 x23 + k38 x25 + k39 x25 − k43 x18 x28 + k44 x29 + k45 x29 − k37 x18 x4 , f19 = −k46 x19 − k28 x16 x19 − k25 x18 x19 + k26 x20 + k27 x20 + k29 x21 + k30 x21 + k45 x29 , f20 = k25 x18 x19 − k26 x20 − k27 x20 , f22 = −k31 x18 x22 + k32 x23 + k33 x23 , f21 = k28 x16 x19 − k29 x21 − k30 x21 , f23 = k31 x18 x22 − k32 x23 − k33 x23 , f24 = −k35 x24 − k36 x24 + k34 x16 x5 , f26 = k39 x25 + k41 x27 − k40 x26 x5 , f25 = −k38 x25 − k39 x25 + k37 x18 x4 , f27 = −k41 x27 − k42 x27 + k40 x26 x5 f28 = k46 x19 − k43 x18 x28 + k44 x29 , f29 = k43 x18 x28 − k44 x29 − k45 x29 . After some obvious factorization, the following elements are binomials: f2 , f6 , f8 , f10 , f12 , f13 , f15 , f17 , f20 , f21 , f22 , f23 , f24 , f25 , f27 , f29 . The system has seven conservation relations, which can be found by linear algebra. According to our strategy to use binomials to simplify the system, we eliminate, if possible, non-binomials using the conservation relations. This is not always possible, as some of the conservation relations stem from duplicate equations like f2 = −f3 . We eliminate f3 , f4 , f5 , f8 , f9 , f18 , and f19 . The remaining non-binomial part consists of f1 , f7 , f11 , f14 , f16 , f26 , and f28 . Dividing by reaction constants, each of the binomials is of the form xi = Kxj xl for some rational expression K involving only reaction constants. Using these in the non-binomials yields k1 k3 x1 x2 k4 k6 x4 x5 k7 k9 x4 x7 k16 k18 x5 x9 + , f7′ = − + , k2 + k3 k5 + k6 k8 + k9 k17 + k18 k10 k12 x4 x9 k13 k15 x11 x5 + , =− k14 + k15 k11 + k12 f1′ = − ′ f11 14 CARSTEN CONRADI AND THOMAS KAHLE k19 k21 x11 x14 k28 k30 x16 x19 k34 k36 x16 x5 + + , k20 + k21 k29 + k30 k35 + k36 k22 k24 x11 x16 k28 k29 x16 x19 k25 k27 x18 x19 k19 k21 x11 x14 − − k28 x16 x19 + + = k20 + k21 k23 + k24 k29 + k30 k26 + k27 k31 k33 x18 x22 k34 k35 x16 x5 + − k34 x16 x5 + , k32 + k33 k35 + k36 k37 k39 x18 x4 k40 k42 x26 x5 k43 k45 x18 x28 ′ = − , f28 = k46 x19 − . k38 + k39 k41 + k42 k44 + k45 ′ f14 =− ′ f16 ′ f26 ′ ′ ′ ′ ′ In particular, we find five new binomials f1′ , f7′ , f11 , f26 , and f28 . Adding f14 to f16 yields the trinomial ′′ f16 =− k22 k24 x11 x16 k25 k27 x18 x19 k31 k33 x18 x22 + + . k23 + k24 k26 + k27 k32 + k33 Consequently, the original system is equivalent to a system consisting of 27 binomials and two trinomials of a relatively simple shape. For comparison we computed the Gröbner basis in Macaulay2 with rational functions in the reaction rates as coefficients. Although the computation finished in just 18 minutes, the result is practically unusable. The Gröbner basis consists of 169 elements each of it with huge rational functions as coefficients. The structure that we observed above is completely lost. The lesson learned from Example 4.4 is that term replacements using binomials are useful in solving a polynomial system, even if the end result is not binomial. Especially in the non-homogeneous case where the notion of minimal generators is absent, computations with the Binomials package [16] in Macaulay2 [11] can probably only assist, but not automatically do useful reductions. For example, a natural general choice would be to replace higher degree monomials by lower degree ones, but this would not directly reveal binomiality in Example 4.3. Finally, we summarize a possible strategy to deal with inhomogeneous ideals. Example 4.1, for instance, is solved already by item 1, but also by item 3. Recipe 4.5. 1) Try linear algebra and Proposition 2.5. 2) Homogenize the given ideal and run Algorithm 3.3. If the algorithm returns binomials, then by Proposition 4.2 the original (dehomogenized) ideal is binomial. The homogenization should be carried out after linear algebra reductions to possibly detect homogeneity already at an earlier stage (compare Example 2.8). 3) If Algorithm 3.3 returns a negative answer, dehomogenize and use known binomials for term replacements (as in Example 4.4). Potentially homogenize again with an enlarged generating set. 4) Compute a reduced Gröbner basis. DETECTING BINOMIALITY 15 References [1] Banaji M., Craciun G., Graph-theoretic criteria for injectivity and unique equilibria in general chemical reaction systems, Adv. in Appl. Math. 44 (2010) 168 – 184. [2] Bachmann O., Greuel G.-M., Lossen C., Pfister G., Schönemann H., A Singular introduction to commutative algebra, Springer, Berlin, 2007. [3] Craciun G., Feinberg M., Multiple equilibria in complex chemical reaction networks: II. The species-reaction graph, SIAM J. Appl. Math. 66 (2006) 1321 – 1338. [4] Craciun G., Feinberg M., Multiple equilibria in complex chemical reaction networks: Semiopen mass action systems, SIAM J. Appl. Math. 70 (2010) 1859 – 1877. [5] Conradi C., Flockerzi D., Multistationarity in mass action networks with applications to ERK activation, J. Math. Biol. 65 (2012) 107 – 156. [6] Cox D. A., Little J. B., O’Shea D., Ideals, Varieties, and Algorithms, Springer, New York, 1996. [7] Eder C., Faugère J.-C., A survey on signature-based Gröbner basis computations, preprint, arXiv:1404.1774. [8] Eisenbud D., Sturmfels B., Binomial Ideals, Duke Math. J. 84 (1996) 1 – 45. [9] Eisenbud D., Commutative Algebra with a View Toward Algebraic Geometry, Springer, New York, 1995. [10] Faugère J.-C., A new efficient algorithm for computing Gröbner bases (F4), J. Pure Appl. Algebra 139 (1999) 61 – 88. [11] Grayson D. R., Stillman M. E., Macaulay2, a software system for research in algebraic geometry, Available at http://www.math.uiuc.edu/Macaulay2/. [12] Joshi B., Shiu A., Simplifying the Jacobian criterion for precluding multistationarity in chemical reaction networks, SIAM J. Appl. Math. 72 (2012) 857 – 876. [13] Johnston M. D., Translated chemical reaction networks, Bull. Math. Biol. 76 (2014) 1081 – 1116. [14] Kahle T., Miller E., Decompositions of Commutative Monoid Congruences and Binomial Ideals, Algebra Number Theory 8 (2014) 1297 – 1364. [15] Kahle T., Rauh J., Sullivant S., Positive margins and primary decomposition, J. Commut. Algebra 6 (2014) 173 – 208. [16] Kahle T., Decompositions of Binomial Ideals, J. Softw. Algebra Geom. 4 (2012) 1 – 5. [17] Müller S., Feliu E., Regensburger G., Conradi C., Shiu A., Dickenstein A., Sign conditions for injectivity of generalized polynomial maps with applications to chemical reaction networks and real algebraic geometry, Found. Comput. Math., published onlineu under doi:10.1007/s10208-0149239-3 (2015). [18] Pérez Millán M., Dickenstein A., Shiu A., Conradi C., Chemical Reaction Systems with Toric Steady States, Bull. Math. Biol. 74 (2012) 1027 – 1065. [19] Pérez Millán M., Turjanski A. G., MAPK’s networks and their capacity for multistationarity due to toric steady states, Math. Biosci. 262 (2015) 125 – 137. [20] Oxley J. G., Matroid Theory, Oxford University Press, Oxford, 2006. [21] Wiuf C., Feliu E., Power-law kinetics and determinant criteria for the preclusion of multistationarity in networks of interacting species, SIAM J. Appl. Dyn. Syst. 12 (2013) 1685 – 1721. Hochschule für Technik und Wirtschaft, Berlin, Germany E-mail address: [email protected] Otto-von-Guericke Universität, Magdeburg, Germany Website: http://www.thomas-kahle.de
0math.AC
1 On Repetitive Scenario Design Giuseppe C. Calafiore arXiv:1602.03796v1 [cs.SY] 11 Feb 2016 Abstract Repetitive Scenario Design (RSD) is a randomized approach to robust design based on iterating two phases: a standard scenario design phase that uses N scenarios (design samples), followed by randomized feasibility phase that uses No test samples on the scenario solution. We give a full and exact probabilistic characterization of the number of iterations required by the RSD approach for returning a solution, as a function of N , No , and of the desired levels of probabilistic robustness in the solution. This novel approach broadens the applicability of the scenario technology, since the user is now presented with a clear tradeoff between the number N of design samples and the ensuing expected number of repetitions required by the RSD algorithm. The plain (one-shot) scenario design becomes just one of the possibilities, sitting at one extreme of the tradeoff curve, in which one insists in finding a solution in a single repetition: this comes at the cost of possibly high N . Other possibilities along the tradeoff curve use lower N values, but possibly require more than one repetition. Keywords Scenario design, probabilistic robustness, randomized algorithms, random convex programs. I. I NTRODUCTION The purpose of the approach described in this paper is to obtain a probabilistically reliable solution for some design problem affected by uncertainty. The concept of “probabilistic design” has been discussed extensively in the control community in the last decade, and it is now well accepted as a standard tool for tacking difficult robust design problems; we refer the reader to the survey paper [6] and to the book [18] for many pointers to the related literature. The essential elements of a probabilistic design approach are the following ones: 1) A spec function, f (θ, q) : Rn × Q → R, which associates a real value to each pair (θ, q) of a design parameter θ ∈ Rn and uncertainty instance q ∈ Q, where Q ⊆ Rnq . Function f represents the design constraints and specifications of the problem and, in particular, we shall say that a design θ is a robust design, if f (θ, q) ≤ 0, ∀q ∈ Q. In this paper, we make the standing assumption that f is convex. 2) A probability measure Prob defined on Q, which describes the probability distribution of the uncertainty. Equipped with these two essential elements, for given  ∈ (0, 1), and given design vector θ, we are in position to define the probability of violation for the spec function at θ: . V (θ) = Prob{q ∈ Q : f (θ, q) > 0}. (1) We say that θ is an -probabilistic robust design, if it holds that V (θ) ≤ . Further, a designer also typically seeks to minimize some cost function of θ (which can be considered of the linear form c> θ, without loss of generality; see, e.g., Section 8.3.4.4 in [2]), while guaranteeing that V (θ) ≤ . Finding such an -probabilistic robust design amounts to solving a so-called chance-constrained optimization problem, which is computationally hard in general, and perhaps harder than finding a classical deterministic robust design. Chance-constrained optimization problems can be solved exactly only in very restrictive cases (e.g., when f is linear, and q has some specific distribution, such as Normal; see, e.g., [16]). Deterministic convex approximations of chance-constrained problems are discussed in [13] for some special classes of problems where f is affine in q and the entries of q are independent. Also, the sampling average approximation (SAA) method replaces the probability constraint V (θ) ≤  with one involving the empirical probability of violation based on N sampled values of q ; see, e.g., [14], [12]. The optimization problem resulting from SAA, however, remains non-convex and intractable, in general. Giuseppe C. Calafiore, Dipartimento di Automatica e Informatica, Politecnico di Torino, Italy. [email protected] 2 A. The standard scenario theory While effective approximation schemes for chance-constrained optimization problems remain to date hard to tackle numerically, an alternative and efficient randomized scheme emerged in the last decade for finding -probabilistic robust designs. This technique, which is now a well-established technology (see, e.g., the recent surveys [9], [15]) in the area of robust control, is called “scenario design,” and was introduced in [4]. In scenario design one considers N . i.i.d. random samples of the uncertainty {q (1) , . . . , q (N ) } = ω , and builds a scenario random convex program (RCP): min θ∈Θ c> θ (2) s.t.: f (θ, q (i) ) ≤ 0, i = 1, . . . , N, where Θ is some given convex and compact domain, and c is the given objective direction. An optimal solution θ∗ to this problem, if it exists, is a random variable which depends on the multiextraction ω , i.e., θ∗ = θ∗ (ω). As a consequence, the violation probability relative to a scenario solution, V (θ∗ ), is itself, a priori, a random variable. Scenario design lies somewhere in between worst-case robust design (where c> θ is minimized subject to f (θ, q) ≤ 0 for all q ∈ Q) and chance-constrained design (where c> θ is minimized subject to V (θ) ≤ ). Indeed, the optimal objective value resulting from a scenario design is lower than the worst-case optimal objective and it is (with high probability) higher than a suitable chance-constrained optimal objective (see, e.g., Section 6 in [3]). Moreover, a fundamental feature of scenario design is that its optimal solution θ∗ (ω) is feasible with high probability for the chance-constrained problem. This key result is recalled next for the sake of clarity. We shall work under the following simplifying assumption, which is routinely made in the literature on scenario design; see [4], [7]. Assumption 1: With probability (w.p.) one with respect to the multi-extraction ω = {q (1) , . . . , q (N ) }, problem (2) is feasible and it attains a unique optimal solution θ∗ (ω). ? Also, we need the following standard definition (see, e.g., Definition 4 in [4]) Definition 1: Let J ∗ = c> θ∗ denote the optimal objective value of problem (2). Also, for j = 1, . . . , N , define . c> θ Jj∗ = min θ∈Θ s.t.: f (θ, q (i) ) ≤ 0, i ∈ {1, . . . , N } \ j. The i-th constraint in (2) is said to be a support constraint if Jj∗ < J ∗ . ? A key fact is that, regardless of the problem structure and of N , the number of support constraints for problem (2) cannot exceed n (the number of decision variables); see, e.g., Theorem 3 in [4]. If an instance of problem (2) happens to have precisely n support constraints, then the problem instance is said to be fully supported (f.s.); see Definition 3 in [7], and Definition 2.5 in [3]. If the instances of problem (2) are fully supported almost surely with respect to the random extraction ω of the N constraints, then we say that problem (2) is fully supported w.p. one. The following key result holds, see Theorem 1 in [7], and Corollary 3.4 in [3]. Theorem 1: Let Assumption 1 hold. Then, for given  ∈ [0, 1] and N ≥ n, it holds that . FV () = ProbN {ω : V (θ∗ (ω)) ≤ } (3)   N X N i ≥  (1 − )N −i (4) i i=n . = 1 − β (N ). Moreover, the bound (4) is tight, since it holds with equality for the class of problems of the form (2) that are fully supported with probability one. ? A remarkable feature of the result in (4) is that it holds irrespective of the probability distribution assumed on q , and that it depends on the problem structure only through the dimension parameter n. B. Scenario problems and Bernoulli trials For given  ∈ [0, 1] and N ≥ n, let us consider the following Bernoulli variable associated to problem (2):  1, if V (θ∗ (ω)) ≤  z = z(ω) = 0, otherwise. 3 By the definition in eq. (3), the event z = 1 happens w.p. FV (). One interpretation of eq. (4) is thus that each time we solve a scenario problem (2) we have an a priori probability ≥ 1 − β (N ) of realizing a “successful design,” that is of finding a solution θ∗ which is an -probabilistic robust design, and a probability ≤ β (N ) of realizing a “failure,” that is of finding a solution θ∗ which is not -probabilistic robust. In the classical scenario theory it is usually prescribed to choose N so to make β (N ) very small (values as low as −12 10 are common). This guarantees that the event {V (θ∗ (ω)) ≤ } will happen with “practical certainty.” In other words, in such regime, the scenario problem will return an -probabilistic robust solution with practical certainty. Moreover, a key feature of scenario theory is that such high level of confidence can be reached at a relatively “cheap” computational price. Indeed, considering the condition β (N ) ≤ β for some given desired probability level β ∈ (0, 1), and using some fairly standard techniques for bounding the Binomial tail (see, e.g., Corollary 5.1 in [3] for the details), one can prove that the condition is satisfied for1  2 ln β −1 + n − 1 . (5) N≥  Since β −1 appears in the above bound under a logarithm, we indeed see that N grows gracefully with the required certainty level β −1 . However, there are cases in which the number N of constraints prescribed by (5) for reaching the desired confidence levels is just too high for practical numerical solution. Convex optimization solvers are certainly efficient, but there are practical limits on the number of constraints they can deal with; these limits depend on the actual type of convex problem (say, a linear program (LP), or a semidefinite program (SDP)) one deals with. A critical situation is, for instance, when problem (2) is a semidefinite program (formally, f can be taken as the maximum eigenvalue function of the matrices describing the linear inequality constraints): dealing with an SDP with many thousands of LMI constraints can pose serious practical issues. C. Contribution In this paper we discuss how a variation of the scenario approach can be used for obtaining an -probabilistic robust solution with high confidence, using “small” values of N . More precisely, we are interested in using scenario optimization in a regime of N for which the right-hand side of eq. (4) is not close to one. We shall do so by solving repeatedly instances of the scenario problem, and checking the result via a suitable “violation oracle.” This novel approach, named repeated scenario design (RSD), is discussed in Section II, which contains all the relevant results. Section III describes two numerical examples of robust control design where the proposed approach is applied. For improving readability, technical proofs are reported in the Appendix. D. Notation and preliminaries We shall make intensive use of the beta and related probability distributions. Some definitions and standard facts are recalled next. We denote by beta(α, β) the beta density function with parameters α > 0, β > 0: . beta(α, β; t) = 1 tα−1 (1 − t)β−1 , B(α, β) t ∈ [0, 1], . −1 = α where B(α, β) = Γ(α)Γ(β) Γ(α+β) , and Γ is the Gamma function (for α, β integers, it holds that B(α, β) Also, we denote by Fbeta(α, β) the cumulative distribution function of the beta(α, β) density: Z t . Fbeta(α, β; t) = beta(α, β; ϑ)dϑ, t ∈ [0, 1]. α+β−1 β−1  ). 0 Fbeta(α, β; t) is the regularized incomplete beta function, and a standard result establishes that, for α, β integers, it holds that α+β−1 X α + β − 1 Fbeta(α, β; t) = ti (1 − t)α+β−1−i . i i=α 1 Notice that the expression the exact minimal value of N can be easily found numerically by searching for the  may be conservative; P in (5) N i N −i least integer N such that N ≥ 1 − β. i=n i  (1 − ) 4 The number x of successes in d independent Bernoulli trials each having success probability p is a random variable with Binomial distribution (which we denote by Bin(d, p)); its cumulative distribution is given by bzc   X d i Prob{x ≤ z} = Prob{x ≤ bzc} = t (1 − t)d−i i i=0   d X d i t (1 − t)d−i = 1− i i=bzc+1 = 1 − Fbeta(bzc + 1, d − bzc; t) ≤ 1 − Fbeta(z + 1, d − z; t) (6) = Fbeta(d − z, z + 1; 1 − t), where bzc denotes the largest integer no larger than z . The number x of successes in d binary trials, where each trial has success probability p, and p is itself a random variable with beta(α, β) distribution, is a random variable with so-called beta-Binomial distribution: for i = 0, 1, . . . , d,   . d B(i + α, d − i + β) f bb (d, α, β; i) = . (7) i B(α, β) The cumulative distribution of a beta-Binomial random variable is given by (see, e.g., [11], [19]) bzc X . f bb (d, α, β; i) F bb (d, α, β; z) = Prob{x ≤ z} = i=0 1 B(β + d − z − 1, α + z + 1) =1− Fd (a, b; z), d + 1 B(α, β)B(d − z, z + 2) where Fd (a, b; z) is the generalized hypergeometric function 3 F2 (1, α + z + 1, −n + z + 1; z + 2, −β − n + z + 2; 1). II. R EPETITIVE SCENARIO DESIGN This section develops the main idea of this paper. By repetitive scenario design (RSD) we here mean an iterative computational approach in which, at each iteration k , the scenario problem (2) is solved and then the ensuing solution θk∗ is checked by a violation oracle (either deterministic, or randomized, as illustrated next). If the oracle returns false, another iteration is performed; if instead the oracle returns true, the algorithm is terminated and the current solution θk∗ is returned. In the RSD the user selects a desired probabilistic feasibility level  ∈ (0, 1), and a number N ≥ n of scenarios to be used in (2). We have from Theorem 1 that, at any iteration k , it holds that ProbN {ω (k) : V (θk∗ ) ≤ } = FV () ≥ 1 − β (N ), (1) (N ) (8) where ω (k) denotes the multisample {qk , . . . , qk }. In very elementary terms, each iteration of the RSD method can be thought of as a biased “coin toss,” where the probability of a success in a toss (that is, getting θk∗ such that V (θk∗ ) ≤ ) is at least 1 − β (N ). In our setting, this probability need not be too close to one: the simple idea behind the RSD method is to repeat the coin toss until we obtain a success, where success is detected by the violation oracle. As one may easily argue intuitively, the probability of obtaining a success at some point in the algorithm is much higher than the probability of obtaining a success in a single toss. A similar idea has been recently proposed in [8], where the authors solve repeatedly a “reduced-size” scenario problem, followed by a randomized test of feasibility. The approach and the results in [8], however, are distinctively different from the ones proposed here. In [8], the scenario problems are solved using a number Nk of scenarios that grows with the iteration count k , up to the value N plain that corresponds to the plain, one-shot, scenario design. The major shortcoming of the approach and analysis in [8] is that the number of iterations is not bounded a-priori, either in a deterministic or in a probabilistic sense, and no tradeoff curve is proposed for the choice of Nk in function of the expected running time of the algorithm. As a result, there is no a-priori guarantee that the algorithm does not reach the final iteration, in which Nk equals 5 N plain , hence the worst-case complexity of the algorithm in [8] can be worse than the one of the plain scenario design method, and an actual reduction of the number of design samples is not theoretically guaranteed. We shall next analyze precisely the probabilistic features of our RSD algorithm in two cases. In the first case we assume that an ideal exact feasibility oracle is available for checking the current solution θk∗ ; this case may be unrealistic in general, but serves for providing an insightful preliminary analysis of the RSD approach. In the second case, we analyze the RSD approach when a practically implementable randomized feasibility oracle is used. A. Violation oracles A deterministic -violation oracle (-DVO) is a “black box” which, when given in input a value of the design variable θ, returns as output a flag value which is true if V (θ) ≤ , and false otherwise. Such an oracle may not realizable computationally in practice, since computing the probability in (1) is numerically hard, in general. For this reason, we next also introduce a randomized 0 -violation oracle (0 -RVO), which is defined by means of the randomized scheme described next. 0 -RVO (Randomized 0 -violation oracle) Input data: integer No , level 0 ∈ [0, 1], and θ ∈ Rn . Output data: a logic flag, true or false. . 1) Generate No i.i.d. samples ωo = {q (1) , . . . , q (No ) }, according to Prob. 2) ForPi = 1, . . . , No , let vi = 1 if f (θ, q (i) ) > 0 and vi = 0 otherwise. 3) If i vi ≤ 0 No , return true, else return false. The 0 -RVO simply evaluates the empirical probability of violation on No samples, and returns true if it is below and false otherwise. A similar type of randomized feasibility oracle has been previously introduced in [5], and used in a probabilistic design setting also in [6]; see also Section 11.1 in [18], and the “validation” step proposed in [8]. However, the 0 -RVO we propose in this paper is different from the one used in the cited references: the latter exits with a false flag as soon as one infeasible sample is found, whereas the 0 -RVO allows up to b0 No c infeasible samples before exit. Also, the kind of a priori analysis we develop here for the repetitive scenario design based on the 0 -RVO is entirely novel. 0 , B. Repetitive scenario design with ideal oracle We consider the following RSD algorithm, where each repetition consists of a plain scenario optimization step, followed by a feasibility check of the ensuing solution, performed by an exact feasibility oracle. Algorithm 1 (RSD with -DVO): Input data: integer N ≥ n, level  ∈ [0, 1]. Output data: solution θ∗ . Initialization: set iteration counter to k = 1. . (1) (N ) 1) (Scenario step) Generate N i.i.d. samples ω (k) = {qk , . . . , qk } according to Prob, and solve scenario problem (2). Let θk∗ be the resulting optimal solution. 2) (-DVO step) If V (θk∗ ) ≤ , then set flag to true, else set it to false. 3) (Exit condition) If flag is true, then exit and return current solution θ∗ ← θk∗ ; else set k ← k + 1 and goto 1. ? The following theorem holds. Theorem 2: Let Assumption 1 hold. Given  ∈ [0, 1] and N ≥ n, define the running time K of Algorithm 1 as the value of the iteration counter k when the algorithm exits. Then: 1) The solution θ∗ returned by Algorithm 1 is an -probabilistic robust design, i.e., V (θ∗ ) ≤ . 2) The expected running time of Algorithm 1 is ≤ (1 − β (N ))−1 , and equality holds if the scenario problem is f.s. w.p. 1. 3) The running time of Algorithm 1 is ≤ k with probability ≥ 1 − β (N )k , and equality holds if the scenario problem is f.s. w.p. 1. ? See Section A in the Appendix for a proof of Theorem 2. Remark 1 (Potential and limits of the RSD approach): The preliminary results in Theorem 2 show the potential of the RSD approach. Suppose that N is chosen so that β (N ) is about, say, 0.4. This means that a plain (i.e., one-shot) 6 scenario approach has only at least a 0.6 chance of returning a “good” solution (i.e., an -probabilistic robust design: a θ∗ such that V (θ∗ ) ≤ ). However, we see from point 3 of Theorem 2 that there is more than 1−10−9 probability that Algorithm 1 returns an -probabilistic robust design within 23 iterations. Further, the eventual outcome of Algorithm 1 is -probabilistic robust with probability one, and the expected number of iterations of the RSD algorithm is just (1 − 0.4)−1 = 1.67, in the worst case of a f.s. problem. Theorem 2 also shows a fundamental limit of the RSD approach: we can decrease N (and hence increase β (N )) with respect to a plain scenario design approach, but we cannot decrease N too much, for otherwise β (N ) → 1, and the expected number of iterations of Algorithm 1 tends to ∞. There is thus a fundamental tradeoff between the reduction of N (which reduces the effort needed for solving the scenario problem) and the increase of the number of iterations of Algorithm 1. This tradeoff can be fully captured by plotting the expected running time bound (1 − β (N ))−1 versus the number N of scenarios. C. Repetitive scenario design with randomized oracle This section contains the main contribution of this paper, where we consider a realistically implementable version of the RSD approach, in which a randomized oracle is used instead of the ideal deterministic one. Algorithm 2 (RSD with 0 -RVO): Input data: integers N , No , level 0 ∈ [0, 1]. Output data: solution θ∗ . Initialization: set iteration counter to k = 1. . (1) (N ) 1) (Scenario step) Generate N i.i.d. samples ω (k) = {qk , . . . , qk } according to Prob, and solve scenario ∗ problem (2). Let θk be the resulting optimal solution. 2) (0 -RVO step) Call the 0 -RVO with current θk∗ as input, and set flag to true or false according to the output of the 0 -RVO. 3) (Exit condition) If flag is true, then exit and return current solution θ∗ ← θk∗ ; else set k ← k + 1 and goto 1. ? A generic iteration, or stage, k , of Algorithm 2 is illustrated in Figure 1. () () ‘ Fig. 1. Generic stage k of Algorithm 2. We next analyze Algorithm 2 along two directions. First, contrary to Algorithm 1, the present algorithm may exit with a solution which is not -probabilistic robust. This is due to the randomized nature of the oracle, which may detect a “false positive,” by misclassifying as good a solution θk∗ for which V (θk∗ ) > . We show that the probability of such a “bad exit” event can be made arbitrarily small. Second, we fully characterize the probabilistic running time (iterations to exit) of the algorithm. We start with the following key preliminary lemma, which is the backbone of the whole paper. Lemma 1: Let Assumption 1 hold and, for any given iteration k , define the events True = {0 -RVO returns true} GoodTrue = {0 -RVO returns true ∩ V (θk∗ ) ≤ } BadTrue = {0 -RVO returns true ∩ V (θk∗ ) > } 7 Let f bb (No , n, N + 1 − n; i)   . No B(i + n, No − i + N − n + 1) = , i B(n, N + 1 − n) H,0 (N, No ) 0 b No c X . =1− f bb (No , n, N + 1 − n; i) · i=0 · Fbeta(n + i, N + No − n − i + 1; ), H1,0 (N, No ) 0 b No c X . =1− f bb (No , n, N + 1 − n; i), i=0 β̄,0 (N, No ) . = Fbeta(N + (1 − 0 )No − n + 1, n + 0 No ; 1 − ). At any iteration k of Algorithm 2, it holds that ,ProbN +No {True} ≥ 1 − H1,0 (N, No ) N +No Prob (9) {GoodTrue} ≥ 1 − H,0 (N, No ) (10) ≥ (1 − β̄,0 (N, No ))(1 − H1,0 (N, No )). (11) N +No (12) Prob {BadTrue} 0 0 ≤ Fbeta((1 −  )No ,  No + 1; 1 − )β (N ). Moreover, if problem (2) is f.s. w.p. one, then bounds (9) and (10) hold with equality, and ProbN +No {BadTrue} = H,0 (N, No ) − H1,0 (N, No ) ≤ β̄,0 (N, No )(1 − H1,0 (N, No )). (13) ? See Section B in the Appendix for a proof of Lemma 1. We can now state the main result concerning Algorithm 2. Theorem 3: Let Assumption 1 hold. Let , 0 ∈ [0, 1], 0 ≤ , and N ≥ n be given. Let all the notation be set as in Lemma 1, and let Prob×× denote the product probability ProbN +No × ProbN +No × · · · . Define the event BadExit in which Algorithm 2 exits returning a “bad” solution θ∗ : . BadExit = {Algorithm 2 returns θ∗ : V (θ∗ ) > }. The following statements hold. 1) Prob×× {BadExit} Fbeta((1 − 0 )No , 0 No + 1; 1 − ) ≤ β (N ). 1 − H1,0 (N, No ) If problem (2) is f.s. w.p. one, then it actually holds that Prob×× {BadExit} ≤ β̄,0 (N, No )). ))−1 , (14) (15) and equality holds if the scenario The expected running time of Algorithm 2 is ≤ (1 − H1,0 (N, No problem is f.s. w.p. 1. 3) The running time of Algorithm 2 is ≤ k with probability ≥ 1 − H1,0 (N, No )k , and equality holds if the scenario problem is f.s. w.p. 1. ? See Section C in the Appendix for a proof of Theorem 3. 2) 8 1) Asymptotic bounds: A key quantity related to the expected running time of Algorithm 2 is H1,0 (N, No ), which is the upper tail of a beta-Binomial distribution. This quantity is related to the hypergeometric function 3 F2 , and to ratios of Gamma functions, which may be delicate to evaluate numerically for large values of the arguments. It is therefore useful to have a more “manageable,” albeit approximate, expression for H1,0 (N, No ). The following corollary gives an asymptotic expression for H1,0 (N, No ), see Section D in the Appendix for a proof. Corollary 1: For No → ∞ it holds that H1,0 (N, No ) → β0 (N ). (16) ? An interesting consequence of Corollary 1 is that, for large No , and 0 ≤ , we have H1,0 (N, No ) ' β0 (N ) ≥ β (N ), from which we conclude that 1 1 1 . ' ≥ . (17) K̂ = 1 − H1,0 (N, No ) 1 − β0 (N ) 1 − β (N ) This last equation gives us an approximate, asymptotic, expression for the upper bound K̂ on the expected running time of Algorithm 2, and also tells us that, for 0 ≤ , this bound cannot be better (smaller) than the corresponding bound of the “ideal” Algorithm 1. D. Practical dimensioning of the scenario and oracle blocks In a typical probabilistic design problem we are given the dimension n of the decision variable and the level  ∈ (0, 1) of probabilistic robustness we require from our design. If we intend to use a randomized approach, we also set a confidence level 1 − β ∈ (0, 1), which is the a-priori level of probability with which our randomized approach will be successfull in returning an -probabilistic robust design. In a plain (i.e., non repetitive) scenario design setting, this requires dimensioning the number N of scenarios so to guarantee that β (N ) ≤ β ; this can be done, for instance, by using the bound in (5), or via a simple numerical search over N . However, if the required N turns out to be too large in practice (e.g., the ensuing scenario optimization problem becomes impractical to deal with numerically), we can switch to a repetitive scenario design approach. In such a case, we suggest the following route for designing the scenario and oracle blocks. Let us first select a level 0 ≤  to be used in the oracle. Qualitatively, decreasing 0 increases the expected running time and decreases the required No , and the converse happens for increasing 0 . We here suggest to set 0 in the range [0.5, 0.9]. 1) Dimensioning the scenario block: We dimension the scenario optimization block by choosing N so to achieve a good tradeoff between the complexity of the scenario program (which grows with N ) and the expected number of iterations required by the RSD approach (which decreases with N ). This choice can be made, for instance, by plotting the approximate expression (which becomes exact as No → ∞) in (17) for the upper bound on the expected running time of Algorithm 2, (1 − β0 (N ))−1 , versus N , and selecting a value of N for which this running time is acceptable. 2) Dimensioning the oracle block: Once N has been selected according to the approach described above, we consider point 1 and point 2 in Theorem 3 and we dimension the 0 -RVO block by searching numerically for an No such that the right-hand side of (14) (or of (15), if the problem is f.s.) is ≤ β . Remark 2: We observe that, in general, the bound in (14) should be used for the design of the 0 -RVO block. However, the expression in (15) is easier to deal with than the one in (14). It is hence advisable to use the former in a preliminary dimensioning phase; the so-obtained values can then be verified ex-post against the actual bound in (14). Another advantage of (15) is that, using a bounding technique analogous to the one described in Section 5 of [3], we can “invert” the condition β̄,0 (N, No ) ≤ β , finding (after some manipulation) that this condition is satisfied if  . No δ + N (δ/2 + 0 ) ≥ ln β −1 + n − 1, δ =  − 0 > 0. (18) δ With a choice of the pair (N, No ) such that (18) is satisfied, we guarantee a priori that our randomized Algorithm 2 may fail in returning an -probabilistic robust design w.p. at most β , as desired (rigorously, this only holds under the assumption that the scenario problem is f.s. w.p. one). The nice feature highlighted by (18) is that now the “workload” necessary to achieve the desired failure level β is subdivided between N (samples in the scenario problem) and No (samples in the oracle): a lower complexity scenario problem can be employed, as long as it is 9 paired with a randomized oracle having a suitable No . Notice, however, that, in making the choice of the (N, No ) pair, the expected running time of Algorithm 2 should also taken into consideration, and that this places a lower limit on how small N can be, see also the discussion in Section II-C1. Remark 3: We further observe that, in typical cases, dealing with large No is a milder problem than dealing with large N . This is due to the fact that merely checking satisfaction of inequality f (θk∗ , q (i) ) > 0, for i = 1, . . . , No , is generally easier than solving a related optimization problem with as many constraints. Also, we remark that the 0 -RVO algorithm is inherently parallel, so an M -fold speedup can potentially be gained if M processors are available in parallel for the randomized feasibility test. Actually, the whole approach can be formulated in a fully parallel – instead of sequential – form, where W workers solve in parallel W instances of scenario problems, and each worker has its own M parallel sub-workers to be used in the randomized oracle. Such a parallel version of the RSD method can be easily analyzed using the probabilistic tools developed in this paper. III. N UMERICAL EXAMPLES We exemplify the steps of the RSD approach, from algorithm dimensioning to numerical results, using two examples of robust control design. The first example deals with robust finite-horizon input design for an uncertain linear system, while the second example deals with robust performance design for a positive linear system. A. Robust finite-horizon input design We consider a system of the form x(t + 1) = A(q)x(t) + Bu(t), t = 0, 1, . . . ; x(0) = 0, where u(t) is a scalar input signal, and A(q) ∈ Rna ,na is an interval uncertain matrix of the form A(q) = A0 + na X qij ei e> j , |qij | ≤ ρ, ρ > 0, i,j=1 where ei is a vector of all zeros, except for a one in the i-th entry. Given a final time T ≥ 1 and a target state x̄, the problem is to determine an input sequence {u(0), . . . , u(T − 1)} P such that (i) the state x(T ) is robustly contained in a small ball around the target state x̄, and (ii) the input energy k u(k)2 is not too large. We write x(T ) = x(T ; q) = . R(q)u, where R(q) is the T -reachability matrix of the system (for a given q ), and u = (u(0), . . . , u(T − 1)). Then, we formally express our design goals in the form of minimization of a level γ such that kx(T ; q) − x̄k22 + λ T −1 X u(t)2 ≤ γ, t=0 where λ ≥ 0 is a tradeoff parameter. Letting θ = (u, γ), the problem is formally stated in our framework by setting . f (θ, q) ≤ 0, where f (θ, q) = kR(q)u − x̄k22 + λkuk22 − γ. Assuming that the uncertain parameter q is random and uniformly distributed in the hypercube Q = [−ρ, ρ]na ×na , our scenario design problem takes the following form: min γ θ=(u,γ) s.t.: f (θ, q (i) ) ≤ 0, i = 1, . . . , N. a) Dimensioning the RSD algorithm: We set T = 10, thus the size of the decision variable θ = (u, γ) of the scenario problem is n = 11. We set the desired level of probabilistic robustness to 1 −  = 0.995, i.e.,  = 0.005, and require a level of failure of the randomized method below β = 10−12 , that is, we require the randomized method to return a good solution with “practical certainty.” Using a plain (one-shot) scenario approach, imposing β (N ) ≤ β would require N ≥ 10440 scenarios. Let us now see how we can reduce this N figure by resorting to a repetitive scenario design approach. Let us fix 0 = 0.7 = 0.0035, thus δ =  − 0 = 0.0015. A plot of the (asymptotic) bound on expected number of iterations, (1 − β0 (N ))−1 , as a function of N is shown in Figure 2. We see from this plot, for instance, that the 10 3 10 2 10 1 10 0 10 3 10 Fig. 2. 4 10 Example in Section III-A: Log-log plot of (1 − β0 (N ))−1 vs. N .     A0 =     −0.7214 0.5704 −1.3983 −0.6308 0.7539 −1.3571 −0.0578 0.1762 −0.1795 −0.0058 0.1423 −0.1769 0.2757 0.7255 0.2171 0.3901 0.3684 −0.0971 0.6822 −0.5604 0.1511 1.0531 −0.1601 0.9031 0.4422 0.8169 0.512 0.2105 0.2039 −0.3757 0.5088 −0.6081 0.1076 1.0032 −0.1781 0.9151     ,        B=    0 1 0 1 0 1         choice N = 2000 corresponds to a value of about 10 for the upper bound on the expected number of iterations in Algorithm 2. Let us choose this value of N for the scenario block. For β = 10−12 , the simplified condition in (18) tells us that No ≥ 62403. Let us choose No = 63000 samples to be used in the oracle. With the above choices we have H1,0 (N, No ) = 0.8963, thus the algorithm’s upper bound on average running time is K̂ = (1 − H1,0 (N, No ))−1 = 9.64. Notice that this upper bound is tight for f.s. problems, but it is conservative for problems that are not necessarily f.s. Thus, in general, we may expect a performance which is in practice better than the one predicted by the theoretical worst-case bound. b) Numerical test: We considered the nominal matrix A0 of dimension na = 6 and B matrix shown on top of this page, with target state x̄ = [1, −1/2, 2, 1, −1, 2]> , ρ = 0.001, and λ = 0.005. We run Algorithm 2 for 100 times, and on each test run we recorded the number of iterations and the solution returned upon exit. Figure 3(a) shows the number of repetitions in the test runs: we see that the algorithm exited most of the times in a single repetition, with a maximum of 4 repetitions, which is below the figure predicted by the upper bound K̂ = 9.64: practical performance was thus better than predicted, which suggests that the problem at hand is not fully supported w.p. 1. Figure 3(b) shows the level of empirical violation probability evaluated by the oracle upon exit. Finally, Figure 4(a) shows the optimal γ level returned by the algorithm in the test runs, and Figure 4(b) shown the optimal input signal returned by the algorithm, averaged over the 100 test runs. c) Computational improvements: In this example, the RSD approach permitted a substantial reduction of the number of design samples (from the 10440 samples required by the plain scenario method, to just 2000 samples), at the price of a very moderate number of repetitions (the average number of repetitions in the 100 test runs was 1.27). The numerical experiments were carried out on an Intel Xeon X5650 machine using CVX under Matlab; [10]. On average over the 100 test experiments, the RSD method (with N = 2000, No = 63000) required 224 s to return a solution. For comparison purposes, we also run a plain, one-shot, scenario optimization with the N = 10440 scenarios that are required to attain the desired β = 10−12 level: the time required for obtaining such a solution was 2790 s. Using the RSD approach instead of a plain one-shot scenario design thus yielded a reduction in computing time of about one order of magnitude. The reason for this improvement is due to the fact that the scenario optimization problem in the RSD approach (which uses N = 2000 scenarios) took about 173 s to be solved on a typical run, and the subsequent randomized oracle test (with No = 63000) is computationally cheap, taking only about 3.16 s. 11 (a) 4 3.5 3.5 3 3 Number of iterations (b) −3 x 10 2.5 2.5 2 2 1.5 1.5 1 1 0.5 0.5 0 0 10 20 30 40 50 Test run 60 70 80 90 0 100 0 10 20 30 40 50 Test run 60 70 80 90 100 Fig. 3. Example in Section III-A: (a) Repetitions of Algorithm 2 in the 100 test runs. (b) Levels of empirical violation probability evaluated by the oracle upon exit, in the 100 test runs. (a) 0.0565 0.056 0.3 0.0555 0.25 0.2 0.0545 u(t) γ 0.055 0.054 0.15 0.1 0.0535 0.05 0.053 0.0525 (b) 0.35 0 10 20 30 40 50 Test run 60 70 80 90 0 100 0 1 2 3 4 t 5 6 7 8 9 Fig. 4. Example in Section III-A: (a) Optimal γ level returned by Algorithm 2 in the 100 test runs. (b) Average over the 100 test runs of the optimal input u(t) returned by Algorithm 2. w x2 x1 x4 x3 Fig. 5. Example in Section III-B: A network model. B. An uncertain linear transportation network As a second example, we consider a variation on a transportation network model introduced in Section 3 of [17]; see Figure 5. The model is described by the state equations where the states xi , i = 1, . . . , 4, represent the contents of four buffers, the parameters `ij ≥ 0 represent the rate of transfer from buffer j to buffer i, w(t) ≥ 0 is an input flow on 12    −1 − `31 `12 0 0    0 −`12 − `32 `23 0 x +  ẋ =     `31 `32 −`23 − `43 `34 0 0 `43 −4 − `34   1 1 1 1 x. y = min  0 1  w 0  0 γ `12 ,`23 ,`32 ∈[0,1];γ ξ≥0    s.t.:   (i) −3 − q1 0 2 + q1 0 min `12 0 0 −`12 − `32 `23 0 (i) (i) `32 −`23 − 2 − q3 1 + q2 (i) (i) 0 2 + q3 −5 − q2 Cξ < γ1.    s.t.:   (i) −3 − q1 0 (i) 2 + q1 0 (20) (21)     ξ + B1 < 0, i = 1, . . . , N  γ µ≥0;ξ≥0;γ (19) (22)   0 0 0 1 0 0   0 0 0   −1 −1 1 (i) (i)  ξ +  0 1 −1 0 −2 − q3 1 + q2  (i) (i) 0 0 0 0 2 + q3 −5 − q2 Cξ < γ1, µ12 ≤ ξ2 , µ32 ≤ ξ2 , µ23 ≤ ξ3 .    µ + B1 < 0, i = 1, . . . , N  the second buffer, and we take as output y the total content of the buffers; see eq. (19)-(20). We consider the situation in which `31 = 2 + q1 , `34 = 1 + q2 , `43 = 2 + q3 , where ` = [`12 `23 `32 ]> ∈ [0, 1]3 is a vector of parameters to be designed, and q = [q1 q2 q3 ]> is an uncertainty term, which is assumed to be a truncated Normal random vector with zero mean, covariance matrix Σ = 0.22 I , and kqk∞ ≤ 1. This system has the form ẋ = A(`, q)x + Bw, y = Cx, where B ≥ 0, C ≥ 0 (element-wise), and the A(`, q) matrix is Metzler (i.e., the off-diagonal entries of A are nonnegative). Theorem 4 in [17] states that, for given `, q , this system is stable and the peak-to-peak gain from w to y is smaller that some given γ if and only if there exist ξ ≥ 0 such that      A(`, q) B ξ 0 < , C 0 1 γ1 where 1 is a vector of ones. By taking N i.d.d. samples q (i) of q , a robust scenario design problem is one in which one seeks to minimize the peak-to-peak gain γ subject to the above constraint on the scenarios; see eq. (21). This problem is a “robustified” version of the one discussed in Section V of [17]. The problem as stated is not convex, due to the product terms between entries in ξ and `. However, by introducing new variables µ12 = `12 ξ2 , µ32 = `32 ξ2 , µ23 = `23 ξ3 , we rewrite the problem as an LP in the variables ξ , µ = [µ12 µ32 µ23 ]> , and γ ; see eq. (22). d) Dimensioning the RSD algorithm: The size of the decision variable θ = (ξ, µ, γ) of the scenario problem is n = 8. As in the previous example, we set the desired level of probabilistic robustness to 1 −  = 0.995, i.e.,  = 0.005, and require a level of failure of the randomized method below β = 10−12 . Using a plain (one-shot) scenario approach, imposing β (N ) ≤ β would require N ≥ 9197 scenarios. We next reduce this N figure by resorting to a repetitive scenario design approach. Let us fix 0 = 0.7 = 0.0035, thus δ =  − 0 = 0.0015. Plotting the asymptotic bound on expected number of iterations, (1 − β0 (N ))−1 as a function of N (as we did in Figure 2 for the previous example), we see that the 13 choice N = 1340 corresponds to a value of about 10 for the upper bound on the expected number of iterations in Algorithm 2. Let us choose this value of N for the scenario block. For β = 10−12 , the simplified condition in (18) tells us that No ≥ 62273 samples can be used in the randomized feasibility oracle. With the above choices we have H1,0 (N, No ) = 0.8931, thus the algorithm’s upper bound on average running time is K̂ = (1−H1,0 (N, No ))−1 = 9.36 (notice again that, in general, we may expect a performance which is in practice better than the one predicted by this theoretical worst-case bound, since the the actual problem may not be fully supported). e) Numerical test and computational performance: We first solved the problem via a plain scenario approach, using N = 9197 scenarios. The computational time was of about 50 s, resulting in the following optimal solution:     0.2314 0.5000  0.5000     ξ=  1.7206  , µ = 0.5000 , γ = 3.4283. 0.0000 0.9763 Next, we run the RSD method (Algorithm 2, with N = 1340, No = 62273) for 100 times, and on each test run we recorded the number of iterations and the solution returned upon exit. Figure 6(a) shows the number of repetitions in the test runs: we see that the algorithm exited most of the times in a single repetition, with a maximum of 3 repetitions; average 1.24 repetitions. Figure 6(b) shows the level of empirical violation probability evaluated by the oracle upon exit. Finally, Figure 7 shows the optimal γ level returned by the algorithm in the test runs. The average (over the 100 test trials) running time of the RSD method was about 6.4 s. Since the plain scenario approach required about 50 s, it was about 680% slower than the newly proposed RSD approach, in this test example. Each repetition of the RSD method required about 4.6 s for solving the scenario problem (with N = 1340), and 0.6 s for the randomized oracle check (with No = 62273); once again, we observe that the oracle time was much lower than the scenario optimization time. (b) (a) 3 3.5 -3 3 2.5 Number of iterations # 10 2.5 2 2 1.5 1.5 1 1 0.5 0 0.5 0 10 20 30 40 50 Test run 60 70 80 90 100 0 0 10 20 30 40 50 Test run 60 70 80 90 100 Fig. 6. Example in Section III-B: (a) Repetitions of Algorithm 2 in the 100 test runs. (b) Levels of empirical violation probability evaluated by the oracle upon exit, in the 100 test runs. IV. C ONCLUSIONS Repetitive scenario design generalizes the scenario approach to robust design by setting up an iterative procedure whereby scenario design trials are followed by a randomized check on the feasibility level of the solution. The expected number of repetitions (or trials) in this procedure is dictated by the key quantity H1,0 (N, No ), which is well approximated, for large No , by β0 (N ). For H1,0 (N, No ) → 0 we recover the extreme situation of the standard, one-shot, scenario design, in which a valid solution is found in a single repetition, at the cost of possibly large N . For smaller N values, we can trade off complexity in the solution of the scenario problem for additional iterations in the RSD algorithm. The extent to which N can be reduced is however limited by the upper bound K̂ we impose 14 3.8 3.6 3.4 . 3.2 3 2.8 2.6 2.4 0 10 20 30 40 50 60 70 80 90 100 Test run Fig. 7. Example in Section III-B: Optimal γ level returned by Algorithm 2 in the 100 test runs. on the expected running time, since eq. (17) tells us that H1,0 (N, No ) ' β0 (N ) ≤ 1 − K̂ −1 . Numerical examples showed that the proposed RSD approach may lead to improvements in computational time of about one order of magnitude, compared to a plain scenario approach. A PPENDIX A. Proof of Theorem 2 The first point of the theorem is obvious, sice the algorithm terminates if and only if true is returned by the deterministic oracle, which happens if and only if the condition V (θk∗ ) ≤  is satisfied. For point two, let zk = zk (ω (k) ), k = 1, . . ., be i.i.d. Bernoulli variables representing the outcome of the -DVO step at each iteration, i.e., zk = 1 if V (θk∗ ) ≤  (oracle returns true), and zk = 0 otherwise (oracle returns false). From eq. (8) we observe that the probability of zk = 1 is FV () ≥ 1 − β (N ). Since the algorithm terminates as soon as a true is returned by the oracle, the running time of the algorithm is defined as the random variable . K = {iteration k at which true is returned for the first time}. Clearly, K has a geometric distribution Prob× {K = k} = (1 − FV ())k−1 FV (), where Prob× denotes the product probability measure over ω (1) , ω (2) , . . . The mean of this geometric distribution is 1/FV (), whence 1 1 ≤ , E{K} = FV () 1 − β (N ) which proves the second point (note that equality holds if the scenario problem is f.s. w.p. one). The cumulative of the above geometric distribution is Prob× {K ≤ k} = 1 − (1 − FV ())k . This function is increasing in FV (), thus FV () ≥ 1 − β (N ) implies Prob× {K ≤ k} ≥ 1 − β (N )k , which proves the third point.  B. Proof of Lemma 1 At any given iteration k of Algorithm 2, let us consider the sequence of binary random variables appearing inside the 0 -RVO:  1 if f (θk∗ , q (i) ) > 0 vi = i = 1, . . . , No 0 otherwise, By definition, we have that Prob{q : f (θk∗ , q) > 0} = V (θk∗ ), and V (θk∗ ) is a random variable with cumulative distribution function given by FV . Therefore, for given V (θk∗ ) = p, the vi s form an i.i.d. Bernoulli sequence with success probability p. However, p is itself a random variable having cumulative distribution FV . Therefore, the vi s form a so-called conditionally i.i.d. Bernoulli sequence [1], having FV as the directing de Finetti measure. In simpler terms, the vi s are described by a compound distribution: first a success probability p is extracted at random according to its directing distribution FV , and then the vi s are 15 . PNo vi . Conditional on V (θk∗ ) = p, generated according to an i.i.d. Bernoulli distribution with success probability p. Let S = i=1 the random variable S has Binomial distribution Bin(No , p) thus, from (6), ProbNo {S ≤ z|V (θk∗ ) = p} =  bzc  X No i p (1 − p)No −i i i=0 = Fbeta(No − bzc, bzc + 1, 1 − p) = 1 − Fbeta(bzc + 1, No − bzc, p) ≤ 1 − Fbeta(z + 1, No − z, p). Considering eq. (4), we next let . FV (t) = Fbeta(n, N + 1 − n; t) + Ψ(t), t ∈ [0, 1], (23) (24) where Ψ(t) is some unknown function such that 0 ≤ Ψ(t) ≤ 1 − Fbeta(n, N + 1 − n; t), for all t ∈ [0, 1], and Ψ(0) = Ψ(1) = 0. Observe that Ψ(t) is identically zero if the scenario problem is f.s. w.p. one. Consider the event . GoodTrue = {True ∩ V (θk∗ ) ≤ } {S ≤ b0 No c ∩ V (θk∗ ) ≤ }. = . Leting z = b0 No c, we have that ProbN +No {GoodTrue} = ProbN +No {S ≤ z ∩ V (θk∗ ) ≤ } Z  = ProbNo {S ≤ z|V (θk∗ ) = t}dFV (t) 0 Z  [using (23)] = Fbeta(No − z, z + 1; 1 − t)dFV (t) 0 [using (24)] = (1 − H,0 (N, No )) + R(), (25) where we defined . H,0 (N, No ) =  Z 1− Fbeta(No − z, z + 1; 1 − t) · 0 . R() = · beta(n, N + 1 − n; t)dt Z  Fbeta(No − z, z + 1; 1 − t)dΨ(t). (26) (27) 0 We next analyze the above two terms. For the first term, we have 1 − H,0 (N, No ) Z  = Fbeta(No − z, z + 1; 1 − t)beta(n, N + 1 − n; t)dt 0  z Z  X No i t (1 − t)No −i · [using (23)] = i 0 i=0 · beta(n, N + 1 − n; t)dt  z Z  X No 1 = ti+n−1 (1 − t)No −i+N −n dt i B(n, N + 1 − n) 0 i=0  z Z  X No B(i + n, No − i + N − n + 1) = · i B(n, N + 1 − n) i=0 0 · beta(i + n, No − i + N − n + 1; t)dt z Z  X [by def. in (7)] = f bb (No , n, N + 1 − n; i) · i=0 0 · beta(i + n, No − i + N − n + 1; t)dt = z X f bb (No , n, N + 1 − n; i) · i=0 · Fbeta(n + i, N + No − n − i + 1; ). (28) 16 Observe that, for all i = 0, . . . , z, it holds that Fbeta(n + i, N + No − n − i + 1; )  NX +No  N + No j =  (1 − )N +No −j j j=n+i  NX +No  N + No j ≥  (1 − )N +No −j j j=n+z = Fbeta(n + z, N + No − n − z + 1; ). Therefore, we obtain following bound 1 − H,0 (N, No ) ≥ Fbeta(n + z, N + No − n − z + 1; ) z X · f bb (No , n, N + 1 − n; i) i=0 = (1 − Fbeta(N + No − n − z + 1, n + z; 1 − )) · · (1 − H1,0 (N, No )) . For z = b0 No c, we have, in particular, that 1 − H,0 (N, No ) ≥ (1 − Fbeta(N + No − n − b0 No c + 1, n + b0 No c; 1 − )) · (1 − H1,0 (N, No )) ≥ (1 − Fbeta(N + (1 − 0 )No − n + 1, n + 0 No ; 1 − )) · (1 − H1,0 (N, No ))  . = 1 − β̄,0 (N, No ) · (1 − H1,0 (N, No )) . We next consider the R() term in (27). We have that Z  R() = (1 − Fbeta(z + 1, No − z; t))dΨ(t) 0 Z  = Ψ() − Fbeta(z + 1, No − z; t)dΨ(t) (29) (30) 0 [integrating by parts] = Ψ()Fbeta(No − z, z + 1; 1 − ) Z  + Ψ(t)beta(z + 1, No − z; t)dt. 0 Since Ψ(t) ≥ 0 forall t ∈ [0, 1], the above expression shows that R() ≥ 0 for all  ∈ [0, 1], with R() being identically zero for problems that are f.s. Considering (25), this fact permits us to conclude that ProbN +No {GoodTrue} = ProbN +No {S ≤ z ∩ V (θk∗ ) ≤ } = [from (29)] 1 − H,0 (N, No ) + R() ≥ 1 − H,0 (N, No )  ≥ 1 − β̄ (N, No ) · · (1 − H1,0 (N, No )) , which proves (10) and (11). Also, we obtain that ProbN +No {True} . = ProbN +No {S ≤ z} = ProbN +No {S ≤ z ∩ V (θk∗ ) ≤ 1} = 1 − H1,0 (N, No ) + R(1) ≥ 1 − H1,0 (N, No ), 17 which proves (9). Further, using (25), we have that ProbN +No {BadTrue} . = ProbN +No {S ≤ z ∩ V (θk∗ ) > } = ProbN +No {True} −ProbN +No {GoodTrue} = H,0 (N, No ) − H1,0 (N, No ) +(R(1) − R()). If the scenario problem is f.s., then R(1) = R() = 0, hence ProbN +No {BadTrue} = H,0 (N, No ) − H1,0 (N, No ) +(R(1) − R()) [if problem is f. s.] = [using (29)] ≤ H,0 (N, No ) − H1,0 (N, No ) β̄,0 (N, No )(1 − H1,0 (N, No )). All the above proves (13). To upper bound the probability of BadTrue in the non-fully supported case, we reason instead as follows: ProbN +No {BadTrue} Z 1 = ProbNo {S ≤ z|V (θk∗ ) = t}dFV (t)  Z 1 = Fbeta(No − z, z + 1; 1 − t)dFV (t)  [integrand is decreasing in t] Z 1 ≤ Fbeta(No − z, z + 1; 1 − )dFV (t)  Z 1 = Fbeta(No − z, z + 1; 1 − ) dFV (t)  = Fbeta(No − z, z + 1; 1 − ) · ProbN {V (θk∗ ) > } [from (4)] ≤ Fbeta(No − z, z + 1; 1 − ) · Fbeta(N + 1 − n, n; 1 − ) [since z = b0 No c] ≤ Fbeta((1 − 0 )No , 0 No + 1; 1 − ) · β (N ),  which proves (13). C. Proof of Theorem 3 Let us define the event BadExitk as the one where the algorithm reaches the k-th iteration, and then exits with a “bad” solution, i.e., with a solution θk∗ for which V (θk∗ ) > . The probability of this event is the probability that the 0 -RVO returns false precisely k − 1 times (for this guarantees that we reach the k-th iteration), and then the event BadTrue happens at the k-th iteration. Therefore, letting q denote the probability of BadTrue, and p denote the probability of True (events defined as in Lemma 1) we have that Prob×× {BadExitk } = (1 − p)k−1 q. The event BadExit in which the algorithm terminates with a bad solution is the union of the non-overlapping events BadExitk , k = 1, 2, . . ., therefore Prob×× {BadExit} = = ∞ X Prob×× {BadExitk } k=1 ∞ X (1 − p)k−1 q = q k=1 (1 − p)k k=0 N +No = ∞ X Prob {BadTrue} q = . p ProbN +No {True} 18 We now use (12) to upper bound q, and then use (9) to conclude that Prob×× {BadExit} Fbeta((1 − 0 )No , 0 No + 1; 1 − )β (N ) ≤ , 1 − H1,0 (N, No ) which proves (14). In the fully supported case, we can instead use (13) to upper bound q, and hence conclude that Prob×× {BadExit} ≤ β̄,0 (N, No ), which proves (15). Let next K denote the running time of Algorithm 2, that is the value of the iteration count when the algorithm terminates. Since the algorithm terminates as soon as a True event happens, and since the True events are statistically independent among iterations, we have that {K = k} has geometric probability (1 − p)k−1 p, where p is the probability of True. Therefore, the expected value of K is 1/p ≤ 1/(1 − H1,0 (N, No )), where the inequality follows from (9), and this proves point 2 in the theorem. Via the same reasoning, {K > k} has probability (1 − p)k , and hence we conclude that Prob×× {K ≤ k} = 1 − (1 − p)k ≥ 1 − H1,0 (N, No )k ,  which proves the third point in the theorem. D. Proof of Corollary 1 . From from eq. (28) we have that, for z = b0 No c, 1 − H1,0 (N, No ) = Z 1 Fbeta(No − z, z + 1; 1 − t)beta(n, N + 1 − n; t)dt. (31) 0 We recall that a beta(α, β) density has mean α/(α + β), peak (mode) at (α − 1)/(α + β − 2), and variance σ 2 = αβ/((α + β)2 (α + β + 1)). Then, we observe that Fbeta(No − z, z + 1; 1 − t) = 1 − Fbeta(z + 1, No − z; t), where Fbeta(z + 1, No − z; t) is the cumulative distribution of a beta(z + 1, No − z) density. The peak of this density is at z/(No − 1), which tends to 0 for No → ∞; further, the variance of this distribution goes to zero as O(No−1 ), which permits us to argue that, for large No , the function Fbeta(No − z, z + 1; 1 − t) has an inflection point near 0 and decreases rapidly from value ' 1 to value ' 0 as t crosses 0 . That is, as No → ∞, the function Fbeta(No − z, z + 1; 1 − t) tends to a step function which is one for t < 0 and zero for t > 0 . Therefore, we have for the integral in (31) that Z 0 1 − H1,0 (N, No ) → 1 · beta(n, N + 1 − n; t)dt 0 = Fbeta(n, N + 1 − n; 0 ) = 1 − β0 (N ),  which proves (16). R EFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9] D. Aldous. Exchangeability and related topics. In P.L. Hennequin, editor, École d’Été de Probabilités de Saint-Flour XIII, volume 1117 of Lecture Notes in Math., pages 1–198. Springer, 1983. G. Calafiore and L. El Ghaoui. Optimization Models. Cambridge University Press, 2014. G.C. Calafiore. Random convex programs. SIAM Journal on Optimization, 20(6):3427–3464, 2010. G.C. Calafiore and M.C. Campi. The scenario approach to robust control design. IEEE Transactions on Automatic Control, 51(5):742–753, 2006. G.C. Calafiore and F. Dabbene. A probabilistic analytic center cutting plane method for feasibility of uncertain LMIs. Automatica, 43:2022–2033, 2007. G.C. Calafiore, F. Dabbene, and R. Tempo. Research on probabilistic methods for control system design. Automatica, 47:1279–1293, 2011. M.C. Campi and S. Garatti. The exact feasibility of randomized solutions of uncertain convex programs. SIAM Journal on Optimization, 19(3):1211–1230, 2008. M. Chamanbaz, F. Dabbene, R. Tempo, V. Venkataramanan, and Q.-G. Wang. Sequential randomized algorithms for convex optimization in the presence of uncertainty. arXiv:1304.2222v2, 2014. S. Garatti and M.C. Campi. Modulating robustness in control design: principles and algorithms. IEEE Control Systems Magazine, 33:36–51, 2013. 19 [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] Michael Grant and Stephen Boyd. CVX: Matlab software for disciplined convex programming, version 2.1. http://cvxr.com/cvx, March 2014. J.C. Lee and D.J. Sabavala. Bayesian estimation and prediction for the beta-binomial model. Journal of Business and Economic Statistics, 5(3):357–367, 1987. J. Luedtke and S. Ahmed. A sample approximation approach for optimization with probabilistic constraints. SIAM Journal on Optimization, 19(2):674–699, 2008. A. Nemirovski and A. Shapiro. Convex approximations of chance constrained programs. SIAM Journal on Optimization, 17(4):969–996, 2009. B.K. Pagnoncelli, S. Ahmed, and A. Shapiro. Sample average approximation method for chance constrained programming: Theory and applications. J. Optim. Theory Appl., 142:399–416, 2009. I. Petersen and R. Tempo. Robust control of uncertain systems: Classical results and recent developments. Automatica, 50:1315–1335, 2014. A. Prékopa. Probabilistic programming. In A. Rusczyński and A. Shapiro, editors, Stochastic Programming, volume 10 of Handbooks in Operations Research and Management Science. Elsevier, Amsterdam, 2003. A. Rantzer. Distributed control of positive system. arXiv:1203.0047v3, 2014. R. Tempo, G.C. Calafiore, and F. Dabbene. Randomized Algorithms for Analysis and Control of Uncertain Systems: With Applications. Communications and Control Engineering. Springer-Verlag; 2nd Ed., 2013. Eric W. Weisstein. Beta binomial distribution. MathWorld–A Wolfram Web Resource.
3cs.SY
Modeling Duct Flow for Molecular Communication Wayan Wicke∗ , Tobias Schwering∗ , Arman Ahmadzadeh∗ , Vahid Jamali∗ , Adam Noel† , and Robert Schober∗ ∗ Institute for Digital Communications, Friedrich-Alexander-Universität Erlangen-Nürnberg of Electrical Engineering and Computer Science, University of Ottawa arXiv:1711.01479v1 [cs.ET] 4 Nov 2017 † School [10] and is now known as Taylor dispersion [6]. Via an effective diffusion coefficient, the particle distribution can be derived in the regime of large release-observation distances where the interaction of cross-sectional diffusion and non-uniform flow will have averaged to a uniform particle distribution in the cross-section and a Gaussian spread along the axis. For molecular communication, some authors adapted this model to keep their analysis analytically tractable but the conditions under which such simplifications are justified have not been considered in detail [11]–[14]. In particular, it is not clear how the channel behaves and can be described outside of this dispersion regime. Moreover, it is not clear when the conditions for Taylor dispersion are satisfied and what their impact on molecular communication is. Potentially, theoretical I. I NTRODUCTION insight into these phenomena could be exploited for molecular Using molecules for conveying digital messages has recently communication system design. The focus of this paper is twofold. First, we introduce the been recognized as a key communication strategy for nanoscale devices such as artificial cells cooperatively fighting a disease notion of dispersion in a systematic manner which is in contrast [1]. As the entities involved in this molecular communication to previous works. Second, we analyze and highlight the major are in the micro- and nanoscale, diffusion plays a significant effects of the advection-diffusion particle transport on molecular communication systems for two different regimes, namely the role in the transport of messages [1]. However, diffusion has a limited effective range that renders dispersion regime and the flow-dominated regime, the latter of molecular communication inefficient over extended distances. which has not been considered in the literature but is prevailing This limitation can be overcome by exploiting fluid flow in for example in blood vessels [6]. addition to diffusion. For example, in blood vessels it is The two key messages of this paper are as follows: the interplay of fluid flow and diffusion that governs the 1) There is a regime where one-dimensional diffusion with supply of oxygen from the lungs to tissues. Consequently, constant drift can accurately capture the channel charthe molecular communication literature has considered basic acteristics by means of an effective diffusion coefficient models of these fundamental mechanisms [1]. In particular, the and the cross-sectional mean velocity. In this regime, the basic channel characteristics of diffusion in three-dimensional initial spatial release pattern at the transmitter does not (3D) unbounded space with uniform flow in the context of affect the resulting particle distribution. molecular communication have been investigated for example 2) Non-uniform flow as encountered in ducts can cause in [2]. Such a model might be applicable when the boundaries significant intersymbol interference (ISI), especially in a are far from the nanonetwork. Our previous work [3] considered flow-dominated regime. Diffusion tends to decrease ISI a 2D environment with uniform flow to study the impact of by enabling slowly-moving particles to move away from bounded drift-diffusion in more detail. On the other hand, the boundary. 1D diffusion with drift has been studied in [4], [5]. It is not This paper is structured as follows. In Section II, we clear when such a simplified model is applicable in molecular introduce the system model and present preliminaries. Section communication since flow in blood vessels or in microfluidic III analyzes the duct channel and the different flow regimes. channels, i.e., in ducts, especially at the microscale, is far from Numerical results are presented in Section IV. Finally, in uniform [6], [7]. Hence, in general, a reduction of the 3D reality Section V, we draw some conclusions. to a 1D model is not justified. In particular, the marginal axial and cross-sectional particle distributions are inherently coupled, II. S YSTEM M ODEL AND P RELIMINARIES which makes a mathematical analysis of the channel response A. System Model difficult. For blood vessels simulations are shown in [8]. The notion of dispersion as the interaction of diffusion and We consider a straight impermeable cylindrical duct of non-uniform laminar flow was principally investigated in [9], infinite axial extent and radius a which can be described Abstract—Active transport is sought in molecular communication to extend coverage, improve reliability, and mitigate interference. One such active mechanism inherent to many liquid environments is fluid flow. Flow models are often over-simplified, e.g., assuming one-dimensional diffusion with constant drift. However, diffusion and flow are usually encountered in threedimensional bounded environments where the flow is highly non-uniform such as in blood vessels or microfluidic channels. For a qualitative understanding of the relevant physical effects inherent to these channels a systematic framework is provided based on the Péclet number and the ratio of transmitter-receiver distance to duct radius. We review the relevant laws of physics and highlight when simplified models of uniform flow and advection-only transport are applicable. For several molecular communication setups, we highlight the effect of different flow scenarios on the channel impulse response. y z a cr cϕ y (a) cx a cr point release uniform release x x = v(r) · t (b) Fig. 1. System model geometry (a) in the cross-section, and (b) along the axis. The red shading in (a) reflects the flow velocity which is maximum in the center and vanishes at the boundary. The corresponding parabolic shape, x = v(r) · t, on which released particles reside when not diffusing after a uniform release, is sketched in (b) for three different time instances. Point and uniform transmitter release are shown as black dot and as a blue line, respectively. in cylindrical coordinates by the points (x, r, ϕ), where x ∈ (−∞, ∞) is the axial position, r ∈ [0, a] is the radial distance, and ϕ ∈ (−π, π] is the azimuth angle. The duct is filled with a fluid of viscosity η that is subject to steady laminar flow in the x-direction where the flow velocity v(r) is a function of r only and is given by a parabolic function; see Fig. 1. We consider a transmitter (TX) that releases NTX molecules either 1) uniformly and randomly distributed over the cross section at x = 0, or 2) from the point (0, r0 , ϕ0 ). Moreover, we assume a transparent receiver (RX) specified by the points (x, r, ϕ) satisfying |x − d| ≤ cx /2, a − cr ≤ r ≤ a, |ϕ| ≤ cϕ /2, i.e., the receiver is mounted on the duct wall with axial TX-RX distance given by d, radial extent cr , and spanning an angle of cϕ (see Fig. 1). We model the particle release from the TX as instantaneous and the released particles are transported by the fluid flow and Brownian motion. For simplicity, we assume that particles do not interact with each other nor influence the flow field. Because of their small size, other forces such as gravity acting on the particles are negligible [7]. B. Preliminaries In molecular communication, information is conveyed by mass transfer. Mass transfer in fluids is mediated by flow and Brownian motion which is referred to as advection and diffusion, respectively. Thereby, mass transfer can be described by a time-varying spatial probability density function (PDF) p(r; t) which can be interpreted as a normalized concentration where dV · p(r; t) gives the average fraction of particles within the differential volume dV at r at time t. The PDF p(r; t) can be found as the solution to the following partial differential equation (PDE), which we will also refer to as the advectiondiffusion equation [7, Eq. (5.22)] ∂t p = D∇2 p − ∇ · pv, (1) ∂ where ∂t p = ∂t p denotes the partial derivative of p with respect to t and ∇ is the Nabla operator. Moreover, D is the diffusion coefficient and v(r) is the velocity vector at point r. To solve (1), we need to know the velocity field v(r). In general, the velocity field can be obtained by solving the NavierStokes equation, which provides a fundamental description of flow by relating the velocity field to the local pressure [7, Ch. 2]. Applied to rigid and straight channels with no-slip boundary conditions, i.e., where the velocity at the boundary is zero, and subject to pressure-driven flow in the steady-state, the velocity profile is referred to as Poiseuille flow [7, Ch. 3]. Thereby, assuming a Newtonian fluid, i.e., a fluid which can be described by the viscosity η, we obtain [7, Eq. (3.32)]   r2 v(r) = 2veff 1 − 2 , (2) a where veff is the mean velocity in the channel and is a function of the applied pressure gradient ∂x P . In particular, veff can be obtained as [7, Eq. (3.34)] veff = |∂x P |a2 . 8η We note that the maximum velocity vmax = 2veff occurs at the center and can be found using r = 0 in (2). By thermodynamic reasoning and assuming spherical particles, the diffusion coefficient satisfies the Einstein relation [6, Eq. (5.2.24)] kB Tf D= , (3) 6πηRp where η [kg m−1 s−1 ] and Tf [K] are the viscosity and temperature of the fluid, respectively, and Rp [m] is the particle radius. We note that (3) is strictly valid only if the solvent can be modeled as continuous with respect to the solute particles, i.e., the Einstein relation gives physical insight but is not to be understood as absolute. The diffusion coefficient is a fundamental characteristic of the diffusion process and governs the microscopic particle motion [6]. An important parameter is the Péclet number, which gives an estimate of the importance of diffusion over advection. This dimensionless number is defined as [6, Eq. (4.6.8)] veff a Pe = , (4) D when considering the duct radius a as the length scale of interest. Intuitively, Pe ∈ [0, ∞) increases and decreases when veff and D increase as the importance of particle transport by flow and diffusion becomes more relevant, respectively. III. A NALYSIS OF THE D UCT C HANNEL The advection-diffusion equation (1) for the environment in Fig. 1 simplifies to the following PDE: ∂t p = D∇2 p − v(r)∂x p, (5) for t > 0 because the velocity field is independent of the axial position. At the boundary r = a, ∂r p = 0 has to hold and p(x, r, ϕ; 0) is initially given by δ(x)/(πa2 ) and δ(x)δ(r − r0 )δ(ϕ − ϕ0 )/r for uniform and point release, respectively. Eq. (5) is still difficult to solve in general because of the nonlinear velocity (2) and the inherent coupling of p in the x- and r-directions. Interestingly, (5) can be solved in a quasi-steady-state where enough time has passed such that cross-sectional diffusion and the non-uniform flow profile have averaged out. We will refer to this behavior as the dispersion regime. Trivially, this regime includes the special case where veff → 0, i.e., when there is pure diffusion. Another special case where (5) can be solved is when D → 0, i.e., when we are in the flow-dominated regime. For each of these regimes, we seek the time-dependent observation probability Z Pob (t) = p(x, r, ϕ; t) dVRX , (6) expense of a larger required distance for dispersion to take place. In fact, we can rearrange (7) as a2 · veff , (11) 4d which approximates the minimum diffusion coefficient required for dispersion to occur. For small and large D, we can neglect the first and second parts in the sum on the right-hand side of (10), respectively. By substituting (4) in (10) and minimizing with respect to D, we obtain the minimum possible effective diffusion coefficient veff a VRX Deff,min = √ , (12) 2 3 where VRX is the RX volume. We will also refer to Pob (t) as √ the impulse response. The impulse response is a fundamental for D = DT = Dmin = veff a/(4 3). For a given Deff > characteristic of the molecular communication channel and Deff,min , there are two values D < Dmin and D > Dmin , heavily influences for example the symbol error rate [2]. which achieve the same effective diffusion coefficient. These values are given by A. Dispersion Regime Deff 1q 2 2 D± = ± Deff − Deff,min . (13) Dispersion is the result of the interaction of cross-sectional 2 2 diffusion and the non-uniform advection due to the flow profile. The observation probability obtained by integrating (9) over This interaction can lead to a particle distribution that is uniform the receiver volume is given by (6) in each cross-section, i.e., the spatial PDF can be written      cϕ cr c2r d − cx /2 − veff t as p(x, r, ϕ; t) = p(x; t)/(πa2 ). In this regime, the particle Pob,d (t) = · 2 − 2 × Q distribution does depend only on the initial x-position, i.e., 2π a a 2Deff t   there is no difference for point and uniform release. This d + cx /2 − veff t −Q , (14) behavior occurs if [6, Chapter 4.6] 2Deff t d Pe  4 , (7) where Q(·) is the Gaussian Q-function. a It is of interest to derive the time at which Pob,d (t) attains e.g., when the TX-RX distance is large, the diffusion coefficient its maximum. As maximizing Pob,d (t) with respect to t is is large, or the duct radius is small. Naturally, this includes cumbersome, we resort to maximizing (9) for x = d, which the special case of pure diffusion where flow is not present. yields s ! 2 If (7) is satisfied, (5) can be written as the following 1D veff Deff −1 + 1 + 2 d2 . (15) tmax = 2 advection-diffusion equation [6, Eq. (4.6.30)] veff Deff ∂t p = Deff ∂x2 p − veff ∂x p, (8) D In this approximation, the peak height follows as pmax = Pob,d (tmax ). We note that because of diffusion tmax < d/veff , with effective diffusion coefficient Deff and mean velocity veff . where d/v is the time when particles moving with the mean eff For an instantaneous uniform release at x = 0, the solution to velocity will reach the RX. (8) is given by B. Flow-dominated Regime   1 1 (x − veff t)2 p(x, r, ϕ; t) = ×√ exp − , (9) In this subsection, we directly determine the observation πa2 4Deff t 4πDeff t probability Pob,f (t) = Pob (t) by neglecting diffusion and where 1/(πa2 ) is the cross-sectional distribution in the r- and without resorting to (6). 1) Uniform Release: First, we assume a uniform release ϕ-directions. Following [10, Eq. (26)], the Taylor-Aris effective diffusion at x = 0. In this case, all particles will lie on the surface of a paraboloid that extends along the axis over time and coefficient Deff is obtained as [6, Eq. (4.6.35)] exhibits rotational symmetry. Thereby, the marginal distribution   1 2 Deff = D 1 + Pe , (10) in the cross-section, i.e., for the r- and ϕ-coordinates, remains 48 uniform because the flow is in the x-direction. The geometric where D is given in (3). We will also refer to D as the diffusion shape is given by x = v(r) · t, cf. Fig. 1. Hence, the time D coefficient in pure diffusion and to DT = 48 Pe2 as the Taylor t when the points (x, r, ϕ) lie on the paraboloid is simply effective diffusion coefficient, i.e., we can write Deff = D +DT . given by t = x/v(r). From this, we also obtain the following We note that in general Deff > D and moreover Deff  auxiliary relationship: r D when D is decreased to very small values, which by (4) x rt (x) = a · 1 − , (16) increases Pe. However, by (7), decreasing D comes at the 2veff t which is obtained by re-arranging (2). i.e., with probability Pob (t) and 1 − Pob (t) each of the NTX The fraction of particles within the receiver volume is particles can be independently and cannot be observed within determined by those particles that lie within a segment of the RX volume at time t, respectively. The reason for this angular extent cϕ and within a ring-region with inner and outer is that for both uniform and point release the initial particle radii ri (t) and ro (t), respectively. Following the uniform release position can be understood as independently and uniformly at x = 0, the observation probability Pob,f (t) can consequently random distributed within the available TX area (the whole be written as Pob,f (t) = cϕ /(2π) · (ro2 − ri2 )/a2 . Variables cross section or one point). ri (t) and ro (t) depend on how the paraboloid intersects with IV. N UMERICAL E VALUATION the RX volume. In fact, there are three scenarios, which are By using particle-based simulation, we validate our derived shown in Fig. 1b for the x-y-plane. In the first case, the paraboloid has not yet reached the RX, cf. the green line analytical expressions and explore those regimes for which in Fig. 1b. The first intersection occurs at t = t1 when the mathematical analysis is difficult. Thereby, unless explicitly paraboloid reaches the points (x = d − cx /2, r = a − cr , ϕ) stated otherwise, we employ the following physical parameter where ϕ ∈ [−cϕ /2, cϕ /2]. In the second case, for t1 < t < t2 , values. As diffusion coefficient we choose D = 10−10 m2 /s the paraboloid intersects with the RX at ri (t) = rt (d − cx /2) which is a reasonable estimate for small proteins [6]. Two and ro (t) = a − cr , cf. the orange line in Fig. 1b. Time t2 is values for the duct radius a = 10 µm and a = 200 µm characterized by the paraboloid intersecting with the RX at the are considered, which is reasonable for small capillaries [6] points (d + cx /2, a − cr , ϕ) where ϕ ∈ [−cϕ /2, cϕ /2]. The and microfluidic ducts [7], respectively. Thereby, two TXlast case occurs for t ≥ t2 , cf. the red line in Fig. 1b. In this RX distances are considered with values d = 200 µm and case, we have ri (t) = rt (d − cx /2) and ro (t) = rt (d + cx /2). d = 800 µm. Moreover, we choose the receiver dimensions Now, we only require t1 and t2 in order to obtain the impulse as cx = a/2, cr = a/2, cϕ = π/2, i.e., the receiver size scales with the duct radius. The microscopic simulation time response. From x = v(r) · t and (2), we obtain step is set to ∆t = 10−3 s. The fluid flow mean velocity is d − cx /2 t1 = (17) assumed to be veff = 1 mm s−1 , which is reasonable for small 2veff (1 − (1 − cr /a)2 ) capillaries [6]. d + cx /2 We show in Fig. 2 (adapted from [6]) the considered t2 = . (18) 2veff (1 − (1 − cr /a)2 ) parameter values in terms of the Péclet number and the ratio In summary, the impulse response in the flow-dominated of the TX-RX distance to the duct radius. In particular, we regime following a uniform release can be written as have shaded the two regimes for which the obtained analytical  results from Section III are expected to be applicable. Eq. (7) 0, t ≤ t1      separates these two regimes and is shown as black line. The     cϕ d − cx /2 cr 2 derived analytical results are valid for parameter values well · − − 1 − , t < t < t 1 2 Pob,f (t) = 2π 2veff t a  within the dispersion or the flow-dominated regime. However,   c c   ϕ · x , the analytical results cannot be expected to be accurate close the t ≥ t2 . 2π 2veff t (19) boundary set by (7). For the two duct radii a = 10 µm, 200 µm Pob,f (t) is maximized for t = t2 . Also, at time t = t2 /α the and the two TX-RX distances d = 200 µm, 800 µm, we show fraction α ∈ (0, 1] of Pob,f (t2 ) can be observed. The tail of the resulting four combinations of d/a and Pe as black dots in the impulse response decays only polynomial with time, which Fig. 2. We see that the two scenarios for a = 10 µm lie close to may give rise to significant ISI in molecular communication the boundary of both regions. These parameter values have been chosen such that simulations can reveal the deviations from systems. 2) Point Release: For a point release with r0 ∈ [a − cr , a] either regime. On the other hand, the scenarios for a = 200 µm and ϕ0 ∈ [−cϕ /2, cϕ /2], i.e., when the TX coordinates are lie well within the flow-dominated regime and we expect no within the r- and ϕ-coordinates of the RX, we observe all deviations from the developed theory. We note that changing particles with certainty if d − cx /2 ≤ v(r0 )t ≤ d + cx /2, i.e., the duct radius a affects both d/a and Pe whereas a change in d influences only d/a. Considering the parameter values chosen the impulse response is given by   in this paper, from Fig. 2, we can conclude that the dispersion v(r0 ) t − d • Pob,f (t) = rect , (20) regime is most applicable for small microscale ducts. On the cx other hand, we also see that there is a large set of parameters where rect(x) = 1 if −1/2 ≤ x ≤ 1/2 and zero otherwise. for which the flow-dominated regime is more appropriate, When the release point is not within the r- and ϕ-coordinates especially for medium to large ducts. In Fig. 3, we numerically evaluate the effective diffusion of the RX then the impulse response is zero for all times. Eqs. (19) and (20) are intuitively valid when D → 0. More coefficient as given in (10) as a function of the molecular generally, the solution is applicable when Pe  d/a [6], e.g., diffusion coefficient for different duct radii a. Thereby, we when the duct radius is large or the TX-RX distance is small. show Deff = D and Deff = DT as the limiting expressions for We note that (19) and (20) still give the observation large and small D, respectively. Furthermore, we distinguish probability ∈ [0, 1] even though the flow is deterministic, between small (shown as orange line) and large (shown as r2 [µm2 ] log10 (d/a) a = 10 µm dispersion d = 800 µm 2 d = 200 µm 0.6 flow-dominated log10 (Pe) a = 200 µm Fig. 2. Sketch of regions of different transport regimes. Adapted from [6]. All four simulation scenarios are shown as black dots. For a = 10 µm, we have Pe = 100 and d/a = 20, 80. For a = 200 µm, we have Pe = 2000 and d/a = 1, 4. 100 50 0 0 500 1,000 1,500 x [µm] Fig. 4. Snapshot of particle positions for a = 10 µm and at t = 0.02, 0.2, 0.8 s after uniform release at x = 0 and t = 0 shown in different colors and starting from left to right, respectively. In total, NTX = 103 are released. Deff [m2 /s] d = 800 µm. For the largest time shown, t = √ 0.8 s, the red lines show the standard deviation positions veff t ± 2Deff t from the mean when assuming the Gaussian distribution in (9) due to 2 ·veff D > a 4d 10−5 dispersion. For small times, e.g., t = 0.02 s, the particles follow a= a2 ·veff the parabolic profile (16) closely. For slightly larger times, e.g., D < 20 4d 0µ 10−6 a= Deff = DT t = 0.2 s, the particles start to spread because of diffusion. m 50 minimum For large times, e.g., t = 0.8 s, particles become uniformly µ −7 m a= 10 distributed along the r2 dimension within the duct due to 10 µm dispersion. We note that for veff = 1 mm s−1 , at t = 0.2 s and 10−8 t = 0.8 s, the mean particle position has arrived at d = 200 µm and d = 800 µm, respectively. In summary, at small times after D 10−9 = ff the release the flow-dominated regime and at large times after e D 10−10 −11 the release the dispersion regime accurately model the actual 10 10−10 10−9 10−8 10−7 10−6 behavior. D [m2 /s] In Figs. 5a and 5b, we show the impulse response for a = 10 µm and a = 200 µm, respectively. In each case, we consider Fig. 3. Effective diffusion coefficient Deff in (10) as a function of the both d = 200 µm and d = 800 µm as well as uniform and point molecular diffusion coefficient D. release. For the point release, the position (0, 0.75a, 0) was blue line) D, which for d = 800 µm satisfy and do not satisfy chosen such that particles can arrive at the receiver when not (11), respectively. Finally, Deff,min from (12) is shown as a diffusing. We simulate the impulse responses and investigate red dot and the value D = 10−10 m2 /s is highlighted by a which of the developed analytical models provides the best fit black vertical line. As a increases, Deff also increases. At the in each case. same time, as can be seen from the transition from the orange In Fig. 5a, for comparison, both Pob,d (t) (applicable for both to the blue line, the (soft) threshold given in (11) delineating point and uniform release) in (14) and Pob,f (t) (applicable the validity of the dispersion regime also increases with a. only for uniform release) in (19) are shown. Thereby, for For a = 10 µm, for D = 10−10 m2 /s, we obtain Deff = Pob,d (t), the peaks are also highlighted with large dots. When 2.1 × 10−8 m2 /s, which is a value otherwise unattainable for d = 200 µm, the simulated impulse response following a point the diffusion coefficient of small proteins [6]. For a = 50 µm release is significantly larger than that for a simulated uniform and a = 200 µm, for D = 10−10 m2 /s and d = 800 µm by release. In this case, both simulated impulse responses neither (11) Deff is not meaningful anymore, cf. Fig. 2. For D > Dmin , match Pob,d (t) nor Pob,f (t). However, especially considering an increase in D leads to an increase in dispersion. On the other the long-time behavior, e.g., for t > 0.5 s, the simulated data hand, for D < Dmin , an increase in D leads to less dispersion points tend to be better described by Pob,d (t) than by Pob,f (t). because the flow cannot broaden the particle distribution along For d = 800 µm, the deviations of the simulated impulse the axis as effectively. responses for point and uniform release from Pob,d (t) are To gain a basic understanding of the particle evolution much smaller and the dispersion regime provides a much towards dispersion, in Fig. 4, we show three snapshots of better fit despite the fact that (7) is not strictly satisfied, cf. the particle positions corresponding to three different time Fig. 2. This is consistent with the green particle cloud in instances and distinguished by different colors following a Fig. 4 which appears uniform in r2 . Comparing Pob,f (t) and uniform release at t = 0. In particular, we plot r2 over x Pob,d (t), we see that the peak of Pob,f (t) is larger and smaller motivated by the fact that the marginal distribution in r2 of than that of Pob,d (t) when d is small and large, respectively. a uniform distribution within a circular disk is uniform. As For larger times, e.g., for t > 0.75 s, Pob,f (t) for d = 200 µm a side effect, for the flow-dominated regime from (16), r2 and Pob,f (t) for d = 800 µm coincide as expected from (19) becomes a simple linear function which for each considered which is independent of d for t > t2 . In conclusion, parameter t is shown as a blue line. Furthermore, a = 10 µm such that values close to the boundary in Fig. 2 can still be applicable according to Fig. 2, dispersion occurs for x in the vicinity of for the dispersion model. 20 0µ m = 0.5 0 0 0.5 a = 10 µm to a = 200 µm. We note that for both uniform and point release the peak values of the impulse responses in Fig. 5a are at least by an order of magnitude smaller than in Fig. 5b. Moreover, for uniform and point release the simulated impulse responses in Fig. 5a decay faster and slower from their peak values than those in Fig. 5b, respectively. Pob,f (t) Pob,d (t) sim. unif. sim. point peak 1 V. C ONCLUSION d = 800 µm d fraction of particles ·10−2 1 time [s] 1.5 2 (a) Pob,f (t) • (t) 0.1 · Pob,f sim. unif. 0.1 · sim. point peak = 20 0µ m 1 0.5 d fraction of particles ·10−1 d = 800 µm 0 0 0.5 1 time [s] 1.5 2 (b) Fig. 5. Impulse responses for (a) a = 10 µm, and (b) a = 200 µm. Simulation results are shown for both uniform and point release. For (b), additionally the simulated and analytical impulse responses due to a point release are scaled by the constant factor 0.1 for a better visualization. Simulation results are for NTX = 106 . • In Fig. 5b, Pob,f (t) in (19) and Pob,f (t) in (20) are shown. For the former, the peak times t2 are highlighted. For both uniform and point release, simulation results are also shown. By Fig. 2, the dispersion approximation is not applicable in this scenario and for clarity is not shown. Considering the point release, the simulated curve for d = 200 µm matches the • rectangular shape of Pob,f (t) in (20) reasonably well. On the other hand, for d = 800 µm, the simulated impulse response significantly deviates from the rectangular shape because diffusion has had enough time to result in a spread of the pulse. As expected from Fig. 2, we observe in general a good agreement between Pob,f (t) in (19) and the simulation results in the case of a uniform release, i.e., the flow-dominated regime provides a reasonable description of the channel. Nevertheless, for d = 200 µm, at larger times, e.g., for t > 1 s, there is a small deviation because of residual particles close to the RX when most particles have already passed. Comparing the impulse responses for point release and uniform release, we find that the tail of the impulse response strongly depends on the initial distribution. There can be considerable ISI, especially when a fraction of the particles is released close to the duct wall. However, as long as the RX can be reached by the particles, an initial release close to the center of the duct might reduce ISI. Comparing Figs. 5a and 5b, we see that the channels behave completely different when the duct radius is changed from Dispersion generalizes the concept of diffusion which is crucial for molecular communication. Thereby, non-uniform flow can be accounted for by an effective diffusion coefficient. This effective diffusion coefficient can be multiple orders of magnitude larger than the molecular diffusion coefficient. However, this description relies on a large TX-RX distance. On the other hand, there are many practical scenarios at the microscale that fall within the flow-dominated regime and where dispersion is insignificant. In this regime, the initial release pattern drastically influences ISI. For a uniform release, the dispersion regime might be preferable over the flowdominated regime, because of the reduced ISI. For a given duct radius either regime can be applicable depending on the TX-RX distance and the Péclet number. R EFERENCES [1] N. Farsad, H. B. Yilmaz, A. Eckford, C. B. Chae, and W. Guo, “A comprehensive survey of recent advancements in molecular communication,” IEEE Commun. Surv. Tutorials, vol. 18, no. 3, pp. 1887–1919, 2016. [2] A. Noel, K. C. Cheung, and R. Schober, “Diffusive molecular communication with disruptive flows,” in Proc. IEEE ICC 2014, Jun. 2014, pp. 3600–3606. [3] W. Wicke, A. Ahmadzadeh, V. Jamali, H. Unterweger, C. Alexiou, and R. Schober, “Molecular communication using magnetic nanoparticles,” arXiv:1704.04206, Apr. 2017. [4] K. V. Srinivas, A. W. Eckford, and R. S. Adve, “Molecular communication in fluid media: The additive inverse Gaussian noise channel,” IEEE Trans. Inf. Theory, vol. 58, no. 7, pp. 4678–4692, Jul. 2012. [5] N. R. Kim, A. W. Eckford, and C. B. Chae, “Symbol interval optimization for molecular communication with drift,” IEEE Trans. Nanobioscience, vol. 13, no. 3, pp. 223–229, Sep. 2014. [6] R. F. Probstein, Physicochemical Hydrodynamics: An Introduction. John Wiley & Sons, Feb. 2005. [7] H. Bruus, Theoretical Microfluidics, 1st ed. Oxford University Press, Nov. 2007. [8] L. Felicetti, M. Femminella, and G. Reali, “Simulation of molecular signaling in blood vessels: Software design and application to atherogenesis,” Nano Commun. Networks, vol. 4, no. 3, pp. 98–119, Sep. 2013. [9] G. I. Taylor, “Dispersion of soluble matter in solvent flowing slowly through a tube,” Proc. R. Soc. Lond. A, vol. 219, no. 1137, pp. 186–203, Aug. 1953. [10] R. Aris, “On the dispersion of a solute in a fluid flowing through a tube,” Proc. R. Soc. Lond. A, vol. 235, no. 1200, pp. 67–77, Apr. 1956. [11] P. He, Y. Mao, Q. Liu, P. Li, and K. Yang, “Channel modelling of molecular communications across blood vessels and nerves,” in Proc. IEEE ICC 2016, May 2016, pp. 1–6. [12] Y. Chahibi, M. Pierobon, and I. F. Akyildiz, “Pharmacokinetic modeling and biodistribution estimation through the molecular communication paradigm,” IEEE Trans. Biomed. Eng., vol. 62, no. 10, pp. 2410–2420, Oct. 2015. [13] A. O. Bicen and I. F. Akyildiz, “System-theoretic analysis and leastsquares design of microfluidic channels for flow-induced molecular communication,” IEEE Trans. Signal Process., vol. 61, no. 20, pp. 5000– 5013, Oct. 2013. [14] Y. Sun, K. Yang, and Q. Liu, “Channel capacity modelling of blood capillary-based molecular communication with blood flow drift,” in Proc. ACM NanoCom 2017, 2017, pp. 19:1–19:6.
7cs.IT
New Tools and Connections for Exponential-time Approximation Nikhil Bansal1 , Parinya Chalermsook2 , Bundit Laekhanukit3 , Danupon Nanongkai4 , and Jesper Nederlof5 arXiv:1708.03515v1 [cs.DS] 11 Aug 2017 1 2 3 4 5 Eindhoven University of Technology, The Netherlands. [email protected]. Aalto University, Finland. [email protected]. Weizmann Institute of Science, Israel. [email protected]. KTH, Royal Institute of Technology, Sweden. [email protected] Eindhoven University of Technology, The Netherlands. [email protected]. Abstract In this paper, we develop new tools and connections for exponential time approximation. In this setting, we are given a problem instance and a parameter α > 1, and the goal is to design an α-approximation algorithm with the fastest possible running time. We show the following results: An r-approximation for maximum independent set in O∗ (exp(Õ(n/r log2 r + r log2 r))) time, An r-approximation for chromatic number in O∗ (exp(Õ(n/r log r + r log2 r))) time, A (2 − 1/r)-approximation for minimum vertex cover in O∗ (exp(n/rΩ(r) )) time, and A (k − 1/r)-approximation for minimum k-hypergraph vertex cover in O∗ (exp(n/(kr)Ω(kr) )) time. (Throughout, Õ and O∗ omit polyloglog(r) and factors polynomial in the input size, respectively.) The best known time bounds for all problems were O∗ (2n/r ) [Bourgeois et al. 2009, 2011 & Cygan et al. 2008]. For maximum independent set and chromatic number, these bounds were complemented by exp(n1−o(1) /r1+o(1) ) lower bounds (under the Exponential Time Hypothesis (ETH)) [Chalermsook et al., 2013 & Laekhanukit, 2014 (Ph.D. Thesis)]. Our results show that the naturally-looking O∗ (2n/r ) bounds are not tight for all these problems. The key to these algorithmic results is a sparsification procedure that reduces a problem to its bounded-degree variant, allowing the use of better approximation algorithms for bounded degree graphs. For obtaining the first two results, we introduce a new randomized branching rule. Finally, we show a connection between PCP parameters and exponential-time approximation algorithms. This connection together with our independent set algorithm refute the possibility to overly reduce the size of Chan’s PCP [Chan, 2016]. It also implies that a (significant) improvement over our result will refute the gap-ETH conjecture [Dinur 2016 & Manurangsi and Raghavendra, 2016]. 1. 2. 3. 4. 1998 ACM Subject Classification F.2.2 Nonnumerical Algorithms and Problems Keywords and phrases Approximations Algorithms, PCP’s, Exponential Time Algorithms Digital Object Identifier 10.4230/LIPIcs... 1 Introduction The Independent Set, Vertex Cover, and Coloring problems are central problems in combinatorial optimization and have been extensively studied. Most of the classical results concern either approximation algorithms that run in polynomial time or exact algorithms that run in (sub)exponential-time. While these algorithms are useful in most scenarios, they lack flexibility: Sometimes, we wish for a better approximation ratio with worse running time (e.g. © Nikhil Bansal, Parinya Chalermsook, Bundit Laekhanukit, Danupon Nanongkai, Jesper Nederlof; licensed under Creative Commons License CC-BY Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany 2 New Tools and Connections for Exponential-time Approximation computationally powerful devices), or faster algorithms with less accuracy. In particular, the trade-off between the running time and approximation ratios are needed in these settings. Algorithmic results on the trade-offs between approximation ratio have been studied already in the literature in several settings, most notably in the context of Polynomialtime Approximation Schemes (PTAS). For instance, in planar graphs, Baker’s celebrated approximation scheme for several NP-hard problems [1] gives an (1 + ε)-approximation for e.g. Independent Set in time O∗ (exp(O(1/ε))) time. In graphs of small treewidth, Czumaj et al. [14] give an O∗ (exp(tw/r)) time algorithm that given a graph along with a tree decomposition of it of width at most tw, find an r-approximation for Independent Set. For general graphs, approximation results for several problems have been studied in several works (see e.g. [5, 6, 7, 13, 12, 11]). A basic building block that lies behind many of these results is to partition the input instance in smaller parts in which the optimal (sub)solution can be computed quickly (or at least faster than fully exponential-time). For example, to obtain an r-approximation for Independent Set one may arbitrarily partition the vertex set in r blocks and restrict attention to independent sets that are subsets of these blocks to get a O∗ (exp(n/r)) time r-approximation algorithm. While at first sight one might think that such a naïve algorithm should be easily improvable via more advanced techniques, it was shown in [9, 5] that almost linear-size PCPs [15, 30] imply that r-approximating Independent Set [9] and Coloring [27] requires at least exp(n1−o(1) /r1+o(1) ) time assuming the popular Exponential Time Hypothesis (ETH). In the setting of the more sophisticated Baker-style approximation schemes for planar graphs, Marx [29] showed that no (1 + ε)-approximating algorithm for planar Independent Set can run in time O∗ (exp((1/ε)1−δ )) assuming ETH, which implies that the algorithm of Czumaj cannot be improved to run in time O∗ (exp(tw/r1+ε )). These lower bounds, despite being interesting, are far from tight and by no means answer the question whether the known approximation trade-offs can be improved significantly, and in fact in many settings we are far from understanding the full power of exponential time approximation. For example we cannot exclude algorithms that 2-approximate k-Independent Set1 in time O∗ (f (k)) for some function f (see e.g. [26]), nor do we know algorithms that run asymptotically faster than the fastest exact algorithm that runs in time n0.792k time [31]. In this paper we aim to advance this understanding and study the question of designing as fast as possible approximation algorithms for Independent Set, Coloring and Vertex Cover in general (hyper)graphs. Our Results. For Independent Set our result is the following. Here we use Õ to omit log log factors in r. I Theorem 1. There is a randomized algorithm that given an n-vertex graph G and integer r outputs an independent set that, with constant probability, has size at least α(G)/r, where α(G) denotes the maximum independent set size of G. The algorithm runs in time O∗ (exp(Õ(n/(r log2 r) + r log2 r))). To prove this result we introduce a new randomized branching rule that we will now introduce and put in context towards previous results. This follows a sparsification technique that reduces the maximum degree to a given number. This technique was already studied 1 That is, given a graph and integer k answer YES if it has an independent set of size at least 2k and NO if it has no independent set of size at least k. N. Bansal et al. before in the setting of exponential time approximation algorithms Independent Set by Cygan et al. (see [11, paragraph ‘Search Tree Techniques’]) and Bourgeois et al. (see [7, Section 2.1]), but the authors did not obtain running times sub-exponential in n/r. Specifically, the sparsification technique is to branch (e.g. select a vertex and try to both include v in an independent set or discard and recurse for both possibilities) on vertices of sufficiently high degree. The key property is that if we decide to include a vertex and the independent set, we may discard all neighbors of v. If we generate instances by keep branching on  vertices of degree n at least d until the maximum degree is smaller than d, then at most n/d / exp(n log(d)/d) instances are created. In each such instance, the maximum independent set can be easily d-approximated by a greedy argument. Cygan et al. [11] note that this gives worse than O∗ (2n/r ) running times. Our algorithm works along this line but incorporates two (simple) ideas. Our first observation is that instead of solving each leaf instance by greedy d-approximation algorithm, one can use a recent Õ( logd2 d ) approximation algorithm by Bansal et al. [2] for Independent Set on bounded degree graphs. If we choose d ≈ r log2 r, this immediately gives an improvement, n an r-approximation in time essentially exp( r log r ). To improve this further we use present an additional (more innovative) idea introducing randomization. This idea relies on the fact that in the sparsification step we have (unexploited) slack as we aim for an approximation.2 Specifically, whenever we branch, we only consider the ‘include’ branch with probability 1/r. This will lower the expected number of produced leaf instances in the sparsification step to n 2n/d ≈ exp( r log 2 r ) and preserves the approximation factor with good probability. Via fairly standard methods (see e.g. [4]) we show this also gives a faster algorithm for coloring in the following sense: I Theorem 2. There is a randomized algorithm that, given an n-vertex graph G and an integer r > 0, outputs with constant probability a proper coloring of G using at most r · χ(G) colors. The algorithm runs in time O∗ (exp(Õ(n/(r log r) + r log2 r))). As a final indication that sparsification is a very powerful tool to obtain fast exponential time approximation algorithms, we show that a combination of a result of Halperin [20] and the sparsification Lemma [22] gives the following result for the Vertex Cover problem in hypergraphs with edges of size at most k (or Set Cover problem with frequency at most k). I Theorem 3. For every k, there is an r0 := r(k) such that for every r ≥ r0 there is an O∗ (exp( (kr)nΩ(kr) )) time (k − 1r )-approximation algorithm for the Vertex Cover problem in hypergraphs with edges of size at most k. n Note that for k = 2 (e.g. vertex cover in graphs), this gives an O∗ (exp( rΩ(r) )) running time, which gives an exponential improvement (in the denominator of the exponent) upon the (2 − 1/r) approximation by Bonnet et al. [7] that runs in time O∗ (2n/r ). It was recently brought to our attention that Williams and Yu [32] independently have unpublished results for (hypergraph) vertex cover and independent set using sparsification techniques similar to ours. Connections to PCP parameters The question of approximating the maximum independent set problem in sub-exponential time has close connections to the trade-off between three important parameters of PCPs: size, gap and free-bit. We discuss the implications of our algorithmic results in terms of these PCP parameters. 2 This observation was already made by Bourgeois et al. [7], but we exploit it in a new way. 3 4 New Tools and Connections for Exponential-time Approximation Roughly speaking, the gap parameter is the ratio between completeness and soundness, while the freeness parameter is the number of distinct proofs that would cause the verifier to accept; the free-bit is simply a logarithm of freeness. For convenience, we will continue our discussions in terms of freeness, instead of freebit. Freebit v.s. gap: The dependency between freeness and gap has played important role in hardness of approximation. Most notably, the existence of PCPs with freeness g o(1) where g is a gap parameter is “equivalent” to n1−o(1) hardness of approximating maximum independent set [21, 3]; this result is a building block for proving other hardness of approximation for many other combinatorial problems, e.g., coloring [19], disjoint paths, induced matching, cycle packing, and pricing. So it is fair to say that this PCP parameter trade-off captures the approximability of many natural combinatorial problems. Better parameter trade-off implies stronger hardness results. The existence of a PCP with arbitrarily large gap and freeness 1 (lowest possible) is in fact equivalent to (2 − ) inapproximability for Vertex Cover. The best known trade-off is due to Chan [10]: For any g > 0, there is a polynomial-sized PCP with gap g and freeness O(log g), yielding the best known NP-hardness of approximating maximum independent set in sparse graphs, i.e. Ω(d/ log4 d) NP-hardness of approximating maximum independent set in degree-d graphs. 3 Size, freebit, and gap: When a polynomial-time approximation algorithm is the main concern, polynomial size PCPs are the only thing that matter. But when it comes to exponential time approximability, another important parameter, size of the PCPs, has come into play. The trade-off between size, freebit, and gap tightly captures the (sub)exponential time approximability of many combinatorial problems. For instance, for √ any O( log g) 1+o(1) g > 0, Moshkovitz and Raz [30] constructs a PCP of size n and freeness 2 ; 1−o(1) /r 1+o(1) this implies that r-approximating Independent Set requires time 2n [9]. Our exponential-time approximation result for Independent Set implies the following tradeoff results. I Corollary 4. Unless ETH breaks, a freebit PCP with gap g, freeness F and size S must satisfy F · S = Ω(n log2 g). In particular, this implies that (i) Chan’s PCP cannot be made smaller size than o(n log g), unless ETH breaks, and (ii) in light of the equivalence between gap-amplifying freebit PCPs with freeness 1 and (2 − ) approximation for Vertex Cover, our result shows that such a PCP must have size at least Ω(n log2 g). We remark that no such trade-off results are known for polynomial-sized PCPs. To our knowledge, this is the first result of its kind. Further related results The best known results for Independent Set in the polynomial-time log n)2 regime are an O( n(log )-approximation [17], and the hardness of n/exp(O(log3/4+o(1) n)) log3 n (which also √ holds for Coloring) [24]. For Vertex Cover, the best known hardness of approximation is ( 2 − o(1)) NP-hardness [23] and (2 − ) hardness assuming the unique games conjecture [25]. All three problems (Independent Set, Coloring, and Vertex Cover) do not admit exact algorithms that run in time 2o(n) , unless ETH fails. Besides the aforementioned works [7, 11] sparsification techniques for exponential time approximation were studied by Bonnet and Paschos in [6], but mainly hardness results were obtained. 3 Roughly speaking, the existence of a PCP with freeness F (g) (where g is a gap) implies Ω( F (d)dlog3 d ) hardness of approximating independent set in degree-d graphs. N. Bansal et al. 2 Preliminaries We first formally define the three problems that we consider in this paper. Independent Set: Given a graph G = (V, E), we say that J ⊆ V is an independent set if there is no edge with both endpoints in J. The goal of Independent Set is to output an independent set J of maximum cardinality. Denote by α(G), the cardinality of the maximum independent set. Vertex Cover: Given a graph G = (V, E), we say that J ⊆ V is a vertex cover of G if every edge is incident to at least one vertex in J. The goal of Vertex Cover is to output a vertex cover of minimum size. A generalization of vertex cover, called k-Hypergraph Vertex Cover k-Vertex Cover, is defined as follows. Given a hypergraph G = (V, E) where each hyperedge h ∈ E has cardinality at most k, the goal is to find a collection of vertices J ⊆ V such that each hyperedge is incident to at least one vertex in J, while minimizing |J|. The degree ∆(H) of hypergraph H is the maximum frequency of an element. Coloring: Given a graph G = (V, E), a proper k-coloring of G is a function f : V → [k] such that f (u) 6= f (v) for all uv ∈ E. The goal of Coloring is to compute a minimum integer k > 0 such that G admits a (proper) k-coloring; this number is referred to as the chromatic number, denote χ(G). For a graph G = (V, E), NG (v) denotes the set of neighbors of v and dG (v) denotes |NG (v)|. If X ⊆ V we let G[X] denote the graph (X, E ∩ (X × X)) i.e. the subgraph of G induced by X We use exp(x) to denote 2x in order to avoid superscripts. We use the O∗ (·)-notation to suppress factors polynomial in the input size. We use Õ and Ω̃ to suppress factors polyloglog in r in respectively upper and lower bounds and write Θ̃ for all functions that are in both Õ and Ω̃. 3 3.1 Faster Approximation via Randomized Branching and Sparsification Maximum Independent Set In this section we prove Theorem 1. Below is our key lemma. I Lemma 5. Suppose there is an approximation algorithm dIS(G, r) that runs in time T (n, r) and outputs an Independent Set of G of size α(G)/r if G has maximum degree d(r), d(r) ≥ 2r). Then there  (where   is an algorithm IS(G, r) running in expected time O∗ exp n d(r) log(4d(r)/r) T (n, r) that outputs an independent set of expected size α(G)/r. Proof. Consider the following algorithm. Algorithm IS(G = (V, E), r) 1: if ∃v ∈ V : dG (v) ≥ d(r) then 2: Draw a random Boolean variable b such that Pr[b = true] = 1/r. 3: if b = true then 4: return the largest of IS(G[V \ v]) and IS(G[V \ N (v)]) ∪ {v}. 5: else 6: return IS(G[V \ v]). 7: else 8: return dIS(G). Figure 1 Approximation algorithm for Independent Set using an approximation algorithm dIS that works in bounded degree graphs. 5 6 New Tools and Connections for Exponential-time Approximation For convenience, let us fix r and d := d(r). We start by analyzing the expected running time of this algorithm. Per recursive call the algorithm clearly uses O∗ (T (n, r)) time. It remains to bound the number of recursive calls R(n) made by IS(G, r) when G has n vertices. We will bound R(n) ≤ 2λn for λ = log(4d/r)/d by induction on n. Note that here λ is chosen such that exp(−λ · d) = r/(4d) ≤ r log(4d/r) , 2d (1) where we use d/r ≥ 2 for the inequality. For the base case of the induction, note that if the condition at Line 1 does not hold, the algorithm does not use any recursive calls and the statement is trivial as λ is clearly positive. For the inductive step, we see that R(n) ≤ R(n − 1) + Pr[b = true] · R(n − d) = R(n − 1) + R(n − d)/r = exp(λ(n − 1)) + exp(λ(n − d))/r = exp(λn) (exp(−λ) + exp(−λd)/r) Using exp(−x) ≤ 1 − x/2 for x ∈ [0, 1] ≤ exp(λn) (1 − λ/2 + exp(−λd)/r) Using exp(−λ · d(r)) ≤ λr/2 from (1) ≤ exp(λn). We continue by analyzing the output of the algorithm. It clearly returns a valid independent set as all neighbors of v are discarded when v is included in Line 4 and an independent set is returned at Line 8. It remains to show E[|IS(G, r)|] ≥ α(G)/r which we do by induction on n. In the base case in which no recursive call is made, note that on Line 8 we indeed obtain an r-approximation as G has maximum degree d(r). For the inductive case, let X be a maximum independent set of G and let v be the vertex as picked on Line 1. We distinguish two cases based on whether v ∈ X. If v ∈ / X, then α(G) = α(G[V \ v]) and the inductive step follows as E[|IS(G[V \ v], r)|] ≥ α(G)/r by the induction hypothesis. Otherwise, if v ∈ X, then E[|IS(G, r)|] is at least Pr[b = false] · E[|IS(G[V \ {v}], r)|] + Pr[b = true] · E[|IS(G[N \ N (v)], r)| + 1]    α(G) − 1 1 1 α(G) − 1 +r +1 ≥ 1− r r r α(G) − 1 1 = + r = α(G)/r, r as required. Here the first inequality uses the induction hypothesis twice. J We will invoke the above lemma by using the algorithm dIS(G) by Bansal et al. [2] implied by the following theorem: I Theorem 6 ([2], Theorem 1.3). There is an Õ(d/ log2 d) approximation algorithm dIS(G) for Independent Set on graphs of maximum degree d running in time O∗ (exp(O(d))). Proof of Theorem 1. We may apply Lemma 5 with r/3 and, by virtue of Theorem 6, with d(r/3) = Θ̃(r log2 r), and T (n, r) = O∗ (exp(Õ(r log2 r))). We obtain an 2 2 ∗ O (exp(Õ(n/r log r + r log r))) expected time algorithm that outputs an independent set of expected size 2α(G)/r. Since the size of the output is upper bounded by α(G) we obtain an independent set of size at least α(G)/r with probability at least 1/(3r), and we may boost this probability to 3/4 by O(r) repetitions. N. Bansal et al. 7 By Markov’s inequality these repetitions together run in O∗ (exp(Õ(n/r log2 r + r log2 r))) time with probability 3/4. The theorem statement follows by a union bound as these O(r) repetitions run in the claimed running time and simultaneously some repetition finds an independent set of size at least α(G)/r, with probability at least 1/2. J A deterministic algorithm: Additionally, we also show a deterministic r-approximation algorithm that runs in time exp(Õ(n/r log r)). The algorithm utilizes Feige’s algorithm [17] as a blackbox, and is deferred to Appendix A. 3.2 Graph Coloring Now we use the approximation algorithm for Independent Set as a subroutine for an approximation algorithm for Coloring to prove Theorem 2 as follows: Proof of Theorem 2. The algorithm combines the approximation algorithm IS from Section 3.1 for Independent Set with an exact algorithm optcol for Coloring (see, e.g., [4]) as follows: Algorithm CHR(G = (V, E), r) 1: Let n = |V |, c = 0. 2: while |V | ≥ n/(r log r) do 3: c ← c + 1. 4: Cc ← IS(G[V ], r/ ln(r log r)). 5: V ← V \ Cc . 6: Let (Cc+1 , . . . , C` ) ← optcol(G[V ]) be some optimum coloring of the remaining graph G(V ). 7: return (C1 , . . . , C` ). Figure 2 Approximation algorithm for the chromatic number. We claim that CHR(G, r) returns with high probability a proper coloring of G using ` ≤ (r + 2) · χ(G) colors. To prove the theorem, we invoke CHR(G, r − 2) which has the same asymptotic running time. First, note that in each iteration of the while loop log r) (Line 2 of Algorithm 2), |V | is decreased by a multiplicative factor of at most 1 − ln(r r·χ(G) because G[V ] must have an independent set of size at least n/χ(G) and therefore |Cc | ≥ ln(r log r)n/(r · χ(G)). Before the last iteration, we have |V | ≥ n/(r ln r). Thus, the number ` of iterations must satisfy 1/(r log r) ≤  `−1   ln(r log r) ln(r log r)(` − 1) 1− ≤ exp − . r · χ(G) r · χ(G) This implies that (` − 1) ≤ r · χ(G). Consequently, the number of colors used in the first phase of the algorithm (Line 1 to Line 5) is c ≤ rχ(G) + 1. The claimed upper bound on ` follows because the number of colors used for G[V ] in the second phase (Line 6) is clearly upper bounded by χ(G). To upper bound the running time, note that Line 4 runs in time        n ln(r log r) n 2 2 exp Õ + r log r = exp Õ + r lg r , r log r r log2 (r/ ln(r log r)) 8 New Tools and Connections for Exponential-time Approximation and implementing optcol(G = (V, E)) by using the O∗ (2|V | ) time algorithm from [4], Line 6 also takes O∗ (2n/(r log r) ) time and the running time follows. J 3.3 Vertex Cover and Hypergraph Vertex Cover In this section, we show an application of the sparsification technique to Vertex Cover to obtain Theorem 3. Here the sparsification step is not applied explicitly. Instead, we utilize the sparsification Lemma of Impagliazzo et al. [22] as a blackbox. Subsequently, we solve each low-degree instance by using an algorithm of Halperin [20]. The sparsification lemma due to Impagliazzo et al. [22], shows that an instance of the k-Hypergraph Vertex Cover problem can be reduced to a (sub-)exponential number of low-degree instances.4 I Lemma 7 (Sparsification Lemma, [22, 8]). There is an algorithm that, given a hypergraph H = (V, E) with edges of size at most k ≥ 2, a real number ε > 0, produces set systems H1 = (V, E1 ), . . . , H` = (V, E` ) with edges of size at most k in O∗ (`) time such that 1. every subset X ⊆ V is a vertex cover of H if and only if X is a vertex cover of Hi for some i, 2. for every i = 1, . . . , `, the degree ∆(Hi ) is at most (k/ε)3k , 3. ` is at most exp(εn). The next tool is an approximation algorithm for the k-Hypergraph Vertex Cover problem when the input graph has low degree due to Halperin [20]. ln ln ∆ I Theorem 8 ([20]). There is a polynomial time k − (1 − o(1)) k(k−1) -approximation ln ∆ algorithm for the vertex cover problem in hypergraphs with edges of size at most k in which every element has degree at most ∆, for large enough ∆ := ∆(k). Now we complete the proof of the theorem by applying Lemma 7 with parameter ε = k/(kr)kr . The number  of low-degree instances Hi produced by Lemma 7 is at most exp(εn) = exp O Note that k (kr)kr 2 . Each graph Hi has degree at most ∆(Hi ) ≤ (k/ε)3k = (kr)3k r . ln ln ∆(Hi ) ln(3k 2 r ln(kr)) 1 ≥ ≥ 2 . ln ∆(Hi ) 3k 2 r ln(kr) 3k r Plugging this value of ∆(Hi ), Halperin’s algorithm gives the approximation factor of k− k(k − 1) ln ln ∆ 1 ≤k− . ln ∆ 6r Thus this gives an k − 1/(6r)-approximation running in time O∗ (exp(nk/(kr)kr )) which translates to an k − 1/r-approximation running in time O∗ (exp(nk/(kr/6)kr/6 )). 4 PCP Parameters and Exponential-time approximation hardness Exponential-time approximation has connections to the trade-off questions between three parameters of PCPs: size, freebit, and gap. To formally quantify this connection, we define new terms, formally illustrating the ideas that have been already around in the literature. 4 The original formulation is for the Set Cover problem and the most popular formulation is for CNF-SAT problem, but they are all equivalent by direct transformation. N. Bansal et al. 9 We define a class of languages FGPCP which stands for Freebit and Gap-amplifiable PCP. Let g be a positive real, and S, F be non-decreasing functions. A language L is in FGPCPc (S, F ) if there is a constant g0 > 1 such that, for all constants g ≥ g0 , there is a verifier Vg that, on input x ∈ {0, 1}n , has access to a proof π : |π| = O(S(n, g)) and satisfies the properties: The verifier runs in 2o(n) time. If x ∈ L, then there is a proof π such that Vgπ (x) accepts with probability ≥ c. If x 6∈ L, then for any proof π, Vgπ (x) accepts with probability ≤ c/g. For each x and each random string r, the verifier has ≤ F (g) accepting configurations. The parameters g, S and log F are referred to as gap, size and freebit of the PCPs respectively. For convenience, we call F (g) the freeness of the PCP. An intuitive way to view this PCP is as a class of PCPs parameterized by gap g. An interesting question in the PCPs and hardness of approximation literature has been to find the smallest functions S and F . I Theorem 9. If SAT ∈ FGPCPδ (S, F ) for some function S(n, g) that is at least linearly growing in n, then for any constant r, r-approximating Independent Set, in input graph G, −1 cannot be done in time 2o(S (|V (G)|,r)/rF (r)) unless ETH fails. (we think of r as a fixed number, and therefore S(n, r) should be seen as a function on a single variable n.) We prove the theorem later in this section. I Corollary 10. Assuming that SAT has no 2o(n) -time randomized algorithm and that SAT ∈ log2 g FGPCPδ (S, F ), then it must be the case that S(n, g) · F (g) = Ω(n · poly(log log g) ). Proof. Otherwise, S −1 (|V (G)|, r) = o(|V (G)| · o(|V imply that there is no 2 approximation algorithm. poly(log log r) (G)|· r log2 r ) F (r)poly(log log r) ), log2 r and the Theorem 9 would , contradicting the existence of our Independent Set J Now let us phrase the known PCPs in our framework of FGPCP. Chan’s PCPs [10] can be stated that SAT ∈ FGPCP1−o(1) (poly, O(log g)). Applying our results, this means that if one wants to keep the same freebit parameters given by Chan’s PCPs, then the size must be at least Ω(n log g). Another interesting consequence is a connection between Vertex Cover and Freebit PCPs in the polynomial time setting [3]. I Theorem 11 ([3]). Vertex Cover is (2 − ) hard to approximate if and only if SAT ∈ FGPCP1/2− (poly, 1). The intended PCPs in Theorem 11 have arbitrary small soundness while the freeness remains 1. Our Corollary 10 implies that such a PCP must have size at least Ω(n log2 g). 4.1 Proof of Theorem 9 Step 1: Creating a hard CSP We will need the following lemma that creates a “hard” CSP from FGPCP. This CSP will be used later to construct a hard instance of Independent Set. I Lemma 12. If SAT ∈ FGPCPδ (S, F ), then, for any g > 1, there is a randomized reduction from an n-variable SAT φ to a CSP φ0 having the following properties (w.h.p.): The The The If φ number of variables of φ0 is ≤ S(n). number of clauses of φ0 is ≤ 10S(n)g/δ. freeness of φ0 is ≤ F (g). is satisfiable, then val(φ0 ) ≥ δ/2. Otherwise, val(φ0 ) ≤ 6δ/g. 10 New Tools and Connections for Exponential-time Approximation Proof. Let g be any number and Vg be the corresponding verifier. On input φ, we create a CSP φ0 as follows. For each proof bit Πi , we have variable xi . The set of variables is X = {x1 , . . . , xS(n) }. We perform M = 10dS(n)g/δe iterations. In iteration j, the verifier picks a random string rj and create a predicate Pj (xb1 , . . . , xbq ), where b1 , . . . , bq are the proof bits read by the verifier VgΠ on random string rj . This predicate is true on assignment γ if and only if the verifier accepts the local assignment where Πbi = γ(xi ) for all i ∈ [q]. ∗ First, assume that φ is satisfiable. Then there is a proof Π∗ such that the verifier V Π (φ) accepts with probability δ. Let γ : X → {0, 1} be an assignment that agrees with the proof Π∗ . So γ satisfies each predicate Pj with probability δ, and therefore, the expected number of satisfied predicates is δM . By Chernoff’s bound, the probability that γ satisfies less than δM −δM/8 ≤ 2−n . 2 predicates is at most 2 Next, assume that φ is not satisfiable. For each assignment γ : X → {0, 1}, the fraction of random strings satisfied by the corresponding proof Πγ is at most δ/g. When we pick a random string rj , the probability that V Πγ (φ, rj ) accepts is then at most δ/g. So, over all the choices of M strings, the expected number of satisfied predicates is δM/g ≥ 10S(n). By Chernoff’s bound, the probability that γ satisfies more than δM/g predicates is at most 2−10S(n) . By union bound over all possible proofs of length S(n) (there are 2S(n) such proofs), the probability that there is such a γ is at most 2S(n) 2−10S(n) ≤ 2−S(n) . J Step 2: FGLSS reduction The FGLSS reduction is a standard reduction from CSP to Independent Set introduced by Feige et al. [18]. The reduction simply lists all possible configurations (partial assignment) for each clause as vertices and adding edges if there is a conflict between two configuration. In more detail, for each predicate Pi and each partial assignment γ such that Pi (γ) is true, we have a vertex v(i, γ). For each pair of vertices v(i, γ)v(i0 , γ 0 ) such that there is a variable appearing in both Pi and Pi0 for which γ(xj ) 6= γ 0 (xj ), we have an edge between v(i, γ) and v(i0 , γ 0 ). I Lemma 13 (FGLSS Reduction [18]). There is an algorithm that, given an input CSP φ with m clauses, n variables, and freeness F , produces a graph G = (V, E) such that (i) |V (G)| ≤ mF and (ii) α(G) = val(φ)m, where val(φ) denotes the maximum number of predicates of φ that can be satisfied by an assignment. Combining everything Assume that SAT ∈ FGPCPδ (S, F ). Let g > 0 be a constant and Vg be the verifier of SAT that gives the gap of g. By invoking Lemma 12, we have a CSP φ1 with S(n, g) variables and 100S(n, g)g/δ clauses. Moreover, the freeness and gap of φ1 are F (g) and g respectively. Applying the FGLSS reduction, we have a graph G with N = |V (G)| = 100S(n, g)F (g)g/δ = O(S(n, g)F (g)g). Now assume that we have an algorithm A that gives o(S −1 (N,g)) a g approximation in time 2 gF (g) . Notice that S −1 (N, g) ≤ O(ngF (g)) and therefore algorithm A distinguishes between Yes- and No-instance in time 2o(n) , a contradiction. Hardness under Gap-ETH: Dinur [16] and Manurangsi and Raghavendra [28] made a conjecture that SAT does not admit an approximation scheme that runs in 2o(n) time. We c observe a Gap-ETH hardness of r-approximating Independent Set in time 2n/r for some constant c. The proof uses a standard amplification technique and is deferred to Appendix B. 5 Further Research Our work leaves ample opportunity for exciting research. An obvious open question is to derandomize our branching, e.g. whether Theorem 1 can be proved without randomized N. Bansal et al. algorithms. While the probabilistic approximation guarantee can be easily derandomized by using a random partition of the vertex set in r parts or splitters, it seems harder to strengthen the expected running time bound to a worst-case running time bound. Can we improve the running times of the other algorithms mentioned in the introduction that use the partition argument, possibly using the randomized branching strategy? Specifically, can we (1 + ε)-approximate Independent Set on planar graphs in time O∗ (2(1/ε)/ log(1/ε) ), or r-approximate Independent Set in time O∗ (2tw/r log r )? As mentioned in the introduction, a result of Marx [29] still leaves room for such lower order improvements. Another open question in this category is how fast we can r-approximate k-Independent Set, where the goal is to find an independent st of size of k. For example no O(nk/f (r) ) time algorithm is known, where f (r) is a non-trivial function of r, that distinguishes graphs G with α(G) ≥ 2k from graphs with α(G) ≤ k. The partition argument gives only a running time of (n/r)0.792k , and no strong lower bounds are known for this problem. Finally, a big open question in the area is to find or exclude a (2 − ε)-approximation for Vertex Cover in graphs in subexponential time for some fixed constant ε > 0. Acknowledgment NB is supported by a NWO Vidi grant 639.022.211 and ERC consolidator grant 617951. BL is supported by ISF Grant No. 621/12 and I-CORE Grant No. 4/11. DN is supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under grant agreement No 715672 and the Swedish Research Council (Reg. No. 2015-04659). JN is supported by NWO Veni grant 639.021.438. References 1 2 3 4 5 6 7 8 9 10 Brenda S. Baker. Approximation algorithms for np-complete problems on planar graphs. J. ACM, 41(1):153–180, 1994. Nikhil Bansal, Anupam Gupta, and Guru Guruganesh. On the Lovász Theta Function for Independent Sets in Sparse Graphs. In Symposium on Theory of Computing, STOC, pages 193–200, 2015. Mihir Bellare, Oded Goldreich, and Madhu Sudan. Free bits, pcps, and nonapproximabilitytowards tight results. SIAM J. Comput., 27(3):804–915, 1998. Andreas Björklund, Thore Husfeldt, and Mikko Koivisto. Set partitioning via inclusionexclusion. SIAM J. Comput., 39(2):546–563, 2009. Édouard Bonnet, Michael Lampis, and Vangelis Th. Paschos. Time-approximation tradeoffs for inapproximable problems. In Symposium on Theoretical Aspects of Computer Science, STACS, pages 22:1–22:14, 2016. Édouard Bonnet and Vangelis Th. Paschos. Sparsification and subexponential approximation. Acta Informatica, pages 1–15, 2016. Nicolas Bourgeois, Bruno Escoffier, and Vangelis Th. Paschos. Approximation of max independent set, min vertex cover and related problems by moderately exponential algorithms. Discrete Applied Mathematics, 159(17):1954 – 1970, 2011. Chris Calabro, Russell Impagliazzo, and Ramamohan Paturi. A duality between clause width and clause density for SAT. In Conference on Computational Complexity (CCC), pages 252–260, 2006. Parinya Chalermsook, Bundit Laekhanukit, and Danupon Nanongkai. Independent set, induced matching, and pricing: Connections and tight (subexponential time) approximation hardnesses. In Foundations of Computer Science, FOCS, pages 370–379, 2013. Siu On Chan. Approximation resistance from pairwise-independent subgroups. J. ACM, 63(3):27:1–27:32, 2016. 11 12 New Tools and Connections for Exponential-time Approximation 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Marek Cygan, Lukasz Kowalik, Marcin Pilipczuk, and Mateusz Wykurz. Exponential-time approximation of hard problems. CoRR, abs/0810.4934, 2008. Marek Cygan, Lukasz Kowalik, and Mateusz Wykurz. Exponential-time approximation of weighted set cover. Inf. Process. Lett., 109(16):957–961, 2009. Marek Cygan and Marcin Pilipczuk. Exact and approximate bandwidth. Theor. Comput. Sci., 411(40-42):3701–3713, 2010. Artur Czumaj, Magnús M. Halldórsson, Andrzej Lingas, and Johan Nilsson. Approximation algorithms for optimization problems in graphs with superlogarithmic treewidth. Inf. Process. Lett., 94(2):49–53, 2005. Irit Dinur. The PCP theorem by gap amplification. J. ACM, 54(3):12, 2007. Irit Dinur. Mildly exponential reduction from gap 3sat to polynomial-gap label-cover. Electronic Colloquium on Computational Complexity (ECCC), 23:128, 2016. Uriel Feige. Approximating maximum clique by removing subgraphs. SIAM J. Discrete Math., 18(2):219–225, 2004. Uriel Feige, Shafi Goldwasser, László Lovász, Shmuel Safra, and Mario Szegedy. Interactive proofs and the hardness of approximating cliques. J. ACM, 43(2):268–292, 1996. Uriel Feige and Joe Kilian. Zero knowledge and the chromatic number. J. Comput. Syst. Sci., 57(2):187–199, 1998. Eran Halperin. Improved approximation algorithms for the vertex cover problem in graphs and hypergraphs. SIAM J. Comput., 31(5):1608–1623, 2002. Johan Håstad. Clique is hard to approximate within n1-epsilon . In 37th Annual Symposium on Foundations of Computer Science, FOCS, pages 627–636, 1996. Russell Impagliazzo, Ramamohan Paturi, and Francis Zane. Which problems have strongly exponential complexity? J. Comput. Syst. Sci., 63(4):512–530, 2001. Subhash Khot, Dor Minzer, and Muli Safra. On independent sets, 2-to-2 games and grassmann graphs. Electronic Colloquium on Computational Complexity (ECCC), 23:124, 2016. Subhash Khot and Ashok Kumar Ponnuswami. Better inapproximability results for maxclique, chromatic number and min-3lin-deletion. In Automata, Languages and Programming, International Colloquium, (ICALP), pages 226–237, 2006. Subhash Khot and Oded Regev. Vertex cover might be hard to approximate to within 2-epsilon. J. Comput. Syst. Sci., 74(3):335–349, 2008. Subhash Khot and Igor Shinkar. On hardness of approximating the parameterized clique problem. In Innovations in Theoretical Computer Science (ITCS), pages 37–45, New York, NY, USA, 2016. ACM. doi:10.1145/2840728.2840733. Bundit Laekhanukit. Inapproximability of Combinatorial Problems in Subexponential-Time. PhD thesis, McGill University, 2014. Pasin Manurangsi and Prasad Raghavendra. A birthday repetition theorem and complexity of approximating dense csps. CoRR, abs/1607.02986, 2016. Dániel Marx. On the optimality of planar and geometric approximation schemes. In Foundations of Computer Science (FOCS), pages 338–348, 2007. Dana Moshkovitz and Ran Raz. Two-query PCP with subconstant error. J. ACM, 57(5):29:1–29:29, 2010. Jaroslav Nešetřil and Svatopluk Poljak. On the complexity of the subgraph problem. Commentationes Mathematicae Universitatis Carolinae, 026(2):415–419, 1985. Ryan Williams and Huacheng Yu. Personal communication. N. Bansal et al. A 13 A Deterministic Algorithm for Independent Set In this section, we give a deterministic r-approximation algorithm that runs in time 2O(n/r log r) . This algorithm is a simple consequence of Feige’s algorithm [17], that we restate below in a slightly different form. α(G) |V (G)| n Ω(t · logk ( kt )) in I Theorem 14 ([17]). Let G be a graph with independence ratio = 1/k. Then, for any parameter t, one can find an independent set of size time poly(n)k O(t) . Now, our algorithm proceeds as follows. If α(G) < n/ log2 r, we can enumerate sets of size n/(r log2 r) (this is an n  all independent n 2 2 r-approximation) in time n/(r log2 r) ≤ (er log r) r log r ≤ 2O(n/(r log r)) . Otherwise, the independence ratio is at least 1/k where k = log2 r. We choose t = n/(r log r), so Feige’s algorithm finds an independent set of size at least    n  n Ω t · logk ( ) = Ω · logk (r log r) = Ω(n/(r log log r)) kt r log r The running time is k O(t) = 2O( n(log log r) ) r log r If we redefine r0 = r log log r, then the algorithm is an r0 -approximation algorithm that 0 2 0 0 runs in time 2O(n(log log r ) /r log r ) . B Gap-ETH hardness of Independent Set (sketch) We now sketch the proof. We are given an n-variable 3-CNF-SAT formula φ with perfect completeness and soundness 1 −  for some  > 0. We first perform standard amplification and sparsification to get φ0 with gap parameter g, the number of clauses is ng, and freeness is g O(1/) . Now, we perform FGLSS reduction to get a graph G such that |V (G)| = ng O(1/) . O(1/) ) Therefore, g-approximation in time 2o(|V (G)|/g would lead to an algorithm that satisfies more than (1 − ) fraction of clauses in 3-CNF-SAT formula in time 2o(n) . In other words, any c 2n/r -time algorithm that r-approximates Independent Set can be turned into a (1 + O(1/c))approximation algorithm for approximating 3-CNF-SAT in sub-exponential time.
8cs.DS
arXiv:1610.06783v1 [math.GR] 21 Oct 2016 LES GROUPES DE MATHIEU SONT-ILS AUSSI SPORADIQUES QU’IL Y PARAÎT ? LABIB HADDAD À Yves Sureau, guide avisé, de haute montagne, au pays des hypergroupes. Abstract. This is a plea for the reopening of the building site for the classification of finite simple groups in order to include the finite simple hypergroups. Hypergroups were first introduced by Frédéric Marty, in 1934, at a Congress in Stockholm, not to be confused with a later and quite different notion to which the same name was given, inopportunely. I am well aware that, probably, quite a few mathematicians must have already felt uncomfortable about the presence of the so-called sporadic simple groups in the large tableau of the classification of finite simple groups, and might have wrote about it, though I do not have any reference to mention. In what follows, I will try to explain, step by step, what a hypergroup is, and, then, suggest a notion of simplicity for hypergroups, in a simple and natural way, to match the notion in the case of groups, hoping it will be fruitful. Examples and constructions are included. 2 LH Introduction Ce qui suit est un plaidoyer pour la réouverture du chantier de classification des groupes simples finis afin d’y inclure les hypergroupes simples finis. La notion d’hypergroupe a été introduite par Frédéric Marty, en 1934, lors d’un congrès à Stockholm, à ne pas confondre avec une notion plus tardive et tout à fait différente à laquelle on a, malencontreusement, donné le même nom. Je suis bien conscient qu’un bon nombre de mathématiciens ont déjà dû se sentir mal à l’aise au sujet de la présence de ce que l’on nomme les groupes simples sporadiques dans le grand tableau de la classification, et certains ont même pu le coucher par écrit, bien que je ne puisse mentionner aucune référence. Dans ce qui suit, on va commencer par rappeller, pas à pas, ce qu’est un hypergroupe puis comment y introduire la simplicité de manière simple (et utile) et qui coı̈ncide avec la notion classique, dans le cas des groupes. On élabore en donnant une manière très générale pour la construction d’hypergroupes et l’on donne des conditions pour qu’ils soient simples. On fournit de nombreux exemples et caractérisations On pose enfin la question : ≪À peine clos, le chantier de la classification des groupes simples finis devra-t-il, éventuellement, rouvrir ses portes afin d’entreprendre la classification des hypergroupes simples finis ?≫ Quelques définitions Un hypergroupe est un ensemble muni d’une opération binaire associative multivalente dont les propriétés généralisent celles des groupes. Plus précisément, une opération binaire multivalente sur un ensemble donné H est une application (x, y) 7→ x.y qui, à chaque couple d’éléments (x, y) ∈ H × H, fait correspondre une partie x.y ⊂ H. Groupes de Mathieu sporadiques ? 3 Pour X ⊂ H et Y ⊂ H, on désigne alors par X.Y la réunion de toutes les parties x.y où x parcourt X et y parcourt Y . Le maniement des opérations multivalentes nécesssite un tout petit effort d’attention de plus que l’usage des opérations classiques, univalentes, n’en demande, mais l’habitude finit par estomper la difficulté. Lorsque le risque de confusion est minime, on écrit, simplement, x.Y au lieu de {x}.Y et, de même, X.y au lieu de X.{y}. Enfin, si une des parties x.y est un singleton, au lieu de x.y = {z}, on écrit plus simplement x.y = z et on retrouve l’écriture classique des opérations binaires univalentes. Définition. Un hypergroupe est un ensemble non vide, H, muni d’une opération binaire multivalente qui vérifie les deux identités suivantes, pour tous x, y, z dans H, x.(y.z) = (x.y).z : associativité. x.H = H = H.x : reproductivité. Ces deux propriétés impliquent que (x.y).H = x.(y.H) = x.H = H, de sorte que le produit x.y n’est jamais vide. Bien entendu, tout groupe est un hypergroupe dont l’opération est univalente. Réciproquement, tout hypergroupe dont l’opération est univalente est un groupe puisqu’alors, pour chaque couple (a, b) donné, les équations a.x = b et y.a = b possèdent des solutions en x et en y. Un exemple élémentaire. Soient G un groupe, H l’un quelconque de ses sous-groupes et soit G/H = {xH : x ∈ G} l’ensemble des classes à droite de G modulo H. L’ensemble xHyH est la réunion des classes à droite xhyH où h parcourt H. En posant (xH).(yH) = {xhyH : h ∈ H}, on définit une opération binaire multivalente sur l’ensemble G/H qui en fait un hypergroupe, comme on le vérifie sans détour. Cette opération est univalente si et seulement si H est un sous-groupe invariant de G : dans ce cas l’hypergroupe G/H est le groupe quotient classique de G par H. Lorsque le sous-groupe H n’est pas invariant dans G, on obtient alors un exemple élémentaire d’un hypergroupe qui n’est pas un groupe. Traditionnellement, on appelle D-hypergroupe tout hypergroupe isomorphe à un hypergroupe de classes à droite de la forme G/H. Morphismes. Un morphisme est alors, par définition, une application f : H → K d’un hypergroupe H dans un hypergroupe K qui vérifie l’identité d’homomorphisme, f (x.y) = f (x).f (y). 4 LH On appelle isomorphisme entre H et K toute application bijective f : H → K qui est un morphisme ainsi que sa réciproque f −1 . Comme dans le cas des groupes, un morphisme bijectif f : H → K est (déjà) un isomorphisme car, dans ce cas, f −1 est aussi un morphisme. En effet, pour a = f (x) et b = f (y), on aura x.y = f −1 f (x.y) = f −1 (f (x).f (y)), autrement dit, f −1 (a).f −1 (b) = f −1 (a.b). Bien entendu, lorsque H et K sont des groupes, on retrouve ainsi les notions classiques d’homomorphismes et d’isomorphismes de groupes. Nombres premiers et groupes simples. Comme pour la primalité, il y a deux manières équivalentes de définir la simplicité. Un entier n > 0 est premier lorsqu’il a exactement deux diviseurs : cela revient à dire qu’il est seulement multiple de deux entiers distincts. Un groupe est simple lorsqu’il a exactement deux sous-groupes invariants : cela revient à dire qu’il possède seulement deux images homomorphes distinctes, à isomorphisme près. Afin d’étendre aux hypergroupes la notion de simplicité, il faut trouver un substitut convenable à la notion d’image homomorphe d’un groupe. Voici ce que nous proposons. Reflets et simplicité. On dira que l’hypergroupe K est un reflet de l’hypergroupe H lorsqu’il existe une application surjective f : H → K qui vérifie les identités suivante : f −1 f (x.y) = f −1 (f (x).f (y)) = x.f −1 f (y) = f −1 f (x).y. On dira alors que l’application f est un réflecteur. Tout réflecteur f est nécessairement un morphisme. En effet, f étant surjective, on a f (x.y) = f f −1 f (x.y) = f f −1 (f (x).f (y)) = f (x).f (y). On observera aussi, sans détour, qu’une application f : H → K est un isomorphisme si et seulement si c’est un réflecteur injectif. Bien entendu, si H est un groupe, l’hypergroupe K est un reflet du groupe H si et seulement si c’est une image homomorphe de H. Chaque hypergroupe H possède toujours, naturellement, les deux reflets suivants : lui-même et l’hypergroupe trivial à un seul élément ; Groupes de Mathieu sporadiques ? 5 ces deux reflets sont isomorphes si et seulement si H lui-même est trivial. On dira qu’un hypergroupe est simple lorsqu’il possède (à isomorphisme près) exactement deux reflets. Cette manière de procéder permet d’éviter les arcanes de la théorie des sous-hypergroupes. On peut espérer que cette nouvelle notion soit un bon choix. Il est clair qu’un groupe donné est simple si et seulement si c’est un ≪hypergroupe simple≫. La classe des hypergroupes simples finis contient ainsi celle des groupes simples finis. Elle la contient, et la prolonge : voir, en effet, la conséquence (5) ci-dessous. Invariance. On aura besoin de la définition suivante. Etant donnés un groupe G ainsi que deux sous-groupes H et K, on dira que le sousgroupe K est invariant modulo H lorsque l’on a (∗) KxK = HxK = KxH, pour tout x ∈ G. Cela généralise la notion classique de sous-groupe invariant car, bien entendu, un sous-groupe est invariant (au sens classique) si et seulement s’il est invariant modulo le sous-groupe trivial. On observera, en passant aux inverses, que chacune des deux conditions suivantes est équivalente à l’autre : KxK = HxK, pour tout x ∈ G, KxK = KxH, pour tout x ∈ G. Chacune d’elles est ainsi équivalente à la condition (∗). En outre, lorsque K est invariant modulo H, on a nécessairement H ⊂ K puisque, pour x ∈ K, la condition HxK = KxK entraı̂ne HK = K. La condition (∗) peut donc s’énoncer également comme ceci : (∗) H ⊂ K et Kx ⊂ HxK, pour tout x ∈ G. Théorème. Soient G un groupe, H et K deux quelconques de ses sous-groupes. Si K est invariant modulo H, le D-hypergroupe G/K est un reflet du D-hypergroupe G/H. Réciproquement, tout reflet de G/H est isomorphe à l’un de ces D-hypergroupes G/K où K est invariant modulo H. Afin de ne pas couper le fil de l’exposé, nous renvoyons la démonstration de ce théorème à l’Appendice ci-dessous. 6 LH Conséquences 1. Tout reflet d’un D-hypergroupe est donc un D-hypergroupe. 2. Le D-hypergroupe G/H est simple si et seulement si H est distinct de G et que les seuls sous-groupes K de G invariants modulo H sont G et H lui-même. 3. En particulier, le D-hypergroupe G/H est simple dès lors que H est un sous-groupe maximal dans G. 4. Ainsi, lorsque H est un sous-groupe maximal du groupe G et qu’il n’est pas invariant dans G, l’hypergroupe G/H est simple et n’est pas un groupe. 5. Il existe donc des hypergroupes simples finis qui ne sont pas des groupes. Classes à gauche On définit, semblablement, l’hypergroupe H\G = {Hx : x ∈ G} des classes à gauche modulo H. Les hypergroupes isomorphes à ces hypergroupes de classes à gauche possèdent les mêmes propriétés, corrélatives, que les D-hypergroupes. Par exemple, H\G est un groupe si et seulement si H est invariant dans G et, s’il en est ainsi, les deux groupes G/H et H\G coı̈ncident, bien entendu. De même, étant donnés deux sous-groupes H ⊂ K ⊂ G, l’hypergroupe K\G est un reflet de H\G si K est invariant modulo H. Le théorème et ses conséquences se transposent, corrélativement. En particulier H\G est simple si et seulement si G/H l’est. Hypergroupe opposé Soit H un hypergroupe avec son opération (x, y) 7→ x.y. Comme dans le cas des opérations univalentes, on définit l’opération opposée (x, y) 7→ x ◦ y = y.x. Muni de cette nouvelle opération, H est de nouveau un hypergroupe que l’on désigne par H ◦ et que l’on appelle l’hypergoupe opposé. Que dire de l’hypergroupe (G/H)◦ opposé d’un hypergroupe G/H ? Groupes de Mathieu sporadiques ? 7 Théorème. Soient G un groupe et H un de ses sous-groupes. (1) Les deux hypergroupes (G/H)◦ et H\G sont isomorphes. (2) D’un autre côté , pour que les deux hypergroupes G/H et H\G soient isomorphes, il faut et il suffit que H soit un sous-groupe invariant dans G. Autrement dit, lorsque le sous-groupe H n’est pas invariant, les deux hypergroupes G/H et H\G ne sont pas isomorphes. Lorsque le sousgroupe H est invariant, G/H et H\G sont un seul et même groupe quotient. Démonstration. (1) Plus précisément, l’application Hx 7→ (Hx)−1 qui, à chaque classe à droite Hx ∈ H\G, fait correspondre la classe à gauche (Hx)−1 = x−1 H ∈ G/H est un isomorphisme de l’hypergroupe H\G sur l’hypergroupe opposé (G/H)◦, comme une simple vérification le montre. (2) Si H est invariant, alors G/H et H\G sont, tous deux, le même groupe quotient classique de G par H. Réciproquement, soit f : G/H → H\G un isomorphisme entre ces deux hypergroupes. Dans chacun d’eux, H est la seule classe qui vérifie l’identité H.H = H. On a donc f (H) = H. De plus, quelque soit x ∈ G, on a (xH).H = xH dans l’hypergroupe G/H. Pour chaque y ∈ G, il existe x ∈ G tel que f (xH) = Hy. On aura alors Hy = f (xH) = f ((xH).H) = f (xH).f (H) = (Hy).H. Ainsi, dans H\G, le produit (Hy).H = Hy est un singleton : cela revient à dire que HyH = Hy, de sorte que Hy ⊂ yH pour tout y ∈ G, donc H est invariant.  Ils vont par paires Soit K un sous-groupe d’un groupe donné G. Si l’hypergroupe G/K est simple, on sait que l’hypergroupe K\G est également simple. Lorsque, de plus, ce ne sont pas des groupes, on sait qu’ils ne sont pas isomorphes. Ainsi, comme les racines imaginaires conjuguées d’un polynôme réel, ces hyergroupes simples vont par paires ! En particulier, en prenant tous les couples (G, K) où K est un sousgroupe maximal, non invariant, d’indice fini, dans un groupe G, on 8 LH obtient une famille de paires d’hypergroupes simples finis (G/K, K\G), deux à deux opposés et non isomorphes : cette famille prolonge ainsi la famille des groupes cycliques simples finis. Les plus simples des exemples On prend pour G le groupe de toutes les permutations d’un ensemble E non vide, fini ou infini, ayant α pour cardinal. On distingue un point particulier p ∈ E et on prend H = {s ∈ G : s(p) = p}, le sous-groupe des permutations qui laissent le point p fixe. C’est un sous-groupe maximal de G. Pour α > 3, ce sous-groupe H n’est pas invariant, de sorte que K = G/H est alors un D-hypergroupe simple qui n’est pas un groupe et dont le cardinal est celui de E. En désignant par e la classe H ∈ K, on vérifie aisément que sa table de multiplication se résume alors ainsi : x.e = x, pour tout x ∈ K, x.y = K \ {x}, pour y 6= e. On observera encore ceci : pour tout x 6= e, on a x2 = x.x = K \ {x} et x3 = x.x.x = K. Ainsi, contrairement au cas des groupes, l’ordre de chacun de ces hypergroupes monogènes est toujours égal à trois et ne coı̈ncide avec son cardinal que pour α = 3. En particulier, en prenant pour α, successivement, chacun des entiers n > 3, on obtient une suite de D-hypergroupes simples finis ayant n éléments et qui ne sont pas des groupes. Un pas de plus Le procédé de construction des hypergroupes de classes, à droite ou à gauche, de la forme G/H ou H\G, peut être grandement étendu en une large généralisation que voici. On se donne un ensemble T , une partie C ⊂ T × T ainsi qu’une opération binaire univalente, Op : C → T, partiellement définie, pour les seuls couples (x, y) ∈ C que l’on appellera les couples composables. Le plus souvent, on écrira simplement xy au lieu de Op(x, y) et on dira que (T, C) est une trame. Groupes de Mathieu sporadiques ? 9 Soit R une relation d’équivalence sur l’ensemble T et, pour chaque élément x ∈ T , soit x̄ sa classe modulo R. On définit alors une opération multivalente (naturelle) sur l’ensemble des classes T /R, de la manière suivante : z̄ ∈ x̄.ȳ ⇐⇒ (∃(u, v) ∈ C)(uv ∈ z̄). On dira que (T, C, R) est une présentation de la structure quotient T /R et, lorsque T /R est un hypergroupe, on dira que la relation R est adéquate. On peut donner, facilement, des conditions nécessaires et suffisantes pour que la relation d’équivalence R soit adéquate, sous la forme d’un ensemble d’énoncés du premier ordre. Il n’est pas besoin de rentrer dans le détail, ici. Voir, pour cela, l’Appendice ci-dessous. Pour le moment, il suffit de savoir que ces conditions explicites existent. Une heureuse circonstance Bien entendu, chaque hypergroupe de classes, de la forme G/H ou H\G, possède une présentation naturelle dont la trame est (T, C) où T = G est le groupe lui-même, C = G × G, (i.e., tous les couples sont composables, l’opération étant celle du groupe). La relation d’équivalence R est définie par xRy ⇐⇒ x−1 y ∈ H, respectivement, xRy ⇐⇒ yx−1 ∈ H. Plus généralement donc, chaque hypergroupe isomorphe à l’un quelconque de ces hypergroupes de classes possède également une présentation. Cette particularité n’est, cependant, pas due à une quelconque singularité de ces hypergroupes. Elle est le lot de tous les hypergroupes, quels qu’ils soient. Voici comment. Tout hypergroupe possède une présentation En effet, soit H un hypergroupe quelconque et T = H × H × H × H. À chaque triplet t = (x, y, z) ∈ H × H × H pour lequel z ∈ x.y, on associe le couple composable ((x, t), (y, t)) ∈ T × T et on pose Op((x, t), (y, t)) = (z, t) : cela définit une opération Op : C → T où C est l’ensemble de tous les couples composables. On obtient ainsi la trame (T, C). On prend pour R la relation d’équivalence sur T dont les 10 LH classes sont les parties {x} × H × H × H. On vérifie, sans détour, que T /R est un hypergroupe isomorphe à l’hypergroupe donné H. cqfd Une nouvelle famille d’exemples Voici une première illustration du procédé de présentation qui fournit des hypergroupes qui ne sont pas des D-hypergroupes. On prend un ensemble K réunion d’une famille (Ai )i∈I d’ensembles non vides, deux à deux disjoints. On suppose que 0 ∈ I et on distingue un point particulier e ∈ A0 . On introduit l’ensemble T formé de toutes les applications injectives f : X → K où e ∈ X ⊂ K et vérifiant la condition suivante : il existe (au moins) une permutation s : I → I telle que l’on ait, pour tout i ∈ I, f (X ∩ Ai ) ⊂ As(i) . On dira que le couple (f, g) formé de deux éléments f : X → K et g : Y → K de T est composable lorsque l’on a g(e) ∈ X et on prend pour composé f g l’application y 7→ f (g(y)) définie sur la partie Y ∩ g −1(X) : cette application, on le voit sans détour, appartient bien à T . On obtient, ainsi, une trame (T, C). L’application f 7→ f (e) de T dans K est surjective et définit une relation d’équivalence R sur T dont les classes d’équivalences sont les parties x̄ = {f ∈ T : f (e) = x}. L’application x 7→ x̄ permet d’identifier l’ensemble T /R des classes modulo R à l’ensemble K lui-même. L’opération multivalente correspondant à la présentation (T, C, R) de T /R = K est donnée par z ∈ x.y ⇐⇒ (∃(f, g) ∈ C)(f (e) = x , g(e) = y , f (y) = z). On en établit facilement la table de multiplication sous la forme suivante : quels que soient ai ∈ Ai , pour chaque indice i, x.e = x, pour tout x ∈ K, ai .y = Ai \ {ai }, pour tout y ∈ A0 \ {e}, ai .aj = K \ Ai , pour tout indice j 6= 0. Dans le cas particulier où I = {0}, K = A0 , on reconnaı̂t l’exemple du D-hypergroupe simple déjà rencontré plus haut. Groupes de Mathieu sporadiques ? 11 Plus généralement, si toutes les parties Ai ont même cardinal, K est encore un D-hypergroupe. En effet, on le voit facilement en introduisant une nouvelle trame G, une sous-trame de la trame de départ T . Du fait que les parties Ai sont équipotentes, chaque élément f de T se prolonge en un élément g de T qui est une application bijective g : K → K, autrement dit, une permutation de l’ensemble K. Ce prolongement n’est cependant pas nécessairement unique. L’ensemble G ⊂ T formé de toutes ces permutations de K est un groupe. On désigne par S la restriction de l’équivalence R au sous-ensemble G et par H le sous-groupe de G formé des permutations qui laissent fixe le point e. On vérifie, sans grand détour, que la structure T /R est isomorphe à la structure G/S elle-même isomorphe au D-hypergroupe G/H. cqfd On trouvera davantage de précisions au sujet de ces structures dans l’Appendice, ci-dessous. Pour le moment, on notera, cependant, encore ceci : pour I = {0, 1} , |A0 | = n > 3 , |A1 | > 3 , n 6= p, on obtient une structure à n + p éléments qui est un hypergroupe, mais pas un D-hypergroupe : voir le A5 de l’Appendice. Scholie On va explorer les liens qui peuvent exister entre deux présentations ayant une même trame (T, C). On se donne deux relations d’équivalence R et S sur l’ensemble T . On désigne, respectivement, par x̄ et x̂ la classe de x modulo R et la classe de x modulo S. On a ainsi deux présentations, (T, C, R) et (T, C, S), de la structure quotient T /R et de la structure quotient T /S, respectivement, qui sont munies des opérations multivalentes correspondantes : z̄ ∈ x̄.ȳ ⇐⇒ (∃(u, v) ∈ (x̄ × ȳ) ∩ C)(uv ∈ z̄), ẑ ∈ x̂.ŷ ⇐⇒ (∃(u, v) ∈ (x̂ × ŷ) ∩ C)(uv ∈ ẑ). Bien entendu, lorsque R ⊂ S, on a x̄ ⊂ x̂ et, dans ce cas, x̄ 7→ x̂ est une application surjective f : T /R → T /S, f (x̄) = x̂. De plus, il 12 LH suffit de se reporter aux définitions pour constater que l’on aura alors, toujours, l’inclusion f (x̄.ȳ) ⊂ x̂.ŷ. Pour avoir l’égalité f (x̄.ȳ) = x̂.ŷ, il faut et il suffit que l’on ait (∗∗)((u, v) ∈ (x̂ × ŷ) ∩ C) =⇒ (∀(p, q) ∈ x̂ × ŷ)(∃(r, s) ∈ (p̄ × q̄) ∩ C)(rs b =u cv). Pour examiner plus attentivement cette situation, commençons par lui donner un nom commode : convenons de dire que l’équivalence S est invariante modulo R lorsque l’on a R ⊂ S et que la condition précédente, (∗∗), est satisfaite pour tous x, y dans T . Supposons donc que S soit invariante modulo R. Il va en découler trois conséquences importantes. 1. Pour tous x, y, z dans T , on aura f −1 f (x̄.ȳ) = f −1 (f (x̄).f (ȳ)) = x̄.f −1 f (ȳ) = f −1 f (x̄).ȳ. 2. Si R est adéquate, il en sera de même de S. Autrement dit, si T /R est un hypergroupe, T /S sera un reflet de T /R car f est alors un réflecteur d’après 1. 3. En particulier, si T /R est un groupe, T /S sera une image homomorphe de T /S. Démonstration. 1. Du fait de l’égalité f (x̄.ȳ) = x̂.ŷ = f (x̄).f (ȳ), on a aussi f −1 f (x̄.ȳ) = f −1 (f (x̄).f (ȳ)). Par définition, on a f (x̄) = x̂ , f (ȳ) = ŷ. Il nous faut établir l’identité f −1 (f (x̄).f (ȳ)) = x̄.f −1 f (ȳ) qui s’écrit donc f −1 (x̂.ŷ) = x̄.f −1 (ŷ). On procède par implications et équivalences successives. On a z̄ ∈ f −1 (x̂.ŷ) ⇐⇒ ẑ ∈ x̂.ŷ ⇐⇒ ∃ (u, v) ∈ (x̂ × ŷ) ∩ C tel que uv ∈ ẑ, Groupes de Mathieu sporadiques ? 13 z̄ ∈ x̄.f −1 (ŷ) ⇐⇒ ∃ t ∈ ŷ et ∃ (u, v) ∈ (x̄ × t̄) ∩ C tel que uv ∈ z̄. Or, t ∈ ŷ et (u, v) ∈ (x̂ × t̂) ∩ C =⇒ (u, v) ∈ (x̂ × ŷ) ∩ C, donc z̄ ∈ x̄.f −1 (ŷ) =⇒ z̄ ∈ f −1 (x̂.ŷ). Pour la réciproque, on utilise la condition (∗∗) sous la forme suivante : t ∈ ŷ et (u, v) ∈ (x̂× ŷ) ∩C =⇒ ∃ (r, s) ∈ (x̄× t̄) ∩C tel que rs b =u cv, donc z̄ ∈ f −1 (x̂.ŷ) =⇒ z̄ ∈ x̄.f −1 (ŷ). D’où l’égalité annoncée f −1 (f (x̄).f (ȳ)) = x̄.f −1 f (ȳ). On étalit de même, l’égalité f −1 (f (x̄).f (ȳ)) = f −1 f (x̄).ȳ. Cela démontre le point 1. 2. Si T /R est un hypergroupe, il en va de même de T /S du fait que f est surjective et vérifie l’identité f (x̄.ȳ) = x̂.ŷ = f (x̄).f (ȳ). En effet, l’opération multivalente de T /S est alors associative car celle de T /R l’est : (x̂.ŷ).ẑ = f (x̄.ȳ).f (z̄) = f (x̄.ȳ.z̄) = f (x̄).f (ȳ.z̄) = x̂.(ŷ.ẑ). De même, elle possède également la propriété de reproductibilité comme pour T /R. Cela démontre le point 2 dont découle immédiatement le point 3.  On aura remarqué, sans doute, la similitude avec la démonstration faite au A1 de l’Appendice pour le cas particulier des D-hypergroupes. On en vient, à présent, à la généralisation complète suivante du théorème qui caractérise les reflets des D-hypergroupes. Théorème. Soit (T, C, R) une présentation d’un hypergroupe H quelconque. Tout reflet L de H possède une présentation (T, C, S) où S est une équivalence invariante modulo R. 14 LH Démonstration. Soient p : T → h = T /R la projection de T sur l’ensemble quotient, h : H → L un réflecteur et S l’équivalence sur T définie par l’application composée g = hp, autrement dit, xSy ⇐⇒ h(p(x)) = h(p(y)). L’hypergroupe L est ainsi identifié à l’hypergroupe T /S présenté par (T, C, S). On adopte les notations précédentes, en posant x̄ = p(x) , x̂ = h(p(x)). On va montrer que S vérifie la condition (∗∗). On se donne (u, v) ∈ (x̂ × ŷ) ∩ C et (p, q) ∈ x̂ × ŷ. On a ainsi p̂ = x̂, q̂ = ŷ et u cv ∈ x̂.ŷ = h(p̄.q̄). Puisque h est un réflecteur, il existe z tel que z̄ ∈ p̄.q̄ et ẑ = u cv. Cela veut dire qu’il existe (r, s) ∈ (p̄ × q̄) ∩ C tel que z̄ = rs et, par suite, rs b = ẑ = u cv.  Corollaire. Soit (T, C, R) une présentation d’un hypergroupe H non trivial. Cet hypergroupe H est simple si et seulement si les deux seules équivalences invariantes modulo R sont l’équivalence totale T × T et R elle-même. Une remarque. Insistons : tout hypergroupe possède une présentation à l’aide d’une trame convenable. La démonstration donnée plus haut établit, en fait, le résultat encore plus général que voici. Soit H un ensemble muni d’une opération multivalente quelconque : autrement dit, certains des produits x.y peuvent être vides et l’opération n’a nul besoin d’être associative, ni reproductive. La construction donnée plus haut fournit une trame (T, C) et une relation d’équivalence R sur T telles que (T, C, R) soit une présentation de H, autrement dit, H est isomorphe à la structure quotient T /R. On peut concevoir cette présentation comme un déploiement de l’opération multivalente sur H en une opération univalente sur T , mais partiellement définie. Ce que l’on gagne en simplicité, en passant du multivalent à l’univalent, on le perd, un tout petit peu, en passant d’une opération partout définie à une opération uniquement définie pour certains couples : le mal n’est pas si grand car cela sous-tend la notion d’une opération univalente générale pour laquelle certains produits x.y au lieu d’être des singletons, seraient simplement vides. Groupes de Mathieu sporadiques ? 15 Dans ce déploiement, chaque élément x de H est, pour ainsi dire, éclaté en une partie de T . On peut aussi concevoir cette présentation comme un revêtement de la structure H par la structure (T, C), un peu comme pour les variétés topologiques. Cette façon de faire est loin d’être rare. Elle est illustrée par de très nombreux exemples. Citons-en uniquement deux : le revêtement d’un groupe de Lie connexe par un groupe de Lie simplement connexe, et la représentation d’un ensemble analytique de la droite réelle par la projection d’un fermé du plan. Les chemins qui ne se distinguent pas très bien dans le groupe, se voient bien plus clairement une fois relevés dans le revêtement. De même, le schéma (complexe) de Souslin qui définit l’ensemble analytique est déployé, à l’aide du fermé du plan, comme une nappe froissée et entortillée que l’on étend sur une corde à linge. Bien entendu, le critère de simplicité qu’on vient de donner pour les hypergoupes s’applique à toutes les structures multivalentes ou univalentes. Il s’applique, en particulier, aux groupes : un groupe est simple si et seulement si l’une de ses présentations (T, C, R), vérifie la condition suivante : les deux seules équivalences invariantes modulo R sont l’équivalence totale T × T et R elle-même. De plus, s’il en est ainsi, alors toutes les présentations du groupe vérifie cette même condition. La question se pose alors : est-il plus simple d’établir qu’un groupe est simple, directement, en s’y tenant au plus près, ou bien peut-on simplifier la preuve, parfois, en prenant de la hauteur au-dessus du groupe, à l’aide d’une trame convenable ? Constructions ≪à la Utumi ≫ On se donne un hypergroupe H dont on désigne l’opération par le signe + (même si elle n’est pas ncessairement commutative). On se donne une partition P de l’ensemble H et, pour chaque x ∈ H, on désigne par x̄ la partie de la partition P à laquelle x appartient (sa ≪classe≫ ). On suppose que H possède un élément 0 ayant les propriétés 16 LH suivantes : 0̄ = {0} , x + 0 = x et x ∈ 0 + x ⊂ x̄ pour tout x ∈ H. On notera que l’on a alors 0 + x̄ = x̄. On définit sur H une nouvelle opération multivalente par la règle : x.y = x + ȳ. Cette opération est toujours reproductive puisque x.H = x + H = H et H.x = H + x̄ = H. Elle est associative si et seulement si, pour tous x et y, on a x̄ + ȳ = x + ȳ. Cela se voit simplement, sans grand détour. On dira alors que cet hypergroupe (H, .) est construit ≪à la Utumi≫ à partir de l’hypergroupe (H, +) et de la partition P. L’exemple de Utumi. Voici le premier exemple de cette construction, donné en 1949 par Utumi [7]. On prend pour H le groupe cyclique d’ordre huit : H = Z/8Z = {0, 1, 2, 3, 4, 5, 6, 7} et la partition formée des trois classes : I = {0}, A = {1, 4, 7} et B = {2, 3, 5, 6}. Les conditions précédentes, édictées pour la construction, étant satisfaite, (H, .) est un hypergroupe. Utumi a montré que ce n’était pas un D-hypergroupe bien qu’il possède la propriété suivante : pour chaque élément fixé x ∈ H, la collection {x.y : y ∈ H} est une partition de H et les cardinaux |x.y| sont tous égaux, pour y ∈ H. En 1940, Eaton [1] a donné le nom de cogroupes (à droite) à cette classe particulière d’hypergroupes et l’hypergroupe H de Utumi en fait partie. Aussi lui a-t-on donné le nom de cogroupe de Utumi. Pour plus de détail, on se reportera à [3]. On va établir, ici, le résultat nouveau que voici. Théorème. Le cogroupe de Utumi est un hypergroupe simple. En effet, soit f : H → K un réflecteur et pour chaque partie X ⊂ H, posons X̂ = f −1 f (X) et, en particulier, x̂ = f −1 f (x) pour chaque x ∈ H. Les propriétés du réflecteur se traduisent, ici, de la manière suivante : x.y c = x̂.ŷ = x.ŷ = x̂.y. Groupes de Mathieu sporadiques ? 17 De ce que x.0 = x, on tire : x̂ = x̂.0̂ = x.0̂ = x̂0 et, en particulier, 0̂ = 0̂.0̂ = 0.0̂ = 0̂.0. Deux cas seulement peuvent se présenter. Premier cas : 0̂ = 0. Alors, pour chaque x, on a x̂ = x.0 = x et f est un isomorphisme. Second cas : 0̂ contient un élément a 6= 0. Alors 0̂ contient aussi le produit 0.a = ā donc, également, le produit ā.a = ā + ā ainsi que toutes les sommes ā + ā + · · · + ā. Une simple vérification montre que A + A + A = H et B + B = H. Donc, quel que soit a 6= 0, on voit que l’on a 0̂ = H et l’hypergoupe K est donc trivial, réduit à un singleton. cqfd Plus généralement, et en brodant sur ce même canevas, on obtient donc ceci. Un hypergroupe (H, .) construit ≪à la Utumi≫, à partir d’un groupe (H, +) et d’une partition P, est simple dès que, pour chacune des parties A ∈ P, différente du singleton {0}, l’une au moins des sommes A + A + · · · + A est égale à H. Appendice Lorsque l’on traite d’hypergroupes, on adopte souvent une convention tacite : chaque fois que le produit x.y est un singleton, on écrit, indifféremment, x.y = {z} ou x.y = z, pourvu que le risque de confusion soit minime. Reflets d’un D-hypergroupe A1. Lemme. Soient H et K deux sous-groupes d’un groupe G. On suppose que K est invariant modulo H. Le D-hypergroupe G/K est alors un reflet du D-hypergoupe G/H. 18 LH Démonstration. Pour x ∈ G, posons x̄ = xH. Par hypothèse, H est un sous-groupe de K. En associant à chaque classe x̄ = xH ∈ G/H la classe x̂ = xK ∈ G/K, on obtient donc une application surjective canonique f : G/H → G/K. On va vérifier que f est un réflecteur. On a f (x̄) = x̂ = xK, de sorte que f (x̄.ȳ) = {ẑ : z ∈ xHyH}, f (x̄).f (ȳ) = x̂.ŷ = {ẑ : z ∈ xKyK}, et ces deux ensembles sont égaux. En effet, soit z ∈ xKyK alors z ∈ xHyK, puisque KyK = HyK ; autrement dit, l’intersection xK ∩ (xHy) n’est pas vide ; soit t un élément de cette intersection ; alors t ∈ xHyH et zK = tK. On a ainsi f (x̄.ȳ) = f (x̄).f (ȳ). De même, on a f −1 f (x̄) = f −1 (x̂) = {z̄ : z ∈ xK}, de sorte que f −1 f (x̄.ȳ) = f −1 (f (x̄).f (ȳ)) = {z̄ : z ∈ xKyK}, f −1 f (x̄).ȳ = {z̄ : z ∈ xKyH}, x̄.f −1 f (ȳ) = {z̄ : z ∈ xHyK}. Ces quatre ensembles sont égaux et l’application f est donc bien un réflecteur.  A2. Deux remarques utiles. Pour établir le lemme suivant, on aura besoin des deux résultats que voici. R1. Tout réflecteur f vérifie l’identité f −1 f (x).f −1 f (y) = f −1 (f (x).f (y)). En effet, soit z ∈ f −1 f (x).f −1 f (y). Il existe alors deux éléments u ∈ f −1 f (x) et v ∈ f −1 f (y) tels que z ∈ u.v. On a donc f (z) ∈ f (u.v) = f (u).f (v) = f (x).f (y). Autrement dit, on a f −1 f (x).f −1 f (y) ⊂ f −1 (f (x).f (y)). On conclut en remarquant que f −1 (f (x).f (y)) = x.f −1 f (y) ⊂ f −1 f (x).f −1 f (y). cqfd Groupes de Mathieu sporadiques ? 19 R2. On se donne des hypergoupes, H, K, L, ainsi que des applications, f : H → K , g : K → L, et leur composée h = gf . Si f et g sont des morphismes, il est clair que h est également un morphisme. Réciproquement, si f et h sont des morphismes, et pourvu que f soit surjective, l’application g est aussi un morphisme. En effet, pour x, y dans K, il existe a, b dans H tels que x = f (a) et y = f (b). Ainsi f (a.b) = f (a).f (b) = x.y donc g(x.y) = h(a.b) = h(a).h(b) = gf (a).gf (b) = g(x).g(y). Autrement dit, g est bien un morphisme. cqfd A3. Lemme. Soient G un groupe, H l’un quelconque de ses sousgroupes et L un reflet du D-hyprgroupe G/H. Il existe alors un sousgroupe K de G, invariant modulo H, tel que L soit isomorphe au D-hypergroupe G/K. Démonstration. Soit h : G/H → L un réflecteur. Désignons par e l’élément unité du goupe G puis, pour chaque x ∈ G, posons x̄ = xH. Soient 1 = h(ē) et K = {x : h(x̄) = 1}. On procède par étapes. On commence par montrer que K est un sous-groupe de G puis on montre qu’il est invariant modulo H et on établit, enfin, que L est isomorphe à l’hypergroupe G/K. 1. Pour x ∈ H, on a x̄ = ē, de sorte que h(x̄) = h(ē) = 1. On a donc H ⊂ K. On commence par utiliser le fait que h est un morphisme. 2. Pour x ∈ G et y ∈ G, on a xy ∈ xHyH donc xy ∈ (xH).(yH) = x̄.ȳ, de sorte que h(xy) ∈ h(x̄.ȳ) = h(x̄).h(ȳ). 3. Pour x ∈ G, on a aussi x̄.ē = x̄ d’où l’on tire h(x̄).1 = h(x̄). De sorte que, pour y ∈ K, on a h(xy) ∈ h(x̄).1 = h(x̄) qui est un singleton, donc h(xy) = h(x̄). 4. En particulier, pour y ∈ K, il vient 1 = h(y −1y) = h(y −1) donc y −1 ∈ K. 5. Plus généralement, si x ∈ K et y ∈ K, alors h(x−1 y) = h(x−1 ) = 1 donc x−1 y ∈ K, de sorte que K −1 K ⊂ K. Cela prouve bien que K est un sous-groupe de G. 20 LH 6. En procédant par équivalences successives, on a z̄ ∈ h−1 h(ē) ⇐⇒ z̄ ∈ h−1 (1) ⇐⇒ h(z̄) = 1 ⇐⇒ z ∈ K. Autrement dit z̄ ∈ h−1 h(ē) ⇐⇒ z ∈ K. On utilise, à présent, les identités spécifiques aux réflecteurs. 7. On a h−1 h(x̄) = h−1 h(x̄.ē) = x̄.h−1 h(ē). D’où z̄ ∈ h−1 h(x̄) ⇐⇒ (∃ū ∈ h−1 h(ē))(z̄ ∈ x̄.ū) ⇐⇒ (∃u ∈ K)(z ∈ xHuH) ⇐⇒ z ∈ xK. Ainsi, h(z̄) = h(x̄) ⇐⇒ z ∈ xK. Il en résulte que l’on a h(x̄) = h(ȳ) ⇐⇒ xK = yK. Il existe ainsi une application g : G/K → L qui, à chacune des classes xK ∈ G/K, associe g(xK) = h(x̄) ∈ L et g est une application bijective. 8. On a l’identité ē.h−1 h(x̄) = h−1 h(ē).h−1 h(x̄), d’après R1. Or, z̄ ∈ ē.h−1 h(x̄) ⇐⇒ z ∈ HxK. De même, z̄ ∈ h−1 h(ē).h−1 h(x̄) ⇐⇒ z ∈ KxK. Donc, pour tout x ∈ G, on a HxK = KxK. Cela achève de prouver que K est invariant modulo H. 9. Soit f : G/H → G/K l’application canonique qui fait correspondre, à la classe xH ∈ G/H, la classe xK ∈ G/K. C’est un réflecteur, d’après A1. On a g(f (x̄)) = g(xK) = h(x̄). Autrement dit, h est la composée gf . Or, en particulier, f est un morphisme surjectif et h un morphisme. Donc g est un morphisme, d’après R2. Puisque g est bijectif (voir le 7 ci-dessus) c’est donc un isomorphisme, comme annoncé.  A4. Conditions d’adéquation. Soient (T, C) une trame et R une relation d’équivalence sur T . Pour chaque x ∈ T , on désignera par x̄ sa classe modulo R, de sorte que toutes les relations suivantes sont synonymes : xRy , yRx , y ∈ x̄ , x ∈ ȳ , x̄ = ȳ. Afin de simplifier les écritures, pour r ∈ T et s ∈ T , on conviendra de ceci : lorsque l’on écrit rs, on suppose (implicitement) que le couple (r, s) est composable, autrement dit, que l’on a (r, s) ∈ C. Voici deux énoncés relatifs à la structure quotient T /R, (ils sont tous deux du premier ordre) : (1) (∀x ∀y)(∃ r ∈ x̄ ∃ s ∈ T )(rs ∈ ȳ) et (∃ r ∈ T ∃ s ∈ ȳ)(rs ∈ x̄)}. Groupes de Mathieu sporadiques ? (2) 21 (∀x)(∀y)(∀z)(∀u)(∃r ∈ x̄ , s ∈ ȳ , t ∈ z̄)((rs)t ∈ ū ⇐⇒ (∃r ∈ x̄ , s ∈ ȳ , t ∈ z̄)(r(st) ∈ ū). On voit, sans détour, que la condition (1) est nécessaire et suffisante pour assurer la reproductibilité. De même, la condition (2) est nécessaire et suffisante pour assurer l’ associativité. Autement dit, pour que l’équivalence R soit adéquate, il faut et il suffit qu’elle satisfasse les deux énoncé s (1) et (2). Sur la nouvelle famille d’exemples On se donne un ensemble K, réunion d’une famille (Ai )i∈I d’ensembles non vides, deux à deux disjonts. On suppose que 0 ∈ I et on distingue un point particulier e ∈ A0 . Sur cet ensemble K, on a défini une opération multivalente dont voici la table : quels que soient ai ∈ Ai , pour chaque indice i, x.e = x, pour tout x ∈ K, ai .y = Ai r {ai }, pour tout y ∈ A0 r {e}, ai .aj = K r Ai , pour tout indice j 6= 0. Il est clair que la structure ainsi définie sur K dépend, uniquement, à isomorphisme près, de la famille des cardinaux, finis ou infinis, n = |A0 | et, pour i 6= 0, pi = |Ai | : on dira qu’elle est de type S(n, (pi )). Cela généralise, quelque peu, les structures de type S(n, p), correspondant au cas où l’on a |I| 6 2, introduite dans l’article [2]. A5. Lorsque l’on a n > 3, pi > 3, pour tout indice i, et pk 6= n, pour un indice k, la structure est un hypergroupe qui n’est pas un D-hypergroupe. En effet, pour voir que la structure est un hypergroupe, il suffit de s’assurer que les conditions d’adéquation sont satisfaites. Pour la condition de reproductibilité , la vérification est sans détour. Quant à la condition d’associativité, on reprend la trame (T, C) qui sert à construire la structure. Soient alors ai , aj , ak , donnés dans K ainsi que r, s, t, dans T tels que r(e) = ai , s(e) ∈ aj , t(e) ∈ ak . Si (r, s) ∈ C 22 LH et (rs, t) ∈ C, on voit, simplement, que l’on a (s, t) ∈ C et (r, st) ∈ C, de sorte que ((rs)t)(e) = (r(st))(e). Réciproquement, soit (s, t) ∈ C et (r, st) ∈ C. Ainsi, s(t(e)) = s(ak ) est défini, de même que r(s(ak )) = al . On montre qu’il existe alors un élément q ∈ T défini au point aj et tel que q(e) = r(e) = ai , (q, s) ∈ C , q(s(ak )) = r(s(ak )) = al , (qs, t) ∈ C, ce qui établira la réciproque. L’application r est déjà définie au point e et au point s(ak ). Si aj est l’un des points e ou s(ak ), on prend q = r. Sinon, on construit q : {e, s(ak ), aj } → K en posant q(e) = r(e) = ai , q(s(ak )) = r(s(ak )) = al , q(aj ) = x, avec un élément x soumis aux trois conditions suivantes : (1) x ∈ / {ai , al }. (2) x ∈ Ai si e ∈ Aj . (3) x ∈ Al si s(ak ) ∈ Aj . Cela est possible car chacune des parties Am de la famille possède au moins trois points. Enfin, ces conditions impliquent que l’on a bien q ∈ T. On pourrait également vérifier à l’aide de la table de multiplication, avec un peu de patience, que l’opération est associative et reproductive. Enfin, pour y ∈ A0 r {e} et a ∈ Ak , les deux parties e.y = A0 r {e} et a.y = Ak r {a} ne sont pas équipotentes alors qu’elles le seraient dans un D-hypergroupe. cqfd On peut ainsi ranger les différentes structures S(n, (pi )) dans quatre classes distinctes. Première classe : pi = n pour tout indice i. Cela comprend, bien entendu, tous les cas où I = {0}. Toutes ces structures sont des Dhypergroupes, comme on l’a dit plus haut. Deuxième classe : n > 3, pi > 3 pour tout indice i et pk 6= n pour un indice k. Ces structures sont, toutes, des hypergroupes qui ne sont pas des hypergroupes de classes. Troisième classe : n > 2 et pk = 1 pour un indice k. L’un des produits est vide : en particulier, A0 = {e, y, . . .}, Ak = {a} et a.y = ∅. Groupes de Mathieu sporadiques ? 23 Quatrième classe : tous les autres cas. Ces structures ne sont pas des hypergroupes car l’associativité est alors en défaut, comme on peut le vérifier. Vérifications. Il n’y a que les trois cas suivants : 1. n = 1 et pk > 2 pour un indice k. 2. n = 2 et pk > 3 pour un indice k. 3. n > 3 et pk = 2 pour un indice k. 1. On a A0 = {e}, Ak = {a, b, . . .} donc a.(a.a) 6= (a.a).a car a.(a.a) = a.(K \ Ak ) ⊂ {a} ∪ (K \ Ak ) 6∋ b, [ (a.a).a = (K \ Ak ).a = (K \ Ai ) ∋ b. i6=k 2. On a A0 = {e, y}, Ak = {a, b, c, . . .}, donc a.(y.y) 6= (a.y).y car a.(y.y) = a.e = a, (a.y).y = (Ak \ {a}).y ⊃ (b.y) ∪ (c.y) = Ak . 3. On a A0 = {e, y, z}, Ak = {a, b} donc a.(y.y) 6= (a.y).y car a.(y.y) = a.{e, z} = Ak , (a.y).y = b.y = a.  Pour la petite histoire Les premières versions de ce texte remontent au siècle dernier ( !) Très souvent remanié, il a été exposé, en partie, au Groupe de travail de théorie des nombres du Département de mathématiques de l’Université Blaise Pascal, de Clermont-Ferrand, sur invitation, le lundi 18 juin 2012, sous le titre : ≪Est-il encore possible d’avancer à la manière d’Emile Mathieu ?≫ avec le résumé suivant : ≪Courte promenade mathématique à travers champs, suivie d’un bref plaidoyer en faveur de la révision de la liste des sporadiques.≫ 24 LH En guise de conclusion (provisoire) On sait faire agir les hypergroupes sur des ensembles, comme on le fait pour les groupes. Plus précisément, on sait les faire agir sur l’ensemble des racines d’un polynôme. Et c’est encore une autre histoire. On peut dès lors se poser la question suivante. Est-il raisonnable, ou non, de prédire l’existence d’hypergroupes de Mathieu simples ? À peine clos, le chantier de la classification des groupes simples finis devra-t-il, éventuellement, rouvrir ses portes afin d’entreprendre la classification des hypergroupes simples finis ?≫ ≪ Bibliographie [1] Eaton, J. E., Theory of cogroups, Duke Math. J., 6 (1940) 101-107. [2] Haddad, Labib et Sureau, Yves, Les cogroupes et les D-hypergroupes, J. Algebra, 118 (1988) 468-476. [3] Haddad, Labib et Sureau, Yves, Les cogroupes et la construction de Utumi, Pacific J. Math., 145 (1990) 17-58. [4] Krasner, M., Sur la théorie de la ramification des idéaux de corps nongaloisiens de nombres algébriques, Acad. Belgique, Cl. Sci. Mém. Coll. 4◦ , 11, Thèse, (1937), 110 pages. [5] Marty, F., Sur une généralisation de la notion de groupe, 8th. Scand. Math. Congr., Stockholm (1934) 45-49. [6] Marty, F., Sur les groupes et hypergroupes attachés à une fraction rationnelle, Ann. Sci. Éc. Norm. Supér. Ser. III. 53 (1936) 83-123. [7] Utumi, Yuzo, On hypergroups of group right cosets, Osaka Math. J., 1 (1949) 73-80. 120 rue de Charonne, 75011 Paris, France E-mail address: [email protected]
4math.GR
Optimal Task Scheduling in Communication-Constrained Mobile Edge Computing Systems for Wireless Virtual Reality                       Xiao Yang∗, Zhiyong Chen∗, Kuikui Li∗ , Yaping Sun∗ and Hongming Zheng†      Medianet Innovation Center, Shanghai Jiao Tong University, Shanghai, P. R. China   †Intel Corporation, P.R. China        [email protected]  Email: {yangxiao1652, zhiyongchen, kuikuili, yapingsun }@sjtu.edu.cn,    arXiv:1708.00606v1 [cs.IT] 2 Aug 2017 ∗ Cooperative Abstract—Mobile edge computing (MEC) is expected to be an effective solution to deliver 360-degree virtual reality (VR) videos over wireless networks. In contrast to previous computation-constrained MEC framework, which reduces the computation-resource consumption at the mobile VR device by increasing the communication-resource consumption, we develop a communications-constrained MEC framework to reduce communication-resource consumption by increasing the computation-resource consumption and exploiting the caching resources at the mobile VR device in this paper. Specifically, according to the task modularization, the MEC server can only deliver the components which have not been stored in the VR device, and then the VR device uses the received components and the corresponding cached components to construct the task, resulting in low communication-resource consumption but high delay. The MEC server can also compute the task by itself to reduce the delay, however, it consumes more communicationresource due to the delivery of entire task. Therefore, we then propose a task scheduling strategy to decide which computation model should the MEC server operates, in order to minimize the communication-resource consumption under the delay constraint. Finally, we discuss the tradeoffs between communications, computing, and caching in the proposed system. I. I NTRODUCTION Virtual reality (VR) over wireless networks is gaining an unprecedented attention due to the ability of bringing immersive experience to users. VR application is computational-intensive, communications-intensive and delay-sensitive, leading to the fact that most of VR are wired with cables. Current wireless systems (e.g., LTE) cannot cope with the ultra-low latency and ultra-high throughput requirements of wireless VR application (e.g., 360-degree VR video) [1]. To address this problem, an effective solution is mobile edge computing (MEC) [2], [3], which enables cloud computing capabilities at the edge of wireless network, e.g., base stations (BS). By deploying computation resource at the network edge, MEC performs the computation tasks closer to the VR device, improving the quality of computation experience. Computation-Constrained MEC, where the VR user can offload the computation tasks from the VR device to the MEC server due to the limited computation capability at the VR device, has attracted significant attention recently [6]–[8]. In [6], a dynamic computation scheduling algorithm based on Lyapunov theory was proposed to minimize the execution     !"    #   Fig. 1. Task can be modularized and then recovered at the user [4], [5]. delay and task failure. Similarly, [7] proposed an optimization offloading framework to minimize the execution latency and the user’s energy consumption. In order to minimize the mobile energy consumption under the constraint of execution delay, [8] optimized the offloading policy based on the channel gains and the consumption of local computing energy. In general, the computation-constrained MEC exploits the communication resource to reduce the requirement of the user’s computation resource. Therefore, it is quite suitable for the computational-intensive and delay-sensitive application with low bandwidth consumption, e.g., online picture processing. The video data rate on online 360-degree VR videos is already many times greater than that of a high definition TV, even though 5G networks maybe not able to satisfy this requirement [1]. Meanwhile, the end-to-end latency through the system is no more than 20 ms for online 360-degree VR videos. We can also use the MEC solution to improve network responsiveness and reduce latency, however, we cannot try to reduce the computation resource by increasing the communications resource overhead. In contrast, we should try to reduce the consumption of communications resource by taking advantage of the computation and caching resources at the mobile VR devices, where we term this solution as Communications-Constrained MEC in this paper. In this paper, we present a communications-constrained MEC framework and develop an optimal task scheduling policy to minimize the average transmission data per task in this system, where the average transmission data per task is adopted as the consumption of communications resource metric. Our major contributions are summarized as follows: • We propose a communications-constrained MEC frame-  denoted by p = [p1 , . . . , pN ], where N P pi = 1. We assume i=1                      Fig. 2. The proposed communication-constrained MEC system with a caching enabled mobile VR device work to reduce the consumption of communications resource byexploiting the caching resource and increasing     the consumption of computing resource at the mobile VR device. To address   this issue, we consider that a 360degree VR video (task) can be modularized today [4],    as Media Transport (MMT) standard, e.g., MPEG   [5],    shown in Fig. 1. Besides, the  contents  composing each whole task have popularity. As a result, for one intended task, the MEC server only delivers the corresponding components which have not been stored in the VR device, and then the VR device uses the received components and the corresponding cached components to construct the task by exploiting the local computation resource. • We develop an optimal task scheduling policy to minimize % % the average transmission data per task. Of course, the   MEC server can also select MEC computation model, which the MEC server combines all corresponding con! "#  $ ! tents as the target task and then deliver the task to the VR device. The MEC computation mode is a reliable way to the  latency due to the fast computation capability reduce  at the MEC server, but this model delivers more data per task to the user. Therefore, we formulate the transmission data consumption minimization problem under the delay constraint and propose a task scheduling strategy based on Lyapunov theory. • We discuss the tradeoffs between communications, computing, and caching. We present how to joint allocate communications, computing and caching resources in the proposed communications-constrained MEC system to achieve a target end-to-end latency, e.g., 20 ms. II. S YSTEM M ODEL As shown in Fig.2, we consider an MEC system, where a cache-enabled mobile VR device can access BS with an MEC server to obtain task. The MEC server has an abundance of computing and caching resource, while the mobile VR device has limited computing ability and cache capacity. A. Task Model We consider each task consists of a number of contents, e.g., MMT assets. All the contents composing each task come from a set of N possible contents, which is denoted by F = {F1 , F2 ......FN }. Note that one content may be used more than once in a task. The popularity distribution of the contents is all the contents are of equal size τ and the MEC server has all N contents. The cache capacity of mobile VR device is M with M < N , which can store at most M contents. We adopt the most popular caching strategy and the stored content set can be denoted as M = {F1 , F2 ......FM }. The system is time-slotted with the time slot length ∆. Let Ht be the task scheduled at time slot t, which consists of Kt contents. We denote H(t) = [h1 (t), . . . , hKt (t)] as the content index vector of the task Ht , where hkt (t) ∈ {1, . . . , N } indicates that the kt -th content in Ht is Fhkt (t) . Thus the size of Ht is D(t) = τ Kt . Let Gtn (1 ≤ n ≤ N ) denote whether Fn ∈ F is requested in Ht and not cached in mobile VR device, which can be given by ( 1, for M + 1 ≤ n ≤ N, and hkt (t) = n t Gn = (1) 0, otherwise. B. Computation Model Each task can either be executed at the MEC server, or at the mobile VR device. Let W denote the required CPU cycles for computing one bit. The CPU frequency of the MEC server and the mobile VR device is fc and fl , respectively. The wireless transmission throughput is R. 1) MEC Computation Mode: When the mobile VR device has a task request, the MEC server computes the contents as the task, and then deliver the task. The size of transmission data is Dct (t) = D(t). The size of computation data is Dcc (t) = D(t). Therefore, Nc (t) = ⌈Dcc (t)W/(fc ∆) + Dct (t)/(R∆)⌉ time slots are required to complete the task Ht . Similar to [9], we use Sc (t) ∈ {0, 1, ..., Nc(t) − 1} to model the MEC state, where Sc (t) = 0 means that the MEC server is idle and Sc (t) = n (n 6= 0) indicates a task is processing at the MEC server and Nc (t) − n time slots are required to complete the computation. 2) Local Computation Mode: For this model, the MEC server delivers the contents which do not been stored in the mobile VR device, and the mobile VR device computes the received contents with the cached contents as the task. Because the MEC server does not transmit the stored contents of the N P Gtn . task, the size of transmission data is Dlt (t) = τ n=M+1 The size of computation data also is Dlc (t) = D(t). As a result, Nl (t) = ⌈Dlc (t)W/(fl ∆) + Dlt (t)/(R∆)⌉ time slots are required to complete Ht . Similarly, let Sl (t) ∈ {0, 1, ..., Nl (t) − 1} denote the mobile VR device state. If the system allocates a task to the mobile VR device at time slot t, Sl (t) updates to Sl (t + 1) = Nl (t) − 1. C. Task Queueing Model The task arrival process is modeled as a Bernoulli process with probability λ. When a task arrivals, the task first enters into a task queue with infinite capacity. The number of the task waiting in the queue is the queue state Q(t) = {0, 1, 2, 3......}, where Q(t) updates according to the following equation Q(t+1)=(Q(t)−(u1l (t)+u2l (t)+u1c (t)+u2c (t)))+ +A(t), (2) where A(t) denotes whether a task arriving in the time slot t. Thus we have Pr{A(t) = 1} = λ and Pr{A(t) = 0} = 1 − λ. Here, {u1l (t), u2l (t), u1c (t), u2c (t)} denotes the task scheduling decision at time slot t. Notice that at most two tasks can be scheduled at a time slot. The first task should be scheduled before the second task. If the first task is scheduled to do the computation at the mobile VR device (MEC server), we have u1l (t) = 1 (u1c (t) = 1) and the second task can not be scheduled to operate in the local computation mode (MEC computation mode) because the CPU has been occupied by the first task, yielding u2l = 0 (u2c (t) = 0). Otherwise, we have u1l (t) = 0 (u1c (t) = 0) for the first task and the local computation mode (MEC computation mode) could be scheduled for the second task, i.e., u2l = 1 (u2c (t) = 1). As a result, there are five possible states for the task scheduling decision in each time slot, i.e., {u1l (t), u2l (t), u1c (t), u2c (t)} = {(0, 0, 0, 0), (1, 0, 0, 0), (0, 0, 1, 0), (1, 0, 0, 1), (0, 1, 1, 0)}. III. TASK S CHEDULING S TRATEGY AND P ROBLEM F ORMULATION The MEC server is a reliable way to reduce the computation latency due to fc ≥ fl , but consumes more communication resource due to Dc (t) ≥ Dl (t). Hence, the MEC server needs to make the task scheduling decision at each time slot to minimize the average transmission data per task under the average delay constraint. A. Task Scheduling Strategy When the MEC server (mobile VR device) is idle, the task can be scheduled to the MEC computation mode (local computation mode). The queue state Q(t) = 0 denotes the task queue is empty and there is no task will be scheduled in time slot t+1, while Q(t) = ∞ indicates that there are infinite tasks in the task queue, yielding the unstable system. According to Q(t), Sl (t), and Sc (t), we can describe the system state. Case 1: Sl (t) = Sc (t) = 0. Both the mobile VR device and the MEC server are idle. The system can process at most two tasks. If there are two tasks in Q(t) at least, i.e., Q(t) ≥ 2, one task can be processed in the mobile VR device (MEC server) and the other task remains wait in the task queue or to be precessed in the MEC server (mobile VR device). The task scheduling policy can be expressed as the follow:   (0, 0, 0, 0)      (0,  0, 1, 0) 1 u (t) = (1, 0, 0, 0) for Q(t) ≥ 2. (3)    (1, 0, 0, 1)    (0, 1, 1, 0) If there is only one task in Q(t), the task can be processed in the mobile VR device, the MEC server or remains wait in the task queue. We thus have   (0, 0, 0, 0) u2 (t) = (0, 0, 1, 0) for Q(t) = 1. (4)   (1, 0, 0, 0) Case 2: Sl (t) 6= 0, Sc (t) = 0. In this case, the MEC server is idle and the mobile VR device is busy so that the system can process one task at most for the MEC server. The task scheduling policy is: ( (0, 0, 0, 0) 3 u (t) = for Q(t) ≥ 1. (5) (0, 0, 1, 0) Case 3: Sl (t) = 0, Sc (t) 6= 0. In this case, the mobile VR device operates in idle mode and the MEC server is occupied. Only one task can be scheduled for the mobile VR device. The task scheduling policy can be expressed as following: ( (0, 0, 0, 0) 4 u (t) = for Q(t) ≥ 1. (6) (1, 0, 0, 0) Case 4: Sc (t) 6= 0, Sl (t) 6= 0 or Q(t) = 0. If both the MEC server and mobile device are busy, i.e., (Sc (t) 6= 0, Sl (t) 6= 0), or there is no task in the task queue Q(t) = 0, no task is scheduled. We then have u5 (t) = (0, 0, 0, 0). (7) At the time slot t, Sl (t) and Sc (t) can be expressed as:  1 2  max(Sl (t)−1, 0) ul (t) = 0 or ul (t)=0, 1 1 (8) Sl (t+1) = Nl (t) − 1 ul (t) = 1,   2 2 ul (t) = 1. Nl (t) − 1  2 1  max(Sc (t)−1, 0) uc (t)=0 or uc (t)=0, Sc (t+1)= Nc1 (t) − 1 u1c (t) = 1,   2 u2c (t) = 1. Nc (t) − 1 (9) where Nli (t) and Nci (t) denote Nl (t) and Nc (t) of the i-th task for i = 1, 2, respectively. Sl (t + 1) = Nli (t) − 1 means the mobile VR device is occupied by a task in the time slot t + 1 and will be busy in the follow Nli (t) − 1 time slots. Similarly, we have Sc (t + 1) = Nci (t) − 1. B. Problem Formulation When T → ∞ and the length of task queue is not infinite, the total number of the task is close to λT . Therefore, the average transmission data per task can be expressed as: T −1 2 o 1 nXX i i i ul (t)Dlt (t) + uic (t)Dct (t) . lim T →∞ λT t=0 i=1 (10) i i where Dlt (t) and Dct (t) denote Dlt (t) and Dct (t) of the i-th task for i = 1, 2, respectively. From the system model, we know that each task requires transmission time, waiting time and processing time. The computation processing time of the MEC server or the mobile VR device is the dominant influence on the execution delay [10]. Based on the Little Law [11], the execution delay, including the waiting time and processing time, is proportional to the average queue length of the task buffer. The execution delay is written as: T −1 i 1 hX lim E Q(t) . T →∞ T t=0 (11) Denote π(t) , {u1l (t), u2l (t), u1c (t), u2c (t)}. Thus, the communication-resource consumption minimization problem is formulated as: T 2 o 1 nXX i i i ul (t)Dlt (t) + uic (t)Dct (t) P1 : min lim T →∞ λT π(t) t=1 i=1 s.t. π(t) ∈ uk (t), k ∈ {1, 2, 3, 4, 5}, T i 1 hX lim E Q(t) < ∞, T →∞ T t=1 (12) (13) where (13) indicates the delay constraint to ensure the task requires can be completed with a finite delay. Unfortunately, P1 is a stochastic optimization problem. The system state changes after a offloading decision is made, and P1 is impossible to be solved by convex optimization methods. IV. O PTIMAL TASK S CHEDULING A LGORITHM BASED O N LYAPUNOV T HEORY A. Problem Transform To simplify P1, we consider Lyapunov optimization theory. We first define the Lyapunov function: 1 2 Q (t). (14) 2 Consider the initial state Q(0) = 0, and then we have L(Q(0)) = 0. If the queue is unstable, L(Q(t)) is more volatile than Q(t). Thus the expectation of L(Q(t)) is: L(Q(t)) = t−1 o nX [L(Q(i + 1)) − L(Q(i))] E[L(Q(t))] = E = E{L(Q(i + 1)) − L(Q(i))|Q(i)}. (15) i=0 The system is stable when E[L(Q(t))] < ∞. Therefore the Lyapunov drift function can be given by: n o ∆L(Q(t)) = E L(Q(t + 1)) − L(Q(t))|Q(t) . (16) We can see from (15) and (16) that to maintain the stability of the queue, we should minimize (16) in each time slot. Therefore the expectation of the L(Q(t)) would not tend to infinite. As a result, we have the following Lemma 1. Lemma 1. Let us define the scheduling rate U (t) = u1l (t) + u2l (t) + u1c (t) + u2c (t). In order to ensure E[L(Q(t))] < ∞, we have: ∆L(Q(t)) ≤ Cmax − Q(t)E[U (t)|Q(t)], state Q(t) can also approach a lower length. However, the minimization of ∆L(Q(t) can not cause the minimization of (10). Thus, we define the Lyapunov drift-plus-penalty function: ∆L(Q(t)) + V E[D(t)|Q(t)] ≤Cmax − Q(t)E[U (t)|Q(t)] + V E[D(t)|Q(t)], (17) where we use Cmax = 21 {5 + 2Q(t)A(t)}. Proof. Please refer to Appendix A. According to Lyapunov theory [11], when we make the task scheduling decision π(t) to minimize ∆L(Q(t), the queue (18) where V is a non-negative control parameter, which denotes that the system is sensitive to the communication cost. When V = 0, the system is only sensitive to the delay. With the increase of V , the Lyapunov drift-plus-penalty becomes more sensitive to the communication cost. Notice that the optimal task scheduling decision π ∗ (t) for minimizing the right side of (18) also minimize D(t) under the queue length stability constraint. Therefore, we can solve P2 in each time slot t: P2 : min s.t. i=0 t−1 X Algorithm 1 Optimal Task Scheduling Algorithm Based On Lyapunov Theory 1: Obtain the queue state Q(t), mobile device state Sl (t), MEC server state Sc (t) at the beginning of each time slot t. 2: Find the system case discussed in Section III. 3: Obtain the system case k. 4: Determine π(t) by solving: 5: min −Q(t)U (t) + V D(t) 6: s.t. (12), and (13) 7: Set t = t + 1 and update Q(t), Sl (t) , Sc (t) according to (2), (8), (9) respectively. − Q(t)U (t) + V D(t) (19) (12) and (13). For each time slot t, we can obtain D(t) based on π(t) and Q(t). Because there are only 5 possible choices for π(t), we can solve P2 in each time slot t by an enumeration method. Thus, we propose an optimal task scheduling algorithm based on Lyapunov theory, as shown in Algorithm 1. Lemma 2. P1 is not equivalent to P2, but if the control parameter V is sufficiently large, the solution of P 1 is very close to P2. Let D̄Alg and D̄Opt be the average transmission data obtained by solving P2 and the optimal value of P 1, respectively. We then have: 5 + D̄Opt . 2V Proof. Please refer to Appendix B. D̄Opt ≤ D̄Alg ≤ (20) B. Tradeoffs between Communications, Computing and Caching In this subsection, we reveal the tradeoff between the average transmission data per task and the computing ability of the mobile VR device. The tradeoff between the the average transmission data per task and the cache capacity is also discussed. Proof. Due to page limitations, we skip the proof here. E[Dlt (t)] = τ N X X 220 200 180 160 140 0 5 10 15 20 25 30 35 40 45 50 Cache capacity (22) 1 − (1 − pn )k Pr(Kt = k). (23) n=M+1 k Proof. Due to page limitations, we skip the proof here. From proposition 2, we can see that D̄lt decreases with the increase of the caching capacity M in the mobile VR device. And we can know that D̄Opt decreases with the decrease of Dlt based on Proposition 1. Hence the increase of M can decrease DOpt . Similar to proposition 1, with large V , D̄Alg approaches D̄opt , and D̄Alg decrease with the increase of M . V. N UMERICAL R ESULTS In this section, we evaluate the performance of the proposed optimal scheduling policy by simulations. The number of contents is N = 1000, the time slot is ∆ = 0.2 s, the length of each content is τ = 5 M bits, and the average arrival rate is λ = 0.4. The mobile VR device has fl = 1 GHz CPU frequency, the cache capacity M = 50 and transmission throughput R = 500M bps, when the MEC server has fc = 4 × 2.5 GHz CPU frequency unless otherwise specified. Kt is distributed uniformly in [40, 60]. We assume the content popularity distribution is identical among all elements of a task, which follows the Zipf distribution with the parameter α. We set α = 0.8 in simulations. We consider the MEC computation policy as baselines, which executes all the tasks in the MEC server. Fig.3 shows that the average transmission data per task achieved by the proposed optimal scheduling policy decreases with the cache capacity. That means the average communication-resource consumption can be traded off by the cache capacity to keep the queue length stable, which verifies the tradeoff presented by Proposition 2. Moreover, the 260 Average transmission data per task (Mbits) l Proposition 2. Define K = E[Kt ], and then we have E[Dct (t)] = D̄ct = τ K, MEC computation policy Optimal schedling, W=10 Optimal schedling, W=30 Optimal schedling, W=50 240 Fig. 3. The communication-resource consumption vs. cache capacity. According to Lemma 2, with large V , D̄Alg approaches 5 + D̄Opt based on (20). Because N̄l = D̄opt , and D̄Alg ≤ 2V E[Nl (t)] = E[⌈Dlc (t)W/(fl ∆) + Dlt (t)/R⌉], for large V , we can observe from (21) that D̄Alg or D̄opt decreases with the increase of fl when N̄1 + N̄1c ≥ λ, N̄1 < λ. l 260 Average transmission data per task (Mbits) Proposition 1. Let E[Dct (t)] = D̄ct and E[Dlt (t)] = D̄lt denote the average transmission data of MEC computation model and local computation model, respectively. And let E[Dlc (t)] = D̄lc denote the average computation data of local computation model. We thus have  1 1 1 1  D̄ct − λN̄l (D̄ct − D̄lt ) N̄l + N̄c ≥ λ, N̄l < λ, 1 D̄Opt = D̄lt ≥ λ, N̄l   1 1 < λ. + inf easible N̄l N̄c (21) where we use E[Nc (t)] = N̄c and E[Nl (t)] = N̄l to denote the exception of the time slots required to complete a task in MEC computation model and local computation model, respectively. 240 MEC computation policy Optimal scheduling, V=0.5 Optimal scheduling, V=0.01 220 Optimal DOpt 200 180 160 140 50 100 150 200 250 300 350 400 450 MD CPU frequency (MHz) Fig. 4. The communication-resource consumption vs. the computing ability of mobile VR device. scheduling policy always outperforms the MEC computation policy even when there are no contents cached in the mobile VR device. This is because the optimal scheduling always executes a part of tasks by local computation policy, and the redundant transmission of contents needed in those tasks can be avoided. However, the MEC computation policy delivers all the contents requested by each task. Fig.4 presents the average transmission data per task versus the mobile VR device computing ability fl . The increase of the mobile VR device computing ability fl decrease the average communication-resource consumption. The reason for it is that the increase of fl decreases the computing delay of local execution, and more tasks will be executed by local computation policy. With large V , the system is more sensitive to the communication-resource consumption, and more tasks are scheduled to mobile VR device. And DAlg is close to DOpt when V is sufficiently large, which verify the lemma 2. Further, when fl is sufficiently large, the local computation mode becomes the optimal schedule strategy. Tradeoff between Communications, Computing and Caching (3C): In Fig. 5, the average end-to-end latency is 20 ms of the proposed system with different 3C resources allocation, e.g., {R, fl , M }={125 M bps, 100 M Hz, 5} or {R, fl , M }={67 M bps, 500 M Hz, 45}. As one can see, the communication throughput R decreases with increasing com- B. Proof of Lemma 2 We assume P 1 is feasible, and there exists at least one π ∗ (t) for satisfying the constraints of P 1. D̄Alg and D̄Opt satisfies the following condition: Transmission throughput (Mbps) 180 160 140 E[D(t)|Q(t)] = D̄Alg ≤ D̄Opt + γ, 120 where γ is a positive value. According to Little Theorem [11], if the average arriving rate is larger than the average service rate, the queue length tends to infinite with the increase of time slot t. Therefore, if P 2 can be solved by proposed algorithm, the following condition should be satisfied 100 80 60 0 0 20 200 40 400 60 600 E[U (t)|Q(t)] = λ + θ, MD CPU frequency (MHz) Caching capacity Fig. 5. The incorporation of communications, computing and caching to achieve a target delay 20 ms. Here, we set λ = 0.2. puting capability fl and caching capacity M . As fl increases, more task be scheduled to the mobile VR device, yielding lower the communication cost. M is similar to fl . Therefore, the system needs a smaller R. We observe that the computing ability has more impact on the communication-resource consumption than that of the caching capacity. This is because the cache capacity only has impact on the performance of local computation mode. On the other hand, when the system has small computing ability and caching capability, the large transmission throughput is required. This result reconfirm the importance of simultaneous exploitation of all 3Cs in wireless networks [2]. VI. C ONCLUSION In this paper, we investigated the communicationconstrained mobile edge computing systems for wireless virtual reality. A transmission data consumption minimization problem with the execution delay constraints was formulated, and we proposed a task scheduling strategy based on Lapunov theory. The tradeoffs between communications, computing, and caching in the proposed system was also dicussed. Finally Simulation results shown that the proposed scheduling strategy achieve a significant reduction in the average transmission data consumption. A PPENDIX A. Proof of Lemma 1 According to (2), we first have Q2 (t+1) ≤ Q2 (t)+U 2 (t)+A2 (t)−2Q(t)(U (t)−A(t)). (24) Substituting (24) into (16), then (16) can be rewritten as 1 E[U 2 (t) + A2 (t)|Q(t)] 2 − Q(t)E[(U (t) − A(t))|Q(t)]. (26) ∆L(Q(t)) ≤ (25) The task arriving rate A(t) is independent of Q(t). Finally, according to U (t) ≤ 2 and A(t) ≤ 1, we have Lemma 1. (27) where θ is a positive value. Substituting (26) and (27) into (18), and with γ → 0, we obtain: 5 ∆L(Q(t)) + V {DAlg (t)|Q(t)} ≤ + V D̄opt . (28) 2 Then taking iterated expectation and using the telescoping sums over t ∈ {1......T }, we get E[L(Q(T ))] − E[L(Q(1))] + V T X E[DAlg (t)|Q(t)] t=1 5 ≤ T ( + V D̄opt ). (29) 2 We divide (29) with V T and let T → ∞, then we have: D̄Alg ≤ 5 + D̄Opt . 2V (30) R EFERENCES [1] E. Bastug, M. Bennis, M. Medard, and M. Debbah, “Toward interconnected virtual reality: Opportunities, challenges, and enablers,” IEEE Communications Magazine, vol. 55, no. 6, pp. 110–117, 2017. [2] H. Liu, Z. Chen, and L. Qian, “The three primary colors of mobile systems,” IEEE Communications Magazine, vol. 54, no. 9, pp. 15–21, September 2016. [3] S. Wang, X. Zhang, Y. Zhang, L. Wang, J. Yang, and W. Wang, “A survey on mobile edge networks: Convergence of computing, caching and communications,” IEEE Access, vol. 5, pp. 6757–6779, 2017. [4] L. Zhang, Y. Xu, W. Huang, L. Yang, J. Sun, and W. Zhang, “A mmt-based content classification scheme for vod service,” in 2015 IEEE International Symposium on Broadband Multimedia Systems and Broadcasting, June 2015, pp. 1–5. [5] J. Huang, Z. Chen, D. Ceylan, and H. Jin, “6-dof vr videos with a single 360-camera,” in 2017 IEEE Virtual Reality (VR), March 2017, pp. 37–44. [6] Y. Mao, J. Zhang, Z. Chen, and K. B. Letaief, “Dynamic computation offloading for mobile-edge computing with energy harvesting devices,” IEEE Journal on Selected Areas in Communications, vol. 34, no. 12, pp. 3590–3605, Dec. 2016. [7] T. Q. Dinh, J. Tang, Q. D. La, and T. Q. S. Quek, “Offloading in mobile edge computing: Task allocation and computational frequency scaling,” IEEE Transactions on Communications, vol. PP, no. 99, pp. 1–1, 2017. [8] C. You, K. Huang, H. Chae, and B. H. Kim, “Energy-efficient resource allocation for mobile-edge computation offloading,” IEEE Transactions on Wireless Communications, vol. 16, no. 3, pp. 1397–1411, March 2017. [9] J. Liu, Y. Mao, J. Zhang, and K. B. Letaief, “Delay-optimal computation task scheduling for mobile-edge computing systems,” in IEEE ISIT, July 2016, pp. 1451–1455. [10] Y. Jian, Y. Qinghai, K. Kyungsup, and R. Ramesh, “Power-Delay Tradeoff in Wireless Powered Communication Networks,” IEEE Transactions on Vehicular Technology, July. 2016. [11] S. Ross, Introduce to probability models. Academic Press, 2014.
7cs.IT
Span-program-based quantum algorithms for graph bipartiteness and connectivity ⋆ Agnis Āriņš arXiv:1510.07825v1 [quant-ph] 27 Oct 2015 University of Latvia, Raiņa bulvāris 19, Riga, LV-1586, Latvia Abstract. Span program is a linear-algebraic model of computation which can be used to design quantum algorithms. For any Boolean function there exists a span program that leads to a quantum algorithm with optimal quantum query complexity. In general, finding such span programs is not an easy task. In this work, given a query access to the adjacency matrix of a simple graph G with n vertices, we provide two new span-program-based quantum algorithms: √ – an algorithm for testing if the graph is bipartite that uses O(n n) quantum queries; √ – an algorithm for testing if the graph is connected that uses O(n n) quantum queries. 1 Introduction The concept of a span program as a linear-algebraic model of computation is not new. It was introduced by Karchmer and Wigderson in 1993 [9] and has many applications in classical complexity theory. Span programs can be used to evaluate decision problems. In 2008 Reichardt and Spalek [12] introduced a new complexity measure for span programs – witness size, which, as Reichardt showed later in [10,11], has strong connection with the quantum query complexity. There is a quantum algorithm for evaluating span programs [10] and these two complexity measures are essentially equivalent. The difficulty is to come up with a span program with a good witness size complexity. In [12] authors dealt with bounded-size span programs evaluating Boolean functions each on O(1) bits and posed an open question – do there exist interesting quantum algorithms based directly on asymptotically large span program? Belovs used span programs to construct learning graphs [4,3]. He also used span program approach for the matrix rank problem [2]. In [1] Ambainis et al. came up with a simple yet powerful span program for the graph collision problem. In this paper, we extend the family of algorithms based on span programs. √ We present two new span-program-based quantum algorithms – an O(n n) √ algorithm for the graph bipartiteness problem and an O(n n) algorithm for the graph connectivity problem. Both algorithms in the quantum query sense are ⋆ This work has been supported by the ERC Advanced Grant Methods for Quantum Computing. optimal because the witness sizes match the quantum query complexity lower bounds [6,7] for these problems. Thus we demonstrate that span programs can be useful also for the problems with an asymptotically large input and possibly our algorithms could be building blocks for bigger span programs in the future. The graph connectivity problem has been studied before [7] and there al√ ready exists a O(n n) quantum query algorithm which requires O(n) qubits of quantum memory. The advantage of our algorithm is that it uses only O(log n) qubits of quantum memory because the span program P2 uses a vector space with O(n2 ) dimensions. Similarly for the graph bipartiteness problem. It can be solved with the breadth-first search method [8] which uses O(n) qubits of quantum memory, but our approach with a span program requires O(log n) qubits of quantum memory. 2 Preliminaries In this paper, we present algorithms which work on simple graphs, given in adjacency model. If the given graph has n vertices then the input size for an algorithm is n × n and we assume that the input variable xi,j corresponds to the value of entry in i-th row and j-th column of the adjacency matrix. 2.1 Span programs Definition 1 ([1]). A span program P is a tuple P = (H, |ti , V ), where H is a finite-dimensional Hilbert space, |ti ∈ H is called the target vector, and V = {Vi,b |i ∈ [n], b ∈ {0, S 1}}, where each Vi,b ⊆ H is a finite set of vectors. Denote by V (x) = {Vi,b |i ∈ [n], xi = b}. The span program is said to compute function f : D → {0, 1}, where the domain D ⊆ {0, 1}n, if for all x ∈ D, f (x) = 1 ⇐⇒ |ti ∈ span(V (x)). Basically, what this definition says is that for each input variable xi we have two sets of vectors (as the span program authors, we define these vectors in advance) – Vi,0 and Vi,1 . If xi = b then we say that vectors from the set Vi,b are available and vectors from the set Vi,1−b are not available. If some vector is included in both sets Vi,0 and Vi,1 then we say that it is a free vector – it is always available. The function returns 1 iff the target vector can be expressed as a linear combination of the available vectors, otherwise it returns 0. Definition 2 ([1]). −1 (1) A positive P witness for x ∈ f (1) is a vector w = (wv ), v ∈ V (x), such that |ti = v∈V (x) wv v. The positive witness size is wsize1 (P ) := max min x∈f −1 (1) w:witness of x kwk2 . (2) A negative witness for x ∈ f −1 (0) is a vector w ∈ H, such that ht|wi = 1 and for all v ∈ V (x): hv|wi = 0. The negative witness size is X 2 hv|wi . wsize0 (P ) := max min −1 x∈f (0) w:witness of x v∈V (3) The witness size of a program P is p wsize(P ) := wsize0 (P ) · wsize1 (P ). (4) The witness size of a function f denoted by wsize(f ) is the minimum witness size of a span program that computes f . Theorem 1 ([10,11]). Q(f ) and wsize(f ) coincide up to a constant factor. That is, there exists a constant c > 1 which does not depend on n or f such that 1 c wsize(f ) ≤ Q(f ) ≤ c · wsize(f ). 3 Span program for testing graph bipartiteness A bipartite graph is a graph whose vertices can be divided into two disjoint sets such that there is no edge that connects vertices of the same set. An undirected graph is bipartite iff it has no odd cycles. Algorithm 1. There exists a span program P which √ for a graph with n vertices detects if the graph is bipartite with wsize(P ) = O(n n). Proof. We will make a span program which detects if a graph has an odd cycle. Let n = |G| be a number of vertices in the given graph G. Then the span program is as follows: Span program P1 for testing graph bipartiteness – H is a (2n2 + 1) dimensional vector space with basis vectors {|0i} ∪ {|vk,b i |v, k ∈ [1..n], b ∈ {0, 1}}. – The target vector is |0i. – For every k ∈ [1..n] make available the free vector |0i + |kk,0 i + |kk,1 i. – For every k ∈ [1..n], for every edge u − v (where input xu,v = 1), make available the vectors |uk,0 i + |vk,1 i and |uk,1 i + |vk,0 i. The states in the span program P1 are mostly in the form |vk,b i where v is vertex index, k represents vertex from which we started our search for an odd length cycle and b represents the parity of the current path length. The first subindex k in state |vk,b i can also be considered as the subspace index for the subspace Vk = span({|vk,b i |v ∈ [1..n], b ∈ {0, 1}}). Vectors corresponding to edges are in the form |uk,b i + |vk,1−b i consisting from sum of two states which both belong to same subspace Vk . In the span program P1 the target vector |0i can only be expressed as a linear combination of the available vectors if at least one of the vectors in the form |kk,0 i + |kk,1 i can be expressed. Without loss of generality, if there is an odd length cycle v1 − v2 − · · · − v(2j+1) − v1 then the target vector can be expressed by taking the vectors corresponding to the edges of this cycle, alternatingly with plus and minus sign |0i = (|0i + |11,0 i + |11,1 i) − (|11,0 i + |21,1 i) + · · · − (|(2j + 1)1,0 i + |11,1 i) therefore the span program P1 will always return 1 when the given graph is not bipartite. From the other side, if there is no odd length cycle then none of the vectors in the form of |kk,0 i + |kk,1 i can be expressed using the available vectors from P1 . To cancel out the state |kk,0 i we should be using a vector |kk,0 i + |vk,1 i corresponding to some edge k − v where v is some vertex adjacent to k because no other vector contains the state |kk,0 i. By doing so we move from the state |kk,0 i to the state |vk,1 i (possibly with some coefficient other than 1) which has the parity bit flipped. Similarly, to cancel out the state |vk,1 i we should be using a vector corresponding to some edge going out from vertex v. To stop this process we need to reach the state |kk,1 i. It can be done only if there is an odd cycle because the path must be closed and the parity bit restricts it to odd length. When there is no odd cycle, span program P1 will always return 0. We can conclude that P1 indeed computes the expected function. It remains to calculate the witness size of P1 . For the case when there is an odd cycle we need to calculate the positive witness size. If there is an odd cycle v1 − v2 − · · · − vd − v1 with length d then the target vector can be expressed in this way |0i = 1 · (|0i + |11,0 i + |11,1 i) + (−1) · (|11,0 i + |21,1 i) + · · · + (−1) · (|d1,0 i + |11,1 i) and the positive witness w here consists only from d + 1 entries ±1 therefore kwk2 = d + 1. If v1 − v2 − · · · − vd − v1 is a cycle then also v2 − v3 − · · · − vd − v1 − v2 is a cycle and therefore the target vector can also be expressed in this way |0i = (|0i + |22,0 i + |22,1 i) − (|22,0 i + |32,1 i) + · · · − (|12,0 i + |22,1 i) the same follows for all d vertices in this cycle and the target vector therefore can be expressed in atleast d different ways. We can combine these d ways each taken with coefficient 1/d and then we get that the positive witness size wsize1 (P1 ) ≤ d ∗ (1/d)2 ∗ (d + 1) < 2 (1) To estimate the negative witness size we must find a negative witness w′ . We derive w′ by defining how it acts on basis vectors. From definition hw′ |0i = 1. For every k we must have hw′ |(|0i + |kk,0 i + |kk,1 i)i = 0 therefore lets pick w′ in such a way that hw′ |kk,0 i = 0 and hw′ |kk,1 i = −1. Now repeat the following steps until no changes happen: – for every available vector |uk,0 i + |vk,1 i if hw′ |uk,0 i is defined then define hw′ |vk,1 i = − hw′ |uk,0 i. – for every available vector |uk,1 i + |vk,0 i if hw′ |uk,1 i is defined then define hw′ |vk,0 i = − hw′ |uk,1 i. For all not yet defined hw′ |vk,b i define hw′ |vk,b i = 0. For any given vector v in span program P1 the value hw′ |vi2 ≤ 1. The total number of vectors does not exceed n + n3 therefore the negative witness size is wsize0 (P1 ) ≤ 1 · (n + n3 ) (2) Combining positive and negative witness sizes we obtain the upper bound for witness size which also corresponds to quantum query complexity p √  (3) wsize(P1 ) = wsize0 (P1 ) · wsize1 (P1 ) = O n n 4 Span program for testing graph connectivity A graph is said to be connected if every pair of vertices in the graph is connected. If in an undirected graph one vertex is connected to all other vertices then by transitivity the graph is connected. Algorithm 2. There exists a span program P which for √ a graph with n vertices detects if the graph is connected with wsize(P ) = O(n n). Proof. Let n = |G| be a number of vertices in the given graph G. Then the span program is as follows: Span program P2 for testing graph connectivity – H is a n2 − 1 dimensional vector space with basis vectors {|vk i |v ∈ [0..n], k ∈ [2..n]}. – The target vector is |ti = |02 i + |03 i + · · · + |0n i. – For every k ∈ [2..n] make available the free vector |0k i + |1k i − |kk i. – For every k ∈ [2..n], for every edge u − v (where u, v ∈ [1..n] and input xu,v = 1), make available the vector |uk i − |vk i. If all vertices are reachable from vertex with index 1 then the given graph is connected. Here we use Belov’s [5] span program for s-t connectivity as subroutine. This subroutine checks if in a given graph there is a path from the vertex s to the vertex t. The span program for it has the target vector |si − |ti and for each edge i − j (input xi,j = 1) we can use the vector |ii − |ji. In span program P2 , by using this subroutine n−1 times, we check if all other vertices are connected to vertex with index 1. We create a separate subspace Vk = span({|vk i |v ∈ [0..n]}) for each such subroutine call to avoid any interference between them, which is a common technique [10] how to compose span programs. The span program returns 1 when all vertices are connected, but otherwise it returns 0. For the case when the given graph is connected we need to calculate the positive witness size. In each s-t subroutine the shortest path length from the vertex s to the vertex t can not be larger than n − 1. Threfore each vector from the set {|0k i |k ∈ [2..n]} requires no more than n vectors to express it. There are n − 1 such subroutines. The positive witness size is wsize1 (P2 ) ≤ n · (n − 1) ≤ n2 (4) To estimate the negative witness size we must find a negative witness w′ . We derive w′ by defining how it acts on the basis vectors. From definition hw′ |ti = 1. We need to talk about negative witness only when some vertex v is not connected to vertex with index 1. Then the vertex v belongs to different connected component than vertex with index 1. Lets name this connected component Cv and let the count of vertices in this connected component be dv . Lets pick w′ in such a way that for each vertex vk ∈ Cv set hw′ |0k i = 1/dv and for each vertex vz ∈ / Cv set hw′ |0z i = 0. For k ∈ [2..n] we must have hw′ |(|0k i + |1k i − |kk i)i = 0 therefore set hw′ |1k i = − hw′ |0k i and hw′ |kk i = 0. Now repeat the following step until no changes happen: for every available vector |uk i − |vk i if hw′ |uk i is defined then define hw′ |vk i = hw′ |uk i. For all other not yet defined basis vectors |vk i set hw′ |vk i = 0. With such negative witness w′ choice the overall negative witness size will only get increased by vectors which correspond to nonexistent graph edges which connects Cv with other connected components in graph - i.e. border edges. An edge u−v is a border edge if u ∈ Cv and v ∈ / Cv . To a border edge u−v correspond the vectors |uk i − |vk i where k ∈ [2..n] but only dv from these vectors will have hw′ |uk i = 6 hw′ |vk i and each such vector increases the negative witness size by value (1/dv )2 . For Cv there are at most dv · (n − 1) border edges therefore the overall negative witness size is wsize0 (P2 ) ≤ d2v · (n − 1) · (1/dv )2 ≤ n (5) Combining the positive and negative witness sizes we obtain the upper bound for the witness size which also corresponds to the quantum query complexity p √  (6) wsize(P2 ) = wsize0 (P2 ) · wsize1 (P2 ) = O n n Acknowledgements I am grateful to Andris Ambainis for the suggestion to solve the graph problems with span programs, and for many useful comments during the development of the paper. References 1. Ambainis, A., Balodis, K., Iraids, J., Ozols, R., Smotrovs, J.: Parameterized quantum query complexity of graph collision. CoRR abs/1305.1021 (2013), http://arxiv.org/abs/1305.1021 2. Belovs, A.: Span-program-based quantum algorithm for the rank problem. CoRR abs/1103.0842 (2011), http://arxiv.org/abs/1103.0842 3. Belovs, A.: Learning-graph-based quantum algorithm for kdistinctness. In: IEEE 53rd Annual Symposium on Foundations of Computer Science (FOCS). pp. 207–216. IEEE (2012), http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6375298 4. Belovs, A.: Span programs for functions with constant-sized 1-certificates. In: Proceedings of the 44th symposium on Theory of Computing. pp. 77–84. ACM (2012), http://dl.acm.org/citation.cfm?id=2213985 5. Belovs, A., Reichardt, B.: Span programs and quantum algorithms for stconnectivity and claw detection. In: Epstein, L., Ferragina, P. (eds.) Algorithms – ESA 2012, Lecture Notes in Computer Science, vol. 7501, pp. 193–204. Springer Berlin Heidelberg (2012), http://dx.doi.org/10.1007/978-3-642-33090-2_18 6. Berzina, A., Dubrovsky, A., Freivalds, R., Lace, L., Scegulnaja, O.: Quantum query complexity for some graph problems. In: Van Emde Boas, P., Pokorný, J., Bieliková, M., Štuller, J. (eds.) SOFSEM 2004: Theory and Practice of Computer Science, Lecture Notes in Computer Science, vol. 2932, pp. 140–150. Springer Berlin Heidelberg (2004), http://dx.doi.org/10.1007/978-3-540-24618-3_11 7. Dürr, C., Heiligman, M., Høyer, P., Mhalla, M.: Quantum query complexity of some graph problems. In: Dı́az, J., Karhumäki, J., Lepistö, A., Sannella, D. (eds.) Automata, Languages and Programming, Lecture Notes in Computer Science, vol. 3142, pp. 481–493. Springer Berlin Heidelberg (2004), http://dx.doi.org/10.1007/978-3-540-27836-8_42 8. Furrow, B.: A panoply of quantum algorithms. Quantum Info. Comput. 8(8), 834– 859 (Sep 2008), http://dl.acm.org/citation.cfm?id=2017011.2017022 9. Karchmer, M., Wigderson, A.: On span programs. In: Proceedings of the Eighth Annual Structure in Complexity Theory Conference. pp. 102–111. IEEE (1993), http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=336536 10. Reichardt, B.W.: Span programs and quantum query complexity: The general adversary bound is nearly tight for every boolean function. In: 50th Annual IEEE Symposium on Foundations of Computer Science (FOCS). pp. 544–551. IEEE (2009), http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5438598 11. Reichardt, B.W.: Reflections for quantum query algorithms. In: Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms. pp. 560–569. SIAM (2011), http://dl.acm.org/citation.cfm?id=2133080 12. Reichardt, B.W., Spalek, R.: Span-program-based quantum algorithm for evaluating formulas. In: Proceedings of the Fortieth Annual ACM Symposium on Theory of Computing. pp. 103–112. STOC ’08, ACM, New York, NY, USA (2008), http://doi.acm.org/10.1145/1374376.1374394
8cs.DS
1 Decentralized Hypothesis Testing in Energy Harvesting Wireless Sensor Networks arXiv:1605.03316v2 [cs.IT] 10 Jun 2017 Alla Tarighati, James Gross, Senior Member, IEEE, and Joakim Jaldén, Senior Member, IEEE Abstract—We consider the problem of decentralized hypothesis testing in a network of energy harvesting sensors, where sensors make noisy observations of a phenomenon and send quantized information about the phenomenon towards a fusion center. The fusion center makes a decision about the present hypothesis using the aggregate received data during a time interval. We explicitly consider a scenario under which the messages are sent through parallel access channels towards the fusion center. To avoid limited lifetime issues, we assume each sensor is capable of harvesting all the energy it needs for the communication from the environment. Each sensor has an energy buffer (battery) to save its harvested energy for use in other time intervals. Our key contribution is to formulate the problem of decentralized detection in a sensor network with energy harvesting devices. Our analysis is based on a queuing-theoretic model for the battery and we propose a sensor decision design method by considering long term energy management at the sensors. We show how the performance of the system changes for different battery capacities. We then numerically show how our findings can be used in the design of sensor networks with energy harvesting sensors. I. I NTRODUCTION Distributed detection problem formulations have traditionally addressed detection in sensor networks by considering network performance measures like error probability and receiver operating characteristic [1]. In these setups, spatially separated sensors make observations of the same phenomenon and send a summary of their observations towards a fusion center (FC) through rate-constrained channels. Each sensor can be viewed as a quantizer which quantizes its observation, and according to the network arrangement, sends its output either to another sensor or to the FC. In many applications, sensors send their outputs to the FC through a multiple access channel [2]–[4] or through parallel access channels, commonly known as the parallel topology [5], [6]. A survey of early works on decentralized hypothesis testing in wireless sensor networks can be found in [7]–[9]. A large number of sensors with small batteries and limited life-time are often used in wireless sensor networks. A major limitation of these sensors is their finite lifetime. In other words, the sensors work as long as their battery last and this implies that also the network has a limited lifetime. Many solutions to increase the lifetime of battery-powered sensor nodes have been proposed, see [10]–[12] and references therein. While in all of these methods the aim is to find an energy usage strategy to maximize the lifetime of a network, the lifetime remains bounded and finite. An alternative way of dealing with this problem is to use energy harvesting devices at the sensor nodes. An energy harvesting device is capable of acquiring energy from nature or from man-made sources [13], [14]. Energy harvesting technologies provide a promising future for wireless sensor networks, such as self sustainability and an effectively perpetual network lifetime which is not limited by the sensor battery lifetime [14]–[16]. While acquiring energy from the environment makes it possible to deploy wireless sensor networks in situations which are impossible using conventional battery-powered sensors, it poses new challenges related to the management of the harvested energy. These new challenges are due to the fact that the amount of energy available at a sensor is random, since the source of energy might not be available at all times we may want to use the sensor nodes. We address the problem of detection in networks of sensors arranged in parallel, where each sensor is an energy harvesting device. At each time t = 1, 2, . . . the sensors send a message towards the FC about the state of the current hypothesis Ht and the FC makes a decision about the hypothesis at that time. The sensors communicate with the FC using energy asymmetric on-off keying (OOK), as a low communication rate scheme for distributed detection applications [17], where a positive message can be sent at the cost of one unit of energy, and a negative message is conveyed through a non-transmission at no cost in energy [18], [19]. It was previously shown in [20] that OOK is the most energy efficient modulation scheme under Rayleigh fading non-coherent transmission, though we are not primarily concerned with explicitly modeling the fading channels between the sensors and the FC herein. We assume that each sensor is equipped with an internal battery and is allowed to use a long term energy conversion policy. We assume the observations at the sensors are, conditioned on the true hypothesis, independent and our goal is to design the sensors’ transmission rules in such a way that the error probability at each time instance t, at the FC, is minimized. To this end, we use the Bhattacharyya distance between the conditional distributions at the FC input, which has been frequently used in the past as a performance measure in the design of distributed detection systems [5], [21], [22]. Using the Bhattacharyya distance, essentially reduces the joint design of decision rules at the sensors to the design of decision rules at single sensors. Doing so may risk not capturing all the aspects of the joint design of the decision rules at peripheral sensors. However, due to the analytical tractability that follows from this choice of design rule, the Bhattacharyya distance has been frequently considered as a performance metric before in the literature [5]. The novelty of our work is in the formulation of a de- 2 un,t 0 Ht ∈ {0, 1} 1 − 0 yn,t 0 0 1 x1,t S1 xN,t xn,t ··· u1,t ··· Sn un,t y1,t yn,t SN 1 1 − 1 1 Fig. 2. Binary asymmetric channels between sensors and the FC. uN,t yN,t Fusion Center bt H harvesting sensor, and formulate the problem. In Section III we study the performance of an energy harvesting sensor with different battery capacities. In Section IV we will illustrate our results in the design of sensor networks by presenting numerical simulations, and finally in Section V we conclude the paper. Fig. 1. Decentralized hypothesis testing scheme in a parallel network. centralized detection problem with system costs coupled to the random behavior of the energy available at the sensors. Concretely, we will find the depletion probability at the sensor batteries, and evaluate the performance of the network for different battery capacities (buffer sizes). We will show how the problem formulation changes (compared to the unconstrained case) when we consider the energy features in the problem of designing the sensors in the network. Distributed inference using energy harvesting agents has gained a lot of interest during the last years (see [23]– [32] and references therein). In the context of distributed estimation, Nayyar et al. studied the structure of optimal communication scheduling [23], Zhao et al. [24], Huang et al. [25], and Nourian et al. [26] studied optimal power allocation schemes, while Li et al. [27] studied the performance of an energy harvesting relay-aided cooperative network under fading channels. Hong [28] considered the case where each peripheral node sends a re-scaled version of its observation towards a FC, if the required energy for that transmission is available at the sensor; otherwise the sensor remains silent. This non-transmission also conveys information regarding the magnitude of the observed signal. Hua Liu et al. [29] considered adaptive quantization is distributed estimation using a game-theoretic approach. Energy harvesting in relay systems was also considered in [30], [31], where the nodes (or relays) harvest the energy they need to transmit their amplified received messages towards a receiver. Medepally and Mehta [31] considered a relay selection scheme where if multiple active relays are available, one of them is selected to transmit. In the context of distributed detection, however, finding optimal decision rules at the remote energy harvesting sensors is largely open. In [32] we studied the structure of decision rules at agents with infinite battery size and in error-free communication channels, while in this paper we shall extend the results to a more general case of erroneous communication channels. The outline of this paper is as follows. In Section II we describe the structure of a parallel network and an energy II. P RELIMINARIES In this section we first present the system model. We then define an energy harvesting sensor and formulate the problem of designing the energy harvesting sensors in the network. Limitations of the proposed system model, and their influence on the obtained results, are further discussed in the concluding remarks in Section V. A. System Model We consider a decentralized hypothesis testing problem where N sensors S1 , . . . , SN are arranged in parallel, according to Fig. 1. During each time interval t (defined as [t, t + 1)) each sensor Sn , n ∈ {1, . . . , N }, makes an observation xn,t from the same phenomenon and sends a message un,t towards the FC. Note that xn,t is just assumed to be an element of an abstract space, so it could be a single scalar measurement or a vector of measurements made during time interval t at sensor Sn . We consider the case where different observations at the sensor Sn , conditioned on the hypothesis, are independent and identically distributed and Xn is a random variable corresponding to observations at sensor Sn . At each time interval the phenomenon Ht is modeled as a random variable drawn from a binary set {0, 1} with apriori probabilities π0 and π1 , respectively, and gives rise to conditionally independent observations Xn ∈ Xn with conditional distribution fXn |Ht (xn,t |ht ) for ht ∈ {0, 1} at the sensors. In this paper, we assume that the present hypothesis Ht changes over time in an i.i.d. fashion while it is fixed during each time interval. We also assume that the sensors are allowed to use a long term energy usage policy managed together with an internal battery. In other words, we consider the long term behavior of a sensor when its battery state operates in steady state. The communication channels between the sensors and the FC are one-way links from the sensors, and there is no communication between the sensor nodes. The sensors communicate with the FC using an energy asymmetric on-off keying, where a positive message (labeled by “1”) is conveyed by transmission of a message and a negative message (labeled by “0”) is conveyed by a non-transmission. We model the 3 channel between sensor Sn and the FC by the most general binary discrete memoryless channel that is the so called binary asymmetric channel (BAC) [33], where the 0-to-1 error occurs with probability 0 < 0.5 and the 1-to-0 error occurs with probability 1 < 0.5, as shown in Fig. 2, where yn,t ∈ {0, 1} is the received message at the FC corresponding to the sensor output un,t . When 0 = 1 the channel will be a binary symmetric channel (BSC) and when 0 = 0, the channel will reduce to the Z-channel. It is important to stress that although we consider the sensor-to-FC channel to be unreliable, we also consider it to be fixed and not subject to alteration by the sensors, i.e., the optimization of the sensor decision rules does not encompass the design of the over the air transmission protocol. The BAC is also a relevant high-level model for the case where each sensor-to-FC channel is a fading channel and the FC (as a non-coherent receiver) uses an energy detector to detect its input yn,t , i.e., where  1 En,t > Γ yn,t = 0 Otherwise , where En,t is the energy received at the FC resulting from sensor un,t and Γ is some positive threshold [18]. For OOK transmission over a fading channel with an energy threshold detector at the FC, it may be reasonable to assume that 1  0 , reflecting the belief that deep fades causing the received energy to not meet the specified threshold are more likely than noise induced fluctuations that push the decision metric over the threshold boundary. The overall problem considered is structurally similar to the classical binary hypothesis testing problem over one bit channels. In other words, each sensor Sn , given a realization xn,t of Xn , computes a message un,t ∈ {0, 1} using its decision function γn : X → {0, 1}, i.e., γn (xn,t ) = un,t , and sends this message towards the FC. The FC, based on the aggregate received BAC channel outputs y t , (y1,t , . . . , yN,t ), makes a decision b ht ∈ {0, 1} (with corresponding random b t ) about the present hypothesis at each time interval, variable H using its decision function γ0 : {0, 1}N → {0, 1}, i.e., γ0 (y t ) = b ht . Note that the FC does not directly have access to the sensor outputs ut , (u1,t , . . . , uN,t ), while it has access to the corresponding BAC channel outputs y t . The overall objective in this paper is to design the decision functions γn , for n = 0, . . . , N , of the FC and the sensors in such a way that some performance measure is optimized. This problem was considered extensively in the classical distributed detection literature [1], [5], [6] when energy is always available at the sensors to send their messages and the sensor-to-FC channels are error-free channels. However, the problem of designing sensors’ decision functions when each sensor is an energy harvesting device is largely open. We shall herein consider the problem of designing decision functions of the sensors when each sensor is an energy harvesting device. In what follows, we first define our performance metric and then, in Section II-B, we define an energy harvesting device. Let Un be a random variable corresponding to output messages of sensor Sn . Then, due to the independence of observations, the conditional PMF associated with the message vector U , (U1 , . . . , UN ) can be obtained according to N Z Y PU |Ht (u|ht ) = fXn |Ht (x|ht ) dx , (1) n=1 −1 x∈γn (un ) where u , (u1 , . . . , uN ), and where γn−1 (un ) is the set of observations x ∈ X that satisfy γn (x) = un . Let BTot,t be the total Bhattacharyya distance (BD) at the FC at time instance t, and for given sensor decision functions γ1 , γ2 , . . . , γN : X q PY |Ht (y t |0)PY |Ht (y t |1) , BTot,t = − log y ∈{0,1}N t where Y , (Y1 , . . . , YN ) and Yn is a random variable corresponding to BAC channel output  yn,t . The Bayesian error b probability PE,t , Pr Ht 6= Ht is minimized when the FC applies the maximum a-posteriori (MAP) rule [34] and the corresponding error probability can be upper bounded by the total BD according to [35] √ PE,t ≤ π0 π1 e−BTot,t . In the context of distributed hypothesis testing, it has been acknowledged that the Bayesian error probability criteria in most cases does not lead to a tractable design procedure for decision functions, even for small sized networks. This led authors to consider the Bhattacharyya distance as a performance measure of the network [5], [21], [22]. In addition, when the observations at the sensors, conditioned on the true hypothesis, are independent, the total Bhattacharyya distance at the FC simplifies greatly and decouples [22], i.e., BTot,t = N X − log n=1 = N X X q PYn |Ht (yn,t |0)PYn |Ht (yn,t |1) yn,t =0,1 Bn,t . n=1 In other words, at each time instance t, the total Bhattacharyya distance at the FC of a parallel network is the summation of all the Bhattacharyya distances delivered from different sensors. Therefore, a network which maximizes the Bhattacharyya distance at the FC is a network with individually optimized sensors. Then, it suffices to maximize the BD received at the FC from each sensor, separately. From now on we will focus on a single energy harvesting sensor S and drop the subscript n and denote its BD at time t by Bt . Throughout this paper, we interchangeably use the terms “Bhattacharyya distance” and “BD”. B. Energy Harvesting Sensors Consider an energy harvesting sensor S as in Fig. 3. Let us assume that during time interval t energy et arrives 4 for a given Θ, where xt et K S bt wt bt wt t ut et l(xt ) , ln bt+1 t+1 Fig. 3. Model of an energy harvesting node (left) and an example of a time interval t (right). stochastically at the node as a stationary and ergodic random process Et , see [14]. Let bt be the battery state and let Bt be its corresponding random process, which is in general a correlated random process over time even when energy harvesting process Et is i.i.d. Note that the actions of the sensor affect the future of the battery state, and the sensor knows the battery state. Assume that the battery size (capacity) is K. Then the amount of available energy in the battery at transmission time t + 1 is (cf. [13]) bt+1 = min {bt − wt + et , K} , (2) where wt is the amount of energy used to send the message ut at time t, with the corresponding random variable Wt . We assume that the arrival energy et during time interval t can not be used at the same time interval (see Fig. 3). The same as in [36]–[39], we assume energy arrives in packets and at each time interval the sensor is capable of harvesting at most one packet of energy. We also assume et ∈ {0, 1} is drawn from a Bernoulli distribution, with Pr(et = 1) = pe . We further assume that only sending a message costs a packet of energy, and the energy of making the observation and processing is negligible. These assumptions, while rather simplistic, are repeatedly used in the literature (see [36]–[39] and references therein) for an energy harvesting system. We adopt this model for the sake of analytical tractability and insight. Thus, wt = 1 if ut = 1 was sent during time interval t, otherwise wt = 0, i.e., ( 1 ut = 1 , wt = wt (ut ) = 0 ut = 0 . As noted before, the received BD at the FC from sensor S at time t is " # X q PY |Ht (yt |0)PY |Ht (yt |1) , (3) Bt = − log yt =0,1 is the log-likelihood ratio for a given observation xt . Let lt , l(xt ) and let L , l(X). It was shown in [40] that, for the unconstrained case1 , and error-free sensor-to-FC channels, likelihood-ratio quantizers are optimal decision rules at the local sensors. Chen and Willett [41] then generalized this result for the case of non-ideal sensor-to-FC channels. They have shown that likelihood-ratio thresholds are optimal for nonideal channels as well (see [41], [42] for the conditions under which this result holds). Furthermore, for scalar observations xt , when the likelihood-ratio of the observation at a sensor S is monotone and increasing in xt , the likelihood-ratio threshold can be directly translated to the sensor observation. This is an immediate consequence of the Karlin-Rubin theorem [43]. Throughout this paper, we denote the optimal threshold of an energy unconstrained sensor by Θ?u . In other words, Θ?u is the threshold in (5) which maximizes (3), i.e.,  hp [0 + δq0 ][0 + δq1 ] + Θ?u = arg max − log Θ i p [1 − 0 − δq0 ][1 − 0 − δq1 ] (6) where qh , Pr (L ≥ Θ|Ht = h) , δ , 1 − 0 − 1 , for h = 0, 1. Note that q0 and q1 are the false alarm and the detection probability of an unconstrained sensor, respectively. We say that the observation model at the sensor is separable, or perfect, if there exists a threshold Θ for which q0 = 0 , lim q0 = 0 , PY |Ht (yt = i|h) =PU |Ht (ut = i|h)(1 − i )+ PU |Ht (ut = 1 − i|h)1−i . (4) We say a sensor decision function γ is a likelihood-ratio quantizer (or likelihood-ratio threshold) if  1 l(xt ) ≥ Θ, ut = γ(xt ) , (5) 0 Otherwise , q1 = 1 . (7) In this situation, for an unconstrained sensor and error-free channel, the BD will be infinity and the detection problem is trivial. However, in real-world applications such observation models do not exist and the observation models are nonseparable, i.e., there is no threshold Θ for which the conditions in (7) are both satisfied. However, such a condition may hold asymptotically in the high SNR limit. Thus, let us define E as the signal-to-noise ratio (SNR) at the sensor. We say that the observation model at the sensor is asymptotically separable if, when SNR goes to infinity, for a sensor with non-separable observations there exists a threshold Θ for which E→∞ where fX|Ht (xt |1) fX|Ht (xt |0) lim q1 = 1 , E→∞ (8) and therefore the corresponding BD for the unconstrained sensor and error-free channel goes to infinity, limE→∞ Bt = ∞. Many observation models that are considered in the literature are asymptotically separable and in the following we will introduce one of these observation models. Consider the case where each observation is from a Rayleigh distribution with 1 By unconstrained we mean the situation where energy is always available at the sensor. 5 scale parameter σ0 or from a Rician distribution with scale parameter σ1 and noncentrality parameter s. The conditional distributions at the sensor are therefore   x x2 fX|Ht (x|0) = 2 exp − 2 , and σ0 2σ  20 2    (9) x x +s xs fX|Ht (x|1) = 2 exp − I0 , σ1 2σ12 σ12 where I0 (z) is the modified Bessel function of the first kind with order zero. This is a relevant observation model for low complexity sensors in a wireless sensor network used to detect the presence of a known signal in Gaussian noise based on the received power. For simplicity, we assume σ0 = σ1 = 1 and by definition E , s2 . Now, letting SNR go to infinity, there is a threshold Θ under which the conditions in (8) are satisfied, and therefore the observation model is asymptotically separable. We shall herein assume that the energy constrained sensor S is also a single-threshold likelihood-ratio quantizer that applies the following threshold test:  1 lt ≥ Θ, bt > 0, ut = γ(xt , bt ) , (10) 0 Otherwise. In other words, a sensor S at each time t compares the likelihood-ratio lt of its observation xt with a threshold Θ. If lt ≥ Θ and the battery is not empty bt > 0, it sends a message towards the FC, otherwise it remains silent.2 We would like to note that, the FC in this setup is a static device, in the sense that, it makes decision at each time t only based on its input messages at the same time, and it does not use previous input messages from the sensors. In other words, the FC does not take into account any correlation in the received messages from a sensor that could (possibly) be introduced by the memory of the battery at that sensor. In what follows we will find a threshold Θ? which maximizes the delivered Bhattacharyya distance from a sensor to the FC. We will show that for the problem at hand an optimum decision rule not only depends on the observation model, it also depends on the battery charge state, arrival energy features and the capacity of the battery K. We further show that the resulting thresholds in general differ from those of the unconstrained case. In the following section, for different battery capacities, we study the depletion probability of an energy harvesting sensor. Furthermore, we will show how one can design an energy harvesting sensor for different battery capacities. Note that by designing energy harvesting sensors we mean the selection of the decision threshold Θ in (10). III. D ESIGN OF E NERGY H ARVESTING S ENSORS To formulate the problem, let us first find conditional mass probabilities resulting from a sensor decision ut ∈ {0, 1}. PU |Ht (ut = 1|h) = Pr (L ≥ Θ ∩ Bt > 0|Ht = h) = Pr (L ≥ Θ|Ht = h) Pr (Bt > 0) (11) = qh [1 − Pr (Bt = 0)] From (3), (4), and (11) we observe that the BD of an energy harvesting sensor at time t depends on the observation 2 Note that the condition bt > 0 is a consequence of wt = 1 assumption. distribution at the sensor through qh and the battery depletion probability Pr (Bt = 0). Under the assumptions that the energy harvesting probability is i.i.d. Bernuoulli over time and space, and has a probability pe , and the observations at the sensor are i.i.d. in time, we say that, the battery has a Markovian behavior in the sense that, conditioned on Et and Wt , its state at time t + 1 (i.e., Bt+1 ) only depends on its state at time t (i.e., Bt ) and not the sequence of previous states, {Bt0 }t−1 t0 =0 . Under the Markovian assumption, a steady state probability for the battery charge state can be derived, which allows us to consider the long term performance of an energy harvesting sensor equipped with a battery. Let the state probability vector of the battery charge at time t be | pt , Pr (Bt = 0) , . . . , Pr (Bt = K) , where the superscript | indicates transposition, and let us define the transition probability matrix as   P = pi,j K×K , where K = K + 1 and pi,j , Pr(Bt = j|Bt−1 = i) , for i, j = 0, . . . , K. When the battery is in steady state [44], the state probability vector will satisfy p∞ = P| p∞ , (12) and the steady state probability of each battery state, i.e., pj , lim Pr(Bt = j), t→∞ can be found using (12) and the fact that the summation of the probabilities must equal unity. In steady state, after dropping the subscript t, the conditional probabilities in (11) are given by PU |H (u = 1|h) = qh (1 − p0 ) , PU |H (u = 0|h) = 1 − qh (1 − p0 ) . (13) We can plug (13) into (4) and find the resulting Bhattacharyya distance in (3) as hp [0 + δq0 (1 − p0 )][0 + δq1 (1 − p0 )] + B = − log i p [1 − 0 − δq0 (1 − p0 )][1 − 0 − δq1 (1 − p0 )] . (14) We observe that the resulting BD for the energy constrained case (in steady state) depends on the depletion probability p0 of the battery, which itself is a function of energy features and the battery capacity. Therefore, in the following we study the performance of an energy harvesting sensor for different battery capacities, K. To this end, for an arbitrary battery capacity K, in Lemma 1, we will find the depletion probability p0 . Then we can find a threshold Θ? which maximizes (14). To this end, consider a K-slot-battery energy harvesting sensor S. Assume that at transmission time t, its battery charge is in state bt = k, where 0 < k < K. Since during each time interval the sensor is capable of harvesting and consuming at most one packet of energy, its state at transmission time t + 1 will be either bt+1 = k − 1, k or k + 1. Two exceptions to this rule are when the battery charge is in state bt = 0 or in state bt = K. In the former case the state of the battery at 6 0.5 0.14 rS 0.45 rS rS rS rS rS bC bC 0.25 bC bC bC bC bC bC bC 0.3 rS bC bC rS 0.2 bC 0.15 bC 0.1 bC rS rS bC 0 Using Using Using Using rS rS bC rS 0.05 bC bC Θ⋆ , Θ⋆u , Θ⋆ , Θ⋆u , K K K K =2 =2 =1 =1 3 4 5 rS bC bC bC bC 6 7 8 rS 0.08 bCbC bC bC rS bC 0.06 bC rS bC 0.04 bC Using Using Using Using rS rS 0.02 bCrS bC bC bC rS rS 2 rS rS 0.1 rS bCbCrS 1 rS rS rS Bhattacharyya distance 0.35 rS rSrS 0.12 rS rS 0.4 Bhattacharyya distance rS rSrS rS 9 10 0 Θ⋆ , Θ⋆u , Θ⋆ , Θ⋆u , K K K K =2 =2 =1 =1 bCbCrS 1 2 3 4 5 6 7 8 9 10 Non-centrality parameter s Non-centrality parameter s Fig. 4. Bhattacharyya distance of single- and double-slot-battery (K = 1, 2) energy harvesting sensors for different threshold tests and for noiseless (left) and noisy (right) communication channels, for π1 = 0.2, pe = 0.15, as a function of non-centrality parameter. transmission time t + 1 will be either zero or one, since the battery charge can not be negative. In the latter case, the state of the battery at transmission time t + 1 will be either K − 1 or K, since there is no space to save more energy packets. Lemma 1: The depletion probability of a K-slot-battery energy harvesting sensor is given by3 " #−1 K 1 X k p0 = 1 + Ω (15a) 1−q k=1 pe − q = , pe ΩK − q where Ω, (15b) pe (1 − q) , q(1 − pe ) and q , π0 q0 + π1 q1 . Proof. See Appendix A. Remark: The depletion probability of a K-slot-battery energy harvesting sensor (when pe < 1) is always above zero for any K < ∞. However, when K = ∞ it admits the following expression:  0 pe ≥ q , p0 = (16) 1 − pqe Otherwise . This can be seen by noting that, the summation k ∞ ∞  X X pe (1 − q) k Ω = q(1 − pe ) k=1 k=1 converges if pe < q. Otherwise the sum diverges, which makes the depletion probability equal to zero. This depletion probability expression for an infinite capacity battery sensor 3 We would like to note that the difference between this model and an M/M/1/K queue is that in this model each battery charge state k after each transition can either change by one, or remain unchanged. is in line with the expression found before by modeling the battery state as a birth-death process in [32]. Note that the condition pe ≥ q, which results in zero depletion probability, follows intuition in the sense that, when the probability of energy arrival pe is higher than the probability of energy consumption (or the probability q that the sensor observation is above the threshold and it decides to send a message), the battery will accumulate energy and, with probability one, in long term not be empty. In this situation the problem will be the same as the unconstrained setup. Now by plugging the expression for the depletion probability in (15) into that of the BD for energy constrained sensor in (14), we can find a closed-form expression for the BD of a K-slot-battery sensor as follows. "s   pe (ΩK − 1) pe (ΩK − 1) B = −log 0 + δq0  + δq + 0 1 pe ΩK − q p e ΩK − q s  # pe (ΩK − 1) pe (ΩK − 1) 1 − 0 − δq0 1 − 0 − δq1 . p e ΩK − q pe ΩK − q (17) Note that since the BD is a function of observation models, we can not simplify it more. In what follows we will be considering different battery capacities K, and numerically find the threshold Θ? which maximizes the corresponding Bhattacharyya distance. When a sensor is capable of saving only one packet of energy, incoming energy et is saved in the battery if the battery is empty. Otherwise, the sensor discards the incoming energy packet. For a single-slot-battery sensor an optimal threshold Θ? is found by maximizing the BD in (17) for K = 1. To do this, we use a grid search to find the threshold Θ that maximizes the BD. When a sensor is capable of saving two packets of energy (K = 2), incoming energy et is saved in the battery if the battery is empty or has only one packet of energy in the buffer. Otherwise, the sensor discards the incoming energy packet. The same as for a single-slot-battery, by maximizing 7 (17) we can find an optimal threshold Θ? for a double-slotbattery sensor K = 2. Fig. 4 illustrates the resulting BD of single- and double-slot-battery energy harvesting sensors using the adapted (Θ? ) and the unconstrained (Θ?u ) thresholds, for π1 = 0.2 and pe = 0.15. The figure on the left, considers error-free communication channels (0 = 1 = 0) while the figure on the right considers BAC channels with parameters 0 = 0.1 and 1 = 0.2. We observe that the unconstrained threshold Θ?u is always sub-optimal. In the single- and double-slot-battery cases the Bhattacharyya distance is bounded when the SNR goes to infinity. In Theorem 1 we will find a closed-form expression for this upper bound for an arbitrary battery size K, and find conditions under which the Bhattacharyya distance is upper bounded. Theorem 1: Consider a K-slot-battery energy harvesting sensor S. Assume that the probability of harvesting energy at each time interval is pe , and the a-priori probability of hypothesis Ht = 1 is π1 and the sensor-to-FC channels are BAC channels as in Fig. 2. The BD of this sensor at the input of the FC can not exceed hp i p B , − log 0 (1 − 1 − p0 δ) + (1 − 0 ) (1 + p0 δ) , (18) where " k K  1 X pe (1 − π1 ) p0 = 1 + 1 − π1 π1 (1 − pe ) #−1 . k=1 Proof. See Appendix B. Remark: The upper bound in (18) is achievable under any separable observation model by selecting Θ? so that q0 = 0 and q1 = 1. It is also asymptotically achievable (when E → ∞) for a sensor with an asymptotically separable observation model. These asymptotes are also shown in Fig. 4 by dotted lines. Note that a, possibly unexpected, insight due to this result is that when the sensors make (asymptotically) separable observations, i.e., when the sensors are sure of the true hypothesis, it is optimal for the sensor to act greedily and always transmit whenever Ht = 1 and their internal battery allows for a transmission. The FC will in this situation still only receive a transmission from a subset of the sensors, as the battery depletion events are independent across sensors due to the independence of the energy arrival process. Remark: The upper bound in (18) is an increasing function of the battery capacity K. It is in line with the intuition that the performance of an energy harvesting sensor S is improved by increasing its battery capacity. The upper bound in (18) is also an increasing function of the probability of harvesting energy pe and is a decreasing function of the a-priori probability π1 . These also follow the intuition in the sense that by increasing the probability of having energy available at the battery, the performance of the sensor is improved. While pe affects the amount of available energy directly, π1 affects the battery content in a more complicated way: According to (10) an optimally designed sensor aims to send a message “1” and consume a packet of energy when its observation is above Θ? . By increasing the a-priori probability of the hypothesis Ht = 1, it will be more likely that the sensor aims to send a “1” and consume energy. This itself increases the depletion probability p0 and so decreases the performance of the sensor. We would also like to note that, unlike previous works on the design of sensor decision functions in a distributed detection network using the Bhattacharyya distance as performance metric, our problem formulation comprises the affect of apriori probabilities πj , for j = 0, 1 through q in the depletion probability p0 . Remark: For any finite K, the BD never grows unboundedly with E → ∞, while for the unconstrained case we have seen that it can grow unboundedly for separable and asymptotically separable observation models for error-free channel by increasing the SNR. Using (17) and (18), one can analyze the BD performance of a K-slot-battery sensor (when K < ∞) and its asymptote. In Fig. 5 the optimum BD for an energy harvesting sensor as a function of the sensor battery capacity is shown when the observation model at the sensor is according to (9) with s = 5. We observe from this figure that the maximum BD and the upper bound (as discussed before) are both increasing (non-decreasing) functions of sensor battery capacity K. Remark: For an infinite battery capacity sensor K = ∞, under some conditions the BD distance grows unboundedly for an asymptotically separable model, as SNR increases. Concretely, only if pe ≥ π1 and communication channels are noiseless, 0 = 1 = 0, the Bhattacharyya distance of an optimal threshold test (10) increases unboundedly for separable or asymptotically separable observation models, as SNR increases. In Fig. 6 the Bhattacharyya distance for an infinite-slotbattery sensor is shown, when using different thresholds, and for different setups. We observe from this figure that as the non-centrality parameter (or SNR) increases, for the case where pe ≥ π1 and 0 = 1 = 0 the Bhattacharyya distance increases unboundedly, otherwise it is upper bounded with the asymptote (shown by the dotted line) found in (18). In the following section, we compare the error probability performance of networks of energy harvesting sensors which we have designed using conventional (unconstrained) formulation in (6) (for Θ?u ) and using our proposed formulation in (17) (for Θ? ). Before considering the error probability performance of the designed networks, consider again the choice of Θ?u and Θ? . While using Θ?u , the sensor makes an optimal decision (in the sense of the Bhattacharyya distance) for the case where required energy for transmission of positive message is always available at the sensor. However, when energy is not always available at the sensor, the sensor should act more conservatively in the sense that: The sensor should remain silent and preserve energy for future time slots, unless it receives observation about the presence of hypothesis 1 with high reliability. In our formulation for the Bhattacharyya distance, the threshold Θ? determines if a received observation has high reliability about the presence of hypothesis 1. According to our simulation results, we always obtain Θ? ≥ Θ?u which further confirms our discussion above. 8 0.7 1 rS rS rS rS rS uT rS 0.8 rS rS rS Bhattacharyya distance Bhattacharyya distance rS rS rS rS 0.9 rS rS 0.6 0.5 rS rS Upperbound, ǫ0 = 0.1, ǫ1 = 0.2 Using Θ⋆ , ǫ0 = 0.1, ǫ1 = 0.2 Upperbound, ǫ0 = 0, ǫ1 = 0 Using Θ⋆ , ǫ0 = 0, ǫ1 = 0 rS rS 0.4 rS bC bC rS 0.3 rS 0.7 bC bC bC bC bC bC bC bC bC bC bC bC bCbC bC bC rS 0.5 rS uT uT uT 0.4 rS rS rS rS 0.3 bC uT 0.1 2 uT 3 4 5 6 7 8 9 10 Battery capacity K Fig. 5. Bhattacharyya distance of an energy harvesting sensor as a function of battery capacity K, for noisy and noiseless communication channels and for π1 = 0.2, pe = 0.15, and corresponding upper bounds according to Theorem 1. IV. E RROR P ROBABILITY P ERFORMANCE OF N ETWORKS In this section we illustrate the benefit of our results by numerical examples. Consider a sensor network with N = 4 energy harvesting sensors. Suppose the sensors make observations from the same phenomenon Ht during each time interval t, and send an OOK message to the FC. Let us assume again that sending a positive message consumes a packet of energy and a negative message is conveyed through a non-transmission with no energy cost. Let the observation model at each sensor be as in (9), and conditioned on the true hypothesis, the observations be independent, and that the sensors use the threshold test in (10). Note that, though in this section we assume the same observation model at the sensors, our results and conclusions drawn through this work are generalized to non-identical observation models at the sensors (and respectively non-identical sensor) case. Using our results in the previous section, we design sensor decision rules Θ for different battery sizes, and compare their error probability performance with those of the unconstrained case. The expected error probability, when the FC uses the MAP criterion, at time t is found using [6] n  o X PE,t = 1 − max πj PY |H y t |j , y rS bC bC bC j=0,1 t which can be numerically computed, without the need for Monte-Carlo simulations. Fig. 7 shows the error probability performance of designed sensor networks, with single-slot-battery sensors and doubleslot-battery sensors, when π1 = 0.2 and pe = 0.15. In both cases (K = 1, 2) the adapted threshold Θ? leads to better performance than the unconstrained threshold Θ?u . This is in line with our results based on the Bhattacharyya distance: Adapted threshold leads to a higher BD. As s → ∞, we also observe that the error probability does not converge to zero (lower bounded). It was shown for the Bhattacharyya distance 0 rSuT bC 1 2 bCrS Using Using Using Using Using Using Θ⋆ , Θ⋆u , Θ⋆ , Θ⋆u , Θ⋆ , Θ⋆u , (0.2, 0.2, 0, 0) (0.2, 0.2, 0, 0) (0.2, 0.15, 0, 0) (0.2, 0.15, 0, 0) (0.2, 0.15, 0.1, 0.2) (0.2, 0.15, 0.1, 0.2) bC bCbC bC bC bC bC 5 6 7 8 9 10 bC bC bCrS bCbC 1 0.2 rS bC rS rS 0.6 uT bC 0.1 rSrS rS rS bC 0.2 rS rS rS rS uT 3 4 Non-centrality parameter s Fig. 6. Bhattacharyya distance of an infinite-slot-battery (K = ∞) energy harvesting sensor for different threshold tests and for different (π1 , pe , 0 , 1 ), as a function of noncentrality parameter. that Bt is upper bounded for single and double-slot-battery sensors. We also observe from the figure that, while both using the optimal threshold or the sub-optimal threshold, increasing the battery capacity (here from one to two) can improve the error probability performance of a network of sensors. In Fig. 8 the error probability performance of the network of N = 4 infinite-slot-battery sensors is shown for different sets of (π1 , pe , 0 , 1 ). When π1 > pe and/or sensor-to-FC channels are erroneous, the error probability of the network converges to a fixed value as s → ∞, while when π1 ≤ pe and the channels are error-free (0 = 1 = 0), the error probabilities for both the adapted threshold and the energy unconstrained threshold rapidly go to zero. These observations are also in line with our results in terms of the Bhattacharyya distance: When K = ∞, if pe ≥ π1 and channels are error-free, the BD increases unboundedly, otherwise it converges to a non-zero asymptote. Note that we have the same observations for other choices of (π1 , pe , 0 , 1 ). V. C ONCLUDING R EMARKS In this paper we studied the problem of decentralized hypothesis testing in a network of energy harvesting sensors. The sensors in the network make observations of a phenomenon and harvest all the energy they need from the environment. We consider the case where the sensors have different battery capacities to save the harvested energy. Considering the Bhattacharyya distance as a performance metric, we formulated the problem of designing sensors in the network by considering the constraints imposed by energy harvesting and proposed a method to design the sensors decision rules. We further studied the performance of sensors for different battery capacities and presented conditions under which the Bhattacharyya distance is upper bounded, and therefore the error probability is lower bounded and does not converge to zero. In this paper, we considered the case where the observations and the energy charging processes at the sensors 9 −0.65 Using Using Using Using rS rS bCrS bC bC bC −0.75 =1 =1 =2 =2 uTrSbC bC bC rS bC uTrS bC bC rS bC uT −1 bC bCbC uT −1.5 bC rS rS rS uT bCrS rS rS −0.85 rS bC rS rS −0.9 rSrS rS rS rS rS −2 rS uT rS uT −2.5 bC bC bC rS −0.8 log10 PE −0.5 K K K K log10 PE −0.7 rS bCrS Θ⋆u , Θ⋆ , Θ⋆u , Θ⋆ , uT Using Using Using Using Using rS Using bC Θ⋆u , Θ⋆ , Θ⋆u , Θ⋆ , Θ⋆u , Θ⋆ , uT bC bC (0.2, 0.15, 0.1, 0.2) (0.2, 0.15, 0.1, 0.2) (0.2, 0.15, 0, 0) (0.2, 0.15, 0, 0) (0.2, 0.2, 0, 0) (0.2, 0.2, 0, 0) rS bC −0.95 −3 bC rS rS uT rS rS rS rS rS 6 7 8 9 10 bC bC −1 −1.05 bC bC 1 2 3 4 5 6 bC bC bC bC 7 8 9 10 −3.5 −4 uT 1 2 3 4 Fig. 7. Error probability performance of networks with N = 4 energy harvesting sensors with different battery capacities, when π1 = 0.2 and pe = 0.15, and noisy communication channels with 0 = 0.1 and 1 = 0.2. are independent. A possible extension to this work can be to consider the case where the observations at the sensors, or/and the energy charging processes are correlated. For the sake of analytical tractability and insight, we only studied the case where each sensor decision rule is a simple singlethreshold test. It is known that having multiple-thresholds at the sensors can result in better BD performance. Concretely, battery state dependent thresholds Θ(bt ) can improve the performance of a single-threshold energy harvesting sensor, and an extension to our study can be to study the performance of such threshold tests. Although not presented herein, we have numerically found optimal threshold tests Θ?1 , Θ?2 , where Θ?i is the optimal threshold when bt = i for i = 1, 2, using a grid search in the case of a double-slot-battery (K = 2) and the observation model in (9). Our results confirm that having multiple thresholds can improve the BD performance of the sensor, but the gains are small compared to introducing the single threshold in the first place. We would also like to note that other members of Ali-Silvey distance (like J-divergence) can also be used as a performance metric for the design of decision rules at the sensors, with a lot of similar derivations. In this paper, we chose to use the BD as the performance metric since according to [5] the BD is one of the most analytically tractable members of Ali-Silvey distances and was reported as the most efficient metric among those studied in [21]. Our work represents a first attempt to introduce energy harvesting considerations in the context of distributed detection using established (but arguably simple) design metrics such as the Bhattacharyya distance. Our approach furthermore utilizes simplified models such as the energy arrival model taken from [36]–[39]. While the simplifying assumptions make the results more tractable and interpretable, they also naturally come with some strong limitations. Apart from the extension to a batterydependent decision threshold, one could also consider the case where the sensors optimize the OOK transmission energy in 5 Non-centrality parameter s Non-centrality parameter s Fig. 8. Error probability performance of networks with infinite-slot-battery (K = ∞) energy harvesting sensors, and for different (π1 , pe , 0 , 1 ). order to influence the error probability of the transmission, i.e., the cross-over probability 0 in Fig. 2, based on some given physical channel model. This would however arguably be more relevant in conjunction with a more refined energy arrival and storage model, which we cannot presently handle directly given that we (for simplicity) assume that energy arrives in quanta matched to the energy needed for a positive (on) transmission. Furthermore, although the decoupling of the sensor design caused by considering the Bhattacharyya distance is often used to simplify the sensor design problem in the distributed detection literature, this approach should be scrutinized again when adding the energy harvesting aspect. This is due to the fact that jointly designed sensor decision rules can potentially lead to tangible benefits through more advanced joint energy conservation rules across sensors than what is implicitly provided by the differences in the random battery state across the sensors. ACKNOWLEDGMENT The authors would like to thank the Associate Editor and anonymous reviewers for their valuable comments and suggestions that led to improvement of this paper. The authors would especially like to thank the reviewers who prompted us to consider non-perfect communication channels. A PPENDIX A P ROOF OF L EMMA 1 Using (12), state probabilities for p0 , . . . , pK−1 are found as p0 = p0,0 p0 + p1,0 p1 , pk = pk−1,k pk−1 + pk,k pk + pk+1,k pk+1 , 1 ≤ k < K. (19) Using (2) and (10), for the transition probabilities we obtain p0,0 = 1 − pe , p1,0 = q(1 − pe ) , p0,1 = pe , 10 and for 1 ≤ k < K by replacing α, β, ξ, and ζ in (24) by q0 , q1 , 0 , and (1−p0 )δ, respectively. pk,k+1 = (1 − q)pe , pk+1,k = q(1 − pe ) , (20) pk,k = qpe + (1 − q)(1 − pe ) . By re-arranging the equations in (19) and replacing the transition probabilities pi,j with those in (20) we get the following equations pe p1 = p0 (21a) q(1 − pe ) p2 (1 − q) p0 (21b) p2 = 2 e q (1 − pe )2 pk = −Ω pk−2 + (1 + Ω) pk−1 , 3 ≤ k ≤ K. (21c) The system of equations described by (21) is a homogeneous difference equation [45]. Its characteristic polynomial is In what follows, we will find another upper bound for B by maximizing the right-hand-side of (25) which is equivalent to minimizing Γ2 . p Γ2 , 0 [0 + q1 (1 − p0 )δ]+ p (26) [1 − 0 ][1 − 0 − q1 (1 − p0 )δ] Minimizing Γ2 is equivalent to maximizing Σ , q1 (1 − p0 ), since Γ2 is a decreasing function of Σ. Then by replacing the depletion probability p0 from (15) we obtain  " #−1  K k k−1 X p (1 − q π − q π ) 0 0 1 1 e . Σ = q1 1 − 1 + (1 − pe )k (q0 π0 + q1 π1 )k k=1 (27) 2 ρ − (1 + Ω)ρ + Ω = 0 , whose roots are ρ = {1, Ω}. These lead to the general solution for the difference equation as k pk = λ1 + λ2 Ω . Ωk p0 , 1−q 1≤k≤K, max q0 ,q1 0≤q0 ≤q1 ≤1 (22) Now, applying auxiliary conditions (21a) and (21b) to (22), 1 we obtain λ1 = 0 and λ2 = 1−q p0 . Thus the solution to the difference equation is found to be given by pk = Now, considering the optimization problem (28) the objective function Σ is a decreasing function of q0 (note that q0 only appears in the argument of the summation) and its maxima is attained when q0 = 0, and therefore the problem in (28) reduces to the following problem, (23) max Λ , (29) 0≤q1 ≤1 which describes each state probability pk in terms of the depletion probability p0 . Now, using the fact that the summation of the probabilities must equal unity, for a K-slot-battery we obtain the desired depletion probability expression (15). where, Λ,Σ q0 =0  " K X pke (1 − q1 π1 )k−1 = q1 1 − 1 + (1 − pe )k (q1 π1 )k #−1  (30) . k=1 A PPENDIX B P ROOF OF T HEOREM 1 To prove the theorem, first consider the following function Γ1 where 0 ≤ α ≤ β ≤ 1, 0 ≤ ζ ≤ 1, and 0 ≤ ξ ≤ 0.5. p p Γ1 , [ξ + ζα][ξ + ζβ] + [1 − ξ − ζα][1 − ξ − ζβ] Taking the derivative of Γ1 with respect to α, we observe that when 0 ≤ α ≤ β, Γ1 is an increasing function of α and its minima is attained when α = 0. In other words p p min Γ1 = ξ[ξ + ζβ] + [1 − ξ][1 − ξ − ζβ] , In what follows we will show that the objective function Λ is an increasing function of q1 and therefore its maxima is attained when q1 = 1, which proves the theorem. Our aim is now to show dΛ ≥ 0, dq1 when 0 ≤ q1 ≤ 1. By evaluating the summation in (30) and introducing λ, α or equivalently p p [ξ + ζα][ξ + ζβ] + [1 − ξ − ζα][1 − ξ − ζβ] ≥ p p ξ[ξ + ζβ] + [1 − ξ][1 − ξ − ζβ] Σ, pe (1 − q1 π1 ) , (1 − pe )q1 π1 we obtain  (24) for 0 ≤ α ≤ β ≤ 1, 0 ≤ ζ ≤ 1, and 0 ≤ ξ ≤ 0.5. Using (24), we can conclude that for any given q1 , 0 , and p0 , the BD in (14) is upperbounded by hp B ≤ − log 0 [0 + q1 (1 − p0 )δ]+ i (25) p [1 − 0 ][1 − 0 − q1 (1 − p0 )δ] , Λ= pe π1  1 − λK . 1 − pe λK − (1 − pe )λK+1 According to the chain rule we have dΛ dΛ dλ = , dq1 dλ dq1 and using first principles we can straightforwardly show dλ ≤ 0, dq1 11 for 0 ≤ q1 ≤ 1. To complete the proof, we need to show dΛ ≤ 0, (31) dλ for λ ≥ 0. To this end, note that    K−1 (K + 1)λ − K − λK+1 (1 − p) dΛ pe λ = . 2 dλ π1 (1 − p)λK+1 + pλK − 1 Thus, proving (31) is equivalent to proving that g(λ) , (K + 1)λ − K − λK+1 ≤ 0 . To prove this, we first show g(λ) (for any K ≥ 0) has its optima at λ = 1 (where g (1) = 0), by setting its first dg equal to zero, i.e., derivative dλ dg = (K + 1) − (K + 1)λK = (K + 1)(1 − λK ) = 0 . dλ Then, we show this optima is a maxima (i.e., maxλ g(λ) = g(1) = 0) by finding its second derivative, i.e., d2 g = −K(K + 1)λK−1 ≤ 0 . dλ2 This completes the proof of of Theorem 1. dΛ dλ ≤ 0 and therefore the proof R EFERENCES [1] P. Varshney, Distributed Detection and Data Fusion. Springer-Verlag New York, Inc., 1996. [2] W. Li and H. Dai, “Distributed detection in wireless sensor networks using a multiple access channel,” IEEE Trans. Signal Process., vol. 55, no. 3, pp. 822–833, 2007. [3] D. Ciuonzo, G. Romano, and P. S. Rossi, “Channel-aware decision fusion in distributed mimo wireless sensor networks: Decode-and-fuse vs. decode-then-fuse,” IEEE Trans. Wireless commun., vol. 11, no. 8, pp. 2976–2985, 2012. [4] D. Ciuonzo, P. S. Rossi, and S. Dey, “Massive MIMO channel-aware decision fusion,” IEEE Trans. Signal Process., vol. 63, no. 3, pp. 604– 619, Feb 2015. [5] M. Longo, T. Lookabaugh, and R. Gray, “Quantization for decentralized hypothesis testing under communication constraints,” IEEE Trans. Inf. Theory, vol. 36, no. 2, pp. 241–255, Mar. 1990. [6] A. Tarighati and J. Jaldén, “Bayesian design of decentralized hypothesis testing under communication constraints,” in Proc. IEEE Int. Conf. Acoustics, Speech and Signal Process. (ICASSP), May 2014, pp. 7624– 7628. [7] V. Veeravalli and P. Varshney, “Distributed inference in wireless sensor networks,” Phil. Trans. A, Math. Phys. Eng. Sci., vol. 370, no. 1958, pp. 100–117, 2012. [8] J.-F. Chamberland and V. Veeravalli, “Wireless sensors in distributed detection applications,” IEEE Signal Process. Mag., vol. 24, no. 3, pp. 16–25, 2007. [9] B. Chen, L. Tong, and P. Varshney, “Channel aware distributed detection in wireless sensor networks,” IEEE Signal Process. Mag., 2006. [10] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci, “A survey on sensor networks,” IEEE Commun. Mag., vol. 40, no. 8, pp. 102–114, 2002. [11] S. J. Baek, G. De Veciana, and X. Su, “Minimizing energy consumption in large-scale sensor networks through distributed data compression and hierarchical aggregation,” IEEE J. sel. Areas Commun., vol. 22, no. 6, pp. 1130–1140, 2004. [12] P. Nuggehalli, V. Srinivasan, and R. R. Rao, “Energy efficient transmission scheduling for delay constrained wireless networks,” IEEE Trans. Wireless Commun., vol. 5, no. 3, pp. 531–539, 2006. [13] V. Sharma, U. Mukherji, V. Joseph, and S. Gupta, “Optimal energy management policies for energy harvesting sensor nodes,” IEEE Trans. Wireless Commun., vol. 9, no. 4, pp. 1326–1336, April 2010. [14] S. Ulukus, A. Yener, E. Erkip, O. Simeone, M. Zorzi, P. Grover, and K. Huang, “Energy harvesting wireless communications: A review of recent advances,” IEEE J. Sel. Areas Commun., 2015. [15] D. Gunduz, K. Stamatiou, N. Michelusi, and M. Zorzi, “Designing intelligent energy harvesting communication systems,” IEEE Commun. Magazine, vol. 52, no. 1, pp. 210–216, 2014. [16] S. Sudevalayam and P. Kulkarni, “Energy harvesting sensor nodes: Survey and implications,” IEEE Communications Surveys & Tutorials,, vol. 13, no. 3, pp. 443–461, 2011. [17] C. Rago, P. Willett, and Y. Bar-Shalom, “Censoring sensors: a lowcommunication-rate scheme for distributed detection,” IEEE Tran. Aerosp. Electron. Syst., vol. 32, no. 2, pp. 554–568, April 1996. [18] C. R. Berger, M. Guerriero, S. Zhou, and P. Willett, “PAC vs. MAC for decentralized detection using noncoherent modulation,” IEEE Trans. Signal Process., vol. 57, no. 9, pp. 3562–3575, 2009. [19] D. Ciuonzo, G. Romano, and P. S. Rossi, “Optimality of received energy in decision fusion over rayleigh fading diversity mac with non-identical sensors,” IEEE Trans. Signal Process., vol. 61, no. 1, pp. 22–27, 2013. [20] F. Li, J. S. Evans, and S. Dey, “Decision fusion over noncoherent fading multiaccess channels,” IEEE Trans. Signal Process., vol. 59, no. 9, pp. 4367–4380, 2011. [21] H. Poor and J. B. Thomas, “Applications of ali-silvey distance measures in the design generalized quantizers for binary decision systems,” IEEE Trans. Commun., vol. 25, no. 9, pp. 893–900, 1977. [22] A. Tarighati and J. Jaldén, “Optimality of rate balancing in wireless sensor networks,” IEEE Trans. Signal Process., vol. 64, no. 14, pp. 3735–3749, July 2016. [23] A. Nayyar, T. Başar, D. Teneketzis, and V. V. Veeravalli, “Optimal strategies for communication and remote estimation with an energy harvesting sensor,” IEEE Trans. Autom. Control, vol. 58, no. 9, pp. 2246–2260, Sept 2013. [24] Y. Zhao, B. Chen, and R. Zhang, “Optimal power allocation for an energy harvesting estimation system,” in Proc. IEEE Int. Conf. Acoustics, Speech and Signal Process., May 2013, pp. 4549–4553. [25] C. Huang, Y. Zhou, T. Jiang, P. Zhang, and S. Cui, “Power allocation for joint estimation with energy harvesting constraints,” in Proc. IEEE Int. Conf. Acoustics, Speech and Signal Process., May 2013, pp. 4804–4808. [26] M. Nourian, S. Dey, and A. Ahlén, “Distortion minimization in multisensor estimation with energy harvesting,” IEEE J. Sel. Areas Commun., vol. 33, no. 3, pp. 524–539, March 2015. [27] T. Li, P. Fan, and K. B. Letaief, “Outage probability of energy harvesting relay-aided cooperative networks over rayleigh fading channel,” IEEE Trans. Vehicular Tech., vol. 65, no. 2, pp. 972–978, Feb 2016. [28] Y.-W. P. Hong, “Distributed estimation with analog forwarding in energy-harvesting wireless sensor networks,” in Proc. IEEE Int. Conf. Commun. Syst. (ICCS), 2014, pp. 142–146. [29] H. Liu, G. Liu, Y. Liu, L. Mo, and H. Chen, “Adaptive quantization for distributed estimation in energy-harvesting wireless sensor networks: a game-theoretic approach,” Int. J. Distributed Sensor Networks, vol. 2014, 2014. [30] B. K. Chalise, Y. D. Zhang, and M. G. Amin, “Energy harvesting in an ostbc based amplify-and-forward mimo relay system,” in Proc. IEEE Int. Conf. Acoustics, Speech and Signal Process. (ICASSP), 2012, pp. 3201–3204. [31] B. Medepally and N. B. Mehta, “Voluntary energy harvesting relays and selection in cooperative wireless networks,” IEEE Trans. Wireless Commun., vol. 9, no. 11, pp. 3543–3553, 2010. [32] A. Tarighati, J. Gross, and J. Jaldén, “Decentralized detection in energy harvesting wireless sensor networks,” in Proc. European Signal Process. Conf. (EUSIPCO), Aug. 2016. [33] J. M. Berger, “A note on error detection codes for asymmetric channels,” Inf. and Control, vol. 4, no. 1, pp. 68–73, 1961. [34] J. N. Tsitsiklis, “Decentralized detection by a large number of sensors,” Math. Contr., Signals, Syst., vol. 1, no. 2, pp. 167–182, 1988. [35] T. Kailath, “The divergence and bhattacharyya distance measures in signal selection,” IEEE Trans. Commun., vol. 15, no. 1, pp. 52–60, Feb. 1967. [36] R. Valentini, M. Levorato, and F. Santucci, “Aging aware random channel access for battery-powered wireless networks,” IEEE Wireless Commun. Letters, vol. 5, no. 2, pp. 176–179, 2016. [37] N. Michelusi and M. Zorzi, “Optimal adaptive random multiaccess in energy harvesting wireless sensor networks,” IEEE Trans. Commun., vol. 63, no. 4, pp. 1355–1372, 2015. [38] N. Michelusi, K. Stamatiou, and M. Zorzi, “Transmission policies for energy harvesting sensors with time-correlated energy supply,” IEEE Trans. Commun., vol. 61, no. 7, pp. 2988–3001, 2013. [39] K. Tutuncuoglu, O. Ozel, A. Yener, and S. Ulukus, “Improved capacity bounds for the binary energy harvesting channel,” in Proc. IEEE Int. Symp. Inf. Theory (ISIT), 2014, pp. 976–980. 12 [40] J. N. Tsitsiklis, “Extremal properties of likelihood-ratio quantizers,” IEEE Trans. Commun., vol. 41, no. 4, pp. 550–558, 1993. [41] B. Chen and P. K. Willett, “On the optimality of the likelihood-ratio test for local sensor decision rules in the presence of nonideal channels,” IEEE Trans. Inf. Theory, vol. 51, no. 2, pp. 693–699, Feb 2005. [42] B. Liu and B. Chen, “Channel-optimized quantizers for decentralized detection in sensor networks,” IEEE Trans. Inf. Theory, vol. 52, no. 7, pp. 3349–3358, July 2006. [43] E. L. Lehmann and J. P. Romano, Testing statistical hypotheses. Springer Science & Business Media, 2006. [44] D. Gross, J. F. Shortie, J. M. Thompson, and C. M. Harris, Fundamentals of Queueing Theory. John Wiley & Sons, Inc., 2008. [45] P. S. Diniz, E. A. Da Silva, and S. L. Netto, Digital signal processing: system analysis and design. Cambridge University Press, 2010.
7cs.IT
STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS arXiv:1609.05611v1 [math.AT] 19 Sep 2016 ERIC RAMOS Abstract. For a tree G, we study the changing behaviors in the homology groups Hi (Bn G) as n varies, where Bn G := π1 (UConf n (G)). We prove that the ranks of these homologies can be described by a single polynomial for all n, and construct this polynomialLexplicitly in terms of invariants of the tree G. To accomplish this we prove that the group n Hi (Bn G) can be endowed with the structure of a finitely generated graded module over an integral polynomial ring, and further prove that it naturally decomposes as a direct sum of graded shifts of squarefree monomial ideals. Following this, we spend time considering how our methods might be generalized to braid groups of arbitrary graphs, and make various conjectures in this direction. 1. Introduction 1.1. Introductory remarks and statements of the main theorems. In recent years there has been a push towards understanding the mechanisms connecting various well-known asymptotic stability results in topology and algebra. For instance, let N be a connected oriented manifold of dimension ≥ 2, which is the interior of a manifold with boundary, and write Conf n (N ) for the n-strand configuration space Conf n (N ) := {(x1 , . . . , xn ) ∈ N n | xi 6= xj }. There is a natural action on Conf n (N ) by the symmetric group Sn , and we may therefore define the n-strand unordered configuration space UConf n (N ) := Conf n (N )/Sn . A classical theorem of McDuff [McD, Theorem 1.2] implies that for each i, and any n ≫ i, the group Hi (UConf n (N )) is independent of n. In contrast to the work of McDuff, it can be seen that the analogous statement is not true for the ordered configuration spaces Conf n (N ). What is true, however, is perhaps the next best thing. It follows from work of Church, Ellenberg, and Farb [CEF, Theorem 6.4.3] that for any i, there is a polynomial P ∈ Q[x] such that the Betti number dimQ (Hi (Conf n (U); Q)) agrees with P (n) for n ≥ 0. Results of this type fall under the heading of what one might call asymptotic algebra. The modern philosophy of asymptotic algebra can be roughly stated as follows: a family of algebraic objects which display asymptotic stability phenomena can often times be encoded into a single object, which is finitely generated in an appropriate abelian category. In the case of McDuff, for each i and n the group Hi (UConf n (N )) can be realized as the n-graded piece of some finitely generated graded module over Z[x]. The result of Church, Ellenberg, and Farb involves showing that the Sn -representations Hi (Conf n (U); Q) are each constituents of some finitely generated representation of the category FI, of finite sets and injections (see [CEF] for more on this notion). This philosophy is also heavily featured in The author was supported by NSF-RTG grant DMS-1502553. 1 2 ERIC RAMOS Sam and Snowden’s recent resolution of Stembridge’s conjecture [SS]. The goal of this paper is to apply similar techniques to the homologies of the unordered configuration spaces of trees. Note that this problem was considered by Lütgehetmann in his Master’s thesis [L]. The results of that work are disjoint from the current work. In this paper, a graph will always refer to a connected, compact CW-complex of dimension 1. A tree is a graph which is contractible as a topological space. An essential vertex of G is a vertex of degree, or valency, at least 3, while an essential edge of G is a connected component of the space obtained by removing all essential vertices from G. Note that both the essential edges and vertices of a graph are unaffected by subdivision of edges, and can be thought of as the topologically essential pieces of the graph. Our main result relates to the asymptotic behavior of the homologies of the braid group of a tree. To state this result, we first need to define a kind of connectivity invariant for trees. Let G be a tree. Then we set ∆iG := max {dimQ (H0 (G − {vj1 , . . . , vji }; Q))}. {{vj1 ,...,vji }|vjk essential} In words, ∆iG is the maximum number of connected components that G can be broken into by removing exactly i essential vertices. Therefore ∆1G is the maximum degree of a vertex G in G, while, if G has NG essential vertices, ∆N G is the number of essential edges of G. By 0 i convention, ∆G = 1, while ∆G = 0 for i > NG . Theorem A. Let G be a tree, and write Bn G to denote the braid group Bn G := π1 (UConf n (G)). Then for each i there is a polynomial Pi ∈ Q[x] of degree ∆iG − 1, such that for all n ≥ 0, Pi (n) = dimQ (Hi (Bn G; Q)). Remark 1.1. It follows from a Theorem of Ghrist [Gh, Theorem 3.3] that given any graph G not homeomorphic to S 1 , Hi (Bn G) = 0 for all i strictly greater than the number of essential vertices of G. This is realized in the case where G is a tree in Theorem A by the fact that ∆iG − 1 = −1 in these cases. The polynomial Pi of Theorem A is explicitly computed throughout the course of this work (see Theorem 3.17). This computation implies something somewhat surprising about these homology groups. Corollary B. Let G be a tree, and let i ≥ 0. Then the homology groups Hi (Bn G) depend only on i, n, and the degree sequence of G. It is interesting to note that the rank of Hi (Bn G) agrees with a polynomial for all n ≥ 0, as opposed to only agreeing for n sufficiently large. In the case of configuration spaces of manifolds, a result of this kind does have precedent. We have already discussed the result of Church, Ellenberg, and Farb which states that if N is an oriented manifold, which STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 3 is the interior of a manifold with non-empty boundary, then for any i the dimension of Hi (Conf n (N ); Q) agrees with a polynomial for all n [CEF, Theorem 6.4.3]. It is perhaps an interesting observation that trees can be thought of as graphs with non-trivial boundary. It is unclear whether the connection to the work of Church, Ellenberg, and Farb goes any deeper than this, however. 1.2. An Outline of the proof. To prove Theorem A, we will rely on classical techniques in commutative algebra, as well as more modern techniques in combinatorial topology. The first key ingredient is the discrete Morse theory of Forman [Fo]. Given a regular CW complex X (see Definition 2.1), write Ki for the set of i-cells of X. A discrete Morse function is a map f from the cells of X to R satisfying the following two hypotheses for all cells σ ∈ Ki : 1. |{τ ∈ Ki+1 | σ ⊆ τ and f (σ) ≥ f (τ )}| ≤ 1; 2. |{τ ∈ Ki−1 | τ ⊆ σ and f (σ) ≤ f (τ )}| ≤ 1. We call σ ∈ Ki a critical i-cell with respect to f , if the sets of conditions 1 and 2 are both empty. The main consequence of discrete Morse theory is that the critical cells of X determine its homotopy type. Formally, let a ∈ R and write X(a) for the subcomplex of X comprised of the closures of cells σ with f (σ) ≤ a. If there is no critical cell σ with a < f (σ) < b, then X(a) is a deformation retract of X(b). Otherwise, if there is a unique critical cell σ with a < f (σ) < b, then X(b) is obtained from X(a) by attaching the cell σ. Moreover, there is a complex (1.1) ∂e . . . → Mi → . . . → M1 → M0 → 0 where Mi is a free Z-module on the critical i-cells of X, whose homology is the homology of the space X. We call the differential ∂e the Morse differential (see Definition 2.5). Using work of Abrams [A], Farley and Sabalka were able to impose a discrete Morse structure on the spaces UConf n (G), where G is any graph [FS]. We will spend a good amount of time recounting the construction of Farley and Sabalka in Section 2.2. Once we have accomplished this, our strategy will be to develop a strong understanding of the critical cells. More specifically, we will work towards understanding the changing behaviors of the critical cells as n varies. Let G be a graph with E essential edges, and write SG := Z[x1 , . . . , xE ] for the integral polynomial ring in E-variables. We will prove the following in Section 3.2. (∗) For each i, there exists a finitely generated graded SG -module Mi,• for which Mi,n is a free Z-module with basis vectors indexed by the critical i-cells of UConf n (G). Specializing to the case where G is a tree, work of Farley [Fa] implies that the Morse differential is always trivial. Using the complex (1.1) we obtain the following. Theorem C. Let G be a tree with E essential edges, and let SG denote the integral polynomial ring in E variables. Then for each i and n, the action of SG on the critical cells of UConf n (G) described in Section L 3.2 imposes the structure of a finitely generated graded SG -module on the abelian group n≥0 Hi (UConf n (G)). In particular, there exists a finitely 4 ERIC RAMOS generated graded SG -module Hi such that, (Hi )n ∼ = Hi (UConf n (G)). A result of Ghrist and Abrams (see Theorem 2.13) implies the spaces UConf n (G) are aspherical. It follows immediately from this that Hi (UConf n (G)) ∼ = Hi (Bn G). With this in mind, the first part of Theorem A simply follows from the existence of the Hilbert polynomial. Of course, the above theorem does not tell us anything about the degree of the Hilbert polynomial, nor does it bound its obstruction. To accomplish this, we must first prove a structure theorem about the modules Hi . To state this theorem, we first recall the definition of a squarefree monomial ideal. We say an ideal I ⊆ Q[x1 , . . . , xd ] is a squarefree monomial ideal, if it contains a generating set of monomials, none of which are divisible by a square in Q[x1 , . . . , xd ]. These ideals are the subject of Stanley-Reisner theory, and have many desirable properties. For instance, much is known about their Hilbert polynomial (see [MS] for a reference on the subject). Theorem D. Let G be a tree, and let Hi denote the SG -module of Theorem C. Then Hi ⊗Z Q is isomorphic to a direct sum of graded twists of squarefree monomial ideals, each having dimension at most ∆iG . We will find that this theorem implies the conclusions of Theorem A. In fact, we will be able to compute the polynomial Pi associated to Hi explicitly in terms of invariants of the tree G (see Theorem 3.17). 1.3. An overview of the paper. In the next section, we will spend time developing necessary background. This includes short summaries of discrete Morse theory (Section 2.1), and configuration spaces of graphs (Sections 2.2 and 2.3). Following this, we use the machinery developed in these preliminary sections to prove the statement (∗) (Section 3.2). Finally, we specialize the the case of trees, and use enumerative combinatorial methods to prove Theorem A via an explicit computation of the Hilbert polynomial (Sections 3.3 and 3.4). To finish the paper, we briefly consider the case of a general graph G. Note that while most of the explicit results in this paper are limited to the case where G is a tree, the statement (∗) will hold for any graph G. A result like Theorem C will therefore hold for general graphs so long as we know that the Morse differential commutes with the action of SG on Mi,• . It is the belief of the author that the action of SG , or perhaps a slight alteration there of, will indeed commute with this differential. Unfortunately, it is known that this differential can become tremendously complicated as G increases in complexity (see [KP]). In any case, the methods in this work therefore provide at least a strategy for proving stability results for more general graphs. In the final sections, we discuss some implications of this. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 5 Acknowledgments The author would like to send thanks to Jordan Ellenberg for his many insights, as well as his help in editing this paper. The author would also like to send special thanks to Steven Sam for his vital advice in approaching the primary problem of this work. A great amount of gratitude must also be sent to Daniel Farley, whose expertise in the field was invaluable to the author during his learning of the material. Finally, the author would like the acknowledge the generous support of the National Science Foundation through NSF-RTG grant DMS-502553. 2. Preliminaries 2.1. Discrete Morse theory. We now take the time to briefly summarize the key points in Forman’s discrete Morse theory [Fo]. We will largely be following the exposition of Forman [Fo][Fo2], Farley and Sabalka [FS], and Ko and Park [KP]. In the introduction, we spent some time discussing the notion of discrete Morse function. One thing that should stand out about this definition is that the literal values of the function are immaterial. Namely, the classification of critical cells is unchanged by composition with any strictly monotone function R → R. In many cases it is often easier to construct the relationships between the cells, rather than the discrete Morse function itself. This hints towards the construction of what are known as discrete vector fields. We will use this approach during the exposition of this, and all future sections. To begin, we first must place certain light restrictions on the spaces we will be working with. Definition 2.1. Let X be a CW complex. A cell of X will always refer to an open cell in X. Given a cell σ of dimension i, we will often write σ (i) to indicate that σ has dimension i. We will write K to denote the set of cells of X, and Ki to denote the set of i-cells of X. A cell τ (i) ⊆ σ i+1 is said to be a regular face of a cell σ (i+1) if, given a characteristic map Φσ : D i+1 → X for σ (i+1) , Φ−1 is a homeomorphism. σ (τ ) is a closed ball, and the map Φσ |Φ−1 σ (τ ) We say that the complex X is regular if given a pair of cells τ (i) ⊆ σ (i+1) , τ (i) is a regular face of σ (i+1) . Equivalently, X is regular if and only if the attaching map of each of its cells is a homeomorphism. We will assume throughout most of our exposition that X is a regular CW complex. In his original paper on discrete Morse theory [Fo], Forman proves some of his results without the requirement that X be regular. The spaces UConf n (G), for any graph G, are actually cubical complexes, which are certainly regular CW complexes. Therefore, the condition that X be regular is not restrictive for what we need. Definition 2.2. Let X be a regular CW complex. A discrete vector field V on X is a collection of partially defined functions Vi : Ki → Ki+1 satisfying the following three conditions for each i: 1. Vi is injective; 2. the image of Vi is disjoint from the domain of Vi+1 ; 3. for any σ (i) in the domain of Vi , σ (i) is a face of Vi (σ (i) ). 6 ERIC RAMOS Given a regular CW complex X equipped with a discrete vector field V , a cellular path between two cells α(i) and β (i) is a finite sequence of i-cells (i) (i) (i) (i) α(i) = α0 , α1 , . . . , αl−1 , αl = β (i) (i) (i) such that αj+1 is a face of Vi (αj ). We say that the path is closed if α(i) = β (i) , and we say (i) (i) it is trivial if αj = αk for all j, k. A discrete vector field V is said to be a discrete gradient vector field if it admits no non-trivial closed cellular paths. If V is a discrete gradient vector field on a regular CW complex X, then we call a cell σ of X redundant if σ is in the domain of Vi for some i, collapsible if it is in the image of Vi for some i, and critical otherwise. Proposition 2.3 ([FS] Proposition 2.2, [Fo] Theorem 3.4). Let X be a regular CW complex equipped with a discrete gradient vector field V . Consider the filtration ∅ = X0′′ ⊆ X0′ ⊆ X1′′ ⊆ X1′ ⊆ . . . ⊆ Xn′′ ⊆ Xn′ ⊆ . . . where Xi′ is the i-skeleton of X with the redundant cells removed, and Xi′′ is the i-skeleton of X with both the redundant and critical cells removed. Then: 1. For any i, Xi′ is obtained from Xi′′ by attaching mi i-cells to Xn′′ along their boundaries, where mi is the number of critical i-cells of the discrete gradient vector field V . ′′ 2. For any i, Xi+1 deformation retracts onto Xi′ . The above proposition leads to one notable corollary, which we record now. Corollary 2.4 ([FS] Proposition 2.3, [Fo] Corollary 3.5). Let X be a regular CW complex equipped with a discrete gradient vector field V . Then X is homotopy equivalent to a CW complex with precisely mi i-cells for each i, where mi is the number of critical i-cells of V . Just as is the case with traditional Morse theory, the decomposition of the space X given by Corollary 2.4 can be used to compute the homology groups of X. For simplicity, we will state the construction for cubical complexes, although the general case is similar. Definition 2.5. Let X be a cubical complex, and write Ci (X) for the free abelian group of i-cells of X. If c ∼ = [0, 1], then we define = I1 × . . . × Ii is an i-cell of X, with Ij ∼ cjτ = I1 × . . . × Ij−1 × {0} × Ij+1 × . . . × Ii , cjι = I1 × . . . × Ij−1 × {1} × Ij+1 × . . . × Ii . This allows us to define a boundary morphism ∂ : Ci (X) → Ci−1 (X) given by ∂(c) := X j cjτ − cjι , STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 7 turning C• (X) into a chain complex. It is a well known fact that the homology of this chain complex is the usual homology of the space X. Further assume that X is equipped with a discrete gradient vector field V . Then we have a map R : Ci (X) → Ci (X) defined by   if c is collapsible 0 R(c) = c if c is critical  ±∂(V (c)) + c otherwise, i where the sign of ∂(Vi (c)) in the above definition is chosen so that c has a negative coefficient. The property that V has no non-trivial closed paths implies that Rm (c) = Rm+1 (c) for all m ≫ 0 and all i-cells c [Fo]. We set R∞ (c) to be this stable value. For each i, let Mi denote the free abelian group with basis indexed by the critical i-cells of V . Then the Morse complex associated to V is defined to be ∂e M• : . . . → Mn → . . . → M1 → M0 → 0, where boundary map ∂e is given by e := R∞ (∂(c)) ∂(c) The map ∂e is known as the Morse differential. Theorem 2.6 (Theorem 8.2 [Fo], Theorem 7.3 [Fo2]). For all i there are isomorphisms, Hi (X) ∼ = Hi (M• ) 2.2. The configuration spaces of graphs. In this section we review necessary facts about configuration spaces of graphs. In the next section, we will explain how the techniques of discrete Morse theory apply to these spaces. Definition 2.7. A graph is any compact, connected CW complex of dimension one. A tree is a topologically contractible graph. Given a graph G with vertex v, we will write µ(v) to denote the degree of the vertex v. Note that any loop on v contributes 2 to its degree count. We say that v is essential if µ(v) ≥ 3. If µ(v) = 1, we say that v is a boundary vertex, and the unique edge connected to v is called a boundary edge. The configuration space on n points of G is the topological space, Conf n (G) := {(x1 , . . . , xn ) ∈ Gn | xi 6= xj if i 6= j}. We note that there is a natural fixed-point-free action on Conf n (G) by the symmetric group Sn . The unordered configuration space on n points of G is the quotient space, UConf n (G) := Conf n (G)/Sn . 8 ERIC RAMOS For the majority of this paper, we will work with the spaces UConf n (G). Note that many of the structural theorems discussed in this section will apply to both spaces. In order to apply discrete Morse theory to questions about these configuration spaces, we will first need to place a CW complex structure on them. To accomplish this, we use a theorem of Abrams [A]. Definition 2.8. The discretized configuration space on n points over G, Dn (G), is the CW subcomplex of Gn spanned by cells of the form σ1 × . . . × σn where σi ⊆ G is a cell (i.e. an edge or vertex) of G, and σi ∩ σj = ∅ whenever i 6= j. We write UDn (G) to denote the quotient of Dn (G) by the action of the symmetric group. Theorem 2.9 ([A] Theorem 2.1, [KKP] Theorem 2.4, [PS]). Let G be a graph, and assume that G satisfies the following two properties: 1. each path connecting distinct vertices of degree 6= 2 has length at least n − 1; 2. each homotopically essential path connecting a vertex to itself has length at least n + 1. Then the inclusions Dn (G) ֒→ Conf n (G), and UDn (G) ֒→ UConf n (G) are homotopy equivalences. Remark 2.10. Note that in the first cited source, Abrams states the theorem assuming that each path connecting distinct vertices of degree 6= 2 has length at least n + 1. It is noted after the proof that the version of the theorem stated above is true, and a brief argument is given for how it is proven. In the second source, Kim, Ko, and Park give a formal argument for this improvement. In the third source, Prue and Scrimshaw provide a discrete Morse theory argument, which is independent of the first two sources. For our purposes, the exact number of vertices needed is unimportant, as we can always just subdivide the edges of G more if needed. Note that subdividing edges of a graph G does not impact the configuration spaces Conf n (G) and UConf n (G). For much of what follows, we will often just assume, without explicit mention, G is subdivided enough so that the homotopy equivalence of Theorem 2.9 holds. Theorem 2.9 implies that Conf n (G) and UConf n (G) are homotopy equivalent to cubical complexes of dimension n. In fact, we will be able to do better than this. Theorem 2.11 ([Gh] Theorem 3.3). Let G be a graph which is not homeomorphic to S 1 . Then Conf n (G) and UConf n (G) are homotopy equivalent to CW complexes of dimension NG , where NG is the number of essential vertices of G. Remark 2.12. If G is homeomorphic to S 1 , then UConf n (G) is easily seen to be homotopy equivalent to a circle for all n. Throughout this work, and the literature in general, it is a recurring theme that certain theorems only apply to graphs which are neither S 1 nor the interval. It is interesting to observe that these two graphs are precisely those which are STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 9 homeomorphic to compact manifolds. Note that Ghrist originally proved Theorem 2.11 using more classical topological means. We will later see it naturally falls out of the discrete Morse structure that Farley and Sabalka placed on UDn (G). This was first noted by Farley and Sabalka in [FS]. One remarkable thing to note about Ghrist’s theorem is that the dimension of the configuration spaces of graphs is independent of n. This behavior is in stark contrast to the behavior of configuration spaces of smooth manifolds of dimension ≥ 2. In his paper [Gh], Ghrist also proves that configuration spaces of graphs are, in fact, aspherical. This result was later reproven by Abrams [A, Theorem 3.10], where he shows that both Dn (G) and UDn (G) are universally covered by CAT(0) complexes. Theorem 2.13 ([Gh] Theorem 3.1, [A] Corollary 3.11). Let G be a graph. Then Conf n (G), and hence UConf n (G), are aspherical. That is to say, πk (Conf n (G)) = 0 for k > 1. Note that this theorem is analogous to that which says the configuration spaces of the plane are aspherical. In that case, the fundamental groups of the ordered and unordered spaces are the Artin pure braid groups, and the Artin braid groups, respectively. We borrow this terminology for our context as well. Definition 2.14. Let G be a graph. The braid group on n strands of G is defined to be Bn G := π1 (UConf n (G)). We similarly define the pure braid group on n strands as Pn G := π1 (Conf n (G)) The study of the braid groups of graphs is still a very active area of research. See [KKP][KP][FS2] for more on these groups. As an immediate corollary to Theorem 2.13, we obtain the following. Corollary 2.15. Let G be a graph. then there are isomorphisms Hi (Conf n (G)) ∼ = Hi (Pn G), Hi (UConf n (G)) ∼ = Hi (Bn G). The goal for this paper is to establish a methodology for understanding stability phenomena in the groups Hi (Bn G), in the spirit of modern trends of asymptotic algebra. Note that we will spend very little time considering pure braid groups. In fact, there doesn’t seem to be much literature about the homology of these groups, as they are vastly more complicated than the braid groups [KP][BF]. 10 ERIC RAMOS The following theorem of Farley exactly computes the homology groups when G is a tree. Theorem 2.16 ([Fa]). Let G be a tree. Then the group Hi (Bn G) is free for all n ≥ 0. Note that the theorem of [Fa] is slightly more general than this. We will discuss the more general version in later sections. Expanding upon the work of Farley, the following theorem of Ko and Park suggests that the tree case is indicative of a more general phenomenon. Theorem 2.17 ([KP] Theorem 3.6). Let G be a graph. Then G is planar if and only if H1 (Bn G) is torsion free for any, and therefore all, n ≥ 2. Moreover, in the case where G is not planar, all torsion is 2-torsion. Kim, Ko, and Park proved that G is planar if and only if H1 (B2 G, Z) is torsion free in [KKP, Theorem 5.5]. It is also conjectured in that work that Theorem 2.17 is true. It should be noted that [KP, Theorem 3.6] is far stronger than what we have written above. In fact, their result explicitly computes the groups H1 (Bn G, Z) in terms of combinatorial invariants of the graph G. It follows from their computation that the amount 2-torsion of the group is unvarying in n. Moreover, if G is biconnected - that is, G requires the removal of at least 2 vertices to disconnect it - then H1 (Bn G, Z) ∼ = H1 (B2 G, Z) for all n ≥ 2 [KP, Lemma 3.12]. In the final section of this paper we will conjecture an extension of this fact to the higher homologies (see Conjecture 4.3). To finish this section, we record a result of Gal on the Euler characteristic of these spaces. Note that Gal proves a more general theorem for computing the Euler characteristic of the configuration space of any simplicial complex. Theorem 2.18 ([Ga] Theorem 2). Let G be a graph, and set X χ(Conf n (G)) e(t) := tn . n! n≥0 Then, e(t) = where E is the number of edges of G. Q v (1 − (1 − µ(v))t) (1 − t)E Remark 2.19. Conf n (G) is an n!-fold cover of UConf n (G). It follows from this that the above formula can be easily used to compute the Euler characteristic of UConf n (G) as well. Definition 2.20. Let G be a graph which has at least one essential vertex, and let E denote the set of essential vertices of G. Then an essential edge of G is a connected component of G − E. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 11 Corollary 2.21. Let G be a graph with at least one essential vertex, and let E denote the number of essential edges of G. Then there is a polynomial P of degree E − 1, for all n ≥ 0, such that the function n 7→ χ(UConf n (G)) is equal P (n). Proof We first note that smoothing the degree 2 vertices of G does not impact the spaces UConf n (G). We may therefore assume without loss of generality that G does not have any such vertices. In this case, the Euler characteristic χ(UConf n (G)) is the coefficient of tn in the power series expansion of Q v essential (1 − (1 − µ(v)t)) (1 − t)E A straight forward enumerative combinatorics argument implies that the n-th coefficient of the power series expansion of this expression is a polynomial of degree exactly E − 1 for n sufficiently large. It remains to show that this agreement begins at n = 0. Assume that G has NG essential vertices. It is a standard fact from enumerative combinatorics that the coefficients of the power series expansion of a rational function of the form f (x) will agree with a polynomial for all n so long as deg(f ) < l. This is the case in our (1−t)l specific instance, so long as NG > 1.  Theorem 2.18 was largely the inspiration for this work. It suggests that the asymptotically the Betti numbers of Hi (Bn G) are polynomial. In this work we will prove this suggestion in the case where G is a tree. We will also provide a setup in the case where G is a general graph, which hopefully will be able to illustrate this behavior in that case as well. 2.3. The discrete Morse theory of UConf n (G). In this section we will outline the discrete Morse structure on UConf n (G) developed in the work of Farley and Sabalka [FS]. We begin by fixing n, and assuming the graph G is sufficiently subdivided for Theorem 2.9 to hold for UConf n (G). Fix a spanning tree T for G, as well as an embedding of T into the plane. We will label the vertices of T by applying a depth-first search. Concretely, begin by choosing a boundary vertex v0 to be the root of T , and label it with the number 0. Continue down the boundary edge adjacent to v0 , labeling any vertices encountered along the way with increasing labels. If at any point an essential vertex is encountered, then travel down the leftmost - relative to the current direction of travel - edge whose vertices have not been labeled. If a boundary vertex is encountered, then one returns to the most recently passed essential vertex. An example of a correctly labeled tree is given in Figure 1. For the remainder of this section, G and T will be as in the previous paragraphs. As before we will write K to denote the set of cells of UConf n (G), while Ki will denote the set of i-cells of UConf n (G). Definition 2.22. Given an edge e of G, we write ι(e) to denote its largest, with respect to the given labeling, vertex, and τ (e) to denote its smallest vertex. If v is a vertex of G, which is not v0 , then we write e(v) to denote the unique edge of T for which ι(e(v)) = v. We note 12 ERIC RAMOS 0 1 6 5 4 3 7 8 2 9 10 Figure 1. A tree which is properly labeled. Note that this tree is also sufficiently subdivided to apply Theorem 2.9 with n = 3. that e(v) will be the first edge on the unique path within T from v to v0 . Let c = {vj1 , . . . , vjn−i , er1 , . . . , eri } be an i-cell of UDn (G). If 6 ∅, τ (e(vj )) ∩ {vj1 , . . . , vjn−i , ι(er1 ), τ (er1 ), . . . , ι(eri ), τ (eri )} = then we say that vj is blocked in c. Note that by convention v0 is always blocked. We define a partial function Vi : Ki → Ki+1 inductively in the following way. Given an i-cell c = {vj1 , . . . , vjn−i , er1 , . . . , eri }, assume without loss of generality that vj1 is an unblocked vertex of c which is smallest with respect to the labeling of T . Assuming that c is not in the image of Vi−1 , we set Vi ({vj1 , . . . , vjn−i , er1 , . . . , eri }) := {vj2 , . . . , vjn−i , er1 , . . . , eri , e(vj1 ))} If c does not have any unblocked vertices, or if c is in the image of Vi−1 , then Vi (c) is undefined. Theorem 2.23 ([FS] Sections 3.1 and 3.2). The collection of partial functions Vi : Ki → Ki+1 form a discrete gradient vector field on UDn (G). While the spaces UConf n (G) can be high dimensional, we can still visualize their cells. Indeed, it is often useful to think of the cells of UConf n (G) as being subsets of edges and vertices of the graph G itself. In Figure 2 we see examples of a critical, a collapsible, and a redundant 1-cell of V, where G is taken to be the tree in Figure 1 and n = 3. In these examples, the cell {v0 , v1 , e9,10 } is collapsible, as {v0 , v1 , e9,10 } = V0 ({v0 , v1 , v10 }), and v10 is the smallest unblocked vertex. The cell {v1 , v5 , e4,7 } is redundant, as v1 is not blocked, and it is not in the image of V0 . Indeed, the only cell that could possibly map to it would be {v1 , v5 , v7 }. However, in this case v1 is the smallest unblocked vertex. Finally, the cell {v0 , v5 , e4,7 } is critical, as its every vertex is blocked, and it is not collapsible. From these examples, one can imagine there existing a way to classify all cells of the three types. To write down such a classification, we first need a bit of nomenclature. Definition 2.24. Let c = {vj1 , . . . , vjn−i , er1 , . . . , eri } be an i-cell of UDn (G). We say that an edge e ∈ c is order respecting in c if e is in T , and for all v ∈ c such that τ (e(v)) = τ (e), the label of v in T is larger than the label of ι(e). STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 0 1 6 5 4 3 9 10 7 8 2 0 1 6 5 4 3 9 10 7 8 2 0 1 6 5 4 3 13 7 8 2 9 10 Figure 2. The critical 1-cell {v0 , v5 , e4,7 }, the collapsible 1-cell {v0 , v1 , e9,10 }, and the redundant 1-cell {v1 , v5 , e4,7 }, respectively. Remark 2.25. Note that edges e ∈ G−T - which we call deleted edges - are, by definition, never order respecting. Theorem 2.26 (The Classification Theorem, [FS] Theorem 3.6). Let c be a cell of UDn (G), and let T be a choice of spanning tree of G equipped with a planar embedding. Then: 1. c is critical if and only if it contains no order respecting edges and all of its vertices are blocked; 2. c is redundant if and only if (a) it contains no order respecting edges and at least one of its vertices is unblocked or, (b) it contains an order respecting edge (and thus a minimal order respecting edge e) and there is some unblocked vertex v such that the label of v in T is less than that of ι(e); 3. c is collapsible if and only if it contains an order respecting edge (and thus a minimal order respecting edge e) and, for any vertex v such that the label of v in T is less than that of ι(e), v is blocked. It is not hard to check that the previous examples satisfy the conditions of the Classification Theorem. One useful fact about the discrete gradient vector field V is that its critical cells are, in some sense, the most restrictive of the three possible types. Indeed, we may expand upon the classification of critical cells in the following way. Lemma 2.27. Let c = {vj1 , . . . , vjn−i , er1 , . . . , eri } be a critical i-cell of V . 1. For each k in {1, . . . , i}, either erk is a deleted edge, or τ (erk ) is an essential vertex of T. 2. Let c′ be a critical i-cell with edges er1 , . . . , eri , such that the number of its vertices in each component of T − {er1 , . . . , eri } agrees with the number of vertices of c in these same components. Then, c = c′ . Proof For the first statement, let e be an edge of c which is not deleted. If τ (e) = v0 , then it is clear that e is order respecting. We note that τ (e) is not a boundary vertex in any other case by how the labeling on T was defined. It therefore remains to show that τ (e) does not have degree 2. Indeed, if this were the case, then for any vertex v of G, τ (e(v)) 6= τ (e). In 14 ERIC RAMOS particular, e must be order preserving. This proves the first claim. For the second claim, one uses the fact that the vertices of c must all be blocked.  Note that the observations made in the above lemma were originally pointed out by Farley and Sabalka when they defined the vector field V [FS, Section 3.3]. We collected these observations in Lemma 2.27 so that they could be easily referred back to during future sections. We will find that this lemma is critical in defining the polynomial ring structure on L n Hi (Bn G). In the next section, we will find that the deleted edges of G can be chosen so that they remain unchanged as n increases and we repeatedly subdivide the graph. The above lemma also suggests that those edges of critical cells contained in the tree T are unchanging in n. While this is not literally the case, as all edges of T are being subdivided as n increases, Lemma 2.27 tells us that the important information encoded by such an edge is the essential vertex of its tail, as well as the direction it is leaving this essential vertex. For this reason we will often be a bit loose with our language and claim that two critical cells with different choices of n have the “same” edges. Definition 2.28. Let c be a critical cell of the discrete gradient vector field, and let e ∈ T be an edge in c. The classification theorem implies that there must exist some vertex v ∈ c such that the label of v in T is smaller than that of ι(e), while τ (e(v)) = τ (e). We refer to such a vertex as a witness for e in c. If v is the only witness for e in c, then we say v is necessary. 3. The proof Theorem A 3.1. The setup. We use this section to fix the notation which will be used throughout the proofs of the main theorems. Note that all of the constructions presented in the previous sections were already well established in the literature prior to this work. To the knowledge of the author, the main construction of the following sections - namely the action of SG on the critical cells of UConf n (G) - does not appear elsewhere in the literature. As was the case in all previous sections, let G denote a graph, which is neither a circle nor a line segment. We will reserve E to denote the number of essential edges of G, while NG will denote the number of essential vertices of G. Next, we must construct our spanning tree T , as in Section 2.3. To do this, we first subdivide every edge of G, which connects two essential vertices, once. Note that this includes any loops of G. Once this is done, we choose a spanning tree T of G which satisfies the following: (3.1) Every edge of G not in T is adjacent to an essential vertex of G. Note that it is not entirely obvious that such a T exists for an arbitrary graph G. This fact was proven by Farley and Sabalka during the proof of [FS, Theorem 4.4]. Remark 3.1. It is noted by Farley and Sabalka that if one chooses T to satisfy (3.1), then Lemma 2.27 and Corollary 2.4 imply Theorem 2.11. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 15 Having chosen our spanning tree T to satisfy (3.1), we observe that for n ≥ 2, we can sufficiently subdivide G for Theorem 2.9 by subdividing T . This follows from the fact that we began by subdividing all edges of G which connected essential vertices. We will often not differentiate the spanning trees chosen for each n for this very reason. 3.2. The modules Mi,• . Recall from Section 2.1 the Morse complex . . . → Mi → . . . → M1 → M0 → 0 where Mi is the free Z-module with basis indexed by critical cells. In our case, we write Mi,n to denote the free Z-module with basis indexed by the critical cells of the Farley-Sabalka discrete gradient vector field of UDn (G). Let e1 , . . . , eE denote the essential edges of the graph G. Then we set SG := Z[xe1 , . . . , xeE ] Our goal for the remainder of this section will be to argue, for each i, that Mi,• has the structure of a finitely generated graded SG -module. Definition 3.2. Fix i and n, and let e denote an essential edge of G. Given a critical i-cell c = {vj1 , . . . , vjn−i , er1 , . . . , eri } of UDn (G), we define xe · c to be the unique critical i-cell of UDn (G) obtained from c by adding a vertex to the connected component of T −{er1 , . . . , eri } containing e. More precisely, xe · c is obtained from c by adding the smallest vertex on the connected component containing e. This is well defined by Lemma 2.27, as well as the choice of the tree T , as T will contain a unique representative of each essential edge of G by construction. This turns the collection {Mi,n }n into a graded SG -module, which we denote Mi,• . One can visualize the action of SG described in the above definition in the following way. The labeling on T induces a natural flow on T . Namely, all edges flow towards the root of T . Let c = {vj1 , . . . , vjn−i , er1 , . . . , eri } be a critical cell. We imagine the vertices vj as being particles drifting in the direction of the flow, while the edges ej , along with their endpoints, are stationary blockades. For any essential edge e, the action of xe on c involves placing a new particle somewhere on e, and allowing it to flow until it too is blocked. We provide an illustration of the action of SG in Figure 3. Lemma 3.3. For each i, the module Mi,• is finitely generated over SG . Proof We claim that every critical cell in Mi,n , with n > 2i, can be obtained from a critical cell in Mi,n−1 . Indeed, if c is a critical cell in Mi,n , then at least one vertex is not a necessary witness of some edge in e. Remove the vertex, among those which are not necessary witness vertices, which occupies the maximal position with respect to the labeling on T . Removing this vertex leaves us with a critical cell c′ in Mi,n−1, as this removal cannot create unblocked vertices nor order respecting edges. It follows that c is the image of c′ under the action of the appropriate essential edge.  16 ERIC RAMOS 0 1 6 5 4 3 9 10 7 8 2 0 1 2 9 8 7 6 5 4 10 11 12 3 13 14 15 Figure 3. An illustration of multiplication by xe , where e is the essential edge containing the boundary vertex v6 of the tree G of Figure 1. Remark 3.4. It follows from the above lemma that the number of critical i-cells grows, as a function of n, like a polynomial of degree ≤ E − 1. In fact, if i < NG , we claim that this polynomial must have degree strictly less than E − 1. First, we note that the action of SG on a critical cell c does not affect the edges of c. Because of this it follows that Mi,• can be expressed as a direct sum of graded SG -modules, where each summand corresponds to a choice of edges in our critical i-cell. For any fixed critical i-cell c, one observes that two variables xe and xe′ will act identically whenever e and e′ are on the same connected component of G with the edges of c removed. It follows that the summand of Mi,• containing this cell has Hilbert polynomial of degree strictly less than E whenever i < NG . The Hilbert polynomial of the whole of Mi,• is a sum of such polynomials, and therefore also has degree strictly less than E. This will be used in the final section of the paper. Lemma 3.3, and Theorem 2.6 now imply some asymptotic data about the homology groups Hi (Bn G). Theorem 3.5. Let G be a graph with E essential edges. Then for all i ≥ 0, there exists a polynomial Pi ∈ Q[t], such that for all n ≫ i dimQ (Hi (Bn G; Q)) ≤ Pi (n). 3.3. The case of trees. In this section, we begin to explore the specific case where G is a tree. The work of Farley [Fa] will allow us to conclude quite a bit more than we are able to in the general case. To begin with, we state a refined version of Theorem 2.16. Theorem 3.6 ([Fa]). Let G be a tree. Then for each n the Morse complex Mi,n has trivial differential. In particular, Hi ∼ = Mi,• , as SG -modules, where Hi is the module of Theorem C. To state our main stability theorem, we begin with the following definition. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 17 Definition 3.7. Let G be a tree. Then we define the quantity ∆iG := max {dimQ (H0 (G − {vj1 , . . . , vji }; Q))}. {{vj1 ,...,vji }|vjk essential} G For example, ∆1G is the maximum degree of G, while ∆N is E, the number of essential G 0 i edges. By convention, ∆G = 1 while ∆G = 0 for i > NG . Theorem 3.8. Let G be a tree, and fix i ≥ 0. Then the Betti number bi (n) := dimQ (Hi (Bn (G); Q)) is equal to a polynomial of degree ∆iG − 1 for n ≫ i. Proof The Theorem 3.6 and the work of the previous sections imply that bi (n) is eventually a polynomial; it remains only to show that this polynomial has the claimed degree. We begin by partitioning the basis vectors of Mi,n according to the collection of edges which appear. The action of SG does not impact the edges, and so each of these partitions will correspond to a summand of Mi,n . Moreover, considering any one of these summands, we observe that the variables induce at most ∆iG distinct operators on Mi,n . It follows that the degree of the Hilbert polynomial of Mi,• is at most ∆iG − 1. To finish the proof, we will show that Mi,• has a summand whose Hilbert polynomial has degree ∆iG − 1. Fix the i essential vertices of G whose absence realizes the maximum in Definition 3.7. For each essential vertex in this fixed list, let e be an edge adjacent to it in the second leftmost direction, relative to the direction of the root. Note that any critical cell containing these edges has a unique essential edge which can house a witness vertex. There is therefore a critical i-cell in Mi,2i constructed by choosing each of these edges, along with the unique witness vertex for each. Denote this cell by c. The submodule generated by c is a summand of Mi,• . We claim that this submodule our desired summand. Any i-cell of Mi,n which shares the same edges of c - i.e. those basis vectors in the n-th graded piece of SG · c - is entirely determined by distributing n − 2i vertices to one of ∆iG components. Thus,   n − 2i + ∆iG − 1 . rankZ ((SG · c)n ) = ∆iG − 1 as desired.  The only piece of Theorem A which remains to be proven is in showing that bi (n) agrees with a polynomial for all n ≥ 0. To accomplish this, we must first prove Theorem D. As a first simplification, we note that our answer is unaffected by changing basis to Q, and may therefore assume we are working over a rational polynomial ring. This grants us access to many classical approaches to solving the problem. We will also make heavy use of the direct sum decomposition of Mi,• described in the proof of Theorem 3.8. Definition 3.9. Let G be a tree. The notation v := (vj1 , . . . , vji ) 18 ERIC RAMOS will always refer to an i-tuple of essential vertices of G, appearing in the order induced by the labeling on G. We write µ(v) to denote the number of connected components of G − {vj1 , . . . , vji }. Given v, let l := (l1 , . . . , li ) denote an i-tuple of positive integers such that 1 ≤ lk ≤ µ(vjk ) − 2 for all k. We will also set X |l| := lk . k Given a pair (v, l), we associate to it the summand of Mi,• ⊗Z Q generated in degree 2i by critical cells c satisfying the following two properties: 1. If e ∈ c is an edge, then τ (e) = vjk for some k, and; 2. if e ∈ c has τ (e) = vjk , then there are precisely lk essential edges which can house witness vertices of e. Note that these two pieces of data uniquely determine the edges which are allowed to appear in cells which form the bases for the graded pieces of the summand. Denote this summand by N (v,l) . We observe that two variables xe1 , xe2 of SG act identically on N (v,l) if and only if e1 and e2 are contained in the same connected component of G − {vj1 , . . . , vji }. Let S (v,l) denote the quotient of SG ⊗Z Q by xe2 − xe2 . In particular, S (v,l) is isomorphic to a rational polynomial ring in µ(v) variables, and N (v,l) is a finitely generated graded module over S (v,l) . Remark 3.10. If i = 0, then v and l are empty tuples with µ(v) = 1. If i > NG , then by convention N (v,l) = 0. next goal will be to show that the Hilbert function n 7→ dimQ (N (v,l) ) agrees with a polynomial for all n. Note that we already know that this Hilbert function is a polynomial for n sufficiently large, and must only show that this agreement is the case for all n. This will imply the same about the Hilbert function for Mi,•. We accomplish this through the computations in the next section, although we spend time now to set some ground work in this direction. Following this, we will explicitly compute this Hilbert polynomial. We begin with the following. Proposition 3.11. The module N (v,l) (i) is isomorphic to a squarefree monomial ideal of S (v,l) . Proof We recall that a monomial ideal is called squarefree, if it is generated by monomials, none of which are divisible by a square. (v,l) By definition, N (v,l) (i)i = N2i is spanned by critical cells containing the edges e1 , . . . , ei determined by the pair (v, l) (see Definition 3.9), along with a single witness vertex for each. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 19 To define a map φ : N (v,l) (i) → S (v,l) , it suffices to specify where each of these cells is mapped. We set for any such cell c Y (3.2) φ(c) = xe , e where the product is over essential edges containing a witness vertex of c. Note that it is impossible for a single essential edge to house a witness vertex for multiple edges, and so the above monomial is indeed squarefree. Extending this map through the action of S (v,l) defines our desired isomorphism.  Squarefree monomial ideals are some of the most well understood objects in commutative algebra. They are also the subject of the so-called Stanley-Reisner theory (see [MS] for a comprehensive reference on the subject). 3.4. Computing the Hilbert polynomial. We note that for i = 1, the polynomial describing the Betti number b1 (n) has been explicitly computed in terms of invariants of the tree G. Indeed, this follows from the structure theorem of Ko, and Park [KP, Theorem 3.6], and also from the work of Farley and Sabalka [FS]. The Hilbert polynomial has also been computed for all i in the case where G is a tree with maximal degree 3 by Farley [Fa]. Aside from these cases, no explicit description of the polynomial is known. That being said, the work in this paper implies that computing this polynomial is no more difficult than computing the Hilbert polynomials of some squarefree monomial ideals. In other words, for any tree G, the work of this paper reduces the task of computing Hi (Bn G) for all n to a finite computation. We will proceed with this computation in this section. Remark 3.12. Proposition 3.11 reveals that the monomial ideals which appear as graded shifts of summands of Hi are quite simple. Because of this, we will find that the computation of the Hilbert polynomial of Hi falls more in the realm of enumerative combinatorics rather than Stanley-Reisner theory. It is likely that studying the cases of more general graphs will require more robust commutative algebra, and we therefore proceed with the case that G is a tree using that language. Our hope is that once the case of general graphs is completed, this will aid in creating a uniform means of approaching asymptotic behaviors in the configuration spaces of graphs. In this section we will use the decomposition of Proposition 3.11 to compute the Hilbert polynomial of Mi,•. Proposition 3.11 implies that N (v,l) (i) is isomorphic to a squarefree monomial ideal of S (v,l) . To ease computations, we reorder the variables of S (v,l) to satisfy the following. Begin by labeling the essential edges adjacent to vj1 which house witness vertices by x1 through xl1 , chosen in the order induced by our ordering of the vertices of G. Next, label the essential edges housing a witness vertex adjacent to vj2 with the variables xl1 +1 to xl1 +l2 , using the same rule. Continue in this fashion until |l| essential edges have been labeled. We then use the remaining variables to label the final µ(v) − |l| essential edges, chosen in any order. Our first observation is the following. 20 ERIC RAMOS Lemma 3.13. There is an isomorphism of S (v,l) -modules, N (v,l) (i) ∼ = (x1 , . . . , xl1 )⊗Q (xl1 +1 , . . . , xl1 +l2 )⊗Q . . .⊗Q (xPi−1 lj +1 , . . . , x|l| )⊗Q Q[x|l|+1 , . . . , xµ(v) ], j=1 where (x1 , . . . , xl1 ) is considered as a module over Q[x1 , . . . , xl1 ], (xl1 +1 , . . . , xl1 +l2 ) a module over Q[xl1 +1 , . . . , xl1 +l2 ], and so on. Proof Follows immediately from the isomorphism (3.2).  Definition 3.14. The Hilbert series associated to the module N (v,l) is the formal power series X H(v,l) (t) := (dimQ Nn(v,l) )tn . n≥0 Our next goal will be to express H(v,l) (t) as a rational function in t. From here standard enumerative combinatorics will allow us to compute the Hilbert polynomial. Proposition 3.15. The Hilbert series H(v,l) (t) can be expressed as the rational function, Q ti j (1 − (1 − t)lj ) . H(v,l) (t) = (1 − t)µ(v) Proof We will prove this using the fact that the Hilbert series is multiplicative over tensor products. It is easy to see that the Hilbert series for the augmentation ideal of a rational polynomial ring in d variables is equal to the rational function 1 1 − (1 − t)d − 1 = . (1 − t)d (1 − t)d Lemma 3.13 therefore implies i H(v,l) (t) = t Y 1 − (1 − t)lj j (1 − t)lj ! 1 (1 − t)µ(v)−|l|  = ti Q − (1 − t)lj ) , (1 − t)µ(v) j (1 where the factor ti arises from the graded shift of N (v,l) .  This will allow us to prove our result on the obstruction to the Hilbert polynomial of Mi,• . Corollary 3.16. Let G be a tree, and fix i ≥ 0. Then the dimension of Mi,n ⊗Z Q agrees with a polynomial for all n ≥ 0. STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 21 Proof It suffices to prove the claim for the summands N (v,l) . Proposition 3.15 tells us that the Hilbert series of N (v,l) takes the form Q ti j (1 − (1 − t)lj ) . (1 − t)µ(v) The 2.21 implies that it suffices to show the total degree of the numerator Q proof of Corollary i lj t j (1 − (1 − t) ) is strictly smaller than µ(v). Namely, we must argue i + |l| < µ(v) This follows from the fact that each essential vertex of v, say vjk , is adjacent to at least one essential edge which can never house a witness vertex. Namely, the essential edge which is maximal among all essential edges adjacent to vjk with respect to the ordering of the vertices of G. Moreover, the essential edge containing the root can never house a witness vertex for any essential vertex. Put another way, i + |l| ≤ i + X (µ(vjk ) − 2) = i + µ(v) − i − 1 = µ(v) − 1. k This concludes the proof.  We have now proven enough to explicitly compute the Hilbert polynomial of Mi,• , and consequently Hi (Bn G). The following theorem follows from the results of this section, as well as the combinatorics of generating functions. Theorem 3.17. Let G be a tree, fix i, r ≥ 0, and for any pair (v, l) write     X li (v,l) r+i l1 . ··· ai,r := (−1) di d1 d1 +...+di =r dj ≥1 Also let Piv (n) be the polynomial Piv (n)   µ(v) − 1 + n − i . = µ(v) − 1 Then for all n ≥ 0, the dimension of Hi (Bn , Q) is equal to the polynomial (3.3) |l| XX (v,l) ai,r Piv (n − r). (v,l) r=i Remark 3.18. One observes from the above formulation that the polynomial Piv (n), as well (v,l) as the constants ai,r , only depend on the degree sequence of the graph G. It follows that the homologies of the braid group of a tree only depends on its degree sequence, as we recorded in Corollary B Specializing Theorem 3.17 to the case wherein i = 1 yields a much simpler form. 22 ERIC RAMOS Corollary 3.19. Let G be a tree. Then for all n ≥ 0, the dimension of H1 (Bn G, Q) agrees with the polynomial X µ(v) − 2 + n µ(v) − 2 + n − l X µ(v)−2 . − µ(v) − 1 − l µ(v) − 1 v essential l=1 Proof In this case we note that for an essential vertex v, and a chosen integer 0 ≤ l ≤ µ(v) − 2, we have   v,l r+1 l . a1,r = (−1) r Therefore the polynomial (3.3) can be written    l X X X µ(v)−2 µ(v) − 2 + n − r r+1 l . (−1) µ(v) − 1 r v essential l=1 r=1 Using the principle of inclusion-exclusion, it can be seen that        l X µ(v) − 2 + n − l µ(v) − 2 + n µ(v) − 2 + n − r r+1 l , − = (−1) µ(v) − 1 − l µ(v) − 1 µ(v) − 1 r r=1 as desired.  A result of this kind appears in the work of Farley and Sabalka, where they compute the number of generators of the group Bn G [FS]. A formula for the case i = 1 is also found in the results of Ko and Park [KP]. Another simple case is that in which every essential vertex of G has degree 3. In this case Theorem 3.17 can be used to recover the following result of Farley [Fa]. Corollary 3.20. Let G be a tree whose every essential vertex has degree 3. Then for all n ≥ 0, the dimension of Hi (Bn G; Q) agrees with the polynomial    n NG 2i i Proof The major thing to note in this case is that for any v, the only associated vector l is (1, . . . , 1). Therefore, ( 1 if r = i (v,l) ai,r = 0 otherwise. The formula (3.3) now becomes            n NG 2i + 1 − 1 + n − 2i µ(v) − 1 + n − 2i NG NG NG v . = = Pi (n−i) = 2i i 2i i i µ(v) − 1 i This completes the proof.  STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 23 4. Concluding remarks In this section we consider what this work implies for the homology of graph braid groups when G is a general graph rather than a tree. Let G be a graph with NG essential vertices, and E essential edges. Also assume that G is homeomorphic to neither S 1 nor a line segment. Then the work of Section 3.2 implies that Mi,• carries the structure of a finitely generated SG -module. If G is not a tree, however, it is no longer the case that the Morse differential is trivial. We therefore pose the following question. Question 1. Does the action of SG on Mi,• commute with the Morse differential? In other words, is the Morse differential a morphism of graded SG -modules? We note that altering our choice of spanning tree T has a non-trivial influence on the Morse differential. It is therefore unclear whether the Morse differential will commute with the action of SG for all choices of T . We therefore refine Question 1 as follows. Question 2. Does there exist a choice of spanning tree T of G such that the action of SG on Mi,• commutes with the Morse differential? If the answer to these questions is affirmative, then we can immediately conclude many things about the asymptotic behavior of these homology groups. Indeed, in this case the Hilbert basis theorem would imply that there is a finitely generated SG -module Hi such that (Hi )n ∼ = Hi (Bn G). Corollary 4.1. Assume that Questions 1 and 2 have an affirmative answer. For each i, n write M M (Z/pj Z)mp,i,j (n) . Hi (Bn G) ∼ = Zbi (n) ⊕ p prime j≥1 Then: 1. there exists a polynomial Pi (t) ∈ Q[t] of degree ≤ E − 1 such that Pi (n) = bi (n) for all n ≫ 0; 2. there exists a positive integer ei , independent of n, such that the exponent of Hi (Bn G) is at most ei ; 3. for each prime p and each positive integer j, there is a polynomial Pi,pj (t) ∈ Q[t] such that Pi,pj (n) = mp,i,j (n) for n ≫ 0. In particular, there is a finite set of primes pi,1 , . . . , pi,l , and polynomials mi,pj (n) such that the order of the torsion subgroup of mpi,1 (n) Hi (Bn G) is precisely p1 mpi,l (n) · · · pl . Proof Follows from standard facts in the study of graded modules over integral polynomial rings.  The work of Ko and Park [KP, Theorem 3.6] that H1 (Bn G) has a torsion subgroup annihilated by 2, and that the multiplicity of this torsion is eventually constant in n. Their work also implies that the rank of H1 (Bn G) will be constant whenever G is sufficiently connected. In contrast to this, affirmative answers to Questions 1 and 2 imply that the top homology of Bn G always grows as fast as possible. 24 ERIC RAMOS Theorem 4.2. Assume that Questions 1 and 2 have an affirmative answer. Then the Hilbert function n 7→ dimQ (HNG (Bn G; Q)) is equal to a polynomial of degree E − 1 for n ≫ 0. Proof Theorem 2.21 implies that the Euler characteristic of UConf n (G) is a polynomial of degree E − 1. On the other hand, Remark 3.4 implies the lower homology groups have Hilbert functions which grow strictly slower than this. It follows that the rank of HNG (Bn G) must eventually grow like a polynomial of degree E − 1.  Note that Theorem 2.6 implies that HNG (Bn G) is torsion-free. We have therefore seen that H1 (Bn G) can only have 2 torsion, while the top homology HNG (Bn G) does not have any torsion. It is an interesting question to ask what other types of torsion can appear in the intermediate homologies. While an affirmative answer to Questions 1 and 2 would be a step in the right direction, the work of Ko and Park [KP] would suggest that the action of SG on Mi,• described in Section 3.2 is perhaps non-optimal. We have already discussed that the result [KP, Theorem 3.6] implies that the braid groups of biconnected graphs have eventually constant first homologies. However, the action of SG defined in Section 3.2 only detects the connectivity a chosen spanning tree of G. In particular, is it possible that one can improve on this action by accounting for connectivity granted by the deleted edges? Question 3. Let G be a graph which is neither a circle, nor a line segment. Does there exist an action of SG on Mi,• which interacts in a non-trivial way with the deleted edges of G? More specifically, can one define this action so that if c is a critical i-cell, then there is a Z-linear relation between xe1 · c and xe2 · c whenever the two essential edges e1 and e2 are in the same connected component of G with the edges of c removed? The existence of such an action would actually suggest something quite strong about what kind of invariants of G are encoded by the homology of its braid groups. If G is a graph, recall that we define ∆iG to be the maximum number of connected components G can be broken into by removing exactly i-vertices. Conjecture 4.3. Let G be a graph which is neither a line segment, nor a circle. Then for all i, and all n ≫ i, the Betti number bi (n) := dimQ (Hi (Bn G; Q)) agrees with a polynomial of degree ≤ ∆iG − 1. Note that Theorem 4.2 is a specific case of this conjecture. Also note, if G is biconnected, then the above implies that b1 (n) is eventually constant. This fact is proven in the work of Ko and Park [KP, Theorem 3.6]. The above conjecture therefore proposes a generalization of one aspect of that work. Finally, we think about the ramifications of this work on the spaces UConf n (G). The action of SG on Mi,• is defined in a purely formal way. However, in the study of more classical STABILITY PHENOMENA IN THE HOMOLOGY OF TREE BRAID GROUPS 25 configuration spaces, stability phenomena often arise from maps on the underlying spaces UConf n (G) → UConf n+1 (G) (see, for instance, [EW-G] and [McD]). Is that also the case here? Question 4. If G is a tree, is the action of SG on Mi,• induced by a map of topological spaces UConf n (G) → UConf n+1 (G)? If G is a general graph, and Questions 1 and 2 have affirmative answers, is the action of SG on the homologies of Bn G induced in a similar way? Of course, Question 4 is highly relevant for Questions 1 and 2. If one understands the action of SG topologically, then it might make the existence of such an action on the homologies of general graph braid groups more apparent. References [A] A. Abrams, Configuration spaces and braid groups of graphs, Ph.D thesis, home.wlu.edu/~abramsa/publications/thesis.ps. [BF] K. Barnett and M. Farber, Topology of configuration space of two particles on a graph, I, Algebr. Geom. Topol. 9(1) (2009), 593624. arXiv:0903.2180. [CEF] T. Church, J. S. Ellenberg and B. Farb, FI-modules and stability for representations of symmetric groups, Duke Math. J. 164, no. 9 (2015), 1833-1910. [EW-G] J. S. Ellenberg and J. D. Wiltshire-Gordon, Algebraic structures on cohomology of configuration spaces of manifolds with flows, arXiv:1508.02430. [Fa] D. Farley, Homology of tree braid groups, Topological and asymptotic aspects of group theory, 101-112, Contemp. Math., 394, Amer. Math. Soc., Providence, RI, 2006. http://www.users.miamioh.edu/farleyds/grghom.pdf. [Fo] R. Forman, Morse theory for cell complexes, Adv. in Math. 134 (1998), pp. 90-145. [Fo2] R. Forman, A user’s guide to discrete Morse theory, Séminaire Lotharingien de Combinatoire 48 (2002), 35 p. http://www.emis.de/journals/SLC/wpapers/s48forman.pdf. [FS] D. Farley and L. Sabalka, Discrete Morse theory and graph braid groups, Algebr. Geom. Topol. 5 (2005), 1075-1109 (electronic). http://www.users.miamioh.edu/farleyds/FS1.pdf. [FS2] D. Farley and L. Sabalka, Presentations of graph braid groups, Forum Math. 24 (2012), no. 4, 827-859. http://www.users.miamioh.edu/farleyds/FS3final.pdf. [Gh] R. Ghrist, Configuration spaces and braid groups on graphs in robotics, Knots, braids, and mapping class groups - papers dedicated to Joan S. Birman (New York, 1998), AMS/IP Stud. Adv. Math., 24, Amer. Math. Soc., Providence, RI (2001), 2940. https://www.math.upenn.edu/~ghrist/preprints/birman.pdf. [Ga] S. R. Gal, Euler characteristic of the configuration space of a complex, Colloq. Math. 89 (2001), 61-67. http://arxiv.org/pdf/math/0202143v1.pdf. [KKP] J. H. Kim, K. H. Ko, and H. W. Park, Graph braid groups and right-angled Artin groups, Trans. Amer. Math. Soc. 364 (2012), 309-360. arXiv:0805.0082. [KP] K. H. Ko, and H. W. Park, Characteristics of graph braid groups, Discrete Comput Geom (2012) 48: 915. arXiv:1101.2648. [L] D. Lütgehetmann, Configuration spaaces of graphs, Masters Thesis, http://luetge.userpage.fu-berlin.de/pdfs/masters-thesis-luetgehetmann.pdf. [McD] D. McDuff, Configuration spaces of positive and negative particles, Topology, Volume 14, Issue 1, March 1975, Pages 91-107. [MS] E. Miller and B. Sturmfels, Combinatorial Commutative Algebra, Graduate Texts in Mathematics # 227, Springer-Verlag New York, 2005. 26 ERIC RAMOS [PS] P. Prue and T. Scrimshaw, Abramss stable equivalence for graph braid groups, arXiv:0909.5511. [SS] S. Sam, and A. Snowden, Proof of Stembridge’s conjecture on stability of Kronecker coefficients, J. Algebraic Combin. 43 (2016), no. 1, 1-10, arXiv:1501.00333. Department of Mathematics, University of Wisconsin - Madison. E-mail address: [email protected]
0math.AC
End-to-end Analysis and Design of a Drone Flight Controller Zhuoqun Cheng1 , Richard West1 , and Craig Einstein1 1 Boston University, USA [email protected] [email protected] [email protected] arXiv:1802.05802v1 [cs.SY] 15 Feb 2018 Abstract Timing guarantees are crucial to cyber-physical applications that must bound the end-to-end delay between sensing, processing and actuation. For example, in a flight controller for a multirotor drone, the data from a gyro or inertial sensor must be gathered and processed to determine the attitude of the aircraft. Sensor data fusion is followed by control decisions that adjust the flight of a drone by altering motor speeds. If the processing pipeline between sensor input and actuation is not bounded, the drone will lose control and possibly fail to maintain flight. Motivated by the implementation of a multithreaded drone flight controller on the Quest RTOS, we develop a composable pipe model based on the system’s task, scheduling and communication abstractions. This pipe model is used to analyze two semantics of end-to-end time: reaction time and freshness time. We also argue that end-to-end timing properties should be factored in at the early stage of application design. Thus, we provide a mathematical framework to derive feasible task periods that satisfy both a given set of end-to-end timing constraints and the schedulability requirement. We demonstrate the applicability of our design approach by using it to port the Cleanflight flight controller firmware to Quest on the Intel Aero board. Experiments show that Cleanflight ported to Quest is able to achieve end-to-end latencies within the predicted time bounds derived by analysis. 1998 ACM Subject Classification C.3 Real-Time and Embedded Systems Keywords and phrases real-time systems, end-to-end timing analysis, flight controller 1 Introduction Over the past few years, commercial and hobbyist multirotor drones have been rapidly growing in popularity. The fast development of drone technology enables an ever widening set of applications, including aerial photography [35], package delivery [3], and search and rescue [39, 27]. One of the most commonly used control boards for drones in use today is the STM32 family of systems-on-chip (SoCs), which are based on the ARM Cortex M-series processors, and include integrated inertial sensors such as a gyroscope, accelerometer and magnetometer. While many of the existing flight control boards are perfectly adequate for drones operated via human-assisted radio control, they fall short of the processing capabilities needed for fully autonomous operation. For this reason, we are developing a new approach to building autonomous drones using emerging multicore platforms such as the Intel Aero board, Qualcomm Snapdragon flight development board [2], and Nvidia’s Jetson [1]. All these boards offer multiple processing cores and integrated graphics processing capabilities, making them capable of mission tasks that would be impossible on simpler hardware. Our first step to building autonomous drones has so far involved a reimplementation of the popular racing drone flight control firmware called Cleanflight [8] on the Intel Aero board. We have also ported our in-house Quest real-time OS (RTOS) [31] to the Aero board, to efficiently and predictably manage the multiple cores and I/O complexity. Our reimplementation of Cleanflight refactors the original single-threaded code running directly as firmware on STM32 SoCs into a multi-threaded application running on Quest. The decoupling of software components into separate threads improves the modularity of Cleanflight, and provides the capability for parallel task execution on platforms with multiple cores. Flight management tasks are then able to leverage the availability of increased compute resources, potentially improving the controllability of a drone. Similarly, the cleaner interfaces between software components eases our future plans to extend Cleanflight with advanced features such as camera data processing, object detection and avoidance, and simultaneous localization and mapping (SLAM) necessary for autonomous flight management. The original Cleanflight code has a series of tasks that are executed as loops with predefined frequencies. These frequencies are based on a combination of the capabilities of the hardware and the experiences of drone developers. However, a multithreaded Cleanflight is subject to extra overheads and uncertainty, due to scheduling and inter-task communication. It is critical to ensure the timing correctness of Cleanflight. For example, if a gyroscope reading fails to correctly influence a change in motor (and, hence, rotor) speed within a specific time bound, the drone might not be able to stabilize. Cleanflight is typical of many applications that process sensor inputs and require timebounded changes to actuators. With the recent development of multi-sensor data fusion algorithms [23, 22, 17] and ever-increasing availability of open source hardware, multisensor/actuator cyber-physical applications are leading to a revolution in areas such as 3D printing, drones, robotics, driverless cars, and intelligent home automation systems. For these applications, it is essential to guarantee two types of end-to-end timing requirements: 1) the maximum time it takes for an input sensor reading to flow through the whole system to eventually affect an actuator output, and 2) the maximum time within which an input sensor reading remains influential on output actuator commands. While the real-time community has developed valuable approaches to scheduling and response time analysis of tasks [10], end-to-end timing analysis has received only limited attention. Most of the prior work has originated from real-time network communication research [34, 30, 28, 40, 33, 42], and is based on event-triggered communication with FIFObased buffers. In a drone flight control program, however, single register-based buffers and periodic sampling are more common. This paper, therefore, presents the end-to-end timing analysis of a drone flight controller based on a combination of the periodic-sampling task model, the register-based inter-task communication model and the Quest RTOS’s scheduling model. We also show how the derived worst case end-to-end communication time can be, in turn, used to guide the design of applications. Contributions of this paper include: 1) the proposal of a composable pipe model to capture the timing characteristics of end-to-end communication in the Quest RTOS; 2) a demonstration of how to derive task periods from given end-to-end timing constraints in the application design stage; 3) the re-implemention and evaluation of the Cleanflight flight controller on the Intel Aero board. The rest of the paper is organized as follows: Section 2 provides background on Cleanflight and the corresponding task, scheduling and communication models adopted throughout the paper. Section 3 describes the end-to-end timing analysis of our proposed composable pipe model. Section 4 shows how the end-to-end time is leveraged in the application design stage, while Section 5 details the re-implementation and evaluation of Cleanflight on the Aero board. Related work is discussed in Section 6, followed by conclusions and future work in Section 7. 2 Execution Model In this section, we first provide an overview of the application that motivated this work. Secondly, we describe the application design model from three perspectives: i.e., the task model, the scheduling model and the communication model. 2.1 Application and System Overview This paper is motivated by our objective to implement an autonomous flight management system for multirotor drones. An autonomous drone is one that is able to reason about and adapt to changes in its surroundings, while accomplishing mission objectives without remote assistance from a human being (once its objectives are established). As part of this effort, we have undertaken a port of the Cleanflight firmware from a traditional single-core STM32-based system-on-chip (SoC) to the Intel Aero compute board. The Aero board has a quadcore x86 Atom x7-Z8750 processor, 4GB RAM, an integrated GPU, inertial measurement sensors and 3D camera connectivity. This makes it capable of flight management tasks (e.g., package delivery, aerial photography, search and rescue) that would be impossible with a less powerful single-core ARM Cortex M3 or M4 found in most STM32 SoCs. Cleanflight is targeted at racing drones, which are operated by humans using radio control. The core software components of Cleanflight consist of sensor and actuator drivers, a PID controller, the Mahony Attitude and Heading Reference (AHRS 1 ) algorithm, various communication stacks, and a logging system. Runtime entities of those components are called tasks. There are 31 tasks in total, of which more than half are optional. The essential ones are listed in Table 1. Tasks are scheduled from highest to lowest dynamic priority, calculated as a function of a task’s static priority and the time since it was last executed. Task Name Period (µs) System 100000 Battery Alert 200000 Battery Voltage 20000 Battery Current 20000 Gyro 1000 PID 1000 Accelerometer 1000 IMU Attitude 10000 RC Receiver 20000 Serial 10000 Magnetometer 100000 Table 1 List of Cleanflight Tasks Static Priority Medium-High Medium Medium Medium RealTime RealTime Medium Medium High Low Low Description Check system utilization Alarm battery runout Update battery voltage reading Update battery current reading Update gyro readings Perform PID-based motor control Update accelerometer readings Calculate attitude Process RC commands Serial communication Update magnetometer readings Our port of Cleanflight to the Aero board runs on our in-house Quest RTOS. We have developed Quest drivers for SPI, I2C, GPIO, UART, and inertial sensors on this and other similar boards. Quest is an SMP system, providing both user and kernel level threads, as 1 The attitude is the orientation of the drone relative to a reference frame such as earth. well as threaded interrupt handlers that are scheduled by a time-budgeted virtual CPU (VCPU) scheduler detailed in Section 2.3. 2.2 Task Model We model the flight controller program as a set of real-time periodic tasks {τ 1 , τ 2 , · · · , τ n }. Each task τ j is characterized by its worst case execution time ej and period T j . ej and T j are determined during the design stage and are fixed at runtime. ej is usually profiled off-line under the worst case execution condition. Deciding the value of T j is a challenging process, which is the major topic of this paper. It mainly depends on the end-to-end latency constraints and the schedulability test. All the periodic tasks are implemented using Quest’s user level threads. In this paper, we use term thread and task interchangeably. Apart from user level threads, there are kernel threads dedicated to I/O interrupts, which originate primarily from the SPI and I2C bus in Cleanflight. Quest executes interrupts in a deferrable thread context, having a corresponding time budget. This way, the handling of an interrupt does not steal CPU cycles from a currently running, potentially time-critical task. 2.3 Scheduling Model Threads in Quest are scheduled by a two-level scheduling hierarchy, with threads mapped to virtual CPUs (VCPUs) that are mapped to physical CPUs. Each VCPU is specified a processor capacity reserve [24] consisting of a budget capacity, C, and period, T . The value of C and T are determined by the e and T of the task mapped to the VCPU. A VCPU is required to receive at least C units of execution time every T time units when it is runnable, as long as a schedulability test [20] is passed when creating new VCPUs. This way, Quest’s scheduling subsystem guarantees temporal isolation between threads in the runtime environment. Conventional periodic tasks are assigned to Main VCPUs, which are implemented as Sporadic Servers [38] and scheduled using Rate-Monotonic Scheduling (RMS) [21]. The VCPU with the smallest period has the highest priority. Instead of using the Sporadic Server model for both main tasks and bottom half threads, special I/O VCPUs are created for threaded interrupt handlers. Each I/O VCPU operates as a Priority Inheritance Bandwidth preserving Server (PIBS) [9]. A PIBS uses a single replenishment to avoid fragmentation of replenishment list budgets caused by short-lived interrupt service routines (ISRs). By using PIBS for interrupt threads, the scheduling overheads from context switching and timer reprogramming are reduced [25]. 2.4 Communication Model Control flow within the flight controller is influenced by the path of data, which originates from sensory inputs and ends with actuation. Inputs include inertial sensors, optional cameras and GPS devices, while actuators include motors that affect rotor speeds and the attitude of the drone. Data flow involves a pipeline of communicating tasks, leading to a communication model characterized by: (1) the interarrival times of tasks in the pipeline, (2) inter-task buffering, and (3) the tasks’ access pattern to communication buffers. Periodic vs. Aperiodic Tasks. Aperiodic tasks have irregular interarrival times, influenced by the arrival of data. Periodic tasks have fixed interarrival times and operate on whatever data is available at the time of their execution. A periodic task implements asynchronous communication by not blocking to await the arrival of new data [11]. Register-based vs. FIFO-based Communication. A FIFO-based shared buffer is used in scenarios where data history is an important factor. However, in a flight controller, data freshness outweighs the preservation of the full history of all sampled data. For example, the motor commands should always be computed from the latest sensor data and any stale data should be discarded. Moreover, FIFO-based communication results in loosely synchronous communication: the producer is suspended when the FIFO buffer is full and the consumer is suspended when the buffer is empty. Register-based communication achieves fully asynchronous communication between two communicating parties using Simpson’s four-slot algorithm [36]. Implicit vs. Explicit Communication. Explicit communication allows access to shared data at any time point during a task’s execution. This might lead to data inconsistency in the presence of task preemption. A task that reads the same shared data at the beginning and the end of its execution might see two different values, if it is preempted between the two reads by another task that changes the value of the shared data. Conversely, the implicit communication model [13] essentially follows a read-before-execute paradigm to avoid data inconsistency. It mandates a task to make a local copy of the shared data at the beginning of its execution and to work on that copy throughout its execution. This paper assumes a periodic task model, as this simplifies timing analysis. Applications such as Cleanflight implement periodic tasks to sample data and perform control operations. Our system also adopts register-based, implicit communication for data freshness and consistency. 3 End-to-end Communication Timing Analysis In this section, we first distinguish two different timing semantics for end-to-end communication, which will be used as the basis for separate timing analyses. Secondly, we develop a composable pipe model for communication, which is derived from separate latencies that influence end-to-end delay. Lastly, we use the pipe model to derive the worst case end-to-end communication time under various situations. 3.1 Semantics of End-to-end Time To understanding the meaning of end-to-end time consider the following two constraints for a flight controller: Constraint 1: a change in motor speed must be within 2 ms of the gyro sensor reading that caused the change. Constraint 2: an update to a gyro sensor value must be within 2 ms of the corresponding update in motor speed. The values before and after a change differ, whereas they may stay the same before and after an update. These semantics lead to two different constraints. To appreciate the difference, imagine the two cases in Table 2. In Case 1, the task that reads the gyro runs every 10 ms and the one that controls the motors runs every 1 ms. Case 1 is guaranteed to meet Constraint 1 because the motor task runs more than once within 2 ms, no matter whether the gyro reading changes. However, it fails Constraint 2 frequently as the gyro task is not likely to run even once in an interval of 2 ms. Conversely, Case 2 is guaranteed to meet Constraint 2 but fails Constraint 1 frequently. This example demonstrates the difference between the two semantics of end-to-end time, which leads to the following formal definitions: Case 1 Case 2 Gyro Period 10 ms 1 ms Motor Period 1 ms 10 ms Table 2 Example Periods Figure 1 Task Chain Reaction time is the time it takes for input data to flow through the system, and is affected by the period of each consumer in a pipeline. A reaction timing constraint bounds the time interval between a sensor input and the first corresponding actuator output. Freshness time is the time within which an instance of the input data has influence on the system, and is affected by the period of each producer in a pipeline. A freshness timing constraint bounds the time interval between a sensor input and the last corresponding actuator output. Constraint 1, above, is a constraint on reaction time, while Constraint 2 is on freshness time. We perform analysis of the two semantics of time in Section 3.5.2 and 3.5.3, respectively. 3.2 Latency Contributors The end-to-end communication delay is influenced by several factors, which we will identify as part of our analysis. To begin, we first consider the end-to-end communication pipeline illustrated as a task chain in Figure 1. Task τ1 reads input data Din over channel Cin , processes it and produces data D1 . Task τ2 reads D1 and produces D2 , and τ3 eventually writes output Dout to channel Cout after reading and processing D2 . Each task handles data in three stages, i.e., read, process and write. The end-to-end time should sum the latency of each stage in the task chain. Due to the asynchrony of communication, however, we also need to consider one less obvious latency, which is the waiting time it takes for an intermediate output to be read in as input, by the succeeding task in the chain. In summary, the latency contributors are classified as follows: Processing latency represents the time it takes for a task to translate a raw input to a processed output. The actual processing latency depends not only on the absolute processing time of a task without interruption, but also on the service constraints (i.e., CPU budget and period of the VCPU) associated with the task. Communication latency represents the time to transfer data over a channel. The transfer data size, bandwidth and propagation delay of the communication channel, and the software overheads of the communication protocol all contribute to the overall latency. Since our communication model is asynchronous and register-based as described in Section 2, queuing latency is not a concern of this work. Scheduling latency represents the time interval between the arrival of data on a channel from a sending task and when the receiving task begins reading that data. The scheduling latency depends on the order of execution of tasks in the system, and therefore has significant influence on the end-to-end communication delay. 3.3 The Composable Pipe Model In Section 3.2, we identified the factors that influence end-to-end communication delay. Among them, the absolute processing time and the transfer data size are determined by the nature of the task in question. To capture the rest of the timing characteristics, we develop a composable pipe model, leveraging the scheduling approach described in Section 2.3. A task and pipe have a one-to-one relationship, as illustrated in Figure 2. Figure 2 Illustration of a Pipe 3.3.1 Terminology A pipe is composed of three elements: Pipe Terminal. A pipe has one terminal, which is an encapsulation of the data processing power reserved for this pipe. A pipe terminal is represented by a VCPU and its timing characteristics are captured by the VCPU’s budget and period, thereby guaranteeing at least C units of execution time every T time units. Pipe terminals are associated with conventional tasks bound to Main VCPUs and kernel control paths (including interrupt handlers and device drivers) bound to I/O VCPUs, as described in Section 2.3. Pipe End. A pipe has two ends, one for input and one for output. A pipe end is an interface to a communication channel, which is either an I/O bus or shared memory. Theoretically, the physical timing characteristics of a pipe end consist of transmission delay and propagation delay. As this work focuses on embedded systems where communicating parties are typically located within close proximity, we neglect propagation delay. The transmission delay is modeled by the bandwidth parameter, W , of the communication channel. We also use a parameter δ to denote the software overheads of a communication protocol. Though we are aware that δ depends on the data transfer size, the time difference is negligible, compared to the time of actual data transfer and processing. Therefore, for the sake of simplicity, δ is a constant in our model. Note that in our definition of a single pipe there is only one terminal, not two at either end of the pipe. This differs from the idea of a POSIX pipe, which comprises at task at both sending and receiving ends. In our case, a pipe is represented by the single terminal that takes input and produces output. An example of two communicating pipes is shown in Figure 3. This is representative of a communication path between a gyro task and attitude calculation in Cleanflight on the Aero board. The gyro task is mapped to Pipe 1, whose input end is over the SPI bus connected to the gyro sensor and output end is over a region of memory shared with Pipe 2. Pipe 1’s terminal is an I/O VCPU because the gyro task is responsible for handling I/O interrupts generated from the SPI bus. On the contrary, the terminal of Pipe 2 is a Main VCPU as the AHRS task is CPU-intensive. The gyro task reads raw gyro readings from Pipe 1’s input end, processes them, and writes filtered gyro readings to Pipe 1’s output end. Similarly, the AHRS task reads the filtered gyro readings from Pipe 2’s input end and produces attitude data for its output end over shared memory. Figure 3 Illustration of Two Communicating Pipes 3.3.2 Notation The timing characteristics of a pipe are denoted by the 3-tuple, π = ((Wi , δi ), (C, T ), (Wo , δo )), where: (Wi , δi ) and (Wo , δo ) denote the bandwidth and software overheads of the input and output ends, respectively. (C, T ) denotes the budget and period of the pipe terminal. A task τ is also represented as a 3-tuple, τ = (di , p, do ), where: di denotes the size of the raw data that is read in by τ in order to perform its job, and do denotes the size of the processed data that is produced by τ . p denotes the uninterrupted processing time it takes for τ to turn the raw data into the processed data. In addition, τ 7→ π denotes the mapping between task τ and pipe π. A task τ = (di , p, do ) is said to be mapped to a pipe π = ((Wi , δi ), (C, T ), (Wo , δo )) when data of size di is read from the input end with parameters (Wi , δi ), and data of size do is written to the output end with parameters (Wo , δo ); the pipe terminal with parameters (C, T ) is used for scheduling and accounting of the read and write operations, as well as the processing that takes time p. For the composition of a chain of pipes, the operator | connects a pipe’s output end to its succeeding pipe’s input end. For example, Figure 3 is represented as τgyro 7→ π1 |τAHRS 7→ π2 . The scheduling latency between two pipes is denoted by Sτ 7→π|τ ′ 7→π′ . Lastly, given a task set T = {τ1 , τ2 , · · · , τn } identity mapped to a pipe set Π = {π1 , π2 , · · · , πn }, where pipes are connected to each other in ascending order of subscript, Eτ1 7→π1 |τ2 7→π2 |···|τn 7→πn denotes the end-to-end reaction time of the pipe chain, and Fτ1 7→π1 |τ2 7→π2 |···|τn 7→πn denotes the end-to-end freshness time. 3.4 Reachability Before mathematically analyzing end-to-end time, we introduce the concept of reachability, inspired by the data-path reachability conditions proposed by Feiertag et al [11]. The necessity of introducing reachability is due to a subtle difference between our register-based asynchronous communication model and the traditional FIFO-based synchronous communication. In the latter, data is guaranteed to be transferred without loss or repetition. This way, end-to-end time is derived from the time interval between the arrival of a data input and the departure of its corresponding data output. Unfortunately, this might result in an infinitely large end-to-end time in the case of register-based asynchronous communication where not every input leads to an output. Instead, unprocessed input data might be discarded (overwritten) when newer input data is available, as explained in Section 2.4. An infinitely large end-to-end time, while mathematically correct, lacks practical use. Therefore, the following timing analysis ignores all input data that fails to “reach” the exit of the pipe chain it enters. Instead, only those data inputs that result in data outputs from the pipe chain are considered. We define this latter class of inputs as being reachable. 3.5 Timing Analysis As alluded to above, the execution of a task is divided into three stages, involving (1) reading, (2) processing, and (3) writing data. To simplify the timing analysis, we assume that tasks are able to finish the read and write stages within one period of the pipe terminal, to which the task is mapped. This is not unrealistic for applications such as a flight controller, because: 1) data to be transferred is usually small, and 2) all three stages are typically able to finish within one period. However, to maintain generality, we do not impose any restriction on the length of the processing stage. 3.5.1 Worst Case End-to-end Time of a Single Pipe First, we consider the case where there is a single pipe. Two key observations for this case are: 1) the absence of scheduling latency due to the lack of a succeeding pipe, and 2) the equivalence of the two end-to-end time semantics (reaction and freshness time) due to the lack of a preceding pipe. We therefore use Lτ 7→π to unify the notation of Eτ 7→π and Fτ 7→π . Given task τ = (di , p, do ) mapped to pipe π = ((Wi , δi ), (C, T ), (Wo , δo )), the worst case end-to-end time is essentially the execution time of the three stages of τ on π. Due to the timing property of π’s pipe terminal, τ is guaranteed C units of execution time within any window of T time units. Hence, the worst-case latency Lwc τ 7→π is bounded by the following:   ∆in + p + ∆out · T + (∆in + p + ∆out ) mod C (1) Lwc = τ 7→π C where ∆in = 3.5.2 di Wi + δi and ∆out = do Wo + δo . Worst Case End-to-end Reaction Time of a Pipe Chain In this section, we extend the timing analysis of a single pipe to a pipe chain. For the sake of simplicity, we start with a chain of length two. We show in Section 3.6 that the mathematical framework is applicable to arbitrarily long pipe chains. To distinguish the tasks mapped to the two pipes, we name the preceding task producer and the succeeding consumer. The producer is denoted by τp = (dpi , pp , d) and its pipe is denoted by πp = ((Wip , δip ), (C p , T p ), (Wop , δop )). Similarly, the consumer task and pipe are denoted by τc = (d, pc , dco ) and πc = ((Wic , δic ), (C c , T c ), (Woc , δoc )). Following the definition of the end-toend reaction time, Eτp 7→πp |τc 7→πc , in Section 3.1, we investigate the time interval between a specific instance of input data, denoted by Di , being read by τp , and its first corresponding output, denoted by Do , being written by τc . It is of vital importance to recognize that end-to-end time of a pipe chain is not simply the sum of the end-to-end time of each single pipe in the chain. We also need to account for the scheduling latency resulting from each appended pipe. As described in Section 3.2, the scheduling latency depends on the order of execution of tasks. We, therefore, perform the timing analysis under two complementary cases: Case 1 - τc has shorter period and thus higher priority than τp ; Case 2 - τp has shorter period and thus higher priority than τc , according to rate-monotonic ordering. 3.5.2.1 Calculating the End-to-end Reaction Time wc wc Case 1. The key to making use of Lwc τp 7→πp and Lτc 7→πc in the timing analysis of Eτp 7→πp |τc 7→πc , wc is to find the worst case scheduling latency, Sτp 7→πp |τc 7→πc . As illustrated in Figure 4, the worst case scheduling latency occurs when τc preempts τp (Step 1 ) immediately before τp produces the intermediate output Dint corresponding to Di . After preemption, τc uses up πc ’s budget and gives the CPU back to τp . Upon being resumed, τp immediately produces Dint (Step 2 ). For τc to become runnable again to read Dint in Step 3 , it has to wait for its budget replenishment. The waiting time is exactly the worst case scheduling latency: = T c − Cc − ( Sτwc p 7→πp |τc 7→πc d + δop ) Wop (2) Figure 4 End-to-end Reaction Time in Case 1 After replenishment, τc reads in Dint , processes it and eventually writes out Do . As Eτp 7→πp |τc 7→πc is defined to be the time interval between the arrival of Di and the departure of Do , the worst case of Eτp 7→πp |τc 7→πc is as follows: wc wc = Lwc Eτwc τp 7→πp + Sτp 7→πp |τc 7→πc + Lτc 7→πc p 7→πp |τc 7→πc d + δop ) (3) Wop Note that if τc runs out of budget before writing Do , τp may overwrite Dint in the pipe with new data (Step 4 ). However, the implicit communication property guarantees that τc only works on its local copy of the shared data, which is Dint until τc initiates another read. c c wc = Lwc τp 7→πp + Lτc 7→πc + T − C − ( Figure 5 End-to-end Reaction Time in Case 2 Case 2. The situation is more complicated when τp has higher priority than τc . The worst case scenario in Case 1 does not hold in Case 2 primarily because τp might overwrite Dint before τc has a budget replenishment. This is impossible in Case 1 because τp has a larger period than τc , which is guaranteed to have its budget replenished before τp is able to initiate another write. In other words, in Figure 4, Step 3 is guaranteed to happen before Step 4 . The data-overwrite problem in Case 2 is the reason for introducing reachability in Section 3.4. To find the worst case end-to-end reaction time in this case, we have to find the scenario that not only leads to the worst case scheduling latency, but also originates from a reachable input. Figure 5 illustrates a scenario that meets these requirements. In the figure, τp preempts τc immediately after τc finishes reading τp ’s intermediate output (Step 3 ), Dint , corresponding to Di . It follows that the longest possible waiting time, between Dint becoming available (Step 2 ) and τc reading the data (Step 3 ), is the period of τp minus both its budget and the execution time of the read stage of τc . This waiting time is exactly the worst case scheduling latency: = T p − Cp − ( Sτwc p 7→πp |τc 7→πc d + δic ) Wic (4) Between reading Dint and writing Do , τc might experience more than one preemption from τp , which repeatedly overwrites the shared data. This will not, however, affect τc ’s processing on Dint either spatially or temporally, thanks to the VCPU model and the implicit communication semantic. Therefore, similar to Case 1, the worst case end-to-end reaction time is again the sum of Equation 1 of each pipe and Equation 4: wc wc = Lwc Eτwc τp 7→πp + Sτp 7→πp |τc 7→πc + Lτc 7→πc p 7→πp |τc 7→πc wc p p = Lwc τp 7→πp + Lτc 7→πc + T − C − ( d + δic ) Wic (5) Since the output end of τp and the input end of τc share the same communication channel, it is reasonable to assume that Wop = Wic and δop = δic . With that, we proceed to unify the worst case end-to-end reaction time using one conditional equation: ( d wc if T c < T p + δ) + Lwc T c − Cc − ( W τp 7→πp + Lτc 7→πc , wc Eτp 7→πp |τc 7→πc = d wc + δ) + Lwc T p − Cp − ( W τp 7→πp + Lτc 7→πc , otherwise (6) where W = Wop = Wic and δ = δop = δic 3.5.2.2 Special Cases Real-time systems are often profiled offline to obtain worst case execution times of their tasks. In our case, this would enable CPU resources for pipe terminals to be provisioned so that each task completes one iteration of all three stages (read, process, write) in one budget allocation and, hence, period. This implies that ∆in + p + ∆out + ǫ = C in Equation 1, where ǫ is an arbitrarily small positive number to account for surplus budget after completing all task stages. With that, it is possible to simplify the worst case end-to-end reaction time derived in Section 3.5.2.1. First, Equation 1 is simplified as follows: C −ǫ ⌋ · T + [(C − ǫ) mod C] C = 0 · T + (C − ǫ) ≈ C Lwc τ 7→π = ⌊ (7) Using Equation 7, Equation 5 reduces to: wc = T p − C p − ∆cin + Lwc Eτwc τp 7→πp + Lτc 7→πc p 7→πp |τc 7→πc = T p − C p − ∆cin + C p + C c = T p + C c − ∆cin The same simplification applied to Equation 3 of Case 1 reduces Equation 6 to: ( T c + C p − ∆, if T c < T p wc Eτp 7→πp |τc 7→πc = T p + C c − ∆, otherwise (8) (9) d + δ. where ∆ = W If we further assume that πp and πc communicate data of small size over shared memory, it is possible to discard communication overheads, such that ∆ = 0. With that, Equation 9 simplifies to: ( T c + C p , if T c < T p wc Eτp 7→πp |τc 7→πc = (10) T p + C c , otherwise Finally, notice that by appending τc 7→ πc to τp 7→ πp , the worst case end-to-end reaction time is increased by the following: − Cp = Eτwc − Eτwc ↑ E wc = Eτwc p 7→πp p 7→πp |τc 7→πc p 7→πp |τc 7→πc ( T c, if T c < T p = p p c T − C + C , otherwise 3.5.3 (11) Worst Case End-to-end Freshness Time of a Pipe Chain Techniques similar to those in Section 3.5.2 will be used to analyze end-to-end freshness time. To avoid repetition, we abbreviate the end-to-end freshness timing analysis by only focusing on the special cases described in Section 3.5.2.2. Recall that freshness time is defined to be the interval between the arrival of an input and the departure of its last corresponding output. Therefore, we investigate the interval between a specific instance of input data, Di , being read by τp and its last corresponding output, Do , being written by τc . Figure 6 End-to-end Freshness Time in Case 1 Case 1. As illustrated in Figure 6, Di is read by the first instance of τp at time 0 and the intermediate output, Dint , is written to the shared data (Step 1 ). After that, τc produces three outputs corresponding to Dint (Steps 2 , 3 and 4 ), or to Di indirectly. The last output, Do , is the one preceding τp ’s write of new data, Dnew (Step 5 ). Thus, the worst , occurs when: 1) the two consecutive writes case end-to-end freshness time, Fτwc p 7→πp |τc 7→πc (Steps 1 and 5 ) from τp have the longest possible time interval between them, and 2) the write of Do happens as late as possible. The latest time to write Do is immediately before the second write of τp , which is preempted by higher priority τc . From Figure 6 that the worst case end-to-end freshness time is: = 2 · T p − ∆pout Fτwc p 7→πp |τc 7→πc (12) Again, when communicating over shared memory, Equation 12 can be further simplified to: = 2 · Tp Fτwc p 7→πp |τc 7→πc (13) Case 2. When τp has a smaller period than τc , it is impossible for τc to read the same intermediate output of τp twice. In Figure 6, Step 5 is guaranteed to happen before 3 . Thus, the worst case freshness time is essentially the worst case reaction time, shown in Equation 5. In summary, the worst case end-to-end freshness latency of two communicating pipes is represented in the following conditional equation: ( 2 · T p, if T c < T p Fτp 7→πp |τc 7→πc = (14) T p + C c , otherwise 3.6 Composability The timing analysis for two pipes in Section 3.5.2 extends to pipe chains of arbitrary length. Every time an extra task τnew (mapped to πnew ) is appended to the tail end of a chain (τtail 7→ πtail ), the worst case end-to-end reaction time increases by the worst case end-toend time of the newly appended pipe, plus the scheduling latency between the new pipe and the tail pipe. The actual value of the increase, depending on the relative priority of the new pipe and the tail pipe, is shown in Equation 11. Similarly, the added end-to-end freshness time can be derived from Equation 14. Composability is a crucial property of our pipe model, since it significantly eases the endto-end time calculation for any given pipeline. This provides the basis for a design framework that derives task periods from given end-to-end timing constraints. This is detailed in the following section. 4 End-to-end Design There are significant challenges to porting a flight control firmware such as Cleanflight to run as a multithreaded application on a real-time operating system. One of the major issues is how to determine the period of each thread so that the application is able to meet its end-to-end timing constraints. A naive approach would be to start by choosing a tentative set of periods and use the timing analysis method in Section 3 to validate the timing correctness. Upon failure, the periods are heuristically adjusted and the validation step is repeated until end-to-end timing guarantees are met. This approach, however, is potentially time-consuming and labor-intensive when the number of tasks or end-to-end constraints increase. Inspired by Gerber et al [12], we derive task periods from end-to-end timing constraints, by combining the timing analysis of the pipe model with linear optimization techniques. In this section, we generalize our method for use with a broader spectrum of cyber-physical control applications. 4.1 Problem Definition To precisely define the problem, first consider a set of tasks T = {τ1 , τ2 , · · · , τn } and a set of pipes Π = {π1 , π2 , · · · , πn }, where τj = (dji , pj , djo ) and πj = ((Wij , δij ), (C j , T j ), (Woj , δoj )). We additionally require the following information: the mapping between T and Π. For ease of notation, we assume tasks map to the pipe with the same subscript, hence ∀j ∈ {1, 2, · · · , n}, τj 7→ πj ; the topology of Π (an example is shown in Figure 7); ∀j ∈ {1, 2, · · · , n}, the value of dji , pj and djo ; ∀j ∈ {1, 2, · · · , n}, the value of Wij , δij , Woj and δoj ; the end-to-end timing constraints, namely the value of Eτi 7→πi |τj 7→πj |···|τk 7→πk and/or Fτp 7→πp |τq 7→πq |···|τr 7→πr where i, j, k, p, q, r ∈ {1, 2, · · · , n}. The aim is to find a feasible set of {(C j , T j )} pairs for j ∈ {1, 2, · · · , n} that: 1. meets all the specified end-to-end timing constraints, 2. passes the task schedulability test, and 3. ideally but not necessarily minimizes CPU utilization. A task should not be run faster than it needs to be, so that resources are made available for additional system objectives. 4.2 Solving the Constraints Our solution is carried out in a three-step process. To make it easier to understand, we use a concrete example with actual numbers to elaborate the process. Consider the pipe topology Eτ1 7→π1 |τ4 7→π4 ≤ 10, Eτ2 7→π2 |τ4 7→π4 ≤ 15, Eτ2 7→π2 |τ5 7→π5 |τ6 7→π6 ≤ 25, Eτ3 7→π3 |τ6 7→π6 ≤ 15; Reaction Fτ1 7→π1 |τ4 7→π4 ≤ 20, Fτ2 7→π2 |τ4 7→π4 ≤ 30, Fτ2 7→π2 |τ5 7→π5 |τ6 7→π6 ≤ 50, Fτ3 7→π3 |τ6 7→π6 ≤ 20; Freshness Cj j=1 T j P6 √ ≤ n( 6 2 − 1) ∀j ∈ {1, 2, · · · , 6}, dji = djo = 3, Wij = Woj = 20, δij = δoj = 0.1, pj = 0.5; Figure 7 Application Task Graph Schedulability Execution Times Table 3 Application Timing Characteristics graph shown in Figure 7, in which there are six tasks mapped to six pipes. Tasks 1, 2 and 3 read inputs from sensors, Tasks 4 and 6 write their outputs to actuators, and Task 5 is an intermediary responsible for complicated processing such as PID control or sensor data fusion. The timing characteristics of the tasks and pipes are shown in Table 3. Note that the execution times are assumed to be identical for all tasks. In practice this would not necessarily be the case but it does not affect the generality of the approach. In Step 1, we use the given di , do , p, Wi , δi , Wo and δo to compute the budget of each pipe terminal. The budget is set to a value that ensures the three stages (i.e., read, process and write) finish in one period. To compute C 1 , for example, we aggregate the times for d1 d1 τ1 to read, process and write data. Thus C 1 = Wi1 + δi1 + p1 + Wo1 + δo1 . All budgets are o i computed in a similar way. When the input to a pipe terminal comes from multiple sources the value di is aggregated from all input channels. For example, τ4 receives a maximum of d4i = d1 + d2 amount of data every transfer from both τ1 and τ2 . Data from a pipe terminal is not necessarily duplicated for all pipe terminals that are consumers. For example, τ2 generates a maximum of d2o = d2 amount of data every transfer, by placing a single copy of the output in a shared memory region accessible to both τ4 and τ5 . If the communication channels did not involve shared memory, then data would be duplicated, so that d2o = 2d2 . In Step 2, we derive a list of inequations involving period variables from the given end-toend timing and scheduling constraints in Table 3. For simplicity, the scheduling constraint is shown as a rate-monotonic utilization bound on the six pipe tasks. However, for sensor inputs and some actuator outputs, our system would map those tasks to I/O VCPUs that have a different utilization bound, as described in our earlier work [9]. The derivation is based on Equations 9 and 14, and the composability property of the pipe model. According to the conditional equations, however, every two pipes with undetermined priority can lead to two possible inequations. This exponentially increases the search space for feasible periods. In order to prune the search space, our strategy is to always start with the case where T p > T c . This is based on the observation that tasks tend to over-sample inputs for the sake of better overall responsiveness. Thus, the reaction constraint Eτ2 7→π2 |τ5 7→π5 |τ6 7→π6 ≤ 25, for example, is translated to inequation T 5 + C 2 − ∆+ T 6 ≤ 25. This is derived by combining Equations 9 and 11. It is then possible to translate all timing constraints to inequations with only periods as variables. In addition, periods are implicitly constrained by T j > C j , ∀j ∈ {1, 2, · · · , n}. Given all the inequations, Step 3 attempts to find the maximum value for each period so that the total CPU utilization is minimized. We are then left with a linear programming problem. Unfortunately, there is no polynomial time solution to the integer linear programming problem, as it is known to be NP-hard. Though linear programming solutions are still available under certain mathematical conditions [4], this is beyond the scope of this paper. Instead, in practice, the problem can be simplified because 1) there are usually a small number of fan-in and fan-out pipe ends for each task, meaning that a period variable is usually involved in a small number of inequations, and 2) a sensor task period is usually pre-determined by a hardware sampling rate limit. For example, if we assume T 3 is known to be 5, a feasible set of periods for the example in Table 3 is easily found: {T 1 = 10, T 2 = 15, T 3 = 10, T 4 = 10, T 5 = 15, T 6 = 5}. If we ignore the integer requirement, it is possible to find a feasible solution in polynomial time using rational numbers that are rounded to integers. Though rounding may lead to constraint violations, it is possible to increase the time resolution to ensure system overheads exceed those of rounding errors. In the worst case, the designer is always able to perform an exhaustive search of all possible constraint solutions. 5 Evaluation This section describes both simulations and experiments on the Intel Aero board with an Atom x7-Z8750 1.6 GHz 4-core processor and 4GB RAM. 5.1 Simulation Experiments We developed simulations for both Linux and Quest, to predict the worst-case end-to-end time using the equations in Section 3. Each simulation consists of three tasks, τ1 , τ2 and τ3 , mapped to pipes, π1 , π2 and π3 , respectively. All three tasks search for prime numbers within a certain range and then communicate with one another to exchange their results. τ1 communicates with τ2 , which further communicates with τ3 . The communication channel is shared memory with caches disabled and the data size is set to 6.7 KB to achieve a nonnegligible 1 millisecond communication overhead. Each task is assigned a different search range and the profiled execution time is shown in Table 4 in milliseconds. The budget of each pipe is set to be slightly larger than the execution time of its corresponding task, to compensate for system overheads. The settings of each pipe terminal (PT) are also shown in Table 4, again in milliseconds. Apart from the three main tasks, the system is loaded with low priority background tasks that consume all the remaining CPU resources and serve as potential interferences. Case 1 Case 2 PT 1 (10,50) (5,100) Table 4 Simulation Settings PT 2 (10,150) (10,50) PT 3 (5,100) (10,150) τ1 9.5 4.5 τ2 9.5 9.5 τ3 4.5 9.5 For each case, we measure the end-to-end reaction time and freshness time separately and compare them to corresponding theoretical bounds. Figure 8 shows the results after 100,000 outputs are produced by τ3 . C1(E) and C1(F ) are the end-to-end reaction and freshness times, respectively, for Case 1 in Table 4, while C2(E) and C2(F ) are for Case 2. As can be seen, the observed values are always within the prediction bounds. As reference, we also perform the two cases on Yocto Linux shipped with the Aero board. The kernel is version 4.4.76 and patched with the PREEMPT_RT patch. While running the simulation, the system also uncompresses Linux source code in the background. This places the same load on the system as the background tasks in Quest. Figure 9 shows all (not only worst case) end-to-end reaction and freshness times within the first 100 outputs. Compared to Linux, there is less variance shown by the end-to-end times on Quest. Additionally, the freshness and reaction times are generally lower with Quest than Linux. Figure 11 summarizes the worst case reaction time (WCR), maximum variance of WCR (MaxRV), worst case freshness time (WCF) and maximum variance of WCF (MaxFV) for both Quest and Linux. 400 350 300 Quest Reaction Linux Reaction Quest Freshness Linux Freshness Observed Predicted 250 300 Time (ms) Time (ms) 250 200 200 150 150 100 100 50 50 0 C1(E) C2(E) C1(F) C2(F) Figure 8 Observed vs. Predicted 5.2 0 20 40 60 80 100 Output # Figure 9 Quest vs. Linux The Cleanflight Experiment Our next experiments apply the end-to-end design approach to determining the periods of each task in the re-implementation of Cleanflight. We decouple software components in the original Cleanflight firmware and re-build the flight controller as a multithreaded application running on the Intel Aero board. The hardware and software architecture is shown in Figure 10. Hardware. We currently only use Core 0 to run Cleanflight on Quest. The remaining three cores are reserved for our Quest-V separation kernel [41] to run a general purpose OS such as Linux. Apart from the main processor, the Aero board also has an FPGA-based I/O coprocessor. It provides FPGA-emulated I/O interfaces including analog-to-digital conversion (ADC), UART serial, and pulse-width modulation (PWM). Our system currently uses the I/O hub to send PWM signals to electronic speed controllers (ESCs) that alter motor and, hence, rotor speeds of the drone. We modified the FPGA logic to improve the timing resolution of PWM signals, as well as control their duty cycle and periods. We make additional use of an onboard Bosch BMI160 Inertial Measurement Unit (IMU). Both the I/O hub and the IMU are connected to the main processor via SPI bus. Software. To minimize the engineering efforts, we currently disable the auxiliary features of Cleanflight such as telemetry, blackbox data logging, and UART-based flight control configuration. The essential components are shown as circular tasks in Figure 10. The Figure 10 Cleanflight Data Flow AHRS sensor fusion task takes the input readings of the accelerometer and gyroscope (in the BMI160 IMU) and calculates the current attitude of the drone. Then, the PID task compares the calculated and target attitudes, and feeds the difference to the PID control logic. In the original Cleanflight code, the target attitude is determined by radio-control signals from a human flying the drone. In an autonomous setting, the target attitude would be calculated according to on-board computations based on mission objectives and flight conditions. The output is nonetheless mixed with the desired throttle and read in by the PWM task, which translates it to motor commands. Motor commands are sent over the SPI bus and ultimately delivered as PWM signals to each ESC associated with a separate motor-rotor pair on the multirotor drone. We decouple all these tasks into separate threads. For safety reasons, the sensor tasks and the PWM task are given individual address spaces. To simplify the experiment setup, we instrument Cleanflight to use a synthetic radio input value (20% throttle and 0 degree pitch, roll, and yaw angle) instead of reading from the real radio driver. The tasks are profiled and execution times are shown in Table 5. Exec Times (µs) Gyro 174 AHRS 10 PID 2 PWM 970 Accl 167 Radio 12 Table 5 Task Execution Times As can be seen in Figure 10, there are currently three data paths, originating from the gyro, the accelerometer and the radio receiver, respectively. Unfortunately, there is little information available on what end-to-end timing constraints should be imposed on each path to guarantee a working drone. Most timing parameters in the original Cleanflight are determined by trial and error. On the other hand, instead of determining the optimum timing constraints, the focus of this paper is on guaranteeing given constraints. Therefore, we first port Cleanflight to Yocto Linux on the Aero board, as a reference implementation. The Linux version remains single-threaded and used to estimate the desired end-to-end time. For example, for the gyro path, the worst case reaction and freshness times are measured to be 9769 and 22972 µs, respectively. We round them to 10 and 23 ms, and use them as end-to-end timing constraints for the Quest flight controller implementation. Using the same approach, we determine end-to-end reaction and freshness times for the accelerometer path, which are set to 10 and 23 ms, respectively. Finally, for the radio path, we set the end-to-end reaction and freshness times to be 20 and 44 ms, respectively. Using the execution times in Table 5 and timing constraints above, we apply the end-toend design approach to derive the periods. The results for each task are shown in Table 6. Budget/Period (µs) Gyro 200/1000 AHRS 100/5000 PID 100/2000 PWM 1000/5000 Accl 200/1000 Radio 100/10000 Table 6 Task Periods Evaluation. To measure the actual end-to-end time, we focus on the longest pipe chain highlighted in Figure 10. We instrument the Cleanflight code to append every gyro reading with an incrementing ID, and also record a timestamp before the gyro input is read. The timestamp is then stored in an array indexed by the ID. Every task is further instrumented to maintain the ID when translating input data to output. This way, the ID is preserved along the pipe chain, from the input gyro reading to the output motor command. After the PWM task sends out motor commands, it looks up the timestamp using its ID and compares it to the current time. By doing this, we are able to log both the reaction and freshness end-to-end time for every input gyro reading. We then compare the observed end-to-end time with the given timing constraints, as well as the predicted worst case value. Results are shown in Figure 12. As can be seen, the observed values are always within the predicted bounds, and always meet the timing constraints. 300 24000 Quest Linux 250 21000 18000 Time (us) 200 Time (ms) Observed Predicted Constraint 150 100 15000 12000 9000 6000 50 3000 0 WCR MaxRV WCF MaxFV Figure 11 Quest vs. Linux Worst-Case Times 6 Reaction Freshness Figure 12 Cleanflight Times Related Work Feiertag et al. [11] distinguish four semantics of end-to-end time and provides a generic framework to determine all the valid data paths for each semantic. The authors do not perform timing analysis as no scheduling model is assumed. Hamann et al. also discuss end-to-end reaction and age time [13]. Their work focuses on integrating three different communication models, including the implicit communication model, into existing timing analysis tools such as SymTA/S [14]. While our composable pipe model is also based on implicit communication, we perform timing analysis using the Quest RTOS’s task and scheduling model. A large portion of end-to-end reaction time analysis is based on the synchronous data-flow graph (SDFG) [19] where inter-task communication is driven by the arrival of input data. In recent work [37], Singh et al. enhance the standard SDFG to allow the specification of an end-to-end latency constraint. Gerber et al. [12] propose a synthesis approach that determines tasks’ periods, offsets and deadlines from end-to-end timing constraints. Their work relies on task precedence constraints as there is no scheduling model used for the analysis. Our work uses a scheduling model based on Quest to perform end-to-end timing analysis. We then derive task periods and budgets to ensure specific reaction, freshness and schedulability constraints. There are also efforts to develop programming languages, such as Prelude [29] and Giotto [15], which are able to derive tasks’ periods based on user-specified timing constraints. Kirsch et al. [18] use Giotto to reimplement a helicopter control system. Others have developed data-triggered rather than time-triggered drone flight control using reactive programming languages [5]. In general operating systems, Scout [26] exposes paths that are similar to pipe chains in our model, to offer Quality of Service guarantees to applications. Paths in Scout are non-preemptive schedulable entities ordered according to an EDF policy. Lastly, programming environments such as ROS [32], OROCOS [6] and LCM [16], already widely adopted in the design of robotics and autonomous cars, are changing the development of cyber-physical applications. Publisher-subscriber paradigms used by ROS, for example, have influenced our thinking in the design cyber-physical systems with modularity and robustness amongst software components. We aim to augment Cleanflight functionality with ROS-style services as part of our ongoing efforts to build autonomous drones. 7 Conclusions and Future Work In this paper, we identify two semantics of end-to-end time, namely reaction and freshness time. We analyze them in the context of the Quest RTOS, for a port of the well-known Cleanflight flight control firmware implemented as a collection of user-level tasks. This paper describes a composable pipe model that is built on task, scheduling and communication abstractions. Using the pipe model, we derive the worst case end-to-end time for data flow through a chain of tasks under various conditions. We argue that end-to-end timing properties should be factored in at the early stage of application design. Thus, we provide a mathematical framework to derive feasible task periods and budgets using the Quest scheduling framework to satisfy a given set of end-to-end timing and schedulability constraints. We demonstrate the applicability of our design approach by using it to port the Cleanflight flight controller to Quest on the Intel Aero board. Future work will integrate the end-to-end design approach into our Quest-Arduino (Qduino [7]) development environment. This will provide the basis for the design and implementation of an autonomous multicore flight management system on our Quest-V separation kernel [41]. Quest-V enables non-time-critical tasks to run on a legacy Linux system in parallel with real-time tasks running on our Quest RTOS. References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Nvidia Jetson Board, March 2017. http://www.nvidia.com/object/embeddedsystems.html. Qualcomm Snapdragon Flight Kit, March 2017. https://www.intrinsyc.com/verticaldevelopment-platforms/qualcomm-snapdragon-flight/. Amazon Prime Air. http://www.amazon.com/b?ie=UTF8&node=8037720011. S.P. Bradley, A.C. Hax, and T.L. Magnanti. Applied Mathematical Programming. AddisonWesley Publishing Company, 1977. Endri Bregu, Nicola Casamassima, Daniel Cantoni, Luca Mottola, and Kamin Whitehouse. Reactive Control of Autonomous Drones. In Proceedings of the 14th Annual International Conference on Mobile Systems, Applications, and Services, MobiSys ’16, pages 207–219, New York, NY, USA, 2016. ACM. H. Bruyninckx. Open Robot Control Software: the OROCOS Project. In Proceedings 2001 ICRA. IEEE International Conference on Robotics and Automation (Cat. No.01CH37164), volume 3, pages 2523–2528 vol.3, 2001. Zhuoqun Cheng, Ye Li, and Richard West. Qduino: A Multithreaded Arduino System for Embedded Computing. In Proceedings of the 2015 IEEE Real-Time Systems Symposium (RTSS), RTSS ’15, pages 261–272, Washington, DC, USA, 2015. IEEE Computer Society. Cleanflight: http://cleanflight.com/. Matthew Danish, Ye Li, and Richard West. Virtual-CPU Scheduling in the Quest Operating System. In Proceedings of the 17th Real-Time and Embedded Technology and Applications Symposium, 2011. Robert I. Davis, Sebastian Altmeyer, Leandro Indrusiak, Claire Maiza, Vincent Nelis, and Jan Reineke. An Extensible Framework for Multicore Response Time Analysis. Real-Time Systems, 2017. Nico Feiertag, Kai Richter, Johan Nordlander, and Jan Jonsson. A Compositional Framework for End-to-End Path Delay Calculation of Automotive Systems under Different Path Semantics. In Proceedings of the IEEE Real-Time System Symposium - Workshop on Compositional Theory and Technology for Real-Time Embedded Systems, Barcelona, Spain, November 30, 2008. Richard Gerber, Seongsoo Hong, and Manas Saksena. Guaranteeing Real-Time Requirements With Resource-Based Calibration of Periodic Processes. IEEE Trans. Softw. Eng., July 1995. Arne Hamann, Dakshina Dasari, Simon Kramer, Michael Pressler, and Falk Wurst. Communication Centric Design in Complex Automotive Embedded Systems. In 29th Euromicro Conference on Real-Time Systems (ECRTS 2017), Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, 2017. Rafik Henia, Arne Hamann, Marek Jersak, Razvan Racu, Kai Richter, and Rolf Ernst. System Level Performance Analysis - the SymTA/S Approach. In IEEE Proceedings Computers and Digital Techniques, 2005. Thomas A. Henzinger, Benjamin Horowitz, and Christoph Meyer Kirsch. Giotto: A TimeTriggered Language for Embedded Programming, pages 166–184. Springer Berlin Heidelberg, Berlin, Heidelberg, 2001. Albert S. Huang, Edwin Olson, and David Moore. LCM: Lightweight Communications and Marshalling. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Taipei, Oct 2010. Jonathan Kelly and Gaurav S Sukhatme. Visual-Inertial Sensor Fusion: Localization, Mapping and Sensor-to-Sensor Self-calibration. The International Journal of Robotics Research, 30(1):56–79, 2011. 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 Christoph M. Kirsch, Marco A. A. Sanvido, Thomas A. Henzinger, and Wolfgang Pree. A Giotto-Based Helicopter Control System, pages 46–60. Springer Berlin Heidelberg, Berlin, Heidelberg, 2002. E. A. Lee and D. G. Messerschmitt. Synchronous data flow. Proceedings of the IEEE, 75(9):1235–1245, Sept 1987. John Lehoczky, Lui Sha, and Ye Ding. The Rate Monotonic Scheduling Algorithm: Exact Characterization and Average Case Behavior. In Proceedings of the IEEE Real-Time Systems Symposium (RTSS), 1989. C. L. Liu and James W. Layland. Scheduling Algorithms for Multiprogramming in a Hard Real-Time Environment. Journal of the ACM, 20(1):46–61, 1973. Sebastian O.H. Madgwick. An Efficient Orientation Filter for Inertial and Inertial/Magnetic Sensor Arrays. Technical report, University of Bristol, 2010. Robert Mahony, Tarek Hamel, and Jean-Michel Pflimlin. Nonlinear Complementary Filters on the Special Orthogonal Group. IEEE Transactions on Automatic Control, 53, June 2008. Clifford W. Mercer, Stefan Savage, and Hideyuki Tokuda. Processor Capacity Reserves for Multimedia Operating Systems. Technical report, Pittsburgh, PA, USA, 1993. E. Missimer, K. Missimer, and R. West. Mixed-Criticality Scheduling with I/O. In 28th Euromicro Conference on Real-Time Systems (ECRTS), pages 120–130, July 2016. David Mosberger and Larry L. Peterson. Making Paths Explicit in the Scout Operating System. In Proceedings of the Second USENIX Symposium on Operating Systems Design and Implementation, OSDI ’96, pages 153–167, New York, NY, USA, 1996. ACM. BBC News. Disaster Drones: How Robot Teams can Help in a Crisis. goo.gl/6efliV. R. S. Oliver and G. Fohler. Probabilistic Estimation of End-to-end Path Latency in Wireless Sensor Networks. In 2009 IEEE 6th International Conference on Mobile Adhoc and Sensor Systems, pages 423–431, Oct 2009. Claire Pagetti, Julien Forget, Frédéric Boniol, Mikel Cordovilla, and David Lesens. Multitask Implementation of Multi-periodic Synchronous Programs. Discrete Event Dynamic Systems, Sep 2011. Bo Peng, Nathan Fisher, and Thidapat Chantem. MILP-based Deadline Assignment for End-to-End Flows in Distributed Real-Time Systems. In Proceedings of the 24th International Conference on Real-Time Networks and Systems, RTNS ’16, pages 13–22, New York, NY, USA, 2016. ACM. Quest RTOS: http://questos.org/. Morgan Quigley, Ken Conley, Brian P. Gerkey, Josh Faust, Tully Foote, Jeremy Leibs, Rob Wheeler, and Andrew Y. Ng. ROS: An Open-source Robot Operating System. In ICRA Workshop on Open Source Software, 2009. S. Quinton, T. T. Bone, J. Hennig, M. Neukirchner, M. Negrean, and R. Ernst. Typical Worst Case Response-time Analysis and its use in Automotive Network Design. In 2014 51st ACM/EDAC/IEEE Design Automation Conference (DAC), pages 1–6, June 2014. J. L. Scharbarg, F. Ridouard, and C. Fraboul. A Probabilistic Analysis of End-To-End Delays on an AFDX Avionic Network. IEEE Transactions on Industrial Informatics, 5(1):38–49, Feb 2009. Da-Jiang Innovations Science and Technology Co. DJI. http://dji.com/. H.R. Simpson. Four-slot Fully Asynchronous Communication Mechanism. IEEE Computers and Digital Techniques, 137:17–30, January 1990. Abhishek Singh, Pontus Ekberg, and Sanjoy Baruah. Applying Real-Time Scheduling Theory to the Synchronous Data Flow Model of Computation. In 29th Euromicro Conference on Real-Time Systems (ECRTS 2017), Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, 2017. 38 39 40 41 42 B. Sprunt. Scheduling Sporadic and Aperiodic Events in a Hard Real-Time System. Technical Report CMU/SEI-89-TR-011, Software Engineering Institute, Carnegie Mellon, 1989. K. P. Valavanis. Advances in Unmanned Aerial Vehicles. Springer Science and Business Media, 2008. Y. Wang, M. C. Vuran, and S. Goddard. Cross-Layer Analysis of the End-to-End Delay Distribution in Wireless Sensor Networks. In 2009 30th IEEE Real-Time Systems Symposium, pages 138–147, Dec 2009. Richard West, Ye Li, Eric Missimer, and Matthew Danish. A Virtualized Separation Kernel for Mixed-Criticality Systems. ACM Trans. Comput. Syst., 34(3):8:1–8:41, June 2016. P. M. Yomsi, D. Bertrand, N. Navet, and R. I. Davis. Controller Area Network (CAN): Response Time Analysis with Offsets. In 2012 9th IEEE International Workshop on Factory Communication Systems, pages 43–52, May 2012.
3cs.SY
arXiv:1211.0638v3 [stat.ME] 1 Aug 2016 Why the Decision-Theoretic Perspective Misrepresents Frequentist Inference: ‘Nuts and Bolts’ vs. Learning from Data Aris Spanos Department of Economics, Virginia Tech, USA August 2016 Abstract The primary objective of this paper is to revisit and make a case for the merits of R.A. Fisher’s objections to the decision-theoretic framing of frequentist inference. It is argued that this framing is congruent with the Bayesian but incongruent with the frequentist inference. It provides the Bayesian approach with a theory of optimal inference, but it misrepresents the theory of optimal frequentist inference by framing inferences solely in terms of the universal quantifier ‘for all values of θ in Θ’, denoted by ∀θ∈Θ. This framing is at odds with the primary objective of modelbased frequentist inference, which is to learn from data about the true value θ∗ ; the one that gave rise to the particular data. The frequentist approach relies on factual (estimation, prediction), as well as hypothetical (testing) reasoning, both of which revolve around the existential quantifier ∃θ∗ ∈Θ. The paper calls into question the appropriateness of admissibility and reassesses Stein’s paradox as it relates to the capacity of frequentist estimators to pinpoint θ∗ . The paper also compares and contrasts lossbased errors with traditional frequentist errors, such as coverage, type I and II; the former are attached to θ, but the latter to the inference procedure itself. Key words: decision theoretic framing; Bayesian vs. Frequentist inference; Stein’s paradox; James-Stein estimator; loss functions; admissibility; error probabilities; risk functions 1 1 Introduction Wald’s (1950) decision-theoretic framework is widely viewed as providing a broad enough perspective to accommodate and compare the frequentist and Bayesian approaches to inference, despite their well-known differences. It is perceived as offering a neutral framing of inference that brings into focus their common features and tones down their differences; see Berger (1985), Robert (2001), O’Hagan (1994). Historically, Wald (1939) proposed the original variant of the decision-theoretic framework with a view to unify Neyman’s (1937) rendering of frequentist interval estimation and testing: “The problem in this formulation is very general. It contains the problems of testing hypotheses and of statistical estimation treated in the literature.” (p. 340) Among the frequentist pioneers, Jerzy Neyman accepted enthusiastically this broader perspective, primarily because the concepts of decision rules and action spaces seemed to provide a better framing for his behavioristic interpretation of Neyman-Pearson (N-P) testing based on the accept/reject rules; see Neyman (1952; 1971). Neyman’s attitude towards Wald’s (1950) framing was also adopted wholeheartedly by some of his most influential students/colleagues at Berkeley, including Lehmann (1959) and LeCam (1986). In a foreword of a collection of Neyman’s early papers, his students/editors described the Wald’s framing as (Neyman, 1967, p. vii): “A natural but far reaching extension of their [N-P formulation] scope can be found in Abraham Wald’s theory of statistical decision functions.” At the other end of the argument, R. A. Fisher (1955) rejected Wald’s framing on the grounds that it seriously distorts his rendering of frequentist statistics: “The attempt to reinterpret the common tests of significance used in scientific research as though they constituted some kind of acceptance procedure and led to ‘decisions’ in Wald’s sense, originated in several misapprehensions and has led, apparently, to several more.” (p. 69) With a few exceptions, such as Cox (1958), Tukey (1960) and Birnbaum (1977), Fisher’s (1955) viewpoint has been inadequately discussed and evaluated by the subsequent statistics literature. The primary aim of this paper is to revisit Fisher’s minority view by taking a closer look at the decision-theoretic framework with a view to re-evaluate the claim that it provides a neutral framework for comparing the frequentist and Bayesian approaches. It is argued that Fisher’s view that the decision theoretic framing is germane to ”acceptance sampling”, but misrepresents frequentist inference, is not without merit. The key argument of the discussion that follows is that the decision-theoretic notions of loss function and admissibility are congruent with the Bayesian approach, but incongruent with both the primary objective and the underlying reasoning of the frequentist approach. Section 2 introduces the basic elements of the decision theoretic set-up with a view to bring out its links to the Bayesian and frequentist approaches, calling into question the conventional wisdom concerning its neutrality. Section 3 takes a closer look at the Bayesian approach and argues that had the decision-theoretic 2 apparatus not exist, Bayesians would have been forced to invent it in order to establish a theory of optimal Bayesian inference. Section 4 discusses critically the notions of loss functions and admissibility, focusing primarily on their role in giving rise to Stein’s paradox and their incompatibility with the frequentist approach. It is argued that the frequentist dimension of the notions of a loss function and admissibility is more apparent than real. Section 5 makes a case that the decision-theoretic framework misrepresents both the primary objective and the underlying reasoning of the frequentist approach. Section 6 revisits the notion of a loss function and its dependence on ‘information other than the data’. It is argued that loss-based errors are both different and incompatible with the traditional frequentist errors because they are attached to the unknown parameters instead of the inference procedures themselves. 2 2.1 The decision theoretic set-up Basic elements of the decision-theoretic framing The current decision-theoretic set-up has three basic elements. 1. A prespecified (parametric) statistical model Mθ (x), generically specified by: Mθ (x)={f (x; θ), θ∈Θ}, x∈RnX , for θ∈Θ⊂Rm , m≪n, (1) where f (x; θ) denotes the (joint) distribution of the sample X:=(X1 , ..., Xn ), RnX denotes the sample space and Θ the parameter space. This model represents the stochastic mechanism assumed to have given rise to data x0 :=(x1 , ..., xn ). 2. A decision space D containing all mappings d(.): RnX → A, where A denotes the set of all actions available to the statistician. 3. A loss function L(., .): [D × Θ] → R, representing the numerical loss if the statistician takes action a∈A when the state of nature is θ∈Θ; see Ferguson (1967), Berger (1985), Wasserman (2004). The basic idea is that, when the decision-maker selects action a, he/she does not know the ‘true’ state of nature, represented by θ ∗ . However, contingent on each action a∈A, the decision-maker ‘knows’ the losses (gains, utilities) resulting from different choices (d, θ) ∈[D × Θ]. The decision-maker observes data x0 , which provides some information about θ∗ , and then maps each x∈RnX to a certain action a∈A guided solely by L(d, θ). 2.2 The original Wald framing It is important to bring out the fact that the original Wald (1939) framing was much narrower than the above (1-3) rendering, due to its aim to formalize the Neyman-Pearson (N-P) approach; see Ferguson (1976). What were the key differences? (i) The decision (action) space D was defined exclusively in terms of subsets of the parameter space Θ. For estimation D:={θ : θ∈Θ} is the set of all singleton points of Θ and for testing D:= (Θ0 , Θ1 ), the null and alternative regions, respectively. 3 (ii) The original loss (weight) was a zero-positive function, with zero loss at ( θ=θ∗ : 0 if b θ(X) = θ∗ L0−c (θ, b θ(X))= (2) cθ >0 if b θ(X)=θ6=θ ∗ , θ∈Θ, where θ∗ is the true value of θ in Θ. For the discussion that follows it is important to note that (2) is non-operational in practice because θ ∗ is unknown. The more general framing, introduced by Wald (1947; 1950) and broadened by Le Cam (1955), extended the scope of the original set-up by generalizing the notions of loss functions and decision spaces. In what follows it is argued that these extensions created serious incompatibilities with both the objective and the underlying reasoning of frequentist inference. In addition, it is both of historical and methodological interest to note that Wald (1939) introduced the notion of a prior distribution π(θ), ∀θ∈Θ, into the original decision-theoretic machinery reluctantly, and justified it on being a useful tool for proving certain theorems: “The situation regarding the introduction of an a priori probability distribution of θ is entirely different. First, the objection can be made against it, as Neyman has pointed out, that θ is merely an unknown constant and not a variate, hence it makes no sense to speak of the probability distribution of θ. Second, even if we may assume that θ is a variate, we have in general no possibility of determining the distribution of θ and any assumptions regarding this distribution are of hypothetical character. The reason why we introduce here a hypothetical probability distribution of θ is simply that it proves to be useful in deducing certain theorems and in the calculation of the best system of regions of acceptance.” (p. 302) He was also the first to highlight the extreme relativism of the decisiontheoretic notion of ‘optimality’ with respect a particular loss function: “The ”best” system of regions of acceptance ... will depend only on the weight function of the errors.” (p. 302) [emphasis added] 2.3 A shared neutral framework? The frequentist, Bayesian and the decision-theoretic approaches share the notion of a statistical model by viewing data x0 :=(x1 , ..., xn ) as a realization of a sample X:=(X1 , ..., Xn ) from (1). The key differences between the three approaches are: (a) the frequentist approach relies exclusively on Mθ (x), (b) the Bayesian approach adds a prior distribution, π(θ), ∀θ∈Θ (for all θ∈Θ), (c) the decision-theoretic framing revolves around a loss (gain or utility) function: L(d(x), θ), ∀θ∈Θ, ∀x∈RnX . The loss function is often assumed to be an even, differentiable and convex function of (d(x)−θ), and can take numerous functional forms; see Wasserman (2004), Robert (2001), Bansal (2007) inter alia. The claim that the decision-theoretic perspective provides a neutral ground is often justified on account of the loss function being a function of the sample and parameter spaces via the two universal quantifiers: 4 (i) ‘∀x∈RnX ’, associated with the distribution of the sample: f (x; θ), ∀x∈RnX , frequentist: (ii) ‘∀θ∈Θ’ associated with the posterior distribution: Bayesian: π(θ)·f (x0 |θ) , π(θ)·f (x0 |θ)dθ π(θ|x0 )= R θ∈Θ ∀θ∈Θ. The idea is that allowing for all values of x in RnX goes beyond the Bayesian perspective, which relies exclusively on a single point x0 . What is not obvious is whether that is sufficient to do justice to the frequentist approach. A closer scrutiny suggests that frequentist inference is misrepresented by the way both quantifiers are used in the decision-theoretic framing of inference. First, the quantifier ∀x∈RnX plays a minor role since its only relevance is in defining the expectation for transforming a loss function, say L(θ, b θ(x)), into a risk function: h i R θ(x))f (x; θ)dx, ∀θ∈Θ. (3) θ(X)) = x∈Rn L(θ, b R(θ, b θ)=EX L(θ, b X This is the only place where the underlying statistical model Mθ (x) enters the decision-theoretic framing. Hence, from this perspective the only relevant part of the behavior of b θ(X) is how it affects the risk for different values of θ in Θ. This undermines the pivotal role of the quantifier ∀x∈RnX in determining the theory of optimal frequentist inference. For that the distribution of the sample, f (x; θ), ∀x∈RnX , takes center stage since the sampling distribution of any statistic Yn =g(X) (estimator, test, predictor) is derived via: Z Z Z f (x; θ)dx. F (y; θ):=P(Yn ≤y; θ)= ··· (4) | {z } {x: g(x)≤t; x∈Rn X} The relevant error probabilities that calibrate the optimality of frequentist procedures are defined in terms of (4). Second, the decision-theoretic notion of optimality revolves around the universal quantifier ‘∀θ∈Θ’, rendering it congruent with the Bayesian but incongruent with the frequentist approach. To be more specific, since different risk functions often intersect over Θ, an optimal rule is usually selected after the risk function is reduced to a scalar. Two such choices of relevant risk are: b b Maximum risk: Rmax (θ)=sup R(θ, θ), θ∈Θ Bayes risk: b RB (θ)= (5) R b θ∈Θ R(θ, θ)π(θ)dθ. Hence, an obvious way to choose among different rules is to find the one that minimizes the relevant risk with respect to all possible estimates e θ(x). In the case of (5), this gives rise to two corresponding decision rules: Minimax rule: Bayes rule: inf Rmax (b θ)= inf [supR(θ, b θ)], e θ(x) e θ(x) θ∈Θ inf RB (b θ)= inf R θ∈Θ e θ(x) e θ(x) 5 R(θ, b θ)π(θ)dθ. In this sense, a decision or a Bayes rule b θ will be considered optimal when it minimizes the relevant risk, no matter what the true state of nature θ ∗ happens to be. This constitutes a key caveat that is often ignored in discussions of these approaches. When viewed as a game against Nature, the decision maker selects action a from A, irrespective of what value θ∗ Nature has chosen. That is, θ∗ plays no role in selecting the optimal rules since the latter have nothing to do with the true value θ∗ of θ. To avoid any misreading of this line of reasoning, it is important to emphasize that ‘the true value θ∗ ’ is shorthand for saying that ‘data x0 constitute a typical realization of the sample X with distribution f (x; θ∗ )’; see Spanos and Mayo (2015). This should be contrasted with the notion of optimality in frequentist inference that gives θ∗ center stage, in the sense that it evaluates the capacity of the inference procedure to inform the modeler about θ ∗ ; no other value is relevant. According to Reid (2015): “A statistical model is a family of probability distributions [Mθ (x)], the central problem of statistical inference being to identify which member of the family [θ∗ ] generated the data of interest.” (p. 418) 3 The Bayesian approach To shed further light on the affinity between the decision-theoretic framework and the Bayesian approach, let us take a closer look at the latter. 3.1 Bayesian inference and its primary objective A key argument in favor of the Bayesian approach is often its simplicity in the sense that all forms of inference revolve around a single function, the posterior distribution: π(θ|x0 )∝π(θ)·f (x0 |θ), ∀θ∈Θ. This, however, is only half the story. The other half is how the posterior distribution is utilized to yield ‘optimal’ inferences. The issue of optimality, however, is intrinsically related to what the primary objective of Bayesian inference is. An outsider looking at Bayesian approach would surmise that its primary objective is to yield ‘the probabilistic ranking’ (ordering) of all values of θ in Θ. The modeling begins with an a priori probabilistic ranking based on π(θ), ∀θ∈Θ, which is revised after observing x0 to derive π(θ|x0 ), ∀θ∈Θ; hence the key role of the quantifier ∀θ∈Θ. Indeed, O’Hagan’s (1994) argues that the revised probabilistic ranking is the inference: “Having obtained the posterior density π(θ|x0 ), the final step of the Bayesian method is to derive from it suitable inference statements. The most usual inference question is this: After seeing the data x0 , what do we now know about the parameter θ. The only answer to this question is to present the entire posterior distribution.” (p. 6) In light of that, the question that naturally arises is: what does the revised probabilistic ranking, based on π(θ|x0 ), ∀θ∈Θ, convey about the underlying data generating mechanism in (1), assumed to have given rise to data x0 ? That is, what does this ranking have to do with learning about the ‘true’ value θ ∗ ? e 0 ) (mode) or some other It is not obvious why the highest ranked value θ(x feature of the posterior distribution pinpoints θ∗ better than any other value. As mentioned above, θ∗ plays no role in selecting the optimal rule, since the 6 latter revolves exclusively around the relevant risk. In contrast, learning from data x0 about the unique value θ∗ makes perfectly good sense in frequentist inference since θ is viewed as an unknown constant that gave rise to x0 . This issue highlights the key built-in tension between the frequentist and Bayesian approaches. If the primary objective of Bayesian inference is not the revised probabilistic ranking of all θ∈Θ, what is it? The answer is that the decision-theoretic perspective came in to refocus and append to Bayesian inference. O’Hagan, echoing earlier views by Lindley (1965) and Tiao and Box (1975) in contrasting frequentist (classical) inferences with Bayesian inferences, argues: “Classical inference theory is very concerned with constructing good inference rules. The primary concern of Bayesian inference, ..., is entirely different. The objective is to extract information concerning θ from the posterior distribution, and to present it helpfully via effective summaries. There are two criteria in this process. The first is to identify interesting features of the posterior distribution. ... The second criterion is good communication. Summaries should be chosen to convey clearly and succinctly all the features of interest. ... In Bayesian terms, therefore, a good inference is one which contributes effectively to appropriating the information about θ which is conveyed by the posterior distribution.” (p. 14) Clearly, O’Hagan’s attempt to define what is a ‘good’ Bayesian inference begs the question: what does constitute ‘effective appropriation of information about θ’ mean, apart from the probabilistic ranking? Putting that aside, in his attempt to defend his stance that the entire posterior distribution is the inference, O’Hagan argues that criteria for ‘optimal’ Bayesian inferences are only parasitical on the Bayesian approach and enter the picture via the decision theoretic perspective: “... a study of decision theory has two potential benefits. First, it provides a link to classical inference. It thereby shows to what extent classical estimators, confidence intervals and hypotheses tests can be given a Bayesian interpretation or motivation. Second, it helps identify suitable summaries to give Bayesian answers to stylized inference questions which classical theory addresses.” (p. 14) Both of the above mentioned potential benefits to the Bayesian approach, are misleading for two reasons. First, the link between the decision-theoretic and the classical (frequentist) inference is fraught with misleading definitions and unclarities with respect to the reasoning and objectives of the latter. For instance, the quantifier ‘∀θ∈Θ’ used to define ‘optimal’ estimators with respect to particular loss functions is at odds with frequentist inference. Second, the claim concerning Bayesian answers to frequentist questions of interest is misplaced because the former provides no real answers to the frequentist primary question of interest which pertains to learning about θ ∗ . A Bayes rule offers very little, if anything, relevant in learning what the value θ ∗ that gave rise to x0 is. Let us unpack this answer in more detail. Substituting the risk function in (3) into the Bayes risk in (5), one can show 7 that: RB (b θ) = = R = R Rθ∈Θ R x∈Rn X R x∈Rn X  L(θ, b θ(x))f (x; θ)dx π(θ)dθ= R L(θ, b θ(x))f (x|θ)π(θ)dθdx= nθ∈Θ o R b L(θ, θ(x))π(θ|x)dθ m(x)dx, θ∈Θ x∈Rn X (6) where m(x)= θ∈Θ f (x; θ)dθ; see Bansal (2007). The second and third equalities presume that one can reverse the order of integration (a technical issue), and treat f (x; θ) as the joint distribution of X and θ so that: f (x; θ)=f (x|θ)π(θ)=π(θ|x)m(x). The latter raises a number of questionable hand-waving moves because it muddies the distinction between x, a generic value of RnX , and the particular value x0 ; see Spanos (2015). In light of (6), a Bayesian estimate is ‘optimal’ relative to a particular loss function L(b θ(X), θ), when it minimizes RB (b θ). This makes it clear that what constitutes an ‘optimal’ Bayesian estimate is primarily determined by L(b θ(X), θ) (Schervish, 1995): (i) when L2 (b θ, θ)=(b θ − θ)2 the Bayes estimate b θ is the mean of π(θ|x0 ), (ii) when L1 (e θ, θ)=|e θ − θ| the Bayes estimate e θ is the median of π(θ|x0 ),  0 for θ−θ < ε (iii) when L0−1 (θ, θ)=δ(θ, θ)= , for ε>0, the Bayes esti1 for θ−θ ≥ ε mate θ is the mode of π(θ|x0 ). In practice, the most widely used loss function is the square: L2 (b θ(X) − θ)2 , ∀θ∈Θ, θ(X); θ)=(b whose risk function is the decision-theoretic Mean Square Error (MSE 1 ): R(θ, b θ)=E(b θ(X)−θ)2 =MSE1 (b θ(X); θ), ∀θ∈Θ. (7) M SE(b θn (X); θ ∗ )=E(b θn (X)−θ∗ )2 . (8) R(θ, b θ) ≤ R(θ, e θ), ∀θ∈Θ, (9) Surprising, however, this definition of the MSE, denoted by MSE1 , is different from the frequentist MSE, which is defined by: ∗ The key difference is that (8) is defined at the point θ=θ , as opposed to ∀θ∈Θ. Unfortunately, statistics textbooks adopt one of the two definitions of the MSE – either at θ=θ∗ or ∀θ∈Θ – and ignore (or seem unaware) of the other. At first sight, his difference might appear pedantic, but it turns out that it has very serious implications for the relevant theory of optimality for the frequentist vs. Bayesian inference procedures. Indeed, reliance on ∀θ∈Θ undermines completely the relevance of admissibility in frequentist inference. Admissibility. An estimator e θ(X) is inadmissible if there exists another estimator b θ(X) such that: and the strict inequality (<) holds for at least one value of θ. Otherwise, e θ(X) b is said to be admissible with respect to the loss function L(θ, θ). 8 3.2 The duality between loss functions and priors The built-in affinity between the decision-theoretic set-up and Bayesian inference is cemented by a duality result between loss functions and prior distributions; see Robert (2001). This duality stems from the fact that minimizing the R Bayes risk: θ, θ)π(θ)dθ, RB (b θ)= θ∈Θ R(b is equivalent to minimizing the integral: R L(b θ(X), θ)π(θ|x)dθ. θ∈Θ This result brings out two important features of Bayesian inference. First, it confirms the minor role played by the quantifier x∈RnX in both Bayesian and decision-theoretic optimality theory of inference. Second, it indicates that L(θ, b θ) and π(θ) are perfect substitutes with respect to any weight function w(θ)>0, ∀θ∈Θ, in the derivation of Bayes rules. Modifying the loss function or the prior yields the same result: “... the problem of estimating θ with a modified (weighted) loss function is identical to the problem with a simple loss but with modified hyperparameters of the prior distribution while the form of the prior distribution does not change.” (Srivastava et al., 2014, p. 522) This implies that in practice a Bayesian could derive a particular Bayes estimate by attaching the weight to the loss function or to the prior distribution depending on which derivation is easier; see Bansal (2007), Srivastava et al. (2014). 3.3 Bayes rule and admissibility As argued in the sequel, it should come as no surprise to learn that Bayes rules dominate all other rules when admissibility is given center stage. A Bayes rule b θ B (X) with respect to a prior distribution π(θ) is: (i) Admissible, under certain regularity conditions, including when b θ B (X) is unique up to equivalence relative to the same risk function. (ii) Minimax when R(θ, b θB )=c<∞. (iii) An admissible estimate b θ(X) is either Bayes b θB (X) or the limit of a sequence of Bayes rules; see Wasserman (2004), Srivastava et al. (2014). These results have been used as evidence for the superiority of the Bayesian perspective, and led to the intimation that an effective way to generate optimal frequentist procedures is to find the Bayes solution using a reasonable prior and then examine their frequentist properties to see whether it is satisfactory from the latter viewpoint; see Rubin (1984), Gelman et al (2004). Even if one were to agree that Bayes rules and admissible estimators largely coincide, the importance of such a result hinges on the appropriateness of admissibility for frequentist estimators. 4 Loss functions and admissibility revisited The claim to be discussed in this section is that the notions of a ‘loss function’ and ‘admissibility’ are incompatible with the optimal theory of frequentist estimation largely framed by Fisher; see Savage (1976). 9 4.1 Admissibility as a minimal property The following example is used to call into question the notion of a loss function and the associated property of admissibility for optimal frequentist estimators. Example. In the context of the simple Normal model: Xk ∽ NIID(θ, 1), k=1, 2, ..., n, for n > 2, (10) let us use the decision-theoretic notion of MSE1 in (7) to compare two estimators of θ: Pn (i) the Maximum Likelihood Estimator (MLE): X n = n1 k=1 Xk , (ii) the ‘crystalball’ estimator: θcb =7405926, ∀x∈RnX . When compared on admissibility grounds, both estimators are admissible, and thus equally acceptable. Common sense, however, suggests that if a particular criterion of optimality cannot distinguish between X n [a strongly consistent, unbiased, fully efficient and sufficient estimator] and θcb , an arbitrarily chosen real number that ignores the data altogether, is not much of a minimal property. A moment’s reflection suggests that the inappropriateness of admissibility stems from its reliance on the quantifier ‘∀θ∈Θ’. The admissibility of θcb arises from the fact that for certain values of θ close to θcb , say θ∈(θcb ± √λn ), for 0<λ<1, θcb is ‘better’ than X n on MSE1 grounds: M SE1 (X n ; θ)= n1 > M SE1 (θ cb ; θ) ≤ λ2 n for θ∈(θcb ± √λn ). (11) Given that the primary objective of a frequentist estimator is to pin-point θ ∗ , the result in (11) seems totally irrelevant as a gauge of its capacity to achieve that! This example indicates that admissibility is totally ineffective as a minimal property because it does not filter out θcb , the worst possible estimator! Instead, it excludes potentially good estimators like the sample median; see Cox and Hinkley (1974). This highlights the ‘extreme relativism’ of admissibility to the particular loss function, L2 (b θ(X); θ), in this case. For the absolute loss function L1 (b θ(X); θ)=|b θ(X) − θ|, however, the sample median would have been the optimal estimator. What determines which loss function is appropriate in particular cases? Despite his wholehearted embrace of the decision-theoretic framing, Lehmann (1984) warned statisticians about the perils of arbitrary loss functions: “It is argued that the choice of a loss function, while less crucial than that of the model, exerts an important influence on the nature of the solution of a statistical decision problem, and that an arbitrary choice such as squared error may be baldly misleading as to the relative desirability of the competing procedures.” (p. 425) A strong case can be made that the key minimal property (necessary but not sufficient) for frequentist estimation is consistency, an extension of the Law of Large Numbers to estimators. For instance, consistency would have eliminated both e θ and θ cb from consideration; they are both inconsistent. This makes intuitive sense because if an estimator b θ(X) cannot pinpoint θ ∗ with an infinite data information, it should be considered impertinent. In contrast, there is 10 nothing in the notion of admissibility that advances learning from data about θ∗ . Further to relative (to particular loss functions) efficiency being a dubious property for frequentist estimators, the pertinent measure of finite sample precision for frequentist estimators is full efficiency, which is defined relative to the assumed statistical model (1), and not some arbitrary loss function based on information other than the data. 4.2 Stein’s paradox and admissibility The quintessential example that has bolstered the appeal of the Bayesian claims concerning admissibility is the James-Stein estimator (Efron and Morris, 1973), that gave rise to an extensive literature on shrinkage estimators; see Saleh (2006). Let X:=(X1 , X2 , ..., Xm ) be independent sample from a Normal distribution: Xk ∽ NI(θ k , σ 2 ), k=1, 2, ..., m, (12) 2 where σ is known. Using the notation θ:=(θ1 , θ2 , ..., θm ) and Im :=diag(1, 1, ..., 1), this can be denoted by: X ∽ N(θ, σ 2 Im ). b Find an optimal estimator θ(X) of θ with respect to the square ‘overall’ loss function: P 2 2 b b b (13) )= m L2 (θ, θ(X))=(k θ(X)−θk k=1 (θ k (X)−θ k ) . Stein (1956) astounded the statistical world by showing that for m=2 the LeastbLS (X)=X is admissible, but for m > 2 θ bLS (X) is Squares (LS) estimator θ inadmissible. Indeed, James and Stein (1961) were able to come up with a nonlinear estimator:   2 bJS (X)= 1 − (m−2)σ θ X, (14) 2 kXk bLS (X)=X that became known as the James-Stein estimator, which dominates θ in MSE1 terms by demonstrating that: bJS (X); θ) < MSE1 (θ bLS (X); θ), ∀θ∈Rm . (15) MSE1 (θ b It turns out that θ JM (X) is also inadmissible for m > 2 and dominated by the modified James-Stein estimator that is admissible:  + 2 b+ (X)= 1 − (m−2)σ θ X, 2 JS kXk + where (z) = max(0, z); see Wasserman (2004). The traditional interpretation of this result is that for the Normal, Independent model in (12), the James–Stein estimator (14) of θ:=(θ1 , θ2 , ..., θm ), for m > 2, reduces the overall MSE1 in (13). This result seems to imply that one will ‘do better’ (in overall MSE1 terms) by using a combined nonlinear (shrinkage) estimator, instead of estimating these means separately. What is surprising about this result is that there is no statistical reason (due to independence) to connect the inferences pertaining to the different individual means, and yet the obvious estimator (LS) is inadmissible. As argued next, this result calls into question the appropriateness of the notion of admissibility with respect to a particular loss function, and not the judiciousness of frequentist estimation. 11 5 Frequentist inference and learning from data The objectives and underlying reasoning of frequentist inference are inadequately discussed in the statistics literature. As a result some of its key differences with Bayesian inference remain beclouded. 5.1 Frequentist approach: primary objective and reasoning All forms of parametric frequentist inference begin with a prespecified statistical model Mθ (x)={f (x; θ), θ∈Θ}, x∈RnX . This model is chosen from the set of all possible models that could have given rise to data x0 :=(x1 , ..., xn ), by selecting the probabilistic structure for the underlying stochastic process {Xt , t∈N:=(1, 2, ..., n, ...)} in such a way so as to render the observed data x0 a ‘typical’ realization thereof. In light of the fact that each value of θ∈Θ represents a different element of the family of models represented by Mθ (x), the primary objective of frequentist inference is to learn from data about the ‘true’ model: M∗ (x)={f (x; θ∗ )}, x∈RnX , (16) ∗ where θ denotes the true value of θ in Θ. The ‘typicality’ is testable vis-a-vis the data x0 using misspecification testing; see Spanos(2006). The frequentist approach relies on two modes of reasoning for inference purposes: Factual (estimation, prediction): Hypothetical (hypothesis testing): f (x; θ∗ ), ∀x∈RnX , f (x; θ0 ), f (x; θ1 ), ∀x∈RnX , where θ ∗ denotes the true value of θ in Θ, and θi , i=0, 1 denote hypothesized values of θ associated with the hypotheses, H0 : θ0 ∈Θ0 , H1 : θ1 ∈Θ1 , where Θ0 and Θ1 constitute a partition of Θ. A frequentist estimator b θ aims to pin-point θ ∗ , and its optimality is evaluated by how effectively it achieves that. Similarly, a test statistic usually compares a good estimator b θ of θ with a prespecified value θ0 , but behind b θ is the value θ∗ assumed to have generated data x0 . Hence, the hypothetical reasoning is used in testing to learn about θ∗ , and has nothing to do with all possible values of θ in Θ. This contradicts misleading claims by Bayesian textbooks (Robert, 2001, p. 61): “The frequentist paradigm relies on this criterion [risk function] to compare estimators and, if possible, to select the best estimator, the reasoning being that estimators are evaluated on their long-run performance for all possible values of the parameter θ.” Contrary to this claim, the only relevant value of θ in evaluating the ‘optimality’ of b θ is θ ∗ . Such misleading claims stem from an apparent confusion between the existential and universal quantifiers in framing certain inferential assertions. The existence of θ∗ can be formally defined using the existential quantifier: ∃θ ∗ ∈Θ : there exists a θ ∗ ∈Θ such that. 12 This introduces a potential conflict between the existential and the universal quantifier ‘∀θ∈Θ’ because neither the decision theoretic nor the Bayesian approach explicitly invoke θ ∗ . Decision-theoretic and Bayesian rules are considered optimal when they minimize the expected loss ∀θ∈Θ, no matter what θ∗ happens to be. How different the two quantifiers are, can be demonstrated using elementary logic. The logical connective for negation (¬) can be used to define the following equivalence relationships between the two quantifiers: (i) ∃θ ∗ ∈Θ ⇐⇒ ¬∀θ ∈Θ, / (ii) ∀θ∈Θ ⇐⇒ ¬∃θ ∗ ∈Θ / Given that (i)-(ii) involve double negations, the two quantifiers could not be further apart. At first sight the quantifier ∀θ∈Θ seems rather innocuous and natural in the context of statistical inference. It seems intuitively obvious that one should care about the behavior of an estimator b θ for all possible values of θ. This is misleading intuition, however, since the behavior of b θ, for all θ∈Θ, although relevant, is not what determines how effective a frequentist estimator is at pinpointing θ∗ ; what matters is its behavior around θ∗ . Assessing its effectiveness calls for evaluating (deductively) the sampling distribution of b θ under θ=θ ∗ , or hypothetical values θ0 and θ1 , and not for all possible values of θ in Θ. Let’s unpack the details of this claim. 5.2 Frequentist estimation The underlying reasoning for frequentist estimation is factual , in the sense the optimality of an estimator is appraised in terms of its generic capacity of b θn (X) to zero-in on (pinpoint) the true value θ∗ , whatever the sample realization X=x0 . Optimal properties like consistency, unbiasedness, full efficiency, sufficiency, etc., calibrate this generic capacity using its sampling distribution of b θn (X) evaluated under θ=θ∗ i.e., in terms of f (b θn (x); θ ∗ ), for x∈RnX . For instance, strong consistency asserts that as n → ∞, b θn (X) will zero-in on θ∗ almost surely: P( lim b θn (X)=θ∗ )=1. n→∞ Similarly, unbiasedness asserts that the sampling distribution of b θn (X) has a mean equal to θ∗ : E(b θ n (X))=θ∗ . In this sense both of these optimal properties are defined at the point θ=θ∗ . This is achieved by using factual reasoning, i.e. evaluating the sampling distribution of b θ n (X) under the true state of nature (θ=θ∗ ), without having to know θ∗ . This is in contrast to using loss functions, such as (2), which are defined in terms of θ∗ but are rendered non-operational without knowing θ ∗ . Example. In the case of the simple Normal model in (10) the point estimator, X n is consistent, unbiased, fully efficient, sufficient, with a sampling distribution: (17) X n ∽ N(θ, n1 ). What is not usually explicitly stated is that the evaluation of that distribution is factual, i.e. θ=θ∗ , and should formally denoted by: θ=θ ∗ X n ∽ N(θ∗ , n1 ). 13 When X n is standardized, it yields the pivotal function:  θ=θ∗ √ d(X;θ):= n X n − θ∗ ∽ N(0, 1), (18) whose distribution only holds for the true θ∗ , and no other value. This provides the basis for constructing a (1−α) Confidence Interval (CI):   P X m − c α2 ( √1n ) ≤ θ ≤ X n + c α2 ( √1n ); θ=θ∗ =1−α, (19) which asserts that the random interval [X n −c α2 ( √sn ), X n +c α2 ( √sn )], will cover (overlay) the true mean θ∗ , whatever that happens to be, with probability (1−α), or equivalently, the error of coverage is α. Hence, frequentist estimation the coverage error probability depends only on the sampling distribution of X n and is attached to random interval for all values θ6=θ ∗ without requiring one to know θ∗ . The evaluation at θ=θ ∗ calls into question the decision-theoretic definition of unbiasedness: E(b θ n (X))=θ, ∀θ∈Θ, for frequentist estimation since this assertion makes no sense for all values θ in Θ, but does make sense when defined at θ=θ∗ . Similarly, the appropriate frequentist definition of the MSE for an estimator, initially proposed by Fisher (1920), is defined at the point θ=θ∗ : (20) M SE(b θn (X); θ ∗ )=E(b θn (X)−θ∗ )2 , for θ ∗ in Θ. Indeed, the well-known decomposition: M SE(b θ(X); θ ∗ )=V ar(b θ(X))+[E(b θ n (X))−θ ∗ ]2 , for θ∗ in Θ, (21) ∗ is meaningful only when defined at the point θ=θ (true mean) since by definition: V ar(b θ(X))=E[b θ n (X)−θm ]2 , θ m =E(b θ n (X)) Bias(b θn (X); θ ∗ )=E(b θn (X))−θ ∗ , (22) and thus, the variance and the bias involve only two values of θ in Θ, θ m and θ∗ , and when θm =θ∗ the estimator is unbiased. This implies that the apparent affinity between the MSE1 defined in (7) and the variance of an estimator is more apparent than real because the latter makes frequentist sense only when θm =E(b θn (X)) is a single point. 5.3 James-Stein estimator from a frequentist perspective For a proper frequentist evaluation of the above James-Stein result, it is important to bring out the conflict between the overall MSE (13) and the factual reasoning underlying frequentist estimation. From the latter perspective, the James-Stein estimator raises several issues of concern. bLS (X) and the James-Stein θ bJS (X) estimaFirst, both the Least-Squares θ tors are inconsistent estimators of θ since the underlying model suffers from the incidental parameter problem: there is essentially one observation (Xk ) for each unknown parameter (θ k ), and as m → ∞ the number of unknown parameters increases at the same rate. To bring out the futility of comparing these two estimators more clearly, consider the following simpler example. 14 Example. Let X:=(X1 , X2 , ..., Xn ) be a sample from the simple Normal model in (10). Comparing the two estimators b θ 1 =Xn , b θ2 = 21 (X1 +Xn ) and b b inferring that θ2 is relatively more efficient than θ1 relative to a square loss function, i.e. MSE(b θ 2 (X); θ)=1 < MSE(b θ1 (X); θ)= 12 , ∀θ∈R, is totally uninteresting because both estimators are inconsistent! Second, to be able to discuss the role of admissibility in the Stein (1956) result, we need to consider a consistent James-Stein estimator, by extending the original data to a panel (longitudinal) data where the sample is: Xt :=(X1t , X2t , ..., Xmt ), t=1, 2, ..., n. In this case the consistent Least-Squares and James-Stein estimators are: n  bLS (X)= X 1 , X 2 , ..., X m , where X k = 1 P Xkt , k=1, 2, ..., m, θ n t=1  +  2 + (m−2)σ b θ JS (X)= 1 − kXk2 X, where X:= X 1 , X 2 , ..., X m . This enables us to evaluate the notion of ‘relatively better’ more objectively. Admissibility relative to the overall loss function in (13) introduces a tradeoff between the accuracy of the estimators for individual parameters θ:=(θ 1 , θ2 , ..., θ m ) and the ‘overall’ expected loss. The question is: ‘In what sense the overall MSE among a group of mean estimates provides a better measure of ‘error’ in learning about the true values θ∗ :=(θ ∗1 , θ∗2 , ..., θ∗m )?’ The short answer is: it doesn’t. Indeed, the overall MSE will be irrelevant when the primary objective of estimation is to learn from data about θ∗ . This is because the particular loss function penalizes the estimator’s capacity to pin-point θ ∗ by trading an increase in bias for a decrease in the overall MSE in (13), when the latter is misleadingly evaluated over all θ in Θ:=Rm . That is, the James-Stein estimator flouts the primary objective of pin-pointing θ∗ in favor of reducing the overall MSE ∀θ∈Θ. In summary, the above discussion suggests that there is nothing paradoxical about Stein’s (1956) original result. What is problematic is not the least-squares estimator, but the choice of ‘better’ in terms of admissibility relative to an overall MSE in evaluating the accuracy of the estimators of θ. 5.4 Frequentist hypothesis testing Another frequentist inference procedure one can employ to learn from data about θ∗ is hypothesis testing, where the question posed is whether θ∗ is close enough to some prespecified value θ 0 . In contrast to estimation, the reasoning underlying frequentist testing is hypothetical in nature. 5.4.1 Legitimate frequentist error probabilities For testing the hypotheses: H0 : θ ≤ θ 0 vs. H1 : θ > θ 0 , where θ 0 is a prespecified value, one utilizes the same sampling distribution X n ∽N(θ, n1 ), but transforms the  √ pivot d(X;θ):= n X n −θ∗ into the test statistic by replacing θ∗ with the pre √ specified value θ0 , yielding d(X):= n X n −θ0 . However, instead of evaluating 15 it under the factual θ=θ∗ , it is now evaluated under various hypothetical scenarios associated with H0 and H1 to yield two types of (hypothetical) sampling distributions:  θ=θ √ (I) d(X):= n X n − θ 0 ∽ 0 N(0, 1),  θ=θ √ √ (II) d(X):= n X n −θ 0 ∽ 1 N(δ 1 , 1), δ 1 = n (θ1 −θ0 ) for θ1 > θ0 . In both cases (I)-(II) the underlying reasoning is hypothetical in the sense that the factual in (18) is replaced by hypothesized values of θ, and the test statistic d(X) provides a standardized distance between the hypothesized values (θ0 or θ1 ) and θ∗ the true θ, assumed to underlie the generation of the data x0 , yielding d(x0 ). Using the sampling distribution in (I) one can define the following legitimate error probabilities: significance level: P(d(X) > cα ; H0 ) = α, (23) p-value: P(d(X) > d(x0 ); H0 )=p(x0 ). Using the sampling distribution in (II) one can define: type II error prob.: P(d(X)≤cα ; θ=θ1 )=β(θ 1 ), for θ 1 >θ 0 , (24) power: P(d(X)>cα ; θ=θ1 )=̺(θ 1 ), for θ1 >θ0 . It can be shown that the test Tα , defined by the test statistic d(X) and the rejection region C1 (α)={x :d(x) > cα }, constitutes a Uniformly Most Powerful (UMP) test for significance level α; see Lehmann (1959). The type I [II] error probability is associated with test Tα erroneously rejecting [accepting] H0 . The type I and II error probabilities evaluate the generic capacity [whatever the sample realization x∈Rn ] of a test to reach correct inferences. Contrary to Bayesian claims, these error probabilities have nothing to do with the temporal or the physical dimension of the long-run metaphor associated with repeated samples. The relevant feature of the long-run metaphor is the repeatability (in principle) of the DGM represented by Mθ (x); this feature can be easily operationalized using computer simulation; see Spanos (2013). The key difference between the significance level α and the p-value is that the former is a pre-data and the latter a post-data error probability. Indeed, the p-value can be viewed as the smallest significance level α at which H0 would have been rejected with data x0 . The legitimacy of post-data error probabilities underlying the hypothetical reasoning can be used to go beyond the N-P accept/reject rules and provide an evidential interpretation pertaining to the discrepancy γ from the null warranted by data x0 ; see Mayo and Spanos (2006). Despite the fact that frequentist testing uses hypothetical reasoning, its main ∗ ∗ n objective is also to learn from data about the  M (x)={f (x; θ )}, x∈RX . √ true model This is because a test statistic like d(X):= n X n −θ0 constitutes nothing more than a scaled distance between θ∗ [the value behind the generation of xn ], and a hypothesized value θ0 , with θ∗ being replaced by its ‘best’ estimator X n . 6 Revisiting loss and risk functions The above discussion raises serious questions about the role of loss functions and admissibility in evaluating learning from data x0 about θ∗ . In particular: 16 (i) What does the extraneous information concerning costs associated with different parameter values have to do with learning about θ∗ ? (ii) In what sense is an inconsistent but relatively (to a particular loss function) efficient an ‘optimal’ estimator for learning about θ∗ ? (iii) Why is the overall MSE more important than learning from data about the true values of θ∗ ? 6.1 Where do loss functions come from? A closer scrutiny of the decision-theoretic set up reveals that the loss function needs to invoke ‘information from sources other than the data’, which is usually not readily available. Indeed, such information is available in very restrictive situations, such as acceptance sampling in quality control. In light of that, a proper understanding of the intended scope of statistical inference calls for distinguishing the special cases where the loss function is part and parcel of the available substantive information from those that no such information is either relevant or available. Tiao and Box (1975), p. 624, reiterated Fisher’s (1935) distinction: “Now it is undoubtedly true that on the one hand that situations exist where the loss function is at least approximately known (for example certain problems in business) and sampling inspection are of this sort. ... On the other hand, a vast number of inferential problems occur, particularly in the analysis of scientific data, where there is no way of knowing in advance to what use the results of research will subsequently be put.” Cox (1978), p. 45, went further and questioned this framing even in cases where the inference might involve a decision: “The reasons that the detailed techniques [decision-theoretic] seem of fairly limited applicability, even when a fairly clear cut decision element is involved, may be (i) that, except in such fields as control theory and acceptance sampling, a major contribution of statistical technique is in presenting the evidence in incisive form for discussion, rather than in providing mechanical presentation for the final decision. This is especially the case when a single major decision is involved. (ii) The central difficulty may be in formulating the elements required for the quantitative analysis, rather than in combining these elements via a decision rule.” Another important aspect of using loss functions in inference is that in practice they seem to be an add-on to the inference itself since they bring to the problem the information other than the data. In particular, the same statistical inference problem can give rise to very different decisions/actions depending on one’s loss function. To illustrate that consider an example from Chatterjee (2002): “... consider the case of a new drug whose effects are studied by a research scientist attached to the laboratory of a pharmaceutical company. The conclusion of the study may have different bearings on the action to be taken by (a) the scientist whose line of further investigation would depend on it, (b) the company whose business decisions would determined by it, and (c) the Government whose policies as to health care, drug control, etc. would take shape on that basis.” (p. 72) 17 In practice, each one of these different agents is likely to have a very different loss function, but their inferences have a common denominator: the scientific evidence which relating to the true θ that stems solely from the observed data? Finally, the extreme relativism of loss function optimality renders decisiontheoretic and Bayes rules highly vulnerable to abuse. In practice, one can justify any estimator as optimal, however lame in terms of other criteria, by selecting the ”appropriate” loss function. Example. Consider a manufacturer of high precision bolts and nuts who has information that the buyer only checks the first and last box for quality control when accepting an order. This suggests that to minimize losses, stemming from the return of its products as defective, an appropriate loss function might be: 2 L(X; θ)= ([(X1 +Xn )/2] − θ) , θ∈(0, 1). (25) The ‘optimal’ estimator relative to (25) is e θ=(X1 +Xn )/2, but e θ is a terrible ∗ estimator for pinpointing θ because it is inconsistent! 6.2 Loss functions vs. inherent distance functions The notion of a loss function stemming from ‘information other than the data’ raises another source of potential conflict. This stems from the fact that within each statistical model Mθ (x) there exists an inherent statistical distance function, often relating to the log-likelihood and the score function, and hence stemming from information contained in the data; see Casella and Berger (2002). It is well-known that when the distribution underlying Mθ (x) is Normal, the inherent distance function for comparing estimators of the mean (θ) is the square: N D(b θn (X); θ ∗ )=(b θ n (X) − θ∗ )2 . On the other hand, when the distribution is Laplace the relevant statistical distance function is the Absolute Distance (see Shao, 2003): AD(b θ n (X); θ ∗ ) = |b θ n (X) − θ∗ |. Similarly, when the distribution underlying Mθ (x) is Uniform, the inherent distance function is: SU P (b θn (X); θ ∗ ) = sup |b θn (x) − θ∗ |. x∈Rn X A key feature of all these distance functions is that they are defined at the point θ=θ∗ and not for all θ in Θ, as the traditional loss functions. The question that naturally arises is when it might make sense to ignore these inherent distance functions and compare estimators using an externally given loss function. The key difference between the two is that any assumptions that comprise the likelihood function are testable vis-a-vis the data, but those underlying the loss function are not. Moreover, the likelihood function gives rise to a ‘global’ notion of optimality, known as full efficiency defined at θ=θ∗ in terms of Fisher’s information:   2 ∂ ln L(θ) ∗ ∗ . (θ ), I (θ ):=E − CR(θ ∗ )=I−1 n ⊤ n ∂θ∂θ What is an optimal estimator depends only on the information contained in the statistical model Mθ (x). This contrasts with admissibility which is a property defined in terms of ‘local’ optimality relative to a loss function based on outside information and evaluated ∀θ∈Rm . 18 6.3 Decisions vs. inferences The above discussion brings out the crucial distinction between a ‘decision’ and an ‘inference’ stemming from data x0 . Even before Wald (1939) introduced the decision-theoretic perspective, Fisher (1935) perceptively argued: “In the field of pure research no assessment of the cost of wrong conclusions, or of delay in arriving at more correct conclusions can conceivably be more than a pretence, and in any case such an assessment would be inadmissible and irrelevant in judging the state of the scientific evidence.” (pp. 25-26) Tukey (1960) echoed Fisher’s view by contrasting decisions vs. inferences: “Like any other human endeavor, science involves many decisions, but it progresses by the building up of a fairly well established body of knowledge. This body grows by the reaching of conclusions – by acts whose essential characteristics differ widely from the making of decisions. Conclusions are established with careful regard to evidence, but without regard to consequences of specific actions in specific circumstances.” (p. 425) Tukey also recognized how decision theory distorts frequentist testing by replacing error probabilities with losses and costs: “Wald’s decision theory ... has given up fixed probability of errors of the first kind, and has focused on gains, losses or regrets.” (p. 433) Hacking (1965) brought out the key difference between an ‘inference pertaining to evidence’ for or against a hypothesis, and a ‘decision to do something’ as a result of an inference: “... to conclude that an hypothesis is best supported is, apparently, to decide that the hypothesis in question is best supported. Hence it is a decision like any other. But this inference is fallacious. Deciding that something is the case differs from deciding to do something. ... Hence deciding to do something falls squarely in the province of decision theory, but deciding that something is the case does not.” (p. 31) This issue was elaborated upon by Birnbaum (1977), p. 19: “Two contrasting interpretations of the decision concept are formulated: behavioral, applicable to ‘decisions’ in a concrete literal sense as in acceptance sampling; evidential, and applicable to ‘decisions’ such as ’reject H0 ’ in a research context, where the pattern and strength of statistical evidence concerning statistical hypotheses is of central interest.” 6.4 Acceptance sampling vs. learning from data Let us bring out the key features of a situation where the above decisiontheoretic set up makes perfectly good sense. This is the situation Fisher (1955) called acceptance sampling, such as an industrial production process where the objective is quality control, i.e. to make a decision pertaining to shipping substandard products (e.g. nuts and bolts) to a buyer using the expected loss/gain as the ultimate criterion. In an acceptance sampling context, the MSE(b θ(X); θ), or some other risk function, are relevant because they evaluate genuine losses associated with a decision related to the choice of an estimate b θ(x0 ), say the cost of the observed 19 percentage of defective products, but that has nothing to do with type I and II error probabilities. Acceptance sampling differs from a scientific enquiry in two crucial respects: [a] The primary aim is to use statistical rules to guide actions astutely, e.g. use b θ(x0 ) in order to minimize the expected loss associated with “a decision”, and [b] The sagacity of all actions is determined by the respective ‘losses’ stemming from “relevant information other than the data” (Cox and Hinkley, 1974, p. 251). The key difference between acceptance sampling and a scientific inquiry is that the primary objective of the latter is not to minimize expected loss (costs, utility) associated with different values of θ∈Θ, but to use data x0 to learn about the ‘true’ model (16). The two situations are drastically different mainly because the key notion of a ‘true θ’ calls into question the above acceptance sampling set up. Indeed, the loss function being defined ‘∀θ∈Θ’, will penalize θ∗ , since there is no reason to believe that the lowest ranked θ would coincide with θ∗ , unless by accident. Consider the case where acceptance sampling resembles hypothesis testing in so far as final products are randomly selected for inspection during the production process. In such a situation the main objective can be viewed as operationalizing the probabilities of false acceptance/rejection with a view to minimize the expected losses. The conventional wisdom has been that this situation is similar enough to Neyman-Pearson (N-P) testing to render the latter as the appropriate framing for the decision to ship this particular batch or not. However, a closer look at some of the examples used to illustrate such a situation (Silvey, 1975), reveals that the decisions are driven exclusively by the risk function and not by any quest to learn from data about the true θ∗ . For instance, N-P way of addressing the trade-off between the two types of error probabilities, fixing α to a small value and seek a test that minimizes the type II error probability, seems utterly irrelevant in such a context. One can easily think of a loss function where the ‘optimal’ trade-off calls for a much larger type I than type II error probability. In light of the above discussion, what is different in acceptance sampling is that: [c] The trade-off between the two types of error probabilities is determined by the risk function itself, and not by any attempt to learn from data about θ ∗ . Indeed, this learning is deliberately undermined by certain loss function such as the overall MSE (13) that favor biased estimators of the James-Stein type. Given the crucial differences in [a]-[c], one can make a strong case that the objectives and the underlying reasoning of acceptance sampling are drastically different from those pertaining to learning from data in a scientific context. 6.5 Is expected loss a legitimate frequentist error? The key question is whether expected loss is a legitimate frequentist error like bias, MSE and the type I-II error. ‘What do these legitimate frequentist errors have in common?’ 20 First, they stem directly from the statistical model Mθ (x) since the underlying sampling distributions of estimators, test statistics and predictors are derived exclusively from the distribution of the sample f (x; θ) via (4). In this sense, the relevant error probabilities are directly related to statistical information pertaining to the data as summarized by the statistical model Mθ (x) itself. Second, they are attached to a particular frequentist inference procedure as they relate to a relevant inferential claim. These error probabilities calibrate the effectiveness of inference procedures in learning from data about the true statistical model M∗ (x)={f (x; θ∗ )}, x∈RnX . In light of these features, the question is: ‘in what sense a risk function could potentially represent relevant frequentist errors?’ That argument that the risk function represents legitimate frequentist errors because it is derived by taking expectations with respect to f (x; θ), x∈RnX (Robert (2001), is misguided for two reasons. (a) The relevant errors in estimation, including the bias E(b θ n (X))−θ∗ and ∗ ∗ 2 MSE E(b θn (X)−θ ) , are evaluated with respect to f (x; θ ), x∈RnX , by invoking factual reasoning (θ ∗ is assumed to be the state of Nature). Wald’s (1939) original loss function in (2) represents an interesting case because it is defined in terms of θ∗ , which renders it non-operational when evaluated for all θ in Θ, since θ∗ is unknown in practice. In contrast, the errors associated with the bias and MSE are rendered operational by the factual reasoning fashioned to forgo knowing θ∗ . (b) The expected losses stemming from the risk function R(θ, b θ) are attached to particular values of θ in Θ. Such an assignment is in direct conflict with all the above legitimate error probabilities that are attached to the inference procedure itself, and never to the particular values of θ in Θ. The expected loss assigned to each value of θ in Θ has nothing to do with learning from data about θ ∗ . Indeed, the risk function will penalize a procedure for pin-pointing θ∗ since the latter is unknown in practice. This is in direct conflict with the main objective of frequentist estimation but in sync with ‘acceptance sampling’, where the objective of the inference has everything to do with expected losses. 7 Summary and conclusions The paper makes a case for Fisher’s (1935; 1955) assertions concerning the appropriateness of the decision-theoretic framing for ‘acceptance sampling’ and its inappropriateness for frequentist inference. A closer look at this framing reveals that it is congruent with the Bayesian approach because provides it with a theory of optimal inference. Decision-theoretic and Bayesian rules are considered optimal when they minimize the expected loss for all possible values of θ [∀θ∈Θ], irrespective of what the true value θ ∗ happens to be. In contrast, the theory of optimal frequentist inference revolves around the true value θ∗ , since it depends entirely on the capacity of the procedure to pinpoint θ∗ . The frequentist approach relies on factual (estimation, prediction), as well as hypothetical (testing) reasoning, both of which revolve around the existential quantifier ∃θ ∗ ∈Θ. 21 The inappropriateness of the quantifier ∀θ∈Θ calls into question the relevance of admissibility as a minimal property for frequentist estimators. A strong case can be made that the relevant minimal property for frequentist estimators is consistency. In addition, full efficiency provides the relevant measure of an estimator’s finite sample efficiency (accuracy) in pinpointing θ∗ . Both of these properties stem from the underlying statistical model Mθ (x), in contrast to admissibility which relies on loss functions based on information other than the data. It is argued that Stein’s (1956) result stems from the fact that admissibility introduces a trade-off between the accuracy of the estimator in pinpointing θ∗ and the ‘overall’ expected loss. That is, the James-Stein estimator achieves a higher overall MSE by blunting the capacity of a frequentist estimator to pinpoint θ ∗ . Why would a frequentist care about the overall MSE defined for all θ in Θ? After all, expected losses are not legitimate errors similar to bias and MSE (when properly defined), as well as coverage, type I and II errors. The latter are attached to the frequentist procedures themselves to calibrate their capacity to achieve learning from data about θ ∗ . In contrast, expected losses are assigned to different values of θ in Θ, using information other than the data. References [1] Bansal, A.K. (2007), Bayesian Parametric Inference, Alpha Science, Oxford. [2] Berger, J.O. (1985), Statistical Decision Theory and Bayesian Analysis, 2nd edition, Springer, NY. [3] Birnbaum, A. (1977), “The Neyman-Pearson Theory as Decision Theory, and as Inference Theory; with a Criticism of the Lindley-Savage argument for Bayesian Theory”, Synthese, 36: 19-49. [4] Casella, G. and R. L. Berger (2002), Statistical Inference, 2nd ed., Duxbury, CA. [5] Chatterjee, S.K. (2002), Statistical Thought: A Perspective and History, Oxford University Press, Oxford. [6] Cox, D. R. (1958), “Some Problems Connected with Statistical Inference,” The Annals of Mathematical Statistics, 29: 357-372. [7] Cox, D.R. (1978), “Foundations of Statistical Inference: the Case for Eclecticism”, Australian Journal of Statistics, 20: 43-59. [8] Cox, D.R. and D.V. Hinkley (1974), Theoretical Statistics, Chapman & Hall, London. [9] Efron, B. and C.N. Morris (1973), “Stein’s estimation rule and its competitors–an empirical Bayes approach”, Journal of the American Statistical Association, 68: 117–130. [10] Ferguson, T.S. (1967), Mathematical Statistics: A Decision Theoretic Approach, Academic Press, London. 22 [11] Ferguson, T.S. (1976), “Development of the Decision Model”, ch. 16 in On the History of Statistics and Probability, edited by D. B. Owen, Marcel Dekker, NY. [12] Fisher, R.A. (1920), “A Mathematical Examination of the Methods of Determining the Accuracy of an Observation by the Mean Error, and by the Mean Square Error”, Monthly Notices of the Royal Astronomical Society, 80: 758-770. [13] Fisher, R.A. (1935), The Design of Experiments, Oliver and Boyd, Edinburgh. [14] Fisher, R.A. (1955), “Statistical methods and scientific induction”, Journal of the Royal Statistical Society, B, 17: 69-78. [15] Gelman, A., J.B. Carlin and D.B. Rubin (2004), Bayesian Data Analysis, 2nd edition, Chapman & Hall, London. [16] Hacking, I. (1965), Logic of Statistical Inference, Cambridge University Press, Cambridge. [17] James, W. and C. Stein (1961), “Estimation with quadratic loss”, Proceedings of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, 1: 361–379. [18] LeCam, L. (1955), “An extension of Wald’s theory of statistical decision functions”, Annals of Mathematical Statistics, 26: 69-81. [19] LeCam, L. (1986), Asymptotic Methods in Statistical Decision Theory, Springer, NY. [20] Lehmann, E.L. (1959), Testing Statistical Hypotheses, Wiley, NY. [21] Lehmann, E.L. (1984), “Specification Problems in the Neyman-PearsonWald Theory”, pp. 425-436 in Statistics: An Appraisal, edited by H.A. David and H.T. David, The Iowa State University Press, Ames, IA. [22] Lindley, D.V. (1965), Introduction to Probability and Statistics from a Bayesian Viewpoint, Part 2: Inference, Cambridge University Press, Cambridge. [23] Mayo, D. G. and A. Spanos, (2006), “Severe Testing as a Basic Concept in a Neyman-Pearson Philosophy of Induction,” The British Journal for the Philosophy of Science, 57: 323-357. [24] Neyman, J. (1937), “Outline of a theory of statistical estimation based on the classical theory of probability”, Philosophical Transactions of the Royal Society of London, Series A, 236: 333-380. [25] Neyman, J. (1952), Lectures and Conferences on Mathematical Statistics and Probability, 2nd ed. U.S. Department of Agriculture, Washington. [26] Neyman, J. (1967), A Selection of Early Statistical Papers by J. Neyman, University of California Press, CA. [27] Neyman, J. (1971), “Foundations of Behavioristic Statistics”, pp.1-13, in Godambe, V. and Sprott, D. (1971), eds., Foundations of Statistical Inference, Holt, Rinehart and Winston of Canada, Toronto. [28] O’Hagan, A. (1994), Bayesian Inference, Edward Arnold, London. [29] Reid, N. (2015), “Statistical Sufficiency”, pp. 418–422 in International Encyclopedia of the Social & Behavioral Sciences, edited by J.D. Wright, 2nd edition, Vol 23. Elsevier, Oxford. 23 [30] Robert, C.P. (2001), The Bayesian Choice: From Decision-Theoretic Foundations to Computational Implementation, 2nd ed., Springer, NY. [31] Rubin, D.B. (1984), “Bayesianly justifiable and relevant frequency calculation for the applied statistician”, Annals of Statistics, 12: 1151-1172. [32] Saleh, A.K. Md. E. (2006), Theory of Preliminary Test and Stein-Type Estimation with Applications, Wiley-Interscience, NY. [33] Savage, L.J. (1976), “On Rereading R.A. Fisher”, The Annals of Statistics, 4(3): 441-500. [34] Schervish, M.J. (1995), Theory of Statistics, Springer-Verlag, NY. [35] Shao, J. (2003), Mathematical Statistics, 2nd ed., Springer, NY. [36] Silvey, S.D. (1975), Statistical Inference, Chapman & Hall, London. [37] Spanos, A. (2006), “Where Do Statistical Models Come From? Revisiting the Problem of Specification”, pp. 98-119 in Optimality: The Second Erich L. Lehmann Symposium, edited by J. Rojo, Lecture Notes-Monograph Series, vol. 49, Institute of Mathematical Statistics. [38] Spanos, A. (2013), “A Frequentist Interpretation of Probability for Modelbased Inductive Inference”, Synthese, 190: 1555-1585. [39] Spanos, A. (2015), “Revisiting Bayes’ Rule and Evidence: Notional Events vs. Real Data”, Virginia Tech, working paper. [40] Spanos, A. and D.G. Mayo (2015), “Error statistical modeling and inference: Where methodology meets ontology”, Synthese, 192: 3533-3555. [41] Srivastava, M.K., A.H. Khan and N. Srivastava (2014), Statistical Inference: Theory of Estimation, PHI Learning, Delhi, India. [42] Stein, C. (1956), “Inadmissibility of the usual estimator for the mean of a multivariate distribution”, Proceedings of the Third Berkeley Symposium on Mathematical Statistics and Probability, 1: 197–206. [43] Tiao, G.C. and G.E.P. Box (1975), “Some comments on ”Bayes” estimators”, pp. 619-626 in Studies in Bayesian Econometrics and Statistics, In Honor of Leonard J. Savage, edited by S. E Fienberg and A. Zellner, NorthHolland, Amsterdam. [44] Tukey, J.W. (1960), “Conclusions vs Decisions”, Technometrics, 2: 423433. [45] Wald, A. (1939), “Contributions to the Theory of Statistical Estimation and Testing Hypotheses”, Annals of Mathematical Statistics, 10: 299-326. [46] Wald, A. (1947), “An essentially complete family class of admissible decision functions”, Annals of Mathematical Statistics, 18: 549-555. [47] Wald, A. (1950), Statistical Decision Functions, Wiley, NY. [48] Wasserman, L. (2004), All of Statistics, Springer, NY. 24
10math.ST
Facial Expression Recognition Based on Complexity Perception Classification Algorithm Tianyuan Chang , Guihua Wen* , Yang Hu , JiaJiong Ma School of Computer Science and Engineering, South China University of Technology,Guangzhou, China [email protected], [email protected] Abstract Facial expression recognition (FER) has always been a challenging issue in computer vision. The different expressions of emotion and uncontrolled environmental factors lead to inconsistencies in the complexity of FER and variability of between expression categories, which is often overlooked in most facial expression recognition systems. In order to solve this problem effectively, we presented a simple and efficient CNN model to extract facial features, and proposed a complexity perception classification (CPC) algorithm for FER. The CPC algorithm divided the dataset into an easy classification sample subspace and a complex classification sample subspace by evaluating the complexity of facial features that are suitable for classification. The experimental results of our proposed algorithm on Fer2013 and CK+ datasets demonstrated the algorithm’s effectiveness and superiority over other state-of-the-art approaches. 1 Introduction Facial expression recognition (FER) has a wide range of research prospects in human computer interaction and affective computing, including polygraph detection, intelligent security, entertainment, Internet education, intelligent medical treatment, etc. As we all know facial expression is a major way of expressing human emotions. Hence, the main task in determining emotion is how to automatically, reliably, and efficiently recognize the information conveyed by facial expressions. In FER research, Ekman and Friensen first proposed the Facial Action Coding System (FACS) [Friensen and Ekman, 1983]. The six basic categories of expressions (surprise, sadness, disgust, anger, happiness, and fear) are defined in FACS, and are commonly used as the basic expression labels. FER methods can be roughly divided into three types [Sun et al., 2017; Yan et al., 2017]: geometry-based methods, appearance-based methods, and hybrid methods. Geometry-based methods describe features mainly through geometric relationships such as key points on the face, face positions and shapes. Appearance-based methods extract the entire facial image as a whole. Lastly, hybrid methods com- bine the first two methods to extract local and global facial features of face images, respectively. Compared with appearance-based methods, the utility of geometry-based methods requires further improvement because it is difficult to accurately label the key points and effective positions of the face in practical applications. Most FER works focus on feature extraction and classifier construction, which can be divided into static and dynamic classification methods [Corneanu et al., 2016]. Static classification methods are applicable for a single static image, and include SVM classifiers, Bayesian network classifiers, Random forests, and Softmax classifiers. Dynamic classification is applied to facial video sequences, taking into account features independently extracted from each frame over time as a basis; the main dynamic classification models are HMM [Le et al., 2011] and VSL-CRF [Walecki et al., 2015]. In recent years, different methods of traditional machine learning have been used in FER to extract appearance features of images, including Gabor filters, local binary patterns (LBP) [Savran et al., 2015], local Gabor binary patterns (LGBP) [Zhang et al., 2005], histograms of oriented gradients (HOG) [Dahmane et al., 2011], and scale-invariant feature transform (SIFT) [Berretti et al., 2011]. These traditional methods tend to be more effective in specific small sample sets, but are difficult to adjust to identify new face images, which brings challenges to FER in uncontrolled environments. This is because the extracted features often belong to low-level features, and it is hard to extract and find meaningful information that distinguishes the different categories from the data. However, a new recognition framework utilizing a convolutional neural network (CNN) [Ranzato et al., 2011; Liu et al., 2014; Kim et al., 2015] based on a deep learning network has achieved remarkable results in FER, and has been used for feature extraction and recognition. Multiple convolution and pooling layers in a CNN may extract higher and multi-level features of the entire face or local area, and has good classification performance of facial expression image features. At present, there are still some deficiencies in FER. Many related work focus on the improvement of classification models and feature extraction methods, easily ignoring the relevance of several basic expression categories and the inconsistencies in the complexity of extracting features. As described by [Lopes et al., 2017], it is difficult to defini- tively partition each expression feature space. Some expressions, like happiness and surprise, belong to highly recognizable categories, which are easily distinguished by facial features. Meanwhile, other expressions, like fear and sadness, are very similar in some situations, making it difficult to distinguish them effectively. In addition, facial images are easily influenced by ethnicity, age, gender, hair, and other uncontrolled factors, resulting in different facial feature distributions and facial feature complexity for classification. Supposing that there are inconsistencies between the training samples and test samples, no matter how suitable the feature extraction of training samples in expression recognition, the prediction result of the test samples will not be accurate. An analogy of this is that we cannot ask an excellent student who has only grasped primary mathematics knowledge to be tested on knowledge of higher mathematics in a university. It is obvious that the complexity of the unequal knowledge needs to be distinguished for learning. In order to effectively solve the above problems, in this paper we proposed a complexity perception classification (CPC) algorithm for FER referenced simple and effective principle. Our algorithm firstly divided the dataset into two parts: the difficult classification sub dataset, and the easy classification sub dataset. This was done by evaluating the complexity of facial features for expression recognition of each sample. The next step was to separately learn the two different feature distributions, that is, we trained two specific classifiers for these two sub datasets to obtain the complexity of different sample features. Instead of using a uniform classifier to predict the facial expression, our algorithm divided the test sample into corresponding classifiers to complete FER through the facial feature complexity discriminator. Our main contributions can be summarized as follows. 1) According to the scale of the facial expression dataset, we proposed a simple and efficient CNN model based on ResNets for facial feature extraction, which effectively alleviated the problem of gradient disappearance, and enhanced information flow in the deep network. 2) A new heuristic classification algorithm named complexity perception classification (CPC) was proposed; it not only improved the recognition accuracy of higher recognizable facial expression categories, but also alleviated the problem of some misclassified expression categories. 3) We achieved state-of-the-art performance on static facial expression recognition benchmarks, including the Fer2013 dataset and CK+ dataset. work blocks, and fully connected layers. In order to extract high level facial features, we selected the output of the second 1024 dimensional fully connected layer as the feature representation. 2 Learning from the simple validity in Occam's razor principle, we proposed a complexity perception classification (CPC) algorithm to solve the complexity inconsistency problem of FER. In this section, we firstly illustrated how to evaluate the complexity of training datasets for recognition.Then we employed the discriminant learining for different disjoint sub datasets and sample complexity discriminator to clearly determine the complexity of test sample for recognition. Figure 3 shows an overview and pipeline of the CPC system. Feature Extraction The classical improvement of CNN frameworks using ResNet [He et al., 2016] and DenseNet [Huang et al., 2016] not only alleviated the problem that deep networks are prone to gradient disappearance in backpropagation, but also remarkably improved the performance of image classification. To this end and motivated by the above network architectures, we proposed a CNN framework for facial feature extraction as shown in Figure 1. Our CNN framework contained multiple convolutional layers, modified residual net Figure 1: Pipeline of the CNN framework In RestNets, the output of the feature mapping of the residual block consists of a non-linearly transformed composite function H(x) and an identity function x, which are combined as in Equation 1: F (x)  H(x)  x (1) This combination may hinder the flow of information through deep networks. In order to improve the flow of information between layers, we improved the combination mode of the residual block. Motivated by DenseNet, we no longer summated the two inputs, but concatenated the two feature mappings. The output function of the feature mapping is shown in Equation 2. F (x)  [H(x), x] (2) Figure 2 shows the structure of the traditional residual block and our modified residual block. Figure 2: Left: Traditional residual block. Right: Modified residual block. 3 Complexity Perception Classification Algorithm for FER Figure 3: Pipeline of the complexity perception classification (CPC) system 3.1 Evaluating the Complexity of Features for Recognition 3.2 The Discriminant Learning We adopted the feature extraction using the CNN as the input of the FER system for each feature value fi (i  1,...,n) , where fi is the i-th feature extracted from the original image. The feature extraction of training samples X  [x1 , x2 ,..., x n ] were randomly divided into K folds, where xi  Rd , i  1, 2,..., n . x i is the i-th sample feature vectors and d is the feature dimension of each sample. In order to improve the generalization ability of the base classifier and to distinguish the easily classifiable samples from the difficultly classifiable samples, we first chose a fold of samples as the training set and the remaining K-1 folds of samples as the test set. This resulted in K base classifiers on different training datasets. We repeated the above process m times to obtain N(N  KM) trained base classifiers. Then, each training sample feature vector was predicted by n base classifiers, counting the correct number of prediction expression categories and computing the ease degree of classification R(x i ) for the i-th sample: R(x i )  N (x i ) N (3) where N denotes the number of the base classifiers, and N(xi ) is the correct classification number in N base classifiers of the i-th training sample. We evaluated the complexity of sample classification features by the ease degree of classification R(x i ) . In addition, we set a parameter named ease threshold  as the boundary to distinguish the easily classifiable samples from the difficultly classifiable samples. S xi   E S D if R(x i )   if R(x i )   (4) As shown in Equation 4, when the ease degree of classification for the i-th training sample R(xi )   , we divided it into the easy classification sample subspace (SE ,LE ) . By contrast, we divided it into the difficult classification sample subspace (SD ,LD ) when the ease degree of classification for the i-th training sample R(xi )   . We divided the training datasets into two disjoint sub datasets by evaluating the feature complexity for recognition. In order to achieve discriminant learning in different sub datasets, we trained an easy sample classifier C E in the easy classification sample subspace (SE ,LE ) , and trained a difficult sample classifier C D in the difficult classification sample subspace (SD ,LD ) . In this way, we could learn different feature distributions in two different sample subspaces to provide more accurate recognition performance for the test sample. The easy sample classifier C E and the difficult sample classifier C D were as follows: CE   (SE ,LE ) , (5) CD   (SD ,LD ) , (6) where  is the specified classification method, such as Softmax, linear SVM, Random forest, etc. S E denotes the easy classification dataset, and LE denotes the expression labels of S E . Similarly, S D denotes the difficult classification dataset, and LD denotes the expression labels of S D . 3.3 Sample Complexity Discriminator In order to be able to clearly determine whether the test sample belongs to the easy classification sample subspace or difficult classification sample subspace, we dynamically generated different sample complexity discriminators for different test samples. The sample complexity discriminator model is described as follows: C s   (SE  S D ,{  , }) , (7) where {+} is the label of the easy classification dataset, {-} is the label of the difficult classification dataset. The sample complexity discriminator model C s denotes a dynamic classification method of KNN-Softmax. We adopted the KNN algorithm to find k neighbors for the i-th test sample in the training set, and dynamically trained the sample complexity discriminator through the k nearest neighbor training set. The KNN-Softmax dynamic classification method could not only reflect the advantages of Softmax, but also improve the dis- crimination accuracy of the feature complexity for each test sample. If the i-th test sample predicted {+} in the sample complexity discriminator, we used the easy sample classifier to recognize the facial expression. By contrast, if the label was {-}, we used the difficult sample classifier to recognize the facial expression. Algorithm 1 elaborates the implementation method and the details of the CPC algorithm. Algorithm 1 Complexity perception classification (CPC) Input: Feature vector x i from each sample, where i  1,..., n , classifier  , Complexity discriminator  , and ease threshold  . Output: The predictive expression label  for the testing sample. Training: 1: Partition data into training, validation, and test sets. 2: for i = 1 to m do 3: partition training data into K folds. 4: for j = 1 to k do 5: apply  to train j-th training data, which gets a base classifier. 6: end for 7: end for 8: Apply N base classifiers to compute the ease degree of classification R(x i ) for each sample. 9: for each training sample x i do 10: if R(x i )   11: Divide the sample x i into S E . 12: else 13: Divide the sample x i into S D . 14: end for 15: C E   (SE ,LE ) 16: C D   (SD ,L D ) 17: C I   (SE  S D ,{ , }) ] Testing: 18: for each training sample do 19: y  C I (x) 20: if y  {  } ,   C E (x) 21: if y  {  } ,   C D (x) 22: end for 4 Experiment Our proposed algorithm was mainly applied to single-image static facial expression recognition. We evaluated the performance of the proposed complexity perception classification (CPC) algorithm by applying it to the Fer2013 [Goodfellow et al., 2013] and CK+ [Lucey et al., 2010] datasets. 4.1 Datasets The Fer2013 dataset is a facial expression recognition challenge dataset that ICML 2013 launched on Kaggle. The dataset contains 28709 training images, 3589 validation images, and 3589 test images. The image size is 48  48 , and facial expression is classified into seven different types (0=Angry, 1=Disgust, 2=Fear, 3=Happy, 4=Sad, 5=Surprise, 6=Neutral). The CK+ dataset is an extension of the CK dataset. It contains 327 labeled facial videos, with each classified into (a) Fer2013_Baseline (b) Fer2013_CPC (c) CK+_Baseline (d) CK+_CPC Figure 4: Confusion matrices for facial expressions on two datasets. The baseline is the result of feature extraction with the CNN predicted by Softmax. The CPC is the result of feature extraction with the CNN predicted by Softmax and adding the CPC algorithm. one of the seven categories mentioned above, i.e., the same categories as those used in the Fer2013 dataset. We extracted four frames from each sequence in the CK+ dataset, which contains a total of 1308 facial expressions. 4.2 Experimental Settings Before the feature extraction phase in the CNN, we preprocessed the dataset with ZCA whitening and global relative normalization, which can effectively remove the redundant information of the input image and reduce the correlation between adjacent pixels in the image. In the pre-training phase of feature extraction with the CNN designed in Figure 1, we used the Fer2013 training dataset to train the networks. The initial network learning rate was set to 0.05, while the decay of the learning rate was per epoch. The mini batch size was 128, the momentum was set to 0.5, and the dropout was set to 0.2. The activation function used in the convolutional layers was the rectified linear unit (ReLU) activation function. The stochastic gradient descent (SGD) was used as the optimization algorithm. In addition, the last fully connected layer used Softmax as a multi-class activation function. 4.3 Baseline Classification vs. CPC We firstly observed the impact of the CPC algorithm on the recognition accuracy of different expression categories. Figure 4 illustrates the resulting confusion matrices of testing accuracies (%) on the two datasets; we employed five-fold cross validation to ensure the stability of results. The effectiveness of the proposed algorithm was verified by compar- ing the effect of the complexity perception classification algorithm on recognition results after the feature extraction of the CNN. On Fer2013 (Figure 4a), we can clearly see that the recognition rates of happiness were significantly higher than those of the other expressions belonging to the easily distinguishable category; meanwhile, the recognition rates of fear was the most difficult to distinguish. After adding the complexity perception classification algorithm to Fer2013 (Figure 4b), we found the following. (1) The recognition rate of happiness increased by 0.87% in the case of a high baseline recognition rate, the recognition rate of fear similarly increased by 1.81%, and the error rate related to mistaking fear for sadness decreased by 0.61%. These exciting recognition results demonstrated that the proposed algorithm not only improved the recognition accuracy of easily distinguishable categories, but also alleviated the easy misclassification of difficultly distinguishable categories. (2) The recognition rates of anger, sadness, and neutral also increased. The proposed algorithm improved the recognition rates for most categories. (3) None of the recognition rates of the expression classes decreased due to the addition of the proposed algorithm. Notice that our proposed algorithm did not raise the recognition accuracy of certain classes at the cost of sacrificing the accuracy of other classes, which is meaningful for practical application in facial expression recognition. On CK+ (Figure 4c, 4d), the recognition accuracy of the natural class increased from 95.71% to 97.14%, while the other categories experienced no change in recognition accuracy upon adding the proposed algorithm. The results of the confusion matrix on the CK+ dataset also validate our above conclusion. 4.4 Performance of the CPC Algorithm Table 1 show the recognition accuracy of different classifiers on the two datasets. We extracted facial features with the CNN, and compared the recognition effect of the CPC algorithm with the baseline recognition. In the experiment, we respectively trained two normal classifiers C n as the baseline recognition by employing the feature vectors of the training set on two datasets. The experimental results showed that the CPC algorithm had significant performance in facial expression recognition. Compared to the baseline recognition rate on the Fer2013 test set, the average recognition rate of Softmax, linear SVM, and random forest classifiers were enhanced by 1.58%, 1.06%, and 0.59%, respectively, by adding the CPC algorithm. The average baseline recognition rate of the CK+ test set of the three different classifiers reached 97.76%. When we introduced the CPC algorithm, this average recognition increased to 98.27%. 4.5 Comparison of State-of-the-art Methods We compared the proposed CNN feature extraction based on the CPC algorithm with existing related methods for FER. Table 2 and Table 3 respectively show the recognition accuracies of the different FER methods and our proposed Table 1: Comparison of recognition accuracies (%) of the baseline with CPC with different classifiers on the Fer2013 and CK+ datasets. Method Fer2013 CNN+Softmax CNN+LinearSVM CNN+RandomForest Baseline 69.77 70.02 69.97 CK+ CPC 71.35 71.08 70.56 Baseline 98.38 97.97 96.92 CPC 98.78 98.36 97.65 Table 2: Recognition rates (%) on the Fer2013 dataset for the state-of-the-art methods Method Recognition rate (%) Unsupervised [Goodfellow et 69.26 al., 2013] Maxim Milakov [Goodfellow et 68.82 al., 2013] [Mollahosseini et al., 2016] 66.40 [Tang et al., 2013] 71.16 [Liu et al., 2016] 65.03 DNNRL[Guo et al., 2016] 70.60 FC3072[Kim et al., 2016] 70.58 Proposed Approach 71.35 Table 3: Recognition rates (%) on the CK+ dataset for the state-of-the-art methods Method Recognition rate (%) [Mollahosseini et al., 2016] 93.20 [Liu et al., 2014] 94.19 [Wu et al., 2015] 98.54 [Happy et al., 2015] 94.09 [Sun et al., 2016] 94.87 [Yan et al., 2017] 96.60 [Barman et al., 2017] 98.30 [Lopes et al., 2017] 95.75 [Sariyanidi et al., 2017] 96.02 Proposed Approach 98.78 algorithm on the CK+ and Fer2013 datasets. As can be seen in Table 2, our proposed algorithm achieved competitive results in the Fer2013 dataset. Table 3 shows that our proposed algorithm outperformed all other compared FER methods in the CK+ dataset. 4.6 Parameter Analysis We investigated the importance of the ease threshold  parameter in the complexity perception classification algorithm. In order to determine the parameter value that produced the FER best performance on both datasets, we employed five-fold cross validation on the Fer2013 validation set and the CK+ dataset. Figure 5 and Figure 6 show the recognition accuracy of our algorithm versus different values of the ease threshold  on two datasets, and compares the recognition accuracy with the baseline. As can be seen in the above two figures, the recognition Acknowledgments This work was supported by the China National Science Foundation (60973083, 61273363), the Science and Technology Planning Project of Guangdong Province (2014A010103009, 2015A020217002), and the Guangdong Science and Technology Planning Project (201504291154480). References Figure 5: Recognition accuracy of the proposed algorithm versus different values of  on the Fer2013 validation set. Figure 6: The recognition accuracy of the proposed algorithm versus different values of  on the CK+ dataset. accuracy of our algorithm exceeded the baseline for most values of  , which illustrates the robustness of our algorithm. We also found that the random forest classifier was not stable enough due to its randomness. In addition, the relationship between recognition accuracy and different values of  was similar for the linear SVM and Softmax classifiers. 5 Conclusions In this paper, we designed a new and efficient CNN model for facial feature extraction, and proposed a complexity perception classification(CPC) algorithm for facial expression recognition. Our algorithm distinguished easily classifiable subspace from difficultly classifiable subspace to achieve discriminant learning of the facial feature distribution. Experimental results on the Fer2013 and CK+ datasets demonstrated that our algorithm outperformed state-of-the-art methods for facial expression recognition in terms of mean recognition accuracy. [Friensen et al., 1983] W. Friensen, P. Ekman, EMFACS-7: Emotional Facial Action Coding System, Technical Report, University of California, San Francisico, 1983. [Sun et al., 2017] Wenyun Sun, Haitao Zhao, Zhong Jin. An Efficient Unconstrained Facial Expression Recognition Algorithm based on Stack Binarized Auto-encoders and Binarized Neural Networks. Neurocomputing, 2017. [Yan et al., 2017] Haibin Yan. Collaborative discriminative multi-metric learning for facial expression recognition in video. Pattern Recognition, 2017. [Corneanu et al., 2016] CA Corneanu, MO Simón, JF Cohn, et al. Survey on RGB, 3D, Thermal, and Multimodal Approaches for Facial Expression Recognition: History, Trends, and Affect-Related Applications. IEEE Transactions on Pattern Analysis & Machine Intelligence, 2016. [Le et al., 2011] Vuong Le, H. Tang, and T.S. Huang. Expression recognition from 3D dynamic faces using robust spatio-temporal shape features. IEEE International Conference on Automatic Face & Gesture Recognition and Workshops IEEE, pages 414-421, 2011. [Walecki et al., 2015] R. Walecki, O. Rudovic, V. Pavlovic, and M. Pantic, Variablestate latent conditional random fields for facial expression recognition and action unit detection, in Proc. IEEE Int. Conf. Autom. Face Gesture Recog., 2015. [Savran et al., 2015] A. Savran, H. Cao, A. Nenkova, and R. Verma, Temporal Bayesian fusion for affect sensing: Combining video, audio, and lexical modali-ties, IEEE Trans. Cybern., pages 1927–1941, 2015. [Dahmane et al., 2011] M Dahmane, J Meunier. Emotion recognition using dynamic grid-based HoG features. IEEE International Conference on Automatic Face & Gesture Recognition and Workshops IEEE, 2011. [Berretti et al., 2011] S Berretti, BB Amor, M Daoudi. 3D facial expression recognition using SIFT descriptors of automatically detected keypoints. Visual Computer International Journal of Computer Graphics, 2011. [Zhang et al., 2005] W Zhang, S Shan, X Chen. Local Gabor Binary Pattern Histogram Sequence (LGBPHS): A Novel Non-Statistical Model for Face Representation and Recognition." Tenth IEEE International Conference on Computer Vision IEEE, pages 786-791, 2005. [Ranzato et al., 2011] M Ranzato, J Susskind, V Mnih G Hinton. On deep generative models with applications to recognition. Computer Vision and Pattern Recognition IEEE, pages 2857-2864, 2011. [Liu et al., 2014] Mengyi Liu,R Wang, X Chen. Learning Expressionlets on Spatio-temporal Manifold for Dynamic Facial Expression Recognition. IEEE Conference on Computer Vision and Pattern Recognition IEEE Computer Society, pages 1749-1756, 2014. [Kim et al., 2015] BK Kim, H Lee, J Roh. Hierarchical Committee of Deep CNNs with Exponentially-Weighted Decision Fusion for Static Facial Expression Recognition. ACM on International Conference on Multimodal Interaction ACM, pages 427-434, 2015:. [Lopes et al., 2017] AT Lopes, ED Aguiar, AFD Souza. Facial expression recognition with Convolutional Neural Networks: Coping with few data and the training sample order. Pattern Recognition pages 610-628, 2017. [He et al., 2016] K He, X Zhang, S Ren, J Sun. Deep Residual Learning for Image Recognition. Computer Vision and Pattern Recognition IEEE, pages 770-778, 2016. [Huang et al., 2016] G Huang, Z Liu, LVD Maaten, KQ Weinberger. Densely Connected Convolutional Networks, 2016. [Goodfellow et al., 2013] IJ Goodfellow, D Erhan, PL Carrier. Challenges in Representation Learning: A Report on Three Machine Learning Contests. International Conference on Neural Information Processing Springer, Berlin, Heidelberg, pages 117-124, 2013. [Lucey et al., 2010] P Lucey, JF Cohn, T Kanade, J Saragihet. The Extended Cohn-Kanade Dataset (CK+): A complete dataset for action unit and emotion-specified expression. Computer Vision and Pattern Recognition Workshops IEEE, pages 94-101, 2010. [Mollahosseini et al., 2016] Ali Mollahosseini, D. Chan, and MH Mahoor. Going deeper in facial expression recognition using deep neural networks. Applications of Computer Vision IEEE, pages 1-10, 2016. [Tang et al., 2013] Y Tang. Deep Learning using Linear Support Vector Machines. Computer Science, 2013. [Liu et al., 2016] Kuang Liu, M. Zhang, and Z. Pan. Facial Expression Recognition with CNN Ensemble. International Conference on Cyberworlds IEEE, pages 163-166, 2016. [Guo et al., 2016] Yanan Guo, J Yu, H Xiong. Deep Neural Networks with Relativity Learning for facial expression recognition. IEEE International Conference on Multimedia & Expo Workshops IEEE Computer Society, pages 1-6, 2016. [Kim et al., 2016] BoKyeong Kim, J Roh, and SY Dong. Hierarchical committee of deep convolutional neural networks for robust facial expression recognition. Journal on Multimodal User Interfaces, pages 1-17, 10.2, 2016. [Wu et al., 2015] Chongliang Wu,S Wang, and Q Ji. Multi-instance Hidden Markov Model for facial expression recognition. IEEE International Conference and Workshops on Automatic Face and Gesture Recognition IEEE, pages 1-6, 2015. [Happy et al., 2015] SL Happy, and A Routray. Automatic facial expression recognition using features of salient facial patches. IEEE Transactions on Affective Computing , pages 1-12, 6.1, 2015. [Sun et al., 2016] Yaxin Sun, and Wen G. Cognitive facial expression recognition with constrained dimensionality reduction. Neurocomputing, 2016. [Barman et al., 2017] Asit Barman, and P Dutta. Facial expression recognition using distance and shape signature features. Pattern Recognition Letters, 2017. [Sariyanidi et al., 2017] Evangelos Sariyanidi, H Gunes, and A Cavallaro. Learning Bases of Activity for Facial Expression Recognition. IEEE Transactions on Image Processing. pages 1965-1978, 2017.
2cs.AI
1 Mobile Unmanned Aerial Vehicles (UAVs) for Energy-Efficient Internet of Things Communications Mohammad Mozaffari1 , Walid Saad1 , Mehdi Bennis2 , and Mérouane Debbah3 arXiv:1703.05401v2 [cs.IT] 12 Sep 2017 1 Wireless@VT, Electrical and Computer Engineering Department, Virginia Tech, VA, USA, Emails:{mmozaff,walids}@vt.edu. 2 3 CWC - Centre for Wireless Communications, Oulu, Finland, Email: [email protected]. Mathematical and Algorithmic Sciences Lab, Huawei France R & D, Paris, France, and CentraleSupelec, Université Paris-Saclay, Gif-sur-Yvette, France, Email: [email protected]. Abstract In this paper, the efficient deployment and mobility of multiple unmanned aerial vehicles (UAVs), used as aerial base stations to collect data from ground Internet of Things (IoT) devices, is investigated. In particular, to enable reliable uplink communications for IoT devices with a minimum total transmit power, a novel framework is proposed for jointly optimizing the three-dimensional (3D) placement and mobility of the UAVs, device-UAV association, and uplink power control. First, given the locations of active IoT devices at each time instant, the optimal UAVs’ locations and associations are determined. Next, to dynamically serve the IoT devices in a time-varying network, the optimal mobility patterns of the UAVs are analyzed. To this end, based on the activation process of the IoT devices, the time instances at which the UAVs must update their locations are derived. Moreover, the optimal 3D trajectory of each UAV is obtained in a way that the total energy used for the mobility of the UAVs is minimized while serving the IoT devices. Simulation results show that, using the proposed approach, the total transmit power of the IoT devices is reduced by 45% compared to a case in which stationary aerial base stations are deployed. In addition, the proposed approach can yield a maximum of 28% enhanced system reliability compared to the stationary case. The results also reveal an inherent tradeoff between the number of update times, the mobility of the UAVs, and the transmit power of the IoT devices. In essence, a higher number of updates can lead to lower transmit powers for the IoT devices at the cost of an increased mobility for the UAVs. I. I NTRODUCTION The use of unmanned aerial vehicles (UAVs) as flying wireless communication platforms has received significant attention recently [1]–[8]. On the one hand, UAVs can be used as wireless relays for improving connectivity and coverage of ground wireless devices. On the 2 other hand, UAVs can act as mobile aerial base stations to provide reliable downlink and uplink communications for ground users and boost the capacity of wireless networks [1], [2], [6]–[12]. Compared to the terrestrial base stations, the advantage of using UAV-based aerial base stations is their ability to provide on-the-fly communications. Furthermore, the high altitude of UAVs enables them to effectively establish line-of-sight (LoS) communication links thus mitigating signal blockage and shadowing. Due to their adjustable altitude and mobility, UAVs can move towards potential ground users and establish reliable connections with a low transmit power. Hence, they can provide a cost-effective and energy-efficient solution to collect data from ground mobile users that are spread over a geographical area with limited terrestrial infrastructure. Indeed, UAVs can play a key role in the Internet of Things (IoT) which is composed of small, battery-limited devices such as sensors, and health monitors [13]. These devices are typically unable to transmit over a long distance due to their energy constraints [13]. In such IoT scenarios, UAVs can dynamically move towards IoT devices, collect the IoT data, and transmit it to other devices which are out of the communication ranges of the transmitters [13]. In this case, the UAVs play the role of moving aggregators or base stations for IoT networks [5]. However, to effectively use UAVs for the IoT, several challenges must be addressed such as optimal deployment, mobility and energy-efficient use of UAVs as outlined in [6] and [1]. In [3], the authors investigated the optimal trajectory of UAVs equipped with multiple antennas for maximizing sum-rate in uplink communications. The work in [4] maximizes the throughput of a relay-based UAV system by jointly optimizing the UAV’s trajectory as well as the source/relay transmit power. However these works considered a single UAV in their models. In [1], we investigated the optimal deployment and movement of a single UAV for supporting downlink wireless communications. The work in [14] proposed a low-complexity algorithm for the optimal deployment of multiple UAVs that provide coverage for ground users. The work in [10] provided a comprehensive downlink coverage analysis for a network in which a finite number of UAVs serve the ground users. In [15], the authors used UAVs to efficiently collect data and recharge the clusters’ head in a wireless sensor network which is partitioned into multiple clusters. However, this work is limited to a static sensor network, and does not investigate the optimal deployment of the UAVs. While the energy efficiency of uplink data transmission in a machine-to-machine (M2M) communication network was investigated [16], the presence of UAVs was not considered. In fact, none of the prior studies in [1]–[16], addressed the problem of jointly optimizing the 3 deployment and mobility of UAVs, device association, and uplink power control for enabling reliable and energy-efficient communications for IoT devices. To our best knowledge, this paper is one of the first comprehensive studies on the joint optimal 3D deployment of aerial base stations, device association, and uplink power control in an IoT ecosystem. The main contribution of this paper is to introduce a novel framework for optimized deployment and mobility of multiple UAVs for the purpose of energy-efficient uplink data collection from ground IoT devices. In particular, we consider an IoT network in which the IoT devices can be active at different time instances. To minimize the total transmit power of these IoT devices, given device-specific signal-to-interference-plus-noise-ratio (SINR) constraints, we propose an efficient approach to jointly and dynamically find the UAVs’ locations, the association of devices to UAVs, and the optimal uplink transmit power. Our proposed framework is composed of two key steps. First, given the locations of the IoT devices, we propose a solution for optimizing the deployment and association of the UAVs. In this case, we solve the formulated problem by decomposing it into two subproblems which are solved iteratively. In the first subproblem, given the fixed UAVs’ locations, we find the jointly optimal device-UAV association and the devices’ transmit power. In the second subproblem, given the fixed device association, we determine the joint 3D UAVs’ locations. For this subproblem, we transform the non-convex continuous location optimization problem to a convex form and provide tractable solutions. Next, following our proposed algorithm, the results of solving the second subproblem are used as inputs to the first subproblem for the next iteration. Here, we show that our proposed approach leads to an efficient solution with a reasonable accuracy compared to the global optimal solution that requires significant overhead. Clearly, the UAVs’ locations and the device association that we obtain in this first step will depend on the locations of active IoT devices. In the second step, we analyze the IoT network over a time period during which the set of active devices changes. In this case, we present a framework for optimizing the UAVs’ mobility by allowing them dynamically update their locations depending on the time-varying devices’ activation process. First, we derive the closed-form expressions for the time instances (update times) at which the UAVs must move according to the activation process of the devices. Next, using the update time results, we derive the optimal 3D UAVs’ trajectory such that the total movement of the UAVs while updating their locations is minimized. Our simulation results show that, using the proposed approach, the total transmit power of the IoT devices can be 4 significantly reduced compared to a case in which stationary aerial base stations are deployed. The results also verify our analytical derivations for the update times and reveal an inherent tradeoff between the number of updates, the mobility of the UAVs, and transmit power of the IoT devices. In particular, it is shown that a higher number of updates leads to lower transmit powers for the IoT devices at the cost of higher UAVs’ energy consumptions. The rest of this paper is organized as follows. In Section II, we present the system model and problem formulation. Section III presents the optimal deployment of UAVs and device association. In Section IV, we address the mobility and update time of the UAVs. In Section V we provide the simulation and analytical results, and Section VI draws some conclusions. II. S YSTEM M ODEL AND P ROBLEM F ORMULATION Consider an IoT system consisting of a set L = {1, 2, ..., L} of L IoT devices. Examples of such devices include various types of sensors used for environmental monitoring, smart traffic control, and smart parking devices. In this system, a set K = {1, 2, ..., K} of K rotary wing UAVs must be deployed to collect the data from the ground IoT devices. These UAVs can dynamically move, when needed, to effectively serve the IoT devices using uplink communication links. Here, the term served by a UAV implies that the uplink SINR is above the threshold and, thus, the UAV can successfully collect data from the ground IoT device. In our model, we assume that the devices transmit their data to the UAVs in the uplink using frequency division multiple access (FDMA) over R orthogonal channels. Let Emax be the maximum energy that each UAV can spend on its movement. The locations of device i ∈ L and UAV j ∈ K are, respectively, given uav by (xi , yi ) and v j = (xuav j , yj , hj ) as shown in Fig. 1. In our model, we consider a centralized network in which the locations of the devices and UAVs are known to a control center located at a central cloud server. The cloud server will determine the UAVs’ locations, device association, and the transmit power of each IoT device. We analyze the IoT network within a time interval [0, T ] during which the IoT devices can be active at different time instances and must be served by the UAVs at some pre-defined time slots. At the beginning of each slot, the positions of the UAVs as well as the device-UAV association are updated based on the locations of currently active devices that are assumed to be known to the 5 cloud center1 . Hereinafter, the time instance at which the UAVs’ locations and associations are jointly updated, is referred to as the update time. The update times are denoted by tn , 1 ≤ n ≤ N , with N being the number of updates. At each update time tn , based on the location of active devices, the optimal UAVs’ locations and the corresponding association must be determined for effectively serving the ground devices. Here, the IoT devices that become active during [tn−1 , tn ) are served by the UAVs during the time period [tn , tn+1 ). Note that, during [tn−1 , tn ), the UAVs’ locations and their device association do not change until the next update time, tn . Clearly, since at different update times, a different subset of devices might be active, the locations of the UAVs must dynamically change at each update time. Therefore, each UAV’s trajectory will consist of N stop locations at which the UAV serves the ground devices. Note that, in our model, the UAVs locations are not necessarily updated once the set of active devices changes. Instead, we consider some specific time instances (update times) at which the UAVs locations device associations, and devices’ transmit power are optimized. In particular, considering the fact that the set of active devices may continuously change, continuously updating the UAVs’ locations, the devices transmit powers, and the device-UAV associations may not be feasible as it can lead to low reliability, high UAVs’ energy consumption, and a need to solve complex real-time optimization processes. In our model, the update times are design parameters that depend on the activity of the devices, and the energy of UAVs. Given this model, our objective is to find the optimal joint UAVs’ locations and device association at each update time tn so as to minimize the total transmit power of the active devices while meeting each device’s SINR requirement. Moreover, we need to develop a framework for determining the update times as well as the UAVs’ mobility to handle dynamic changes in the activity of the devices. To this end, first, we present the ground-to-air channel model and the activation models for the IoT devices. A. Ground-to-Air Path Loss Model In our model, while optimizing the locations of the UAVs, the information available includes the ground devices’ locations, and the type of environment (e.g. rural, suburban, urban, highrise urban, etc.). Note that, in such practical scenarios, one will not have any additional information about the exact locations, heights, and number of the obstacles. Therefore, one must consider the 1 We consider static IoT devices in delay-tolerant applications which their fixed locations and activation patterns are known to the cloud center. 6 uav move UAVj ( x uav j , y j , hj ) move d ij hj  Devicei ( xi , yi ) Control center IoT device Fig. 1: System model. randomness associated with the LoS and NLoS links while designing the UAV-based communication system. Therefore, for ground-to-air communications, each device will typically have a LoS view towards a specific UAV with a given probability. This LoS probability depends on the environment, location of the device and the UAV as well as the elevation angle [8]. One suitable expression for the LoS probability is given by [1], [6], [8]: ij PLoS = 1 , 1 + ψ exp(−β [θij − ψ]) (1) where ψ and β are constant values which depend on the carrier frequency and type of environment   −1 hj 180 , such as rural, urban, or dense urban, and θij is the elevation angle. Clearly, θ = π ×sin dij q uav 2 2 2 where dij = (xi − xuav j ) + (yi − yj ) + hj is the distance between device i and UAV j. From (1), we can see that by increasing the elevation angle or increasing the UAV altitude, the LoS probability increases. The path loss model for LoS and non-line-of-sight (NLoS) links between device i and UAV j is given by [6] and [8]:   α  η1 4πfc dij ,  c α Lij =  η2 4πfc dij , c LoS link, (2) NLoS link, where fc is the carrier frequency, α is the path loss exponent, η1 and η2 (η2 > η1 > 1) are the excessive path loss coefficients in LoS and NLoS cases, and c is the speed of light. Note that, ij ij the NLoS probability is PNLoS = 1 − PLoS . Typically, given only the locations of the UAVs and devices, it is not possible to exactly determine which path loss type (LoS/NLoS) is experienced by the device-UAV link. In this case, the path loss average considering both LoS and NLoS links can be used for the device-UAV communications [6] and [8]. Now, using (1) and (2), the average path loss between device i and UAV j can be expressed as:  α  α  ij  4πfc dij 4πfc dij ij ij ij L̄ij = PLoS η1 + PNLoS η2 = PLoS η1 + PNLoS η2 (Ko dij )α , c c (3) 7 where Ko = ḡij = 1 . L̄ij 4πfc . c Clearly, the average channel gain between the UAV and the device is Note that, by using the average channel gain, there is no need to account for LoS and NLoS links separately, and, hence, the SINR expressions become more tractable. Therefore, we use the average channel gain to model the interference and desired links for all device-UAV communications while computing the SINRs. B. IoT Device Activation Model Indeed, the activation of IoT devices depends on the services that they are supporting. For instance, in some applications such as weather monitoring, smart grids, or home automation, the IoT devices need to report their data periodically. However, the IoT devices can have random activations in health monitoring, or smart traffic control applications. Therefore, the UAVs must be properly deployed to collect the IoT devices data while dynamically adapting to the activity patterns of these devices. Naturally, the optimal locations of the UAVs and their update times depend on the activation process of the IoT devices. Here, we consider two activation models. In the first model, the IoT devices are randomly activated, as in smart traffic control applications. In this case, the concurrent transmissions of a massive number of devices within a short time duration can lead to a bursty traffic as pointed out in [17] and [18]. In fact, when massive IoT devices attempt to transmit within a short time period, the arrival patterns become more bursty [19]. Thus, 3GPP suggests a beta distribution to capture this traffic characteristic of IoT devices [20]. In this case, each IoT device will be active at time t ∈ [0, T ] following the beta distribution with parameters κ and ω [18]–[20]: f (t) = tκ−1 (T − t)ω−1 , T κ+ω−1 B(κ, ω) (4) where [0, T ] is the time interval within which the IoT devices can be active, and B(κ, ω) = R 1 κ−1 t (1 − t)ω−1 dt is the beta function with parameters κ and ω [21]. 0 In addition, IoT devices such as smart meters typically report their data periodically rather than randomly. For such devices, the activation process is deterministic and assumed to be known in advance. In such case, we assume that device i becomes active each τi seconds during [0, T ] j k time duration. Clearly, the number of activations for a device i during [0, T ] is τTi . C. Channel Assignment Strategy Here, given only the devices’ locations, a practical channel assignment approach is to assign different channels to devices which are located in proximity of each other. This approach 8 significantly mitigates the possibility of having strong interference between two closely located devices. For the channel assignment problem, we have adopted a constrained K-mean clustering strategy [22], which is an efficient distance-based clustering approach in which a set of given points are grouped into K clusters based on their proximity. In this case, given the number of active devices, Ln , and the number of orthogonal channels, R ≤ Ln , we group the devices based on proximity, and assign different channels to devices which are in the same group. Now, we present our optimization problem to find the UAVs’ locations, device association, and transmit power of IoT devices at each update time tn during [0, T ]: (OP): min v j ,c,P s.t. P Ln X Pi , ∀i ∈ Ln , ∀j ∈ K, (5) i=1 Pi ḡici (v ci ) ≥ γ, Pk ḡkci (v ci ) + σ 2 (6) k∈Zi 0 < Pi ≤ Pmax , (7) where Ln is the total number of active devices at update time tn , and Ln is the set of devices’ index. P is the transmit power vector with each element Pi being the transmit power of device i. Also, v j is the 3D location of UAV j, and c is the device association vector with each element ci being the index of the UAV that is assigned to device i. Pmax is the maximum transmit power of each IoT device, and σ 2 is the noise power. Furthermore, ḡici (v ci ) is the average channel gain between device i and UAV ci which is a function of the UAV’s location. Also, ḡkci (v ci ) is the average channel gain between interfering device k and UAV ci . In (6), Zi is the set of all other devices that use the same channel as device i and create interference. γ is the SINR target which must be achieved by all the devices, (6) represents the SINR requirement, and (7) shows the maximum transmit power constraint. Hereinafter, we call (OP) the original problem. Note that, in (5), the transmit power of the IoT devices, the 3D locations of the UAVs, and the UAV-device associations are unknowns. Clearly, the locations of the UAVs impact the channel gain between the devices and UAVs, and, hence, they affect the transmit power of each device, Pi . Furthermore, given (6), due to the mutual interference between the devices, the transmit power of each device depends also on the transmit power of the interfering devices as well as the device-UAV associations. In addition, the device-UAV associations depend on the UAVs’ locations which are also unknowns. Therefore, there is a mutual dependency between all the 9 Fig. 2: Block diagram for the proposed solution. optimization variables in (OP). Moreover, considering (1) and constraint (6), we can see that, this optimization problem is highly non-linear and non-convex. Indeed, solving (5) is significantly challenging due to the mutual dependency of the optimization variables, non-linearity, and nonconvexity of the problem. Next, we propose a framework for solving this optimization problem. In essence, our proposed framework for solving (OP) proceeds as follows. At each update time tn , given the fixed UAVs’ locations, we find the optimal device-UAV association and the transmit power of the devices. Next, given the fixed UAV association from the previous step, we determine the sub-optimal locations of the UAVs and update the transmit power the devices accordingly. This procedure is done iteratively until the 3D UAVs’ locations, device association, and the transmit power of the devices are found. Clearly, at each step, the total transmit power of the devices decreases, and, hence, the proposed algorithm converges. Fig. 2 shows a block diagram that summarizes the main steps for solving (OP). Next, we discuss, in detail, each block of the proposed solution in Fig. 2. III. UAV D EPLOYMENT AND D EVICE A SSOCIATION WITH P OWER CONTROL Here, given the locations of active IoT devices, we minimize the total transmit power of the devices by solving (5). Clearly, the UAVs’ locations and the device association are mutually dependent. In particular, to find the device association, the locations of the UAVs must be known. Moreover, the UAVs’ locations cannot be optimized without knowing the device association. Therefore, we decompose (OP) into two subproblems that will be solved iteratively. In the first subproblem, given the locations of the UAVs, we find the optimal device association and the transmit power of the devices such that the uplink SINR requirements of all active devices are satisfied with a minimum total transmit power. In the second subproblem, given the device association resulting from the first subproblem, we determine the sub-optimal locations of the 10 UAVs for which the transmit power of the devices is minimized. Note that, this is an iterative process in which the results of each subproblem are used in the other subproblem for the next iteration. These computations are performed by the control center until the 3D UAVs’ locations, device association, and transmit power of the devices are obtained. Note that, given the limited number of available orthogonal channels, the interference between the devices will depend on the number of active devices at each update time. Clearly, there is no interference when the number of active devices at time tn is less than the number of orthogonal channels, or equivalently Ln ≤ R. Given that, in the interference-free scenario, one can provide a more tractable analysis, here, for the deployment and association steps. Therefore, we will investigate the interference and interference-free scenarios, separately. A. Device Association and Power Control Here, given initial locations of the UAVs, we aim to find the optimal device association as well as the transmit power of each IoT device such that the total transmit power used for successful uplink communications is minimized. 1) Interference scenario: In the presence of uplink interference when Ln > R, the power minimization problem at update time tn will be given by: (P1-a): min c,P s.t. P Ln X Pi , ∀i ∈ Ln , ∀j ∈ K, (8) i=1 Pi ḡici ≥ γ, Pk ḡkci + σ 2 (9) k∈Zi 0 < Pi ≤ Pmax . (10) To solve (P1-a), we need to jointly find the optimal device association and the transmit power of all active devices under the SINR constraints for the given UAVs’ locations. Clearly, given the fixed UAVs’ locations, optimization variables are the device association and the transmit power of the devices. Note that, satisfying the SINR requirement of each device significantly depends on the distance and altitude of its serving UAV. Therefore, the feasibility of the optimization problem in (8) depends on the locations of the UAVs. Next, we derive an upper bound and a lower bound for the altitude of serving UAV j as a function of its distance from device i. 11 Proposition 1. The lower and upper bounds for the altitude of a UAV j needed to serve a device i (meeting its SINR requirement), are given by:     1/α  ψQ Pmax 1 ln + ψ ≤ hj ≤ , dij sin β 1−Q γKoα σ 2 η1 where dij is the distance between UAV j and device i, and Q = Pmax α 2 γdα ij Ko σ (η1 −η2 ) (11) − η2 . η1 −η2 Proof: Let Ii be the cumulative interference from interfering devices on device i, then: Pi ḡij ≥ γ, Ii + σ 2 Pi Pmax ≤ , dαij ≤ ij ij ij ij α 2 α 2 γKo (Ii + σ ) η1 PLoS + η2 PNLoS γKo σ η1 PLoS + η2 (1 − PLoS ) Pmax η2 ij PLoS ≥ α α 2 − , γdij Ko σ (η1 − η2 ) η1 − η2 SINRi = considering Q = (a)  − η2 ) − η2 , and using equation (1), η1 − η2  ψQ + ψ, 1−Q     1 ψQ hj ≥ dij sin ln +ψ , β 1−Q θij ≥ 1 ln β Pmax α α γdij Ko σ 2 (η1 (12) where (a) stems from (1). Also, we have: dαij ≤ γKoα σ 2 (b) Pmax Pmax  ≤ , ij ij γKoα σ 2 η1 η1 PLoS + η2 (1 − PLoS ) where in (b) we consider PLoS = 1 which is equivalent to hj = dij . Finally,  1/α Pmax hj ≤ . γKoα σ 2 η1 (13) (14) Clearly, (12) and (14) prove the proposition. Proposition 1 provides the necessary conditions for the UAV’s altitude needed in order to be able to serve the IoT device. From (11), the minimum altitude must increase as the distance increases. In other words, the UAV’s altitude needs to be adjusted based on the distance such   ψQ that the elevation angle between the device and the UAV exceeds β1 ln 1−Q + ψ. Furthermore, as expected, the maximum altitude of the UAVs significantly depends on the maximum transmit power of the devices as given in (14). Now, given the fixed UAVs’ locations, problem (P1-a) corresponds to the problem of joint user association and uplink power control in the terrestrial base station scenario. The algorithm 12 presented in [23] and [24] leads to the global optimal solution to the joint user association and uplink power control under the SINR and maximum transmit power constraints. As a result, the optimal transmit power of users and the base station association for which the total uplink transmit power is globally minimized, is determined. In problem (P1-a), the IoT devices correspond to the users, and fixed positioned UAVs correspond to the terrestrial base stations. For our case, this algorithm, as given in Algorithm 1, will proceed as follows. We start with an initial value (t) for transmit power of all active devices in step 3. Then, in step 4 we compute ρij at iteration t. (t) In this case, ρij represents the minimum required transmit power of device i to reach an SINR of 1 while connecting to UAV j, given the fixed transmit power of other devices. In step 5, we find the minimum transmit power of device i if it connects to the best UAV. Then, the index of the best UAV which is assigned to device i is given in step 6. In step 7 we update the transmit power of device i in order to achieve an SINR of γ. Steps 4 to 7 must be repeated for all devices to obtain the optimal transmit power and the device association vectors. Algorithm 1 Iterative algorithm for joint power control and device-UAV association 1: Inputs: Locations of UAVs and IoT devices 2: Outputs: Device association vector (c), and transmit power of all devices (P ).  (0) (0) 3: Set t = 0, and initialize P (0) = P1 , ..., PK σ2 + (t) k∈Zi 4: Define ρij = 5: 6: 7: P  . (t) Pk ḡkj ḡij . (t) Compute Si (P (t) ) = min ρij . j∈K (t) Find ci (P (t) ) = arg min ρij . j∈Kn o (t+1) Update Pi = min γSi (P (t) ), Pmax , 8: Repeat steps 4 to 7 for all devices until P ∀i ∈ Ln . (t) converges. h i 9: P = P (t) , c = ci (P (t) ) , ∀i ∈ Ln . As shown in [23], after several iterations this algorithm quickly converges to the global optimal solution if the SINR of each device is equal to γ. Hence, by solving (P1-a), we are able to find the optimal transmit power of the devices and the device association for any given fixed locations of the UAVs. Then, the device association and transmit power of the devices will be used as inputs for solving the second subproblem in which the UAVs’ locations need to be optimized (in Subsection III-B). 13 2) Interference-free scenario: At each update time tn , if the number of active devices is lower than the number of orthogonal channels or equivalently Ln ≤ R, there will be no interference between the devices. Unlike in the interference scenario, here, the transmit power of each device can be computed only based on the channel gain between the device and its serving UAV. Therefore, considering (3), and (6) without interference, the minimum transmit power of device i in order to connect to UAV j is Pi = γσ 2 L̄ij . In this case, given the locations of the UAVs (fixed for all v j ), L̄ij is known for all devices and problem (P1-a) can be simplified. Hence, the optimal association problem under minimum power in the interference-free scenario will be: (P1-b): K X Ln X min Aij L̄ij , (15) Aij s.t. K X j=1 i=1 Aij = 1, ∀i ∈ Ln , (16) j=1 Aij L̄ij ≤ Pmax , Aij ∈ {0, 1}, ∀i ∈ Ln , j ∈ K, γσ 2 (17) where L̄ij is the average path loss between device i and UAV j, which is known, give the locations of the UAV and the device. Aij is equal to 1 if device i is assigned to UAV j, otherwise Aij will be equal to 0. Clearly, the optimization problem in (15) is an integer linear programming (ILP). In general, this problem can be solved by using standard ILP solution methods such as the cutting plane. However, these solutions might not be efficient as the size of the problem grows. In particular, due to the potentially high number of IoT devices, a more efficient technique for solving (15) is needed. Here, we transform problem (15) to a standard assignment problem [25] which can be solved in polynomial time. In the assignment problem, the objective is to find the optimal one-to-one assignment between two sets of nodes with a minimum cost. In our problem, the devices and the UAVs can be considered as two sets of nodes that need to be assigned to each other with an assignment cost of Lij between nodes i and j. However, compared to the classical assignment problem, (P1-b) has an additional constraint in (17) which results from the transmit maximum power constraint. This constraint indicates that device i cannot be assigned to UAV j if L̄ij > Pmax . γσ 2 Therefore, in the assignment problem we can consider Lij = +∞ to avoid assigning device i to UAV j when L̄ij > Pmax γσ 2 that implies the constraint in (17) is violated. Subsequently, using the updated assignment costs, Lij , problem (P1-b) will be transformed to the classical assignment problem which can be solved using the Hungarian method with a time complexity 14 of O((Ln K)3 ) [26]. We note that, in absence of interference, problems (P1-a) and (P1-b) have the same solution. Next, we present the second subproblem of the original optimization problem (5) in order to optimize the UAVs’ locations. B. Optimal Locations of the UAVs In this section, given the optimal device association, our goal is to find the sub-optimal locations of the UAVs for which the total transmit power of the devices is minimized. In other words, considering the mobile nature of the UAVs, we intelligently update the location of each UAV based on the location of its associated IoT devices. 1) Interference scenario: In this scenario, given the UAV-device associations, the optimization problem to find the 3D locations of the UAVs and the transmit power of the devices will be: (P2-a): min v j ,P s.t. P Ln X Pi , ∀i ∈ Ln , ∀j ∈ K, (18) i=1 Pi ḡij (v j ) ≥ γ, Pk ḡkj (v j ) + σ 2 (19) k∈Zi 0 < Pi ≤ Pmax , (20) uav where vj = (xuav j , yj , hj ) indicates the 3D location of UAV j. Clearly, the channel gains used in (19) depend on the locations of the UAVs. Note that, according to (1) and (3), ḡij (v j ) is a non-convex function of v j . Consequently, constraint (19) is also non-linear and non-convex. Furthermore, the transmit power of the devices and the UAVs’ locations are mutually dependent. On the one hand, the location of each UAV must be determined such that its associated devices can connect to it with a minimum transmit power. On the other hand, the UAV’s location will impact the amount of interference received from other interfering devices. Indeed, solving the optimization problem in (P2-a) is challenging as the problem is highly non-linear and nonconvex. In particular, the complexity of this problem stems from the mutual dependence between the transmit power of the devices and the locations of the UAVs. Our proposed approach to solve (P2-a) is based on optimizing the location of each UAV separately. Note that, using the results of (P1-a), for each UAV, the associated and non-associated devices and their transmit power, Pi∗ , are known. Our proposed solution proceeds as follows. The cloud starts by considering a single UAV and then optimizing its location given the fixed 15 transmit power for the non-associated devices. Then, the cloud updates the transmit power of the associated devices according to the new location of their serving UAV. Hence, at each step, the location of a UAV and the transmit power of its associated devices are updated. At each iteration, after finding Pi∗ , we set Pmax = Pi∗ for the next iteration. This ensures that the transmit power of the devices does not increase during the iterative process. The entire process is repeated by the cloud for all UAVs one-by-one, until the transmit power of the devices cannot be further reduced by changing the UAVs’ locations. Note that, at each step, one must determine the optimal location of each UAV such that the total transmit power of its associated devices is minimized. Now, let Cj be the set of devices’ index associated to UAV j. Given (3), (18), and (19), the optimal location of UAV j can be determined by solving the following problem: X min Fi (v j ), vj (21) i∈Cj   ij ij s.t. Fi (v j ) = γ η1 PLoS + η2 PNLoS (Ko dij )α   k∈Zi Fi (v j ) ≤ Pi∗ , ∀i ∈ Cj , Pk X  kj η1 PLoS + kj η2 PNLoS  α (Ko dkj ) + σ 2 , (22) (23) ij kj Note that, PLoS , PLoS , dkj , and dij depend on the locations of UAVs (vj ). Also, (23) guarantees that the transmit power of each device is reduced by updating the location of serving UAV. Clearly, (21), (22), and (23) are non-linear and non-convex. Considering the fact that the objective function and constraints are twice differentiable, we convert (21) to a quadratic form which can be solved using efficient techniques. In particular, we adopt the sequential quadratic programming (SQP) method as one of the most powerful algorithms for solving large scale and constrained differentiable non-linear optimization problems [27]. Clearly, considering the high non-linearity of (22) as well as the large number of constraints, the SQP is a suitable method for solving our optimization problem. In the SQP method, the objective function is approximated by a quadratic function, and the constraints are linearized. Subsequently, the optimization problem is solved by solving multiple quadratic subproblems. In our optimization problem, to find the optimal location of UAV j, v j,k , we start with an initial point v j,k (starting with k = 0). Then, we use the first order necessary optimality or Karush-Kuhn-Tucker (KKT) conditions to find the 16 Lagrangian variables. In particular, we use: X ∇L(v j,k , λk ) = ∇Fi (v j,k ) + ∇wi (v j,k )λk = 0, (24) i∈Cj where L(v j,k , λk ) = P Fi (v j,k ) + λT w(v j,k ) is the Lagrangian function, λk is the vector of i∈Cj Lagrangian variables, and w(v j,k ) is a vector of functions with each element being wi (v j,k ) = (Fi (v j,k ) − Pi∗ ). Then, given v j,k , we determine the Lagrange variables by [27]: X  −1 ∇Fi (v j,k ). λk = − wi (v j,k )T ∇wi (v j,k ) ∇wi (v j,k )T (25) i∈Cj In the next step, we update v j,k+1 = v j,k + dk , where dk is the solution to the following quadratic programming problem: dk = arg min d X i∈Cj 1 ∇Fi (v j,k )T d + dT ∇2 [L(v j,k , λk )] d, 2 s.t. Fi (v j,k ) + ∇Fi (v j,k )T d − Pi∗ ≤ 0, ∀i ∈ Cj , (26) (27) where, ∇ and ∇2 indicate the gradient and Hessian operations. Clearly, (26) is an inequality constrained quadratic programming. Moreover, it can be shown that the Hessian matrix, ∇2 [L(v, λk )], is not positive semidefinite, and, hence, (26) is non-convex in general. In this case, the two possible solution approaches are the active set, and the interior point methods. Typically, the active set method is preferred when the Hessian matrix is moderate/small and dense. The interior point, however, is a suitable approach when the Hessian matrix is large and sparse [28]. In our problem, due to the potential possible high number of active devices, the number of constraints can be high. Therefore, the Hessian matrix, ∇2 [L(v j,k , λk )], is large and sparse, and, hence, the interior point method is used. Finally, based on (24)-(27), the sub-optimal location of each UAV (v j ), given the fixed device association, will be determined. Next, we address the UAVs’ location optimization in an interference-free scenario. 2) Interference-free scenario: In the absence of interference, we are able to provide tractable analysis on the UAVs’ locations optimization. Considering α = 2 for LoS ground-to-air propagation [8], the optimal locations of the UAVs will be given by: 17 3.52 Error (%) 3.5 3.48 3.46 3.44 3.42 50 100 150 200 250 300 350 400 450 500 UAV Altitude (m) Fig. 3: Error in the objective function approximation. (P2-b): min vj X  2 ij ij Ko2 σ 2 γ η1 PLoS + η2 PNLoS dij , (28) i∈Cj  2 Pmax ij ij s.t. η1 PLoS + η2 PNLoS dij ≤ 2 2 , ∀i ∈ Cj . Ko σ γ (29) uav This optimization problem is non-convex over vj = (xuav j , yj , hj ). However, given any altitude hj , we can provide a tractable solution to this problem. First, given hj , we consider the following function that is used in (28):  2 ij ij q(dij ) = Ko2 σ 2 γ η1 PLoS + η2 PNLoS dij . (30) ij ij ij Clearly, considering the fact that 0 ≤ PLoS ≤ 1, and PNLoS = 1 − PLoS , we have: Ko2 σ 2 γη1 d2ij ≤ q(dij ) ≤ Ko2 σ 2 γη2 d2ij . (31) From (31), we can see that q(dij ) is bounded between two quadratic functions that each is linearly proportional to d2ij . Now, using the least square estimation method, we find the coefficients α1 and α2 such that, given any hj , q(dij ) is approximated by the following convex quadratic function: q(dij ) ≈ α1 d2ij + α2 . (32) where α1 and α2 are altitude dependent coefficients. Note that, using the quadratic approximation, the solution of (28) becomes more tractable. Fig. 3 shows the error in the objective function (28) due the quadratic approximation. As we can see from Fig. 3 which is obtained based on the parameters in Table I, the error is less than 4% for different UAVs’ altitudes.  2 ij ij Now, in constraint (29), we consider D = η1 PLoS + η2 PNLoS dij . Clearly, D is an increasing function of dij since η1 −η2 < 0, and for a fixed altitude, LoS probability is a decreasing function 2 uav 2 2 of distance. Therefore, using dij 2 = (xi − xuav j ) + (yi − yj ) + hj , and (32), for any given hj we can write the optimization problem (28) as: X 2 2 2 uav min (xuav j − xi ) + (yj − yi ) + hj , uav uav xj ,yj i∈Cj (33) 18 2 uav 2 2 2 s.t. (xuav j − xi ) + (yj − yi ) + hj −  ≤ 0, ∀ i ∈ Cj , and j ∈ K. (34) where ε = {d|Ko2 σ 2 γ (η1 PLoS + η2 PNLoS ) d2 = Pmax }. Next, we derive the solution to problem (33) that corresponds to finding the sub-optimal UAVs’ locations. ∗ uav ∗ , yj ) = −P (λ)−1 Q(λ), with the Theorem 1. The solution to (33) is given by s∗ = (xuav j vector λ that maximizes the following concave function: max λ 1 Q(λ)T P (λ)−1 Q(λ) + r(λ), 2 (35) s.t. λ ≥ 0, where P (λ) = P o + |C j| P λi Pi , Q(λ) = Qo + (36) |C j| P λi Qi and r(λ) = ro + i=1 i=1 |C j| P λi ri , with P o , Qo , i=1 ro , P i , Qi , and ri given in the proof. Proof: As we can see from (33), the optimization problem is a quadratically constrained quadratic program (QCQP) whose general form is given by [29]: min s s.t. 1 T s P o s + QTo s + ro , 2 1 T s P i s + QTi s + ri , i ∈ Cj . 2 (37) (38) Given (33) and (34), we have:     T  h iT |C |C j| j| 2|Cj | 0 2 0 P P     , Qi = −2xi −2yi . Po = , Pi = , Qo = −2 xi −2 yi i=1 i=1 0 2|Cj | 0 2 |C | |C | j j P P Also, ro = x2i + yi2 , and ri = x2i + yi2 + h2j − 2 with ε = {d|Ko2 σ 2 γ (η1 PLoS + η2 PNLoS ) d2 = i=1 i=1 Pmax }. Note that, P o and P i are positive semidefinite matrices, and, hence, the QCQP problem in (37) is convex. Now, we write the Lagrange dual function as:   X 1 1 T T T T f (λ) = inf s P o s + Qo s + ro + λi s P i s + Q i s + ri s 2 2 i   1 T T = inf s P (λ)s + Q(λ) s + r(λ) . s 2 (39) Clearly, by taking the gradient of the function inside the infimum with respect to s, we find s∗ = −P (λ)−1 Q(λ). As a result, using s∗ , f (λ) = 21 Q(λ)T P (λ)−1 Q(λ) + r(λ). Finally, the dual of problem (37) or (33) will be: max f (λ), s.t. λ ≥ 0, (40) 19 which proves Theorem 1. Using Theorem 1, for a fixed altitude, we find the optimal 2D coordinates of the UAV, s∗ = ∗ uav ∗ (xuav , yj ). Then, the optimal UAV’s altitude is the argument that minimizes the following j one-dimensional function as: h i  h∗j = arg min α1 h2j + ks∗ k2 + α2 . (41) hj where α1 and α2 are the altitude dependent coefficients given in (32). Note that, given (41), the sub-optimal altitude of the UAV is obtained via one dimensional search over a feasible range of altitudes. Consequently, we can determine the optimal 3D location of each UAV. Note that, the device association (presented in Section III), and UAVs’ locations optimization (in Section IV) are applied iteratively until there is no change in the location update step. Clearly, at each iteration, the total transmit power of the devices is reduced and the objective function is monotonically decreasing. Hence, the solution converges after several iterations. Note that, our proposed approach provides a suboptimal solution to the original problem. Nevertheless, our solution has a reasonable accuracy but significantly fast compared to the global optimal solution that can be achieved by the brute-force search, as will be further corroborated in the simulations. Thus far, we considered the IoT network at one snapshot in the time duration [0, T ]. Next, we analyze the IoT network considering the entire time duration [0, T ] in which the set of active devices changes. In this case, to maintain the power-efficient and reliable uplink communications of the devices, the UAVs must update their locations at different update times tn . IV. U PDATE T IMES AND M OBILITY OF UAV S Here, we find the optimal update time and trajectory of the UAVs to guarantee the reliable uplink transmissions of the IoT devices. Clearly, the trajectory of the UAVs, as well their update time depend on the activation process of the IoT devices. Furthermore, to move along the optimal trajectories, the UAVs must spend a minimum total energy on mobility so as to remain operational for a longer time. In the considered ground IoT network, the set of active IoT devices changes over time. Consequently, the UAVs must frequently update their locations accordingly. Note that, the UAVs do not continuously move as they must stop, serve the devices, and then update their locations. Furthermore, the mobility of the UAVs is also limited due to their energy constraints. Hence, the UAVs update their locations only at some specific times. In this case, during time interval [0, T ], we need to find update times tn , 1 ≤ n ≤ N with N updates, and a framework for 20 optimizing the mobility of the UAVs at different update times. Here, for tractability, we assume that the devices are synchronized at t = 0. In this case, the synchronization process needs to be done only once during the entire activation period [0, T ]. Note that, our optimization problems for jointly finding the optimal UAVs’ locations, the device association, and devices’ transmit power at each update time do not depend on this synchronization assumption. A. Update Time Analysis First, we propose a framework to find the update times of the UAVs. As discussed in Section II, each UAV’s trajectory consists of multiple stop locations (determined in update times) at which each UAV serves its associated ground devices. Clearly, the update times depend on the activation of the IoT devices during the given time period [0, T ]. Indeed, the number of update times, N , impacts the optimal location and trajectory of the UAVs as well as the power consumption of the IoT devices. A higher number of updates leads to a shorter time interval between the consecutive updates. Hence, a lower number of devices will be active during the shorter time interval. In such a case, the active devices experience lower interference from each other while transmitting their data to the UAVs. Therefore, the IoT devices can use lower transmit power to meet their SINR constraint. However, a higher number of updates requires more mobility and higher energy consumption for the UAVs. Next, we provide insightful analysis on the update time based on the probabilistic and periodic activation models of the IoT devices. 1) Periodic IoT activation: In some applications such as weather monitoring, smart grids (e.g. smart meters), and home automation, the IoT devices can report their data periodically. Therefore, the devices are activated periodically. Let τi be the activation period of device i during [0, T ]. Without loss of generality, assume τ1 ≤ τ2 ≤ ... ≤ τL . Due to the periodic nature of devices’ activation, we can find the exact number of active devices at each update time tn . Proposition 2. The exact number of active IoT devices at update time tn is given by:   −   L X tn−1 tn > , n > 1, bn = 1 τ τ i i i=1 b1 = arg max {t1 > τi } , (42) (43) i where 1(.) is the indicator function which can only be equal to 1 or 0, and tn − = lim+ (tn − ε). ε→0 21 Proof: User i becomes active during [tn−1 , tn ) if there exists q ∈ N such that tn−1 ≤ qτi < tn . Thus, the number of activations of device i before tn must be greater than the one until tn−1 . j −k j k Considering the fact that the number of activations before tn is tnτi , and until tn−1 is tn−1 , τi we must have:  tn − τi    tn−1 > . τi (44) Hence, the total number of active devices which need to be served at tn is equal to:  −    L X tn tn−1 bn = 1 > . τi τi i=1 (45) Finally, considering t0 = 0, we can write b1 as: b1 = arg max {t1 > τi }. i Proposition 2 gives the exact number of devices that must be served by UAVs at each update time. In this case, the update times can be adjusted according to the number of devices that can be served by the UAVs. Indeed, knowing the exact number of active devices enables us to determine the update times in a deterministic and efficient way based on system requirements. 2) Probabilistic IoT activation: Certain IoT devices can have probabilistic activations in applications such as health monitoring, and smart traffic control. In this case, each IoT device becomes active at time t ∈ [0, T ] following the beta distribution as given in (4). For this scenario, we will next derive the specific update times as a function of the average number of active devices. Theorem 2. The update times during which, on the average, a total of an devices must be served by the UAVs, are given by: a  + I tn−1 (κ, ω) , κ, ω , n > 1, T L a  1 t1 = T × I −1 , κ, ω , L tn = T × I −1 n (46) (47) where Ix (.) is the regularized incomplete beta function and I −1 (.) is its inverse function. L is the total number of IoT devices, and [0, T ] is the time interval during which the devices can be active. Proof: First, we find the probability that each device becomes active in order to send its data to a UAV at update time tn . As discussed in the system model, a device needs to transmit at time tn if it becomes active during time [tn−1 , tn ). Thus, the probability that each device needs to be served at tn is: Z tn pn = tn−1 tκ−1 (T − t)ω−1 dt = T κ+ω−1 B(κ, ω) Z tn T tn−1 T tκ−1 (1 − t)ω−1 dt, B(κ, ω) 22 B tn (κ, ω) − B tn−1 (κ, ω) = where Bx (κ, ω) = Rx 0 T = I tn (κ, ω) − I tn−1 (κ, ω), T B(κ, ω) T (48) T y κ−1 (1 − y)ω−1 dy is the incomplete beta function with parameters κ and ω, and Ix (.) is the regularized incomplete beta function. Now, the average number of active devices at tn is given by: L   L X X L (L − 1)! L−k k an = pn (1 − pn ) = Lpn pn k−1 (1 − pn )L−k , k (k − 1)! (L − k)! k=1 k=1 0 L X (L0 )! L0 −k0 k0 −1 = p (1 − p ) = Lpn , n n (k 0 )! (L0 − k 0 )! k0 =0 (49) where in (a), we used L0 = L − 1 and k 0 = k − 1. Note that, (49) corresponds to the mean of a binomial distribution. Then we have: h i L I tn (κ, ω) − I tn−1 (κ, ω) = an . T (50) T This leads to: tn = T × I −1 a n L +I  tn−1 T Finally, considering I0 (.) = 0, we find t1 = T × I −1 (κ, ω) , κ, ω . a1 , κ, ω L (51)  . Clearly, the update times need to be determined based on the IoT devices’ activation patterns. In fact, tn depends on the number of IoT devices, and their activation distribution. Furthermore, according to (46), each tn depends also on the previous update time, tn−1 . This is due to the fact that, the number of active devices that need to be served at tn , depends on the update time difference tn − tn−1 . Using Theorem 2, the update times of the UAVs can be set based on the average number of active devices. Typically, at each update time, the number of devices which need to be served by the UAVs should not be high in order to avoid high interference. However, considering the number of available resources (orthogonal channels and UAVs), it is preferable to serve a maximum number of active devices at each update time. Hence, in this case, the number of active devices at each update time must not be relatively low.Therefore, considering system requirements and different parameters such as mutual interference between devices, acceptable delay for serving the devices, and number of available channels, an appropriate tn must be adopted. For instance, using Theorem 2, the update times can be set such that the average number of active devices be lower than the number of channels, R, to avoid interference between the devices. Next, we investigate the UAVs’ mobility during the update times. 23 B. UAVs’ Mobility Thus far, we have determined the update times as well as the stop locations at each update time. Here, we investigate how the UAVs should move between the stop locations at different update times. In this case, considering the energy limitation of the UAVs, Emax , we find the optimal trajectory of each UAV to guarantee reliable and energy-efficient uplink transmissions of active IoT devices. The UAVs update their locations according to the activity of the IoT devices. Therefore, the UAVs move from their initial locations at tn−1 to a new optimal locations at tn . This mobility should be done in such a way that the UAVs spend a minimum total energy on the mobility so as to remain operational for a longer time. In fact, given the optimal sets of UAVs’ locations at tn−1 and tn obtained from Section III, we determine how to move the UAVs between the initial and the new sets of locations in order to minimize total mobility of the UAVs. Now, let In−1 and In be two sets comprising the UAVs’ locations at two consecutive update times tn−1 and tn . Our goal is to find the optimal mapping between these two sets in a way that the energy used for transportations (between two sets) is minimized. Not that, in our model, the total energy which each UAV can use for the mobility during [0, T ] is limited to Emax . Clearly, in the multiple updates (mobilities) during [0, T ], the maximum energy consumption of each UAV at each update is equal to the remaining energy of the UAV. Let Γn,k be the remaining energy of the UAV at the location having index k ∈ In−1 at time tn . Then, we can write the following UAVs’ mobility optimization problem: X X min Ekl Zkl , Z s.t. X l∈In (52) l∈In k∈In−1 Zkl = 1, X Zkl = 1, (53) k∈In−1 Elk ≤ Γn,k , Zkl ∈ {0, 1}, ∀k ∈ In−1 , ∀l ∈ In , (54) where In−1 and In , are the initial and new sets of UAVs’ locations at times tn−1 and tn . Z is the |In | × |In | assignment matrix with each element Zkl being 1 if UAV k is assigned to location l, and 0 otherwise. Ekl is the energy used for moving a UAV from its initial location with index k ∈ In−1 to a new location with index l ∈ In . Also, Γn,k is the remaining energy for the UAVs at time tn . Note that, (54) guarantees that UAVs remain operational until the end of the period T . The total energy consumption of the rotary wing UAV while moving between 24 two stop locations can be computed as done in [30]: E= D (PV + PH ) , v (55) where D is the distance between two stop locations, D/v is the flight duration, PV is the power consumption for vertical movement, and PH is the power consumption for horizontal movement. Clearly, if the altitude difference between two stop locations is ∆h, the effective vertical and  . According to horizontal velocities will be vv = v sin φ and vh = v cos φ, with φ = sin−1 ∆h D [31] and [32], PH is composed of parasitic power and induced power needed for overcoming the parasitic drag and the lift-induced drag. The parasitic power, based on [32, equations (13.32), (13.27), and (11.3)], can be given by:   v 2  π 1 h 3 3 4 PP = ρCDo Ae vh + Nb cb ρCDo ω R 1 + 3 , 2 4 ωR (56) where vh is the effective horizontal velocity, CDo is the drag coefficient, ρ is the air density, cb is the blade chord, Nb is the number of blades, and Ae is the reference area (frontal area of the UAV) [31] and [32]. We note that the second term in (56) represents the blade power profile. Using [32, equations (13.19), (13.13), and (12.2)], the induced power (assuming zero tilt angle) can be computed by: PI = ωRW × λ, (57) where R is the rotor disk radius, W is the weight of the UAV, and ω is the angular velocity. Also, given [32, (13.18), (13.13), and (12.1)], we can find λ by solving the following equation: r vh2 2 4 + λ2 − W = 0. (58) g (λ) = 2ρπω R λ ω 2 R2 The power consumption due to the vertical climbing and descending (assuming rapid descent) can be given by [32, equations (12.35), (12.47), (12.50)]:  q   W vv + W vv 2 + 2W2 , climbing, 2 2 ρπR PV = q   W vv − W vv 2 − 2W2 , descending (in windmill state), 2 2 ρπR (59) where vv is the effective vertical velocity. Finally, the total mobility energy consumption is computed using (55)-(59). Clearly, the optimization problem in (52) is an integer linear programming (ILP). Following the similar approach we used for solving (15), we transform problem (52) to a standard assignment problem which can be solved using the Hungarian method in a polynomial time with a complexity 25 Table I: Simulation parameters. Parameter Description Value Pmax Maximum transmit power of each device 200 mW α Path loss exponent for LoS links 2 σ2 Noise power -130 dBm γ SINR threshold 5 dB L Total number of IoT devices 500 η1 Additional path loss to free space for LoS 3 dB η2 Additional path loss to free space for NLoS 23 dB of O(|In |3 ). To this end, we need to remove constraint (54) by considering Elk = +∞ when the constraint is not satisfied. To determine when (54) is not satisfied, we use In−1 and In to compute Elk , and compare it with the remaining energy of the UAVs, Γn,k . Then, in the objective function (52), we replace each Elk corresponding to the unsatisfied constraint with Elk = +∞. Consequently, (52) is transformed into a standard assignment problem. The result of solving (52) will be the assignment matrix, Z, that optimally assigns the UAVs to the destinations. Therefore, the locations of the UAVs are updated according to the new destinations. Then, having the destinations of each UAV at different update times, we can find the optimal trajectory of the UAVs. V. S IMULATION R ESULTS AND A NALYSIS For our simulations, the IoT devices are deployed within a geographical area of size 1 km × 1 km. In this case, we consider a total number of 500 IoT devices which are uniformly distributed on the area. Furthermore, we consider UAV-based communications in an urban environment with ψ = 11.95 and β = 0.14 at 2 GHz carrier frequency [8]. Table I lists the simulation parameters. Here, we analyze the transmit power of the IoT devices, the energy consumption of UAVs on their mobility, and the update times. In our update time analysis, unless otherwise stated, we consider the probabilistic activation model for the IoT devices with the beta distribution parameters κ = 3, and ω = 4 [20]. When applicable, we compare our results with pre-deployed stationary aerial base stations (UAVs) scenario while adopting the optimal device association and power control technique of Subsection III-A. In the stationary case, the locations of UAVs are assumed to be fixed over the target area and they are not updated according to the devices’ locations. All statistical results are averaged over a large number of independent runs. Note that, in the given IoT network, serving all the active devices may not be possible due to the limitations on the number of UAVs and the maximum transmit power of the devices. Thus, 26 0.9 0.8 Stationary aerial base stations Proposed approach Reliability 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 20 40 60 80 100 120 Pmax (mW) Fig. 4: Reliability comparison between the proposed approach and stationary aerial base stations using 5 UAVs. in Fig. 4, we show the achieved system reliability which, here, is defined as the probability that all the active devices can be served by the UAVs. Clearly, the reliability depends on the locations and transmit powers of the devices as well as the number of UAVs. Fig. 4 shows the reliability as the maximum transmit power of the devices, Pmax , varies. In this case, 5 UAVs are deployed to serve 100 active IoT devices. Clearly, as Pmax increases, the reliability also increases. In fact, for higher Pmax values, the devices have higher a chance to successfully connect to UAVs. From Fig. 4, we can see that, our proposed approach leads to a significantly improved reliability compared to the case in which stationary aerial base stations are used. In particular, the difference between the reliability of the stationary case and our proposed approach is significant for lower Pmax . Indeed, a higher reliability is achieved by dynamically optimizing the UAVs’ locations based on the locations of the IoT devices. As shown in Fig. 4, by increasing Pmax from 40 mW to 100 W, the reliability increases from 0.3 to 0.72 for the stationary case, while it increases from 0.58 to 0.82 in our proposed approach. Furthermore, the proposed approach yields a maximum of 28% improvement in the system reliability. Fig. 5 shows a snapshot of the UAVs’ locations and their associated IoT devices (indicated by the same color) resulting from the proposed approach. In this figure, 5 UAVs are efficiently deployed to serve 100 active IoT devices which are uniformly distributed on the area. In this case, all the devices are able to send their data to the associated UAVs by using a minimum total transmit power. Here, the 3D locations of the UAVs as well as the device association are determined based on the locations of the ground IoT devices and their transmit power. In Fig. 6, we show the total transmit power needed by the IoT devices for reliable uplink communications, versus the number of UAVs in the interference scenario. Clearly, the total transmit power of the IoT devices can be reduced by deploying more UAVs. For instance, 27 UAV 1 UAV 2 UAV 3 UAV 4 UAV 5 Devices Altitude (m) 400 300 200 100 0 1000 800 600 400 y−coordinate (m) 200 0 0 200 600 400 1000 800 x−coordinate (m) Fig. 5: UAVs’ locations and associations for one illustrative snapshot. 5 Proposed approach Stationary aerial base stations 4 3.5 3 2.5 2 1.5 1 0.5 0 0.5 Stationary aerial base stations Proposed approach 0.45 Total transmit power (W) Total transmit power (W) 4.5 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 5 6 7 8 9 10 Number of UAVs 0 5 6 7 8 9 10 Number of UAVs Fig. 6: Total transmit power of devices vs. number of Fig. 7: Total transmit power of devices vs. number of UAVs in the presence of interference. UAVs in the interference-free scenario. considering 100 active devices and 20 available channels, using our proposed approach, the total transmit power decreases from 2.4 W to 0.2 W by increasing the number UAVs from 5 to 10. Furthermore, using the proposed approach, the total transmit power of the devices decreases by 45% (on the average) compared to the stationary case. Clearly, for a lower number of UAVs, the proposed approach leads to higher power reduction compare to the stationary case. In other words, intelligently optimizing the locations of UAVs provides more power reduction gains when the number of UAVs is low. In fact, for very dense networks with a high number of UAVs, updating the UAVs’ locations is obviously no longer necessary compared to a case with a low number of UAVs. For instance, as we can see from Fig. 6, the power reduction gain achieved by deploying 5 UAVs is around 7 times larger than the case with 10 UAVs. Fig. 7 shows the total transmit power of the IoT devices as a function of the number of UAVs in an interference-free scenario. Compared to the interference scenario, the devices can obviously use a lower transmit power for sending their data to the UAVs. For instance, by efficiently deploying only 5 UAVs, the devices can establish reliable uplink communications with a total transmit power of 70 mW. Furthermore, Fig. 7 shows that, our proposed approach 28 Total transmit power (W) 1.8 Stationary aerial base stations Proposed approach 1.6 1.4 1.2 1 0.8 0.6 0.4 0.2 25 30 35 40 45 50 Number of orthogonal channels (R) Fig. 8: Total transmit power of devices vs. number of orthogonal channels. leads to an average of 80% power reduction compared to the stationary case. Fig. 8 shows the total transmit power of devices used for meeting the SINR requirement as the number of available channels varies. The result in Fig. 8 corresponds to a case with 100 active devices which are served by 5 UAVs. Clearly, the total transmit power decreases as the number of channels increases. This is due to the fact that, when more orthogonal resources are available, the interference between the devices will decrease. As a result, each device can reduce its transmit power while connecting to the serving UAV. From Fig. 8, we can see that, by increasing the number of channels from 25 to 50, the total transmit power of devices can be reduced by 68% in the proposed approach. In fact, the average number of interfering devices decreases from 4 to 2 when we increase the number of channels from 25 to 50. Consequently, less interference is generated by the devices while transmitting to the UAVs. In Fig. 9, we show the average number of active devices that must be served by UAVs at different update times tn which are normalized by T . Clearly, the number of active devices at each update time depends the activation process of the devices and the number of update times that indicates how frequently the UAVs serve the devices. In Fig. 9, due to the beta distributionbased activation pattern of the IoT devices, the number of active devices decreases when tn exceeds 0.5 for N = 10. From Fig. 9, we can see that, for a higher number of update times or equivalently shorter time period between consecutive updates, the average number of devices that need to transmit their data decreases. For instance, considering tn = 0.6, the average number of active devices decreases from 180 to 80 when the number of updates increases from 5 to 10. We also note that, while a lower number of active devices leads to a lower interference between the devices, it requires more updates and mobility for the UAVs. Fig. 9 also verifies that the analytical results in Theorem 2 match the simulations. Furthermore, in Fig. 10, we show the Average number of active devices 29 N=5 (Theory) N=10 (Theory) N=5 (Simulations) N=10 (Simulations) 200 180 160 140 120 100 80 60 40 20 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Update time (normalized) Fig. 9: Average number of active devices at update times for the probabilistic activation. Exact number of active devices 300 250 200 10 updates 30 updates 150 100 50 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Update time (normalized) 0.9 1 Fig. 10: Exact number of active devices at different update times for the periodic activation. exact number of active devices for the periodic activation case obtained from Proposition 2. In this case, each device becomes active with a certain activation period, τi . As expected, for a higher number of updates, a lower number of active devices will need to be served by the UAVs. For instance, by increasing the number of updates from 10 to 30, on the average, the number of active devices decreases by 58%. Moreover, Fig. 10 shows that the maximum number of active devices for 10 updates is about two times larger than the case with 30 updates. Therefore, in order to avoid the interference between the devices, the number of orthogonal channels must be increased by a two-fold factor when the number of updates decreases from 30 to 10. Fig. 11 presents a direct result of Theorem 2 that computes the update times based on the average number of active devices. Fig. 11 shows how to set update times in order to ensure that the number of devices (which needs to be served) at each update time does not exceed a specified number, a. As we can see from Fig. 11, to achieve a lower value of a, updates must occur more frequently to reduce the time interval between the consecutive updates. For example, as can be seen from this figure, to meet a = 100, 75, and 50, the 5th update must occur at tn = 0.41, 0.55, and 1. Moreover, Fig. 11 shows that, the number of updates increases as a decreases. For example, in this case, to reduce a from 100 to 50, the number of updates needs to be doubled. Fig. 12 shows the impact of the number of updates on the amount of energy that the UAVs use 30 Update time (normalized) 1 0.9 0.8 0.7 0.6 0.5 0.4 a = 100 a = 75 a = 50 0.3 0.2 0.1 1 2 3 4 5 6 7 8 9 10 Update number Fig. 11: Update times for different average number of active devices. to move. For our simulations, we have considered v = 10 m/s, ρ = 1.225 kg/m−3 , ω = 20 rad/s, R = 0.5 m, cb = 10 cm, Nb = 4, and W = 50 N [32]. Intuitively, a higher number of updates requires more mobility of the UAVs. Therefore, by increasing the number of updates, the total energy consumption of the UAVs will also increase. As we can see from Fig. 12, by increasing the number of updates from 3 to 6, the energy consumption of UAVs increases by a factor of 2.1 when the target area size is 1 km × 1 km. Note that, the mobility of the UAVs also depends on the size of geographical area in which the devices are distributed. Clearly, on average, the UAVs need to move further for covering a larger area. Interestingly, there is an inherent tradeoff between the number of updates, mobility of the UAVs, and transmit power of the IoT devices. In fact, considering Fig. 12, a higher number of updates leads to a higher energy consumption of the UAVs due to the higher mobility. In addition, as shown in Fig. 9, as the number of updates increases, a lower number of the IoT devices will be active at each update time, and, hence, there will be lower interference between the devices. As a result, the transmit power of the devices that is needed for satisfying the SINR requirement, can be reduced. Note that, as we showed in Fig. 8, the devices’ transmit power decreases as the interference decreases (by increasing the number of orthogonal channels). Hence, while a higher number of updates leads to a lower devices’ transmit power, it requires more UAVs’ mobility. Fig. 13 shows the overall convergence of the proposed power minimization algorithm that is used for solving the original problem (5) considering 5 UAVs. As we can see from the figure, in this case, the total transmit power of the IoT devices converges after 5 iterations. In Fig. 13, each iteration corresponds to a joint solution to the device association and UAVs’ locations optimization problems. Clearly, after several iterations, updating the device association Total energy consumption of UAVs (kJ) 31 500 Area size= 0.7km × 0.7km Area size= 1km × 1km 400 300 200 100 0 2 4 6 8 10 Number of updates 25 1000 3 20 800 15 600 10 400 5 200 2 1 0 1 2 3 4 5 6 0 10 7 Number of iterations 12 14 16 Relative computational time 4 Optimality gap (%) Total transmit power (W) Fig. 12: Total UAV energy consumption vs. number of updates. 0 18 Number of active devices Fig. 13: Overall convergence of the algorithm. Fig. 14: Proposed approach vs. optimal solution. and UAVs’ locations will no longer improve the solution. In Fig. 14, we show an example to compare the accuracy and time complexity of our proposed approach with the optimal solution obtained by an exhaustive search. Here, to perform an exhaustive search over the continuous space, we have discretized the space with a resolution of 0.1 m. In this case, two UAVs are deployed to serve the devices. Clearly, the average gap between the proposed solution and the optimal solution is around 11%. However, in this example, the proposed solution is around 500 times, on the average, faster than the optimal solution. VI. C ONCLUSION In this paper, we have proposed a novel framework for efficiently deploying and moving UAVs to collect data in the uplink from ground IoT devices. In particular, we have determined the jointly optimal UAVs’ locations, device association, and uplink power control of the IoT devices such that the total transmit power of the devices under their SINR constraints is minimized. In addition, we have investigated the effective movement of the UAVs to collect the IoT data in a time-varying IoT network. For this case, based on the devices activation process, we have derived the update time instances at which the UAVs must update their locations. Furthermore, we have obtained the optimal trajectories that are used by the UAVs to dynamically serve the IoT devices with a minimum energy consumption. The results have shown that by intelligently moving and 32 deploying the UAVs, the total transmit power of the devices significantly decreases compared to the case with pre-deployed stationary aerial base stations. Moreover, there is a fundamental tradeoff between the number of updates, the UAVs’ mobility, and the devices’ transmit power. R EFERENCES [1] M. Mozaffari, W. Saad, M. Bennis, and M. Debbah, “Unmanned aerial vehicle with underlaid device-to-device communications: Performance and tradeoffs,” IEEE Transactions on Wireless Communications, vol. 15, no. 6, pp. 3949–3963, June 2016. [2] Y. Zeng, R. Zhang, and T. J. Lim, “Wireless communications with unmanned aerial vehicles: opportunities and challenges,” IEEE Communications Magazine, vol. 54, no. 5, pp. 36–42, May 2016. [3] F. Jiang and A. L. Swindlehurst, “Optimization of UAV heading for the ground-to-air uplink,” IEEE Journal on Selected Areas in Communications, vol. 30, no. 5, pp. 993–1005, June 2012. [4] Y. Zeng, R. Zhang, and T. J. Lim, “Throughput maximization for UAV-enabled mobile relaying systems,” IEEE Transactions on Communications, vol. 64, no. 12, pp. 4983–4996, Dec. 2016. [5] M. Mozaffari, W. Saad, M. Bennis, and M. Debbah, “Mobile Internet of Things: Can UAVs provide an energy-efficient mobile architecture?” in Proc. of IEEE Global Communications Conference (GLOBECOM), Washington, DC, USA, Dec. 2016. [6] R. Yaliniz, A. El-Keyi, and H. Yanikomeroglu, “Efficient 3-D placement of an aerial base station in next generation cellular networks,” in Proc. of IEEE International Conference on Communications (ICC), Kuala Lumpur, Malaysia, May 2016. [7] M. Mozaffari, W. Saad, M. Bennis, and M. Debbah, “Optimal transport theory for cell association in UAV-enabled cellular networks,” IEEE Communications Letters, vol. 21, no. 9, pp. 2053–2056, Sept. 2017. [8] A. Al-Hourani, S. Kandeepan, and S. Lardner, “Optimal LAP altitude for maximum coverage,” IEEE Wireless Communication Letters, vol. 3, no. 6, pp. 569–572, Dec. 2014. [9] M. Mozaffari, W. Saad, M. Bennis, and M. Debbah, “Efficient deployment of multiple unmanned aerial vehicles for optimal wireless coverage,” IEEE Communications Letters, vol. 20, no. 8, pp. 1647–1650, Aug. 2016. [10] V. V. Chetlur and H. S. Dhillon, “Downlink coverage analysis for a finite 3D wireless network of unmanned aerial vehicles,” IEEE Transactions on Communications, to appear, 2017. [11] M. Chen, M. Mozaffari, W. Saad, C. Yin, M. Debbah, and C. S. Hong, “Caching in the sky: Proactive deployment of cacheenabled unmanned aerial vehicles for optimized quality-of-experience,” IEEE Journal on Selected Areas in Communications, vol. 35, no. 5, pp. 1046–1061, May 2017. [12] M. Mozaffari, W. Saad, M. Bennis, and M. Debbah, “Wireless communication using unmanned aerial vehicles (UAVs): Optimal transport theory for hover time optimization,” available online: arxiv.org/abs/1704.04813, 2017. [13] S.-Y. Lien, K.-C. Chen, and Y. Lin, “Toward ubiquitous massive accesses in 3GPP machine-to-machine communications,” IEEE Communications Magazine, vol. 49, no. 4, pp. 66–74, Apr. 2011. [14] J. Lyu, Y. Zeng, R. Zhang, and T. J. Lim, “Placement optimization of UAV-mounted mobile base stations,” IEEE Communications Letters, vol. 21, no. 3, pp. 604–607, Mar. 2017. [15] Y. Pang, Y. Zhang, Y. Gu, M. Pan, Z. Han, and P. Li, “Efficient data collection for wireless rechargeable sensor clusters in harsh terrains using UAVs,” in Proc. of IEEE Global Communications Conference (GLOBECOM), Austin, TX, USA, Dec. 2014. 33 [16] C.-Y. Tu, C.-Y. Ho, and C.-Y. Huang, “Energy-efficient algorithms and evaluations for massive access management in cellular based machine to machine communications,” in Proc. of Vehicular Technology Conference (VTC), San Francisco, CA, USA, Sep. 2011. [17] K.-C. Chen and S.-Y. Lien, “Machine-to-machine communications: Technologies and challenges,” Ad Hoc Networks, vol. 18, pp. 3–23, July 2014. [18] M. Tavana, V. Shah-Mansouri, and V. W. S. Wong, “Congestion control for bursty M2M traffic in LTE networks,” in Proc. of IEEE International Conference on Communications (ICC), London, UK, June 2015. [19] X. Jian, X. Zeng, Y. Jia, L. Zhang, and Y. He, “Beta/M/1 model for machine type communication,” IEEE Communications Letters, vol. 17, no. 3, pp. 584–587, Mar. 2013. [20] 3GPP, “Study on RAN improvements for machine type communication,” TR 37.868, Sep. 2011. [21] A. K. Gupta and S. Nadarajah, Handbook of beta distribution and its applications. CRC press, 2004. [22] S. Z. Selim and M. A. Ismail, “K-means-type algorithms: a generalized convergence theorem and characterization of local optimality,” IEEE Transactions on Pattern Analysis and Machine Intelligence, no. 1, pp. 81–87, 1984. [23] R. D. Yates, “A framework for uplink power control in cellular radio systems,” IEEE Journal on Selected Areas in Communications, vol. 13, no. 7, pp. 1341–1347, Sep. 1995. [24] R. Sun, M. Hong, and Z. Q. Luo, “Joint downlink base station association and power control for max-min fairness: Computation and complexity,” IEEE Journal on Selected Areas in Communications, vol. 33, no. 6, pp. 1040–1054, June. 2015. [25] R. E. Burkard, M. Dell’Amico, and S. Martello, Assignment Problems, Revised Reprint. SIAM, 2009. [26] H. W. Kuhn, “The hungarian method for the assignment problem,” Naval research logistics quarterly, vol. 2, no. 1-2, pp. 83–97, 1955. [27] P. T. Boggs and J. W. Tolle, “Sequential quadratic programming,” Acta numerica, vol. 4, pp. 1–51, 1995. [28] K. Scheinberg, “An efficient implementation of an active set method for SVMs,” Journal of Machine Learning Research, vol. 7, no. Oct, pp. 2237–2257, 2006. [29] S. Boyd and L. Vandenberghe, Convex optimization. Cambridge university press, 2004. [30] C. Di Franco and G. Buttazzo, “Energy-aware coverage path planning of UAVs,” in Proc. of IEEE International Conference on Autonomous Robot Systems and Competitions (ICARSC), Vila Real, Portugal, Apr. 2015. [31] Y. Zeng and R. Zhang, “Energy-efficient UAV communication with trajectory optimization,” IEEE Transactions on Wireless Communications, vol. 16, no. 6, pp. 3747–3760, June 2017. [32] A. Filippone, Flight performance of fixed and rotary wing aircraft. Elsevier, 2006.
7cs.IT
On the weak order ideal associated to linear codes Mijail Borges-Quintana, Miguel Ángel Borges-Trenard∗ arXiv:1705.06609v1 [cs.IT] 17 May 2017 Edgar Martı́nez-Moro † Abstract In this work we study a weak order ideal associated with the coset leaders of a non-binary linear code. This set allows the incrementally computation of the coset leaders and the definitions of the set of leader codewords. This set of codewords has some nice properties related to the monotonicity of the weight compatible order on the generalized support of a vector in Fnq which allows to describe a test set, a trial set and the set of zero neighbours of a linear code in terms of the leader codewords. keywords Linear codes, order ideals, test set, trial set, zero neighbours, correctable errors 1 Introduction As it is pointed in [5] it is common folklore in the theory of binary linear codes that there is an ordering on the coset leaders chosen as the lexicographically smallest minimum weight vectors that provides a monotone structure. This is expressed as follows: if x is a coset leader and y ⊆ x (i.e. yi ≤ xi for all i) then y is also a coset leader. This nice property has been proved of great value, see for example [12], and it has been used for analyzing the error-correction capability of binary linear codes [5]. In this last paper the authors introduce the concept of a trial set of codewords and they provide a gradient-like decoding algorithm based on this set. Finding the weight distribution of cosets leaders for a code C is a classic problem in coding theory. This problem is still unsolved for many family ∗ M. Borges-Quintana and M.A. Borges-Trenard are with the Department of Department of Mathematics, Faculty of Ciencias Naturales y Exactas, Universidad de Oriente, Santiago de Cuba, Cuba. Emails: [email protected], [email protected]. M. BorgesQuintana has been partially supported by a Post-doctorate scholarship at the University of Valladolid (09-2014 to 02-2015) by Erasmus Mundus Program, Mundus Lindo Project. † E. Martı́nez-Moro is with the Institute of Mathematics IMUVa, University of Valladolid. Valladolid, Castilla, Spain. Email: [email protected]. Partially supported by Partially supported by the Spanish MINECO under grants MTM2015-65764-C3-1-P and MTM2015-69138-REDT. 1 of linear codes even for first-order Reed-Muller codes (see [6]). The set of coset leaders is also related with the minimum distance decoding and bounded distance decoding problems as well with the set of minimal support codewords. [1, 9, 10] Despite their interest no generalization of these ideas is known by the authors of this communication to non-binary case. In this paper we provide such a (non straightforward) generalization. The outline of the paper is as follows Section 2 introduces the idea of a generalized support of a vector In Section 3 is is defined the weak order ideal associated with the coset leaders O(C) and it is shown that can be computed incrementally. Theorem 3.4 establishes that all the coset leaders of the code belong to O(C). Subsection 3.2 is devoted to the study of the set of leader codewords of a code as a zero neighbour set and their properties. Finally in Section 4 we analyze the correctable and uncorrectable errors defining a trial set for a linear code from the set of leader codewords. The limitations from a practical point view of the results and properties studied in this paper are clear because of the size and the complexity of computing the set of coset leaders. Anyway our main interest is the study and characterizations of some objects related to the codes like zero neighbours, trial set, and the set of correctable and uncorrectable errors. 2 Preliminaries From now on we shall denote by Fq the finite field with with q = pm elements, p a prime. A linear code C over Fq of length n and dimension k is a kdimensional subspace of Fnq . We will call the vectors v in Fnq words and those v ∈ C, codewords. For every word v ∈ Fnq its support is defined as supp(v) = {i | vi 6= 0} and its Hamming weight, denoted by wH (v) as the cardinality of supp(v) and the Hamming distance dH (x, y) between two words x, y ∈ Fnq is dH (x, y) = wH (x − y). The minimum distance d(C) of a linear code C is defined as the minimum weight among all nonzero codewords. The words of minimal Hamming weight in the cosets of Fnq /C is the set of coset leaders of the code C in Fnq and we will denote it by CL(C). CL(y) will denote the subset of coset leaders corresponding to the coset y + C. Given a coset y + C we define the weight of the coset wH (y + C) as the smallest Hamming weight among all vectors in the coset, or equivalently the weight ⌋ where ⌊·⌋ of one of its leaders. It is well known that given t = ⌊ d(C)−1 2 denotes the greatest integer function then every coset of weight at most t has a unique coset leader. Let f (X) be an irreducible polynomial over Fp of degree m and β be a root of f (X), then any element a ∈ Fq can be represented as a1 + a2 β + . . . + am β m−1 with ai ∈ Fp for i ∈ {1, . . . , m}. For a word v = (v1 , . . . , vn ) ∈ Fnq , 2 such that the i-th component of v is vi = vi,1 + vi,2 β + . . . + vi,m β m−1 we define the generalized support of a vector v as the support of the nm-tuple given by the concatenations of the p-adic expansion of each component vi of v, i.e. suppgen (v) = (supp((vi,1 , . . . , vi,m )) : i = 1 . . . n), and suppgen (v)[i] = supp((vi,1 , . . . , vi,m )). We will say that (i, j) ∈ suppgen (v) if the corresponding vi,j is not zero. From now on the set  eij = β j−1 ei : i = 1, . . . , n; j = 1, . . . m will be denoted as Can(Fq , f ) and it represents the canonical basis of (Fnq , +), the additive monoid Fnq with respect to the “+” operation, where f is the irreducible polynomial used to define Fq . We state the following connection between Fnq and Nnm : ∆ : Fnq → Nnm v 7→ (ψ(vi,j ) : i = 1, . . . , n, j = 1, . . . , m), where ψ : Fp → N k · 1Fp 7→ k mod p. On the other hand, ∇ : Nnm → Fnq a 7→ ((am(i−1)+1 + am(i−1)+2 β + . . . + am(i−1)+m β m−1 ) : i = 1, . . . , n). P P Given x, y ∈ (Fnq , +), x = i,j xij eij , y = i,j yij eij , we say x ⊂ y if ψ(xij ) ≤ ψ(yij ) for all i ∈ [1, n], and j ∈ [1, m]. By using ∆ it is possible to relate orders on Fnq with orders on Nnm , and vice versa. An admissible order on (Nnm , +) is a total order < on Nnm satisfying the following two conditions 1. 0 < x, for all x ∈ Nnm , x 6= 0. 2. If x < y, then x + z < y + z, for all z ∈ Nnm . In particular, Any admissible order on (Nnm , +), like the Lexicographical, Degree Lexicographical, Degree Reverse Lexicographical orders, induces an order on (Fnq , +). We will say that a representation of a word v as an nm-tuple over N is in standard form if ∆(∇(v)) = v. We will denote the standard form of v as SF(v, f ) (note that ∇(v) = ∇(SF(v, f ))). Therefore, v is in standard form if v = SF(v, f ) (we will also say v ∈ SF(Fnq , f )). Remark 1. From now on we will use Can(Fq ) and SF(Fnq ) instead of Can(Fq , f ) and SF(Fnq , f ) respectively, since it is clear that different elections of f or β provide equivalent generalized supports. 3 Definition 1. A subset O of Nk is an order ideal if for all w ∈ O and v ∈ Nk s.t. vi ≤ wi , i = 1, . . . , k, we have v ∈ O. In the same fashion we say that a subset S of Fnq is an order ideal if ∆(S) is an order ideal in Nnm . It is easy to check that an equivalent definition for the order ideal would be that for all w ∈ S, and for all (i, j) ∈ suppgen (w), and v ∈ Fnq s.t. w = v + eij we have v ∈ S. If instead of for all (i, j) ∈ suppgen (w) the condition is satisfied at least for one (i, j) ∈ suppgen (w) we say that S is a weak order ideal. Definition 2. A subset S of Fnq is a weak order ideal if for all w ∈ S \ 0 there exists (i, j) ∈ suppgen (w) s.t. for v ∈ Fnq s.t. w = v + eij we have v ∈ S. Definition 3. The Voronoi region of a codeword c ∈ C is the set  D(c) = y ∈ Fnq | dH (y, c) ≤ dH (y, c′ ), ∀c′ ∈ C \ {c} . The set of all the Voronoi regions for a given linear code C covers the space Fnq and D(0) = CL(C). However, some words in Fnq may be contained in several regions. For any subset A ⊂ Fnq we define  X (A) = y ∈ Fnq | min {dH (y, a) : a ∈ A} = 1 as the set of words at Hamming distance 1 from A, i.e. The boundary of A is defined as δ(A) = X (A) ∪ X (Fnq \ A). Definition 4. A nonzero codeword z ∈ C is called a zero neighbour if its Voronoi region shares a common boundary with the set of coset leaders, i.e. δ(D(z)) ∩ δ(D(0)) 6= ∅. The set of all zero neighbours of C is denoted by Z(C) = {z ∈ C \ {0} : δ(D(z)) ∩ δ(D(0)) 6= ∅} . Definition 5. A test-set T for a given linear code C is a set of codewords such that every word y 1. either y lies in D(0) 2. or there exists v ∈ T such that wH (y − v) < wH (y). The set of zero neighbours is a test set, also from the set of zero neighbours can be obtained any minimal test set according to the cardinality of the set [1]. 3 The weak order ideal of the coset leaders The first idea that allows us to compute incrementally the set of all coset leaders for a linear code was introduced in [2]. In that paper we used the additive structure of Fnq with the set of canonical generators Can(Fq ). Unfortunately in [2] most of the chosen coset representatives may not be coset leaders if the weight of the coset is greater than t. 4 Theorem 3.1 ([7], Theorem 1.12.6.v). Assume that x is a coset leader of C. If x′ ∈ Fnq and x′i = xi for all i ∈ supp(x′ ), then x′ is also a coset leader of C. In order to incrementally generate all coset leaders starting from 0 adding elements in Can(Fq ), we must consider words with weight one more than the previous chosen coset leader. Next result is a byproduct of Theorem 3.1, we may characterize which vectors we need to generate with weight one more than its coset leader in order to ensure all coset leaders are generated. Theorem 3.2. Let x ∈ SF(Fnq ) be an element in CL(C), let i ∈ supp(x). If x′ ∈ Fnq and x′j = xj for all j ∈ supp(x′ )\{i}, then wH (x′ ) ≤ wH (x′ + C)+ 1. Proof. By Theorem 3.1, x − xi ∈ CL(C). The proof of the Theorem is analogous to the proof of Theorem 1.12.6.v in [7]. Note that if we suppose that wH (x′ ) ≥ wH (x′ + C) + 2 it would imply that x is not a coset leader, which is a contradiction. Let w ∈ SF(Fnq ) be an element in CL(C), and (i, j) ∈ suppgen (w). Let y ∈ SF(Fnq ) s.t. w = y + eij then, as a consequence of the previous theorem we have that wH (y) ≤ wH (y + C) + 1. (1) In the situation above we will say that the coset leader w is an ancestor of the word y, and that y is a descendant of w. In the binary case this definitions behave as the ones in [7, §11.7] but in the case q 6= 2 there is a subtle difference, a coset leader could be an ancestor of another coset leader or an ancestor of a word at Hamming distance 1 to a coset leader (this last case is not possible in the binary case). 3.1 The set O(C) Given ≺1 an admissible order on (Nnm , +) we define the weight compatible order ≺ on (Fnq , +) associated to ≺1 as the ordering given by 1. x ≺ y if wH (x) < wH (y) or 2. if wH (x) = wH (y) then ∆(x) ≺1 ∆(y). I.e. the words are ordered according their weights and the order ≺1 break ties. These class of orders is a subset of the class of monotone α-orderings in [5]. In fact we will need a little more than monotonicity, for the purpose of this work we will also need that for every pair v, w ∈ SF(Fnq ) if v ⊂ w, then v ≺ w. 5 (2) Note that (2) is satisfied for a weight compatible order. In addition, for any weight compatible order ≺ every strictly decreasing sequence terminates (due to the finiteness of the set Fnq ). In the binary case the behavior of the coset leaders can be translated to the fact that the set of coset leader is an order ideal of Fn2 ; whereas, for non binary linear codes this is no longer true even if we try to use the characterization of order ideals given in [4], where order ideals do not need to be associated with admissible orders. Definition 6. We define the weak order ideal of the coset leaders of C as the set O(C) of elements in Fnq verifying one of the following items: 1. 0 ∈ O(C). 2. Criterion  1: If v ∈ O(C) and wH (v) = wH (v + C) then v + eij | ∆(v) + ∆(eij ) ∈ SF(Fnq ) ⊂ O(C).  3. Criterion 2: If v ∈ O(C) and wH (v) = wnH (v + C) + 1 then v + eij | i ∈ supp(v), ∆(v) + ∆(eij ) ∈ SF(Fq ) , v − vi ∈ CL(C)} ⊂ O(C). Remark 2. It is clear by the Criteria 1 and 2 of the definition above that O(C) is a weak order ideal. Theorem 3.3. Let w ∈ Fnq . If there exists i ∈ 1, . . . , n s.t. w − wi ∈ CL(C) then w ∈ O(C). Proof. We will proceed by induction on Fnq with respect to the order ≺. The statement is true for 0 ∈ Fnq . Now for the inductive step, we assume that the desired property is true for any word u ∈ Fnq such that there exists i ∈ 1, . . . , n s.t. u − ui ∈ CL(C) and also u is smaller than an arbitrary but fixed w 6= 0 with respect to ≺ and w − wj ∈ CL(C), for some j ∈ 1, . . . , n, i.e. if u − ui ∈ CL(C), for some i ∈ 1, . . . , n, and u ≺ w then u ∈ O(C). We will show that the previous conditions imply that w is also in O(C). Let w = v + eij , with (i, j) ∈ suppgen (w) then v ≺ w by (2). As w − wi ∈ CL(C), the same is true for v, i.e, v − vi ∈ CL(C) then by the induction hypothesis we have that v ∈ O(C). By Theorem 3.2, wH (v) ≤ wH (v + C) + 1; therefore, by Criteria 1 or 2 in Definition 6 it is guaranteed that w ∈ O(C). Theorem 3.4. Let w ∈ Fnq and w ∈ CL(C) then w ∈ O(C). Proof. Let (i, j) ∈ suppgen (w), since w ∈ CL(C), by Theorem 3.2, w − wi ∈ CL(C); then, by Theorem 3.3, w ∈ O(C). The previous theorem has been shown that O(C) contains the set of coset leaders of the linear code C. 6 3.2 Zero neighbours and leader codewords Definition 7. The set of leader codewords of a linear code C is defined as   v1 + eij − v2 ∈ C \ {0} | ∆(v1 ) + ∆(eij ) ∈ SF(Fnq ), L(C) = . v2 ∈ CL(C) and v1 − v1i ∈ CL(C) Note that the definition is a bit more complex that the one for binary codes in [3] due to the fact that in the general case not all coset leaders need to be ancestors of coset leaders. The name of leader codewords comes from the fact that one could compute all coset leaders of a corresponding word knowing the set L(C) adapting [3, Algorithm 3]. Remark 3. The algorithm for computing L(C) is based on the construction of O(C). Theorem 3.3 guarantees that w ∈ O(C) provided that w−wi ∈ CL(C) for some i, then the associated set of leader codewords may be computed as {w − v : w ∈ O(C), w − wi ∈ CL(C), v ∈ CL(w) and v 6= w}. Theorem 3.5 (Properties of L(C)). Let C be a linear code then 1. L(C) is a test set for C. 2. Let w be an element in L(C) then wH (w) ≤ 2ρ(C) + 1 where ρ(C) is the covering radius of the code C. 3. If w ∈ L(C) then X (D(0)) ∩ (D(w) ∪ X (D(w))) 6= ∅. 4. If X (D(0)) ∩ D(w) 6= ∅ then w ∈ L(C). Proof. 1) Let y ∈ / CL(C) and supp(y) = {ik : k = 1, . . . , l}, l ≤ n. Let P / s be such that 1 ≤ s < l, v1 = sk=1 yik eik ∈ CL(C), v1 +PyiS+1 eiS+1 ∈ z CL(C) and v2 = CL(v1 + yiS+1 eiS+1 ). Let yiS+1 eiS+1 = t=1 eijt and v1 ′ = v1 + yiS+1 eiS+1 − eijZ . Then v1 ′ − v1 ′i = v1 ∈ CL(C) implies that w = v1 ′ + eijZ − v2 ∈ L(C). In addition, wH (y − w) = wH (v2 + (y − v1 ′ − eijZ )) ≤ wH (v2 ) + wH (y − v1 ′ − eijZ ) and wH (v2 ) + wH (y − v1 ′ − eijZ ) < wH (v1 ′ + eijZ ) + wH (y − v1 ′ − eijZ ). Note that supp(v1 ′ + eijZ ) ∩ supp(y − v1 ′ − eijZ ) = ∅; consequently, wH (y) = wH (v1 ′ + eijZ ) + wH (y − v1 ′ − eijZ ) and wH (y − w) < wH (y). Thus, L(C) is a test set. 2) Let c ∈ L(C) then there exists v2 ∈ CL(C), v1 ∈ SF(Fnq ), 1 ≤ i ≤ n and 1 ≤ j ≤ m such that v1 − v1i ∈ CL(C) and c = v1 + eij − v2 . Applying the definition of covering radius we have that wH (v1 − v1i ), wH (v2 ) ≤ ρ, thus wH (c) ≤ 2ρ + 1. 3) Let w ∈ L(C), then w = v1 + eij − v2 , where v1 , v2 are elements in n Fq such that v1 + eij ∈ SF(Fnq ), v2 ∈ CL(C) and v1 − v1i ∈ CL(C). • If v1 + eij ∈ / CL(C), then v1 + eij ∈ X (D(0)) and (v1 + eij ) − w = v2 ∈ CL(C) implies that v1 + eij ∈ D(w). 7 • If v1 + eij ∈ CL(C) we define v1′ = v1′ (0) = v1 + eij . It is clear be a number in the set that v1′ , v2 ∈ CL(v2 ). Since w 6= 0 let l P ′ {1, . . . , n} such that v1l −v2l 6= 0. Let v2l = Tj=1 elij , for 1 ≤ h ≤ T , P P v1 ′ (h) = v1′ + hj=1 elij and v2 (h) = v2 − hj=1 elij . / CL(C) and If there exists an h (1 ≤ h < T ) such that v1′ (h) ∈ ′ v1 (h − 1) ∈ CL(C) then these two conditions imply that v1′ (h) ∈ X (D(0)). On the other hand, v2 (h) = v1′ (h) − w is either a coset leader (v1′ (h) ∈ D(w)) or dH (v2 (h), v2 ) = 1 (v1′ (h) ∈ X (D(w))). If there is no such and h (1 ≤ h < T ) satisfying the condition then wH (v1′ (T )) = wH (v2 (T )) + 1, which means that v1′ (T ) is not a coset leader and v1′ (T − 1) is a coset leader. Then using the same idea of the previous paragraph we have that v1′ (T ) ∈ X (D(0)) and v1′ (T ) ∈ D(w) ∪ X (D(w)). 4) If X (D(0)) ∩ D(w) 6= ∅, let u ∈ X (D(0)) ∩ D(w). The first condition u ∈ X (D(0)) implies u = v1 + eij for some v1 ∈ SF(Fnq ) , (i, j) ∈ suppgen (u) and v1 − v1i ∈ CL(C). On the other hand, v1 + eij ∈ D(w) implies that v2 = (v1 + eij ) − w ∈ CL(C). Therefore, w = v1 + eij − v2 ∈ L(C). Remark 4. Note that item 3 in Theorem 3.5 implies that any leader codeword is a zero neighbour however, one of the differences with the binary case is that it is not always true that for a leader codeword w we have that X (D(0)) ∩ D(w) 6= ∅, although by item 4 we have that w is a leader codeword provided this condition is satisfied. Furthermore, item 4 guarantees that the set of leader codewords contains all the minimal test set according to its cardinality (see [1]). As a consequence of all these properties in Theorem 3.5 we could say that the the set of leader codewords is a “good enough” subset of the set of zero neighbours. 4 Correctable and uncorrectable errors We define the relation ⊂1 in the additive monoid which describe exactly the relation ⊂ in the vector space Fnq . Given x, y ∈ (Fnq , +) x ⊂1 y if x ⊂ y and supp(x) ∩ supp(y − x) = ∅. (3) Note that this definition translates to Fnq the binary case situation in [5]. In this case given a y ∈ (Fnq , +) there are more words x ∈ (Fnq , +) such that x ⊂ y than if we consider x, y as elements in the vector space Fnq . Of course, any relation x ⊂ y in Fnq as a vector space it is also true in the additive monoid, but it is not true the other way round. The set E 0 (C) of correctable errors of a linear code C is the set of the minimal elements with respect to ≺ in each coset. The elements of the set 8 E 1 (C) = Fnq \E 0 (C) will be called uncorrectable errors. A trial set T ⊂ C \{0} of the code C is a set which has the following property y ∈ E 0 (C) if and only if y  y + c, for all c ∈ T. Since ≺ is a monotone α-ordering on Fnq , the set of correctable and uncorrectable errors form a monotone structure. Namely, if x ⊂1 y then x ∈ E 1 (C) implies y ∈ E 1 (C) and y ∈ E 0 (C) implies x ∈ E 0 (C). In the general case q 6= 2 there is a difference with respect to the binary case, there may be words y′ ∈ Fnq s.t. suppgen (y′ ) = suppgen (y), y′ ⊂ y and y′ could be either a correctable error or an uncorrectable error, so, the monotone structure it is not sustained by ⊂ in the additive monoid (Fnq , +). Let the set of minimal uncorrectable errors M 1 (C) be the set of y ∈ E 1 (C) such that, if x ⊆1 y and x ∈ E 1 (C), then x = y. In a similar way, the set of maximal correctable errors is the set M 0 (C) of elements x ∈ E 0 (C) such that, if x ⊆1 y and y ∈ E 0 (C), then x = y. For c ∈ C \ {0}, a larger half is defined as a minimal word u ⊆1 c in the ordering  such that u − c ≺ u. The weight of such a word u is such that wH (c) ≤ 2wH (u) ≤ wH (c) + 2, see [5] for more details. The set of larger halves of a codeword c is denoted by LH (c), and for U ⊆ C \ {0} the set of larger halves for elements of U is denoted by LH (U ). Note that LH (C) ⊆ E 1 (C). For any y ∈ Fnq , let H(y) = {c ∈ C : y − c ≺ y}, and we have y ∈ E 0 (C) if and only if H(y) = ∅, and y ∈ E 1 (C) if and only if H(y) 6= ∅. In [5, Theorem 1] there is a characterization of the set M 1 (C) in terms of H(·) and larger halves of the set of minimal codewords M (C) for the binary case. It is easy to proof that this Theorem and [5, Corollary 3] are also true for any linear code. Proposition 4.1 (Corollary 3 in [5] ). Let C be a linear code and T ⊆ C\{0}. The following statements are equivalent,: 1. T is a trial set for C. 2. If y ∈ M 1 (C), then T ∩ H(y) 6= ∅. 3. M 1 (C) ⊆ LH (T ). Now we will formulate the result which relates the trial sets for a given weight compatible order ≺ and the set of leader codewords. Theorem 4.2. Let C be a linear code and L(C) the set of leaders codewords for C, the following statements are satisfied. 1. L(C) is a trial set for any given ≺. 9 2. Algorithm 2 in [3] can be adapted to compute a set of leader codewords which is a trial set T for a given ≺ such that satisfies the following property For any c ∈ T , there exists y ∈ M 1 (C) ∩ LH (c) s.t. y − c ∈ E 0 (C). Proof. Proof of 1) We will prove statement 2 of Proposition 4.1. Let y ∈ M 1 (C), let i such that suppgen (y)[i] 6= ∅ and v1 = y − yi . Since y ∈ M 1 (C) we have that v1 ∈ E 0 (C), thus it is a coset leader. On the other hand, let v2 ∈ E 0 (C) such that v2 ∈ CL(y) and c = y − v2 . It is clear that c is a leader codeword and y − c = v2 ≺ y. Therefore c ∈ H(y). Proof of 2) In the Algorithm 2 in [3], as the first step, it is necessary to add to the function InsertNext the Criteria 2 of the construction of O(C), whose elements are stored in Listing. On the other hand, in the steps of the construction of the leader codewords (Steps 11 - 13) it is enough to state the condition t ∈ M 1 (C) for t and taking tk only equal to the coset leader of CL(t), that is the corresponding correctable error and add the codeword t − tk to the set L(C). References [1] A. Barg, Complexity issues in coding theory. In Handbook of coding theory, Vol. I, North-Holland, Amsterdam, pp. 649–754, 1998. [2] M. Borges-Quintana, M.A. Borges-Trenard, E. Martı́nez-Moro, On a Gröbner bases structure associated to linear codes, J. Discret. Math. Sci. Cryptogr. 10(2), pp. 151–191, 2007. [3] M. Borges-Quintana, M.A. Borges-Trenard, I. Márquez-Corbella, E. Martı́nez-Moro, Computing coset leaders and leader codewords of binary codes, Journal of Algebra and its Applications 14, 2015. [4] G. Braun, S. Pokutta. A polyhedral characterization of border bases. SIAM J. Discrete Math 30(1), pp. 239–265, 2016. [5] T. Helleseth, T. Kløve, I.L. Vladimir, Error-correction capability of binary linear codes, IEEE Transactions on Information Theory 51(4), pp. 1408–1423, 2005. [6] R.P. Kurshan and N.J.A. Sloane. Coset analysis of reed muller codes via translates of finite vector spaces, Information and Control 20(5), pp. 410 - 414, 1972. [7] W.C. Huffman, V. Pless, Fundamentals of error-correcting codes, Cambridge University Press, Cambridge, 2003. 10 [8] F. J. MacWilliams, N. J. A. Sloane. The Theory of Error-Correcting Codes, Elsevier/North Holland, 1997. [9] I. Márquez-Corbella, E. Martı́nez-Moro. Algebraic structure of the minimal support codewords set of some linear codes. Adv. Math. Commun. 5(2), pp. 233–244, 2011. [10] J. L. Massey. Minimal codewords and secret sharing, Proceedings of the 6th Joint Swedish-Russian International Workshop on Information Theory, pp. 246–249, 1993. [11] T. Mora. Solving Polynomial Equation Systems II: Macaulay’s Paradigm and Gröbner Technology. Cambridge University Press, 2005. [12] G. Zémor, G. Cohen. The threshold probability of a code, IEEE Trans. Inform. Theory 41(2), pp. 469–477, 1995. 11
7cs.IT
Deep learning for word-level handwritten Indic script identification Soumya Ukil1 , Swarnendu Ghosh1 , Sk Md Obaidullah2 , K. C. Santosh3 , Kaushik Roy4 , and Nibaran Das1 1 Dept. of Computer Science & Engineering, Jadavpur University, Kolkata 700032, WB, India Dept. of Computer Science & Engineering, Aliah University, Kolkata 700156, WB, India 3 Dept. of Computer Science, The University of South Dakota, Vermillion, SD 57069, USA Dept. of Computer Science & Engineering, West Bengal State University, 700126, WB, India arXiv:1801.01627v1 [cs.CV] 5 Jan 2018 2 4 Corresponding authors: K. C. Santosh ([email protected]) & N. Das ([email protected]) Abstract. We propose a novel method that uses convolutional neural networks (CNNs) for feature extraction. Not just limited to conventional spatial domain representation, we use multilevel 2D discrete Haar wavelet transform, where image representations are scaled to a variety of different sizes. These are then used to train different CNNs to select features. To be precise, we use 10 different CNNs that select a set of 10240 features, i.e. 1024/CNN. With this, 11 different handwritten scripts are identified, where 1K words per script are used. In our test, we have achieved the maximum script identification rate of 94.73% using multi-layer perceptron (MLP). Our results outperform the state-of-the-art techniques. Keywords: Convolutional neural network, deep learning, multi-layer perceptron, discrete wavelet transform, Indic script identification 1 Introduction Optical character recognition (OCR) has always been a challenging field in pattern recognition. OCR techniques are used to convert handwritten or machine printed scanned document images to machine-encoded texts. These OCR techniques are script dependent. Therefore, script identification is considered as a precursor to OCR. In particular, in case of a multilingual country like India script identification is the must since a single document, such as postal documents and business forms, contains several different scripts (see Fig. 1). Indic handwritten script identification has a rich state-of-the-art literature [1–4]. More often, previous works have been focusing on word-level script identification [5]. Not stopping there, in a recent work [6], authors introduced page-level script identification performance to see whether we can expedite the processing time. In general, in their works, hand-crafted features that are based on structural and/or visual appearances (morphology-based) were used. The question is, are we just relying on what we see and use apply features accordingly or can we just let machine to select features that are required for optimal identification rate? This inspires to use deep learning, where CNNs can be used for extracting and/or selecting features for identification task(s). Needless to say, CNNs have stood well with their immense contribution in the field of OCR. Their onset has ben marked by the ground-breaking performance of CNNs on MNIST dataset [7]. Very recently, the use CNN for Indic script (Bangla character recognition) has Fig. 1. Two multi-script postal document images, where Bangla, Roman and Devanagari scripts are used. been reported [8]. Not to be confused, the primary of goal of this paper is to use deep learning concept to identify 11 different handwritten Indic scripts: Bangla, Devnagari, Gujarati, Gurumukhi, Kannada, Malayalam, Oriya, Roman, Tamil, Telugu and Urdu. Inspired from deep learning-based concept, we use CNNs to select features from handwritten document images (scanned), where we use multilevel 2D discrete Haar wavelet transform (in addition to conventional spatial domain representation) and image representations are scaled to a variety of different sizes. With these representation, several different CNNs are used to select features. In short, the primary idea behind this is to avoid using hand-crafted features for identification. Using multi-layer perceptron (MLP), 11 different handwritten scripts (as mentioned earlier) are identified with satisfactory performance. The remainder of the paper can be summarized as follows. Section 2 provides a quick overview of our contribution, where it includes CNN architecture and feature extraction process. In Section 3, experimental results are provided. It also includes a quick comparison study. Section 4 concludes our paper. 2 Contribution outline As mentioned earlier, in stead of using hand-crafted features for document image representation, our goal is to let deep learning to select distinguishing features for optimal script identification. For a few but recent works, where CNNs have used with successful classification, we refer to [7, 9, 10]. We observe that CNNs work especially when we have sufficient data to train. This means, data redundancies will be helpful. In general, CNN takes raw pixel data (image) and as training proceeds, the model learns distinguishing features that can successfully contribute to identification/classification. Such a training process produces a feature vector that summarize the important aspects of the studied image(s). More precisely, our approach is twofold: first, we use a two- and three-layered CNNs for three different scales of the input image; and secondly, we use exactly same CNNs for two different scales of the transformed image (wavelet transform). We then merge those features and make ready for script identification. In what follows, we explain our CNN architecture including definitions, parameters for wavelet transform and the way we produce features. Fig. 2. Schematic block diagram of handwritten Indic script identification showing different modules: feature extraction/selection and classification. 2.1 CNN architecture In general, a CNN has a layered architecture consisting of three basic types of layers namely, 1. convolutional layer (CL), 2. pooling layer (PL) and 3. fully connected layer (FCL). CLs consist of a set of kernels that produce parameters and help in convolution operation. In CL, every kernel generates an activation map as an output. PLs do not have parameters but, their major role is to avoid possible data redundancies (still preserving their significance). In our approach, all CNNs have max-pooling operation at their corresponding PLs. In addition to these two different types of layers, FCL is used, where MLP has been in place. In Fig. 2, we provide a complete schematic block diagram of handwritten Indic script identification showing different modules: feature extraction/selection and classification. In our study, 10 different CNNs are used to select features from a variety of representations of the studied image and we label each of them as CNNd,x,y . In every CNNd,x,y , d and x respectively refer to domain representation and dimension of the studied image, and y refers to the number of convolutional and pooling layers in that particular CNN. For example, domain representation can be expressed as d = {s, f }, where s refers to spatial domain and f , frequency. In our case, either of these is taken into account. Note that, with the use of the Haar wavelet transform (HWT) (see Section 2.2), certain frequencies are removed. In case of dimension (x), we have x = {[32 × 32], [48 × 48], [128 × 128]}, and for simplicity, x = {32, 48, 128} is used. All of these dimensions signify resolution to which the input images are scaled. In case of CL and PL, y = {2, 3}: one of the two is taken in CNN, and y = 2 means that there are two pairs of convolutional and pooling layers in the CNNs. In our model, two broad CNN architectures: CNNd,x,2 and CNNd,x,3 are used and can be summarized as in Table 1. Table 1. Architecture: CNNd,x,y , where y = {2, 3}. Architecture Parameter CL1 PL1 CL2 Layer PL2 CL3 CNNd,x,2 Channel Filter size Pad size 32 5×5 2 32 2×2 — 64 5×5 2 64 2×2 — CNNd,x,3 Channel Filter size Pad size 32 7×7 3 32 2×2 — 64 5×5 2 64 2×2 — PL3 FCL1 FCL2 Softmax — — — — — — 1024 — — 512 — — 11 — — 128 3×3 1 128 2×2 — 1024 — — 512 — — 11 — — Index CL = convolutional layer PL = pooling layer FCL = fully connected layer 1. CNNd,x,2 : We have six different layers, i.e. two CLs, two PLs and two FCLs. The first two CLs are followed by PLs. In FCLs, the first layer takes image representation that has been generated by CLs and PLs and reshapes them in the form of a vector, and the second FCL produces a set of 1024 features. 2. CNNd,x,3 : Every CNN has eight different layers: three CLs, three PLs and two FCLs. In general, such an architecture is very much similar to previously mentioned CNNd,x,2 . The difference lies in additional pair of CL and PL that follows second pair of the same. Like the CNNd,x,2 , these CNNs produce a set of 1024 features for any studied image. Once again, the architectural details of aforementioned CNNs are summarized in Table 1 that follows schematic block diagram of the system (see Fig. 2). For more understanding, in Fig. 3, we provide the activation maps for CNNs,128,3 . This means that it uses spatial domain image representation with the dimensionality of 128 and three pairs of convolutional and pooling layers in the CNNs. 2.2 Data representation In general, since Fourier transform [11] may not work to successfully provide information about what frequencies are present at what time, wavelet transform (WT) [12] and short time Fourier transform [13] are typically used. Both of these help identify the frequency components present in any signal at any given time. WT, on the other hand, can provide dynamic resolution. We consider an image a 2D time signal that can be resized. We then use multilevel 2D discrete WT on a scaled/resized image (128×128) to generate frequency domain representation. To be precise, we use the Haar wavelet [14] with seven different level decomposition that can generate approximated and detailed coefficients. Since the approximated coefficients are equivalent to zero, we use the detailed coefficients in addition to modified approximated coefficients to reconstruct the image. In the modified approximated coefficients, we consider only high frequency components. In our method, using a variety of different WTs, such as the Daubechies [15] and several decomposition levels, the best results were observed with the Haar wavelet and a decomposition level of 7. This reconstructed image is further resized to 32 × 32 (x = 32) and 48 × 48 Fig. 3. Illustrating the activation maps for CNNs,128,3 : spatial domain image representation with the dimensionality of 128 and three-layered convolutional and pooling layers. (x = 48), and are fed into multiple CNNs as mentioned in Section 2.1. Like in the frequency domain representation, spatial domain representations are resized/scaled to 32 × 32 (x = 32), 48 × 48 (x=48) and 128 × 128 (x =128) are fed into multiple CNNs. 3 3.1 Experiments Dataset, and evaluation metrics and protocol. To evaluate our proposed approach for word-level handwritten script identification, we have considered a dataset named PHD Indic 11 [6]. It is composed of 11K scanned word images (grayscale) from 11 different Indic script, i.e. 1K per script. A few samples are shown in Fig. 4. For more information about dataset, we refer to recently reported work [6]. The primary reason behind considering PHD Indic 11 dataset in our test is, no big size data has been reported in the literature for research purpose, till this date. Using the exact same CNN representation as before, Cd,x,y [i][j] represents the count where an instance with label i is classified as j. Accuracy (acc) of the particular CNN can then be computed as P11 Cd,x,y [i][i] accd,x,y = P11 i=1 . P11 i=1 j=1 Cd,x,y [j][i] Precision (prec) can be computed as P11 i=1 precd,x,y = precid,x,y Cd,x,y [i][i] and precid,x,y = P11 , 11 j=1 Cd,x,y [i][j] where precid,x,y refers to precision for any i-th label. In a similar fashion, recall (rec) can be computed as P11 recd,x,y = recid,x,y Cd,x,y [i][i] and recid,x,y = P11 , 11 j=1 Cd,x,y [i][j] i=1 where recid,x,y refers to recall for any i-th label. Having both precision and recall, f-score can be computed as P11 f-scored,x,y = i=1 precid,x,y × recid,x,y f-scoreid,x,y and f-scoreid,x,y = 2 × . 11 precid,x,y + recid,x,y Following conventional 4:1, i.e. train:test evaluation protocol, we have separated 8.8K images for training and the remaining 2.2K images for testing. We ran our experiments by using a machine: GTX 730 with 384 CUDA cores and 4GB GPU RAM. Besides, it has Intel Pentium Core2Quad Q6600 and 4GB RAM. 3.2 Experimental set up As mentioned earlier, are are required to train the CNNs first before testing. In other words, it is important to see how training and testing have been performed. Fig. 4. Illustrating few samples from dataset named PHDIndic 11 used in our experiment. Our CNNs in this study represented by CNNd,x,y are trained independently using the training dataset (as mentioned earlier). To clarify once again, these CNNs has either two or three pairs of consecutive convolutional and pooling layers. Besides, each of them has three fully connected layers. The first of these three layers function as an input layer with number of neurons that depends on the size of the input image specified by x. The second layer in CNNs has 1024 neurons, and during training, we apply a dropout probability of 0.5. The final layer has 11 neurons, whose outputs are used as input to an 11-way soft-max classifier that provides us with classification/identification probabilities for each of 11 possible classes. Our training set of 8.8K word images are split into multiple batches of 50 word images and the CNNs are trained accordingly. For optimization, Adam optimizer [16] was used with learning rate of 1 × 10−3 having default parameters: β1 = 0.9 and β2 = 0.999. This helps apply gradients for loss to the weight parameters during back propagation. We computed the accuracy of the CNN as training proceeds by taking ratio of the of images successfully classified in the batch to the total number of images in the studied batch. After training CNNs with 8.8K word images, we evaluated/tested each of them independently with the test set that is composed of 2.2K word images. More specifically, for each input size specification, we have two CNNs, i.e. for domain (d) and input size (x × x): CNNd,x,2 and CNNd,x,3 . Altogether, we have 10 different CNNs since we have three different input sizes (x = {32, 48, 128}) for raw image and two different input sizes (x = {32, 48}) for wavelet transformed image/data. For better understanding, we refer readers to Fig. 2. Note that we have trained the CNNs to extract 1024 features from each one, i.e. 120 × 1. These are then concatenated to form a single 10240 × 1 vector, where ten different CNNs are employed. Like in the conventional machine learning classification, these features are used for training and testing purpose using MLP classifier. Fig. 5. Our results (in terms of accuracy, precision, recall and f-score) for all networks: CNNs and their possible combinations. 3.3 Our results and comparative study In this section, using dataset, and evaluation metrics (see Section 3.1), and experimental setup (see Section 3.2), we summarize our results and comparative study as follows: 1. We provide results that have been produced from different architectures (CNNs), and select the highest script identification rate from them; and 2. We then take highest script identification for a comparative study, where previous relevant works are considered. Our results: Fig. 5 shows the comparison of the individual CNNs along with the effect of combining them. The individual CNNd,x,y produced the maximum script identification rate of 90% for CNNs,128,3 . As we ensemble two- and three-layered networks of corresponding domain (d) and input size (x), we observe a positive correlation between input size and accuracy. CNNs,128 provides the maximum script identification rate of 91.41% in this category. The primary reason behind the increase in accuracy is that the ensemble of two- and threelayered networks suggests that these networks complement each other. Further, to study an effect of the spatial (s) and frequency (f) domain representation in CNNd,x,y , we ensemble networks across all input sizes and depth of network. The spatial representation, CNNs , have produced script identification rate of 94.14% and the frequency domain representation, CNNf , have escalated up to 90.27%. However, the frequency domain representations learning can be complimented and it has been clearly seen when we combined them. In their combination, we have achieved the highest script identification rate of 94.73%. Since we Fig. 6. Misclassified samples, where script names in the bracket are the actual scripts but, our system identified them incorrectly. For example, in the first case, word image has been identified as Gurumukhi and it actually is Bangla. have not received 100% script identification rate, it is wise to provide a few samples where our system failed to identify correctly (see Fig. 6). Like we have mentioned in Section 3.1, we also provide precision, recall and f-score for all architectures in Fig. 5. In what follows, the highest script identification rate, i.e. 94.73% will be taken for a comparison. Comparative study: For a fair comparison, widely used deep learning methods, such as LeNet [7] and AlexNet [9] were taken. In addition, recently reported work on 11 handwritten Indic script dataset [6] (including their baseline results) was considered. In Table 2, we summarize the results. Our comparative study is focused on accuracy (not precision, recall and f-score), since other methods reported accuracy, i.e. identification rate. Of course, in Fig. 5, we are not just limited to accuracy. In Table 2, our method outperforms all other methods. Precisely, it outperforms Obaidullah et al. [6] by 4.7%, LeNet [7] by 2.73% and AlexNet [9] by 2.61%. 4 Conclusion In this paper, we have proposed a novel framework that uses convolutional neural networks (CNNs) for feature extraction. In our method, in addition, to conventional spatial domain representation, we have used multilevel 2D discrete Haar wavelet transform, where image representations have been scaled to a variety of different sizes. Having these, several different CNNs have been used to select features. With this, 11 different handwritten scripts: Bangla, Devnagari, Gujarati, Gurumukhi, Kannada, Malayalam, Oriya, Roman, Tamil, Telugu and Urdu, have been identified, where 1000 words per script are used. In our test, we have achieved the maximum script identification rate of 94.73% using multi-layer perceptron (MLP). To the best of our knowledge, this is the biggest data for Indic script identification work. Considering the complexity and the size of the dataset, our method outperforms the previously reported techniques. Table 2. Comparative study. Method Obaidullah et al. [6] (Hand-crafted features) LeNet [7] (CNN) AlexNet [9] (CNN) Our method (Multiscale CNN + WT) Accuracy 91.00% 82.00% 92.14% 94.73% References 1. Ghosh, D., Dube, T., Shivaprasad, A.: Script recognitiona review. IEEE Transactions on pattern analysis and machine intelligence 32(12) (2010) 2142–2161 2. Pal, U., Jayadevan, R., Sharma, N.: Handwriting recognition in indian regional scripts: a survey of offline techniques. ACM Transactions on Asian Language Information Processing (TALIP) 11(1) (2012) 1 3. Singh, P.K., Sarkar, R., Nasipuri, M., Doermann, D.: Word-level script identification for handwritten indic scripts. In: Document Analysis and Recognition (ICDAR), 2015 13th International Conference on, IEEE (2015) 1106–1110 4. Hangarge, M., Santosh, K., Pardeshi, R.: Directional discrete cosine transform for handwritten script identification. In: Document Analysis and Recognition (ICDAR), 2013 12th International Conference on, IEEE (2013) 344–348 5. Pati, P.B., Ramakrishnan, A.: Word level multi-script identification. Pattern Recognition Letters 29(9) (2008) 1218 – 1229 6. Obaidullah, S.M., Halder, C., Santosh, K., Das, N., Roy, K.: Phdindic 11: page-level handwritten document image dataset of 11 official indic scripts for script identification. Multimedia Tools and Applications (2017) 1–36 7. LeCun, Y., Bottou, L., Bengio, Y., Haffner, P.: Gradient-based learning applied to document recognition. Proceedings of the IEEE 86(11) (1998) 2278–2324 8. Roy, S., Das, N., Kundu, M., Nasipuri, M.: Handwritten isolated bangla compound character recognition: A new benchmark using a novel deep learning approach. Pattern Recognition Letters 90 (2017) 15–21 9. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. In: Advances in neural information processing systems. (2012) 1097–1105 10. Sarkhel, R., Das, N., Das, A., Kundu, M., Nasipuri, M.: A multi-scale deep quad tree based feature extraction method for the recognition of isolated handwritten characters of popular indic scripts. Pattern Recognition (2017) 11. Smith, S.W., et al.: The scientist and engineer’s guide to digital signal processing. (1997) 12. Daubechies, I.: The wavelet transform, time-frequency localization and signal analysis. IEEE transactions on information theory 36(5) (1990) 961–1005 13. Portnoff, M.: Time-frequency representation of digital signals and systems based on short-time fourier analysis. IEEE Transactions on Acoustics, Speech, and Signal Processing 28(1) (1980) 55–69 14. Sundararajan, D.: Fundamentals of the discrete haar wavelet transform. (2011) 15. Vonesch, C., Blu, T., Unser, M.: Generalized daubechies wavelet families. IEEE Transactions on Signal Processing 55(9) (2007) 4415–4429 16. Kingma, D., Ba, J.: arXiv:1412.6980 (2014) Adam: A method for stochastic optimization. arXiv preprint
1cs.CV
arXiv:1412.8054v2 [math.OC] 15 Nov 2016 Power Flow as an Algebraic System Jakub Marecek, Timothy McCoy, and Martin Mevissen ∗ January 24, 2018 Abstract Steady states of alternating-current (AC) circuits have been studied in considerable detail. In 1982, Baillieul and Byrnes derived an upper bound on the number of steady states in a loss-less AC circuit [IEEE TCAS, 29(11): 724–737] and conjectured that this bound holds for AC circuits in general. We prove this is indeed the case, among other results, by studying a certain multi-homogeneous structure in an algebraisation. 1 Introduction For more than 60 years [37], steady states of alternating-current (AC) circuits have been studied in considerable detail. The key problem, sometimes known as the power flow or load flow problem, considers complex voltages Vk at all buses k as variables, except for one reference bus (k = 0), where the power supplied. When one denotes complex admittance matrix Y , complex current Ik , and complex power Sk at bus k, the steady-state equations are based on: X X ∗ ∗ Sk = Vk Ik∗ = Vk Yk,l Vl∗ = Yk,l Vk Vl∗ (1) l∈N l∈N where asterisk denotes complex conjugate. This captures the complex, nonconvex non-linear nature [16, 38, 11, 15, 18] of any problem in the AC model. In order to obtain an algebraic system from (1), one needs to reformulate the complex conjugate. In order to do so, one may replace all Vk∗ with independent variables Uk , and filter for “real” solutions where Uk = Vk∗ = ℜVk − ℑVk ı once the complex solutions are obtained. Thereby, we obtain a particular structure, which allows us to prove a variety of results. In particular, the main contributions of our paper are: • a reformulation of the steady-state equations to a multi-homogeneous algebraic system ∗ J. Marecek and M. Mevissen are with IBM Research – Ireland, IBM Technology Campus Damastown, Dublin D15, Ireland. e-mail: [email protected]. T. McCoy is with Google. 1 • analytical results on the number and structure of feasible solutions considering losses, resolving a conjecture of Baillieul and Byrnes [2], which has been open for over three decades • empirical results for some well-known instances, including the numbers of roots, conditions for non-uniqueness of optima, and tree-width. Our analytical results rely on the work of Morgan and Sommese [32, 36] on multihomogeneous structures. Our empirical results rely on Bertini [6], a leading implementation of homotopy-continuation methods. As we explain in Section 8, ours is not the first algebraisation of the system (1), cf. [37, 4, 3, 2], and there is a long history [34, 14, 26, 23, 31, 29, 9, 39, 41] of the use of homotopycontinuation methods. 2 The Problem In order to make the paper self-contained, we restate of the steady-state equations. Consider a circuit represented by an undirected graph (N, E), where vertices n ∈ N are called buses and edges {l, m} ∈ E ⊆ N × N are called branches, and an admittance matrix Y = G + Bı ∈ C|N |×|N |, where the real part of an element is called conductance G = (glm ) and the imaginary part susceptance B = (blm ). Each bus k ∈ N is associated with complex voltage Vk = ℜVk + ℑVk ı, complex current Ik = ℜIk + ℑIk ı, and power Sk = Pk + Qk ı demanded or generated. Let 0 ∈ N correspond to a reference bus with phase ℑV0 = 0 and magnitude |V0 | fixed; powers at all other buses are fixed too. (In a variety of extensions, there are other buses, denoted generators, where voltage magnitude, but not the phase and not the power is fixed.) Each branch (l, m) ∈ E is associated with the complex power Slm = Plm + Qlm ı. The key constraint linking the buses is Kirchhoff’s current law, which stipulates the sum of the currents injected and withdrawn at each bus is 0. Considering the 2 relationship I = Y V , the steady state equations hence are: Pkg = Pkd + ℜVk n X (ℜyik ℜVi − ℑyik ℑVi ) i=1 + ℑVk n X (ℑyik ℜVi + ℜyik ℑVi ) (2) i=1 Qgk = Qdk + ℜVk n X (−ℑyik ℜVi − ℜyik ℑVi ) i=1 + ℑVk n X (ℜyik ℜVi − ℑyik ℑVi ) (3) i=1 Plm = blm (ℜVl ℑVm − ℜVm ℑVl ) (4) 2 2 + glm (ℜVl + ℑVm − ℑVl ℑVm − ℜVl ℜVm ) Qlm = blm (ℜVl ℑVm − ℑVl ℑVm − ℜVl 2 − ℑVl 2 ) + glm (ℜVl ℑVm − ℜVm ℑVl − ℜVm ℑVl ) − b̄lm (ℜVl 2 + ℑVl 2 ) 2 (5) Additionally, one can optimise a variety of objectives over the steady states. In one commonly used objective function, one approximates the costs of real power P0 generated at the reference bus 0 by a quadratic function f0 : cost := f0 (P0 ). (6) (In a variety of extensions, in which there are other buses where the power is not fixed, there would be a quadratic function for each such bus and the quadratic function of power would be summed across all of these buses.) In the Lp -norm loss objective, one computes a norm of the vector D obtained by summing apparent powers S(u, v) + S(v, u)∀(u, v) ∈ E for: ||D||p =  X |S(u, v) + S(v, u)| (u,v)∈E p 1/p . (7) The usual ||D||1 is denoted loss below. We consider these objectives only in Section VII, while our results in Sections IV–VI apply independently of the use of any objective function whatsoever. 3 Definitions from Algebraic Geometry In order to state our results, we need some definitions from algebraic geometry. While we refer the reader to [2, 27] for the basics, we present the concepts introduced in the past three decades, not yet widely covered by textbooks. For a more comprehensive treatment, please see [32, 36, 35]. 3 Let n ≥ 0 be an integer and f (z) be a system of n polynomial equations in z ∈ C n with support (A1 , . . . , An ):  P α1 α2 αn  α∈A1 f1α z1 z2 · · · zn  f1 (z) = .. (8) . P   α1 α2 αn fn (z) = α∈An fnα z1 z2 · · · zn , where coefficients fiα are non-zero complex numbers. It is well known [12] that the polynomials define n projective hypersurfaces in a projective space CPn . Bézout theorem states that either hypersurfaces intersect in an infinite set with some component of positive dimension, or the number of intersection points, counted with multiplicity, is equal to the product d1 · · · dn , where di is the degree of polynomial i. We call the product d1 · · · dn the usual Bézout number. The usual Bézout number can be improved by considering: Definition 1 (Structure). Any partition of the index set {1, . . . , n} into k sets I1 , . . . , Ik defines a structure. There, Zj = {zi : i ∈ Ij } is known as the group of variables for each set Ij . The associated degree dij of a polynomial fi with respect to group Zj is X def αl . (9) dij = max α∈Ai l∈Ij We say that fi has multi-degree (di1 , . . . , din ). Whenever for some j, for all i, the same dij is attained for all α ∈ Ai , we call the system (11) homogeneous in the group of variables Zj . The projective space associated to the group of variables Zj in a structure has dimension  |Ij | − 1 if (11) is homogeneous in Zj , and def aj = (10) |Ij | otherwise. Pk Definition 2 (Multi-homogeneous Bézout Number). Assuming n = j=1 aj , the multi-homogeneous Bézout number Béz(A1 , . . . , An ; I1 , . . . , Ik ) is defined as Qk a the coefficient of the term j=1 ζj j , where aj is the associated dimension (10), Q n Pk within the polynomial i=1 j=1 dij ζj , in variables ζj , j = 1 . . . k with coefficients dij are the associated degrees (9); that is (d11 ζ1 + d12 ζ2 + . . . + d1k ζk ) (d21 ζ1 + d22 ζ2 + . . . + d2k ζk ) · · · (d2n ζ1 + d2n ζ2 + . . . + dnk ζk ). Consider the example of Wampler   p1 (z) = p2 (z) =  p3 (z) = [42] in x ∈ C 3 : x21 + x2 + 1, x1 x3 + x2 + 2, x2 x3 + x3 + 3, (11) with the usual Bézout number of 8. Considering the partition {x1 , x2 }, {x3 }, where d11 = 2, d12 = 0, d21 = d22 = d31 = d32 = 1. the monomial ζ12 ζ21 is 4 to be looked up in the polynomial 2ζ1 (ζ1 + ζ2 )2 . The corresponding multihomogeneous Bézout number is hence 4 and this is the minimum across all possible structures. In general, the multi-homogeneous Bézout number Béz(A1 , . . . , An ; I1 , . . . , Ik ) is an upper bound on the number of isolated roots of (11) in CPa1 × · · · × CPak , and thereby an upper bounds the number of isolated finite complex roots of (11). There are a variety of additional methods for computing the multi-homogeneous Bézout number, e.g., [42]. In the particular case where A = A1 = · · · = An , we denote  Y  k n def a (12) dj j , Béz(A1 , . . . , An ; I1 , . . . , Ik ) = a1 a2 · · · ak j=1 where dj = dij (equal for each i) and the multinomial coefficient   n! n def = a1 a2 · · · ak a1 ! a2 ! · · · ak ! Qk Pk is the coefficient of j=1 ζjak in (ζ1 + · · · + ζk )n with n = j=1 aj , as above. In summary, the multi-homogeneous Bézout number provides a sharper bound on the numberQof isolated solutions of a system of equations than the n usual Bézout number i=1 di = d1 · · · dn . In the famous example of the eigenvalue problem [43], it is known that the Bézout number is 2n , whereas there exists a structure with multi-homogeneous Bézout number of n. We hence study the multi-homogeneous structure within the steady state equations of alternating-current circuits. 4 The Multi-Homogeneous Structure Notice that in order to obtain an algebraic system from the steady-state equations (2–5), one needs to reformulate the complex conjugate. In order to do so, one may replace all vn∗ with independent variables un , and later filter for solutions where un = vn∗ once the complex solutions are obtained. We denote such solution “real”. Let G be the set of slack generators for which |vn | is specified, and assume 0 ∈ G corresponds to a reference node with phase 0. Notice that the use of variables vn and un produces a multi-homogeneous structure with variable groups {vn } and {un }: vn X Yn,k uk + un X Yn,k uk − un k vn k X ∗ Yn,k vk = 2pn n∈N \G X ∗ Yn,k vk = 2qn n∈N \G k k vn un = |vn |2 v0 = |v0 |, u0 = |v0 | n ∈ G − {0} (13) 5 For example for the two-bus network, we obtain: ∗ ∗ v1 (Y1,0 u0 + Y1,1 u1 ) + u1 (Y1,0 v0 + Y1,1 v1 ) = 2p1 ∗ ∗ v1 (Y1,0 u0 + Y1,1 u1 ) − u1 (Y1,0 v0 + Y1,1 v1 ) = 2q1 v0 = |v0 |, u0 = |v0 | (14) Using the algebraic system, one can formulate a number of structural results concerning power flows. 5 An Analysis for s = 1 For the particular multi-homogeneous structure, which is the partition of the variables into several groups in (13), we can bound the number of isolated solutions: Theorem 1. With exceptions on a parameter set of measure zero, the alternatingcurrent power flow (13) has a finite number of complex solutions, which is bounded above by:   2n − 2 (15) n−1 Proof. Each equation in the system (13) is linear in the V variables and also in the V ∗ variables, giving rise to a natural multi-homogeneous structure of mult-idegree (1, 1). Since the slack bus voltage is fixed at a reference value, the system has 2n − 2 such equations in (n − 1, n − 1) variables. By the multihomogeneous form of Bézout’s Theorem (see e.g. Theorem 8.4.7 in [36]), the total number of solutions in multi-projective space CPn−1 × CPn−1 is precisely the stated bound, counting multiplicity. Some subset of these lie on the affine patch C n−1 × C n−1 ⊂ CPn−1 × CPn−1 , giving the result. Notice that this applies also to some well-known instances of alternatingcurrent optimal power flows (ACOPF). For example, the instances of Lesieutre et al. [22] and Bukhsh et al. [8] have only a single “slack” bus, whose active and reactive powers are not fixed, and hence the result applies. Notice that the exception of measure-zero set is necessary; cf. Example 4.1 of [2]. As we will illustrate in the next section, this bound is tight in some cases. Deciding whether the bound on the number of roots obtained using a particular multi-homogeneous structure is tight for a particular instance is, nevertheless, hard. This can be seen from: Theorem 2 (Theorem 1 of Malajovich and Meer [27]). There does not exist a polynomial time algorithm to approximate the minimal multi-homogeneous Bézout number for a polynomial system (11) up to any fixed factor, unless P = NP. 6 We can, however, show there exists a certain structure among these solutions: Corollary 1. If there exists a feasible solution of the alternating-current power flow, then the solution has even multiplicity greater or equal to 2 or another solution exists. Proof. The finite number of solutions to the power flows problem of Theorem 1 is even. Observe that (U, Û ) is a solution of the system (13) if and only if (Û ∗ , U ∗ ) is a solution. This implies that the non-“real” solutions, that is solutions for which U ∗ 6= Û , necessarily come in pairs. It follows that “real” feasible solutions are also even in number, counting multiplicity. The result follows. Note that a solution having multiplicity greater than 1 is a special case that is highly unlikely in a real system. Moreover, it is easily detected, since the Jacobian at a solution is nonsingular if and only if the solution has multiplicity 1. 6 Alternating-Current Optimal Power Flow One may also make the following observations about the alternating-current optimal power flows, i.e., the problem of optimising an objective over the steady state: Remark 1. For the alternating-current power flows, where powers are fixed at all but the reference bus, whenever there exists a real feasible solution, except for a parameter set of measure zero, one can enumerate all feasible solutions in finite time. Indeed: By Theorem 1, we know there exist a finite number of isolated solutions to the system (13). By the homotopy-continuation method of Sommese et al. [36, 6], we can enumerate the roots with probability 1, which allows us to pick the global optimum, trivially. Notice that Bertini, the implementation of the method of Sommese [6], makes it possible to check that all roots are obtained. Notice that the addition of inequalities can be accommodated by filtering the real roots. Nevertheless, this method is not practical, as there may be too many isolated solutions to enumerate. Generically, this is indeed the case, whenever there are two or more generators with variable output, i.e., buses, whose active and reactive power is not fixed: Corollary 2. In the alternating-current optimal power flow problem, i.e., with s > 1, where powers are variable outside of the reference bus and there are no additional inequalities, the complex solution set is empty or positive-dimensional, except for a parameter set of measure zero. When the complex solution set is positive-dimensional, if a smooth real feasible solution exists, then there are infinitely many real feasible solutions. 7 Proof. For each slack bus after the first, the system has two variables but only one equation. With s + 1 slack buses, the rank of the Jacobian and hence the dimension of the complex solution set will be at least s by Lemma 13.4.1 in [36]. Furthermore, if a real feasible solution U exists and the solution set is smooth at this point, then the local dimension of the complex and real solution sets are equal at U . Therefore, since the complex solution set is positive-dimensional, so is the real set at U , and so infinitely many real feasible solutions exist. Although there are a variety of methods for studying positive-dimensional systems, including the enumeration of a point within each connected component [5, 33] and studying the critical points of the restriction to the variety of the distance function to such points [1], we suggest the method of moments [20, 13] may be more suitable for studying the feasible set of alternating-current optimal power flows. It has been shown recently [13] that it allows for very small errors on systems in dimension of over five thousand. As is often the case in engineering applications, one may also be interested in the distance of a point to the set of feasible solutions. Again, by considering our algebraisation, one can bound the probability this distance is small using the theorem of Lotz [25] on the zero-set V of multivariate polynomials. This could be seen as the converse of the results of [24]. 8 Method No. |N | of buses 3 4 5 6 7 8 9 10 11 12 13 14 9 Bézout’s upper bound A BKK-based upper bound Theorem 1 16 8 6 64 40 20 256 192 70 1024 864 252 4096 3712 924 16384 15488 3432 65536 63488 12870 262144 257536 48620 1048576 1038336 184756 4194304 4171776 705432 16777216 16728064 2704156 67108864 67002368 10400600 Generic lower bound 6 20 70 252 924 3432 12870 48620 184756 705432 2704156 10400600 Table 1: The maximum number of steady states in a circuit with a fixed number of buses. Treewidth tw(P ) No. |X| of solutions minx∈X (cost(x)) No. of min. wrt. cost avgx∈X (cost(x)) maxx∈X (cost(x)) minx∈X (loss(x)) No. of min. wrt. loss avgx∈X (loss(x)) maxx∈X (loss(x)) Bukhsh et al. [8] Klos and Wojcicka [18] Lavaei and Low [21] Bukhsh et al. [8] McCoy et al. McCoy et al. Bukhsh et al. [8] Grainger and Stevenson [45] Lesieutre et al. [22] McCoy et al. McCoy et al. McCoy et al. Bukhsh et al. [8] McCoy et al. McCoy et al. McCoy et al. Bukhsh et al. [8] Chow [45] McCoy et al. McCoy et al. McCoy et al. McCoy et al. McCoy et al. McCoy et al. No. |E| of branches 10 case2w case3KW case3LL case3w case4 case4ac case4cyc case4gs case5w case6ac case6ac2 case6b case6cyc case6cyc2 case6cyc3 case7 case8cyc case9 case9g caseK4 caseK4sym caseK6 caseK6b caseK6sym Source No. |N | of buses Instance 2 3 3 3 4 4 4 4 5 6 6 6 6 6 6 7 8 9 9 4 4 6 6 6 1 3 3 2 3 4 4 4 6 6 6 6 6 6 6 7 8 9 9 6 6 15 15 15 1 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 5 5 5 2 6 2 2 4 6 4 10 2 23 22 30 30 12 12 2 60 16 2 8 6 36 40 48 8.42 -0.0 1502.07 5.88 1502.51 2005.25 3001.61 2316.37 2003.57 4005.44 4005.32 3005.7 3005.7 1506.87 4502.42 1667.31 6506.11 3504.44 2604.41 2008.62 2009.28 2018.2 6002.79 6003.01 1 1 1 1 1 2 1 1 1 1 1 5 4 1 1 1 1 1 1 1 2 1 1 1 9.04 1250.0 1502.19 5.94 1505.19 3337.5 3003.56 3681.07 2004.6 5574.23 5554.03 3606.3 3606.3 3131.55 4505.95 1668.36 8557.72 5692.02 4103.36 3006.32 3339.29 5075.47 6017.01 6017.75 9.66 1500.0 1502.31 6.01 1507.88 4005.51 3005.52 4595.8 2005.63 6013.26 6012.82 4508.28 4508.28 4508.24 4508.01 1669.41 9511.04 6505.02 5602.31 4005.51 4005.91 6030.0 6019.41 6019.86 0.71 -0.0 0.22 0.55 0.11 0.01 0.01 0.37 0.47 0.02 0.02 0.01 0.01 0.03 0.02 0.08 0.01 0.03 0.08 0.01 0.01 0.02 0.01 0.01 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1.02 -0.0 0.34 0.58 2.79 2.44 1.96 27.24 1.5 6.26 5.97 3.9 3.9 4.15 3.55 0.26 4.52 1.37 0.26 4.6 3.96 17.16 14.23 14.75 1.33 0.0 0.46 0.61 5.48 3.78 3.92 39.72 2.53 10.51 10.21 5.88 5.88 6.56 5.61 0.45 7.84 1.87 0.45 7.03 7.28 27.25 16.62 16.86 Table 2: Properties of the instances tested. variable_group V0, V1; variable_group U0, U1; I0 = V0*Yv0_0 + V1*Yv0_1; I1 = V0*Yv1_0 + V1*Yv1_1; J0 = U0*Yu0_0 + U1*Yu0_1; J1 = U0*Yu1_0 + U1*Yu1_1; fv0 = V0 - 1.0; fv1 = I1*U1 + J1*V1 + 7.0; fu0 = U0 - 1.0; fu1 = -I1*U1 + J1*V1 - 7.0*I; Figure 1: A Bertini encoding of ACPF on the two-bus instance of Bukhsh et al. 2012, where the impedance of a single branch is 0.04 + 0.2i. 7 Computational Illustrations In order to illustrate Theorem 1, we first present the maximum number of steady states in a circuit with a fixed number of buses in Table , and compare it to the values of our upper bound, Bézout-based upper bound, and the BKKbased upper bound [10, 31]. Notice that the maximum number of steady states in a circuit with a fixed number of buses is achieved when (N, E) is a clique. Notice further that the generic lower bound, obtained as the number of solutions found by tracing the paths, matches the upper bound of Theorem 1 throughout Table 7. To illustrate Proposition 1, we have enumerated the steady states using Bertini, a versatile package for homotopy-continuation methods by Sommese et al. [36]. See Figure 1 for an example of Bertini input corresponding to the example above (14), with constants Yu i j representing Yi,j and Yv i j ∗ representing Yi,j . The results are summarised in Table . To illustrate Theorem 1 further, we present the values of our upper bound on a collection of instances widely known in the power systems community. The instances are mostly available from the Test Case Archive of Optimal Power Flow (OPF) Problems with Local Optima of Bukhsh1 , while some have appeared in well-known papers, e.g. [18], and some are available in recent distributions of Matpower [45], a well-known benchmark. In particular, we present the numbers of distinct roots of the instances. In all cases, where Theorem 1 applies, the number of solutions found by tracing the paths matches the upper bound of Theorem 1, certifying the completeness. In other cases, one could rely on Bertini certificates of completeness of the search. Empirically, we observe there exists a unique global optimum in all these instances tested with respect to the L1 -loss objective. For the generation cost objective, however, there are a number of instances (case4ac, caseK4sym, case6b, case6cyc), where the global optima are not unique. The case of caseK4sym is a particularly good illustration, where the symmetry between two generators and two demand nodes in a complete graph results in multiple global optima. In order to provide material for further study of structural properties, we present tree-width of the instances in Table 7 in column tw(N ). Notice that for the well-known small instances, tree-width is 1 or 2, e.g., 1 for the instance 1 http://www.maths.ed.ac.uk/OptEnergy/LocalOpt/ , 11 accessed November 30th, 2014. in Figure 1, and 2 for the instance of Lesieutre et al. As the instances grow, however, this need not be the case: Kloks [17] shows treewidth is not bounded even in sparse random graphs, with high probability. In complete graphs, such as caseK4sym with tree-width 3 above, tree-width grows linearly in the number of vertices. 8 Related Work There is a long history of study of the number and structure of solutions of power flows [37, 4, 3, 2]. [37] considered the Bézout bound. [10, 31] considered a bound based on the work of Bernstein [7] and Kushnirenko [19]. [2, 4] derived the same expression as in Theorem 1 using intersection theory, but in the lossless AC model. They highlight that the number of solutions in an alternatingcurrent model with losses is an important open problem. We note that Theorem 1 subsumes Theorem 4.1 of [2] as a special case. Finally, we note that [18] present a lower bound without a proof and recent papers [39, 44] bound certain distinguished solutions, but not all solutions; cf. [28]. There is also a long history of applications of homotopy-continuation methods in power systems [34, 14, 26, 23], although often, e.g. in [26], the set-up of the homotopy restricted the methods to a heuristic, which could not enumerate all the solutions of the power flow [30]. Recently, these have attracted much interest [31, 29, 9] following the work of Trias [39, 40, 41]. See [28] for an overview. 9 Conclusions We hope that the structural results provided will aid the development of faster solvers for the related non-linear problems [15]. Arguably, one could: • By using Theorem 1 in the construction of start systems for homotopycontinuation methods [43], allow for larger zero-dimensional systems to be studied. • Extend Corollary 2 to finding at least one point in each connected component [33, 1]. • Extend the homotopy-continuation methods to consider inequalities within the tracing, rather than only in the filtering phase, which could improve their computational performance considerably. • Develop methods for the optimal power flow problem, whose complexity would be superpolynomial only in the tree-width and the number of buses. The latter two may be some of the most important challenges within the analysis of circuits and systems. 12 Acknowledgements Parts of this work have been done while Tim was visiting IBM Research. Jakub would like to thank Isaac Newton Institute for Mathematical Sciences at the University of Cambridge for their generous support for his visits. Dhagash Mehta has kindly provided a variety of suggestions as the related work. References [1] P. Aubry, F. Rouillier, and M. S. E. Din. Real solving for positive dimensional systems. Journal of Symbolic Computation, 34(6):543 – 560, 2002. [2] J. Baillieul and C. Byrnes. Geometric critical point analysis of lossless power system models. IEEE Transactions on Circuits and Systems, 29(11):724–737, Nov 1982. [3] J. Baillieul and C. I. Byrnes. Remarks on the number of solutions to the load flow equations for a power system with electrical losses. In Decision and Control, 1982 21st IEEE Conference on, pages 919–924, Dec 1982. [4] J. Baillieul, C. I. Byrnes, and R. B. Washburn. An algebraic-geometric and topological analysis of the solution to the load-flow equations for a power system. In Decision and Control including the Symposium on Adaptive Processes, 1981 20th IEEE Conference on, pages 1312–1320, Dec 1981. [5] S. Basu, R. Pollack, and M.-F. Roy. A new algorithm to find a point in every cell defined by a family of polynomials. In Quantifier elimination and cylindrical algebraic decomposition, pages 341–350. Springer Vienna, 1998. [6] D. Bates, J. Hauenstein, A. Sommese, and C. Wampler. Numerically Solving Polynomial Systems with Bertini:. Software, Environments, and Tools. Society for Industrial and Applied Mathematics, 2013. [7] D. N. Bernstein. The number of roots of a system of equations. Funkcional. Anal. i Prilozen., 9(3):1–4, 1975. [8] W. Bukhsh, A. Grothey, K. McKinnon, and P. Trodden. Local solutions of the optimal power flow problem. IEEE Trans. Power Syst., 28(4):4780– 4788, 2013. [9] S. Chandra, D. Mehta, and A. Chakrabortty. Equilibria analysis of power systems using a numerical homotopy method. In Power Energy Society General Meeting, 2015 IEEE, pages 1–5, July 2015. [10] T. Chen and D. Mehta. On the Network Topology Dependent Solution Count of the Algebraic Load Flow Equations. 2015. ArXiv e-prints 1512.04987. 13 [11] H.-D. Chiang, C.-W. Liu, P. P. Varaiya, F. F. Wu, and M. G. Lauby. Chaos in a simple power system. IEEE Transactions on Power Systems, 8(4):1407–1417, Nov 1993. [12] W. Fulton. Intersection Theory. Springer New York, Jan. 1998. [13] B. Ghaddar, J. Marecek, and M. Mevissen. Optimal power flow as a polynomial optimization problem. IEEE Transactions on Power Systems, 31(1):539–546, Jan 2016. [14] S. X. Guo and F. M. A. Salam. The real homotopy-based method for computing solutions of electric power systems. In Circuits and Systems, 1992. ISCAS ’92. Proceedings., 1992 IEEE International Symposium on, volume 6, pages 2737–2740 vol.6, May 1992. [15] I. A. Hiskens. Analysis tools for power systems-contending with nonlinearities. Proceedings of the IEEE, 83(11):1573–1587, Nov 1995. [16] I. A. Hiskens and R. J. Davy. Exploring the power flow solution space boundary. IEEE Transactions on Power Systems, 16(3):389–395, Aug 2001. [17] T. Kloks. Only few graphs have bounded treewidth. In T. Kloks, editor, Treewidth, volume 842 of Lecture Notes in Computer Science, pages 51–60. Springer Berlin Heidelberg, 1994. [18] A. Klos and J. Wojcicka. Physical aspects of the nonuniqueness of load flow solutions. International Journal of Electrical Power and Energy Systems, 13(5):268–276, 1991. [19] A. Kushnirenko. Newton polytopes and the Bézout theorem. Funct. Anal. Appl., 10:233–235, 1976. [20] J. B. Lasserre. Convergent sdp-relaxations in polynomial optimization with sparsity. SIAM Journal on Optimization, 17(3):822–843, 2006. [21] J. Lavaei and S. Low. Zero duality gap in optimal power flow problem. Power Systems, IEEE Transactions on, 27(1):92 –107, feb. 2012. [22] B. Lesieutre, D. Molzahn, A. Borden, and C. DeMarco. Examining the limits of the application of semidefinite programming to power flow problems. In Communication, Control, and Computing (Allerton), 2011 49th Annual Allerton Conference on, pages 1492–1499, 2011. [23] C.-W. Liu, C.-S. Chang, J. A. Jiang, and G. H. Yeh. Toward a cpflow-based algorithm to compute all the type-1 load-flow solutions in electric power systems. IEEE Transactions on Circuits and Systems I: Regular Papers, 52(3):625–630, March 2005. 14 [24] C.-W. Liu and J. S. Thorp. A novel method to compute the closest unstable equilibrium point for transient stability region estimate in power systems. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, 44(7):630–635, Jul 1997. [25] M. Lotz. On the volume of tubular neighborhoods of real algebraic varieties. Proc. Amer. Math. Soc., 143:1875–1889, 2015. [26] W. Ma and J. S. Thorp. An efficient algorithm to locate all the load flow solutions. IEEE Transactions on Power Systems, 8(3):1077–1083, Aug 1993. [27] G. Malajovich and K. Meer. Computing minimal multi-homogeneous Bézout numbers is hard. Theory of Computing Systems, 40(4):553–570, 2007. [28] D. Mehta, D. K. Molzahn, and K. Turitsyn. Recent advances in computational methods for the power flow equations. In 2016 American Control Conference (ACC), pages 1753–1765, July 2016. [29] D. Mehta, H. D. Nguyen, and K. Turitsyn. Numerical polynomial homotopy continuation method to locate all the power flow solutions. IET Generation, Transmission Distribution, 10(12):2972–2980, 2016. [30] D. K. Molzahn, B. C. Lesieutre, and H. Chen. Counterexample to a continuation-based algorithm for finding all power flow solutions. IEEE Transactions on Power Systems, 28(1):564–565, Feb 2013. [31] D. K. Molzahn, D. Mehta, and M. Niemerg. Toward topologically based upper bounds on the number of power flow solutions. In 2016 American Control Conference (ACC), pages 5927–5932, July 2016. [32] A. Morgan and A. Sommese. A homotopy for solving general polynomial systems that respects m-homogeneous structures. Appl. Math. Comput., 24(2):101–113, 1987. [33] F. Rouillier, M.-F. Roy, and M. S. E. Din. Finding at least one point in each connected component of a real algebraic set defined by a single equation. Journal of Complexity, 16(4):716–750, 2000. [34] F. M. A. Salam, L. Ni, S. Guo, and X. Sun. Parallel processing for the load flow of power systems: the approach and applications. In Decision and Control, 1989., Proceedings of the 28th IEEE Conference on, pages 2173–2178 vol.3, Dec 1989. [35] I. R. Shafarevich. Basic algebraic geometry. Springer-Verlag, springer study edition edition, 1977. Translated from the Russian by K. A. Hirsch; Revised printing of Grundlehren der mathematischen Wissenschaften, Vol. 213, 1974. 15 [36] A. J. Sommese and C. W. Wampler. The numerical solution of systems of polynomials arising in Engineering and Science. World Scientific, 2005. [37] C. J. Tavora and O. J. M. Smith. Equilibrium analysis of power systems. IEEE Transactions on Power Apparatus and Systems, PAS-91(3):1131– 1137, May 1972. [38] J. S. Thorp and S. A. Naqavi. Load flow fractals. In Decision and Control, 1989., Proceedings of the 28th IEEE Conference on, pages 1822–1827 vol.2, Dec 1989. [39] A. Trias. The holomorphic embedding load flow method. In Power and Energy Society General Meeting, 2012 IEEE, pages 1–8, July 2012. [40] A. Trias. System and method for monitoring and managing electrical power transmission and distribution networks, US Patent 7519506 and 7979239, 2009 and 2010, number = US 7519506 and 7979239, type = Patent, version = , location = US,. [41] A. Trias and J. L. Marı́n. The holomorphic embedding loadflow method for dc power systems and nonlinear dc circuits. IEEE Transactions on Circuits and Systems I: Regular Papers, 63(2):322–333, Feb 2016. [42] C. W. Wampler. Bezout number calculations for multi-homogeneous polynomial systems. Applied Mathematics and Computation, 51(2):143 – 157, 1992. [43] C. W. Wampler. An efficient start system for multi-homogeneous polynomial continuation. Numerische Mathematik, 66(4):517–524, 1993/94. [44] T. Wang and H. D. Chiang. On the number of system separations in electric power systems. IEEE Transactions on Circuits and Systems I: Regular Papers, 63(5):661–670, May 2016. [45] R. Zimmerman, C. Murillo-Sánchez, and R. Thomas. Matpower: Steadystate operations, planning, and analysis tools for power systems research and education. Power Systems, IEEE Transactions on, 26(1):12–19, 2011. 16
5cs.CE
FESTUNG: A MATLAB / GNU Octave toolbox for the discontinuous Galerkin method. Part II: Advection operator and slope limiting Balthasar Reutera , Vadym Aizingera,∗, Manuel Wielanda , Florian Frankb , Peter Knabnera a Friedrich–Alexander arXiv:1602.05754v1 [math.NA] 18 Feb 2016 b Rice University of Erlangen–Nürnberg, Department of Mathematics, Cauerstraße 11, 91058 Erlangen, Germany University, Department of Computational and Applied Mathematics, 6100 Main Street – MS 134, Houston, TX 77005-1892, USA Abstract This is the second in a series of papers on implementing a discontinuous Galerkin (DG) method as an open source MATLAB / GNU Octave toolbox. The intention of this ongoing project is to offer a rapid prototyping package for application development using DG methods. The implementation relies on fully vectorized matrix / vector operations and is comprehensively documented. Particular attention was paid to maintaining a direct mapping between discretization terms and code routines as well as to supporting the full code functionality in GNU Octave. The present work focuses on a two-dimensional time-dependent linear advection equation with space / time-varying coefficients, and provides a general order implementation of several slope limiting schemes for the DG method. Keywords: MATLAB, GNU Octave, discontinuous Galerkin method, slope limiting, vectorization, open source, advection operator 1. Introduction The development milestones for the MATLAB / GNU Octave toolbox FESTUNG (F inite E lement S imulation T oolbox for UN structured G rids) available at [1, 2] run somewhat counter to the history of the development of the discontinuous Galerkin (DG) methods. Thus, our first paper in series [3] introduced a local discontinuous Galerkin discretization for a time-dependent diffusion equation using the numerical methods introduced in [4]. The current work, however, enhances the package with the functionality for purely hyperbolic equations—namely the original purpose of the DG method proposed by Reed and Hill in [5] and analyzed by Johnson and Pitkäranta in [6]. The reason behind this time inversion is that the numerical and software development technology necessary to produce a fully functional DG solver for hyperbolic equations has to include upwind fluxes and slope limiters—both tasks more complicated to solve in a computationally efficient manner than those needed for a pure diffusion equation. The continued development of this toolbox still adheres to the same design principles declared in [3]: 1. Design a general-purpose software package using the DG method for a range of standard applications and provide this toolbox as a research and learning tool in the open source format (cf. [1]). 2. Supply a well-documented, intuitive user-interface to ease adoption by a wider community of application and engineering professionals. 3. Relying on the vectorization capabilities of MATLAB / GNU Octave, optimize the computational performance of the toolbox components and demonstrate these software development strategies. 4. Maintain throughout full compatibility with GNU Octave to support users of open source software. ∗ Corresponding author Email addresses: [email protected] (Balthasar Reuter), [email protected] (Vadym Aizinger), [email protected] (Manuel Wieland), [email protected] (Florian Frank), [email protected] (Peter Knabner) Preprint submitted to Elsevier September 15, 2017 We refer to [3] for a literature review on DG methods and open source packages offering a DG capability. The present work expands the functionality of the numerical solver published in the first paper in series by adding linear advection terms and vertex-based slope limiters of general order. The latter development is particularly interesting, since, to the best of our knowledge, no closed form description of vertex-based slope limiters for general order discretizations are to be found in the literature, even less so implementations of such limiters. In addition to hierarchical vertex-based limiters of Kuzmin [7], this publication and the accompanying code includes an extension of the standard linear vertex-based slope limiter to general order discretizations and a new scheme based on the hierarchical vertexbased limiter but using a stricter limiting strategy. Further additions in this work include a selection of TVD (total variation diminishing) Runge–Kutta methods of orders one, two, and three employed for time discretization instead of a simple implicit Euler method used in the first paper. The rest of this paper is organized as follows: We introduce the model problem in the remainder of this section and describe its discretization using the DG method in Sec. 2. Section 3 introduces slope limiting algorithms, first, for linear DG discretizations followed by the general order case. Implementation specific details such as reformulation and assembly of matrix blocks as well as numerical results are given in Sec. 4. All routines mentioned in this work are listed and documented in Sec. 5. Section 6 concludes the work and gives future perspectives. 1.1. Model problem Let J ≔ (0, tend ) be a finite time interval and Ω ⊂ R2 a polygonally bounded domain with boundary ∂Ω. We consider the advection equation in conservative form  ∂t c(t, x) + ∇ · u(t, x) c(t, x) = f (t, x) in J × Ω (1a) with time / space-varying coefficients u : J × Ω → R2 and f : J × Ω → R. A prototype application of (1a) is the advective transport in fluids, i. e., the movement of a solute due to the bulk movement of the fluid, in which case the primary unknown c denotes the solute concentration, u the velocity of the fluid, and f accounts for generation or degradation of c, e. g., by chemical reactions. Equation (1a) is complemented by the following boundary and initial conditions: on J × ∂Ωin (t) , c = cD c = c 0 on {0} × Ω (1b) (1c) with inflow boundary ∂Ωin (t) ≔ {x ∈ ∂Ω | u(t, x) · ν(x) < 0} and ν(x) denoting the outward unit normal. The outflow boundary ∂Ωout (t) is defined as ∂Ωout (t) ≔ ∂Ω \ ∂Ωin (t); c0 : Ω → R+0 and cD : J × ∂Ωin (t) → R+0 are the given initial and Dirichlet boundary data, respectively. 2. Discretization 2.1. Notation Before describing the DG scheme for (1) we introduce some notation; an overview can be found in the Section “Index of notation”. Let Th = {T } be a regular family of non-overlapping partitions of Ω into K closed triangles T of characteristic size h such that Ω = ∪T . For T ∈ Th , let νT denote the unit normal on ∂T exterior to T . Let EΩ denote the set of interior edges, E∂Ω the set of boundary edges, and E ≔ EΩ ∪ E∂Ω = {E} the set of all edges (the subscript h is suppressed here). For an interior edge E ∈ EΩ shared by triangles T − and T + , we define the one-sided values of a scalar quantity w = w(x) on E by w− (x) ≔ lim+ w(x − ε νT − ) ε→0 and w+ (x) ≔ lim+ w(x − ε νT + ) , ε→0 respectively. For a boundary edge E ∈ E∂Ω , only the definition on the left is meaningful. 2 2.2. Variational formulation Because of the local nature of the DG method, we can formulate the variational system of equations on a triangleby-triangle basis. To do that, we multiply (1a) by a smooth test function w : T → R and integrate by parts over element T ∈ Th . This gives us Z Z Z Z w f (t) dx . w u(t) c(t) · νT ds = ∇w · u(t) c(t) dx + w ∂t c(t) dx − T ∂T T T 2.3. Semi-discrete formulation We denote by P p (T ) the space of complete polynomials of degree at most p on T ∈ Th . Let n o P p (Th ) ≔ wh : Ω → R ; ∀T ∈ Th , wh |T ∈ P p (T ) denote the broken polynomial space on the triangulation Th . For the semi-discrete formulation, we assume that the coefficient functions (for t ∈ J fixed) are approximated as: uh ∈ [P p (Th )]2 and fh (t), c0h ∈ P p (Th ). A specific way to compute these approximations was given in the first paper of the series [3]; here we use the standard L2 -projection into P p (T ), therefore the accuracy of this approximation improves with increasing polynomial order p. Choosing the same polynomial space for all functions simplifies the implementation and is done in preparation for later applications, in which uh might be part of the solution of a coupled system. Incorporating the boundary condition (1b), the semidiscrete formulation reads: Seek ch (t) ∈ P p (Th ) such that the following holds for t ∈ J and ∀T − ∈ Th , ∀wh ∈ P p (Th ) : Z Z Z Z   wh ∂t ch (t) dx − ∇wh · uh (t) ch (t) dx + w−h u(t) · νT − ĉh (t) ds = wh fh (t) dx , (2) T− T− ∂T − T− where the boundary integral is calculated using the upwind-sided value ĉh (t, x) ∂T −  − ch (t, x) if      + ch (t, x) if =     c (t, x) if D u(t, x) · νT − ≥ 0 u(t, x) · νT − < 0 ∧ x < ∂Ωin x ∈ ∂Ωin (outflow from T − ) (inflow into T − from T + ) (inflow into T − over ∂Ωin )       .      Note that we did not use the approximate representation of the velocity uh in the boundary integral. This is due to the fact that the L2 -projection on elements may have poor approximation quality on edges and generally produces different values on both sides of the edge ultimately leading to different upwind-sided values and inconsistent flux approximations. Instead we evaluate the normal velocity u · νT in each quadrature point analytically and use the result for both the numerical integration and the determination of the upwind direction as will be demonstrated in Sec. 2.3.4. Thus far, we used an algebraic indexing style. In the remainder, we switch to a mixture of algebraic and numerical style: for instance, Ekn ∈ ∂T k ∩ EΩ means all possible combinations of element indices k ∈ {1, . . . , K} and local edge indices n ∈ {1, 2, 3} such that Ekn lies in ∂T k ∩ EΩ . This implicitly fixes the numerical indices which accordingly can be used to index matrices or arrays. We use a bracket notation followed by a subscript to index matrices and multidimensional arrays. Thus, for an n-dimensional array X, the symbol [X]i1 ,...,in stands for the component of X with index il in the l-th dimension. As in MATLAB / GNU Octave, a colon is used to abbreviate all indices within a single dimension. For example, [X]:,:,i3,...,in is a two-dimensional array / matrix. 2.3.1. Local basis representation In contrast to globally continuous basis functions mostly used by the continuous finite element method, the DG basis functions have no continuity constraints across triangle boundaries. Thus a standard DG basis function ϕki : Ω → R is only supported on the triangle T k ∈ Th (i. e., ϕki = 0 on Ω r T k ) and can be defined arbitrarily while ensuring !  (p + 1)(p + 2) p+2 = (3) where N p ≔ ∀k ∈ {1, . . . , K} , P p (T k ) = span ϕki i∈{1,...,N p } , p 2 3 is the number of local degrees of freedom. Note that N p may in general vary from triangle to triangle, but, for simplicity, we assume here a uniform polynomial degree p for every triangle and abbreviate N ≔ N p . Clearly, the number of global degrees of freedom equals KN. Closed-form expressions for orthonormal basis functions on the reference triangle T̂ (cf. Sec. 4.1) employed in our implementation up to order two can be found in our first paper [3]. The basis functions up to order four are provided in the routine phi and their gradients in gradPhi. Bases of even higher order can be constructed, e. g., with the Gram–Schmidt algorithm or by using a three-term recursion relation— the latter is unfortunately not trivial to derive in the case of triangles. Note that these so-called modal basis functions ϕ̂i do not posses interpolation properties at nodes unlike Lagrangian / nodal basis functions, which are often used by the continuous finite element or nodal DG methods. The local concentration ch and the local velocity uh on T k ∈ Th can be represented in terms of the local basis {ϕki }i∈{1,...,N} : ch (t, x) T ≕ k N X Ck j (t) ϕk j (x) , uh (t, x) T ≕ k j=1 N X 2 X Ukmj (t) em ϕk j (x) , j=1 m=1 where em denotes the m-th unit vector in R2 . We condense the coefficients associated with unknowns into twodimensional arrays C(t) such that Ck j (t) ≔ [C(t)]k, j , etc. The symbol [C]k,: is called local representation matrix  of ch on T k with respect to the basis ϕki i∈{1,...,N} . In a similar way, we express the coefficient functions as linear combinations of the basis functions: On T k ∈ Th , we use the local representation matrices [C0 ]k,: for c0h and [F]k,: for fh . 2.3.2. System of equations Testing (2) with wh = ϕki for i ∈ {1, . . . , N} yields a time-dependent system of equations whose contribution from T k (identified with T k− in boundary integrals) reads N X ∂tCk j (t) Tk j=1 | + Z ϕki ϕk j dx − {z ∂T k− | Ck j (t) j=1 N X 2 X Z Uklm (t) ∂ xm ϕki ϕkl ϕk j dx Tk l=1 m=1 } | I Z N X {z II  N X     Ck− j (t) ϕk− j if u(t) · νk− ≥ 0      j=1      X N ϕk− i u(t) · νk−     Ck+ j (t) ϕk+ j if u(t) · νk− < 0 ∧ x < ∂Ωin      j=1      cD (t) if x ∈ ∂Ωin {z III }            Z  N  X   ϕki ϕkl dx , ds = Fkl (t)     Tk  l=1   | {z }     IV    } where we abbreviated νT k by νk . Written in matrix form, system (4) is then given by   M ∂t C + −G1 − G2 + R C = L − KD | {z } | {z } ≕ A(t) (4) (5) ≕ V(t) with the representation vector h C(t) ≔ C11 (t) · · · C1N (t) · · · · · · C K1 (t) · · · C KN (t) iT . The block matrices and the right-hand side vectors of (5) are described in Sections 2.3.3 and 2.3.4. Note that all blocks except for the mass matrix M are time-dependent (we have suppressed the time arguments here). 4 n− Ek − Tk − ν k − n− Tk + Figure 1: Two triangles adjacent to edge Ek− n− . It holds: Ek− n− = Ek+ n+ and νk− n− = −νk+ n+ . 2.3.3. Contributions from area terms I, II, IV The matrices in the remainder of this section have sparse block structure; by giving definitions for non-zero blocks we tacitly assume a zero fill-in. The mass matrix M ∈ RKN×KN in term I is defined component-wise as Z ϕki ϕk j . [M](k−1)N+i,(k−1)N+ j ≔ Tk Since the basis functions ϕki , i ∈ {1, . . . , N} are supported only on T k , M has a block-diagonal structure     MT 1  Z  ϕk1 ϕk1 · · · ϕk1 ϕkN       .. ..  dx , .. .. M =  with MT k ≔   . . . .        Tk  MT K ϕkN ϕk1 · · · ϕkN ϕkN (6)  i. e., it consists of K local mass matrices MT k ∈ RN×N . Henceforth, we write M = diag MT 1 , . . . , MT K . m KN×KN The block matrices G ∈ R , m ∈ {1, 2} from term II are given by [Gm ](k−1)N+i,(k−1)N+ j ≔ N X Uklm (t) l=1 Z ∂ xm ϕki ϕkl ϕk j dx . Tk m  Similarly to M, the matrices Gm = diag Gm T 1 , . . . , GT K are block-diagonal with local matrices Gm Tk ≔ N X l=1  Z  ∂ xm ϕk1 ϕkl ϕk1  ..  Uklm (t) .  Tk  ∂ xm ϕkN ϕkl ϕk1  · · · ∂ xm ϕk1 ϕkl ϕkN   .. ..  dx . . .  · · · ∂ xm ϕkN ϕkl ϕkN (7) Vector L(t) resulting from IV is obtained by multiplication of the representation vector of fh (t) to the global mass matrix: h iT L(t) = M F11 (t) · · · F1N (t) · · · · · · F K1 (t) · · · F KN (t) . 2.3.4. Contributions from edge term III Interior Edges EΩ . In this section, we consider a fixed triangle T k = T k− with an interior edge Ek− n− ∈ ∂T k− ∩ EΩ = ∂T k− ∩∂T k+ shared by an adjacent triangle T k+ and associated with fixed local edge indices n− , n+ ∈ {1, 2, 3} (cf. Fig. 1). For a fixed index i ∈ {1, . . . , N}, we have a contribution for ϕk− i in a block matrix RΩ ∈ RKN×KN Z  (PN Ck− j (t) ϕk− j if u · νk− n− ≥ 0)  PNj=1 − − − ds . ϕk i u(t) · νk n E k − n− j=1 Ck+ j (t) ϕk+ j if u · νk− n− < 0 This means that, depending on the direction of the velocity field u(t, x), we obtain entries in the diagonal or offdiagonal blocks of RΩ . Entries in diagonal blocks are then component-wise given by [RΩ ](k−1)N+i,(k−1)N+ j ≔ X Ekn ∈∂T k ∩EΩ Z Ekn   ϕki ϕk j u·νkn δu·νkn ≥0 ds with 5 δu·νkn ≥0 (t, x) ≔ ( 1 0 ) if u(t, x) · νkn ≥ 0 . if u(t, x) · νkn < 0 (8a) Entries in off-diagonal blocks in R are possibly non-zero only for pairs of triangles T k− , T k+ with ∂T k− ∩ ∂T k+ , ∅ and read Z   (8b) ϕk− i ϕk+ j u · νk− n− δu·νk− n− <0 ds with δu·νk− n− <0 ≔ 1 − δu·νk− n− ≥0 . [RΩ ](k− −1)N+i,(k+ −1)N+ j ≔ E k − n− Boundary Edges E∂Ω . Similarly to interior edges we have contributions for a boundary edge Ekn ∈ ∂T k ∩ E∂Ω Z  (PN Ck j (t) ϕk j if u(t) · νkn ≥ 0)  j=1 ds . ϕki u(t) · νkn cD (t) if u(t) · νkn < 0 Ekn These consist of entries in the block diagonal matrix R∂Ω ∈ RKN×KN X Z   ϕki ϕk j u · νkn δu·νkn ≥0 ds , [R∂Ω ](k−1)N+i,(k−1)N+ j ≔ Ekn ∈∂T k ∩E∂Ω (9) Ekn and in the right-hand side vector KD ∈ RKN X Z   ϕki cD (t) u · νkn δu·νkn <0 ds . [KD ](k−1)N+i ≔ Ekn ∈∂T k ∩E∂Ω (10) Ekn We combine the block matrices RΩ , R∂Ω into a block matrix R ∈ RKN×KN R ≔ RΩ + R∂Ω . (11) Since the definition of entries in the diagonal blocks in Eqns. (8a), (9) is the same for both matrices differing only in the set of edges included in the sum, we can disregard the fact whether they are interior or boundary edges and simply assemble the entries for all Ekn ∈ ∂T k . 2.4. Time discretization The system (5) is equivalent to  M∂t C(t) = V(t) − A(t) C(t) ≕ S C(t), t  (12) with A(t) ∈ RKN×KN and right-hand-side vector V(t) ∈ RKN as defined in (5). We discretize system (12) in time using TVD (total variation diminishing) Runge–Kutta methods [8] of orders one, two, and three, which are representatives of the class of SSP (strong stability preserving) Runge–Kutta methods [9]. The advantage of using a time stepping algorithm of such type lies in the guaranteed preservation of the monotonicity of the solution if the DG discretization is also post processed by a slope limiting method. Let 0 = t1 < t2 < . . . < tend be a not necessarily equidistant decomposition of the time interval J and let ∆tn ≔ tn+1 − tn denote the time step size. The update scheme of the s-step Runge–Kutta method is given by C(0) C(i) Cn+1 = Cn ,   = ωi Cn + (1 − ωi ) C(i−1) + ∆tn M−1 Sn+δi , = C(s) , for i = 1, . . . , s , (13) where we abbreviated Cn ≔ C(tn ) and Sn+δi ≔ S(C(i−1) , tn + δi ∆tn ) with coefficients s=1 : ω1 = 0 , δ1 = 0 . s=2 : s=3 : ω1 = 0 , ω2 = 1/2 , ω1 = 0 , ω2 = 3/4 , ω3 = 1/3 , δ1 = 0 , δ2 = 1 . δ1 = 0 , δ2 = 1 , δ3 = 1/2 . When possible, we choose the order of the time-discretization to be p+1, with p being the spatial approximation order, in order to avoid the temporal discretization error dominating the spatial one. Unfortunately, no optimal SSP Runge– Kutta methods higher than order three are known [9], which is why we restrict ourselves to orders one to three for the time discretization. 6 3. Slope limiting Slope limiters are a technique to prevent the onset of spurious oscillations that violate the monotonicity preserving property of the piecewise constant part of a DG solution by means of restricting some of the degrees of freedom (generally linear and superlinear) to certain bounds and thus eliminating over- and undershoots. All limiting procedures utilize the fact that the lowest order (piecewise constant) part of a DG solution in explicit TVD time stepping schemes is guaranteed to preserve the monotonicity of the solution and produce no spurious extrema. Using this physically consistent but numerically not very accurate solution part, all slope limiters attempt to modify the full higher order DG solution in a suitable way—on the one hand, to prevent any oscillations and, on the other hand, to preserve as much of the accuracy as possible. The key differences in slope limiters affect the limiting stencil used (edge neighbors, node neighbors, neighbors of the neighbors, etc.), presence of ad hoc parameters, the amount of the introduced numerical diffusion, a strict or less strict preservation of the monotonicity, and the degree of solution degradation in smooth extrema. Whereas a large literature on slope limiting for piecewise linear DG discretizations exists [10, 11, 12], the limiting of DG solutions with p ≥ 2 is a much less explored area. The traditional approach to dealing with superlinear DG solutions [13] has been based on ignoring all higher order degrees of freedom on elements on which linear limiting is active. Other methods require a much larger stencil [14, 15] to provide enough information for the reconstruction of higher order derivatives. The hierarchical vertex-based limiters of Kuzmin [16, 7] represent a computationally efficient scheme easily extendable to any discretization order and supporting fully unstructured meshes. These limiters do not guarantee the strict monotonicity of the DG solution, but the violations are small and may be further reduced by simple modifications described in Sec. 3.4. 3.1. Taylor basis representation Many limiting procedures rely on some fundamental properties of a certain choice of basis, in our case the 2D Taylor basis, which we introduce in a way similar to Kuzmin [16]. Consider the 2D Taylor series expansion of a local solution ch ∈ P p (T k ), ch (x) = X ∂ a ch (xkc ) 0≤|a|≤p (x − xkc ) a a! on T k ∈ Th (14) T T about the centroid xkc = [x1kc , x2kc ] of T k ∈ Th with a two-dimensional multi-index a = [a1 , a2 ] ∈ N20 , where we use some standard notation for multi-indices a, b ∈ N20 and x ∈ R2 : T a ± b = [a1 ± b1 , a2 ± b2 ] , 1 2 x a ≔ (x1 )a (x2 )a , For v : T k → R, let v ≔ form [17, 18, 19] ch (x) = ch + R 1 |T k | T k |a| ≔ a1 + a2 ,  1 2 ∂ a ≔ ∂|a| ∂(x1 )a ∂(x2 )a . a! ≔ a1 !a2 ! , v(x) dx denote the integral mean of v on T k . We express (14) in the equivalent X ∂ch ∂ch (x − xkc ) a − (x − xkc ) a 1 1 2 2 a (x )(x − x ) + (x )(x − x ) + ∂ c (x ) kc kc h kc kc kc a! ∂x1 ∂x2 2≤|a|≤p on T k ∈ Th . (15) Note that varying any terms in (15) except ch does not affect the mean of ch (x) over T k . To be able to identify each term in expansions (14), (15) by a consecutive index, we introduce a linear index mapping I : N20 → N corresponding to any two-dimensional multi-index a ∈ N20 as I(a) = N|a|−1 + a2 + 1 = |a|(|a| + 1) + a2 + 1 2 (16) with N p = dim P p (T ) as defined in (3). We implicitly define a j such that ∀ j ∈ N, I(a j ) = j. The linear indices, polynomial degrees, and corresponding multi-indices up to order four are listed in Table 1. This leads to the following 7 p 0 1 2 3 4 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 I(ai ) ai T [0, 0] [1, 0] [0, 1] [2, 0] [1, 1] [0, 2] [3, 0] [2, 1] [1, 2] [0, 3] [4, 0] [3, 1] [2, 2] [1, 3] [0, 4] Table 1: Multi-indices (bottom), linear indices (middle), and corresponding polynomial degrees in the Taylor basis (17) (top). definition of the local Taylor basis [17]: φk1 = 1 , φk2 = x1k − x1kc ∆(x1k ) , φk3 = x2k − x2kc ∆(x2k ) , φki = (x − xkc ) ai − (x − xkc ) ai ai ! (∆xk ) ai for i ≥ 4 . (17) As opposed to the DG basis {ϕk j } (cf. [3], Sec. 2.4.1), the basis {φk j } cannot be defined on a reference element T̂ .  T j j j j j j The scaling by ∆xk = ∆(x1k ), ∆(x2k ) with ∆(xk ) ≔ (xk,max − xk,min )/2, where xk,max ≔ maxi∈{1,2,3} xki and xk,min ≔ j mini∈{1,2,3} xki are the minimum and maximum values of the corresponding spatial coordinates on T k , is introduced to obtain a better conditioned operator [17]. The Taylor degrees of freedom are now proportional to the cell mean values ch and derivatives of ch at the centroid xkc ch (x) = ch φk1 + Np X  !  !   ∂ch ∂ch 1 2 φ (x)+ φ (x)+ (x ) ∆ x (x ) ∆ x ∂ ai ch (xkc ) (∆xk ) ai φki (x) on T k ∈ Th . (18) k2 k3 kc kc k k 1 2 ∂x ∂x i=4 Note that the Taylor basis is non-orthogonal on triangular meshes [16], but the cell means are still decoupled from the other degrees of freedom since Z Z φk1 φk j dx = 0 for j > 1 . φ2k1 dx = |T k | , Tk Tk To transform a function ch from the modal basis representation with representation matrix C(t) ∈ RK×N —as described in Sec. 2.3.1—into a Taylor basis representation with representation matrix CTaylor (t) ∈ RK×N , we employ the L2 -projection defined locally for T k ∈ Th by  N   N  Z Z X  X Taylor  wh  Ck j (t) ϕk j  dx = ∀wh ∈ P p (T k ) , wh  Ck j (t) φk j  dx . Tk Tk j=1 j=1 Choosing wh = ϕki for i ∈ {1, . . . , N} we obtain N X j=1 Ck j (t) Z ϕki ϕk j dx = Tk N X j=1 Taylor Ck j (t) Z ϕki φk j dx Tk ⇔ DG,Taylor MT k [C]k,: = MT k h CTaylor i k,: with the local mass matrix MT k as defined in Eq. 6 and the local basis transformation matrix   Z  ϕk1 φk1 · · · ϕk1 φkN    .. DG,Taylor ..  dx . .. MT k ≔ (19)  . . .   Tk  ϕkN φk1 · · · ϕkN φkN   DG,Taylor DG,Taylor and representation vectors C, CTaylor ∈ RKN we obtain a linear Using MDG,Taylor ≔ diag MT 1 , . . . , MT K system of equations M C = MDG,Taylor CTaylor , (20) which can be employed to transform back-and-forth between both bases. 8 Figure 2: The neighborhood of a vertex xki ∈ T k (red circle) considered in Eq. (21) consists of the patch of elements max containing xki (red area). The bounds cmin ki , cki from Eq. (22) are determined from all centroid values (green squares) within this neighborhood. 3.2. Linear vertex-based limiter Kuzmin [7, 16] and Aizinger [20] described the vertex-based limiter, which is based on the Barth–Jespersen limiter [21] and improved it further by taking the bounds from all elements containing the vertex instead of taking only edge neighbors of the cell. The goal is to determine the maximum admissible slope for a linear reconstruction of the form ch (x) = ckc + αke ∇ch (xkc ) · (x − xkc ) , 0 ≤ αke ≤ 1 , x ∈ Tk , where we abbreviated the function value ckc ≔ ch (xkc ) in the centroid xkc . The correction factor αke is chosen such that above reconstruction is bounded in all vertices xki ∈ T k by the minimum and maximum centroid values of all elements containing xki , that is ∀T k ∈ Th , ∀i ∈ {1, 2, 3} , max cmin ki ≤ ch (xki ) ≤ cki (21) with cmin ki ≔ min {T l ∈Th | xki ∈T l } clc , cmax ki ≔ max {T l ∈Th | xki ∈T l } clc (22) (cf. Fig. 2 for an illustration). To enforce (21), the correction factor αke is defined as [16]    max   (c − ckc ) (cki − ckc ) if cki > cmax   ki    ki min max  1 if cki ≤ cki ≤ cki  , ∀T k ∈ Th , αke ≔ min      i ∈ {1,2,3}   (cmin − c ) (c − c ) if c < cmin  ki kc ki kc ki (23) ki where cki ≔ ckc + ∇ch (xkc ) · (xki − xkc ) is the unconstrained linear reconstruction in xki . The limited counterpart of the DG solution (18) becomes then # "  !  ! ∂ch ∂ch 1 2 (x ) ∆ x (x ) ∆ x φ (x) + φ (x) on T k ∈ Th , ch (x) = ch φk1 + αke kc kc k2 k3 k k ∂x1 ∂x2 i. e., the linear degrees of freedom are scaled by αke , and any degrees of freedom associated with higher polynomial degrees are set to zero. In the particular case of a linear DG approximation, the limiting can be performed using any hierarchical basis as opposed to higher-order DG solutions that require a Taylor basis representation (see Sec. 3.3). In case of αke = 1, both linear and superlinear degrees of freedom remain unchanged. 3.3. Hierarchical vertex-based limiter Further improvements by Kuzmin combine the vertex-based or standard Barth–Jespersen limiter with the higher order limiting scheme of Yang and Wang [17], who limit the numerical solution by multiplying all derivatives of 9 (q) order q by a common correction factor αke instead of applying the correction only to the linear terms and dropping all higher degrees of freedom. Kuzmin [16] described this scheme in detail for quadratic representations, and here we offer a closed form expression of this limiting procedure for DG discretizations of arbitrary orders. Let Aq ≔ {a ∈ N20 |a| = q} be the set of all two-dimensional multi-indices of order q. We determine the correction (q) factor αke for each order q ≤ p by computing correction factors (23) using the linear vertex-based limiter for all linear reconstructions of derivatives of order q − 1, ∀ a ∈ Aq−1 , Taylor Taylor Taylor ck,a,i ≔ Ck,I(a) φk1 (xki ) + Ck,I(a+[1,0]T ) φk2 (xki ) + Ck,I(a+[0,1]T ) φk3 (xki ) on T k ∈ Th , (24) where the indices of the corresponding degrees of freedom are given by I(a) and the first x1 -derivatives (identified by (q) I(a + [1, 0]T )) and x2 -derivatives (identified by I(a + [0, 1]T )). Formally, the correction factor αke is defined as (q) (q) αke = min αka , a∈Aq−1 with α(q) ka  max   (ck,a,i − ck,a,c ) (ck,a,i − ck,a,c )     1 ≔ min   i∈{1,2,3}    (cmin − ck,a,c )(ck,a,i − ck,a,c ) k,a,i if c a,i > cmax a,i min if ck,a,i ≤ ck,a,i ≤ cmax k,a,i if ck,a,i < cmin k,a,i       , (25)      max where cmin k,a,i , ck,a,i are defined as in (22). To avoid the loss of accuracy at smooth extrema, the lower order derivatives should be limited by a factor not exceeding that of the higher order derivatives, since lower orders are typically smoother. Beginning with the highest-order degrees of freedom, we compute the correction factors ∀q ≥ 1 (d) α(q) ke ≔ max αke . (26) q≤d≤p Once the correction factor α(q) ke becomes equal to one for some d > 1, no further limiting on this element is necessary. The limited solution becomes N X  !  !  ∂ch (1) ∂ch 1 2 i |) φ (x) + α φ (x) + ch (x) = ch φk1 + α(1) α(|a ∂ ai ch (xkc ) (∆xk ) ai φki (x) . (x ) ∆ x (x ) ∆ x k2 k3 kc kc k k ke ke ke 1 2 ∂x ∂x i=4 3.4. Stricter form of the vertex-based limiter Our numerical experiments showed that implicitly assuming that higher order derivatives are always smoother than lower order derivatives results in limiting procedures that do not guarantee strict fulfillment of condition (21), especially at discontinuities in the solution. We modified two key components of the limiter presented in the previous section and obtained a limiter that exhibited slightly stronger peak clipping but turned out to be always effective: 1. Instead of employing only the linear reconstruction as given in Eq. (24), we replace ck,a,i in the computation of the correction factor in Eq. (25) by the full reconstruction X Taylor ∀ a ∈ Aq−1 , ck,a,i ≔ Ck,I(a+b) φk,I(b) (xki ) , 0≤|b|<p−q where p is the polynomial degree of the DG solution ch (x). 2. Again, we begin with the highest-order derivative but drop the hierarchical limiting condition (26) and instead (q) apply each correction coefficient αke immediately to all coefficients corresponding to polynomial degree q or (q−1) higher. These limited coefficients are then used to compute the next correction coefficient αke . The result of our stricter limiter is ch (x) = ch φk1 +α(1) ke N  X  !  !   ∂ch (1) ∂ch (1) (|ai |) 1 2 ai ai ) (∆x φ (x)+α φ (x)+ (x ) ∆ x (x ) ∆ x α · · · α φki (x) . ∂ c (x ) k2 k3 kc kc h kc k k k ke ke ke ∂x1 ∂x2 i=4 10 3.5. Slope limiting in time-dependent problems For time-dependent problems, the slope limiting procedure is applied to each intermediate solution C(i) in the update scheme (13). However, due to the fact that the Taylor basis is non-orthogonal on triangles—as discussed in Sec. 3.1—an implicit coupling between the spatial derivatives is present and leads to non-smooth spatial variations in the time derivatives of ch . For that reason, Kuzmin [7] applied the slope limiter not only to the solution of each Runge–Kutta stage but also to the time derivative ċ ≔ ∂t c and used in addition a filtering procedure that can be interpreted as selective mass lumping. We describe this technique first for a discretization in Taylor basis and extend it then to arbitrary basis representations. Let ΦTaylor denote the slope limiting operator that applies any of the above slope limiting procedures to a global representation vector CTaylor (t) of a solution ch (t) in Taylor basis representation. The semi-discrete system (12) written in a Taylor basis   MC ∂t CTaylor (t) = STaylor CTaylor (t), t is replaced by   ML ∂t CTaylor (t) = STaylor ΦTaylor CTaylor (t), t + (ML − MC ) ΦTaylor ∂t CTaylor (t) , where MC = {mi j }, ML ≔ diag{mii } denote the full and the lumped mass matrices in Taylor basis (to improve readability, we drop the superscript ‘Taylor’ here). Note that for the case ΦTaylor = I both formulations are identical. Consequently, update scheme (13) is modified replacing   Taylor,n+δi CTaylor,(i) = ωi CTaylor,n + (1 − ωi ) CTaylor,(i−1) + ∆tn ĊTaylor,(i) with ĊTaylor,(i) ≔ M−1 C S by the selectively lumped and limited update i h  CTaylor,(i) = ΦTaylor ωi CTaylor,n + (1 − ωi ) CTaylor,(i−1) + ∆tn C̃Taylor,(i) with i h Taylor Taylor,(i) Ċ + STaylor,n+δi . C̃Taylor,(i) = M−1 L (ML − MC ) Φ Although the mass matrix M in the modal basis is diagonal, the implicit coupling between the spatial x1 - and x2 derivatives is still present. Only the Taylor basis has vectors coinciding with the coordinate directions, hence, the lumping technique cannot be directly applied to representations in other bases. To get rid of this implicit coupling of the spatial derivatives in the time derivative of the modal DG basis, we reformulate the lumped time derivative in Taylor basis as −1 Taylor,n+δi Taylor Taylor,(i) Taylor Taylor,(i) Ċ + M−1 Ċ − M−1 C̃Taylor,(i) = M−1 L MC MC S L MC Φ L ML Φ | {z } =I   Taylor Taylor,(i) −1 Taylor,n+δi Taylor Taylor,(i) −1 −Φ Ċ =Φ Ċ + ML MC MC S | {z } =ĊTaylor,(i)  Taylor,(i) − ΦTaylor ĊTaylor,(i) . = ΦTaylor ĊTaylor,(i) + M−1 L MC Ċ  Using the time derivative in modal basis Ċ(i) = M−1 Sn+δi and transformation (20), we obtain i  h Taylor,(i) − ΦTaylor ĊTaylor,(i) , C̃(i) = M−1 MDG,Taylor C̃Taylor,(i) = M−1 MDG,Taylor ΦTaylor ĊTaylor,(i) + M−1 L MC Ċ  −1 where ĊTaylor,(i) ≔ MDG,Taylor MĊ(i) . Thus, the fully modified version of update scheme (13) reads as C(0) C(i) Cn+1 = Cnh,  i = Φ ωi Cn + (1 − ωi ) C(i−1) + ∆tn C̃(i) = C(s) , for ∀i = 1, . . . , s , with C̃(i) as given in (27) and the slope limiting operator Φ formally defined as −1  Φ ≔ M−1 MDG,Taylor ΦTaylor MDG,Taylor M . 11 (27) (28) (29) x̂2 xk3 Fk x̂3 1 Ek1 Ek2 Ê1 x2 Ê2 T̂ x̂1 0 0 xk1 Tk xk2 Ek3 x̂2 Ê3 1 1 x̂ x1 Figure 3: The affine mapping Fk transforms the reference triangle T̂ with vertices x̂1 = [0, 0]T , x̂2 = [1, 0]T , x̂3 = [0, 1]T to the physical triangle T k with counter-clockwise-ordered vertices xki , i ∈ {1, 2, 3}. 3.6. Boundary conditions max Problems can occur when computing the bounds cmin ki , cki in Eq. (21) for control points xki ∈ ∂Ωin on the Dirichlet boundary. To account for the boundary data in the limiting procedure we include on those control points the boundary value cD (tn + δi ∆tn , xki ) in the minimum/maximum-operation in Eq. (22) for α(1) ke when applying the slope limiting operator Φ in Eq. (28). 4. Implementation An extensive documentation on our data structures, grid, etc. can be found in the first paper of the series [3]. These explanations are not reproduced here; greater detail is provided for routines first introduced in the present work. 4.1. Backtransformation to the reference triangle We are using a back transformation to the reference triangle T̂ = {(0, 0), (1, 0), (0, 1)} defined by an affine mapping h i Fk : T̂ ∋ x̂ 7→ Bk x̂ + xk1 = x ∈ T k , with R2×2 ∋ Bk ≔ xk2 − xk1 xk3 − xk1 , (30) for any triangle T k = {xk1 , xk2 , xk3 } ∈ Th (see Fig. 3). It holds 0 < det Bk = 2|T k |. Any function w : T k → R implies ŵ : T̂ → R by ŵ = w ◦ Fk , i. e., w(x) = ŵ( x̂) . The transformation of the gradient is obtained by the chain rule: ˆ k −T ∇ ˆ, ∇ = ∇F (31) ˆ = [∂ x̂1 , ∂ x̂2 ]T . This results in transformation formulas for integrals over an element T k or where we abbreviated ∇ an edge Ekn ⊂ T k for a function w : Ω → R Z Z Z Z |T k | (32a) w(x) dx = w ◦ Fk ( x̂) d x̂ = 2|T k | w ◦ Fk ( x̂) d x̂ = 2|T k | ŵ( x̂) d x̂ , |T̂ | T̂ T̂ T̂ Tk Z Z Z |Ekn | |Ekn | w(x) dx = w ◦ Fk ( x̂) d x̂ = ŵ( x̂) d x̂ . (32b) |Ên | Ên |Ên | Ên Ekn 4.2. Numerical integration As an alternative to the symbolic integration functions provided by MATLAB, we implemented a quadrature integration functionality for triangle and edge integrals. Since we transform all integrals on T k ∈ Th to the reference triangle T̂ (cf. Sec. 4.1), it is sufficient to define the quadrature rules on T̂ (which, of course, can be rewritten to apply for every physical triangle T = FT (T̂ )): Z T̂ ĝ( x̂) d x̂ ≈ R X ωr ĝ( q̂r ) (33) r=1 12 with R quadrature points q̂r ∈ T̂ and quadrature weights ωr ∈ R. The order of a quadrature rule is the largest integer s such that (33) is exact for polynomials g ∈ P s (T̂ ). Note that we exclusively rely on quadrature rules with positive weights and quadrature points located strictly in the interior of T̂ and not on ∂T̂ . The rules used in the implementation are found in the routine quadRule2D. An overview of quadrature rules on triangles can be found in the “Encyclopaedia of Cubature Formulas” [22]. For edge integration, we rely on standard Gauss quadrature rules of required order. The integrals in (4) contain integrands that are polynomials of maximum order 3p−1 on triangles and of maximum order 3p on edges. Using quadrature integration, one could choose rules that integrate all such terms exactly; however, sufficient accuracy can be achieved with quadrature rules that are exact for polynomials of order 2p on triangles and 2p + 1 on edges (cf. [23]). 4.3. Assembly The aim of this section is to transform the terms required to build the block matrices in (5) to the reference triangle T̂ and then to evaluate those either via numerical quadrature or analytically. The assembly of block matrices from local contributions is then performed in vectorized operations. For the implementation, we need the explicit form for the components of the mappings Fk : T̂ → T k and their inverses F−1 k : T k → T̂ as defined in (30). Recalling that 0 < det Bk = 2|T k | (cf. Sec. 4.1) we obtain " # # " 11 1 1 B22 (x1 − a1k1 ) − B12 (x2 − a2k1 ) Bk x̂ + B12 x̂2 + a1k1 −1 k k k . and Fk (x) = Fk ( x̂) = 2 2 21 1 1 1 22 2 2 B21 2 |T k | B11 k (x − ak1 ) − Bk (x − ak1 ) k x̂ + Bk x̂ + ak1 From (31) we obtain the component-wise rule for the gradient in x ∈ T k : # " " # 21 1 B22 ∂ x1 k ∂ x̂1 − Bk ∂ x̂2 . = 12 ∂ x2 2 |T k | B11 k ∂ x̂2 − Bk ∂ x̂1 (34) Similarly to the first paper in series [3], we make extensive use of the Kronecker product A ⊗ B of two matrices A = [ai j ] ∈ Rma ×na , B = [bkl ] ∈ Rmb ×nb defined as h i A ⊗ B ≔ ai j B ∈ Rma mb ×na nb . (35) In the following, we present the necessary transformation for all blocks of system (5) and name the corresponding MATLAB / GNU Octave routines that can be found in Sec. 5. 4.3.1. Assembly of M Using the transformation rule (32a), the following holds for the local mass matrix MT k as defined in (6): MT k = 2|T k | M̂ with  Z  ϕ̂1 ϕ̂1  . M̂ ≔  ..  T̂  ϕ̂N ϕ̂1  · · · ϕ̂1 ϕ̂N   ..  , .. . .   · · · ϕ̂N ϕ̂N (36) where M̂ ∈ RN×N is the representation of the local mass matrix on the reference triangle T̂ . With (6) we see that the global mass matrix M can be expressed as a Kronecker product of a matrix containing the areas |T k | and the local matrix M̂:      |T 1 |  MT 1     .. .. = 2 M =   ⊗ M̂ .   . .     |T K | MT K In the corresponding assembly routine assembleMatElemPhiPhi , the sparse block-diagonal matrix is generated using the command spdiags with the list g.areaT (cf. [3]). 13 4.3.2. Assembly of Gm Application of the product rule, (32a), and (34) gives us Z Z 11 22 21 ∂ x2 ϕki ϕkl ϕk j = −B12 ∂ x1 ϕki ϕkl ϕk j = Bk [Ĝ]i, j,l,1 − Bk [Ĝ]i, j,l,2 , k [Ĝ]i, j,l,1 + Bk [Ĝ]i, j,l,2 Tk Tk with a multidimensional array Ĝ ∈ RN×N×N×2 representing the transformed integral on the reference triangle T̂ : Z ∂ x̂m ϕ̂i ϕ̂ j ϕ̂l , for m ∈ {1, 2} . (37) [Ĝ]i, j,l,m ≔ T̂ Now we can express the local matrix G1T k from (7) as G1T k = N X l=1 = N X l=1   Z  22 1  Ukl (t)  Bk  T̂   ∂ x̂1 ϕ̂1 ϕ̂1 ϕ̂l  ..  .  ∂ x̂1 ϕ̂N ϕ̂1 ϕ̂l  · · · ∂ x̂1 ϕ̂1 ϕ̂N ϕ̂l  Z  .. ..  − B21 . k .  T̂ · · · ∂ x̂1 ϕ̂N ϕ̂N ϕ̂l   21 Ukl1 (t) B22 k [Ĝ]:,:,l,1 − Bk [Ĝ]:,:,l,2   ∂ x̂2 ϕ̂1 ϕ̂1 ϕ̂l  ..  .  ∂ x̂2 ϕ̂N ϕ̂1 ϕ̂l  · · · ∂ x̂2 ϕ̂1 ϕ̂N ϕ̂l   .. ..  . .  · · · ∂ x̂2 ϕ̂N ϕ̂N ϕ̂l m and analogously G2T k . With Gm = diag(Gm T 1 , . . . , GT K ) we can vectorize over all triangles using the Kronecker product as done in the routine assembleMatElemDphiPhiFuncDiscVec . We would like to point out that this is identical to the assembly of Gm in our first paper [3] except for the vectorial coefficient function; however, the respective section had some typos, above is the corrected version. Additionally, in the assembly routine the wrong component of the normal vector was used for the assembly of Gm . Corrected and up-to-date versions of the code can be found in our Github-repository [2]. 4.3.3. Assembly of R To ease the assembly of R we split the global matrix as given in (11) into a block-diagonal part and a remainder so that R = Rdiag + Roffdiag holds. We first consider the block-diagonal entries of R given in Eqns. (8a), (9) and transform the integral terms to the n-th edge of the reference triangle Ên : Z Z     |Ekn | ϕki ϕk j u · νkn δu·νkn ≥0 dx = ϕ̂i ϕ̂ j (u ◦ Fk ( x̂)) · νkn δu·νkn ≥0 d x̂ |Ên | Ên Ekn Z   |Ekn | 1 ϕ̂i ◦ γ̂n (s) ϕ̂ j ◦ γ̂n (s) (u ◦ Fk ◦ γ̂n (s)) ·νkn δûkn ·νkn ≥0 |γ̂′n (s)| ds = | {z } |Ên | 0 ≕ ûkn (s) ≈ |Ekn | R X   ωr ϕ̂i ◦ γ̂n (qr ) ϕ̂ j ◦ γ̂n (qr ) uknˆ(qr ) · νkn δûkn ·νkn ≥0 , | {z } r=1 ≕[R̂diag ]i, j,n,r (38) where we used transformation rule (32b), quadrature rule (33), and |γ̂′n (s)| = |Ên |. The explicit forms of the mappings γ̂n : [0, 1] → Ên can be easily derived: " # " # " # 1−s 0 s γ̂1 (s) ≔ , γ̂2 (s) ≔ , γ̂3 (s) ≔ . (39) s 1−s 0 Thus, we can assemble the global matrix using the Kronecker product Rdiag ≔ 3 X R X n=1 r=1  |E1n |  ωr   .. .    (û1n (qr ) · ν1n ) δû1n ·ν1n ≥0    ◦    |E Kn | 14 .. . (ûKn (qr ) · νKn ) δûKn ·νKn ≥0    h diag i  ⊗ R̂ , :,:,n,r  where ‘◦’ denotes the Hadamard product. Next, we consider the off-diagonal blocks of R stored in Roffdiag . For an interior edge Ek− n− = Ek+ n+ ∈ ∂T k− ∩ ∂T k+ , n− , n+ ∈ {1, 2, 3}, we obtain analogously: Z   ϕk− i ϕk+ j u · νk− n δu·νk− n <0 dx E k − n− =I Z z }| {   |Ek− n− | = ϕ̂i ϕk+ j ◦ Fk+ ◦ F−1 k+ ◦Fk− ( x̂) (u ◦ Fk− ( x̂)) · νk− n− δu·νk− n− <0 d x̂ |Ên− | Ên− Z   |Ek− n− | ϕ̂i ϕ̂ j ◦ F−1 = k+ ◦ Fk− ( x̂) (u ◦ Fk− ( x̂)) · νk− n− δu·νk− n− <0 d x̂ |Ên− | Ên− Z 1   − − ϕ̂i ◦ γ̂n− (s) ϕ̂ j ◦ F−1 = |Ek n | k+ ◦ Fk− ◦ γ̂n− (s) ûk− n− (s) · νk− n− δûk− n− ·νk− n− <0 ds . 0 − Note that F−1 k+ ◦ Fk maps from T̂ to T̂ . Since we compute a line integral, the integration domain is further restricted to an edge Ên− , n− ∈ {1, 2, 3} and its co-domain to an edge Ên+ , n+ ∈ {1, 2, 3}. As a result, this integration can be boiled down to nine possible maps between the sides of the reference triangle expressed as Ên− ∋ x̂ 7→ ϑ̂n− n+ ( x̂) = F−1 k+ ◦ Fk− ( x̂) ∈ Ê n+ ϑ̂n− n+ : for an arbitrary index pair {k− , k+ } as described above. The closed-form expressions of the nine cases are given in our first paper [3]. We apply quadrature rule (33) and define R̂offdiag ∈ RN×N×3×3×R by h i R̂offdiag ≔ ϕ̂i ◦ γ̂n− (qr ) ϕ̂ j ◦ ϑ̂n− n+ ◦ γ̂n− (qr ) (40) − + i, j,n ,n ,r and thus arrive at Roffdiag   0 δE1n− =E2n+ . . . ... δE1n− =EKn+     .. ..   δE − =E + . . 0  3 X 3 X R  2n 1n X   .. . . . . .. .. .. ..  ≔ ωr  .   n− =1 n+ =1 r=1   .. ..  . 0 δE(K−1)n− =EKn+  .   δEKn− =E1n+ ... . . . δEKn− =E(K−1)n+ 0    |E1n− | (û1n− · ν1n− ) δû1n− ·ν1n− <0 · · · |E1n− | (û1n− · ν1n− ) δû1n− ·ν1n− <0    .. ..  ⊗ [R̂offdiag ]:,:,n− ,n+ ,r . ◦  . .   |E Kn− | (ûKn− · νKn− ) δûKn− ·νKn− <0 · · · |E Kn− | (ûKn− · νKn− ) δûKn− ·νKn− <0 The sparsity structure for off-diagonal blocks depends on the numbering of mesh entities and is given for each combination of n− and n+ by the list markE0TE0T . Due to the upwind flux in the edge integrals, it is not possible here to include the quadrature rule directly in the element-blocks R̂offdiag as opposed to the assembly of element integrals and the assembly routines for edges in the first paper [3]. Implementing the assembly with above formulation is possible but expensive, since the global matrix would have to to be built for every quadrature point. Instead we make use of the fact that the sparsity structure is the same for every quadrature point as we solely rely on the element numbering and do not account for the upwind direction when determining the structure of Roffdiag . We define a tensor of block vectors R̃offdiag ∈ RKN×N×3×3    |E1n− | (û1n− · ν1n− ) δû1n− ·ν1n− <0  R X h i    ..  ⊗ [R̂offdiag ]:,:,n− ,n+ ,r . R̃offdiag ≔ ωr  . (k−1)N+1:kN,:,n−,n+   r=1 |E Kn− | (ûKn− · νKn− ) δûKn− ·νKn− <0 For mb = rma , r ∈ N, let · ⊗V · : i h Rma ×na × Rmb ×nb ∋ (A, B) 7→ A ⊗V B ≔ [A]i, j [B](i−1)r : ir,: ∈ Rmb ×na nb 15 (41) be an operator which can be interpreted as a Kronecker product (cf. Eq. (35)) that takes a different right-hand side for every row of the left-hand side and is implemented in the routine kronVec. This allows us to write   0 δE1n− =E2n+ . . . ... δE1n− =EKn+     .. ..   δE − =E + . 0 .  3 X 3   2n 1n X h i   .. .. offdiag . . . offdiag . . . R = ,   ⊗V R̃ . . . . . :,:,n−,n+   n− =1 n+ =1  . .  .. ..  0 δE(K−1)n− =EKn+    δEKn− =E1n+ ... . . . δEKn− =E(K−1)n+ 0 which omits the expensive assembly of the global matrix in every quadrature point. The routine assembleMatEdgePhiPhiValUpwind assembles the matrices Rdiag and Roffdiag directly into R with a code very similar to the formulation above. To avoid repeated computation of the normal velocity u·νkn , we evaluate it once in all quadrature points on each edge using the globally continuous function u(t, x) and store it in a dedicated variable vNormalOnQuadEdge , which is then employed in the decision of the upwind direction using δu·νkn ≥0 and δu·νkn <0 as well as the normal velocity in the assembly of R and KD . 4.3.4. Assembly of KD The entries of KD in (10) are transformed using transformation rule (32b) and mapping (39) X Z   m ϕki cD (t) u · νm [KD ](k−1)N+i = kn δu·νkn <0 dx Ekn ∈∂T k ∩E∂Ω = X Ekn ∈∂T k ∩E∂Ω = X Ekn ∈∂T k ∩E∂Ω Ekn |Ekn | |Ên | |Ekn | Z Z Ên 1 0   m ϕ̂i cD (t, Fk ( x̂)) (u ◦ Fk ( x̂)) · νm kn δu·νkn <0 d x̂   m ϕ̂i ◦ γ̂n (s) cD (t, Fk ◦ γ̂n (s)) ûkn (s) · νm kn δûkn ·νkn <0 ds , where we again implicitly assumed the application of Fk and γ̂n to δu·νkn ≥0 . This integral is then approximated using a 1D quadrature rule (33) on the reference interval (0, 1) [KD ](k−1)N+i ≈ X Ekn ∈∂T k ∩E∂Ω |Ekn | R X r=1   m ωr ϕ̂i ◦ γ̂n (qr ) cD (t, Fk ◦ γ̂n (qr )) ûkn (qr ) · νm kn δûkn ·νkn <0 allowing to vectorize the computation over all triangles and resulting in the routine assembleVecEdgePhiIntFuncContVal . 4.4. Slope limiters For the implementation of the slope limiters described in Sec. 3, three parts must be considered: 1. The assembly of the transformation matrix MDG,Taylor from Eq. (19); 2. the slope limiters themselves; 3. the selective mass lumping in the limiting of time-derivatives, as explained in Sec. 3.5. 4.4.1. Assembly of MDG,Taylor The entries in MDG,Taylor are transformed using transformation rule (32a), and the integral is then approximated using a 2D quadrature rule (33) on the reference triangle T̂ Z Z R X i h ϕki φk j dx = 2|T k | ϕ̂i φk j ◦ Fk ( x̂) d x̂ ≈ 2|T k | ϕ̂i (qr ) φk j ◦ Fk (qr ) . MDG,Taylor = (k−1)N+i,(k−1)N+ j T̂ Tk r=1 Recall that we cannot define the Taylor basis (17) on the reference triangle T̂ since the basis functions depend directly on the physical coordinates of the element. The assembly is vectorized over all triangles resulting in the routine assembleMatElemPhiDiscPhiTaylor . Matrices MDG,Taylor and M assembled in Sec. 4.3.1 are then used in the routines projectDataDisc2DataTaylor and projectDataTaylor2DataDisc to transform the representation matrix between the modal and Taylor basis—as explained in Sec. 3.1—by solving system (20). 16 4.4.2. Slope limiting operators The slope limiters themselves are implemented in a generic manner according to Sec. 3. Beginning with the highest-order derivatives, we evaluate the linear or the full reconstruction of these derivatives at all control points xki . max These values along with the centroid values are used to determine the minimum and maximum values cmin ki and cki (see Eq. (21)) for each control point and, from these, the element-wise correction factors αe according to Eq. (23) or (25) are calculated. This is implemented in routine computeVertexBasedLimiter . Depending on the limiter type, this value is then applied to a certain subset of degrees of freedom, and the computation is repeated for the next lowerorder derivatives. The full slope limiting operators Φ, ΦTaylor are provided by the functions applySlopeLimiterDisc or applySlopeLimiterTaylor , respectively. min To overcome numerical problems for cases where cki ≈ cmax ki or cki ≈ cki , we modify Eqs. (23) and (25) so that max min the condition for cases 1 and 3 are modified to cki > cki − ǫ and cki < cki + ǫ for a small 0 < ǫ ∈ R. Additionally, we increase the absolute value of the denominators in cases 1 and 3 by ǫ, i. e., add or subtract ǫ, respectively. This makes our limiter slightly more strict than the one given by condition (21); ǫ = 10−8 has been found to be a suitable value for double precision computations. Moreover, we enforce 0 ≤ αke ≤ 1 to overcome cases where the division by a number close to zero might lead to values αke > 1. To reduce execution time, we perform the necessary evaluation of the Taylor basis functions in all vertices only once and store the result in a global variable that is used in the slope limiting routines. This is implemented in computeTaylorBasesV0T . 4.4.3. Limiting time-derivatives To obtain the selectively lumped time-derivative C̃(i) required for update scheme (28), we compute the discrete time derivative Ċ(i) as given in Sec. 3.5 and transform it to a Taylor basis representation using Eq. (20) (implemented in routine projectDataDisc2DataTaylor ). We compute the stationary matrix Mcorr ≔ M−1 L M in the beginning (which is computationally cheap, since ML is a diagonal matrix) and calculate the selectively lumped time-derivative C̃Taylor,(i) from Equation (27). Backtransformation to the modal DG basis is again cheap, since it requires only the inverse of the diagonal matrix M (implemented in projectDataTaylor2DataDisc ) to produce the selectively lumped time-derivative C̃(i) . Each intermediate solution C(i) in update scheme (28) is then obtained by applying the slope limiting operator Φ implemented in applySlopeLimiterDisc . 4.5. Numerical results 4.5.1. Analytical convergence test The code is verified by showing that the numerically estimated orders of convergences match the analytically predicted ones for prescribed smooth solutions. To verify the spatial discretization, we restrict ourselves to the stationary version of (1) and investigate the impact of different slope limiting schemes on the convergence order. The effectiveness of the slope limiters is verified in the next section. We choose the exact solution c(x) ≔ cos(7x1 ) cos(7x2 ) and velocity field u(x) ≔ [exp((x1 + x2 )/2), exp((x1 − 2 x )/2)]T on the domain Ω ≔ (0, 1)2. The data cD and f are derived analytically by inserting c and u into (1). We then compute the solution ch j for a sequence of increasingly finer meshes with element sizes h j , where the coarsest grid Th0 covering Ω is an irregular grid, and each finer grid is obtained by regular refinement of its predecessor. The discretization error kch (t) − c(t)kL2 (Ω) at time t ∈ J is computed as the L2 -norm of the difference between the discrete solution ch (t) and the analytical solution c(t), as it was described in detail in our first paper [3]. Table 2 contains the results demonstrating the experimental order of convergence α estimated using !, ! kch j−1 − ckL2 (Ω) h j−1 α ≔ ln ln . kch j − ckL2 (Ω) hj The interesting points to compare in Table 2 are the errors for different limiting schemes. Whereas the linear approximation does not get limited at all on finer grids—indicating that the vertex-based limiters are able to distinguish between smooth and non-smooth solutions given sufficient mesh resolution, the case of higher order approximation warrants a closer look. First of all, the linear limiter takes a heavy toll on the higher order degrees of freedom: 17 strict hier. vert. based linear none limiter p j 0 kch − ck 0 α 1 kch − ck 1 α 2 kch − ck 2 α 3 kch − ck 3 α 4 kch − ck 4 α 0 1 2 3 4 5 6 3.64e–1 5.64e–1 3.49e–1 2.49e–1 1.73e–1 1.09e–1 6.35e–2 — –0.63 0.69 0.49 0.53 0.66 0.78 5.44e–1 4.25e–1 1.28e–1 3.65e–2 8.29e–3 1.93e–3 4.71e–4 — 0.36 1.73 1.81 2.14 2.11 2.03 6.98e–1 1.32e–1 2.82e–2 3.15e–3 3.68e–4 4.50e–5 5.59e–6 — 2.40 2.23 3.16 3.10 3.03 3.01 2.73e–1 8.51e–2 6.10e–3 3.87e–4 2.39e–5 1.50e–6 9.36e–8 — 1.68 3.80 3.98 4.02 4.00 4.00 2.21e–1 1.46e–2 1.25e–3 4.58e–5 1.51e–6 4.80e–8 1.51e–9 — 3.92 3.54 4.77 4.92 4.97 4.99 0 1 2 3 4 5 6 — — — — — — — — — — — — — — 5.15e–1 4.53e–1 1.64e–1 4.53e–2 8.76e–3 1.98e–3 4.74e–4 — 0.19 1.47 1.85 2.37 2.14 2.07 7.21e–1 3.55e–1 1.34e–1 3.12e–2 4.48e–3 6.20e–4 7.63e–5 — 1.02 1.41 2.10 2.80 2.85 3.02 4.60e–1 3.54e–1 1.51e–1 3.12e–2 4.46e–3 6.19e–4 7.61e–5 — 0.38 1.23 2.27 2.81 2.85 3.02 5.27e–1 3.59e–1 1.47e–1 3.12e–2 4.46e–3 6.19e–4 7.61e–5 — 0.55 1.29 2.23 2.81 2.85 3.02 0 1 2 3 4 5 6 — — — — — — — — — — — — — — 5.15e–1 4.53e–1 1.64e–1 4.53e–2 8.76e–3 1.98e–3 4.74e–4 — 0.19 1.47 1.85 2.37 2.14 2.07 6.98e–1 2.47e–1 1.06e–1 7.87e–3 6.39e–4 5.32e–5 5.94e–6 — 1.50 1.22 3.76 3.62 3.59 3.16 2.73e–1 2.57e–1 5.89e–2 4.02e–3 6.16e–5 2.62e–6 1.17e–7 — 0.09 2.12 3.87 6.03 4.56 4.48 2.21e–1 1.33e–1 5.10e–2 3.17e–3 6.53e–6 1.08e–7 5.48e–9 — 0.73 1.38 4.01 8.92 5.92 4.30 0 1 2 3 4 5 6 — — — — — — — — — — — — — — 5.15e–1 4.53e–1 1.64e–1 4.53e–2 8.76e–3 1.98e–3 4.74e–4 — 0.19 1.47 1.85 2.37 2.14 2.07 6.84e–1 3.79e–1 1.14e–1 1.23e–2 1.15e–3 1.19e–4 6.64e–6 — 0.85 1.74 3.21 3.41 3.27 4.17 3.28e–1 3.69e–1 6.74e–2 1.20e–2 8.99e–4 1.33e–4 1.09e–6 — –0.17 2.45 2.49 3.74 2.76 6.93 3.56e–1 3.54e–1 6.15e–2 1.16e–2 8.85e–4 1.33e–4 1.13e–6 — 0.00 2.53 2.40 3.72 2.74 6.88 Table 2: Discretization errors measured in L2 (Ω) and estimated orders of convergences for different polynomial degrees and limiter types. We have h j = 3·21 j and K = 36 · 4 j triangles in the jth refinement level. quadratic, cubic, and quartic solutions produce virtually the same error, thus negating the effect of a more accurate DG solution. The strict limiter seems to flatten out after the cubic approximation, thus gaining one order of convergence on the linear limiter. The hierarchical limiter of Kuzmin, however, appears to perform very well for all tested meshes and approximation orders having a very small effect on the errors of the analytical test case. 4.5.2. Solid body rotation As a benchmark problem, we use solid body rotation test proposed by LeVeque [24], which is often used to investigate limiter performance [7, 13]. It consists of a slotted cylinder, a sharp cone, and a smooth hump (see Figure 4a) that are placed in a square domain Ω = [0, 1]2 and transported by a time-independent velocity field u(x) = T 1 [0.5 − x2 , x1 − 0.5] in a counterclockwise rotation over J = (0, 2π). With r = 0.0225 and G(x, x0) ≔ 0.15 kx − x0 k2 , we choose initial data satisfying     (x1 − 0.5)2 + (x2 − 0.75)2 ≤ r     1 if (slotted cylinder)   1 1 2     ∧ (x ≤ 0.475 ∨ x ≥ 0.525 ∨ x ≥ 0.85)       T 1 2 2 2 0 1 − G(x, [0.5, 0.25] ) if (x − 0.5) + (x − 0.25) ≤ r (sharp cone) c (x) =       T 1 1 2 2 2     (1 + cos(πG(x, [0.25, 0.5] )) if (x − 0.25) + (x − 0.5) ≤ r (smooth hump)   4      0  otherwise and zero boundary cD = 0 and right-hand side f = 0. 18 (a) Projected and limited initial data. (b) Linear limiter, no lumped time-derivative. (c) Hier. vert.-based lim., no lumped time-derivative. (d) Linear limiter, lumped time derivative. (e) Hier. vert.-based limiter, lumped time derivative. (f) Strict limiter, lumped time derivative. Figure 4: Visualization of the DG solutions with p = 2 at end time tend = 2π. First, we would like to emphasize the huge improvement of the solution when applying Kuzmin’s selectively lumped time-stepping scheme (cf. Sec. 3.5), which reduces numerical diffusion and peak clipping, as visible in the intersection lines in Fig. 5 and the 3D visualization (Figs. 4b–4e) and results in a smaller error (see Tab. 3). Without this technique, the implicit coupling of the derivatives renders the higher order limiter inferior to the linear limiter. 19 1 0.8 y = 0.25 yy==0.75 0.75 The results for the different slope limiters (see Fig. 4d–4f) when applying the lumped time-stepping scheme are similar with all limiters producing errors in the same range (see Tab. 3). The linear vertex based limiter exhibits significantly stronger peak clipping than the higher order limiters in the intersection lines of Fig. 6. When looking at the slotted cylinder the strict limiter outperforms the others, producing less fill-in in the slot and better preserving the shape of the cylinder. Also, the total error is lowest for the strict limiter. 0.6 11 x = 0.5 1 0.4 0.8 0.8 y = 0.75 y = 0.25 0.8 1 0.6 0.6 x = 0.25 0.4 0.4 0.2 0.21 0.2 0 0 0.6 0.6 0.4 0.4 0 0.2 0.4 0.6 x = 0.25 0.8 1 0 0.5 1 0.4 0.8 0.8 0 0.3 0.6 0.2 0.4 0.1 0.2 0 0.6 x = 0.5 0.8 0 initial 0 0.2 0.4 linear non-lumped 0.6 0.8 0.2 1 linear lumped 0.2 0 0 0.2 0.4 0.6 x = 0.5 0.4 0.4 0.6 hier. vert. based non-lump. 0.8 0.8 1 1 0.6 0.8 hier. vert. based lump. 0.2 0.2 Figure 5: Intersection lines of the DG solution with p = 2 at end time tend = 2π with and without the selectively lumped time-derivative, as described in Section. 3.5. The large deviation of the solutions from the initial data in the lower right plot are due to fill-in of the slot in the cylinder. 0.4 For polynomial degrees p ≥ 2 the solution might still violate the bounds along the edges when using only control points in the vertices of the element for the slope limiting procedure. When evaluating the numerical fluxes, these values are transported to the neighboring elements and can lead to cell averages lying outside of the initial bounds in the next time step. Table 3 shows that all limiter types suffer from this, however these small violations of the bounds usually smooth out over time due to the effects of numerical diffusion and do not introduce numerical problems. The linear limiter is the only that preserves the upper bound but comes at the price of stronger peak-clipping. To effectively restrict the solution to these bounds for p = 2, additional control points on the edges are necessary, which leads to a significant increase in numerical diffusion, hence this is not a suitable technique. 00 0 0.2 0.2 00 5. Register of Routines 0.4 0.6 0.8 0.2 0.2 0.4 0.4 0.6 0.6 1 0.8 0.8 We list here all routines of our implementation that were added since the first paper [3] in alphabetic order. For the reason of compactness, we waive the check for correct function arguments, e. g., by means of routines as assert. However, it is strongly recommended to catch exceptions if the code is to be extended. The argument g is always 0.2 0 0 0.4 0.2 0 0.4 0.6 20 0.2 0.6 0.8 0.4 0.8 1 0.6 1 0. y = 0.25 yy==0.75 0.75 0.6 y = 0.75 y = 0.25 11 1 0.4 1 x = 0.5 0.8 0.6 0.6 x = 0.25 0.4 0.8 0.8 0.4 0.2 0.21 0.2 0 0 0.6 0.6 0 0.2 0.4 0.6 x = 0.25 0.8 1 0 0.5 1 0.4 0 0.8 0.8 0.3 0.6 0.2 0.4 0.1 0.2 0.4 0.4 0 0 0.6 x = 0.5 0.8 0 0.2 0.2 0.4 0.6 0.8 initial linear 0.4 0.6 x = 0.5 0.8 1 0.4 0 0 1 0.2 0.2 hier. vert. based 0.4 0.6 0.6 0.8 0.8 1 strict Figure 6: Intersection lines of the DG solution with p = 2 at end time tend = 2π when applying the lumped timestepping scheme (cf. Sec. 3.5). Compared are solutions with the different limiters described in Section 3. 0.2 0.2 0.4 0 mink ch (xkc ) mink,i ch (xki ) mink, j ch (xe,k j ) maxk ch (xkc ) maxk,i ch (xki ) maxk, j ch (xe,k j ) kch (0) − c0 kL2 (Ω) kch (tend ) − c0 kL2 (Ω) linear non-lumped hier. vertex-based 0.00 –2.93e–2 –3.32e–8 1.00000 1.00000 1.00000 3.73e–2 8.18e–2 –1.11e–5 –2.47e–2 –4.28e–3 1.00000 1.00915 1.00014 3.66e–2 1.15e–1 linear lumped hier. vertex-based strict –3.95e–10 –9.53e–3 –1.18e–7 1.00000 1.00000 1.00000 3.73e–2 7.38e–2 –6.18e–5 –9.69e–3 –4.28e–3 1.00000 1.01760 1.00297 3.66e–2 7.40e–2 –6.42e–4 –9.79e–16 –5.35e–3 1.00142 1.00000 1.00296 3.66e–2 7.07e–2 00 0.2 0.4 0.2 0.6 0.8 1 00 0.2 0.2 0.4 0.4 0.6 0.6 0.8 0.8 Table 3: Minimum and maximum values in centroids xkc , nodes xki , and edge midpoints xe,k j with p = 2 over the entire simulation time J = (0, 2π). Two last rows give the L2 -errors of the slope-limited projection of initial data and the end solution when compared to the analytical initial data. 0 0.4 a struct representing the triangulation Th , the argument N is always the number of local basis functions N. A script that demonstrates the application of the presented routines is given in mainAdvection.m. Additionally, we recommend using Laurent Sorbers slightly faster implementation of the Kronecker product [25] for sparse matrices from MATLAB File Exchange1 to speed up the computation. Note that this implementation is only suitable for logical and double matrices. 0.2 0 0 0.4 0.6 0.2 0.6 1 http://www.mathworks.com/matlabcentral/fileexchange/ 0.2 21 0.8 0.4 0.8 1 0.6 1 0. dataDisc = applySlopeLimiterDisc(g, dataDisc, markV0TbdrD, dataV0T, globM, globMDiscTaylor, type) implements the slope limiting operator Φ, as given in Eq. (29) with the chosen limiter type given as a string in type. Parameter dataDisc is the representation matrix in modal DG basis, markV0TbdrD is a logical matrix marking all Dirichlet boundary nodes for which boundary data is given in dataV0T. function dataDisc = a p p l y S l o p e L i m i t e r D i s c(g , dataDisc , markV0TbdrD , dataV0T , globM , globMDiscTaylor , type ) d a t a T a y l o r = p r o j e c t D a t a D i s c 2 D a t a T a y l o r( dataDisc , globM , g l o b M D i s c T a y l o r) ; d a t a T a y l o r = a p p l y S l o p e L i m i t e r T a y l o r(g , dataTaylor , markV0TbdrD , dataV0T , type ) ; dataDisc = p r o j e c t D a t a T a y l o r 2 D a t a D i s c( dataTaylor , globM , g l o b M D i s c T a y l o r) ; end dataTaylor = applySlopeLimiterTaylor(g, dataTaylor, markV0TbdrD, dataV0T, type) implements the slope limiting operator ΦTaylor , as described in Sec. 3.5. Parameter dataTaylor is the representation matrix in Taylor basis, the other parameters are the same as for applySlopeLimiterDisc . function d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r(g , dataTaylor , markV0TbdrD , dataV0T , type ) switch type case ' linear ' d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r L i n e a r(g , dataTaylor , markV0TbdrD , dataV0T ) ; case ' h i e r a r c h _ v e r t' d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r H i e r a r c h i c a l V e r t e x(g , dataTaylor , markV0TbdrD , dataV0T ) ; case ' strict ' d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r S t r i c t(g , dataTaylor , markV0TbdrD , dataV0T ) ; otherwise error ( ' Unknown limiter type ') ; end end dataTaylorLim = applySlopeLimiterTaylorHierarchicalVertex(g, dataTaylor, markV0TbdrD, dataV0T) applies the hierarchical vertex-based limiter as described in Sec. 3.3, with input parameters as for applySlopeLimiterTaylor . function d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r H i e r a r c h i c a l V e r t e x(g , dataTaylor , markV0TbdrD , dataV0T ) global g P h i T a y l o r V 0 T [K , N ] = size ( d a t a T a y l o r) ; p = ( sqrt (8* N +1) -3) /2; d a t a T a y l o r L i m = zeros ( size ( d a t a T a y l o r) ) ; d a t a T a y l o r L i m(: , 1) = d a t a T a y l o r(: , 1) ; alpha = zeros (K , 1) ; for ord = p : -1 : 1 alphaOrd = ones ( K , 1) ; indDOF = ord *( ord +1) /2 + 1 : ( ord +1) *( ord +2) /2; for i = 1 : ord mult = bsxfun ( @plus , [ ord - i , i - 1] , m u l t i i n d e x (1) ) ; ind = mult2ind ( mult ) ; valV0T = c o m p u t e F u n c D i s c A t P o i n t s( d a t a T a y l o r(: , ind ) , g P h i T a y l o r V 0 T(: , : , 1:3) ) ; if ord > 1 alphaTmp = c o m p u t e V e r t e x B a s e d L i m i t e r(g , d a t a T a y l o r(: , ind (1) ) , valV0T , markV0TbdrD , valV0T ) ; else alphaTmp = c o m p u t e V e r t e x B a s e d L i m i t e r(g , d a t a T a y l o r(: , ind (1) ) , valV0T , markV0TbdrD , dataV0T ) ; end alphaOrd = min ( alphaOrd , alphaTmp ) ; end alpha = max ( alpha , alphaOrd ) ; d a t a T a y l o r L i m(: , indDOF ) = bsxfun ( @times , alpha , d a t a T a y l o r(: , indDOF ) ) ; end end % f u n c t i o n dataTaylorLim = applySlopeLimiterTaylorLinear(g, dataTaylor, markV0TbdrD, dataV0T) applies the linear vertex-based limiter as described in Sec. 3.2, with input parameters as for applySlopeLimiterTaylor . function d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r L i n e a r(g , dataTaylor , markV0TbdrD , dataV0T ) global g P h i T a y l o r V 0 T alphaE = c o m p u t e V e r t e x B a s e d L i m i t e r(g , d a t a T a y l o r(: , 1) , c o m p u t e F u n c D i s c A t P o i n t s( d a t a T a y l o r(: , 1:3) , ֒→g P h i T a y l o r V 0 T(: ,: ,1:3)) , markV0TbdrD , dataV0T ) ; d a t a T a y l o r L i m = [ d a t a T a y l o r(: ,1) , bsxfun ( @times , alphaE , d a t a T a y l o r(: , 2:3) ) , bsxfun ( @times , alphaE == ֒→1 , d a t a T a y l o r(: , 4: end ) ) ]; end % f u n c t i o n 22 dataTaylorLim = applySlopeLimiterTaylorStrict(g,dataTaylor, markV0TbdrD, dataV0T) applies the stricter form of the hierarchical vertex-based limiter as described in Sec. 3.4, with input parameters as for applySlopeLimiterTaylor . function d a t a T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r S t r i c t(g , dataTaylor , markV0TbdrD , dataV0T ) global g P h i T a y l o r V 0 T [K , N ] = size ( d a t a T a y l o r) ; p = ( sqrt (8* N +1) -3) /2; d a t a T a y l o r L i m = d a t a T a y l o r; for ord = p : -1 : 1 alphaOrd = ones ( K , 1) ; indDOF = ord * ( ord + 1) / 2 + 1 : N ; for i = 1 : ord p R e c o n s t r u c t i o n = p - ord + 1; mult = bsxfun ( @plus , [ ord - i , i - 1] , m u l t i i n d e x( p R e c o n s t r u c t i o n) ) ; ind = mult2ind ( mult ) ; valV0T = c o m p u t e F u n c D i s c A t P o i n t s( d a t a T a y l o r L i m(: , ind ) , g P h i T a y l o r V 0 T(: , : , 1 : size ( ind , 1) ) ) ; if ord > 1 alphaTmp = c o m p u t e V e r t e x B a s e d L i m i t e r(g , d a t a T a y l o r L i m(: , ind (1) ) , valV0T , markV0TbdrD , valV0T ) ; else alphaTmp = c o m p u t e V e r t e x B a s e d L i m i t e r(g , d a t a T a y l o r L i m(: , ind (1) ) , valV0T , markV0TbdrD , dataV0T ) ; end alphaOrd = min ( alphaOrd , alphaTmp ) ; end d a t a T a y l o r L i m(: , indDOF ) = bsxfun ( @times , alphaOrd , d a t a T a y l o r L i m(: , indDOF ) ) ; end end % f u n c t i o n ret = assembleMatEdgePhiPhiValUpwind(g, refEdgePhiIntPhiInt, refEdgePhiIntPhiExt, valOnQuad) assem- bles the matrix R according to Sec. 4.3.3, containing edge integrals of products of two basis functions multiplied with for each quadrature point specified values, stored in valOnQuad, and where the upwind-sided value w. r. t. valOnQuad is chosen. The input arguments refEdgePhiIntPhiInt and refEdgePhiIntPhiExt provide the local matrices R̂diag and R̂offdiag (multidimensional arrays), respectively. function ret = a s s e m b l e M a t E d g e P h i P h i V a l U p w i n d(g , r e f E d g e P h i I n t P h iI nt O nQ ua d , r e f E d g e P h i I n t P h i Ex tO n Qu ad , ֒→v a l O n Q u a d) K = g . numT ; N = size ( r e f E d g e P h i I n t P h i In t On Qu a d , 1) ; ret = sparse ( K *N , K * N ) ; p = ( sqrt (8* N +1) -3) /2; qOrd = 2* p +1; [~ , W ] = q u a d R u l e 1 D( qOrd ) ; for nn = 1 : 3 Rkn = g . areaE0T (: , nn ) ; for r = 1 : length ( W ) % D i a g o n a l b l o c k s ret = ret + kron ( spdiags ( W ( r ) .* Rkn .* v a l O n Q u a d(: , nn , r ) .* ( v a l O n Q u a d(: , nn , r ) > 0) , 0 , K , K ) , ֒→r e f E d g e P h i I n t P h i I n t O n Q u a d(: , : , nn , r ) ) ; end for np = 1 : 3 % Off - d i a g o n a l b l o c k s R k n T i m e s V a l = sparse ( K *N , N ) ; for r = 1 : length ( W ) R k n T i m e s V a l = R k n T i m e s V a l + kron ( W ( r ) .* Rkn .* v a l O n Q u a d(: , nn , r ) .* sparse ( v a l O n Q u a d(: , nn , r ) ֒→< 0) , r e f E d g e P h i I n t P h i E x t O n Q u a d(: , : , nn , np , r ) ) ; end ret = ret + kronVec ( g . m a r k E 0 T E 0 T{ nn , np } , R k n T i m e s V a l) ; end % for end % for end % f u n c t i o n assembles two matrices, each containing integrals of products of a basis function with a (spatial) derivative of a basis function and with a component of a discontinuous coefficient function whose coefficients are specified in dataDisc1 and dataDisc2, respectively. The matrices are returned in a 2 × 1 cell variable. This corresponds to the matrices Gm , m ∈ {1, 2} according to Sec. 4.3.2. The input argument refElemDphiPhiPhi stores the local matrices Ĝ (multidimensional array) as defined in (37) and can be computed by integrateRefElemDphiPhiPhi [3]. The coefficients of the projection of the algebraic diffusion coefficient d into the broken polynomial space are stored in the input arguments dataDisc1 and dataDisc2 and can be computed by projectFuncCont2dataDisc . ret = assembleMatElemDphiPhiFuncDiscVec(g, refElemDphiPhiPhi, dataDisc1, dataDisc2) function ret = a s s e m b l e M a t E l e m D p h i P h i F u n c D i s c V e c(g , r e f E l e m D p h iPh iP hi , dataDisc1 , d a t a D i s c 2) [K , N ] = size ( d a t a D i s c 1) ; ret = cell (2 , 1) ; ret {1} = sparse ( K *N , K * N ) ; ret {2} = sparse ( K *N , K * N ) ; for l = 1 : N ret {1} = ret {1} + kron ( spdiags ( d a t a D i s c 1(: , l ) .* g . B (: ,2 ,2) , 0 ,K , K ) , r e f E l e m D p h i P h i P h i(: ,: ,l ,1) ) ... 23 - kron ( spdiags ( d a t a D i s c 1(: , l ) .* g . B (: ,2 ,1) , 0 ,K , K ) , r e f E l e m D p h i P h i P h i(: ,: ,l ,2) ) ; ret {2} = ret {2} - kron ( spdiags ( d a t a D i s c 2(: , l ) .* g . B (: ,1 ,2) , 0 ,K , K ) , r e f E l e m D p h i P h i P h i(: ,: ,l ,1) ) ... + kron ( spdiags ( d a t a D i s c 2(: , l ) .* g . B (: ,1 ,1) , 0 ,K , K ) , r e f E l e m D p h i P h i P h i(: ,: ,l ,2) ) ; end % for end % f u n c t i o n ret = assembleMatElemPhiDiscPhiTaylor(g, N) assembles the matrix MDG,Taylor according to Sec. 3.1, which cor- responds to the basis transformation matrix with one basis function from each, modal and Taylor basis. It is required for the transformation between modal and Taylor basis in the routines projectDataDisc2DataTaylor and projectDataTaylor2DataDisc . function ret = a s s e m b l e M a t E l e m P h i D i s c P h i T a y l o r(g , N ) global gPhi2D p = ( sqrt (8* N +1) -3) /2; qOrd = max (2* p +1 , 1) ; [ Q1 , Q2 , W ] = q u a d R u l e 2 D( qOrd ) ; K = g . numT ; ret = sparse ( K *N , K * N ) ; for i = 1 : N for j = 1 : N i n t P h i I P h i J = ( repmat ( gPhi2D { qOrd }(: , i ) ', [ K 1]) .* p h i T a y l o r R e f(g , j , Q1 , Q2 ) ) * W '; ret = ret + sparse ( i : N : K *N , j : N : K *N , 2 * g . areaT .* intPhiIPhiJ , K *N , K * N ) ; end % for end % for end % f u n c t i o n ret = assembleMatElemPhiTaylorPhiTaylor(g, N) assembles the mass matrix in Taylor basis MTaylor . function ret = a s s e m b l e M a t E l e m P h i T a y l o r P h i T a y l o r(g , N ) p = ( sqrt (8* N +1) -3) /2; qOrd = max (2*p , 1) ; [ Q1 , Q2 , W ] = q u a d R u l e 2 D( qOrd ) ; K = g . numT ; ret = sparse ( K *N , K * N ) ; for i = 1 : N for j = 1 : N i n t P h i I P h i J = ( p h i T a y l o r R e f(g , i , Q1 , Q2 ) .* p h i T a y l o r R e f(g , j , Q1 , Q2 ) ) * W '; ret = ret + sparse ( i : N : K *N , j : N : K *N , 2 * g . areaT .* intPhiIPhiJ , K *N , K * N ) ; end % for end % for end % f u n c t i o n ret = assembleVecEdgePhiIntFuncContVal(g, markE0Tbdr, funcCont, valOnQuad, N) assembles a vector con- taining integrals of products of a basis function with a continuous function and a given value that is provided in each quadrature point on each edge for all triangles. This corresponds to the contributions of Dirichlet boundaries KD to the right-hand side of (4) according to Sec. 4.3.4. markE0Tbdr marks the boundary edges on which the vector should be assembled, funcCont is a function handle and valOnQuad is the value provided in each quadrature point, as computed by computeFuncContNuOnQuadEdge . function ret = a s s e m b l e V e c E d g e P h i I n t F u n c C o n t V a l(g , markE0Tbdr , funcCont , valOnQuad , N ) global gPhi1D K = g . numT ; p = ( sqrt (8* N +1) -3) /2; qOrd = 2* p +1; [Q , W ] = q u a d R u l e 1 D( qOrd ) ; Q2X1 = @ ( X1 , X2 ) g . B (: ,1 ,1) * X1 + g . B (: ,1 ,2) * X2 + g . coordV0T (: ,1 ,1) * ones ( size ( X1 ) ) ; Q2X2 = @ ( X1 , X2 ) g . B (: ,2 ,1) * X1 + g . B (: ,2 ,2) * X2 + g . coordV0T (: ,1 ,2) * ones ( size ( X1 ) ) ; ret = zeros (K , N ) ; for n = 1 : 3 [ Q1 , Q2 ] = gammaMap (n , Q ) ; f u n c O n Q u a d = funcCont ( Q2X1 ( Q1 , Q2 ) , Q2X2 ( Q1 , Q2 ) ) ; Kkn = m a r k E 0 T b d r(: , n ) .* g . areaE0T (: , n ) ; for i = 1 : N integral = ( f u n c O n Q u a d .* squeeze (( v a l O n Q u a d(: , n , :) < 0) .* v a l O n Q u a d(: , n , :) ) ) * ( W ' .* gPhi1D { ֒→qOrd }(: , i , n ) ) ; ret (: , i ) = ret (: , i ) + Kkn .* integral ; end % for end % for ret = reshape ( ret ' , K *N ,1) ; end % f u n c t i o n ret = computeFuncContNuOnQuadEdge(g, funcCont1, funcCont2, qOrd) assembles a three-dimensional array with the normal velocity u · νki evaluated in all quadrature points of all edges of each triangle. function ret = c o m p u t e F u n c C o n t N u O n Q u a d E d g e(g , funcCont1 , funcCont2 , qOrd ) K = g . numT ; [Q , W ] = q u a d R u l e 1 D( qOrd ) ; 24 ret = zeros (K , 3 , length ( W ) ) ; for n = 1 : 3 [ Q1 , Q2 ] = gammaMap (n , Q ) ; ret (: ,n ,:) = bsxfun ( @times , g . nuE0T (: , n ,1) , f u n c C o n t 1( g . m a p R e f 2 P h y(1 , Q1 , Q2 ) ,g . m a p R e f 2 P h y(2 , Q1 , Q2 ) ) ) +... bsxfun ( @times , g . nuE0T (: , n ,2) , f u n c C o n t 2( g . m a p R e f 2 P h y(1 , Q1 , Q2 ) ,g . m a p R e f 2 P h y(2 , Q1 , Q2 ) ) ) ; end % for end valV0T = computeFuncContV0T(g, funcCont) assembles a matrix containing the function funcCont evaluated in each node of each triangle. function valV0T = c o m p u t e F u n c C o n t V 0 T(g , funcCont ) valV0T = zeros ( g . numT ,3) ; for n = 1 : 3 valV0T (: , n ) = funcCont ( g . coordV0T (: , n , 1) , g . coordV0T (: , n , 2) ) ; end end ret = computeFuncDiscAtPoints(funcDisc, phiAtPoints) assembles a matrix containing the values of a discrete function with representation matrix stored in funcDisc evaluated in all points, for which the evaluated basis functions are given in phiAtPoints. function ret = c o m p u t e F u n c D i s c A t P o i n t s( funcDisc , p h i A t P o i n t s) nPoints = size ( phiAtPoints , 2) ; K = size ( funcDisc , 1) ; ret = zeros (K , nPoints ) ; for i = 1 : nPoints ret (: , i ) = sum ( funcDisc .* squeeze ( p h i A t P o i n t s(: , i , :) ) , 2) ; end % for end % f u n c t i o n minMaxV0T = computeMinMaxV0TElementPatch(g, valCentroid, markV0TbdrD, dataV0T) determines a matrix min with bounds cmax ki , cki of Eq. (22) for each vertex of each triangle, as required by computeVertexBasedLimiter . function m i n M a x V 0 T = c o m p u t e M i n M a x V 0 T E l e m e n t P a t c h(g , valCentroid , markV0TbdrD , dataV0T ) m i n M a x V 0 T = cell (2 ,1) ; m i n M a x V 0 T{1} = zeros ( g . numT , 3) ; m i n M a x V 0 T{2} = zeros ( g . numT , 3) ; s h i f t C e n t r o i d P o s = abs ( min ( v a l C e n t r o i d) ) + 1; s h i f t C e n t r o i d N e g = abs ( max ( v a l C e n t r o i d) ) + 1; v a l C e n t r o i d P o s = v a l C e n t r o i d + s h i f t C e n t r o i d P o s; v a l C e n t r o i d N e g = v a l C e n t r o i d - s h i f t C e n t r o i d N e g; valD = NaN ( g . numT , 3) ; valD ( m a r k V 0 T b d r D) = dataV0T ( m a r k V 0 T b d r D) ; for i = 1 : 3 m a r k N b V 0 T = g . m a r k V 0 T V 0 T{i , 1} | g . m a r k V 0 T V 0 T{i , 2} | g . m a r k V 0 T V 0 T{i , 3}; if exist ( ' O C T A V E _ V E R S I O N' , ' builtin ') m a r k N b V 0 T = m a r k N b V 0 T + 0 * speye ( size ( markNbV0T , 1) , size ( markNbV0T , 2) ) ; end m i n M a x V 0 T {1}(: , i ) = min ( min ( bsxfun ( @times , markNbV0T , valCentroidNeg ') ,[] ,2) + shiftCentroidNeg , valD (: , i ) ) ; m i n M a x V 0 T {2}(: , i ) = max ( max ( bsxfun ( @times , markNbV0T , valCentroidPos ') ,[] ,2) - shiftCentroidPos , valD (: , i ) ) ; end % for end % f u n c t i o n computeTaylorBasesV0T(g, N) evaluates the Taylor basis functions Φk j in all vertices of all triangles xki and stores them in a global multidimensional array. function c o m p u t e T a y l o r B a s e s V 0 T(g , N ) global g P h i T a y l o r V 0 T g P h i T a y l o r V 0 T = zeros ( g . numT , 3 , N ) ; for n = 1 : 3 for i = 1 : N g P h i T a y l o r V 0 T(: , n , i ) = p h i T a y l o r P h y(g , i , g . coordV0T (: , n , 1) , g . coordV0T (: , n , 2) ) ; end end end alphaE = computeVertexBasedLimiter(g, valCentroid, valV0T, markV0TbdrD, dataV0T) computes a vector with correction factors αke (cf. Eq. (23)) for all elements. Centroid values ckc are given in valCentroid , values of the unconstrained reconstruction cki are specified in valV0T and markV0TbdrD is a logical matrix marking all Dirichlet boundary nodes for which boundary data is given in dataV0T. 25 function alphaE = c o m p u t e V e r t e x B a s e d L i m i t e r(g , valCentroid , valV0T , markV0TbdrD , dataV0T ) m i n M a x V 0 T = c o m p u t e M i n M a x V 0 T E l e m e n t P a t c h(g , valCentroid , markV0TbdrD , dataV0T ) ; d i f f V 0 T C e n t r o i d = valV0T - repmat ( valCentroid , [1 3]) ; d i f f M i n C e n t r o i d = m i n M a x V 0 T {1} - repmat ( valCentroid , [1 3]) ; d i f f M a x C e n t r o i d = m i n M a x V 0 T {2} - repmat ( valCentroid , [1 3]) ; tol = 1. e -8; markNeg = d i f f V 0 T C e n t r o i d < d i f f M i n C e n t r o i d + tol ; markPos = d i f f V 0 T C e n t r o i d > d i f f M a x C e n t r o i d - tol ; a l p h a E V 0 T = ones ( g . numT ,3) ; a l p h a E V 0 T( markNeg ) = max (0 , min (1 , d i f f M i n C e n t r o i d( markNeg ) ./ ( d i f f V 0 T C e n t r o i d( markNeg ) - tol ) ) ) ; a l p h a E V 0 T( markPos ) = max (0 , min (1 , d i f f M a x C e n t r o i d( markPos ) ./ ( d i f f V 0 T C e n t r o i d( markPos ) + tol ) ) ) ; alphaE = min ( alphaEV0T ,[] ,2) ; end % f u n c t i o n ret = integrateRefEdgePhiIntPhiExtPerQuad(N) computes a multidimensional array of functionals in the quadra- ture points on the edges of the reference triangle T̂ that consist of all permutations of two basis functions of which one belongs to a neighboring element that is transformed using ϑ̂. This corresponds to the local matrix R̂offdiag as given in (40). function ret = i n t e g r a t e R e f E d g e P h i I n t P h i E x t P e r Q u a d( N ) global gPhi1D g T h e t a P h i 1 D p = ( sqrt (8* N +1) -3) /2; qOrd = 2* p +1; [~ , W ] = q u a d R u l e 1 D( qOrd ) ; ret = zeros (N ,N ,3 ,3 , length ( W ) ) ; % [ N x N x N x 3 x 3] for nn = 1 : 3 % 3 edges for np = 1 : 3 for i = 1 : N for j = 1 : N ret (i , j , nn , np , :) = gPhi1D { qOrd }(: , i , nn ) .* g T h e t a P h i 1 D{ qOrd }(: , j , nn , np ) ; end % for end % for end % for end % for end ret = integrateRefEdgePhiIntPhiIntPerQuad(N) computes a multidimensional array of functionals in the quadra- ture points on the edges of the reference triangle T̂ that consist of all permutations of two basis functions. This corresponds to the local matrix R̂diag as given in (38). function ret = i n t e g r a t e R e f E d g e P h i I n t P h i I n t P e r Q u a d( N ) global gPhi1D p = ( sqrt (8* N +1) -3) /2; qOrd = max (2* p +1 ,1) ; [~ , W ] = q u a d R u l e 1 D( qOrd ) ; ret = zeros (N , N , 3 , length ( W ) ) ; % [ N x N x 3 x R ] for n = 1 : 3 % 3 edges for i = 1 : N for j = 1 : N ret (i ,j ,n ,:) = gPhi1D { qOrd }(: , i , n ) .* gPhi1D { qOrd }(: , j , n ) ; end % for end % for end % for end % f u n c t i o n K = kronVec(A,B) computes the result of Rmb ×na nb ∋ K = A ⊗V B as given in Eq. (41). function K = kronVec (A , B ) [ ma , na ] = size ( A ) ; [ mb , nb ] = size ( B ) ; mc = mb / ma ; if ~ issparse ( A ) && ~ issparse ( B ) % Both i n p u t s full , r e s u l t is full . A = reshape (A , [1 ma 1 na ]) ; B = reshape (B , [ mc ma nb 1]) ; K = reshape ( bsxfun ( @times , A , B ) , [ mb na * nb ]) ; else [ i2 , j2 , v2 ] = find ( kron (A , ones ( mc , 1) ) ) ; ik = repmat ( i2 , [1 nb ]) ; jk = bsxfun ( @plus , nb * ( j2 - 1) , 1 : nb ) ; sk = bsxfun ( @times , v2 , B ( i2 , :) ) ; K = sparse ( ik , jk , sk , mb , na * nb ) ; end % if end % f u n c t i o n 26 mainAdvection.m This is the main script to solve (1) which can be used as a template for further modifications. Modifiable parameters are found in Lines 5–16, the problem data (initial condition, velocity, right-hand side and boundary data) is specified in Lines 35–42. function m a i n A d v e c t i o n() more off % d i s a b l e p a g i n g of o u t p u t tic % Start time m e a s u r e m e n t % % P a r a m e t e r s. hmax = 2^ -6; % m a x i m u m edge l e n g t h of t r i a n g l e p = 2; % local p o l y n o m i a l d e g r e e ordRK = min ( p +1 ,3) ; % order of Runge Kutta time s t e p p e r. tEnd = 2* pi ; % end time numSteps = 3142; % n u m b e r of time steps isVisGrid = false ; % v i s u a l i z a t i o n of grid isVisSol = true ; % v i s u a l i z a t i o n of s o l u t i o n i s S l o p e L i m = true ; % slope l i m i t i n g t y p e S l o p e L i m = ' h i e r a r c h _ v e r t'; % Type of slope l i m i t e r ( linear , h i e r a r c h_ver t , s t r i c t) o u t p u t F r e q u e n c y = 100; % no v i s u a l i z a t i o n of every t i m e s t e p o u t p u t B a s e n a m e = [ ' s o l u t i o n _' t y p e S l o p e L i m]; % B a s e n a m e of o u t p u t files outputTypes = cellstr ([ ' vtk '; ' tec ' ]) ; % % P a r a m e t e r check . diary ([ o u t p u t B a s e n a m e '. log ' ]) assert ( p >= 0 && p <= 4 , ' P o l y n o m i a l order must be zero to four . ' ) assert ( ordRK >= 1 && ordRK <= 3 , ' Order of Runge Kutta must be zero to three . ') assert ( hmax > 0 , ' Maximum edge length must be positive . ' ) assert ( numSteps > 0 , ' Number of time steps must be positive . ' ) assert (~ i s S l o p e L i m || p > 0 , ' Slope limiting only a v a i l a b l e for p > 0. ' ) % % T r i a n g u l a t i o n. g = d o m a i n S q u a r e( hmax ) ; % A l t e r n a t i v e: g = d o m a i n P o l y g o n([0 1 1 0] , [0 0 1 1] , hmax ) ; if isVisGrid , v i s u a l i z e G r i d( g ) ; end % % G l o b a l l y c o n s t a n t p a r a m e t e r s. K = g . numT ; % n u m b e r of t r i a n g l e s N = nchoosek ( p + 2 , p ) ; % n u m b e r of local DOFs tau = tEnd / numSteps ; % time step size m a r k E 0 T i n t = g . idE0T == 0; % [ K x 3] mark local edges that are i n t e r i o r m a r k E 0 T b d r D = ~ m a r k E 0 T i n t; % [ K x 3] mark local edges on the D i r i c h l e t b o u n d a r y m a r k V 0 T b d r D = ismember ( g . V0T , g . V0E ( g . E0T ( m a r k E 0 T b d r D) ,:) ) ; % [ K x 3] mark v e r t i c e s on D i r i c h l e t bdr % % C o e f f i c i e n t s and b o u n d a r y data ( LeVeque ' s solid body r o t a t i o n) . G = @ ( x1 , x2 , x1_0 , x2_0 ) (1/0.15) * sqrt (( x1 - x1_0 ) .^2 + ( x2 - x2_0 ) .^2) ; c0Cont = @ ( x1 , x2 ) (( x1 -0.5) .^2+( x2 -0.75) .^2 <= 0.0225 & ( x1 <=0.475| x1 >=0.525| x2 >=0.85) ) + ... (1 - G ( x1 , x2 , 0.5 , 0.25) ) .* (( x1 - 0.5) .^2 + ( x2 - 0.25) .^2 <= 0.0225) + ... 0.25*(1+ cos ( pi * G ( x1 , x2 , 0.25 , 0.5) ) ) .*(( x1 - 0.25) .^2 + ( x2 - 0.5) .^2 <= 0.0225) ; fCont = @ (t , x1 , x2 ) zeros ( size ( x1 ) ) ; u1Cont = @ (t , x1 , x2 ) 0.5 - x2 ; u2Cont = @ (t , x1 , x2 ) x1 - 0.5; cDCont = @ (t , x1 , x2 ) zeros ( size ( x1 ) ) ; % % L o o k u p table for basis f u n c t i o n. c o m p u t e B a s e s O n Q u a d( N ) ; if isSlopeLim , c o m p u t e T a y l o r B a s e s V 0 T(g , N ) ; end % % C o m p u t a t i o n of m a t r i c e s on the r e f e r e n c e t r i a n g l e. hatM = i n t e g r a t e R e f E l e m P h i P h i( N ) ; hatG = i n t e g r a t e R e f E l e m D p h i P h i P h i( N ) ; hatRdiagOnQuad = i n t e g r a t e R e f E d g e P h i I n t P h i I n t P e r Q u a d( N ) ; h a t R o f f d i a g O n Q u a d = i n t e g r a t e R e f E d g e P h i I n t P h i E x t P e r Q u a d( N ) ; % % A s s e m b l y of time - i n d e p e n d e n t g l o b a l m a t r i c e s. globM = a s s e m b l e M a t E l e m P h i P h i(g , hatM ) ; if i s S l o p e L i m globMTaylor = a s s e m b l e M a t E l e m P h i T a y l o r P h i T a y l o r(g , N ) ; g l o b M D i s c T a y l o r = a s s e m b l e M a t E l e m P h i D i s c P h i T a y l o r(g , N ) ; globMCorr = spdiags (1./ diag ( g l o b M T a y l o r) , 0 , K *N , K * N ) * g l o b M T a y l o r; end % if % % I n i t i a l data . cDisc = p r o j e c t F u n c C o n t 2 D a t a D i s c(g , c0Cont , 2* p +1 , hatM ) ; if i s S l o p e L i m cDV0T = c o m p u t e F u n c C o n t V 0 T(g , @ ( x1 , x2 ) cDCont (0 , x1 , x2 ) ) ; cDisc = a p p l y S l o p e L i m i t e r D i s c(g , cDisc , markV0TbdrD , cDV0T , globM , globMDiscTaylor , t y p e S l o p e L i m) ; end % if fprintf ( ' L2 error w . r . t . the initial c o n d i t i o n: % g \ n ' , c o m p u t e L 2 E r r o r(g , cDisc , c0Cont , 2* p ) ) ; % % v i s u a l i z a t i o n of i n i t a l c o n d i t i o n. if isVisSol c L a g r a n g e = p r o j e c t D a t a D i s c 2 D a t a L a g r( cDisc ) ; v i s u a l i z e D a t a L a g r(g , cLagrange , ' u_h ' , outputBasename , 0 , o u t p u t T y p e s) end % % Time s t e p p i n g. fprintf ( ' Starting time i n t e g r a t i o n from 0 to % g using time step size % g (% d steps ) .\ n ' , tEnd , tau , ֒→numSteps ) for nStep = 1 : numSteps 27 [t , omega ] = r u n g e K u t t a S S P( ordRK , tau , ( nStep - 1) * tau ) ; cDiscRK = cell ( length ( omega ) +1 , 1) ; cDiscRK {1} = reshape ( cDisc ' , [ K * N 1]) ; % % P e r f o r m Runge - Kutta steps for rkStep = 1 : length ( omega ) % L2 p r o j e c t i o n s of C o n t e b r a i c c o e f f i c i e n t s fDisc = p r o j e c t F u n c C o n t 2 D a t a D i s c(g , @ ( x1 , x2 ) fCont ( t ( rkStep ) ,x1 , x2 ) , 2* p , hatM ) ; u1Disc = p r o j e c t F u n c C o n t 2 D a t a D i s c(g , @ ( x1 , x2 ) u1Cont ( t ( rkStep ) ,x1 , x2 ) , 2* p , hatM ) ; u2Disc = p r o j e c t F u n c C o n t 2 D a t a D i s c(g , @ ( x1 , x2 ) u2Cont ( t ( rkStep ) ,x1 , x2 ) , 2* p , hatM ) ; % E v a l u a t e n o r m a l v e l o c i t y in q u a d r a t u r e p o i n t s of edges v N o r m a l O n Q u a d E d g e = c o m p u t e F u n c C o n t N u O n Q u a d E d g e(g , @ ( x1 , x2 ) u1Cont ( t ( rkStep ) ,x1 , x2 ) , @ ( x1 , x2 ) u2Cont ֒→( t ( rkStep ) ,x1 , x2 ) , 2* p +1) ; % veloc \ dot \ nu on q u a d r a t u r p o i n t s on edges % A s s e m b l y of time - d e p e n d e n t g l o b a l m a t r i c e s globG = a s s e m b l e M a t E l e m D p h i P h i F u n c D i s c V e c(g , hatG , u1Disc , u2Disc ) ; globR = a s s e m b l e M a t E d g e P h i P h i V a l U p w i n d(g , hatRdiagOnQuad , h a t R o f f d i a g OnQ ua d , v N o r m a l O n Q u a d E d g e) ; % A s s e m b l y of D i r i c h l e t b o u n d a r y c o n t r i b u t i o n s globKD = a s s e m b l e V e c E d g e P h i I n t F u n c C o n t V a l(g , markE0TbdrD , @ ( x1 , x2 ) cDCont ( t ( rkStep ) ,x1 , x2 ) , ֒→v N o r m a l O n Q ua dEd ge , N ) ; % A s s e m b l y of the s o u r c e c o n t r i b u t i o n globL = globM * reshape ( fDisc ' , K *N , 1) ; % B u i l d i n g the s y s t e m sysA = - globG {1} - globG {2} + globR ; sysV = globL - globKD ; % C o m p u t i n g the d i s c r e t e time d e r i v a t i v e cDiscDot = globM \ ( sysV - sysA * cDiscRK { rkStep }) ; % Apply slope l i m i t i n g to time d e r i v a t i v e if i s S l o p e L i m c D i s c D o t T a y l o r = p r o j e c t D a t a D i s c 2 D a t a T a y l o r( reshape ( cDiscDot , [ N K ]) ', globM , g l o b M D i s c T a y l o r) ; c D i s c D o t T a y l o r L i m = a p p l y S l o p e L i m i t e r T a y l o r(g , cDiscDotTaylor , markV0TbdrD , NaN (K ,3) , t y p e S l o p e L i m) ; c D i s c D o t T a y l o r = reshape ( c D i s c D o t T a ylo rL im ' , [ K * N 1]) + g l o b M C o r r * reshape (( c D i s c D o t T a y l o r ֒→c D i s c D o t T a y l o r L i m) ', [ K * N 1]) ; cDiscDot = reshape ( p r o j e c t D a t a T a y l o r 2 D a t a D i s c( reshape ( cDiscDotTaylor , [ N K ]) ', globM , ֒→g l o b M D i s c T a y l o r) ', [ K * N 1]) ; end % C o m p u t e next step cDiscRK { rkStep + 1} = omega ( rkStep ) * cDiscRK {1} + (1 - omega ( rkStep ) ) * ( cDiscRK { rkStep } + tau * ֒→cDiscDot ) ; % L i m i t i n g the s o l u t i o n if i s S l o p e L i m cDV0T = c o m p u t e F u n c C o n t V 0 T(g , @ ( x1 , x2 ) cDCont ( t ( rkStep ) , x1 , x2 ) ) ; cDiscRK { rkStep + 1} = reshape ( a p p l y S l o p e L i m i t e r D i s c(g , reshape ( cDiscRK { rkStep + 1} , [ N K ]) ', ֒→markV0TbdrD , cDV0T , globM , globMDiscTaylor , t y p e S l o p e L i m) ', [ K * N 1]) ; end % if end % for cDisc = reshape ( cDiscRK { end } , N , K ) '; %% visualization if isVisSol && mod ( nStep , o u t p u t F r e q u e n c y) == 0 c L a g r a n g e = p r o j e c t D a t a D i s c 2 D a t a L a g r( cDisc ) ; v i s u a l i z e D a t a L a g r(g , cLagrange , ' u_h ' , outputBasename , nStep , o u t p u t T y p e s) ; end end % for if isVisSol c L a g r a n g e = p r o j e c t D a t a D i s c 2 D a t a L a g r( cDisc ) ; v i s u a l i z e D a t a L a g r(g , cLagrange , ' u_h ' , outputBasename , nStep , o u t p u t T y p e s) ; end fprintf ( ' L2 error w . r . t . the initial c o n d i t i o n: % g \ n ' , c o m p u t e L 2 E r r o r(g , cDisc , c0Cont , 2* p ) ) ; fprintf ( ' Total c o m p u t a t i o n time : % g seconds .\ n ' , toc ) ; diary off end % f u n c t i o n ind = mult2ind(a) computes the linear index I(a) corresponding to a two-dimensional multi-index a as defined in (16). function ind = mult2ind ( a ) p = sum (a , 2) ; N = p .* ( p + 1) / 2; ind = N + 1 + a (: , 2) ; end mult = multiindex(p) computes all two-dimensional multi-indices involved in the representation of a polynomial solution of degree p and returns them in a N × 2 array. function mult = m u l t i i n d e x( p ) mult = zeros ( p * ( p +1) / 2 , 2) ; mult (1 ,:) = [0 , 0]; for ord = 1 : p 28 offset = ord * ( ord +1) / 2; for i = 1 : ord + 1 mult ( offset + i , :) = mult (1 , :) + [ ord - i + 1 , i - 1]; end end end ret = phiTaylorPhy(g, i, X1, X2) evaluates the ith basis function φi on each triangle T ∈ Th (cf. Sec. 3.1) at points specified by a list of n x1 coordinates X1 ∈ RK×n and x2 coordinates X2 ∈ RK×n . function ret = p h i T a y l o r P h y(g , i , X1 , X2 ) qOrd = ceil (( sqrt (8* i +1) -3) /2) ; [ Q1 , Q2 , W ] = q u a d R u l e 2 D( qOrd ) ; Q2X1 = @ ( X1 , X2 ) g . B (: , 1 , 1) * X1 + g . B (: , 1 , 2) * X2 + g . coordV0T (: , 1 , 1) * ones ( size ( X1 ) ) ; Q2X2 = @ ( X1 , X2 ) g . B (: , 2 , 1) * X1 + g . B (: , 2 , 2) * X2 + g . coordV0T (: , 1 , 2) * ones ( size ( X1 ) ) ; R = length ( W ) ; K = g . numT ; numP = size ( X1 , 2) ; dX1 = repmat (2 ./ ( max ( g . coordV0T (: ,: ,1) ,[] ,2) - min ( g . coordV0T (: ,: ,1) ,[] ,2) ) , [1 numP ]) ; dX2 = repmat (2 ./ ( max ( g . coordV0T (: ,: ,2) ,[] ,2) - min ( g . coordV0T (: ,: ,2) ,[] ,2) ) , [1 numP ]) ; switch i case 1 % (0 ,0) ret = ones (K , numP ) ; case 2 % (1 ,0) ret = ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) .* dX1 ; case 3 % (0 ,1) ret = ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) .* dX2 ; case 4 % (2 ,0) ret = ( 0.5*( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^2 -... repmat ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^2 * W ' , [1 numP ]) ) .*( dX1 .* dX1 ) ; case 5 % (1 ,1) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) -... repmat ( 2 * ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) ) * W ' , [1 numP ]) ) .*( dX1 .* dX2 ) ; case 6 % (0 ,2) ret = ( 0.5*( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^2 -... repmat ( ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^2 * W ' , [1 numP ]) ) .*( dX2 .* dX2 ) ; case 7 % (3 ,0) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^3 / 6 -... repmat ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^3 * W ' / 3 , [1 numP ]) ) .* dX1 .^3; case 8 % (2 ,1) ret = ( 0.5*( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^2 .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) -... repmat ( ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^2 .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) ) * W ' , [1 numP ]) ) .*( dX1 .^2.* dX2 ) ; case 9 % (1 ,2) ret = ( 0.5*( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^2 -... repmat ( ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^2 ) * W ' , [1 numP ]) ) .*( dX1 .* dX2 .^2) ; case 10 % (0 ,3) ret = ( ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^3 / 6 -... repmat ( ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^3 * W ' / 3 , [1 numP ]) ) .* dX2 .^3; case 11 % (4 ,0) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^4 / 24 -... repmat ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^4 * W ' / 12 , [1 numP ]) ) .* dX1 .^4; case 12 % (3 ,1) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^3 .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) / 6 -... repmat ( ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^3 .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) ) * W ' / 3 , [1 numP ]) ) .*( dX1 .^3.* dX2 ) ; case 13 % (2 ,2) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .^2 .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^2 / 4 -... repmat ( ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .^2 .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^2 ) * W '/2 , [1 numP ]) ) .*( dX1 .* dX2 ) .^2; case 14 % (1 ,3) ret = ( ( X1 - repmat ( g . baryT (: ,1) , [1 numP ]) ) .* ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^3 / 6 -... repmat ( ( ( Q2X1 ( Q1 , Q2 ) - repmat ( g . baryT (: ,1) , [1 R ]) ) .* ... ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^3) * W '/3 , [1 numP ]) ) .*( dX1 .* dX2 .^3) ; case 15 % (0 ,4) ret = ( ( X2 - repmat ( g . baryT (: ,2) , [1 numP ]) ) .^4 / 24 -... repmat ( ( Q2X2 ( Q1 , Q2 ) - repmat ( g . baryT (: ,2) , [1 R ]) ) .^4 * W ' / 12 , [1 numP ]) ) .* dX2 .^4; end % s w i t c h end ret = phiTaylorRef(g, i, hatX1, hatX2) evaluates the ith basis function φi on each triangle T ∈ Th (cf. Sec. 3.1) at points specified by a list of x̂1 coordinates hatX1 and x̂2 coordinates hatX2. function ret = p h i T a y l o r R e f(g , i , hatX1 , hatX2 ) 29 Q2X1 = @ ( X1 , X2 ) g . B (: , 1 , 1) * X1 + g . B (: , 1 , 2) * X2 + g . coordV0T (: , 1 , 1) * ones ( size ( X1 ) ) ; Q2X2 = @ ( X1 , X2 ) g . B (: , 2 , 1) * X1 + g . B (: , 2 , 2) * X2 + g . coordV0T (: , 1 , 2) * ones ( size ( X1 ) ) ; ret = p h i T a y l o r P h y(g , i , Q2X1 ( hatX1 , hatX2 ) , Q2X2 ( hatX1 , hatX2 ) ) ; end dataTaylor = projectDataDisc2DataTaylor(dataDisc, globMDisc, globMDiscTaylor) converts the representa- tion matrix in the DG / modal basis to the respective representation matrix in a Taylor basis, both of size K × N. It solves Eq. (20) for CTaylor . function d a t a T a y l o r = p r o j e c t D a t a D i s c 2 D a t a T a y l o r( dataDisc , globMDisc , g l o b M D i s c T a y l o r) [K , N ] = size ( dataDisc ) ; d a t a T a y l o r = reshape ( g l o b M D i s c T a y l o r \ ( g l o b M D i s c * reshape ( dataDisc ' , [ K * N 1]) ) , [ N K ]) '; end % f u n c t i o n dataDisc = projectDataTaylor2DataDisc(dataTaylor, globMDisc, globMDiscTaylor) converts the representa- tion matrix in the Taylor basis to the respective representation matrix in a DG / modal basis, both of size K × N. It solves Eq. (20) for CDG . function dataDisc = p r o j e c t D a t a T a y l o r 2 D a t a D i s c( dataTaylor , globMDisc , g l o b M D i s c T a y l o r) [K , N ] = size ( d a t a T a y l o r) ; dataDisc = reshape ( g l o b M D i s c \ ( g l o b M D i s c T a y l o r * reshape ( dataTaylor ' , [ K * N 1]) ) , [ N K ]) '; end % f u n c t i o n [t, omega] = rungeKuttaSSP(ord, tau, nStep) provides a list of time levels t(i) = tn + δi ∆tn and weights ωi for the n-th time step nStep with time step size tau according to Sec. 2.4. The order of the Runge-Kutta method is given as parameter ord. function [t , omega ] = r u n g e K u t t a S S P( ord , tau , t0 ) switch ord case 1 omega = 0; t = t0 ; case 2 omega = [0 , 0.5]; t = t0 + [0 , 1] * tau ; case 3 omega = [0 , 3/4 , 1/3]; t = t0 + [0 , 1 , 0.5] * tau ; end end % f u n c t i o n 6. Conclusion and Outlook The second installment in the present paper series on implementing a MATLAB / GNU Octave toolbox introduced performance optimized techniques for dealing with linear advection operators, higher order Runge–Kutta time discretizations, and a range of slope limiters designed to support general order DG discretizations. Our future work plans include nonlinear advection operators and coupled systems of PDEs as well as multi-physics applications with corresponding coupling mechanisms. Acknowledgments The work of B. Reuter was supported by the German Research Foundation (DFG) under grant AI 117/1-1. 30 Index of notation Symbol Definition · R Integral mean, v ≔ |T1 | T v(x) dx, where v : T → R. " # A ≔ , block-diagonal matrix with blocks A, B. diag(A, B) #M a·b ∇ ◦ ⊗ c c0 cD C CTaylor δ[condition] em Ekn , Ên V, E, T EΩ , E∂Ω f Fk h hT J K ν νT νk N = Np ωr Ω, ∂Ω ∂Ωin , ∂Ωout p ϕki , ϕ̂i φki P p (T ) P p (Th ) Φ ΦTaylor q̂r R R+ , R+0 t tn tend ϑ̂n− n+ ∆tn T k , ∂T k T̂ u x x̂ xkc xki B Cardinality of a set M. P ≔ 2m=1 am bm , Euclidean scalar product in R2 . ≔ [∂ x1 , ∂ x2 ]T , spatial gradient in the physical domain Ω. Composition of functions or Hadamard product. Kronecker product. Concentration (scalar-valued unknown). Concentration prescribed at initial time t = 0. Concentration prescribed on the inflow boundary. ∈ RKN , representation vector of ch ∈ P p (Th ) with respect to {ϕk j }. ∈ RKN , representation vector of ch ∈ P p (Th ) with respect to {φk j }. ≔ {1 if condition is true, 0 otherwise}, Kronecker delta. mth unit vector. nth edge of the physical triangle T k , nth edge of the reference triangle T̂ . Sets of vertices, edges, and triangles. Set of interior edges, set of boundary edges. Source / sink (scalar-valued coefficient function). Affine mapping from T̂ to T k . Mesh fineness of Th . ≔ diam(T ), diameter of triangle T ∈ Th . ≔ (0, tend ), open time interval. ≔ #Th , number of triangles. Unit normal on ∂Ω pointing outward of Ω. Unit normal on ∂T pointing outward of T . ≔ νT k . ≔ (p + 1)(p + 2)/2, number of local degrees of freedom of P p (T ). Quadrature weight associated with q̂r . spatial domain in two dimensions, boundary of Ω. inflow√ and outflow boundaries, ∂Ω = ∂Ωin ∪ ∂Ωout . = ( 8N + 1 − 3)/2, polynomial degree. ith hierarchical basis function on T k , ith hierarchical basis function on T̂ . ith Taylor basis function on T k . Space of polynomials on T ∈ Th of degree at most p. ≔ {wh : Ω → R ; ∀T ∈ Th , wh |T ∈ P p (T )}. Slope limiting operator with respect to {ϕk j }. Slope limiting operator with respect to {φk j }. rth quadrature point in T̂ . Number of quadrature points. Set of (strictly) positive real numbers, set of non-negative real numbers. Time variable. nth time level. End time. Mapping from Ên− to Ên+ . ≔ tn+1 − tn , time step size. kth physical triangle, boundary of T k . Bi-unit reference triangle. Velocity (vector-valued coefficient function). T = [x1 , x2 ] , space variable in the physical domain Ω. T 1 2 = [ x̂ , x̂ ] , space variable in the reference triangle T̂ . Centroid of the element T k ∈ Th . ith vertex of the physical triangle T k . References [1] F. Frank, B. Reuter, V. Aizinger, FESTUNG—The Finite Element Simulation Toolbox for UNstructured Grids (2016). doi:10.5281/zenodo.46069. URL http://www.math.fau.de/FESTUNG 31 [2] F. Frank, B. Reuter, FESTUNG: The Finite Element Simulation Toolbox for UNstructured Grids (2016). URL https://github.com/FESTUNG [3] F. Frank, B. Reuter, V. Aizinger, P. Knabner, FESTUNG: A MATLAB / GNU Octave toolbox for the discontinuous Galerkin method, Part I: Diffusion operator, Computers & Mathematics with Applications 70 (1) (2015) 11–46. doi:10.1016/j.camwa.2015.04.013. [4] B. Cockburn, C. Shu, The local discontinuous Galerkin method for time-dependent convection–diffusion systems, SIAM Journal on Numerical Analysis 35 (6) (1998) 2440–2463. doi:10.1137/S0036142997316712. [5] H. Reed, T. R. Hill, Triangular mesh methods for the neutron transport equation, Tech. Rep. LA-UR-73-479, Los Alamos Scientific Laboratory, NM (1973). [6] C. Johnson, J. Pitkranta, An Analysis of the Discontinuous Galerkin Method for a Sacalar Hyperbolic Equation, Mathematics of Computation 46 (173) (1986) 1–26. [7] D. Kuzmin, Slope limiting for discontinuous Galerkin approximations with a possibly non-orthogonal Taylor basis, International Journal for Numerical Methods in Fluids 71 (9) (2013) 1178–1190. doi:10.1002/fld.3707. [8] S. Gottlieb, C.-W. Shu, Strong stability-preserving high-order time discretization methods, Math. Comp. 67 (221) (1998) 73–85. doi:10.1090/S0025-5718-98-00913-2. [9] S. Gottlieb, C.-W. Shu, E. Tadmor, Strong stability-preserving high-order time discretization methods, SIAM Review 43 (1) (2001) 89–112. [10] B. Cockburn, C.-W. Shu, TVB Runge-Kutta local projection discontinuous Galerkin finite element method for conservation laws. II. General framework, Mathematics of computation 52 (186) (1989) 411–435. [11] L. Krivodonova, J. Xin, J.-F. Remacle, N. Chevaugeon, J. E. Flaherty, Shock detection and limiting with discontinuous galerkin methods for hyperbolic conservation laws, Applied Numerical Mathematics 48 (3) (2004) 323–338. [12] S. Tu, S. Aliabadi, A slope limiting procedure in discontinuous galerkin finite element method for gasdynamics applications, International Journal of Numerical Analysis and Modeling 2 (2) (2005) 163–178. [13] C. Michoski, C. Mirabito, C. Dawson, D. Wirasaet, E. Kubatko, J. Westerink, Adaptive hierarchic transformations for dynamically p-enriched slope-limiting over discontinuous galerkin systems of generalized equations, Journal of Computational Physics 230 (22) (2011) 8028 – 8056. doi:10.1016/j.jcp.2011.07.009. [14] M. Yang, Z.-J. Wang, A parameter-free generalized moment limiter for high-order methods on unstructured grids, Adv. Appl. Math. Mech 1 (4) (2009) 451–480. [15] X. Zhang, Y. Xia, C.-W. Shu, Maximum-principle-satisfying and positivity-preserving high order discontinuous Galerkin schemes for conservation laws on triangular meshes, J. Sci. Comput. 50 (1) (2012) 29–62. doi:10.1007/s10915-011-9472-8. [16] D. Kuzmin, A vertex-based hierarchical slope limiter for adaptive discontinuous Galerkin methods, Journal of Computational and Applied Mathematics 233 (12) (2010) 3077–3085, Finite Element Methods in Engineering and Science (FEMTEC 2009). doi:10.1016/j.cam.2009.05.028. [17] M. Yang, Z.-J. Wang, A parameter-free generalized moment limiter for high-order methods on unstructured grids, in: 47th AIAA Aerospace Sciences Meeting Including The New Horizons Forum and Aerospace Exposition, AIAA-2009-605. doi:10.2514/6.2009-605. [18] K. Michalak, C. Ollivier-Gooch, Limiters for unstructured higher-order accurate solutions of the euler equations, in: 46th AIAA Aerospace Sciences Meeting and Exhibit, AIAA-2008-776. doi:10.2514/6.2008-776. [19] H. Luo, J. D. Baum, R. Lhner, A discontinuous Galerkin method based on a Taylor basis for the compressible flows on arbitrary grids, Journal of Computational Physics 227 (20) (2008) 8875 – 8893. doi:10.1016/j.jcp.2008.06.035. [20] V. Aizinger, A geometry independent slope limiter for the discontinuous Galerkin method, in: E. Krause, Y. Shokin, M. Resch, D. Krner, N. Shokina (Eds.), Computational Science and High Performance Computing IV, Vol. 115 of Notes on Numerical Fluid Mechanics and Multidisciplinary Design, Springer Berlin Heidelberg, 2011, pp. 207–217. doi:10.1007/978-3-642-17770-5_16. [21] T. Barth, D. Jespersen, The design and application of upwind schemes on unstructuredmeshes, in: Proc. AIAA 27th Aerospace Sciences Meeting, Reno, 1989. [22] R. Cools, An encyclopaedia of cubature formulas, Journal of Complexity 19 (3) (2003) 445–453. doi:10.1016/S0885-064X(03)00011-6. [23] B. Cockburn, C.-W. Shu, The Runge–Kutta discontinuous Galerkin method for conservation laws V: multidimensional systems, J. Comput. Phys. 141 (2) (1998) 199–224. doi:10.1006/jcph.1998.5892. [24] R. J. Leveque, High-resolution conservative algorithms for advection in incompressible flow, SIAM Journal on Numerical Analysis 33 (2) (1996) 627–665. doi:10.2307/2158391. [25] L. Sorber, Kronecker product, MATLAB Central File Exchange. Retrieved October 30, 2015 (2010). URL http://de.mathworks.com/matlabcentral/fileexchange/28889-kronecker-product 32
5cs.CE
Additive Approximation for Near-Perfect Phylogeny Construction ⋆ arXiv:1206.3334v1 [cs.DS] 14 Jun 2012 Pranjal Awasthi, Avrim Blum, Jamie Morgenstern, and Or Sheffet Carnegie Mellon University, Pittsburgh, 5000 Forbes Ave., Pittsburgh PA 15213, USA, {pawasthi,avrim,jamiemmt,osheffet}@cs.cmu.edu Abstract. We study the problem of constructing phylogenetic trees for a given set of species. The problem is formulated as that of finding a minimum Steiner tree on n points over the Boolean hypercube of dimension d. It is known that an optimal tree can be found in linear time [1] if the given dataset has a perfect phylogeny, i.e. cost of the optimal phylogeny is exactly d. Moreover, if the data has a near-perfect phylogeny, i.e. the cost of the optimal Steiner tree is d + q, it is known [2] that an exact solution can be found in running time which is polynomial in the number of species and d, yet exponential in q. In this work, we give a polynomial-time algorithm (in both d and q) that finds a phylogenetic tree of cost d+O(q 2 ). This provides the best guarantees known—namely, √ a (1 + o(1))-approximation—for the case log(d) ≪ q ≪ d, broadening the range of settings for which near-optimal solutions can be efficiently found. We also discuss the motivation and reasoning for studying such additive approximations. 1 Introduction Phylogenetics, a subfield of computational biology, aims to construct simple and accurate descriptions of evolutionary history. These descriptions are represented as evolutionary trees for a given set of species, each of which is represented by some set of features ([3,4]). A typical choice for these features are single nucleotide polymorphisms (SNPs), binary indicator variables for common mutations found in DNA[5,6]; see, for example, [2,1,7,8,9,10]. This challenging problem has attracted much attention in recent years, with progress in studying various computational formulations of this problem ([3,11,2,1,12,7]). The problem is often posed as that of constructing the most parsimonious tree induced by the set of species. Formally, a phylogeny or a phylogenetic tree for a set C of n species, each represented by a string (called taxa) of length d over a finite alphabet Σ, is an unrooted tree T = (V, E) such that C ⊆ V ⊆ Σ d . Given a distance metric µ over ⋆ This work was supported in part by the National Science Foundation under grant CCF-1116892, by an NSF Graduate Fellowship, and by the MSR-CMU Center for Computational Thinking. P Σ d , we define the cost of T as (u,v)∈E µ(u, v). The tree of maximum parsimony for a dataset is the tree which minimizes this cost with respect to the Hamming metric; i.e., it is the optimum Steiner tree for the set C under this metric. The Steiner tree problem is known to be NP-hard in general [13], and remains NP-hard even in the case of a binary alphabet with the metric induced by the Hamming distance [14]. Extensive recent work, both experimental and theoretical, has focused on the binary character set with the Hamming metric ([3,2,1,12,7,4,15,16]). This version of the phylogeny problem will also be the focus of this paper. A phylogeny is called perfect if each coordinate i ∈ [d] flips exactly once in the tree (representing a single mutation of i amongst the set of species)1 . If a dataset admits a perfect phylogeny, an optimal tree can be constructed in polynomial time [17] (even linear time, in the case where the alphabet is binary [3]). In this work, we investigate near perfect phylogenies – instances whose optimal phylogenetic tree has cost d + q, where q ≪ d. Near perfect phylogenies have been studied in theoretical ([11,2,12,16]) and experimental settings ([15]). The work of [11,2,12,16] has given a series of randomized algorithms which find the optimal phylogeny in running time polynomial in n and d but exponential in q. Clearly, when q = ω(log d), these algorithms are not tractable. An alternative approach for finding a phylogenetic tree of low cost is to use a generic Steiner tree approximation algorithm. The best current such algorithm yields a tree of cost at most 1.39(d+q) [18] (we comment that the exponential size of the explicit hypercube with respect to its small representation size requires one implement such an algorithm using techniques devised especially for the hypercube, e.g. Alon et al. [7].) However, notice that for moderate q (e.g., for q = polylog(d)), the excess of this tree—meaning the difference between its cost and d—may be extremely large compared to the excess q of the optimal tree. In such cases, one would much prefer an algorithm whose excess could be written as a function of q only. In this work, we present a randomized poly(n, d, q)-time algorithm that finds a phylogenetic tree of cost d + O(q 2 ). Theorem 1. Given a set C ⊆ {0, 1}d of n terminals, such that the optimal phylogeny of C has cost d + q, there exists a randomized poly(n, d, q)-time algorithm that finds a phylogenetic tree of cost d + O(q 2 ) w.p. ≥ 1/2. Note that Theorem 1 provides √ a substantial improvement over prior work for the case that log d ≪ q ≪ d. In this range, the exact algorithms are no longer tractable, and the multiplicative approximations yield significantly worse bounds. Alternatively, viewed as a multiplicative guarantee, in this range our tree is within a 1 + o(1) factor of optimal. To the best of our knowledge, this is the first work to give an additive poly-time approximation to either the phylogeny problem or any (non-trivial) setting the Steiner tree problem. One immediate 1 Without loss of generality, we may assume each coordinate flips at least once, since all coordinates on which all species agree may be discarded up front. question, which remains open, is whether our results can be improved to d+o(q 2 ) or perhaps even to d + O(q). The rest of the paper is organized as follows. After surveying related work in Section 1.1, we detail notation and preliminaries in Section 2. The presentation of our algorithm is partitioned into two parts. In Section 3, we present the algorithm for the case where no pair of coordinates is identical over all terminals (formal definition there). In Section 4, we alter the algorithm for the simple case, in a nontrivial way, so that the modified algorithm finds a low-cost phylogeny for any dataset. We conclude in Section 5 with a discussion, motivating the problem of near-perfect phylogeny tree from a different perspective, and present open problems for future research. 1.1 Related Work As mentioned in the introduction, the problem of constructing an optimal phylogeny is NP-complete even when restricted to binary alphabets [14]. Schwartz et al. [11] give an algorithm based on an Integer Linear Programming (ILP) formulation to solve the multi-state problem optimally, and show experimentally the algorithm is efficient on small instances. Perfect phylogenies (datasets which admit a tree in which any coordinate changes exactly once) have optimal parsimony trees which can be constructed in linear time in the binary case [1] and in polynomial time for a fixed alphabet [12]. Unfortunately, finding the perfect phylogeny for arbitrary alphabets is NP-hard [19]. Recent work [2] gives an algorithm to construct optimal phylogenetic trees for binary, near-perfect phylogenies (where only a small number of coordinates mutate more than once in the optimal tree). However, the running time of the algorithm presented in their work [2] is exponential in the number of additional mutations. There has also been a lot of work on computing multiplicative approximations to the Steiner tree problem. A Minimum Spanning Tree (MST) over the set of terminals achieves an approximation ratio of 2 and a long line of work has led to the current best bound of 1.39 [20,21,22,23,24,8,25,9,10,18]. The more recent of these papers use a result due to Borchers and Du [26] showing that an optimal Steiner tree can be approximated to arbitrary precision using k-restricted Steiner trees. Some of these approximations to the Steiner tree problem are not immediately extendable to the problem of constructing phylogenetic trees. This is because the size of the vertex set for the phylogeny problem is exponential in d (there are 2d vertices in the hypercube). If an algorithm works on an explicit representation of the graph G defined by the hypercube, then it does not solve the phylogeny problem in polynomial time. However, the line of work started by Robins and Zelikovsky [9,10] used the notion of k-restricted Steiner trees, which can be efficiently implemented on the hypercube. In particular, Alon et al. [7] showed that in finding the optimal k-restricted component for a given set of k terminals, it is sufficient to only consider topologies with the given k terminals at the leaves. Using this, they were able to extend that work to achieve a 1.55 approximation ratio for the maximum parsimony problem, and a 16/9 approximation for maximum likelihood. Byrka et al. [18] considered a new LP relaxation to the k-restricted Steiner tree problem and achieved an approximation ratio of 1.39, which can be combined with the topological argument from Alon et al. [7] to achieve the same ratio for phylogenies. 2 Notation and Preliminaries Our dataset C ⊆ {0, 1}d consists of n terminals over d binary coordinates. A Steiner tree (or phylogeny) over C consists of a tree T on the hypercube that spans C (plus possibly additional Steiner nodes), where we label each edge e in T with the index i ∈ {1, . . . , d} of the coordinate flipped on edge e. The cost of such a Steiner tree is the number of edges in the tree. Given a collection of datasets P = {P1 , P2 , . . . , Pk } ⊆ C we define the Steiner forest problem as the problem of finding a minimal Steiner tree on every P ∈ P separately. We refer to such collection as a partition from now on, even though it may contain a subset of the original terminal set C. In this work, we consider instances C whose minimum Steiner tree has cost √ d+q, and think of q = o( d) (otherwise, any off-the-shelf constant approximation algorithm for the Steiner problem gives a solution of cost ≤ d + O(q 2 )). We fix T to be some optimal Steiner tree. By optimality, all leaves in T must be terminals, whereas the internal nodes of T may be either terminals or non-terminals (nonterminals are called Steiner nodes). We define a coordinate i to be good if exactly one edge in T is labeled i, and bad if two or more edges in T are labeled with i. We may assume all d coordinates appear in the tree, otherwise, some coordinates in C are fixed and so the dimensionality of the problem is less than d. Therefore, at most q coordinates are bad (each bad coordinate flips at least twice and thus adds a cost of at least 2 to the tree). Given a coordinate i of a set of terminals P , we define an i-cut as the partition P0 = {x ∈ P : xi = 0} and P1 = {x ∈ P : xi = 1}. We call two coordinates i 6= j interchangeable if they define the same cut. We now present the following basic facts which are easy to verify (see [2] for proofs). Fact 1 1. Let S be a set of interchangeable coordinates. Then all coordinates in S appear together in the optimal tree T , adjacent to one another. That is, in T there are paths s.t. for each path: all of its edges are labeled by some i ∈ S, all coordinates in S have an edge on the path, and all internal nodes on the paths aren’t terminals and have degree 2. On these paths, any reordering the S-labeled edges yields an equivalent optimal tree. 2. For any two good coordinates, i 6= j, one side of the i-cut is contained within one side of the j-cut. Equivalently, there exist values bj such that all terminals on one side of the i-cut have their jth coordinate set to bj . 3. Fix any good coordinate i and let j be a good coordinate such that all terminals on one side of the i-cut have their j coordinate set to bj . Then both endpoints of the edge labeled i have their jth coordinate set to bj . 4. A good coordinate i and a bad coordinate i′ cannot define the same cut. It immediately follows from Fact 1 that for a given good coordinate i one can efficiently reconstruct the endpoints of the edge on which i mutates, except for at most q coordinates. This leads us to the following definition. Given i, we denote Di as the set of all coordinates that are fixed to a constant value vi on at least one side of the i-cut (different coordinates may be fixed on different sides), and we denote bi as the vector of the corresponding values, i.e. vi ’s, of the coordinates in Di . The pair (Di , bi ) is called the pattern of coordinate i. That set of terminals that match the pattern of i is the set Pbi = {x ∈ P : ∀j ∈ Di , xj = bij }. 3 A Simple Case: Each Coordinate Determines a Distinct Cut To show the main ideas behind our algorithm, we first discuss a special case in which no two coordinates i and j define the same cut on the terminal set C. Algorithms for constructing phylogenetic trees often make this assumption as they preprocess C by contracting any pair of interchangeable coordinates. However, in our case such contractions are problematic, as we discuss in the next section. So in Section 4, when we deal with the general case, we deal with interchangeable coordinates in a non-trivial fashion. 3.1 Basic Building Blocks We now turn to the description of our algorithm. On a high level it is motivated by the notion of maintaining a proper partition of the terminals. Definition 1. Call a partition P proper if the forest produced by restricting the optimal tree T to the components P ∈ P is composed of edge disjoint trees. Equivalently, the path in T between two nodes x and y in the same component P of P does not pass through any node x′ in any different component P ′ of P. Clearly, our initial partition, P = {C}, is proper. Our goal is to maintain a proper partition of the current terminals while decreasing the dimensionality of the problem in each step. This is implemented by the two subroutines we now detail. Pluck a Leaf and Paste a Leaf. The first subroutine works by building the optimal phylogeny bottom-up, finding a good coordinate i adjacent to a leaf terminal t in the tree, and replacing t with its parent (t with i flipped) in the set of terminals. Observe that if i is a good coordinate, then this removes the only occurrence of i, leaving all terminals in our new dataset with a fixed i coordinate, thus reducing the dimensionality of the problem by 1. The matching subroutine to Pluck-a-leaf is Paste-a-leaf: if Pluck-a-leaf succeeds and returns some (x, P ′ ), and we have found a Steiner forest for the terminals in P ′ . Then Paste-a-leaf merely connects x with x̄i by an edge labeled i, then returns the resulting forest. (We omit formal description.) Pluck-a-leaf input: A partition P of current terminals. if there exists P ∈ P and x ∈ P s.t. some coordinate i is non-constant on P , but only the terminal x has xi = 0 (or xi = 1), then: – Set P ′ = P \ {x} ∪ {x̄i }, where x̄i is identical to x except for flipping i. – Return x and P ′ = P \ {P } ∪ {P ′ }. else fail. Lemma 1. If P is a proper partition and Pluck-a-leaf succeeds, then P ′ is a proper partition. Proof (Sketch). Let T [P ] be the subtree in which x resides. We claim that x is a leaf in T [P ], attached by an edge labeled i to the rest of the terminals. If this indeed is the case, then removing i means removing a leaf-adjacent edge from T [P ] which clearly leaves all components in the forest edge-disjoint. Wlog x lies on the i = 0 side of the cut. If x isn’t a leaf, then at least two disjoint paths connect x to two other terminals. Since P is proper, both these terminals are in P . This means T [P ] crosses the i-cut twice, but then we can replace T [P ] with an even less costly tree in which i is flipped once, by projecting the path between the two occurrences of i onto the i = 1 side. ⊓ ⊔ Observe that lemma 1 holds only when the underlying alphabet of the problem is binary. In particular, for a non-binary alphabet, such x can be a non-leaf. Split and Merge. When Pluck-a-leaf can no longer find leaves to pluck, we switch to the second subroutine, one that works by splitting the set of terminals into two disjoint sets, based on the value of the i-th coordinate. We would like to split our set of terminals according to the i-cut, and recurse on each side separately. But, in order to properly reconnect the two subproblems, we need to introduce the two endpoints of the i-labeled edge to their respective sides of the i-cut. Our Split subroutine deals with one particular case in which these endpoints are easily identified. Split(i) input: A partition P of current terminals, a coordinate i that is not constant on every component of P. – Find a component P on which i isn’t constant. Denote the i-cut of P as (P0 , P1 ). – Find Pbi , the set of terminals that match the pattern of i. – if exists some x which is the unique terminal that matches the pattern of i in one side of the cut (that is, if for some x we have Pbi ∩ P0 = {x} or Pbi ∩ P1 = {x}) • Flip the i-th coordinate of x, and let x̄i be the resulting node. • Add x to its side of the i-cut, add x̄i to the other side of the cut. • Return x, x̄i and P ′ = P \ {P } ∪ {P0 , P1 }. else fail. The matching subroutine to Split is Merge: Assume Split succeeds and returns some (x, x̄i , P ′ ), and assume we have found a Steiner forest for the terminals in P ′ . Then Merge merely connects x with x̄i by an edge labeled i, then returns the resulting forest. (Again, formal description is omitted.) Lemma 2. Assume P is a proper partition. Assume Split is called on a good coordinate i s.t. the edge labeled i in T has at least one endpoint which is a terminal. Then the returned partition P ′ is proper. Proof (Sketch). Since P is proper, then the induced tree T [P ] is the only tree in the forest that contains the i-labeled edge. The lemma then follows from showing that x and x̄i are the two endpoints of i-labeled edge in T [P ]. This follows from the observation that the endpoints of the i-labeled edge must both match the pattern of i. Let u be an endpoint and wlog u belongs to the (i = 0)-side of the cut. On all coordinates that are fixed on the (i = 0)-side, u obviously has the right values. All coordinates that are fixed on the (i = 1)-side can only flip on the (i = 0)-side, but only after traversing u, so u has them set to the value fixed on the (i = 1)-side. ⊓ ⊔ 3.2 The Algorithm We can now introduce our algorithm. input: A partition P of current terminals. Initially, P is the singleton set P = {C}. 1. if Pluck-a-leaf succeeds and returns (x, P ′ ) – recurse on P’, then Paste-a-leaf x back and return the resulting forest. 2. else-if the number of non-constant coordinates on P is at least 40q 2 – Pick a non-constant coordinate i u.a.r and invoke Split(i) . – if Split succeeds: recurse on P ′ , then Merge x and x̄i , and return the resulting forest; otherwise fail. 3. else – For every P ∈ P find its MST, T (P ), and return the forest {T (P )}. Fig. 1. Algorithm for the simple case Theorem 2. With probability ≥ 1/2, the algorithm in Figure 1 returns a tree whose cost is at most d + O(q 2 ). In order to prove Theorem 2, fix an optimal phylogeny T over our initial set of terminals, and for any partition P our algorithm creates, denote T [P] as the forest induced by T on this partition. The proof of the theorem relies on the following lemma. Lemma 3. If P is a proper partition, then with probability ≥ 1 − (8q)−1 , Split is called on a good coordinate and succeeds. Furthermore, Split is executed at most 4q times. Proof (of Theorem 2). The proof follows from lemmas 1 and 3. Since we start with a proper partition, then with probability at least 1 − (4q)(8q)−1 ≥ 1/2 we keep recursing on proper partitions, until reaching the base of the recursion. By the time the algorithm reaches the base of the recursion, the dimensionality of the problem was reduced to d′ ≤ 40q 2 , so the cost of the optimal Steiner forest is at most d′ + q. As MSTs give a 2-approximation to the optimal Steiner tree problem, our forest is of cost ≤ 2(d′ + q). Then, the algorithm reconnects the forest, adding the coordinates (edges) the algorithm as removed in the first two steps of the algorithm. Since the algorithm removed at most d − d′ edges, the tree it outputs is of overall cost at most d − d′ + 2(d′ + q) = d + 40q 2 + 2q. ⊓ ⊔ Proof (of Lemma 3). Let P be the partition in the first iteration of the algorithm for which Split was invoked, and assume P is proper. Thus, the forest T [P] contains disjoint components. We call any vertex in this forest of degree ≥ 3 an internal split. Suppose we replace each internal split v with deg(v) many new vertices, each adjacent to one edge. This breaks the forest into a collections of paths we call the path decomposition of the tree. In addition, remove from this path decomposition all edges that are labeled with a bad coordinate to obtain the good path decomposition. Denote the number of paths in the good path decomposition as t. First, we claim that any call to Split (on P or any partition succeeding P), on a coordinate i which lies on a path of length ≥ 2 in the abovementioned decomposition, does not fail. Assume Split was called on i and denote its adjacent coordinate on the path as j (choose one arbitrarily if i has two adjacent coordinates on its path), and both are non-constant on P ∈ P. Observe that our decomposition leaves only good coordinates, so both i and j are good. Therefore, j is fixed on one side of the i-cut and i is fixed on one side of the j-cut. It follows that there exist binary values bi , bj s.t. for every x ∈ P , if xi = bi then xj = bj ; and if xj = 1 − bj then xi = 1 − bi . In fact, the only node on the entire tree for which xi = 1 − bi and xj = bj is the node connecting the i-edge and the j-edge. Recall that we assume for the special case i and j do not define the same cut. It follows that the node between i and j has to be a terminal, so now we can use Lemma 2 and deduce Split succeeds. So, Split can either fail or return a non-proper partition only if it was invoked either on a bad coordinate or on a good coordinate that lies on a path of length 1 in our path decomposition. There are at most q bad coordinates and q+t at most t paths of length 1, so each call to Split fails w.p. ≤ 40q 2 . Furthermore, calling Split on a good edge i lying on a path of length at least 2 results in both i’s endpoints as new leaves in their respective sides of the i-cut. As a result, Pluck-a-leaf then completely unravels the path on which i lies. Therefore, in a successful run of the algorithm, Split is called no more than t times. All that remains is to bound t. t is the number of paths on the path decomposition of P, a partition for which Pluck-a-leaf failed to execute. Observe that if the forest T [P] had even a single leaf connected to the rest of its tree by a good coordinate, then Pluck-a-leaf would continue – such a leaf, by definition, is the only terminal on which the good coordinate takes a certain value. It follows that l, the number of leaves in T [P] is bounded by 2q, the number of bad edges in T . Removing the internal splits then leaves us with at most 2l paths; removing the bad coordinates’ edges adds at most 2q − l new paths (for every bad coordinate k adjacent to a leaf, removing k does not create a new path). All in all, t ≤ 2l+2q −l ≤ 4q. Therefore, 1 each call to Split has success probability ≥ 1 − 4q+q 40q2 = 1 − 8q , and Split is called at most 4q times. ⊓ ⊔ 4 The General Case: Interchangeable Coordinates May Exist Before describing the general case, let us briefly discuss why the conventional way of initially contracting all interchangeable coordinates and applying the algorithm from the Section 3 might result in a tree of cost d+ω(q 2 ). The analysis of the first two steps of the algorithm still holds. The problem lies in the base of the recursion, where the algorithm runs the MST-based 2-approximation. Indeed, the MST algorithm is invoked on < 40q 2 contracted coordinates, but they correspond to d˜ original coordinates, and it is possible that d˜ ≫ q 2 . So by using any constant approximation on this entire forest, we may end with a tree of cost d + 2d˜ which isn’t d + O(q 2 ). Our revised algorithm does not contract edges initially. Instead, let us define a simple coordinate as one for which Split(i) succeeds. So, the first alteration we make to the algorithm is to call Split as long as the set of simple coordinates is sufficiently big. However, most alterations lie in the base of the recursion. Below we detail the algorithm and analyze its correctness. In the algorithm’s description, for any coordinate i we denote the set of coordinates interchangeable with i by Wi , and their number as w(i) = |W (i)|. Theorem 3. With probability ≥ 1/2, the algorithm in Figure 2 returns a tree of cost d + O(q 2 ). The proof of Theorem 3 follows the same outline as the proof of Theorem 2. Observe that Lemmas 1 and 3 still hold2 . Therefore, with probability ≥ 1/2, the algorithm enters the base of the recursion with a proper partition. Thus, by the following lemma, the algorithm outputs a tree of cost d + O(q 2 ). Lemma 4. Assume that the base of the recursion (i.e., Step 3) is called on a proper partition P of the terminals over d′ non-constant coordinates. Then the algorithm returns a forest of cost d′ + O(q 2 ). The full proof of Lemma 4 is deferred to the appendix. However, let us sketch the main outline of the proof. Recall the good path decomposition we used in the proof of Lemma 3. We partition its paths in the following way. 2 Clearly, Split cannot abort now, but it might be the case that the algorithm picks i which is a bad coordinate. This can happen with probability ≤ q/8q 2 = 1/8q. input: A partition P of current terminals. Initially, P is the singleton set P = {C}. 1. if Pluck-a-leaf succeeds and returns (x, P ′ ) – recurse on P’, then Paste-a-leaf x and return the resulting forest. 2. else-if the number of simple coordinates on P is at least 8q 2 – Pick a simple coordinate i u.a.r and invoke Split(i) . – if Split succeeds: recurse on P ′ , then Merge x and x̄i , and return the resulting forest; otherwise fail. 3. else – Contract all Wi into ī – For every ī with w(i) > q and the (unique) component P in which the i-cut resides, • Apply pattern matching to (P, i). Let (Di , bi ) be the pattern of i. • if i is simple, split P into P0 ∪ {xi } and P1 ∪ {xi }. • else ∗ Define the node y(i) as the node where yi = 0, every coordinate j ∈ Di is set to bij , and every coordinate j ∈ / Di is set to 0. ∗ Define y(i) to be y(i) with coordinate i flipped. ∗ P = P \ {P } ∪ {P0 ∪ {y(i)}} ∪ {P1 ∪ {y(i)}}. – For every P ∈ P find its MST T (P ), and retrieve the forest {T (P )}. – For every i with w(i) > q: if i was simple, add an edge labeled i between xi and xi else add an edge labeled i between y(i) and y(i). – Expand all contracted coordinates to their original set of coordinates by replacing i with a path of length w(i). Return the resulting forest. Fig. 2. Algorithm for the general case – Paths with at least one terminal on them. On such paths, because all interchangeable coordinates may appear in T in any order, then all coordinates on such paths are simple. So, when we enter the base of the recursion, there are at most 8q 2 edges on such paths. – Paths with no terminal on them, with length > q. Such paths are composed of interchangeable coordinates, and since there are more than q of those, we deduce all of them are good. Therefore, the endpoints of such paths are fixed up to at most q (bad) coordinates. We therefore contract these edges, split on them, and introduce into each side of the cut an arbitrary endpoint, by replacing non-fixed coordinates with zeros. So on each side of the cut the cost of the subtree increases by at most q, and since there are at most 4q such paths, our overall cost for introducing these artificial endpoints is O(q 2 ). – Paths with no terminal on them, with length ≤ q. Such paths are composed of interchangeable coordinates, but we do not contract them. Since there are at most 4q ·q edges on such paths, we run the MST approximation, and incur a cost of O(q 2 ) for edges on such paths. Runtime analysis: Pluck-a-leaf can be implemented in time linear in the size of the dataset, i.e. O(nd). Counting the number of simple coordinates takes time O(nd2 ), and Split takes time O(nd). A naive implementation of the base case of the recursion takes time O(nd2 ) for contracting coordinates, and the rest can be implemented in time O(nd). Hence the time to process each node in the recursion tree is at most O(nd2 ). Since there are at most O(q) nodes in the recursion tree, the total runtime is O(qnd2 ). 5 Discussion and Open Problems This paper presents a randomized approximation algorithm for constructing near-perfect phylogenies. In order to achieve this, we obtain a Steiner tree of low additive error. However, from the biological perspective, the goal is to find a good evolutionary tree, one that will give correct answers to questions like “what is the common ancestor of the following species?” or “which of the two gene-mutations happened earlier?”. Such questions, we hope, can be answered by finding the most-parsimonious phylogenetic tree over the given taxa. Hence, it is also desirable that any low-cost tree which we output also captures a lot of the structure of the optimal tree. We would like to point out that our algorithm in fact has this valuable property. Notice that until the base case of the recursion, both Pluck-a-leaf and Split subroutines construct the optimal tree, and correctly identify the endpoints of the edges they remove. Even when the algorithm reaches the base case of the recursion – we can declare every edge of weight > q to be good, and we know its endpoints up to at most q coordinates. In total, our algorithm gives the structure of the optimal tree up to O(q 2 ) edges, and those edges can be marked as “unsure”. Several open problems remain for this work. The most straight-forward one is whether one can devise an algorithm outputting a phylogenetic tree of cost d + O(q)? Alternatively, one may try to design exact algorithms that are efficient even for q = ω(log d). We suspect that even the case of q = O((log d)2 ) poses quite a challenge. Finally, extending our results to non-binary alphabets is intriguing. Note however that even the case of perfect phylogenies is NP-hard, and tractable only for moderately sized alphabets. Furthermore, our bottom-up approach completely breaks down for non-binary alphabets (see comment past Lemma 1), so devising an additive-approximation algorithm for the phylogeny problem with non-binary alphabets requires a different approach altogether. References 1. Ding, Z., Filkov, V., Gusfield, D.: A linear-time algorithm for the perfect phylogeny haplotyping (pph) problem. In: RECOMB, Springer (2005) 585–600 2. Blelloch, G.E., Dhamdhere, K., Halperin, E., Ravi, R., Sridhar, S.: Fixed parameter tractability of binary near-perfect phylogenetic tree reconstruction. In: ICALP, Springer (2006) 667–678 3. Gusfield, D.: Algorithms on strings, trees, and sequences: computer science and computational biology. Cambridge University Press (1997) 4. Semple, C., Steel, M.: Phylogenetics. Oxford lecture series in mathematics and its applications. Oxford University Press (2003) 5. Hinds, D.A., Stuve, L.L., Nilsen, G.B., Halperin, E., Eskin, E., Ballinger, D.G., Frazer, K.A., Cox, D.R.: Whole-genome patterns of common dna variation in three human populations. Science 307(5712) (2005) 1072–1079 6. : The international hapmap project. Nature 426(6968) (2003) 789–96 7. Alon, N., Chor, B., Pardi, F., Rapoport, A.: Approximate maximum parsimony and ancestral maximum likelihood. IEEE/ACM Trans. Comput. Biol. Bioinformatics 7 (Jan 2010) 183–187 8. Robins, G., Zelikovsky, A.: Improved steiner tree approximation in graphs. In: SODA, Society for Industrial and Applied Mathematics (2000) 770–779 9. Robins, G., Zelikovsky, A.: Improved steiner tree approximation in graphs (2000) 10. Robins, G., Zelikovsky, A.: Tighter bounds for graph steiner tree approximation. SIAM Journal on Discrete Mathematics 19 (2005) 122–134 11. Misra, N., Blelloch, G.E., Ravi, R., Schwartz, R.: Generalized buneman pruning for inferring the most parsimonious multi-state phylogeny. In Berger, B., ed.: RECOMB. Volume 6044 of Lecture Notes in Computer Science., Springer (Apr. 2010) 369–383 12. Fernández-Baca, D., Lagergren, J.: A polynomial-time algorithm for near-perfect phylogeny. SIAM J. Comput. 32 (May 2003) 1115–1127 13. Karp, R.M.: Reducibility among combinatorial problems. In Miller, R.E., Thatcher, J.W., eds.: Complexity of Computer Computations. Plenum, New York (1972) 85–103 14. Foulds, L.R., Graham, R.L.: The Steiner problem in phylogeny is NP-complete. Adv. Appl. Math. 3 (1982) 15. Sridhar, S., Dhamdhere, K., Blelloch, G., Halperin, E., Ravi, R., Schwartz, R.: Algorithms for efficient near-perfect phylogenetic tree reconstruction in theory and practice. IEEE/ACM Trans. Comput. Biol. Bioinformatics 4 (Oct 2007) 561–571 16. Damaschke, P.: Parameterized enumeration, transversals, and imperfect phylogeny reconstruction. Theor. Comput. Sci. 351 (Feb 2006) 337–350 17. Agarwala, R., Fernandez-Baca, D.: A polynomial-time algorithm for the perfect phylogeny problem when the number of character states is fixed. In: SFCS. (Nov 1993) 140–147 18. Byrka, J., Grandoni, F., Rothvoß, T., Sanità, L.: An improved lp-based approximation for steiner tree. In: STOC, ACM (2010) 19. Bodlaender, H.L., Fellows, M.R., Warnow, T.: Two strikes against perfect phylogeny. In: ICALP’92. (1992) 273–283 20. Takahashi, H., Matsuyama, A.: An approximate solution for the steiner problem in graphs. Mathematica Japonica 24 (1980) 573–577 21. Berman, P., Ramaiyer, V.: Improved approximations for the steiner tree problem. In: SODA. (1992) 325–334 22. Pramel, H., Steger, A.: Rnc-approximation algorithms for the steiner problem. In Reischuk, R., Morvan, M., eds.: STACS 97. Volume 1200 of Lecture Notes in Computer Science. Springer Berlin / Heidelberg (1997) 559–570 10.1007/BFb0023489. 23. Karpinski, M., Zelikovsky, A.: New approximation algorithms for the steiner tree problems. Journal of Combinatorial Optimization 1 (1995) 47–65 24. Zelikovsky, A.: Better approximation bounds for the network and euclidean steiner tree problems. Technical report (1996) 25. Hougardy, S., Promel, H.J.: A 1.598 approximation algorithm for the steiner problem in graphs. In: SODA. (1999) 448–453 26. Borchers, A., Du, D.Z.: The k-steiner ratio in graphs. In: STOC, ACM (1995) 641–649 A Appendix Here, we give short proofs of the basic properties presented in Fact 1. Many of these results are also found in other work [2]. 1. Let S be a set of coordinates that define the same cut over the terminals (up to renaming of P0 and P1 ). Then whenever any edge in T is labeled with some i ∈ S, then the edge lies on a path on which each edge is labeled with a unique coordinate from S, and no node of the |S|-long path is a terminal. Proof. Assume i, j ∈ S define the same cut over C. Given some edge ei where i flips, consider the shortest path from a terminal t1 through ei to another terminal t2 . If every node on this path is of degree 2, there is no terminal before t2 , and j flips before t2 . Now, suppose some node on the path between t1 and t2 has degree more than 2. Either j flips on each outgoing path before any terminals, or j does not define the same cut (since each outgoing path has a terminal on it). But if j flips on all outgoing paths before any terminal occurs on those paths, relabel the Steiner nodes on each path so that j is constant along those outgoing paths. Then, add one Steiner node and an edge from the endpoint of ei which flips j. This tree has cost strictly less than the tree which flipped j on each outgoing path, since there were at least two paths, each of which flipped j. ⊓ ⊔ 2. For any two good coordinates, i 6= j, one side of the i-cut is contained within one side of the j-cut. Alternatively, there exist values bj such that all terminals on one side of the i-cut have their jth coordinate set to bj . Proof. Suppose i is good. Then, consider the i-cut in T . Since j is good, j may flip only once in the tree. If j flips in C0 , then j is constant in C1 . If j flips in C1 , then j is constant in C0 . ⊓ ⊔ 3. Fix any good coordinate i and let j be a good coordinate such that all terminals on one side of the i-cut have their j coordinate set to bj . Then both endpoints of the edge labeled i have their j th coordinate set to bj . Proof. Suppose that some endpoint of the edge on which i flips has j (which is constant on C0 ) set to b̄j . Then, since the edge allows only one coordinate to flip across it, both endpoints are labelled with j = b̄j . Then, the side where j is constant (say C0 ) has to pay for j. If j is constant and set to bj on C1 , j has to flip twice, a contradiction since j is good. If j is constant and set to b̄j on C0 , then the labels on i’s edge are labelled by some constant setting of j. If j is non-constant Assuming j is non-constant for C1 , j flips somewhere in C1 . But then, j flips twice, contradicting the fact that j is good. ⊓ ⊔ 4. A good coordinate i and a bad coordinate i′ cannot define the same cut. Proof. This follows directly from Fact 2.1, since i and i′ will occur the same number of times in an optimal tree and a good coordinate occurs exactly once, while a bad coordinate occurs at least twice. ⊓ ⊔ B Proof of Lemma 4 Here we give the full proof of Lemma 4. For convenience, we reiterate the lemma. Lemma 5. Assume that when step 3 is entered, P is a proper partition of the terminals over d′ non-constant coordinates. Then step 3 of the algorithm returns a forest of cost d′ + O(q 2 ). Proof. Recall that for any coordinate i, we define the weight of i as the total number of coordinates interchangeable with i. Let P post denote the instance which results after splitting on all coordinates with weight greater than q. The proof of the lemma reduces to showing that there exists a forest over P post of cost O(q 2 ). If such a forest exists, the MST-based 2-approximation for each component returns a forest of cost O(q 2 ), and reconstructing the tree with plucked and split edges has weight at most d′ . So, the forest over P we get has cost ≤ d′ + O(q 2 ). The set of all terminals in all components of P post is composed of terminals that belong to the original P, and the new terminals, added by coordinates of weight more than q which are not simple. We construct a forest of low cost over P post by (i) taking an optimal Steiner forest T over P, (ii) for every simple coordinate which is split upon, remove the path of corresponding coordinates from T , and (iii) for every non-simple coordinate split upon, remove the path of corresponding coordinates and introduce the two vertices y(i) and y(i), connecting each vertex to the end-point of the path that resides in the same side of the cut. We denote the resulting forest by T post , and show that T post contains at most O(q 2 ) edges. First, observe that since there are at most q bad coordinates, by splitting only on coordinates with weight more than q, we are guaranteed to split only on good coordinates (we know from Fact 1 that the good and bad coordinates cannot define the same cut). Therefore, since P is proper, the coordinate i resides in a single component. Second, observe that the base of the recursion is executed only when Pluck-a-leaf fails. Therefore, as in the proof of Lemma 3, T is a forest with at most 2q leaves, so its path decomposition contains at most 4q paths. Our next observation is the following proposition. Proposition 1. Fix a path in the path decomposition of the forest. If there exists some non-endpoint terminal on this path, all coordinates on this path are simple. Proof. Let i be a coordinate associated with an edge on such a path. Let xi be a terminal on the path which is the closest to i. Recall the observation from before, that any two coordinates that yield the same terminal cut must appear in the optimal tree adjacent to one another, and furthermore, their order does not matter (see Fact 1). Therefore, we may assume i is adjacent to xi . Furthermore, as xi is not an endpoint, there exists a good coordinate j 6= i adjacent to xi on this path. It follows that i and j determine two different cuts over the set of terminals. Then, just as in the proof of Lemma 3, i is simple, where xi is the unique terminal on one side of its cut matching i’s pattern. ⊓ ⊔ Proposition 1 means that any non-simple coordinate corresponds to an entire path in the path decomposition (because all edges on a path with no terminals on it determine the same cut). We deduce that (a) the number of non-simple contracted coordinates of weight more than q is at most 8q. Furthermore, the number of edges on any path of length no more than q with no terminal on them is at most 8q 2 . Finally, since the base of the recursion is executed only when Split fails to execute, the number of edges on paths that do have a terminal on them is at most 16q 2 . It follows that the path decomposition of T contains at most 16q 2 edges, in addition to the edges on paths of length more than q with no terminal on them (and each such path causes the algorithm to split exactly once). We can now upper bound the number of edges in T post . The forest T post contains at most 2q ≤ 2q 2 bad edges; at most 16q 2 edges from T ; and all the paths between the vertices we introduce by adding the y(i)-vertices and connecting them to T . Let i be a non-simple contracted coordinate which was split upon, and let u → v be the corresponding path on T which was removed. Assume y(i) resides on the same side of the cut as u. Clearly, u and y(i) identify on all coordinates on the u → v path, but they also identify on all other good coordinates: a good coordinate j appears most once in T , so u, v and all terminals on at least one side of the u − v cut has the same value on their jth coordinate. It follows that the path between y(i) and u is of length at most q, and the same applies to the path between y(i) and v. Therefore, the number of edges on paths we have yet to upper bound, sum to no more than 8q · 2 · q = 16q 2 . Thus T post contains no more than 34q 2 edges. This completes the proof. ⊓ ⊔
5cs.CE
1 Tracking Gaze and Visual Focus of Attention of People Involved in Social Interaction arXiv:1703.04727v2 [cs.CV] 21 Nov 2017 Benoit Massé, Silèye Ba, and Radu Horaud Abstract—The visual focus of attention (VFOA) has been recognized as a prominent conversational cue. We are interested in estimating and tracking the VFOAs associated with multiparty social interactions. We note that in this type of situations the participants either look at each other or at an object of interest; therefore their eyes are not always visible. Consequently both gaze and VFOA estimation cannot be based on eye detection and tracking. We propose a method that exploits the correlation between eye gaze and head movements. Both VFOA and gaze are modeled as latent variables in a Bayesian switching statespace model. The proposed formulation leads to a tractable learning procedure and to an efficient algorithm that simultaneously tracks gaze and visual focus. The method is tested and benchmarked using two publicly available datasets that contain typical multi-party human-robot and human-human interactions. Index Terms—Visual focus of attention, eye gaze, head pose, dynamic Bayesian model, switching Kalman filter, multi-party dialog, human-robot interaction. I. I NTRODUCTION n this paper we are interested in the computational analysis of social interactions. In addition to speech, people communicate via a large variety of non-verbal cues, e.g. prosody, hand gestures, body movements, head nodding, eye gaze, and facial expressions. For example, in a multi-party conversation, a common behavior consists in looking either at a person, e.g. the speaker, or at an object of current interest, e.g. a computer screen, a painting on a wall, or an object lying on a table. We are particularly interested in estimating the visual focus of attention (VFOA), or who is looking at whom or at what, which has been recognized as one of the most prominent social cues. It is used in multi-party dialog to establish faceto-face communication, to respect social etiquette, to attract someone’s attention, or to signify speech-turn taking, thus complementing speech communication. The VFOA characterizes a perceiver/target pair. It may be defined either by the line from the perceiver’s face to the perceived target, or by the perceiver’s direction of sight or gaze direction (which is often referred to as eye gaze or simply gaze). Indeed, one may state that the VFOA of person i is target j if the perceiver’s gaze is aligned with the perceiverto-target line. From a physiological point of view, eye gaze depends on both eyeball orientation and head orientation. Both the eye and the head are rigid bodies with three and six degrees of freedom respectively. The head position (three coordinates) and the head orientation (three angles) are jointly referred to I B. Massé and R. Horaud are with INRIA Grenoble Rhône-Alpes, Montbonnot Saint-Martin, France. S. Ba is with Dailymotion, Paris, France This work is supported by ERC Advanced Grant VHIA #340113. as the head pose. With proper choices for the head- and eyecentered coordinate frames, one can assume that gaze is a combination of head pose and of eyeball orientation,1 and the VFOA depends on head pose, eyeball orientation, and target location. In this paper we are interested into estimating and tracking jointly the VFOAs of a group of people that communicate with each other and with a robot, or multi-party HRI (human-robot interaction), which may well be viewed as a generalization of single-user HRI. From a methodological point of view the former is more complex than the latter. Indeed, in single-user HRI the person and the robot face each other and hence a camera mounted onto the robot head provides high-resolution frontal images of the user’s face such that head pose and eye orientation can both be easily and robustly estimated. In the case of multi-party HRI the eyes are barely detected since the participants often turn their faces away from the camera. Consequently, VFOA estimation methods based on eye detection and eye tracking are ineffective and one has to estimate the VFOA, indirectly, without explicit eye detection. We propose a Bayesian switching dynamic model for the estimation and tracking gaze directions and VFOAs of several persons involved in social interaction. While it is assumed that head poses (location and orientation) and target locations can be directly detected from the data, the unknown gaze directions and VFOAs are treated as latent random variables. The proposed temporal graphical model, that incorporates gaze dynamics and VFOA transitions, yields (i) a tractable learning algorithm and (ii) an efficient gaze-and-VFOA tracking method.2 The proposed method may well be viewed as a computational model of [1], [2]. The method is evaluated using two publicly available datasets, Vernissage [3] and LAEO [4]. These datasets consist of several hours of video containing situated dialog between two persons and a robot (Vernissage) and human-human interactions (LAEO). We are particularly interested in finding participants that either gaze to each other, gaze to the robot, or gaze to an object. Vernissage is recorded with a motion capture system (a network of infrared cameras) and with a camera placed onto the robot head. LAEO is collected from TV shows. 1 Note that orientation generally refers to the pan, tilt and roll angles of a rigid-body pose, while direction refers to the polar and azimuth angles or, equivalently, a unit vector. Since the contribution of the roll angle to gaze is generally marginal, in this paper we make no distinction between orientation and direction. 2 Supplementary materials, that include a software package and examples of results, are available at https://team.inria.fr/perception/research/eye-gaze/. 2 The remainder of this paper is organized as follows. Section II provides an overview of related work in gaze, VFOA and head-pose estimation. Section III introduces the paper’s mathematical notations and definitions, states the problem formulation and describes the proposed model. Section IV presents in detail the model inference and Section V derives the learning algorithm. Section VI provides implementation details and Section VII describes the experiments and reports the results. II. R ELATED W ORK As already mentioned, the VFOA is correlated with gaze. Several methods proceed in two steps, in which the gaze direction is estimated first, and then used to estimate VFOA. In scenarios that rely on precise estimation of gaze [5], [6] a head-mounted camera, like the one in [7], can be used to detect the iris with high accuracy. Head-mounted eye trackers provide extremely accurate gaze measurements and in some circumstances eye-tracking data can be used to estimate objects of interest in videos [8]. Nevertheless, they are invasive instruments and hence not appropriate for analyzing social interactions. Gaze estimation is relevant for a number of scenarios, such as car driving [9] or interaction with smartphones [10]. In these situations, either the field of view is limited, hence the range of gaze directions is constrained (car driving), or active human participation ensures that the device yields frontal views of the user’s face, thus providing accurate eye measurements [7], [9], [11], [12]. In some scenarios the user is even asked to limit head movements [13], or to proceed through a calibration phase [12], [14]. Even if no specific constraints are imposed, single-user scenarios inherently facilitate the task of eye measurement [11]. At the best of our knowledge, there is no gaze estimation method that can deal with unconstrained scenarios, e.g. participants not facing the cameras, partially or totally occluded eyes, etc. In general, eye analysis is inaccurate when participants are faraway from the camera. An alternative is to approximate gaze direction with head pose [15]. Unlike eye-based methods, head pose can be estimated from low-resolution images, i.e. distant cameras [16], [17], [18], [19], [20]. These methods estimate gaze only approximatively since eyeball orientation can differ from head orientation by ±35° [21]. Gaze estimation from head orientation can benefit from the observation that gaze shifts are often achieved by synchronously moving the head and the eyes [22], [1], [2]. The correlation between head pose and gaze has also been exploited in [23]. More recently, [24] combined head and eye features to estimate the gaze direction using an RGB-D camera. The method still requires that both eyes are visible. Several methods were proposed to infer VFOAs either from gaze directions [25], or from head poses [4], [26], [27], [28]. For example, in [4] it is proposed to build a gaze cone around the head orientation and targets lying inside this cone are used to estimate the VFOA. While this method was successfully applied to movies, its limitation resides in its vagueness: the VFOA information is limited to whether there are two people looking at each other or not. An interesting application of VFOA estimation it the analysis of social behavior of participants engaged in meetings, e.g. [23], [26], [29], [30]. Meetings are characterized by interactions between seated people that interact based on speech and on head movements. Some methods estimate the most likely VFOA associated with a head orientation [23], [29]. The drawback of these approaches is that they must be purposively trained for each particular meeting layout. The correlation between VFOA and head pose was also investigated in [26] where an HMM is proposed to infer VFOAs from head and body orientations. This work was extended to deal with more complex scenarios, such as participants interacting with a robot [27], [31]. An input-output HMM is proposed in [31] to enable to model the following contextual information: participants tend to look to the speaker, to the robot, or to an object which is referred to by the speaker or by the robot. The results of [31] show that this improves the performance of VFOA estimation. Nevertheless, this method requires additional information, such as speaker identification or speech recognition. The problem of joint estimation of gaze and of VFOA was addressed in a human-robot cooperation task [28]. In such a scenario the user doesn’t necessarily face the camera and robot-mounted cameras have low-resolution, hence the estimation of gaze from direct analysis of eye regions is not feasible. [28] proposes to learn a regression between the space of head poses and the space of gaze directions and then to predict an unknown gaze from an observed head pose. The head pose itself is estimated by fitting a 3D elliptical cylinder to a detected face, while the associated gaze direction corresponds to the 3D line joining the head center to the target center. This implies that during the learning stage, the user is instructed to gaze at targets lying on a table in order to provide training data. The regression parameters thus estimated correspond to a discrete set of head-pose/gazedirection pairs (one for each target); an erroneous gaze may be predicted when the latter is not in the range of gaze directions used for training. A summary of the proposed Bayesian dynamic model and experiments with the Vernissage [3] motion capture dataset were presented in [32]. In this article we provide a detailed and comprehensive description and analysis of the proposed model, of the model inference, of the learning methodology, and of the associated algorithms. We show results with both motion capture and RGB data from Vernissage. Additionally, we show results with the LAEO dataset [4]. III. P ROPOSED M ODEL The proposed mathematical model model is inspired from psychophysics [1], [2]. In unconstrained scenarios a person switches his/her gaze from one target to another target, possibly using both head and eye movements. Quick eye movements towards a desired object of interest are called saccades. Eye movements can also be caused by the vestibuleocular reflex that compensates for head movements such that one can maintain his/her gaze in the direction of the target of interest. Therefore, in the general case, gazing to an object is achieved by a combination of eye and head movements. 3 Figure 1. This figure illustrates the principle of our method and displays the observed and latent variables associated with a person (left-person indexed by i). The two images were grabbed with a camera mounted onto the head of a robot and they correspond to frames t − n (left image) and t (right image), respectively. The following variables are displayed: head orientation (red arrow), Hit−n , Hit (observed variables), as well as the latent variables estimated i with the proposed method, namely gaze direction (green arrow), Git−n , Git , VFOA, Vt−n , Vti , and head reference orientation (black arrow), Rit−n , Rit (that coincides with upper-body orientation). In this example left-person gazes towards the robot at t − n, then turns her head to eventually gaze towards i right-person at t, hence her VFOA switches from Vt−n = robot to Vti = right-person. In the case of small gaze shifts, e.g. reading or watching TV, eye movements are predominant. In the case of large gaze shifts, often needed in social scenarios, head movements are necessary since eyeball movements have limited range, namely ±35° [21]. Therefore, the proposed model considers that gaze shifts are produced by head movements that occur simultaneously with eye movements. A. Problem Formulation We consider a scenario composed of N active targets and M passive targets. An active target is likely to move and/or to have a leading role in an interaction. Active targets are persons and robots.3 Passive targets are objects, e.g. wall paintings. The set of all targets is indexed from 0 to N + M , where the index 0 designates “no target". Let i be an active target (a person or a robot), 1 ≤ i ≤ N , and j be a passive target (an object), N + 1 ≤ j ≤ N + M . A VFOA is a discrete random variable defined as follows: Vti = j means person (or robot) i looks at target j at time t. The VFOA of a person (or robot) i that looks at none of the known targets is Vti = 0. The case Vti = i is excluded. The set of all VFOAs at time t is denoted by Vt = Vt1 , . . . , VtN . Two continuous variables are now defined: head orientation and gaze direction. The head orientation of person i at t i is denoted with Hit = [φiH,t , θH,t ]> , i.e. the pan and tilt angles of the head with respect to some fixed coordinate frame. The gaze direction of person i is denoted with Git and is also parameterized by pan and tilt with respect to the i same coordinate frame, namely Git = [φiG,t , θG,t ]> . Although eyeball orientation is neither needed nor used, it is worth noticing that it is the difference between Git and Hit . These variables are illustrated on Fig. 1. 3 Note that in case of a robot, the gaze direction and the head orientation are identical and that the latter can be easily estimated from the head motors. Finally, to establish a link between VFOAs and gaze directions, the target locations must be defined as well. Let Xit = [xit , yti , zti ]> be the location of target i. In the case of a person, this location corresponds to the head center while in the case of a passive target, it corresponds to the target center. These locations are defined in the same coordinate frame as above. Also notice that the direction from the active target i to target j is defined by the unit vector j j i i Xij t = (Xt −Xt )/kXt −Xt k which can also be parameterized ij i,j i,j > by two angles, Xt = [φX,t , θX,t ] . As already mentioned, target locations and head orientations are observed random variables, while VFOAs and gaze directions are latent random variables. The problem to be solved can now be formulated as a maximum a posteriori (MAP) problem: V̂t , Ĝt = argmax P (Vt , Gt |H1:t , X1:t ) (1) Vt ,Gt Since there is no deterministic relationship between head orientation and gaze direction, we propose to model it probabilistically. For this purpose, we introduce an additional latent random variable, namely the head reference orientation, i Rit = [φiR,t , θR,t ]> , which we choose to coincide with the upper-body orientation. We use the following generative model, initially introduced in [26], linking gaze direction, head orientation, and head reference orientation: P (Hit |Git , Rit ; α, ΣH ) = N (Hit ; µiH,t , ΣH ), with µiH,t = αGit + (I2 − α)Rit , (2) (3) where ΣH ∈ R2×2 is a covariance matrix, I2 ∈ R2×2 is the identity matrix and α = Diag (α1 , α2 ) is a diagonal matrix of mixing coefficients, 0 < α1 , α2 < 1. Also it is assumed that the covariance matrix is the same for all the persons and over time. Therefore, head orientation is an observed random variable normally distributed around a convex combination 4 Xt−1 associated with different people are independent, given the VFOAs. By combining the above equations with this independency assumption, we obtain: Y P (Ht |Gt , Rt ) = N (Hit ; µiH,t , ΣH ) (9) Xt Vt−1 Vt i P (Gt |Gt−1 , Ġt−1 , Vt , Xt ) = Gt−1 Gt Y i δj (Vt ) N (Git ; µij G,t , ΓG ) i,j (10) Rt−1 P (Rt |Rt−1 , Ṙt−1 ) = Rt Y N (Rit ; µiR,t , ΓR ) (11) i Ht−1 Ht Figure 2. Graphical representation showing the dependencies between the variables of the proposed Bayesian dynamic model. The discrete latent variables (visual focus of attention) are shown with squares while continuous variables are shown with circles: observed variables (head pose and target locations) are shown with shaded circles and latent variables (gaze and reference) are shown with white circles. between two latent variables: gaze direction and head reference orientation. B. Gaze Dynamics where the dependencies between variables are embedded in the variable means, i.e. (3) and (6). The covariance matrices will be estimated via training. While gaze directions can vary a lot, we assume that head reference orientations are almost constant over time, which can be enforced by imposing that the total variance of gaze is much larger than the total variance of head reference orientation, namely: Tr(ΓG )  Tr(ΓR ), (12) C. VFOA Dynamics Using a first-order Markov approximation, the VFOA transition probabilities can be written as: P (Vt |V1:t−1 ) = P (Vt |Vt−1 ), The following model is proposed: (13) N P (Git |Git−1 Ġit−1 , Vti = j, Xt ) = N (Git ; µij G,t , ΓG ), (4) P (Ġit |Ġit−1 ) = N (Ġit ; Ġit−1 , ΓĠ ), (5) with: ( µij G,t = Git−1 + Ġit−1 dt, if j = 0, (6) i βGit−1 + (I2 − β)Xij + Ġ dt, if j 6= 0, t t−1 where Ġit = dGit /dt is the gaze velocity, ΓG , ΓĠ ∈ R2×2 are covariance matrices, and β = Diag (β1 , β2 ) is a diagonal matrix of mixing coefficients, 0 < β1 , β2 < 1. Therefore, if a person looks at one of the targets, then his/her gaze dynamics depends on the person-to-target direction Xij t at a rate equal to β, and if a person doesn’t look at one of the targets, then his/her gaze dynamics follows a random walk. The head reference orientation dynamics can be defined in a similar way: P (Rit |Rit−1 , Ṙit−1 ) = N (Rit ; µiR,t , ΓR ), P (Ṙit |Ṙit−1 ) with µiR,t = = N (Ṙit ; Ṙit−1 , ΓṘ ), Rit−1 + Ṙit−1 dt, (7) (8) where Ṙit = dRit /dt is the head reference orientation velocity and ΓR , ΓṘ ∈ R2×2 are covariance matrices. The dependencies between all the model variables are shown as a graphical representation in Figure 2. It is assumed that the gaze directions associated with different people are independent, given the VFOAs V1:t . The crossdependency between different people is taken into account by the VFOA dynamics as detailed in section III-C below. Similarly, head orientations, and head reference orientations Notice that matrix P (Vt |Vt−1 ) is of size (N + M ) × (N + M )N . Indeed, there are N persons (active targets), and N + M +1 targets (one "no" target, N active targets and M passive targets) and the case of a person that looks to him/herself is excluded. For example, if N = 2 and M = 4, matrix (13) has (2 + 4)2×2 = 1296 entries. The estimation of this matrix would require, in principle, a large amount of training data, in particular in the presence of many symmetries. We show that, in practice, only 15 different transitions are possible. This can be seen on the following grounds. We start by assuming conditional independence between the VFOAs at t: Y P (Vt |Vt−1 ) = P (Vti |Vt−1 ). (14) i Vti , Let’s consider the VFOA of person i at t, given Vt−1 , the VFOAs at t − 1. One can distinguish two cases: i • Vt−1 = k where k is either a passive target, N < k ≤ N + M , or it is none of the targets, k = 0; in this case i Vti depends only on Vt−1 , and i • Vt−1 = k, where k 6= i is a person 1 ≤ k ≤ N ; in this i k . case Vti depends on the both Vt−1 and Vt−1 To summarize, we can write that: P (Vti = j|Vt−1 ) = ( i k P (Vti = j|Vt−1 = k, Vt−1 = l) if 1 ≤ k ≤ N, (15) i i P (Vt = j|Vt−1 = k) otherwise. Based on this it is now possible to count the total number of possible VFOA transitions. With the same notations as in (15), we have the following possibilities: 5 k = 0 (no target): there are two possible transitions, j = 0 and j 6= 0. • N < k ≤ N +M (passive target): there are three possible transitions, j = 0, j = k, and j 6= k. • 1 ≤ k ≤ N, l = 0 (active target k looks at no target): there are three possible transitions, j = 0, j = k, and j 6= k. • 1 ≤ k ≤ N, l = i (active target k looks at person i): there are three possible transitions, j = 0, j = k, and j 6= k. • 1 ≤ k ≤ N, l 6= 0, i (active target k looks at active target l different than i): there are four possible transitions, j = 0, j = k, j = l and j 6= k, l. Therefore, there are 15 different possibilities for P (Vti = j|Vt−1 ), i.e. appendix A. Moreover, by assuming that the VFOA transitions don’t depend on i, we conclude that the transition matrix may have up to 15 different entries. Moreover, the number of possible transitions is even smaller if there is no passive target (M = 0), or if the number of active targets is small, e.g. N < 3. This considerably simplifies the task of estimating this matrix and makes the task of learning tractable. • IV. I NFERENCE We start by simplifying the notation, namely Lt = [Gt ; Ġt ; Rt ; Ṙt ] where [·; ·] denotes vertical concatenation. The emission probabilities (9) become: Y P (Ht |Lt ) = N (Hit ; µiH,t , ΣH ), (16) i with µiH,t = CLit , (17) where matrix C is obtained from the definition of and from (3):  α1 0 0 0 1 − α1 0 0 C= 0 α2 0 0 0 1 − α2 0 Lt above  0 . 0 j ij i ij with µij L,t = At Lt−1 + bt  ΓG  ΓĠ  and ΓL =  ΓR P (Lt ,Vt |H1:t−1 , X1:t ) XZ = P (Lt , Vt , Lt−1 , Vt−1 |H1:t−1 , X1:t )dLt−1 Vt−1 = XZ × P (Lt−1 , Vt−1 |H1:t−1 , X1:t−1 )dLt−1 , (19) (23) where unnecessary dependencies were removed. Combining (22) and (23) we obtain a recursive formulation in P (Vt , Lt |H1:t , X1:t ). However, this model is still intractable without further assumptions. The main approximation used in this work consists of assuming local independence for the posteriors: Y P (Lt , Vt |H1:t , X1:t ) ' P (Lit , Vti |H1:t , X1:t ). (24) i A. Switching Kalman Filter Approximation Several strategies are possible, depending upon the structure of P (Lt , Vt |H1:t , X1:t ). Commonly used strategies to evaluate this distribution include variational Bayes or MonteCarlo. Alternatively, we propose to cast the problem into the framework of switching Kalman filters (SKF) [33]. We assume the filtering distribution to be Gaussian, P (Lt , Vt |H1:t , X1:t ) ∝ N (Lt ; µt , Σt ). (25) From (24) and (25) we obtain the following factorization: YY ij δj (Vti ) P (Lt , Vt |H1:t , X1:t ) ∝ N (Lit ; µij . (26) t , Σt ) j Thus, (23) can be split into N components, one for each active target i: P (Lit ,Vti = j|H1:t , X1:t ) ∝ P (Hit |Lit ) XZ ij i i × N (Lit ; Aij t Lt−1 + bt )P (Vt |Vt−1 ) Vt−1   ,  P (Lt |Vt , Lt−1 , Xt )P (Vt |Vt−1 ) Vt−1 i The transition probabilities can be obtained by combining (10) and (11) with (5) and (8): YY δj (Vti ) P (Lt |Vt , Lt−1 , Xt ) = N (Lit ; µij , (18) L,t , ΓL ) i where c is the normalization evidence. Now we can introduce Vt−1 and Lt−1 using the sum rule: × (20) ΓṘ ij where Aij t is an 8 × 8 matrix and bt is an 8 × 1 vector. The indices i,j and t cannot be dropped since the transitions depend on Xij t from (6). The MAP problem (1) can now be derived in a Bayesian framework for the VFOA variables: Z P (Vt |H1:t , X1:t ) = P (Vt , Lt |H1:t , X1:t )dLt . (21) We propose to study the filtering distribution of the joint latent variables, namely P (Vt , Lt |H1:t , X1:t ). Indeed, Bayes rule yields: 1 P (Vt , Lt |H1:t , X1:t ) = P (Ht |Lt )P (Lt , Vt |H1:t−1 , X1:t ). c (22) Y i ik δk (Vt−1 ) N (Lit−1 ; µik dLit−1 , t−1 , Σt−1 ) (27) k or, after several algebraic manipulations: X ijk ijk P (Lit , Vti = j|H1:t , X1:t ) ∝ wt−1,t N (Lit ; µijk t , Σt ). k (28) In this expression, µijk and Σijk are obtained by performing t t ik constrained Kalman filtering on µik t−1 , Σt−1 with transition ij ij dynamics defined by At and bt , emission dynamics defined ijk by C, and observation Hit , i.e. [34]. The weights wt−1,t are i i defined as P (Vt−1 = k | Vt = j, H1:t , X1:t ). The constraint comes from the fact that ||Git − Hit || < 35° and is achieved by projecting the mean (refer to [34] for more details). This can be rephrased as follows: from the filtering distribution at time t − 1, there are N + M possible dynamics for Lit . The normal distribution at time t − 1 then becomes 6 a mixture of N + M normal distributions at time t as shown in (28). However, we expect a single Gaussian such ij as P (Lit , Vti = j|H1:t , X1:t ) ∝ N (Lit ; µij t , Σt ). This can be done by moment matching: X ijk µij wt−1,t µijk (29) t = t Σij t = k X ijk ijk > (Σijk + (µijk − µij − µij wt−1,t t t t )(µt t ) ) (30) k ijk . Let’s introduce Finally, it is necessary to evaluate wt−1,t the following notations: i i cijk t−1,t = P (Vt = j, Vt−1 = k|H1:t , X1:t ), cij t = P (Vti = j|H1:t , X1:t ). (31) A. Learning the VFOA Transition Probabilities The VFOA transitions are drawn from the generalized Bernoulli distribution. Therefore, the transition probabilities can be estimated with P (Vti = j|Vt−1 ) = Et−1 [δj (Vti )], where δj (i) is the Kronecker delta function. In Section III-C we showed that there are up to 15 different possibilities for the VFOA transition probability. This enables us to derive an explicit formula for each case, see appendix B. Consider for i example one of these cases, namely p14 = P (Vti = l|Vt−1 = k k, Vt−1 = l), which is the conditional probability that at t person i looks at target l, given that at t − 1 person i looked at person k and that person k looked at target l. This probability can be estimated with the following formula: (32) Nq Tq Nq Q X X XX X It follows that cij t = X cijk t−1,t ijk and wt−1,t = cijk t−1,t k cij t p̂14 = . By applying Bayes formula to cijk t−1,t , yields: q,i q,k δl (Vtq,i )δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X q,i q,k δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i i i cijk t−1,t ∝ P (Ht |Vt = j, Vt−1 = k, H1:t−1 , X1:t ) i i ×cik t−1 P (Vt = j|Vt−1 = k, H1:t−1 , X1:t−1 ) (33) ijk Then, cik t−1 is obtained from ct−2,t−1 calculated at previous step. The last factor in (33) is either equal P time i k kl i to c P l t−1 (Vt = j|Vt−1 = k, Vt−1 = l) if k is i i an active target, or P (Vt = j|Vt−1 = k) otherwise. Both cases are straightforward to compute. Finally, the first factor in (33), the observation component, can be i = k, H1:t−1 , X1:t ) × factorized as P (Hit |Vti = j, Vt−1 Q P P n n n = m, V = p, H1:t−1 , X1:t ). By |V P (H t t t−1 n6=i m p introducing the latent variable L, we obtain: n P (Hnt |Vtn = m, Vt−1 = p, H1:t−1 , X1:t ) Z = P (Hnt |Lnt ) P (Lnt |Lnt−1 , Vtn = m, Xt ) n × P (Lnt−1 |Vt−1 = p, H1:t−1 , X1:t−1 )dLnt−1 dLnt . (34) All the factors (34) are normal distributions, hence it integrates in closed-form. In summary, we devised a procedure to estimate an online approximation of the joint filtering distribution of the VFOAs, Vt , and of the gaze and head reference directions, Lt . V. L EARNING The proposed model has two sets of parameters that must be estimated: the transition probabilities associated with the discrete VFOA variables, and the parameters associated with the Gaussian distributions. Learning is carried out using Q recordings with annotated VFOAs. Each recording is composed of Tq frames, 1 ≤ q ≤ Q and contains Nq active targets (the robot is the active target 1 and the persons are indexed from 2 to Nq ) and Mq passive targets. In addition to target locations and head poses, it is worth noticing that the learning algorithm requires VFOA ground-truth annotations, while gaze directions are still treated as latent variables. B. Learning the Gaussian Parameters In Section IV we described the derivation of the proposed model that is based on SKF. This model requires the parameters (means and covariances) of the Gaussian distributions defined in (16) and (18). Notice however that the mean (17) of (16) is parameterized by α. Similarly, the mean (19) of (18) is parameterized by β. Consequently, the model parameters are: θ = (α, β, ΓL , ΣH ), (35) and we remind that α and β are 2 × 2 diagonal matrices, ΓL is a 8 × 8 covariance and and ΣH is a 2 × 2 covariance, and that we assumed that these matrices are common to all the active targets. Hence the total number of parameters is equal to 2 + 2 + 36 + 3 = 43. In the general case of SKF models, the discrete variables are unobserved both for learning and for inference. Here we propose a learning algorithm that takes advantage of the fact that the discrete variables, i.e. VFOAs, are observed during the learning process, namely the VFOAs are annotated. We propose an EM algorithm adapted from [35]. In the case of a standard Kalman filter, an EM iteration alternates between a forward-backward pass to compute the expected latent variables (E-step), and between the maximization of the expected complete-data log-likelihood (M-step). We start by describing the M-step. The complete-data loglikelihood is: ln P (L1 , H1 , . . . , LQ , HQ |θ) = Nq Tq Q X X X q,i ln P (Lq,i t |Lt−1 , β, ΓL ) q=1 i=2 t=2 + Nq Tq Q X X X q=1 i=2 t=1 q,i ln P (Hq,i t |Lt , α, ΣH ). (36) 7 By taking the expectation w.r.t. the posterior distribution P (L1 , . . . , LQ |H1 , . . . , HQ , θ), we obtain:   Q(θ, θ old ) = EL1 ,...,LK |θold ln P (L1 , H1 , . . . , LQ , HQ |θ) , (37) which can be maximized w.r.t. to the parameters θ, which yields closed-form expressions for the covariance matrices: Nq Tq Q X X X ΓL = Q X (38) Kt = Pt,t−1 C (CPt,t−1 C + ΣH ) The backward pass estimates N (Lt ; µ̂t , P̂t ) and leads to Q X (Nq − 1)Tq −1 . P (Lt |H1 , . . . , HT ) µ̂t = µt + Jt (µ̂t+1 − (At+1 µt + bt+1 )), Pt+1,t )J> t , (45) = (46) (47) where: (48) The expectations are estimated by performing a forwardbackward pass over all the persons and all the recordings of the training data. This yields the following formulas: q,i E[Lq,i t ] = µ̂t q,i q,i q,i > E[(Hq,i t − µH,t )(Ht − µH,t ) ] q=1 i=2 t=1 (44) > −1 Jt = P t A > . t+1 (Pt+1,t ) (Nq − 1)(Tq − 1) q,ij q,i q,ij where µq,ij L,t = At Lt−1 + bt , i.e. (19), and: , (39) q=1 µq,i H,t > P̂t = Pt + Jt (P̂t+1 − q=1 ΣH = Pt,t−1 = At Pt−1 A> t + ΓL , q,ij q,ij > i E[(Lq,i t − µL,t )(Lt − µL,t ) ] q=1 i=2 t=2 Nq Tq Q X X X where: q,i > E[Lq,i ] t Lt > q,i E[Lq,i t Lt−1 ] = = q,i > + µ̂q,i t µ̂t q,i > q,i q,i > P̂q,i t Jt−1 + µ̂t µ̂t−1 P̂q,i t (49) (50) (51) VI. I MPLEMENTATION D ETAILS CLq,i t , i.e. (17). where = The estimation of α and of β is carried out in the following way. ∂Q(θ, θ old )/∂β1 = 0 and ∂Q(θ, θ old )/∂β2 = 0 yield a set of two linear equations in the two unknowns:  Nq Tq Q X X X  q,i q,i q,ij > −1 ∂ E (Lt − µq,ij ) Γ (L − µ ) = 0, L L,t L,t ∂β1 t q=1 i=2 t=2  Nq Tq Q X X  q,i X q,ij > −1 ∂ q,i q,ij E (Lt − µL,t ) ΓL (L − µL,t ) = 0, ∂β2 t q=1 i=2 t=2 The proposed method was evaluated on the Vernissage dataset [3] and on the Looking At Each Other (LAEO) dataset [4]. We describe in detail these datasets and their annotations. We provide implementation details and we analyse the complexity of the proposed algorithm. A. The Vernissage Dataset The Vernissage scenario can be briefly described as follows, e.g. Fig. 3: there are three wall paintings, namely the passive targets denoted with o1 , o2 , and o3 (M = 3); two persons, (40) denoted left person (left-p) and right person (right-p), interact with the robot, hence N = 3. The robot plays the role of and similarly: an art guide, describing the paintings and asking questions  Nq Tq Q X X X  q,i to the two persons in front of him. Each recording is split q,i > −1 ∂ E (Ht − µq,i (Hq,i t − µH,t ) = 0, into two roughly equal parts. The first part is dedicated to H,t ) ΣH ∂α1 q=1 i=2 t=1 painting explanation, with a one-way interaction. The second   Nq Tq Q X X X ∂ part consists of a quiz, thus illustrating a dialog between the q,i > −1 q,i (Hq,i E (Hq,i t − µH,t ) = 0, two participants and the robot, most of the time concerning t − µH,t ) ΣH ∂α2 q=1 i=2 t=1 (41) the paintings. where as above, the expectation is taken w.r.t. to the posterior distribution. Once the formulas above are expanded and once q,i the means µq,ij L,t and µH,t are substituted with their expressions, the following terms remain to be estimated: E[Lq,i t ], q,i > q,i q,i > E[Lq,i L ] and E[L L ]. t t t t−1 The E-step provides estimates of these expectations via a forward-backward algorithm. For the sake of clarity, we drop the superscripts i (active target index) and q (recording index) up to equation (48) below. Introducing the notation P (Lt |H1 , . . . , Ht ) = N (Lt ; µt , Pt ), the forward-pass equations are: µt = At µt−1 + bt + Kt (Ht − C(At µt−1 + bt )) (42) Pt = (I − Kt C)Pt,t−1 , (43) Figure 3. The Vernissage setup. Left: Global view of an “exhibition" showing wall paintings, two participants, i.e. left-p and right-p, and the NAO robot. Right: Top view of the room showing the Vernissage layout. The scene was recorded with a camera embedded into the robot head and with a VICON motion capture system consisting of a network of infrared cameras, placed onto the 8 walls, and of optical markers, placed onto the robot and people heads. Both were recorded at 25 frames per second (fps). There is a total of ten recordings, each lasting ten minutes. The VICON system provided accurate estimates of head positions, X1:T and head orientations, H1:T . Head positions and head orientations were also estimated using from the RGB images gathered with the camera embedded into the robot head. The RGB images are processed as follows. We use the OpenCV version of [36] to detect faces and their bounding boxes which are then tracked over time using [37]. Next, we extract HOG descriptors from each bounding box and apply a head-pose estimator, e.g. [38]. This yields H̃1:T . The 3D head positions, X̃1:T , can be estimated using the line of sight through the face center and the bounding-box size, which provides a rough estimate of the depth along the line of sight. In the remaining of this paper, X1:T and H1:T are referred to as Vicon Data; X̃1:T and H̃1:T as RGB Data. Because the whole setup was carefully calibrated, both Vicon and RGB Data are represented in the same coordinate frame. In all our experiments we assumed that the passive targets are static and their positions are provided in advance. The position of the robot itself is also known in advance and one can easily estimate the orientation of the robot head from motor readings. Finally, the VFOAs of the participants were manually annotated in all the frames of all the recordings. B. The LAEO Dataset The LAEO dataset [4] is an extension of the TVHID (TV Human Interaction Dataset) [39]. It consists of 300 videos extracted from TV shows. At least two actors appear in each video engaged in four human-human interactions: handshake, highfive, hug, and kiss. There are 50 videos for each interaction and 100 videos with no interaction. The videos have been grabbed at 25 fps and each video lasts from five seconds to twenty-five seconds. LAEO is further annotated, namely some of these videos are split into shots which are separated by cuts. There are 443 shots in total which are manually annotated whenever two persons look at each other, [4]. While there is no passive target in this dataset (M = 0), the number of active targets (N ) corresponds to the number of persons in each shot. In practice N varies from one to eight persons. All the faces in the dataset are annotated with a bounding box and with a coarse head-orientation label: frontal-right, frontal-left, profile-right, profile-left, backward. As with Vernissage, we use the bounding-box center and size to estimate the 3D coordinates of the heads, X1:T . We also assigned a yaw value to each one of the five coarse head orientations, H1:T . We also computed finer head orientations, H̃1:T , using [38]. C. Algorithmic Details The inference procedure is summarized in Algorithm 1. This is basically an iterative filtering procedure. The update step consists of applying the recursive relationship, derived in ij ij ijk ijk Section IV, to µij and cijk t , Σt and ct , using µt , Σt t−1,t as intermediate variables. The VFOA is chosen using MAP, given observations up to the current frame, and the gaze direction is the mean of the filtered distribution (the first two components of µij t are indeed the mean for the pan and tilt gaze angles). Algorithm 1 Inference 1: procedure G AZE A NDVFOA 2: X1 , H1 ← G ET O BSERVATIONS(time = 1) 3: c1 , µ1 , Σ1 ← I NITIALIZATION(H1 , X1 ) 4: V1i ← argmaxj cij 1 5: Gi1 ← µij 1 [1..2] 6: for t = 2..T do 7: Xt , Ht ← G ET O BSERVATIONS(time = t) 8: ct , µt , Σt ← U PDATE(Ht , Xt , ct−1 , µt−1 , Σt−1 ) 9: Vti ← argmaxj cij t 10: Git ← µij [1..2] t 11: return V1:T , G1:T Let’s now describe the initialization procedure used by Algorithm 2. In a probabilistic framework, parameter intialization is generally addressed by defining an initial distribution, e.g. P (L1 |V1 ). Here, we did not explicitly define such a distribution. Initialization is based on the fact that, with repeated similar observation inputs, the algorithm reaches a steady-state. The initialization algorithm uses a repeated update method with initial observation to provide an estimate of gaze and of reference directions. Consequently, the initial filtering distribution P (L1 , V1 |H1 , X1 ) is implicitly defined as the expected stationary state. Algorithm 2 Initialization 1: procedure I NITIALIZATION (H1 , X1 ) 2: µin ← [H1 ; 0; H1 ; 0] 3: Σin ← I 1 4: cin ← N +M (Uniform) 5: while Not Convergence do 6: cin , µin , Σin ← U PDATE(H1 , X1 , cin , µin , Σin ) 7: return cin , µin , Σin D. Algorithm Complexity The computational complexity of Algorithm 1 is C = T (CO + CU ) + TI CU , (52) where T is the number of frames in a test video, TI is the number of iterations needed by the Algorithm 2 (initialization) to converge, CO is the computational complexity of G ET O BSERVATION and CU is the computational complexity of U PDATE. The complexity of one iteration of Algorithm 1 is CO + CU . CO depends on face detection and head pose estimation algorithms. Hence we concentrate on CU . From Section IV one sees that the following values need to be i computed: P (Hit |Vti = j, Vt−1 = k, H1:t−1 , X1:t−1 ), cijk t−1,t , ijk ijk ij ij ij µt , Σt , and then ct , µt and Σt , for each active target i, and for each combination of targets j and k different from i. There are N possible values for i and (N + M ) possible values for j and k. Then, CU = K × N (N + M )2 , (53) 9 where K is a factor whose complexity can be estimated as follows. The most time-consuming part is the Kalman Filter ik algorithm used to estimate µijk and Σijk from µik t t t and Σt . These calculations are dominated by several 8×8 and 2×8 matrix inversions and multiplications. By neglecting scalar multiplications and matrix additions, and by denoting with CKF the complexity of the Kalman filter, we obtain that K ≈ CKF and hence CU ≈ CKF × N (N + M )2 . VII. E XPERIMENTAL RESULTS A. Vernissage Dataset We applied the same experimental protocol to the Vicon and RGB data. We used a leave-one-video-out strategy for training. The test is performed on the left out video. We used the frame recognition rate (FRR) metrics to quantitatively evaluate the methods. FRR computes the percentage of frames for which the VFOA is correctly estimated. One should note however that the ground-truth VFOAs were obtained by manually annotating each frame in the data. This is subject to errors since the annotator has to associate a target with each person. The VFOA transition probabilities and the model parameters were estimated using the learning method described in Section V. Appendix B provides the formulas used for estimating the VFOA transition probabilities given the annotated data. Notice that the fifteen transitions probabilities thus estimated are identical for both data, Vicon and RGB. The Gaussian parameters, i.e. (35), were estimated using the EM algorithm of Section V-B. This learning procedure requires head-pose estimates as well as the targets locations, estimated as just explained. Since these estimates are different for the two kinds of data (Vicon and RGB) we carried out the learning process twice, with the Vicon data and with the RGB data. The EM algorithm needs initialization. The initial parameter values for α and β are α0 = β 0 = Diag (0.5, 0.5). Matrices ΣH and ΓL defined in (20) are initialized with isotropic covariances: Σ0H = σI2 , Γ0G = Γ0Ġ = γI2 , and Γ0R = Γ0Ṙ = ηI2 with σ = 15, γ = 5, and η = 0.5. In particular, this initialization is consistent with (12). In practice we noticed that the covariances estimated by training remain consistent with (12). B. Results with Vicon Data The FRR of the estimated VFOAs for the Vicon data are summarized in Table I. A few examples are shown in Figure 5. The FRR score varies between 28.3% and 74.4% for [26] and between 43.1% and 79.8% for the proposed method. Notice that high scores are obtained by both methods for recording #27. Similarly, low scores are obtained for recording #26. Since both methods assume that head motions and gaze shifts occur synchronously, an explanation could be that this hypothesis is only valid for some of the participants. The confusion matrices for VFOA classification using Vicon data are given in Figure 4. There are a few similarities between the results obtained with the two methods. In particular, wall painting #o2 stands just behind Nao and both methods don’t always discriminate between these two targets. In addition, the head of one of the persons is often aligned with painting Table I FRR SCORES OF THE ESTIMATED VFOA S FOR THE V ICON DATA FOR THE LEFT AND RIGHT PERSONS ( LEFT- P AND RIGHT- P ). Recording 09 10 12 15 18 19 24 26 27 30 Mean Ba & Odobez [26] left-p right-p 51.6 65.1 64.3 74.4 53.5 67.6 67.1 46.2 37.5 28.3 56.7 45.4 44.9 49.0 40.3 32.9 65.8 72.0 69.1 49.1 54.5 Proposed left-p right-p 59.8 61.4 76.5 65.0 61.6 63.2 64.8 67.6 62.0 53.7 54.5 60.4 59.7 54.7 43.6 43.1 79.8 78.3 72.0 63.9 62.6 Figure 4. Confusion matrices for the Vicon data. Left: [26]. Right: Proposed algorithm. Row-wise: ground-truth VFOAs. Column-wise: estimated VFOAs. Diagonal terms represent the recall. #o1 from the viewpoint of the other person. A similar remark holds for painting #o3 . As a consequence both methods often confuse the VFOA in these cases. This can be seen in the third image of Figure 5. Indeed, it is difficult to estimate whether the left person (left-p) looks at #o1 or at right-p. Finally, both methods have problems with recognizing the VFOA “nothing” or gaze aversion (Vti = 0). We propose the following explanation: the targets are widespread in the scene, hence it is likely that an acceptable target lies in most of the gaze directions. Moreover, Nao is centrally positioned, therefore the head orientation used to look at Nao is similar to the resting head orientation used for gaze aversion. However, in [26] the reference head orientation is fixed and poorly suited for dynamic head-to-gaze mapping, hence the high error rate on painting #o3 . Our method favors the selection of a target, either active or passive, over the no target (nothing) case. C. Results with RGB Data The RGB images were processed as described in section VI-A above in order to obtain head orientations, H̃1:T , and 3D head positions, X̃1:T . Table II shows the accuracy of these measurements (in degrees and in centimeters), when compared with the ground truth provided by the Vicon motion capture system. As it can be seen, while the head orientation estimates are quite accurate, the error in estimating the head positions can be as large as 0.8 m for participants lying in between 1.5 m and 2.5 m in front of a robot, e.g. recordings #19 and #24. In particular this error increases as a participant is farther away from the robot. In these cases, the bounding 10 Figure 5. Results obtained with the proposed method on Vicon data. Gaze directions are shown with green arrows, head reference directions with dark-grey arrows and observed head directions with red arrows. The ground-truth VFOA is shown with a black circle. The top row displays the image of the robot-head camera. Top views of the room show results obtained for the left-p (middle row) and for the right-p (bottom row). In the last example the left-p gazes at “nothing". box is larger than it should be and hence the head position is, on an average, one meter closer than the true position. These relatively large errors in 3D head position affect the overall behavior of the algorithm. The FRR scores obtained with the RGB data are shown in Table III. As expected the loss in accuracy is correlated with the head position error: the results obtained with recordings #09 and #30 are close to the ones obtained with the Vicon data, whereas there is a significant loss in accuracy for the other recordings. The loss is notable for [26] in the case of the right person (right-p) for the recordings #12, #18 and #27. The confusion matrices obtained with the RGB data are shown Table II M EAN ERROR FOR HEAD POSE ESTIMATIONS FROM RGB DATA , FOR THE LEFT PERSON ( LEFT- P ) AND THE RIGHT PERSON ( RIGHT- P ). T HE ERRORS IN HEAD POSITION ( CENTIMETERS ) AND ORIENTATION ( DEGREES ) ARE COMPUTED WITH RESPECT TO VALUES PROVIDED BY THE MOTION CAPTURE SYSTEM . Video 09 12 18 19 24 26 27 30 Mean Position error (cm) left-p right-p 18.1 20.8 35.7 41.5 36.9 12.8 86.0 87.4 86.5 73.9 50.2 56.9 64.5 58.3 16.7 13.3 46.4 Pan error left-p right-p 4.4° 4.8° 4.8° 5.5° 6.8° 3.7° 4.0° 5.8° 3.3° 3.5° 7.4° 9.0° 4.1° 5.8° 2.8° 2.9° 5.0° Tilt error left-p right-p 3.7° 3.2° 2.6° 3.8° 5.8° 2.5° 2.7° 3.7° 2.8° 2.7° 4.1° 5.2° 3.2° 4.4° 1.8° 2.7° 3.3° on Fig. 6. In the case of RGB data, the comparison between our method and the method of [31] is biased by the use of different head orientation and 3D head position estimators. Indeed, the RGB data results reported in [31] were obtained with unpublished methods for estimating head orientations and 3D head positions, and for head tracking. Moreover, [31] uses cross-modal information, namely the speaker identity based on the audio track (one of the participants or the robot) as well as the identity of the object of interest. We also note that [31] reports mean FRR values obtained over all the test recordings, instead of an FRR value for each recording. Table IV summarizes a comparison between the average FRR obtained with our method, with [26], and with [31]. Our method yields a similar FRR score as [31] using the Vicon data (first row) in which case the same head pose inputs are Table III FRR SCORES OF THE ESTIMATED VFOA S OBTAINED WITH [26] AND WITH THE PROPOSED METHOD FOR THE RGB DATA . T HE LAST TWO COLUMNS SHOW THE 3D HEAD POSITION ERRORS OF TABLE II. Video 09 12 18 27 30 Mean Ba & Odobez [26] left-p right-p 50.3 59.8 54.2 14.8 39.0 16.1 38.2 17.1 61.6 44.6 39.0 Proposed left-p right-p 58.1 55.9 59.0 46.5 64.2 33.1 53.3 55.1 54.7 66.6 54.7 Head pos. error left-p right-p 18.1 20.8 35.7 41.5 36.9 12.8 64.5 58.3 16.7 13.3 11 comparable with those of [4] on this dataset. This is quite remarkable knowing that we estimated the model parameters with the Vernissage training data. Table V AVERAGE SHOT RECOGNITION RATE (SRR) OBTAINED WITH [26] AND WITH THE PROPOSED METHOD . Coarse head orientation Fine head orientation Figure 6. Confusion matrices for the RGB data. Left: [26]. Right: Proposed algorithm. Row-wise: ground-truth VFOAs. Column-wise: estimated VFOAs. Diagonal terms represent the recall. Table IV M EAN FRR SCORES OBTAINED WITH [26], WITH [31] AND WITH THE PROPOSED METHOD . R ECORDING #26 WAS EXCLUDED FROM THE FRR MEANS AS REPORTED IN [31]. M OREOVER , [31] USES ADDITIONAL CONTEXTUAL INFORMATION . Vicon data RGB data Ba & Odobez [26] 56.5 39.0 Sheikhi [31] 66.6 62.4 Proposed 64.7 54.7 used. D. LAEO Dataset As already mentioned in Section VI-B above, the LAEO annotations are incomplete to estimate the person-wise VFOA at each frame. Indeed, the only VFOA-related annotation is whether two people are looking at each other during the shot. This is not sufficient to know in which frames they are actually looking at each other. Moreover, when more than two people appear in a shot, the annotations don’t specify who are the people that look at each other. For these reasons, we decided to estimate the parameters using Vicon data of the whole Vernissage dataset, i.e. cross-validation. We used the same pipeline as with the Vernissage RGB data to estimate 3D head positions, X̃1:T , from the face bounding boxes. Concerning head orientation, there are two cases: coarse head orientations (manually annotated) and fine head orientations (estimated). Coarse head orientations were obtained in the following way: pan and tilt values were associated with each head orientation label, namely the pan angles −20°, 20°, −80°, 80°, and 180° were assigned to labels frontal-left, frontal-right, profile-left, profile-right, and backwards respectively, while a tilt anble of 0° was assigned to all five labels. Fine head orientations were estimated using the same procedure as in the case of the Vernissage RGB data, namely face detection, face tracking, and head orientation estimation using [38]. Algorithm 1 was used to compute the VFOA for each frame and for each person thus allowing to determine who looks at whom, e.g. Fig. 8. We used two shot-wise, not frame-wise, metrics since the LAEO annotations are for each shot: the shot recognition rate (SRR), e.g. Table V, and the average precision (AP), e.g. Table VI. We note that [4] only provides AP scores. It is interesting to note that the proposed method yields results Ba & Odobez [26] 0.535 0.363 Proposed 0.727 0.479 Table VI AVERAGE PRECISION (AP) OBTAINED WITH [4], WITH BA & O DOBEZ [26] AND WITH THE PROPOSED METHOD . Coarse head orientation Fine head orientation Marin-Jimenez et al. [4] 0.925 0.896 [26] 0.916 0.838 Proposed 0.923 0.890 VIII. C ONCLUSIONS In this paper we addressed the problem of estimating and tracking gaze and visual focus of attention of a group of participants involved in social interaction. We proposed a Bayesian dynamic formulation that exploits the correlation between head movements and eye gaze on one side, and between visual focus of attention and eye gaze on the other side. We described in detail the proposed model. In particular we showed that the entries of the large-sized matrix of VFOA transition probabilities have a very small number of different possibilities for which we provided closed-form formulae. The immediate consequence of this simplified transition matrix is that the associated learning doesn’t require a large training dataset. We showed that the problem of simultaneously inferring VFOAs and gaze directions over time can be cast in the framework of a switching state-space model, which yields tractable learning and inference algorithms. We applied the proposed method to two datasets, Vernissage and LAEO. Vernissage contains several recordings of a humanrobot interaction scenario. We experimented both with motion capture data gathered with a Vicon system and with RGB data gathered with a camera mounted onto a robot head. We also experimented with the LAEO dataset that contains several hundreds of video shots extracted from TV shows. A quite remarkable result is that the parameters obtained by training the model with the Vernissage data have been successfully used for testing the method with the LAEO data, i.e. cross-validation. This can be explained by the fact that social interactions, even in different contexts, share a lot of characteristics. We compared our method with three other methods, based on HMMs [26], on input-output HMMs [31], and on a geometric model [4]. The interest of these methods (including ours) resides in the fact that eye detection, unlike many existing gaze estimation methods, is not needed. This feature makes the above methods practical and effective in a very large number of situations, e.g. social interaction. We note that gaze inference from head orientation is an ill-posed problem. Indeed, the correlation between gaze and head movements is person dependent as well as context 12 Figure 7. Results obtained with the proposed method on RGB data. Gaze directions are shown with green arrows, head reference directions with dark-grey arrows and observed head directions with red arrows. The ground-truth VFOA is shown with a black circle. The top row displays the image of the robot-head camera. Top views of the room show results obtained for the left person (left-p, middle row) and the right person (right-p, bottom row). Figure 8. This figure shows some results obtained with the LAEO dataset. The top row shows results obtained with coarse head orientation and the bottom row shows results obtained with fine head orientation. Head orientations are shown with red arrows. The algorithm infers gaze directions (green arrows) and VFOAs (blue circles). People looking at each others are shown with a dashed blue line. dependent. It is however important to detect gaze whenever the eyes cannot be reliably extracted from images and properly analyzed. We proposed to solve the problem based on the fact that alignments often occur between gaze directions and a finite number of targets, which is a sensible assumption in practice. Contextual information could considerably improve the results. Indeed, additional information such as speaker recognition (as in [31]), speaker localization [40], speech recognition, or speech-turn detection [41] may be used to learn VFOA transitions in multi-party multimodal dialog systems. In the future we plan to investigate discriminative methods based on neural network architectures for inferring gaze direc- tions from head orientations and from contextual information. For example one could train a deep learning network from input-output pairs of head pose and visual focus of attention. For this purpose, one can combine a multiple-camera system, to accurately detect the eyes of several participants and to estimate their head poses, with a microphone-array and associated algorithms to infer speaker and speech information. A PPENDIX A VFOA T RANSITION P ROBABILITIES Using the notations introduced in section III-C, let i, 1 ≤ i ≤ N , be an active target. In section III-C we showed that in 13 Nq Tq Nq +Mq Q X X X X practice the probability transition matrix has up to 15 different entries. For completeness, these entries are listed below. • The VFOA of i at t − 1 is neither an active nor a passive target (k = 0): p̂4 = i p1 =P (Vti = 0|Vt−1 = 0) q,i δk (Vtq,i )δk (Vt−1 ) q=1 i=2 t=2 k=Nq +1 Nq Tq Nq +Mq Q X X X X q,i ) δk (Vt−1 q=1 i=2 t=2 k=Nq +1 i p2 =P (Vti = j|Vt−1 = 0) • The VFOA of i at t − 1 is a passive target (N < k ≤ N + M ): Nq Tq Nq +Mq Q X X X X X p̂5 = q=1 i=2 t=2 k=Nq +1 j6=i,k Nq Tq Nq +Mq Q X X X X i p3 =P (Vti = 0|Vt−1 = k) p4 =P (Vti p5 =P (Vti • = = i k|Vt−1 i j|Vt−1 = k) p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 = = = = = = = = = = = k) i k 0|Vt−1 = k, Vt−1 = 0) i k k|Vt−1 = k, Vt−1 = 0) i k j|Vt−1 = k, Vt−1 = 0) i k 0|Vt−1 = k, Vt−1 = i) i k k|Vt−1 = k, Vt−1 = i) i k j|Vt−1 = k, Vt−1 = i) i k 0|Vt−1 = k, Vt−1 = l) i k k|Vt−1 = k, Vt−1 = l) i k l|Vt−1 = k, Vt−1 = l) i k j|Vt−1 = k, Vt−1 = l) Nq Tq Nq Q X X XX p̂6 = This appendix provides the formulae allowing to estimate the 15 transitions probabilities as explained in section V-A. p̂1 = q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X X XX Nq Tq Nq Q X X XX p̂7 = q,i q,k δk (Vt−1 )δ0 (Vt−1 ) q,i q,k )δ0 (Vt−1 ) δk (Vtq,i )δk (Vt−1 q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X XX X q,i q,k δk (Vt−1 )δ0 (Vt−1 ) q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X X XX X p̂8 = q,i q,k )δ0 (Vt−1 ) δj (Vtq,i )δk (Vt−1 q=1 i=2 t=2 k=1 j6=i,k k6=i Nq Tq Nq Q X X XX q,i δ0 (Vtq,i )δ0 (Vt−1 ) q,i q,k δk (Vt−1 )δ0 (Vt−1 ) q=1 i=2 t=2 k=1 k6=i q=1 i=2 t=2 Nq Tq Q X X X q,i δ0 (Vt−1 ) Nq Tq Nq Q X X XX q=1 i=2 t=2 Nq Tq Q X X XX p̂2 = q,i q,k δ0 (Vtq,i )δk (Vt−1 )δ0 (Vt−1 ) q=1 i=2 t=2 k=1 k6=i A PPENDIX B VFOA L EARNING Nq Tq Q X X X q,i δk (Vt−1 ) q=1 i=2 t=2 k=Nq +1 The VFOA of i at t − 1 is an active target (1 ≤ k ≤ N, k 6= i): =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti =P (Vti q,i ) δj (Vtq,i )δk (Vt−1 q,i δj (Vtq,i )δ0 (Vt−1 ) p̂9 = q,i q,k δ0 (Vtq,i )δk (Vt−1 )δi (Vt−1 ) q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X X XX q=1 i=2 t=2 j6=i Nq Tq Q X X X q,i q,k δk (Vt−1 )δi (Vt−1 ) q=1 i=2 t=2 k=1 k6=i q,i δ0 (Vt−1 ) q=1 i=2 t=2 Nq Tq Nq +Mq Q X X X X p̂3 = Nq Tq Nq Q X X XX q,i δ0 (Vtq,i )δk (Vt−1 ) p̂10 = q=1 i=2 t=2 k=Nq +1 Nq Tq Nq +Mq Q X X X X q=1 i=2 t=2 k=Nq +1 q,i δk (Vt−1 ) q,i q,k δk (Vtq,i )δk (Vt−1 )δi (Vt−1 ) q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X X XX q=1 i=2 t=2 k=1 k6=i q,i q,k δk (Vt−1 )δi (Vt−1 ) 14 Nq Tq Nq Q X X XX X p̂11 = q,i q,k δj (Vtq,i )δk (Vt−1 )δi (Vt−1 ) q=1 i=2 t=2 k=1 j6=i,k k6=i Nq Tq Nq Q X X XX q,i q,k δk (Vt−1 )δi (Vt−1 ) q=1 i=2 t=2 k=1 k6=i Nq Tq Nq Q X X XX X p̂12 = q,i q,k δ0 (Vtq,i )δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X q,i q,k δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X p̂13 = q,i q,k δk (Vtq,i )δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X q,i q,k δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X p̂14 = q,i q,k δl (Vtq,i )δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X q,i q,k δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i Nq Tq Nq Q X X XX X X p̂15 = q,i q,k δj (Vtq,i )δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k j6=i,k,l k6=i Nq Tq Nq Q X X XX X q,i q,k δk (Vt−1 )δl (Vt−1 ) q=1 i=2 t=2 k=1 l6=i,k k6=i ACKNOWLEDGMENTS The authors would like to thank Vincent Drouard for his valuable expertise in head pose estimation and tracking. R EFERENCES [1] E. G. Freedman and D. L. Sparks, “Eye-head coordination during headunrestrained gaze shifts in rhesus monkeys,” Journal of Neurophysiology, 1997. [2] E. G. Freedman, “Coordination of the eyes and head during visual orienting,” Experimental Brain Research, vol. 190, 2008. [3] D. B. Jayagopi et al., “The vernissage corpus: A multimodal humanrobot-interaction dataset,” IDIAP, Tech. Rep., 2012. [4] M. J. Marin-Jimenez, A. Zisserman, M. Eichner, and V. Ferrari, “Detecting people looking at each other in videos,” International Journal of Computer Vision, vol. 106, 2014. [5] L. H. Yu and M. Eizenman, “A new methodology for determining pointof-gaze in head-mounted eye tracking systems,” IEEE Transactions on Biomedical Engineering, vol. 51, Oct 2004. [6] T. Toyama, T. Kieninger, F. Shafait, and A. Dengel, “Gaze guided object recognition using a head-mounted eye tracker,” in Proceedings of the ETRA Symposium, 2012. [7] A. K. A. Hong, J. Pelz, and J. Cockburn, “Lightweight, low-cost, sidemounted mobile eye tracking system,” in IEEE WNYIPW, 2012. [8] K. Kurzhals, M. Hlawatsch, C. Seeger, and D. Weiskopf, “Visual analytics for mobile eye tracking,” IEEE Transactions on Visualization and Computer Graphics, vol. 23, no. 1, pp. 301–310, Jan 2017. [9] P. Smith, M. Shah, and N. Da Vitoria Lobo, “Determining driver visual attention with one camera,” IEEE Transactions on Intelligent Transportation Systems, vol. 4, 2003. [10] K. Krafka, A. Khosla, P. Kellnhofer, H. Kannan, S. Bhandarkar, W. Matusik, and A. Torralba, “Eye tracking for everyone,” in IEEE CVPR, June 2016. [11] Y. Matsumoto, T. Ogasawara, and A. Zelinsky, “Behavior recognition based on head pose and gaze direction measurement,” in IEEE IROS, vol. 3, 2000. [12] T. Ohno and N. Mukawa, “A free-head, simple calibration, gaze tracking system that enables gaze-based interaction,” in Proceedings of the ETRA Symposium. ACM, 2004. [13] F. Lu, Y. Sugano, T. Okabe, and Y. Sato, “Adaptive linear regression for appearance-based gaze estimation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 36, Oct 2014. [14] F. Lu, T. Okabe, Y. Sugano, and Y. Sato, “Learning gaze biases with head motion for head pose-free gaze estimation,” Image and Vision Computing, vol. 32, 2014. [15] E. Murphy-Chutorian and M. Trivedi, “Head pose estimation in computer vision: A survey,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 31, 2009. [16] X. Zabulis, T. Sarmis, and A. A. Argyros, “3D head pose estimation from multiple distant views,” in BMVC, 2009. [17] I. Chamveha, Y. Sugano, D. Sugimura, T. Siriteerakul, T. Okabe, Y. Sato, and A. Sugimoto, “Head direction estimation from low resolution images with scene adaptation,” Computer Vision and Image Understanding, vol. 117, 2013. [18] A. K. Rajagopal, R. Subramanian, E. Ricci, R. L. Vieriu, O. Lanz, and N. Sebe, “Exploring transfer learning approaches for head pose classification from multi-view surveillance images,” International Journal of Computer Vision, vol. 109, 2014. [19] Y. Yan, E. Ricci, R. Subramanian, G. Liu, O. Lanz, and N. Sebe, “A multi-task learning framework for head pose estimation under target motion,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 38, 2016. [20] Z. Qin and C. R. Shelton, “Social grouping for multi-target tracking and head pose estimation in video,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 38, 2016. [21] J. S. Stahl, “Amplitude of human head movements associated with horizontal saccades,” Experimental Brain Research, vol. 126, 1999. [22] H. H. Goossens and A. Van Opstal, “Human eye-head coordination in two dimensions under different sensorimotor conditions,” Experimental Brain Research, vol. 114, 1997. [23] R. Stiefelhagen and J. Zhu, “Head orientation and gaze direction in meetings,” in Human Factors in Computing Systems, 2002. [24] P. Lanillos, J. F. Ferreira, and J. Dias, “A bayesian hierarchy for robust gaze estimation in human-robot interaction,” International Journal of Approximate Reasoning, vol. 87, 05 2017. [25] S. Asteriadis, K. Karpouzis, and S. Kollias, “Visual focus of attention in non-calibrated environments using gaze estimation,” International Journal of Computer Vision, vol. 107, 2014. [26] S. Ba and J.-M. Odobez, “Recognizing visual focus of attention from head pose in natural meetings,” IEEE Transactions on System Men and Cybernetics. Part B., 2009. [27] S. Sheikhi and J.-M. Odobez, “Recognizing the visual focus of attention for human robot interaction,” in Human Behavior Understanding Workshop, 2012. [28] Z. Yucel, A. A. Salah, C. Mericli, T. Mericli, R. Valenti, and T. Gevers, “Joint attention by gaze interpolation and saliency,” IEEE Transactions on System Men and Cybernetics. Part B., 2013. [29] K. Otsuka, J. Yamato, and Y. Takemae, “Conversation scene analysis with dynamic bayesian network based on visual head tracking,” in IEEE ICME, 2006. [30] S. Duffner and C. Garcia, “Visual focus of attention estimation with unsupervised incremental learning,” IEEE Transactions on Circuits and Systems for Video Technology, 2015. [31] S. Sheikhi and J.-M. Odobez, “Combining dynamic head pose–gaze mapping with the robot conversational state for attention recognition in human–robot interactions,” Pattern Recognition Letters, vol. 66, 2015. [32] B. Massé, S. Ba, and R. Horaud, “Simultaneous estimation of gaze direction and visual focus of attention for multi-person-to-robot interaction,” in IEEE ICME, Seattle, WA, Jul. 2016. 15 [33] K. P. Murphy, “Switching Kalman filters,” UC Berkeley, Tech. Rep., 1998. [34] D. Simon, “Kalman filtering with state constraints: a survey of linear and nonlinear algorithms,” Control Theory Applications, IET, 2010. [35] C. M. Bishop, Pattern Recognition and Machine Learning. SpringerVerlag, 2006. [36] P. Viola and M. Jones, “Rapid object detection using a boosted cascade of simple features,” in IEEE CVPR, vol. 1, 2001. [37] S.-H. Bae and K.-J. Yoon, “Robust online multi-object tracking based on tracklet confidence and online discriminative appearance learning,” in IEEE CVPR, 2014. [38] V. Drouard, R. Horaud, A. Deleforge, S. Ba, and G. Evangelidis, “Robust head-pose estimation based on partially-latent mixture of linear regressions,” IEEE Transactions on Image Processing, vol. 26, Jan. 2017. [39] A. Patron-Perez, M. Marszałek, A. Zisserman, and I. D. Reid, “High five: Recognising human interactions in TV shows,” in British Machine Vision Conference, 2010. [40] X. Li, L. Girin, R. Horaud, and S. Gannot, “Multiple-speaker localization based on direct-path features and likelihood maximization with spatial sparsity regularization,” IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 25, no. 10, pp. 1997–2012, Oct 2017. [41] I. Gebru, S. Ba, X. Li, and R. Horaud, “Audio-visual speaker diarization based on spatiotemporal bayesian fusion,” IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. Benoit Massé received the M.Eng. degree in applied mathematics and computer science from ENSIMAG, Institut National Polytechnique de Grenoble, France, in 2013, and the M.Sc. degree in graphics, vision and robotics from Université Joseph Fourier, Grenoble, France, in 2014. Currently he is a PhD student in the PERCEPTION team at INRIA Grenoble RhoneAlpes. His research interests include scene understanding, machine learning and computer vision, with special emphasis on attention recognition for human-robot interaction. Silèye Ba received the M.Sc. (2000) in applied mathematics and signal processing from University of Dakar, Dakar, Senegal, and the M.Sc. (2002) in mathematics, computer vision, and machine learning from Ecole Normale Supérieure de Cachan, Paris, France. From 2003 to 2009 he was a PhD student and then a post-doctoral researcher at IDIAP Research Institute, Martigny, Switzerland, where he worked on probabilistic models for object tracking and human activity recognition. From 2009 to 2013, he was a researcher at Telecom Bretagne, Brest, France working on variational models for multi-modal geophysical data processing. From 2013 to 2014 he worked at RN3D Innovation Lab, Marseille, France, as a research engineer, where he used computer vision and machine learning principles and methods to develop human-computer interaction software tools. From 2014 to 2016 he was a researcher in the PERCEPTION team at INRIA Grenoble Rhône-Alpes, working on machine learning and computer vision models for human-robot interaction. Since May 2016 he is a computer vision scientist with VideoStitch, Paris. Radu Horaud received the B.Sc. degree in Electrical Engineering, the M.Sc. degree in Control Engineering, and the Ph.D. degree in Computer Science from the Institut National Polytechnique de Grenoble, France. In 1982-1984 he was a post-doctoral fellow with the Artificial Intelligence Center, SRI International, Menlo Park, CA. Currently he holds a position of director of research with INRIA Grenoble Rhône-Alpes, where he is the founder and head of the PERCEPTION team. His research interests include computer vision, machine learning, audio signal processing, audiovisual analysis, and robotics. Radu Horaud and his collaborators received numerous best paper awards. He is an area editor of the Elsevier Computer Vision and Image Understanding, a member of the advisory board of the Sage International Journal of Robotics Research, and an associate editor of the Kluwer International Journal of Computer Vision. He was program co-chair of IEEE ICCV’01 and of ACM ICMI’15. In 2013, Radu Horaud was awarded an ERC Advanced Grant for his project Vision and Hearing in Action (VHIA) and in 2017 he was awarded an ERC Proof of Concept Grant for this project VHIALab.
1cs.CV
An Atomistic Fingerprint Algorithm for Learning Ab Initio Molecular Force Fields arXiv:1709.09235v3 [cs.CE] 14 Dec 2017 Yu-Hang Tang , Dongkun Zhang , and George Em Karniadakis Division of Applied Mathematics, Brown University, Rhode Island, USA 02912 Abstract Molecular fingerprints, i.e. feature vectors describing atomistic neighborhood configurations, is an important abstraction and a key ingredient for data-driven modeling of potential energy surface and interatomic force. In this paper, we present the Density-Encoded Canonically Aligned Fingerprint (DECAF) fingerprint algorithm, which is robust and efficient, for fitting per-atom scalar and vector quantities. The fingerprint is essentially a continuous density field formed through the superimposition of smoothing kernels centered on the atoms. Rotational invariance of the fingerprint is achieved by aligning, for each fingerprint instance, the neighboring atoms onto a local canonical coordinate frame computed from a kernel minisum optimization procedure. We show that this approach is superior over PCA-based methods especially when the atomistic neighborhood is sparse and/or contains symmetry. We propose that the ‘distance’ between the density fields be measured using a volume integral of their pointwise difference. This can be efficiently computed using optimal quadrature rules, which only require discrete sampling at a small number of grid points. We also experiment on the choice of weight functions for constructing the density fields, and characterize their performance for fitting interatomic potentials. The applicability of the fingerprint is demonstrated through a set of benchmark problems. Keywords: active learning, Gaussian process regression, quantum mechanics, molecular dynamics, next generation force fields 1 Introduction Molecular Dynamics (MD) simulations have been widely used for studying atomistic systems, e.g. proteins and catalysts, due to their ability to precisely capture transient events and to predict macroscopic properties from microscopic details [1, 2]. In its most prevalent implementation, the trajectory of an atomistic system is integrated in time according to the Newton’s law of motion using forces calculated as the negative gradient of a Hamiltonian, whose functional form and parameters are collectively referred to as a force field [3–5]. Traditionally, the pairwise and many-body terms that comprise a force field are derived empirically by fitting to quantum mechanical calculations and experimental data. Three properties directly relate to the applicability of a force field: accuracy, transferrability, and complexity [6, 7]. Over the years, a large number of force fields have been developed, each carrying 1 Tang et al. Molecular fingerprints Figure 1: In the pipeline of machine learning-driven molecular computations, atomistic neighborhood configurations are transformed into feature vectors, called fingerprints, and used to train non-linear regression models. a particular emphasis over these three properties. However, the combinatorial complexity of atomistic systems can easily outpace force field development efforts, the difficulty of which explodes following the curse of dimensionality [8]. A deceptively simple system that can demonstrate the situation is water, a triatomic molecule with a well-characterized molecular structure. In fact, all common water models, such as SPC-E, TIP3P, and TIP4P, have only succeeded in reproducing a small number of structural and dynamical properties of water due to the difficulty in modeling strong intermolecular many-body effects such as hydrogen bonding and polarization [9, 10]. In lieu of a force field, quantum mechanical (QM) calculations can be employed straightforwardly to drive molecular dynamics simulations. The method achieves significantly better accuracy and transferrability by solving for the electronic structure of the system. However, the computational complexity of QM methods is at least cubic in the number of electrons, and consequently the time and length scales accessible by QM-driven molecular dynamics are severely constrained. Assuming that there is smoothness in the potential energy surface of the atomistic system, one possible strategy to accelerate QM-driven molecular dynamics is to use QM calculations on only a subset of the time steps, and to interpolate for similar atomic configurations [11–14]. A schematic overview of the process is given in Figure 1, which is enabled by the recent development of high-dimensional nonlinear statistical learning and regression techniques such as Gaussian process regression [15] and artificial neural networks [16]. This paper focuses on a particular aspect of the machine-learning-driven molecular computation pipeline, i.e. fingerprint algorithms, whose importance arises naturally from the aforementioned regression protocol. A fingerprint is an encoding of an atomistic configuration that can facilitate regression tasks such as similarity comparison across structures consisting of variable numbers of atoms and elements. As has been pointed out previously [12], a good fingerprint should possess the following properties: 1. It can be encoded as a fixed-length vector so as to facilitate regression (particularly for artificial neural networks). 2. It is complete, i.e. different atomistic neighborhood configurations lead to different fingerprints 2 Tang et al. Molecular fingerprints and vice versa, and the ‘distance’ between the fingerprints should be proportional to the intrinsic difference between the atomistic neighborhood configurations. 3. It is continuous with regard to atomistic coordinates, and the change in fingerprint should be approximately proportional to the structural variation as characterized by, for example, some internal coordinates. 4. It is invariant under permutation, rotation, and translation. 5. It is computationally feasible and straightforward to implement. Before we proceed to the details of our work, we will first briefly review several fingerprints that are closely related to our work, i.e. the Smooth Overlap of Atomic Positions (SOAP) kernel [12], the Coulomb matrix [17], and the Graph Approximated Energy (GRAPE) kernel [18]. Smooth Overlap of Atomic Positions (SOAP): The SOAP kernel is built on the idea of representing atomistic neighborhoods as smoothed density fields using Gaussian kernels each centered at a neighbor atom. Similarity is measured as the inner product between density fields, while rotational invariance is achieved by integrating over all possible 3D rotations, which can be performed analytically using the power spectrum of the density field. In fact, our fingerprint algorithm is inspired by this idea of treating atoms as smoothed density fields. However, we take a different approach to endorse the fingerprint with rotational invariance, and use the Euclidean distance instead of inner product as a distance metric. Coulomb Matrix: The practice of using graphs to represent atomistic neighbor configurations was first implied by the Coulomb matrix, and later further formulated in the GRAPE kernel, where the diffusion distance was proposed as a similarity measure between different local chemical environments [19]. The idea is to construct an undirected, unlabeled graph G = ( V , E ) with atoms serving as the vertices and pairwise interactions weighting the edges. For example, the Coulomb matrix can be treated as a physically-inspired Laplacian matrix [20] M=D−A   2.4 if I = J   0.5 ZI DIJ =    0 if I , J     if I = J 0 AIJ =   Z Z  − kR I−RJ k if I , J I I (1) (2) (3) where the degree matrix D encodes a polynomial fit of atomic energies to the nuclear charge, while the adjacency matrix A corresponds to the Coulombic interactions between all pairs of atoms. Due to the use of only relative positions between atoms in the adjacency matrix, the Coulomb matrix is automatically invariant under translation and rotation. However, the matrix itself is not invariant under permutation, as swapping the order of two atoms will result in an exchange of the corresponding columns and the rows. To address this, the sorted list of eigenvalues of the Coulomb matrix can be used instead as a feature vector, while an `p norm can be used as a distance metric. In practice, due to the fact that the number of 3 Tang et al. Molecular fingerprints neighbor atoms may change, the shorter eigenvalue list is padded with zeros in a distance computation. Graph Approximated Energy (GRAPE): The GRAPE kernel evaluates the simultaneous random walks on the direct product of the two graphs representing two atomistic neighborhood configurations. Permutational invariance is achieved by choosing a uniform starting and stopping distribution across nodes of both graphs. However, the cost of distance computation between two graphs scales as O(N2 ) with a one-time per-graph diagonalization cost of O(N3 ). In the sections below, we present our new fingerprint algorithm, namely the Density-Encoded Canonically Aligned Fingerprint (DECAF). The paper is organized as follows: in Section 2, we introduce a robust algorithm that can determine canonical coordinate frames for obtaining symmetry-invariant projections; in Section 3, we present numerical recipes to use smoothed atomistic density fields as a fingerprint for molecular configuration; in Section 4, we demonstrate the capability of the fingerprint via examples involving the regression of atomistic potential energy surfaces; in Section 5, we discuss the connection between our algorithm and previously proposed ones; we conclude with a discussion in Section 6. 2 2.1 Localized Canonical Coordinate Frame for Rotationally Invariant Description of Atomistic Neighborhood Kernel Minisum Approach To improve model generalization while minimizing data redundancy, a fingerprint algorithm should be able to recognize atomistic structures that differ only by a rigid-body transformation or a permutation of atoms of the same element, and to extract feature vectors invariant under these transformations. As summarized in Table 1, a variety of strategies have been successfully employed by common fingerprint algorithms to achieve rotational invariance. However, these approaches do not provide a means for the acquisition of vector-valued quantities in a rotational invariant form. One approach is to only acquire and interpolate the potential energy, a scalar quantity, and then take the derivative of the regression model. This approach, however, triggers the need for methods to decompose the total energy among the atoms, which is a property of the entire system rather than individual atoms [21]. Another approach proposed by Li et al. [13, 22] is to project vector quantities onto a potentially overcomplete set of non-orthogonal basis vectors obtained from a weighted sum of the atomic coordinate vectors: "   # X kxi k pk . (4) Vk = xi exp − Rc i However, the approach may suffer from robustness issues. For example, all of the Vk generated with different pk will point in the same direction if the radial distance of the atoms are all equal. Further, the 4 Tang et al. Molecular fingerprints configuration with 4 atoms at (r cos ε, r sin ε), (0, r), (−r, 0), (0, −r) leads to Vk = c · [(r cos ε, r sin ε) + (0, r) + (−r, 0) + (0, −r)] = c · r · (1 − cos ε, sin ε). (5) (6) Thus, if ε gets close to zero, Vk will always point toward either (0, 1) or (0, −1), even if the vector quantity of interest may point in other directions. Table 1: Comparison of strategies used by fingerprint algorithms to obtain feature vectors which are invariant under translation, permutation, and rotation. Invariance Fingerprint Coulomb matrix [17] Behler [11] SOAP [12] GRAPE [18] Translation Permutation Rotation relative distance relative distance relative distance relative distance sorting eigenvalues summation summation uniform distribution all vs. all graph ignoring angular information integrating over all rotations uniform distribution Here, we present a robust kernel PCA-inspired algorithm for the explicit determination of a canonical coordinate frame, within which the projection of the atomistic neighborhood is invariant under rigidbody rotation. Furthermore, the canonical coordinate frame can be directly used to capture vector-valued quantities in a rotational-invariant form. Given N atoms with position x1 , . . . , xN ∈ Rd , we first formulate the Lp PCA algorithm as an optimization problem where we seek a unit vector w∗ that maximizes the sum of the projections: w = argmaxkwk=1 ∗ = argmaxkwk=1 N X i=1 N X wT xi p (7) p |ri |p wT ei , (8) i=1 where ri = kxi k is the distance from the origin to atom i, ei = xi /ri is the unit vector pointing toward atom i, respectively. The optimization process can only uniquely determine the orientation of a projection vector up to a line, because wT e ≡ −wT e . As a consequence, further heuristics are needed to identify a specific direction for the PCA vectors. To overcome this difficulty, we generalize the |ri |p term into a weight function g(r) of radial distance p and the wT ei term into a bivariate kernel function κ(w, e) between two vectors. We then attempt to seek a unit vector w∗ that minimizes the kernel summation: w = argminkwk=1 ∗ N X g(ri ) κ(w, ei ). (9) i=1 In particular, we have found a square angle (SA) kernel and an exponentiated cosine (EC) kernel that 5 Tang et al. Molecular fingerprints perform well in practice: 1 arccos2 (wT e), 2   κEC (w, e)  exp −wT e . κSA (w, e)  (10) (11) As shown in Figure 2, both kernels are minimal when w and e are parallel, and monotonically reach maximum when w and e are antiparallel. Intuitively, optimizing the minisum objective function generated by the SA kernel will yield a vector that, loosely speaking, bisects the sector occupied by the atoms. The EC kernel exhibits very similar behavior but leads to a smoother objective function. As shown in Figure 2, this allows for the determination of a projection vector without ambiguity, even if the atom configuration contains perfect symmetry. Square Angle Exponentiated Cosine PCA π 0 0 -π/2 π θ Aw 0 -π π 0 0 -π/2 π/2 π -π θ 0 -π/2 π θ π/2 π -π π Aw -π π/2 Aw Aw π/2 0 π 0 -π/2 θ Figure 2: Shown here is an illustration of the minisum algorithm that determines projection vectors for rotational invariant description of atomistic neighbor configurations. Black dots represent atoms which all carry equal importance. The vectors that point from the origin to the atoms are used as the input to bivariate kernels to compute the minisum objective function, which are drawn in solid lines. For reference, the negated values of the PCA objective function are drawn in dashed lines. Projection vectors are obtained by finding the unit vector w∗ that minimizes the objective function. A major advantage of the kernel minisum approach versus Lp norm-based PCA, lies in its 1) robustness in the presence of structural symmetry; and 2) continuity of the resulting principal axes with respect to angular movement of the input data. As shown in Figure 3, kernel minisum is particularly suitable for atomistic systems where strong symmetries are common and the continuity against angular movement is desired. The minisum framework can also be used with other customized kernels to suit for the characteristics of specific application scenarios. 6 Tang et al. 1.0 Molecular fingerprints (A) Rotational invariance (B) Angular continuity (C) Cluster angular continuity 0.8 0.6 0.4 0.2 0.0 0.0 PCA − L2 0.2 PCA − L1 0.4 Kernel Minisum 0.6 0.8 1.0 Figure 3: A comparison of the orthogonal bases obtained using principal components analysis (PCA) and kernel minisum with the square-angle (MSA) kernel. (A) The PCA algorithm, used in conjunction with the L2 norm, fails to extract a principal axis that rotates with a system that exhibits planar C4 symmetry. Both MSA and PCA with the L1 norm can accommodate this scenario. (B) Both L1 and L2 principal axes change orientation abruptly when the system undergoes a slight angular motion. In contrast, the MSA output is continuous with regard to this movement as it always bisects the angle formed by the atoms and the origin. (C) Loosely speaking, the MSA axis points at the majority direction of the atoms if only a single cluster is present within the cutoff distance, but bisects the angle between two atom clusters. This is different from PCA-based results and should deliver robust rotational invariance as well as continuity. Arrows are drawn at different lengths to improve visual clarity in situations of overlapping. They are to be understood as unit vectors. De-trending is not performed because the radial distances of the atoms carry physically significant information. 2.2 Solving the Kernel Minisum Optimization Problems The optimization problem can be solved very efficiently using a gradient descent algorithm as detailed below. Square Angle: The objective function of the minisum problem using the square angle (SA) kernel is N ASA (w)  1X g(ri ) arccos2 (wT ei ). 2 i=1 7 (12) Tang et al. Molecular fingerprints The gradient of ASA with respect to w is ∇w ASA = N X i=1 Te ) i arccos(w Note that √ T 1−(w ei )2 arccos(wT ei ) ei . −g(ri ) p 1 − (wT ei )2 (13) is singular when w k ei . This can be treated numerically by replacing the removable Te ) i arccos(w singularities at wT ei = 1 with the left-limit limwT ei →1− √ T 1−(w ei )2 = 1, while truncating the gradient at a finite threshold near the poles at wT ei = −1. A local minimum can be iteratively searched for with gradient descent while renormalizing w after each iteration. Moreover, due to the locally quadratic nature of the objective function, we have found that the Barzilai-Borwein algorithm [23] can significantly accelerate the convergence at a minimal cost. The algorithm is presented in Alg. 1. Algorithm 1 Gradient descent for solving the square angle minisum problem. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: function MinSquareAngle(E = [e1 , e2 , . . . , eN ], G = [g1 , g2 , . . . , gN ], w0 ) w ← w0 repeat Compute gradient ∇w using Eq. 13. T Obtain tangential component of gradient ∇⊥ w ← (I − ww )∇w if at step 0 then α ← 0.01 . Small initial step size for bootstrapping else ⊥ (w−w−1 )T (∇⊥ w −∇w−1 ) . Adaptive subsequent steps by Barzilai-Borwein α← ⊥ ⊥ k∇ −∇ k2 w w−1 end if ⊥ Save w as w−1 , save ∇⊥ w as ∇w−1 ⊥ Update w ← w − α ∇w and normalize to unit length until kw − w−1 k < ε return w end function Exponentiated Cosine: (EC) kernel is: The objective function of the minisum problem using the exponentiated cosine AEC (w)  N X   g(ri ) exp −wT ei . (14)   −g(ri ) exp −wT ei ei . (15) i=1 The gradient of AEC with respect to w is ∇w AEC = N X i=1 8 Tang et al. Molecular fingerprints The gradient contains no singularity. However, it is not always locally quadratic or convex. This can cause the Barzilai-Borwein algorithm to generate negative step sizes and consequently divert the search towards a maximum. Luckily, this can be easily overcome by always using the absolute value of the step size generated by the Barzilai-Borwein algorithm. Such enforcement prevents the minimization algorithm from going uphill. The complete algorithm is given in Alg. 2. Algorithm 2 Gradient descent for solving the exponentiated cosine minisum problem. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: function MinExpCosine(E = [e1 , e2 , . . . , eN ], G = [g1 , g2 , . . . , gN ], w0 ) w ← w0 repeat Compute gradient ∇w using Eq. 15. T Obtain tangential component of gradient ∇⊥ w ← (I − ww )∇w if at step 0 then α ← 0.01 . Small initial step size for bootstrapping else ⊥ (w−w−1 )T (∇⊥ w −∇w−1 ) α← . Adaptive subsequent steps by Barzilai-Borwein k∇⊥ −∇⊥ k2 w w−1 end if ⊥ Save w as w−1 , save ∇⊥ w as ∇w−1 ⊥ Update w ← w − α ∇w and normalize to unit length until kw − w−1 k < ε return w end function As shown in Table 2, both Alg. 1 and Alg. 2 converge quickly and consistently across a wide range of representative point configurations commonly found in molecular systems. However, the gradient descent method can only find local optima. Thus, multiple trials should be performed using different initial guesses to ensure that a global minimum can be located. 2.3 Complete Set of Orthogonal Projection Vectors as A Canonical Coordinate Frame In 3D, a complete set of orthogonal bases can be found greedily using the protocol as described in Alg. 3. Specifically, we use the globally optimal solution of the minisum optimization problem as the first basis bα , and the constrained optimal solution in a plane orthogonal to bα as the second basis bβ . Special care must be taken for determining the third basis bγ , as the only degree of freedom now is its sign due to the orthogonality constraint. The straightforward approach of choosing the direction that gives the smaller objective function value may fail, for example, when the system contains improper rotational symmetry. In that case, bα and bβ are interchangeable and both perpendicular to the rotation-reflection axis. As a result, the two candidates of bγ will both align with the rotation-reflection axis and are thus indistinguishable by kernel minisum. However, the projection of the atoms into the two seemingly equivalent coordinate frames are not identical, but rather mirror images of each other. Fortunately, this can be addressed by choosing the direction of the half-space, as created by the plane bα -bα , that yields the smaller kernel objective function between the bisector of bα and bβ versus the points lies in that half-space. This rule can also handle general situations with/without symmetry. 9 Tang et al. Molecular fingerprints Table 2: Listed here is the number of iterations and initial guesses used by the gradient descent algorithm to find an local optimum of the kernel minisum problems. The numbers are averaged over 500 repetitions, and the convergence criterion is 10−14 . In cases where the iterative algorithm does not converge within 64 iterations, the optimization will be restarted with a new guess. Kernel Square Angle Exponentiated Cosine Configuration Itrs./Guess Guesses Itrs./Guess Guesses Single point Two points, angle < π/2 Two points, angle ≥ π/2 Two points, angle = π Planar C3 Planar C4 Tetrahedra Octahedra Improper S4 Improper S6 2D random 10 points 3D random 50 points 8.8 7.1 6.1 6.0 6.2 5.6 10.6 11.7 17.9 14.7 7.2 16.9 1 1 1 1 1 1 1 1 1 1 1.1 1.2 7.9 7.7 6.3 5.6 6.3 6.9 7.7 9.4 23.1 18.0 8.9 14.4 1 1 1 1 1 1 1 1 1 1 1 1 Algorithm 3 The procedure for determining a canonical coordinate frame using kernel minisum. 1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: function GetCanonicalProjection3D(E = [e1 , e2 , . . . , eN ], G = [g1 , g2 , . . . , gN ] ) bα ← global minimum of Minisum(E, G) using multiple runs of Alg. 1 or Alg. 2 if E contains only 1 point then construct arbitrary bβ ⊥ bα bγ ← bα × bβ else bβ ← global minimum of Minisum(E, G) using multiple runs of Alg. 1 or Alg. 2, subjecting to the constraint that the √ probe vector and the gradient are all ⊥ bα d← P (bα + bβ )/ 2 P if ∀ei ; eT (bα ×bβ )≥0 gi κ(d, ei ) ≤ ∀ei ; eT (bα ×bβ )<0 gi κ(d, ei ) then i i bγ ← bα × bβ else bγ ← −bα × bβ end if end if return bα , bβ , bγ end function 10 Tang et al. Molecular fingerprints It is difficult to prove global uniqueness of the kernel minisum solution given the non-convex nature of the exponentiated cosine and square angle kernels. In fact, it seems that the only kernel that allows analytical proof of solution uniqueness is κCOM (w, e)  −wT e, whose solution simply corresponds to the weighted center of mass of the neighbor atoms. Unfortunately, this simple kernel is not robust against reflectional and rotational symmetry. Luckily, the rare cases where two global optimal solutions do coexist can be safely captured by the repeated searching procedure starting from different seeds. Thus, a fingerprint can be extracted using each of the resulting coordidate frame. This may mildly increase the size of the training set, which could even be advantagenous when training data is scarce. 3 3.1 Density-Encoded Canonically Aligned Fingerprint Density Field and Approximation of Volume Integral (A) (B) Atoms Density ρ1 1/2 d(ρ1 , ρ2 ) = [∫ (ρ1 − ρ2 )2 dV] ρ2 Figure 4: (A) Two 1D density profiles, ρ1 and ρ2 , are generated from two different atomistic configurations using atom-centered smoothing kernel functions. The ‘distance’ between them is measured as the L2 norm of their pointwise difference, which corresponds to the orange area in the middle plot. (B) Shown here is a 2D density field using smoothing kernels whose widths depend on the distances of the atoms from the origin. Darker shades indicate higher density. The local density field ρs (r) around a point s is formulated as a superimposition of smoothing kernel functions each centered at a neighbor atom i = 1, 2, . . . , N with relative displacement xi with regard to s and within a cutoff distance Rc : ρs (r) = N X Wc (xi − s) Wd (xi − r) (16) i,kxi −sk<Rc This density field, as has been pointed out previously [12], may be used as a fingerprint of the local atomistic environment. Here, we assume that the smoothing kernel Wd (r) takes the form of a stationary h i Gaussian σ−1 exp − 21 krk2 /σ2 . We also assume that the density scaling function Wc (r), which ensures the continuity of the density field when atoms enter or exit the cutoff distance, is a bell-shaped function with compact support. Further discussion on both Wc (r) and Wd (r) can be found in Section 3.2 and Section 3.3, respectively. 11 Tang et al. Molecular fingerprints To achieve rotational invariance, we project the atom coordinates into the canonical coordinate frame R  [bα , bβ , bγ ] as determined by the kernel minisum algorithm, when generating the density field: N X ρs (r) = Wc (RT xi − s) Wd (RT xi − r). (17) i,kxi −sk<Rc Depending on the specific application, s may not necessarily overlap with any of the xi . Scalar properties can be acquired directly from the target atom, while vector-valued properties, such as force, can be acquired and interpolated in the local orthogonal coordinates as ỹ = RT y. We define the distance between two density fields ρi and ρ j as a weighted volume integral of their pointwise difference: ∆ρs1 s2 (r)  ρs1 (r) − ρs2 (r), !1/2 Z 2 d(ρs1 , ρs2 )  w(r) ∆ρs1 s2 (r) dV (r) . (18) (19) R3 The weight function w(r) provides additional flexibility for emphasizing particular regions of the atomistic neighborhood. It could play an important role for fitting properties with steep gradients, e.g. the repulsive part of the Lennard-Jones potential. We now introduce an optimal quadrature rule to approximate the integral in Eq. 19 in a computationally R P tractable manner. A quadrature rule is a numerical recipe in the form f (x) = N i=0 wi f (xi ), which numerically approximates a definite integral using only discrete evaluations of the integrand. To determine the quadrature nodes and weights, we decompose the volume integral in Eq. 19 into a surface integral over spherical shells and a 1D integral along the radial direction: Z Z 2 R3 w(r) ∆ρs1 s2 (r) dV (r) = ∞ r=0 Z 2π Z ϕ=0 π θ=0 2 ! w(r, θ, ϕ) ∆ρs1 s2 (r, θ, ϕ) sin θ dθ dϕ r2 dr (20) The surface integral can be optimally approximated using the Lebedev quadrature rule [24]: Z ∆Ps1 s2 (r)  2π ϕ=0 Z π θ=0 2 w(r, θ, ϕ) ∆ρs1 s2 (r, θ, ϕ) sin θ dθ dϕ ≈ 4π N a (r) X 2 w(r · qm ) βm ∆ρs1 s2 (r · qm ) , (21) m=1 where βm , qm  (xm , ym , zm ), and Na are the weights, positional unit vectors, and number of the Lebedev nodes, respectively. The radial integral fits well into the generalized Laguerre-Gauss quadrature formula with weight function r2 e−r [25]: ∞ Z 0 ∆Ps1 s2 (r) r2 dr ≈ Nr X αn ern ∆Ps1 s2 (rn ), (22) n=1 where αn , rn , and Nr are the weights, coordinates, and number of the Laguerre nodes, respectively. Combining Eq. 20–22, a composite quadrature rule can be generated consisting of several spherical layers 12 Tang et al. Molecular fingerprints of nodes. As shown in Figure 5, the radial coordinates of the quadrature nodes are determined by the Laguerre quadrature nodes, while the angular positions are determined by the Lebedev quadrature nodes, respectively. This composite quadrature formula translates the 3D volume integral into a summation over discrete grid points: Z 2 R3 w(r) ∆ρs1 s2 (r) dV (r) ≈ 4π Nr N a (n) X X 2 αn βm w(rn · qm ) ern ∆ρs1 s2 (rn · qm ) . (23) n=1 m=1 Using the right hand side of Eq. 23 to replace the integral in Eq. 19, and use the multi-index notation k = (n, m); 1 ≤ n ≤ Nr , 1 ≤ m ≤ Na (n) to enumerate over the quadrature nodes located at rk = rn · qm with weights wk = 4π αn βm w(rn · qm ) ern , we obtain the final discretized formula for computing the distance between the fingerprints: 1/2  N X  2  d(ρs1 , ρs2 ) ≈  wk ρs1 (rk ) − ρs2 (rk )  . (24) k=1 For quick reference, we tabulated in Appendix the values for rn and αn in the Laguerre quadrature of up to 6 points, and the values for qm , βm in the Lebedev quadrature of up to 50 points. In addition, the quadrature nodes could be radially scaled such that the outer most nodes lie at a radius R∗ within some cutoff distance Rc . This allows us to fit a Laguerre quadrature of any order within an arbitrary cutoff distance. The scaled quadrature rule is given by: τ = R∗ / max (rn ) , n 1/2  N  X 2 τ3 wk ρs1 (τ rk ) − ρs2 (τ rk )  . d∗ (ρs1 , ρs2 ) ≈  (25) (26) k=1 Since the scaling is simply constant among all nodes, it can be safely omitted in many regression tasks where only the relative distance between the fingerprints are of significance. 3.2 Radial Weight Functions In this section, we examine two radial weight functions that can be used to fine-tune the density field fingerprint: the density scaling function Wc (r) as appears in Eq. 17 and the weight of integral w(r) as appears in Eq. 19. Driven by the interest of reducing computational cost, we would like to use a cutoff distance to select atoms involved in constructing the density field. However, it is important to ensure that atoms will enter and exit the neighborhood smoothly. This naturally requests that the contribution of an atom to be zero outside of the cutoff, and to increase continuously and smoothly when the atom approaching entrance. Correspondingly, Wc (r) should: 1) become unity at the origin; 2) smoothly approach zero at the cutoff distance; and 3) be twice-differentiable to ensure the differentiability of regression models based on the 13 Tang et al. Molecular fingerprints (A) Laguerre (B) Lebedev (C) Fingerprint by Quadrature 5 4 3 a1 a2 a3 bk 2 1 0 1 Shell 0 Shell 1 Shell 2 Figure 5: (A) Laguerre quadrature nodes with order 1 to 5, normalized by the reciprocal of the largest node onto the unit interval. (B) The a1 , a2 , a3 , and bk class of Lebedev grid points on a unit sphere. (C) The DECAF molecular fingerprint essentially comprises of a grid of quadrature nodes that optimally samples the density field induced by the neighbor atoms. Shown here is an example of one such composite quadrature grid which combines a 3-node Laguerre quadrature rule with three layers of Lebedev quadrature nodes of 3rd, 5th, and 7th order, respectively. fingerprint. Candidates satisfying the above conditions include, for example, a tent-like kernel Wc (r) = (1 − krk/Rc )t , t > 2 (27) and a bell-shaped polynomial kernel with compact support Wc (r) = −b (1 − krk/Rc )a + a (1 − krk/Rc )b , a>b>2 a−b (28) as detailed in Appendix. The approximation of the radial integral using a Laguerre quadrature requires that the integrand, i.e. the pointwise difference between the atomistic density fields, decays sufficiently fast beyond the outermost quadrature nodes in order to achieve acceptable convergence. In addition, the steeply repulsive yet flat attractive interatomic short-range interactions prompt that the sensitivity of fingerprint be adjusted correspondingly in order to avoid numerical difficulties in training a regression model. The weight of the integral, w(r), provides a convenient means for achieving the purpose. Different from Wc (r), w(r) R should instead satisfy the following conditions: 1) is normalized such that w(r)dV(r) = 1; 2) decays sufficiently fast, but not necessarily to 0, beyond the outer most quadrature node; and 3) be sufficiently smooth beyond the outermost quadrature node. Candidates for w(r) includes the tent-like kernel and the bell-shaped kernel for Wc (r), albeit with a different normalization factor. The Laplacian kernel w(r) = exp(− |r| /l)/(8πl3 ), l > 0 (29) with a properly sized length scale l also appears to be a candidate due to its similarity with e−r part of the 14 Tang et al. Molecular fingerprints Bell Weight of Integral w(r) Unity Fingerprint Distance 1 0 Density Scaling Function Wc (r) Tent (A) 6.5 Rc 1.0 Unity (B) 6.5 Rc 1.0 1.0 6.5 Rc (C) Rc 6.5 1.0 6.5 Rc 1.0 (D) Rc 6.5 1.0 Rc 6.5 1.0 1.0 Rc 6.5 Figure 6: Shown here are examples of the distance matrices between fingerprints sampled from a biatomic system. As manifested by the difference between (A) against (B), a bell-shaped weight of integral helps to emphasize the near field. Meanwhile, the obvious discontinuities in the second row of matrices demonstrate the importance of the density scaling function when the fingerprint algorithm uses only atoms within a finite cutoff distance. weight function of the Laguerre quadrature. Note that the constant kernel w(r) = 3/(4πR3c ) (30) may also be a choice as long as the density field already decays fast enough due to the density scaling function Wc (r). In Figure 6, we demonstrate the effect of the density scaling function and the weight of integral on the distance matrices between fingerprint obtained from a pair of atoms. The comparison between panel A and B shows that a bell-shaped integration weight allows the distance between fingerprints to change 15 Tang et al. Molecular fingerprints more rapidly when the atoms are closer but more slowly when the atoms are farther apart. The visible discontinuity in the second row clearly demonstrates the importance of the damping function when only atoms within a finite cutoff distance are used to compute the fingerprint. We further examine the impact of the weight functions on the performance of Gaussian process regression (GPR) using the fingerprint of the interatomic force of a minimal system containing two nitrogen atoms. Despite the simplicity of the system, this case is of fundamental importance because of its ubiquity, and because the fast-growing repulsive regime of the Lennard-Jones potential could cause difficulty as a small change in the system configuration can trigger large changes in the regression target function. In Figure 7, we compare the performance among the combination of four weights of the integral and two density scaling functions. The initial training set consists of two samples collected at rN-N = 1.0 and 6.0. The regression is then refined using a greedy strategy that consecutively learns the point with the largest posterior variance until the largest uncertainty, defined as twice the posterior standard deviation, is less than 0.1 eV/Å. The active learning scheme is able to delivery a GPR model, for each and every combination of the weight functions, that closely fits the target function. However, the numbers of refinement iterations and the achieved accuracy do vary. Therefore, it is important to evaluate and choose the weight functions in the context of specific application scenarios. 3.3 Quadrature Resolution and Density Kernel Despite the formal convergence of the composite quadrature in DECAF, a cost of O(NM) distance calculations and kernel evaluations are needed to sample a density field generated by N atoms using M quadrature nodes. A less prominent cost is associated with the L2 distance calculation, which comes at a cost of O(M) floating point operations. Thus, in practice it is often desirable to use as few nodes as possible to capture only information of the density field within a certain band limit [26]. Accordingly, the integral cutoff Rc , the number of quadrature nodes, and the width of the density kernel need to be tuned to obtain an optimal balance between resolution and computational speed. When designing the composite quadrature rule, we chose the Laguerre quadrature for the radial direction because its nodes are denser near the origin but sparser farther away. This is consistent with our physical intuition that the near field generally has a stronger influence than the far field in an atomistic neighborhood. For example, the Van de Waals potential grows rapidly when atoms are in direct contact, but flattens out of the first coordinate shell. Accordingly, it may be possible for us to use sparser outerlayer grids to reduce the total number of quadrature nodes, while still keeping enough nodes in the inner layers to maintain the sensitivity of the quadrature toward close neighbors. Cooperatively, we can also use non-stationary Gaussian density kernels whose width dependent on the distance from the atom to the origin. In this way, the sparser nodes should still sufficiently sample the smoother far field. Wider kernels at remote atoms also reduce the total difference between the far fields of two fingerprints in a statistical sense. Thus, the contribution of the far field in the integral can be effectively tuned even though the weights on the quadrature nodes remain the same. In Figure 8, we demonstrate how a variable-resolution quadrature can be combined with a widening smoothing density kernel to simultaneously reduce the computational complexity and preserve the quality 16 Tang et al. Molecular fingerprints GPR Truth Scaling of Density seed refine 30 Bell Tent 17 points, RMSE 0.05 eV/Å 11 points, RMSE 0.15 eV/Å f (eV/Å) Bell 20 10 10 0 5 7 2 −10 14 1 3 11 13 0 8 4 12 0 6 9 4 5 1 −20 2 16 points, RMSE 0.06 eV/Å 30 6 7 8 3 10 points, RMSE 0.21 eV/Å f (eV/Å) Tent 10 10 0 5 7 2 −10 13 3 −20 9 1 0 8 4 12 11 3 6 7 0 6 4 5 1 2 20 points, RMSE 0.04 eV/Å 30 11 points, RMSE 0.14 eV/Å 20 f (eV/Å) Laplace Weight of Integral 20 10 11 0 5 7 −10 12 3 14 5 17 −20 1 9 6 16 2 13 8 4 15 10 0 0 4 1 2 21 points, RMSE 0.03 eV/Å 30 6 7 8 3 12 points, RMSE 0.11 eV/Å f (eV/Å) Unity 20 10 5 11 0 −10 6 16 −20 1 3 14 7 18 1 10 4 15 2 9 5 12 0 8 17 13 4 3 7 6 8 1 2 9 0 4 3 N-N distance (Å) 5 6 1 2 2 4 3 N-N distance (Å) 5 6 Figure 7: Gaussian process regression of the force between two nitrogen atoms as a function of interatomic distance using different combinations of radial weight functions. Inset figures are plots of the regression function using distances from the feature space. 17 Tang et al. Molecular fingerprints of the fingerprint. In column A, a dense grid is used to sample density fields generated by a wide smoothing length. By examining the distance matrices of fingerprints sampled during bond stretching and angular stretching movements, we note that the radial similarity decreases monotonically while the angular similarity changes nearly constantly. In column B, the number of quadrature nodes is kept the same, but the smoothing length is reduced as an attempt to increase fingerprint sensitivity. Better response in the near field of the radial direction is obtained, but the linearity in the far field in the angular direction is compromised. In column C, the fingerprint performs even worse due to the combination of a sparser quadrature grid and a small smoothing length. In column D, the performance recovered because we let the smoothing length parameter σ of the Gaussian density kernels Wd (r) depend on the distance from the origin to each atom, and simultaneously adjust the quadrature node density according to this pattern. (A) 50 nodes × 4 layers σ = 1.4 (B) 50 nodes × 4 layers σ = 1.0 (C) 26 nodes × 4 layers σ = 1.0 (D) 6, 14, 26, 38 nodes σ = 0.7 + 0.3r 6.0 Radial 1.0 1.0 6.0 1.0 6.0 1.0 6.0 1.0 6.0 π π/6 π Angular π/6 r=1.5 r=3.0 r=1.5 r=3.0 r=1.5 r=3.0 r=1.5 r=3.0 Fingerprint Distance 0 1 Figure 8: A comparison of fingerprint distance matrices corresponding to bond stretching and angular stretching movements. (A) Dense grid + large smoothing length: radial similarity decreases monotonically while angular similarity changes nearly constantly. (B) Dense grid + smaller smoothing length: better fingerprint sensitivity in the near field for bond stretching, compromised linearity in the far field for angular stretching. (C) Sparser grid + smaller smoothing length: compromised far-field performance for both bond and angular movements. (D) Variable-resolution grid + radially dependent smoothing length: good resolution and linearity in both near and far fields. 18 Tang et al. 4 4.1 Molecular fingerprints Demonstration Method Regression tasks throughout this work are performed using Gaussian process regression (GPR), a nonlinear kernel method that treats training data points as discrete observations from an instantiation of a Gaussian process. Predictions are made using the posterior mean and variance of the joint distribution between the test data and the training data. One particular interesting property about Gaussian process is that the posterior variance may be interpreted as a measure of prediction uncertainty, which can be exploited to design active learning algorithms for sampling expensive functions. The actual computation used our own software implementation which was made publicly available on Zenodo [27]. We use the square exponential covariance kernel to compute the covariance, i.e. correlation, between the samples: 1 kSE (x, x0 ) = σ2 exp[− d(x, x0 )2 /l2 ] 2 where x and x0 are DECAF fingerprints, and d(x, x0 ) the distance between norm as computed by Eq. 24 or Eq. 26. The kernel is stationary, meaning that the covariance depends only on the relative distance between two samples but not their absolute position. The training process searches for the hyperparameters, i.e. the output variance σ and the length scale l, that maximizes the likelihood of the training data. A detailed tutorial on GPR can be found in Ref. [15]. An illustration on the complete workflow of using the density field fingerprint to perform regression tasks is given in Figure 9. 4.2 Potential Energy Surface First, we attempt to fit the potential energy surface of a protonated water dimer system, in a head-to-head configuration, as a function of the oxygen-oxygen distance rO-O and the dihedral angle ϕ between the two planes each formed by a water molecule. As shown in Figure 10A, the system contains an improperly rotational symmetry, which we wish to capture with the kernel minisum algorithm. A GPR model was seeded with 8 training points corresponding to the combinations of rO-O = 2.2, 2.4, 2.6, 2.8 and ϕ = 0, π/2. Subsequently, an active learning protocol was used to greedily absorb points with the highest uncertainty into the training set. Despite that we restricted all training data to be within the subdomain ϕ <= π/2, as shown by Figure 10B and 10C, we are able to accurately reproduce the target function over the entire parameter space after a few active learning steps. The DECAF fingerprint used here is constructed with 3 spherical layers within a cutoff distance Rc of 6.0 Å, each consisting of 14, 26, and 38 Lebedev quadrature nodes, respectively. The weight of integral was chosen as w(r) = W 6,4 (1 − r/Rc ), where W 6,4 is the bell-shaped polynomial as defined in Appendix Eq. 35. The density scaling function Wc (r) = (1 − krk/Rc )3 , where r is the vector from the atom to the fingerprint center, is the tent-like kernel as defined in Eq. 27 with t = 3. The density kernel that sits on the oxygen atoms assumes the form of a non-stationary Gaussian as discussed in h i Section 3.3: WdO (r, r0 ) = σO (r)−1 exp − 21 kr0 k2 /σO (r)2 , σO (r) = 1.5 + 0.25krk with r being the vector from the atom to the fingerprint center and r0 being the vector from the atom to the quadrature node. The 19 Tang et al. Molecular fingerprints Regression Configuration sample prediction uncertainty Kernel Minisum Aligned Configuration prediction Neural Network Gaussian Process Distance/Similarity Matrix Distance Computation Density Field Generation Density Field Quadrature Fingerprint (Feature Vector) Figure 9: Shown here is the workflow of regression using the density field fingerprint. The key stages, i.e. kernel minisum optimization, density field generation, and quadrature-based distance computation, are covered in detail in Sec. 2 and Sec. 3. The fingerprints can also be readily used to train artificial neural networks. 20 Tang et al. Molecular fingerprints density kernel for the hydrogen atoms has a different weight and width to ensure discriminability: i h WdH (r, r0 ) = 0.75 σH (r)−1 exp − 12 kr0 k2 /σH (r)2 , σH (r) = 0.9 + 0.15krk. φ rO-O Oxygen Hydrogen Figure 10: Gaussian process regression is carried out to fit the potential energy surface of a protonated water dimer as a function of two internal variables, i.e. the oxygen-oxygen distance rO-O and the dihedral angle ϕ between the plane determined by the two water molecules. This system contains an improperly rotational symmetry, which can be correctly recognized by the kernel minisum-based algorithm given in Alg. 3. Only a quarter of the domain was used to train the GP, yet the model can accurately predict the energy of the entire parameter space thanks to symmetry detection. 4.3 Geometry Optimization and Vibrational Analysis Next, we demonstrate the usability of fingerprint for fitting vector-valued quantities by performing geometry optimization and vibrational analysis on a single water molecule. The process involves the simultaneous regression of: 1) energy, a molecular scalar quantity; 2) force, a per-atom vector quantity; and 3) dipole, a molecular vector quantity. Correspondingly, we performed GPR of energy and dipole using fingerprints extracted from the center of mass of the molecule, and GPR of force using fingerprints extracted from each atom. Each component of the vector properties is modeled independently as a scalar Gaussian process. The training set consists of 45 configurations uniformly covering the range rO-H = 0.93, 0.95, 0.97, 0.99, 1.05Å and θH-O-H = 101◦ , 105.5◦ , 111◦ . As shown in Table 3, the GPR model can successful drive calculations of the infrared spectrum of the molecule from randomly perturbed initial structures in arbitrary orientation. The fingerprint configuration is the same as in the previous section. 4.4 Molecular Dyanmics Trajectory As shown in Figure 11, here we attempt to fit for the forces felt by the atoms in a benzene molecule along the MD Trajectories as obtained from a sibling database of QM7 [28, 29]. The density kernel for the carbon atoms assumes the same functional form with that of the oxygen atoms, but uses a different smoothing length function σC (r) = 1.2 + 0.2krk. The rest of the parameters are inherited from the previous examples. The training configurations were chosen adaptively in an iterative process using the sum of the GPR posterior variance and the prediction error as the acquisition function. 21 Tang et al. Molecular fingerprints Table 3: Geometry optimization and vibrational analysis of a single water molecule using GPR and our proposed fingerprint algorithm. 256 independent trials were performed using coordinates of water perturbed from equilibrium by a Gaussian noise N(0, 0.15I) followed by a randomly chosen rigid-body rotation. Zero-point energy Static dipole Residual Force Mode 0 1 2 GPR DFT 0.591 ± 0.003 eV 2.1580 ± 0.0001 D 0.0016 ± 0.0005 eV/Å 0.583 eV 2.159 D 0.0003 eV/Å Frequency (cmˆ-1) Intensity (D/A)ˆ2 amuˆ-1 GPR DFT GPR DFT 1576.5 ± 1.4 3819.3 ± 0.9 3916.7 ± 1.6 1602.4 3817.5 3922.6 1.5726 ± 0.0005 0.2516 ± 0.0005 1.3349 ± 0.0028 1.5767 0.2159 1.3401 ⋅ mol−1 ) −1 ⋅ mol−1 ) 0 fz (eV ⋅ Å −1 40 fy (eV ⋅ Å fx (eV ⋅ Å −1 ⋅ mol−1 ) 80 −40 −80 0 25 75 50 100 0 25 Time (ns) MAE = 0.17 (eV ⋅ Å −1 75 50 100 0 25 Time (ns) ⋅ mol−1 ) MAE = 0.12 (eV ⋅ Å −1 75 50 100 Time (ns) ⋅ mol−1 ) MAE = 0.13 (eV ⋅ Å −1 ⋅ mol−1 ) 80 fit 40 0 −40 −80 −80 −40 0 40 80 −80 −40 0 truth truth 40 80 −80 −40 0 40 80 truth Figure 11: The force exerted on the carbon atoms in a benzene molecule was fit using 100 out of the 1200 configurations in a 100-ns molecular dynamics trajectory at 0.5 ns time step size. Color coding corresponds to carbon atom id, while crosses indicate the atomistic configurations used in the GPR training. 22 Tang et al. 5 Molecular fingerprints Connection to Other Fingerprint Algorithms In Figure 12, we compare the ability to distinguish atomistic configurations of our fingerprint as well as SOAP and the Coulomb matrix. Our work is inspired by the SOAP descriptor [12], which proposes the use of smoothed densities to represent atomistic neighborhoods. However, instead of converting the density field into the frequency domain using spherical harmonics, we perform density field sampling and comparison directly in the real space. This is enabled thanks to the available of canonical coordinate frame as computed through the kernel minisum optimization. We have mainly used the L2 norm to compute the distance between atomistic neighborhoods. However, our fingerprint exhibits very similar behavior to SOAP when used together with an inner product formula PN d(ρs1 , ρs2 ) ≈ q k=1 wk ρs1 (rk ) ρs2 (rk ) PN k=1 wk ρs1 (rk ) ρs1 (rk ) (31) q PN k=1 wk ρs2 (rk ) ρs2 (rk ) as demonstrated in Figure 12A. Thus, our fingerprint could be used in conjunction with a wide variety of covariance functions based on either the Euclidean distance or the inner product similarity. (A) (B) 1.0 1.0 Δφ Δφ DECAF-L2 SOAP DECAF-Dot Coulomb 0.0 random rigid-body rotation radial stretch SOAP DECAF − Dot Coulomb 0.0 1.0 11.0 Interatomic Distance random rigid-body rotation i.i.d. noise perturbation 0.0 1.0 Δφ(DECAF-L2 ) Figure 12: A comparison between the distance measure used DECAF, SOAP, and the Coulomb matrix. Fingerprint distances ∆ϕ shown in the plots are measured against ri j = 1.0 in (A) and an randomly chosen initial state in (B). At first sight, DECAF is very different from the Coulomb matrix fingerprint and GRAPE, which are both graph-based algorithms [17, 18]. However, instead of trying to capture the overall density field, if we measure the contribution from each individual atom on the quadrature nodes at z1 , z2 , . . . , zM as a row vector, and stacked up the results to yield the matrix EN×M = k(xi , z j ). ij (32) Then E can be regarded as an incidence matrix [30] between atoms and the quadrature nodes. This is similar to the graph-based abstraction as seen in the Coulomb matrix and the GRAPE kernel. However, in both cases the vertices in the graph represent atoms while the edges represent pairwise interatomic interactions. Here, the density-based incidence matrix adopts the opposite pattern and constructs a graph with the quadrature nodes being vertices and atoms being edges. The adjacency matrix in this case is 23 Tang et al. Molecular fingerprints Molecule Graph x3 H1 Coulomb Matrix O H1 H2 x2 H2 x1 O O O H1 H1 H2 H2 Density-based Sensors z1 z2 z3 z4 O z2 Adjacency Matrix z1 z1 z2 z3 z4 z2 H1 z3 H2 z3 H2 Density-based Incidence Matrix z1 z4 GRAPE O H1 z4 Figure 13: A comparison between graph-based molecular fingerprints. The Coulomb Matrix and the GRAPE kernel construct graphs where nodes corresponds to atoms while the weights on the edges are determined by some pairwise inter-atomic interactions. In contrast, in the density-based incidence matrix we construct a graph on a set of quadrature nodes whose connectivity is weighted by a sum of contributions from individual atoms. computed as the inner product ET E: AM×M = (ET E)i j = ij N X k(xk , zi ) k(xk , z j ). (33) k=1 The weight on the edges, as represented by the elements of the adjacency matrix A, can be interpreted as the total flux as contributed by all paths each bridged by an atom k. We have numerically found that the smallest N eigenvalues (except for the 0 eigenvalue) of the symmetric normalized Laplacian L = I − D−1/2 AD−1/2 , where Dii = δi j X Ai j (34) j is invariant under rotation up to a certain noise level, even if the quadrature nodes do not rotate with the atoms. Nonetheless, this detour appears to represent a pure theoretical interest rather than any practical value. 6 Conclusion In this paper, we presented the Density-Encoded Canonically Aligned Fingerprint (DECAF) by exploring the idea of using smoothed density fields to represent and compare atomistic neighborhoods. One of 24 Tang et al. Molecular fingerprints the key enabling technique in DECAF is a kernel minisum algorithm, which allows the unambiguous identification of a canonically aligned coordinate frame that can be used for rotationally invariant projection of the density field as well as any associated vector quantities. We have performed detailed analysis to study the behavior of the fingerprint by changing various parameter, such as resolution, smoothing length, and the choice of weight functions. We demonstrate that the fingerprint algorithm can be used to implement highly accurate regressions of both scalar and vector properties of atomistic systems including energy, force and dipole moment, and could be a useful building block for constructing data-driven next generation force fields to accelerate molecular mechanics calculations with an accuracy comparable to those driven by quantum mechanical theories and calculators. Acknowledgment This work was supported by the Department of Energy (DOE) Collaboratory on Mathematics for Mesoscopic Modeling of Materials (CM4). This work was also supported by the Army Research Laboratory under Cooperative Agreement Number W911NF-12-2-0023. References [1] G. Zhao, J. R. Perilla, E. L. Yufenyuy, X. Meng, B. Chen, J. Ning, J. Ahn, A. M. Gronenborn, K. Schulten, C. Aiken, and Others. Mature HIV-1 capsid structure by cryo-electron microscopy and all-atom molecular dynamics. Nature, 497(7451):643–646, 2013. [2] K. Lindorff-Larsen, P. Maragakis, S. Piana, and D. E. Shaw. Picosecond to Millisecond Structural Dynamics in Human Ubiquitin. The Journal of Physical Chemistry B, 120(33):8313–8320, 2016. [3] A. K. Rappe, C. J. Casewit, K. S. Colwell, W. A. Goddard, and W. M. Skiff. UFF, a full periodic table force field for molecular mechanics and molecular dynamics simulations. Journal of the American Chemical Society, 114(25):10024–10035, 1992. [4] W. D. Cornell, P. Cieplak, C. I. Bayly, I. R. Gould, K. M. Merz, D. M. Ferguson, D. C. Spellmeyer, T. Fox, J. W. Caldwell, and P. A. Kollman. A second generation force field for the simulation of proteins, nucleic acids, and organic molecules. Journal of the American Chemical Society, 117(19):5179–5197, 1995. [5] W. L. Jorgensen, D. S. Maxwell, and J. Tirado-Rives. Development and Testing of the OPLS All-Atom Force Field on Conformational Energetics and Properties of Organic Liquids. Journal of the American Chemical Society, 118(15):11225–11236, 1996. [6] D. Frenkel and B. Smit. Understanding molecular simulation: from algorithms to applications, volume 1. Academic press, 2001. [7] A. R. Leach. Molecular modelling: principles and applications. Pearson education, 2001. 25 Tang et al. Molecular fingerprints [8] T. Cheng, A. Jaramillo-Botero, W. A. Goddard, and H. Sun. Adaptive accelerated ReaxFF reactive dynamics with validation from simulating hydrogen combustion. Journal of the American Chemical Society, 136(26):9434–9442, 2014. [9] D. Braun, S. Boresch, and O. Steinhauser. Transport and dielectric properties of water and the influence of coarse-graining: Comparing BMW, SPC/E, and TIP3P models. The Journal of Chemical Physics, 140(6):064107, 2014. [10] S. Boonstra, P. R. Onck, and E. van der Giessen. CHARMM TIP3P Water Model Suppresses Peptide Folding by Solvating the Unfolded State. The Journal of Physical Chemistry B, 120(15):3692–3698, 2016. [11] J. Behler. Atom-centered symmetry functions for constructing high-dimensional neural network potentials. The Journal of Chemical Physics, 134(134), 2011. [12] A. P. Bartók, R. Kondor, and G. Csányi. On representing chemical environments. Physical Review B, 87(18):184115, 2013. [13] Z. Li, J. R. Kermode, and A. De Vita. Molecular Dynamics with On-the-Fly Machine Learning of Quantum-Mechanical Forces. Physical Review Letters, 114(9):096405, 2015. [14] A. Khorshidi and A. A. Peterson. Amp: A modular approach to machine learning in atomistic simulations. Computer Physics Communications, 207:310–324, 2016. [15] C. E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning. 2006. [16] D. Specht. A general regression neural network. IEEE Transactions on Neural Networks, 2(6):568–576, 1991. [17] M. Rupp, A. Tkatchenko, K.-R. Muller, O. A. von Lilienfeld, K.-R. R. Müller, O. Anatole Von Lilienfeld, and O. A. von Lilienfeld. Fast and accurate modeling of molecular atomization energies with machine learning. Physical Review Letters, 108(5):58301, 2012. [18] G. Ferré, T. Haut, and K. Barros. Learning molecular energies using localized graph kernels. The Journal of Chemical Physics, 146(11):114107, 2017. [19] H. Y. Sun. Learning over Molecules : Representations and Kernels. PhD thesis, Harvard University, 2014. [20] R. R. Coifman, S. Lafon, A. B. Lee, M. Maggioni, B. Nadler, F. Warner, and S. W. Zucker. Geometric diffusions as a tool for harmonic analysis and structure definition of data: diffusion maps. Proceedings of the National Academy of Sciences of the United States of America, 102(21):7426–31, 2005. [21] A. P. Bartók, M. C. Payne, R. Kondor, and G. Csányi. Gaussian Approximation Potentials: The Accuracy of Quantum Mechanics, without the Electrons. Physical Review Letters, 104(13):136403, 2010. [22] V. Botu and R. Ramprasad. Learning scheme to predict atomic forces and accelerate materials simulations. Physical Review B, 92(9):094306, 2015. 26 Tang et al. Molecular fingerprints [23] J. Barzilai and J. M. Borwein. Two-Point Step Size Gradient Methods. IMA Journal of Numerical Analysis, 8(1):141–148, 1988. [24] D. Lebedev, VI and Laikov. A quadrature formula for the sphere of the 131st algebraic order of accuracy. Doklady. Mathematics, 59(3):477–481, 1999. [25] P. Rabinowitz and G. Weiss. Tables of Abscissas and Weights for Numerical Evaluation of Integrals of the Form \int 0ˆ\infty eˆ{-x} xˆn f(x) dx. Mathematical Tables and Other Aids to Computation, 13(68):285– 294, 1959. [26] B. Leistedt and J. D. McEwen. Exact Wavelets on the Ball. IEEE Transactions on Signal Processing, 60(12):6257–6269, 2012. [27] Y.-H. Tang. Reference implementation for the algorithms presented in ”An Atomistic Fingerprint Algorithm for Learning Ab Initio Molecular Force Fields”, 2017. DOI: 10.5281/ZENODO.1054550. [28] K. T. Schütt, F. Arbabzadah, S. Chmiela, K. R. Müller, and A. Tkatchenko. Quantum-chemical insights from deep tensor neural networks. Nature Communications, 8:13890, 2017. [29] S. Chmiela, A. Tkatchenko, H. E. Sauceda, I. Poltavsky, K. T. Schütt, and K.-R. Müller. Machine learning of accurate energy-conserving molecular force fields. Science Advances, 3(5):e1603015, 2017. [30] J. L. Gross and J. Yellen. Graph theory and its applications. Chapman & Hall/CRC, 2005. [31] M. Liu, G. Liu, and K. Lam. Constructing smoothing functions in smoothed particle hydrodynamics with applications. Journal of Computational and Applied Mathematics, 155(2):263–284, 2003. [32] L. B. Lucy. A numerical approach to the testing of the fission hypothesis. The Astronomical Journal, 82(12), 1977. Appendix Polynomial Smoothing Functions with Compact Support As candidates for the weight of integral and density scaling functions (Section 3.2), a class of compact polynomials that satisfy the criteria [31]: 1. is compactly supported, 2. is strictly positive within some cutoff distance rc , 3. decreases monotonically, 4. is at least twice continuously differentiable with minimal number of non-zero terms are: W a,b (s) = −b sa + a sb , a > b > 2, σ 27 (35) Tang et al. Molecular fingerprints where s = 1 − r/h is the normalized complementary coordinate within the span h of the kernel, and σ = 8πh 3 a b − 3 3 2 2 b + 6b + 11b + 6 a + 6a + 11a + 6 ! (36) is an optional normalization factor to ensure that the integral of the kernel in a 3D ball of radius h is unity. The parameters a and b are free parameters that can be used to adjust the smoothness and width of the kernel, and can take any real numbers satisfying the condition a > b > 2. Note that the kernel W 4,3 is equivalent to the Lucy kernel commonly used in Smoothed Particle Hydrodynamics simulations [32]. The kernel can be evaluated very efficiently using only multiplication and addition when both a and b are integers. 2.5 (A) Kernel 0.0 0.1 −1.0 2.0 0.0 0.8 0.9 1.0 −20 0.0 −3.0 −5.0 (B) Second Derivative 5 −40 −4.0 0.5 20 0 −2.0 1.5 1.0 (B) First Derivative −60 −0.5 0.9 1.0 0 0.9 1.0 0.0 −6.0 −80 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 r/h r/h Gaussian Cosine W 8,6 W 6,5 W 6,3 W 5,4 W 5,3 W 4,3 7 5 W 2,2 r/h Figure 14: Visualization of the polynomial kernels as given in Eq. 35 with a unit support radius. The kernels are bell-shaped with a derivative of 0 at the origin. Both the first and second derivatives of the kernels transition smoothly to 0 at its support radius. In contrast, the Gaussian kernel and its derivatives does not decay to zero at any finite distance, while the second derivative of the Cosine kernel as mentioned in previous work [11, 12] is not zero at the cutoff distance. Table of Quadrature Nodes and Weights In Table 4, we list the nodes and weights of the Laguerre quadrature rules up to Nr = 6, using notations from Eq. 22. In Table 5, we list the nodes and weights of the Lebedev quadrature rules up to Nr = 6, using notations from Eq. 21. The Laguerre and Lebedev quadrature nodes can be combined using Eq. 23-26 into composite grids for sampling the atomistic density field. 28 Tang et al. Molecular fingerprints Table 4: Laguerre quadrature nodes and weights up to 6 points. ================================================================================ n = 0 n = 1 n = 2 n = 3 n = 4 n = 5 -------------------------------------------------------------------------------Nr = 2 r_n 2.0000 6.0000 a_n 1.5000 0.5000 -------------------------------------------------------------------------------Nr = 3 r_n 1.5174 4.3116 9.1710 a_n 1.0375 0.9058 0.0568 -------------------------------------------------------------------------------Nr = 4 r_n 1.2268 3.4125 6.9027 12.4580 a_n 0.7255 1.0634 0.2067 0.0044 -------------------------------------------------------------------------------Nr = 5 r_n 1.0311 2.8372 5.6203 9.6829 15.8285 a_n 0.5209 1.0667 0.3835 0.0286 0.0003 -------------------------------------------------------------------------------Nr = 6 r_n 0.8899 2.4331 4.7662 8.0483 12.6004 19.2620 a_n 0.3844 0.9971 0.5361 0.0795 0.0029 0.0000 ================================================================================ 29 Tang et al. Molecular fingerprints Table 5: Lebedev quadrature nodes and weights up to 50 points. ================================================================================ Na = 6 x_m y_m z_m b_m m = 0,1 + -1.00000 0.00000 0.00000 0.16667 m = 2,3 0.00000 + -1.00000 0.00000 0.16667 m = 4,5 0.00000 0.00000 + -1.00000 0.16667 -------------------------------------------------------------------------------Na = 14 x_m y_m z_m b_m m = 0,1 + -1.00000 0.00000 0.00000 0.06667 m = 2,3 0.00000 + -1.00000 0.00000 0.06667 m = 4,5 0.00000 0.00000 + -1.00000 0.06667 m = 6 -13 + -0.57735 + -0.57735 + -0.57735 0.07500 -------------------------------------------------------------------------------Na = 26 x_m y_m z_m b_m m = 0,1 + -1.00000 0.00000 0.00000 0.04762 m = 2,3 0.00000 + -1.00000 0.00000 0.04762 m = 4,5 0.00000 0.00000 + -1.00000 0.04762 m = 6-9 0.00000 + -0.70711 + -0.70711 0.03810 m = 10 -13 + -0.70711 0.00000 + -0.70711 0.03810 m = 14 -17 + -0.70711 + -0.70711 0.00000 0.03810 m = 18 -25 + -0.57735 + -0.57735 + -0.57735 0.03214 -------------------------------------------------------------------------------Na = 38 x_m y_m z_m b_m m = 0,1 + -1.00000 0.00000 0.00000 0.00952 m = 2,3 0.00000 + -1.00000 0.00000 0.00952 m = 4,5 0.00000 0.00000 + -1.00000 0.00952 m = 6 -13 + -0.57735 + -0.57735 + -0.57735 0.03214 m = 14 -17 + -0.45970 + -0.88807 0.00000 0.02857 m = 18 -21 + -0.88807 + -0.45970 0.00000 0.02857 m = 22 -25 + -0.45970 0.00000 + -0.88807 0.02857 m = 26 -29 + -0.88807 0.00000 + -0.45970 0.02857 m = 30 -33 0.00000 + -0.45970 + -0.88807 0.02857 m = 34 -37 0.00000 + -0.88807 + -0.45970 0.02857 -------------------------------------------------------------------------------Na = 50 x_m y_m z_m b_m m = 0,1 + -1.00000 0.00000 0.00000 0.01270 m = 2,3 0.00000 + -1.00000 0.00000 0.01270 m = 4,5 0.00000 0.00000 + -1.00000 0.01270 m = 6-9 0.00000 + -0.70711 + -0.70711 0.02257 m = 10 -13 + -0.70711 0.00000 + -0.70711 0.02257 m = 14 -17 + -0.70711 + -0.70711 0.00000 0.02257 m = 18 -25 + -0.57735 + -0.57735 + -0.57735 0.02109 m = 26 -33 + -0.30151 + -0.30151 + -0.90453 0.02017 m = 34 -41 + -0.30151 + -0.90453 + -0.30151 0.02017 m = 42 -49 + -0.90453 + -0.30151 + -0.30151 0.02017 ================================================================================ 30
5cs.CE
arXiv:1711.03147v1 [cs.AI] 8 Nov 2017 On the incorporation of interval-valued fuzzy sets into the Bousi-Prolog system: declarative semantics, implementation and applications Clemente Rubio-Manzanoa , Martı́n Pereira-Fariñab b a Dep. of Information Systems, University of the Bı́o-Bı́o, Chile. Centre for Argument Technology, University of Dundee, UK. Departamento de Filosofı́a e Antropoloxı́a, Universidade de Santiago de Compostela,Spain. Abstract In this paper we analyse the benefits of incorporating interval-valued fuzzy sets into the Bousi-Prolog system. A syntax, declarative semantics and implementation for this extension is presented and formalised. We show, by using potential applications, that fuzzy logic programming frameworks enhanced with them can correctly work together with lexical resources and ontologies in order to improve their capabilities for knowledge representation and reasoning. Keywords: Interval-valued fuzzy sets, Approximate Reasoning, Lexical Knowledge Resources, Fuzzy Logic Programming, Fuzzy Prolog. 1. Introduction and Motivation Nowadays, lexical knowledge resources as well as ontologies of concepts are widely employed for modelling domain independent knowledge [1, 2] or Email address: [email protected] (Clemente Rubio-Manzano) Preprint submitted to Summited to Studies of Computational Intelligent SeriesNovember 16, 2017 by automated reasoners [3]. In the case of approximate reasoning, this makes possible to incorporate general knowledge into any system, which is independent of the programmer’s background [4]. Inside the former and current frameworks of fuzzy logic programming [5, 6, 7, 8, 9, 10], we argue that lexical reasoning might be an appropriate way for tackling this challenge, because of this type of knowledge is usually expressed linguistically. However, from a computational point of view, this source of information involves vagueness and uncertainty and, consequently, it must be specifically addressed. Fuzzy set theory (FS) is a good candidate, but it shows some particular limitations to this aim: i) sometimes, words mean different things to different people and this generates and additional layer of uncertainty that cannot be adequately handled by FS; ii) the definition of membership functions for word meaning is also a debatable question and, therefore, achieving an agreement by means of a standard fuzzy set it is difficult; and, iii) with respect to semantic similarity measures used in this proposal, there is not a dominant one and, therefore, for two given words, different degrees of resemblance can be obtained with the resulting additional level of uncertainty. In the specific field of fuzzy logic programming and fuzzy Prolog systems, little attention has been paid to the impact of this type of high degree of uncertainty and vagueness inherent to lexical knowledge, which is used in the definition of knowledge bases and inference processes. Next, a very simple example is introduced in order to illustrate i) and ii) in the building of a 2 Prolog knowledge base. Example 1. Suppose that we extract from Internet two people’s opinions about a particular football player. The first one says “a is a normal player” and the second one says “a is a bad player”. If we consider the label for qualifying the highest quality (e.g., “good”) as a basic component, this lexical knowledge could be modelled by using two annotated facts as: “football player(a,good):-0.8.” and “football player(a,good):-0.6.”, respectively. In this case, we use “football player(a,good):-0.6.” given the infimum is usually employed. However, as it can be observed, the information of the first person is lost. Case iii) deserves a special attention, given it involves the use of independent linguistic resources (such as WordNet Similarity [11]). As we said, this tool provide us different measures according to alternative criteria for assessing the degree of similarity between two words. In Example 2, we illustrate this situation by means of a simple case. Example 2. Suppose we have the fact “loves(a,b)” and we extract the closeness between “loves” and “desires” by using two different semantics measures obtaining 0.8 and 0.6. Therefore, in order to represent this semantic knowledge we could employ two facts either “desires(a,b):-0.8” or “desires(a,b):0.6”. In order to address both Examples 1 and 2 inside the same frame, we propose to enhance the Bousi-Prolog system with interval-valued fuzzy sets (IVFSs), since they allow us to capture the uncertainty associated to lexical knowledge better than FS. Several advantages have pointed out for dealing with environments with high uncertainty or imprecision using IVFSs, such as [12]; other authors have also shown that IVFSs can generate better results than standard FSs [13]. Additionally, the use of intervals for describing 3 uncertain information has been successfully applied in the realms of decision making, risk analysis, engineering design, or scheduling [14]. Both Example 1 and Example 2 can be easily modelled by means of IVFSs, using and interval for combining information of the different sources into a single fact such as “football player(a,good):-[0.6,0.8]” or “desires(a,b):[0.6,0.8]”, respectively. The main contribution of this paper is to design and implement an intervalvalued fuzzy logic language, and to incorporate it into the Bousi-Prolog system [15]. This task involves different challenges both from theoretical and implementation points of view. The former entails adding a IVFSs arithmetic into the Warren Abstract Machine based on Similarity (SWAM) [16]; the latter, means to establish a (model-theoretic) declarative semantics for the language in the classical way, formalising the notion of least interval valued fuzzy Herbrand model for interval-valued fuzzy definite programs. This paper is divided into the following sections: section 2 introduces the concepts that support our approach; section 3 describes the details of the syntax, semantics and implementation of the proposed language; section 4 analyses different realms where this programming language can be applied; in section 5, the main differences between this proposal an others that are described in the literature are discussed; and, finally, section 6 summarizes our main conclusions and some ideas for future work. 4 2. Preliminary Concepts 2.1. Interval-Valued Fuzzy Sets IVFSs are a fuzzy formalism based on two membership mappings instead of a single one, like in standard FSs. Each one of these membership functions are called, lower membership function and upper membership function. Both are established on a universe of discourse X , and they map each element from X to a real number in the [0, 1] interval, where the elements of X belongs to A according to an interval. Definition 2.1. An interval-valued fuzzy set A in X is a (crisp) set of ordered triples: A = {(x, µA (x), µA (x)) : x ∈ X ; µA (x), µA (x) : X → [0, 1]} where: µ, µ are the lower and the upper membership functions, respectively, satisfying the following condition: 0 ≤ µA (x) ≤ µA (x) ≤ 1 ∀x ∈ X As can be observed in Definition 2.1, those intervals are included in [0, 1] and closed at both ends. On the other hand, some arithmetic operations on interval-numbers have been recalled since they are useful in operating on cardinalities of IVFSs. Let a=[a, a], b=[b, b] be intervals in R, and r ∈ R+. The arithmetic operations ’+’, ’-’, ’·’ and power are defined as follows: [a, a] + [b, b] = [a + b, a + b]; (1) [a, a] − [b, b] = [a − b, a − b]; (2) [a, a] · [b, b] = [min(a · b, a · b, a · b, a · b), max(a · b, a · b, a · b, a · b)]; ([a, a])r = [ar , ar ] for non-negative a, a 5 (3) (4) The operations of union and intersection for IVFSs are defined by triangular norms. Let A, B be IVFSs in X , t a t-norm and s a t-conorm. The union of A and B is the interval-valued fuzzy set A∪B with the membership function: µA∪B (x) = [s(µA (x), µB (x)), s(µA (x), µB (x))]. The intersection of A and B is the IVFSs A∩B in which µA∩B (x) = [t(µA (x), µB (x)), t(µA (x), (µB (x))]. Thus, de Morgan’s laws for IVFSs A,B in X are: (A ∪ B)c = Ac ∩ B c and (A ∩ B)c = Ac ∪ B c . Let L be a lattice of intervals in [0, 1] that satisfies: L = [x1 , x2 ] ∈ [0, 1]2 with x1 ≤ x2 ; (5) [x1 , x2 ] ≤L [y1 , y2 ] if f x1 ≤ y1 and x2 ≤ y2 . (6) Also by definition: [x1 , x2 ] <L [y1 , y2] ⇔ x1 < y1 , x2 ≤ y2 or x1 ≤ y1 , x2 < y2 ; (7) [x1 , x2 ] =L [y1 , y2 ] ⇔ x1 = y1 , x2 = y2 . (8) Hence, 0L = [0, 0] and 1L = [1, 1] are the smallest and the greatest elements in L. 2.2. Approximate Deductive Reasoning When we consider a collection of imprecise premises and a possible imprecise conclusion inferred from them in a Prolog program, we are applying a process of approximate deductive reasoning. These set of statements can 6 be interpreted under two different frames [17] in a Prolog program: conditional and set-based interpretations. If the former is assumed, an imprecise premise is an assertion qualified by a degree of truth; e.g. “John is tall with [0.2,0.5]” means that the degree of truthfulness of this sentence using and IVFS is [0.2, 0.5]. On the other hand, if the latter is adopted, the interval that qualifies the sentence means the degree of membership of an element to a specific set; e.g., “John is tall with [0.2,0.5]” means that the membership of John to the set of tall people is [0.2, 0.5]. The conclusion inferred from an imprecise premise must be also qualified by the same type of degree; e.g. “John is a good player with [0.2,0.5]”. In order to preserver the coherence with classical Prolog, we adopt the propositional interpretation (the interval indicates the degree of truth of the assertion) and, consequently, approximate deductive reasoning is based on multi-valued modus ponens [18]: Q, [α, α] (9) A ← Q, [β, β] (10) A, T ([α, α], [β, β]] (11) If we have (9) and (10), we can deduce (11) with T a t-norm defined on the lattice L([0, 1]). 7 3. Simple Interval-valued fuzzy prolog: syntax, semantics and implementation The design of a programming language involves three main steps. Firstly, the definition of the syntax; secondly, the elaboration of a formal study of its semantics; and thirdly, an implementation of the system. In order to address the tasks related with syntax and semantics, we will follow the guidelines established in [19] and [20]1 ; for the implementation task, we will follow the guidelines detailed in [16]. 3.1. Sintax An Interval-valued fuzzy program conveys a classical Prolog knowledge base and a set of IVFSs, which are used for annotating the facts by means of an interval-valued fuzzy degree: p(t1 , . . . , tn )[α, α]. Definition 3.1. An interval-valued fuzzy definite clause is a Horn clause of the form A[α, α] or A ← B1 , . . . , Bn [β, β], where A is called the head, and B1 , . . . , Bn denote a conjunction which is called the body (variables in a clause are assumed to be universally quantified). Definition 3.2. An interval-valued fuzzy definite program is a finite set of interval-valued fuzzy clauses. Example 3. Let Π = {p(X) ← q(X), q(a)[0.8, 0.9], q(b)[0.7, 0.8]} be an intervalvalued fuzzy definite program, Π generates a first order language, L, whose alphabet is comprised of the set of variable symbols, X , constant symbols, C, function symbols, F and predicate symbols, P, which appear in the clauses of Π. We assume that the first order language L has, at least one constant symbol; i.e., an assertion. If there are not constants available in the alphabet, an artificial constant “a” must be added to it. The first order language L generated by Π is: X = {x}, C = {a, b, c}, F = ∅ and P = {p, q, r}. 1 We assume familiarity with the theory and practice of logic programming. 8 3.2. Declarative Semantics In logic programming, the declarative semantics for a program is traditionally formulated on the basis of the least Herbrand model (conceived as the infimum of a set of interpretations). In this section, we formally introduce the semantic notions of Herbrand interpretation, Herbrand model and least Herbrand model for an interval-valued fuzzy program Π, in order to characterise it. In our framework, truth-values of the facts are modelled in terms of interval-valued degrees [α, α] with 0 ≤ α ≤ α ≤ 1. An interval-valued fuzzy interpretation I is a pair hD, J i where D is the domain of the interpretation and J is a mapping which assigns meaning to the symbols of L: specifically n-ary relation symbols are interpreted as mappings D n −→ L([0, 1]). In order to evaluate open formulas, we have to introduce the notion of variable assignment. A variable assignment, ϑ, w.r.t. an interpretation I = hD, J i, is a mapping ϑ : V −→ D, from the set of variables V of L to the elements of the interpretation domain D. This notion can be extended to the set of terms of L by structural induction as usual. The following definition formalises the notion of valuation of a formula in our framework. Definition 3.3. Given an interval-valued fuzzy interpretation I and a variable assignment ϑ in I, the valuation of a formula w.r.t. I and ϑ is: 1. (a) I(p(t1 , . . . , tn ))[ϑ] = p̄(t1 ϑ, . . . , tn ϑ), where J (p) = p̄; (b) I(A1 , . . . , An ))[ϑ] = inf {I(A1 )[ϑ], . . . , I(An )[ϑ]}; 2. I(A ← Q)[ϑ] = 1 if I(A) >= I(Q); I(A ← Q)[ϑ] = I(A)[ϑ] if I(A) < I(Q); 9 3. I((∀x)C)[ϑ] = inf{I(C)[ϑ′ ] | ϑ′ x–equivalent to ϑ} where p is a predicate symbol, A and Ai atomic formulas and Q any body, C any clause, T is any left-continuous t-norm defined on L([0, 1]). An assignment ϑ′ is x–equivalent to ϑ when zϑ′ = zϑ for all variables z 6= x in V. Definition 3.4. Let L be a first order language. The Herbrand universe UL for L, is the set of all ground terms, which can be formed out of the constants and function symbols appearing in L. Definition 3.5. Let L be a first order language. The Herbrand base BL for L is the set of all ground atoms which can be formed by using predicate symbols from L with ground terms from the Herbrand universe as arguments. Example 4. Let us consider again the language L generated by the program Π of Example 3, the Herbrand universe UL = {a, b, c} and the Herbrand base: BL = {p(a), p(b), p(c), q(a), q(b), q(c), r(a), r(b), r(c)}. It is well-known that, in the classical case, it is possible to identify a Herbrand interpretation with a subset of the Herbrand base. Therefore, a convenient generalization of the notion of Herbrand interpretation to the interval-valued fuzzy case consists in establishing an interval-valued fuzzy Herbrand interpretation as an interval-valued fuzzy subset of the Herbrand base. Definition 3.6 (Interval-valued fuzzy interpretation). Given, a first order language L, an interval-valued fuzzy Herbrand interpretation for L is a mapping I : BL −→ L([0, 1]). Hence, the truth value of a ground atom A ∈ BL is I(A). Sometimes we will represent an interval-valued fuzzy Herbrand interpretation I extensively: as a set of pairs {hA, [α, α]i | A ∈ BL and [α, α] = I(A)}. Now, we introduce the notion of Interval-valued Fuzzy Herbrand Model, which is formalised in Definitions 3.7 and 3.8. We employ a declarative 10 semantics based on a threshold [21, 20]. Intuitively, a threshold [λ, λ] is delimiting truth degrees equal o greater that [λ, λ] as true. Therefore, we are going to speak of Interval-valued Fuzzy Herbrand Model at level [λ, λ] or simply [λ, λ]-model. Definition 3.7. An Interval-valued fuzzy Herbrand Interpretation is a [λ, λ]model of an interval-valued fuzzy clause C[α, α] if and only if I(C) ≥ [α, α] ≥ [λ, λ]. Definition 3.8. An Interval-valued fuzzy Herbrand Interpretation is a [λ, λ]model of an interval-valued fuzzy program Π if and only if I is a [λ, λ]-model for each clause C[α, α] ∈ Π. Theorem 3.9. Let Π be an Interval-valued fuzzy program and suppose Π has a [λ, λ]-model. Then Π has a Herbrand [λ, λ]-model. Proof 1. Suppose that M is a [λ, λ]-model of Π. Let M′ be an Intervalvalued fuzzy Herbrand interpretation: M′ = {A ∈ BΠ | M(A) ≥ [λ, λ]}. We are going to prove that this interpretation is a [λ, λ]-model for all clauses of Π. Let C any clause, by initial supposition and by definition of [λ, λ]-model for an interval-valued fuzzy program, we have that: C ≡ ∀x1 , . . . , xn (p(x1 , . . . , xn ) ← q1 (x1 , . . . , xn ) ∧ . . . ∧ qm (x1 , . . . , xn ))[β, β] M is a [λ, λ]-model of C iff ∀a1 , . . . , an ∈ UL , M(C) ≥ [β, β] ≥ [λ, λ]. Let a1 , . . . , an ∈ UL then we have that M(p(a1 , . . . , an )) = [β, β] ≥ [λ, λ] what implies that M′ (p(a1 , . . . , an )) ≥ [λ, λ] Definition 3.10. Let Π be an interval-valued fuzzy program. Let A be an interval-valued fuzzy clause of Π. Then A is a logical consequence of Π at level [λ, λ] if and only if for each interval-valued fuzzy interpretation I, if I is a [λ, λ]-model for Π then I is a [λ, λ]-model for A. Proposition 3.11. A is a logical consequence of an interval-valued fuzzy program Π at level [λ, λ] if and only if for every interval-valued fuzzy Herbrand interpretation I for Π, if I is a [λ, λ]-model for Π, it is an interval-valued fuzzy Herbrand [λ, λ]-model for A. 11 Proof 2. First, let us suppose that A is a logical consequence for Π at level [λ, λ], then, by definition, for any interval-valued fuzzy interpretation I if I is [λ, λ]-model for Π, it is a [λ, λ]-model for A. Moreover, by the Theorem 3.9, there must exist I’ which being an interval-valued fuzzy Herbrand model for Π at level [λ, λ], it is a [λ, λ]-model for A. This establishes the first side of the argument. Now, we have that for every interpretation I, if I is a Herbrand model for Π at level [λ, λ], it is a Herbrand [λ, λ]-model for A. Let M be an interpretation, not necessarily Herbrand, which is a [λ, λ]-model for Π. We have that: M′ = {p(t1 , . . . , tn )[α, α] with p(t1 , . . . , tn ) ∈ BL | M(p(t1 , . . . , tn )) ≥ [α, α] ≥ [λ, λ]} and by the Theorem 3.9 M’ is a [λ, λ]model for Π. And so it is for A. So, M is a [λ, λ]-model for all ground instances A’ of A. As result M is a [λ, λ]-model for A’, hence for A and A’. This establishes the other side of the argument. The ordering ≤ in the lattice L([0, 1]) can be extended to the set of interval-valued fuzzy interpretation as follows: I1 ⊑ I2 iff I1 (A) ≤ I2 (A) for all interval-valued fuzzy atom A ∈ BL . It is important note that the pair hH IV F , ⊑i is a complete lattice. Then it comes equipped with t-norms and t-conorms, that is, T (I1 , I2 ) is an interval-valued fuzzy interpretation for all A ∈ BL , and t(I1 , I2 ) an interval-valued fuzzy interpretation for all A ∈ BL . Therefore, the top element of this lattice is hA, [1, 1]i with A ∈ BL and the bottom element is hA, [0, 0]i with A ∈ BL . Interval-valued fuzzy interpretations have an important property which allow us to characterize the semantics of an interval-valued fuzzy program Π. Definition 3.12. If M1 is a model of Π at level [λ1 , λ1 ] and M2 is a model of Π at level [λ2 , λ2 ], then M1 ∩ M2 contains the interval-valued fuzzy atom in both M1 and M2 but to degree min([λ1 , λ1 ], [λ2 , λ2 ]). Proposition 3.13 (Intersection Property of Models: Min-Model). Let Π be an interval-valued fuzzy program. Let M1 , . . . , Mn be a non-empty set of 12 model for Π at levels [λ1 , λ1 ] . . . [λn , λn ], respectively. Then min([λ1 , λ1 ] . . . [λn , λn ]) is a min-model for Π. T (M1 , . . . , Mn ) ≥ Proof 3. We prove this proposition by induction on the number of interpretations i: 1. Base Case (i=2). Let M1 and M2 be models for Π at levels [λ1 , λ1 ] and [λ2 , λ2 ]. Then for all interval-valued fuzzy clause C, M1 (C) ≥ [λ1 , λ1 ] and M2 (C) ≥ [λ2 , λ2 ], so M1 ∩ M2 is a min([λ1 , λ1 ], [λ2 , λ2 ])model for Π; 2. Inductive Case (i=n). Let M1 , M2 , . . . Mn be models for Π at levels [λ1 , λ1 ] . . . [λn , λn ]. Then for all interval-valued fuzzy clause C, Mi (C) ≥ min([λi , λi ]), so by the properties of the minimum. Definition 3.14. Let Π be an interval-valued fuzzy program. The least model T for Π is defined as follows: M = {I(A) ≥ [λ, λ] | A ∈ BL }. We call it a min-interval-valued fuzzy degree [λ, λ]min . Theorem 3.15. Let Π an interval-valued fuzzy program. Let M be the least model of Π. Let A ∈ BL a ground atom of the interval-valued fuzzy Herbrand base. M(A) ≥ [λ, λ]min if and only if A is logical consequence of Π at level [λ, λ]min . T Proof 4. First, by definition M = {I(A) ≥ [λ, λ] | A ∈ BL }. Hence, for all model I of Π, I(A) ≥ M(A) ≥ [λ, λ]min . That is, A is a logical consequence for Π at level [λ, λ]min . This establishes the first side of the argument. Now, If A is a logical consequence of Π by definition all model I for Π, I is a [λ, λ]min -model T for A. That is, I(A) ≥ [λ, λ]min . Therefore, by definition of least model, (I(A)) ≥ [λ, λ] what implies that M ≥ [λ, λ]min . This establishes the another side of the argument. 3.3. Fixpoint Semantics In this section, we give a deeper characterisation of the least Herbrand model for an interval-valued fuzzy program Π using fixpoint concepts. This is possible because of each interval-valued fuzzy program has associated a complete lattice of interval-valued fuzzy Herbrand interpretations and 13 we can define a continuous operator on that lattice. This allows us to provide a constructive vision of the meaning of a program by defining an immediate consequences operator and to construct the least Herbrand model by means of successive applications. Definition 3.16 (Fixpoint Characterization of the least Herbrand model). Let Π be an interval-valued fuzzy program, the mapping O : 2BL → 2BL is defined as follows. Let I be an interval-valued fuzzy Herbrand interpretation, then: O = {A ∈ BL : A ← B1 , . . . , Bn [α, α] is a ground instance of a clause in Π and I(Bi ) ≥ [α, α] ≥ [λ, λ] where I(A) ≥ inf (I(B1 , . . . , Bn ))} As in the case of classical logic programming, interval-valued fuzzy Herbrand interpretations which are models can be characterised in terms of the operator O. Theorem 3.17. Let Π be an interval-valued fuzzy program. Let I be an interval-valued fuzzy Herbrand interpretation of Π. I is [λ, λ]-model for Π if and only if O(I) ⊆ I. Proof 5. I is a [λ, λ]-model for Π if and only if for all clause C in Π then I(C) ≥ [λ, λ]. Therefore, it is fulfilled if and only if for every variable assignment ϑ, I(Cϑ) ≥ [λ, λ]. Therefore, supposing without loss of generality that C ≡ A ← B1 , . . . , Bn [α, α] then I(A ← B1 , . . . , Bn ϑ) ≥ [λ, λ], by the properties of the t-norm minimun I(B1 , . . . , Bn ϑ) ≥ [α, α] ≥ [λ, λ]min what implies that I(B1 , . . . , Bn ϑ) ⊆ O and hence I(Aϑ) ⊆ O(I), again by the properties of the t-norm minimun I(Aϑ) ≥ inf (I(B1 ϑ), . . . , I(Bn ϑ)) what implies that O(I) ⊆ I Now we are ready to demonstrate the main theorem of this subsection, but first we recall the following results from fixpoint theory. 14 Theorem 3.18 (FixPoint Theorem). Let hL, ≤i be a complete lattice and O : L → L be a monotonic mapping. Then O has a least fixpoint lf p(O) = inf {x | O(x) = x} = inf {x | T (x) ≤ x}. Proposition 3.19. Let hL, ≤i be a complete lattice and O : L → L be a continuous mapping. Then lf p(O) = O ↑ ω. Proof 6. See [19] Theorem 3.20. Let Π be an interval-valued fuzzy definite program. Then M = lf p(OΠT ) = O ↑ ω. Proof 7. M is the least model which is the intersection of any [λ, λ]-model for Π. As the lattice of interval-valued fuzzy Herbrand models is a complete one, then we can use the Theorem 3.18, the Proposition 3.19 and the Theorem 3.17. Applying them and the continuity of O establishes the theorem. Example 5. Given the program Π of Example 3, the least Herbrand model for Π: O ↑ 0 = I⊥ ; O ↑ 1 = O(O ↑ 0) = {hp(a), [0, 0]i, hp(b), [0, 0]i, hq(a), [0.8, 0.9]i, hq(a), [0.7, 0.8]i} O ↑ 2 = O(O ↑ 1) = {hp(a), [0.8, 0.9]i, hp(b), [0.7, 0.8]i, hq(a), [0.8, 0.9]i, hq(a), [0.7, 0.8]i} O↑3=O↑2 Therefore, as the fixpoint is reached at the next item: M = O ↑ 2 3.4. Operational Semantics We begin by providing definitions of an interval-valued SLD-derivation and an interval-valued fuzzy SLD-refutation that will be used later for showing the soundness and the completeness of the system. 15 Definition 3.21. Let G be ← A1 , . . . , Am , . . . , Ak and C be either A[α, α] or A ← B1 , . . . , Bq [β, β]. Then G′ is derived from G and C using mgu θ if the following conditions hold (G’ is the interval-fuzzy resolvent of G and C): i) Am is an atom called the selected atom in G; ii) θ is a mgu of Am and A; iii) G′ is the interval-valued fuzzy goal ← (A1 , . . . , B1 , . . . , Bq , , . . . , Ak )θ with [αG′ , αG′ ] = min([αC , αC ], [αG , αG ]) Definition 3.22. An interval-valued fuzzy SLD-derivation of Π∪G is a successful interval-valued SLD-derivation of Π ∪ G which has the empty clause as the last goal in the derivation. If Gn is the empty clause, we say that the derivation has length n. The empty clause is derived from ← (A1 , . . . , Am , . . . , Ak )[αG , αG ] and A(t1 , . . . , tq )[αA , αA ] ← with [αGn , αGn ] = min([αA , αA ], [αG , αG ]) Definition 3.23. Let Π be an interval-valued fuzzy program and G be an interval-valued fuzzy goal. An interval-valued fuzzy computed answer hθ, [β, β]i for Π∪G is the substitution obtained by restricting the composition θ1 , . . . , θn to the variables of G, where θ1 , . . . , θn is the sequence of mgu’s employed in the finite interval-valued fuzzy SLD-derivation of Π ∪ G with an interval-valued approximation degree [β, β] Definition 3.24. Let Π be an interval-valued fuzzy program, G be an intervalvalued fuzzy goal ← (A1 , . . . , Ak ) and hθ, [β, β]i be an answer for Π ∪ G. We say that hθ, [β, β]i is an interval-valued fuzzy correct answer if ∀(A1 , . . . , Ak )θ is a logical consequence of Π at level [λ, λ]min , that is, [β, β] ≥ [λ, λ]min . 3.5. Implementation In this section, we briefly explain how interval-valued fuzzy sets are incorporated into the Bousi-Prolog system2 . Here, we describe the structure and main features of its abstract machine. It was created as extension of the SWAM for the execution of Bousi-Prolog programs. We have appropriately modified the compiler, some machine instructions and SWAM structures in 2 A beta version can be http://www.face.ubiobio.cl/∼clrubio/bousiTools/ 16 founded at the URL: order to trigger the interval-valued fuzzy resolution. It is worth noting that, to the best of our knowledge, this is the first SWAM implementation that supports interval-valued fuzzy resolution. A mandatory step to achieve this result is to include a new data structure into the architecture for computing with interval-valued fuzzy sets. This data structure has been implemented by using a class called IntervalFS which is formed by two private attributes of double type: upper limit, lower limit. We define the public method constructor IntervalFS(double ll,double lu) and the four methods (sets and gets): double getUpperLimit(); double getLowerLimit(); void setUpperLimit(double v); void setLowerLimit(double v). Additionally, we overwrite both the toString and the equals meth- ods in the usual way. Finally, methods for adding, substracting and computing minimum of interval valued fuzzy set are implemented: IntervalFS add(IntervalFS a, IntervalFS b); IntervalFS substract(IntervalFS a, IntervalFS b); IntervalFS min(IntervalFS a, IntervalFS b). The following example illustrates the new features of the SWAM enhanced with IVFSs. Example 6. Let us suppose that we want to represent the following knowledge: a football player is good when he is fast, tall and coordinated. We know a particular player that is fast, quite tall but he is not very coordinated. Thus, is he a good player? Answering this question and in this scenario, the linguistic expression “is not very coordinate” could be represented by the fact “coordinate(a) [0.2,0.4]”, the linguistic term “fast” could be represented by the fact “fast(a) [0.9,1.0]” and “quite tall” could be represented by the fact “tall(a)[0.8,0.9]”. A possible solution by employing a Bousi-Prolog program is described as follows: 17 %% FACTS coordinate(a) [0.2,0.4] fast(a) [0.9,1.0] tall(a )[0.8,0.9] %% RULES good_player(X):-tall(X), fast(X), coordinate(X) The SWAM enhanced with IVFSs allows us to obtain the answer: “X=a with [0.2,0.4]”. The SWAM code generated for this program is as follows: 00:good_player:trust_me [1.0,1.0] 01: allocate 02: get_variable Y0 A0 03: put_value Y0 A0 04: call coordinate (11) 05: put_value Y0 A0 06: call fast (14) 07: put_value Y0 A0 08: call tall (17) 09: deallocate 10: proceed 11:coordinate:trust_me [0.2,0.4] 12: get_constant a A0 13: proceed 14: fast: trust_me [0.9,1.0] 15: get_constant a A0 16: proceed 17:tall: trust_me [0.8,0.9] 18: get_constant a A0 19: proceed 20:query: trust_me 21: create_variable Q0 X 22: put_value Q0 A0 23: call good_player (00) 24: halt The first instruction to be executed is the one labelled with the key “query”, hence the execution starts at the position 20 with a degree D = [1.0, 1.0] (which is fixed in the instruction trust me). After that, from line 20 to line 23 the query is launched and the variable X is created (create variable instruction). After that from line 00 to line 04 the first subgoal (coordinate(X)) is launched, then the execution goes to line 11 and the unification with the term ”coordinate(a) is produced (from line 11 to 13) (put value 18 and get constant instructions), a new approximation degree is established D = min([1.0, 1.0], [0.2, 0.4]) (trust me instruction), as these terms unify the following subgoal (f ast(X), line 05 and from line 14 to line 16) is launched with an approximation degree D = min([0.2, 0.4], [0.9, 1.0]); as the terms unify, then the following subgoal (tall(X), line 08 and from line 17 to 19) is launched with an approximation degree D = min([0.2, 0.4], [0.9, 1.0]). Finally, the assignation X = a with [0.2, 0.4] is produced. We have implemented a limit to the expansion of the search space in a computation by what we called a “λ-cut for IVFSs”. When the LambdaCutIVFS flag is set to a value different than [0.0, 0.0], the weak unification process fails if the computed approximation degree goes below the stored LambdaCutIVFS value. Therefore, the computation also fails and all possible branches starting from that choice point are discarded. By default the LambdaCutIVFS value is [0.0, 0.0]. However, the lambda cut flag can be set to a different value by means of a λ-cut directive: “:-lambdaCutIVFS(N).”, where N is an interval between [0.0, 0.0] and [1.0, 1.0]. For example, a λcut of [0.5, 0.5] could be established by using the following directive: “:lambdaCutIVFS([0.5,0.5])”. 4. Applications The main realms for the application of the IVFSs programming language described in this paper are those which involve natural language semantics processing. In this section, we will discuss two of them: linguistic knowledge 19 modelling and proximity-based logic programming using linguistic resources. 4.1. Linguistic Knowledge Modelling Linguistic knowledge modelling handles the computational representation of knowledge that is embedded in natural language. This framework can be enhanced by combining multiadjoint paradigm with interval-valued fuzzy sets [14]. For example, we can define interval-valued annotated atoms. Let us assume the same definition of suitable journal given in [22], that is, a journal with a high impact factor, a medium immediacy index, a relatively big halflife and with a not bad position in the listing of the category. Now, we introduce in the program the following inference rule: suitable_journal(X):-impact_factor(X)[0.8,0.9], immediacy_index(X)[0.4,0.6], cited_half_life(X)[0.6,0.7], best_position(X)[0.4,0.6]. Now, let us suppose the IEEE Transactions of Fuzzy System journal has the following properties: “high” impact factor, “small” immediacy index, “relatively small” cited half life and the “best position”. Regarding the linguistic variables: “high”, “medium”, “relatively big” and “not bad”, which can be related to the following truth-values: [0.8, 0.9], [0.4, 0.6], [0.6, 0.7] and [0.4, 0.6], respectively, considering the variables “medium” and “not a bad” with a similar meaning. This knowledge could be model in an interval-valued fuzzy logic language as follows: 20 %% high impact factor impact_factor(ieee_fs)[0.8,0.9] %% small immediacy index immediacy_index(ieee_fs) [0.3,0.5] %% relatively small cited_half_life(ieee_fs)[0.3,0.5] %% best position best_position(ieee_fs) [1,1] When the query “suitable journal(X)” is launched, then the system answers: “X = ieee f s′′ with[0.3, 0.6]. 4.2. Proximity-based Logic Programming based on WordNet Proximity-based Logic Programming is a framework that provides us with the capability of enriching semantically classical logic programming languages by using Proximity Equations (PEs). A limitation of this approach is that PEs are mostly defined for a specific domain [6, 23], being the designer who manually fixes the values of these equations. This fact makes harder to use PLP systems in real applications. A possible solution consists in obtaining the proximity equations from WordNet which requires to employ interval-valued fuzzy sets in order to deal with the high uncertainty generated by the possibility of using several 21 different semantic similarity metrics. Let us assume a fragment of a deductive database that stores information about people and their preferences. The proximity equations can be generated from WordNet, we only put here some of them (see [4] for more detail). %% m loves mountaineering loves(mary,mountaineering). %% j likes football likes(john,football). %% peter plays basketball plays(peter,basketball). %% if a person practises sports %% the he/she is a healthy person healthy(X):- practices(X,sport). %%automatically generated from wordnet love~passion=[0.25,0.8]. basketball~hoops=[1,1]. play~act=[0.25,0.7]. practice~rehearse=[1,1]. sport~variation=[0.1,0.5]. sport~fun=[0.3,0.8]. 22 5. Related Work In the literature, other proposals that address our same goal can be found [24, 25]. One of the most relevant ones is Ciao-Prolog [25] and, for that reason, we will analyse in detail the differences between it and Bousi-Prolog in order to clarify and reinforce the novelty of our proposal: • From the point of view of its implementation. In Ciao-Prolog, IVFSs are included by means of constrains and hence a translator must be implemented. As a result, the programmer must code the variables in order to manage the truth values and get the answers from the system based on those constraints. In Bousi-Prolog, on the other hand, IVFSs are included in a different way, where the compiler and the warren abstract machine are enhanced by using a IVFSs data structure which has been created and adapted for this architecture. As a result, intervals work as a standard data structure in the code of the program instead of a particular set of variables defined ad hoc by the programmer. This feature allows us to include IVFSs in both fuzzy unification (see [4]) and fuzzy resolution. In addition, this framework also allows other possible extensions, such as the incorporation of a reasoning module using WordNet (see [4]). • From the point of view of its syntax. Ciao-Prolog and BousiProlog, although both are Prolog languages, they have a well differentiated syntax. The former only allows the annotation of facts, rules 23 cannot be annotated because these only allow the use of an aggregator operator for the computing of the annotated IVFSs. The latter, on the other hand, allows the user both the annotation the fact and rules by means of IVFSs. In addition, if we focus on the inference engine, while Ciao-Prolog only extends the resolution mechanism, Bousi-Prolog uses interval-valued proximity equations (e.g., young teenager=[0.6,0.8]), which extends both the resolution and unification process. • From the point of view of its semantics. Ciao-Prolog and BousiProlog have relevant differences at the semantic levels as well. Firstly, Bousi-Prolog implements the concept of cut-level, which allows to the user imposes a threshold in the system, and according to it you can be as precise as you want in your answer. This is a substantial change due to the introduction of a threshold operational semantics. Therefore, our operational mechanism behaves very much as the one of a Prolog system (obtaining correct answers one by one), while this option is not available in Ciao semantics. As we mentioned in section 3.5, a λ-cut for IVFS approximation degrees has been implemented. The concepts of interpretation, least model semantics, model, so on, are presented and defined in a different way, in Bousi-Prolog the operational semantics is based an extension of SLD Resolution. In [25] the type of resolution is based on the classical SLD Resolution of Prolog Systems. 24 6. Conclusions and future work We have formally defined and efficiently implemented a simple intervalvalued fuzzy programming language using interval-valued fuzzy sets for modelling the uncertainty and imprecision of the knowledge associated to lexical resources. As future work, we propose to extend our language and to provide results of soundness and completeness. Additionally, we want to develop a fully integrated framework in which interval-valued fuzzy sets and intervalvalued fuzzy relations can be combined in a same framework. Acknowledgements The authors gratefully acknowledges the comments made by reviewers. This work has been partially supported by FEDER and the State Research Agency (AEI) of the Spanish Ministry of Economy and Competition under grants TIN2016-76843-C4-2-R (AEI/FEDER, UE) and TIN2014-56633-C3-1-R, the Consellerı́a de Cultura, Educación e Ordenación Universitaria (the Postdoctoral Training Grants 2016 and Centro singular de investigación de Galicia accreditation 2016-2019, ED431G/08) and European Regional Development Fund (ERDF). This work has been done in collaboration with the research group SOMOS (SOftware-MOdelling-Science) funded by the Research Agency and the Graduate School of Management of the Bı́o-Bı́o University. References [1] Miller, G.A.: Wordnet: A lexical database for english. Communications of the ACM 38(11) (1995) 39–41 25 [2] Liu, H., Singh, P.: Commonsense reasoning in and over natural language. In Negoita, M.G., Howlett, R.J., Jain, L.C., eds.: Proceedings of the 8th International Conference on Knowledge-Based Intelligent Information and Engineering Systems (KES 2004), Wellington, New Zealand, September 20-25, Berlin, Heidelberg, Springer (2004) 293–306 [3] León-Aráuz, P., Gómez-Romero, J., Bobillo, F.: A fuzzy ontology extension of wordnet and eurowordnet for specialized knowledge. In: Proceedings of the TKE 2012. (2012) [4] Rubio-Manzano, C., Pereira-Fariña, M.: Towards fuzzy lexical reasoning. Journal of Intelligent & Fuzzy Systems 32(3) (Feb 2017) 2425–2436 [5] Medina, J., Ojeda-Aciego, M.: Multi-adjoint logic programming. In: Proceedings of the 10th International Conference on Information Processing and Managment of Uncertainty in Knowledge-Based Systems (IPMU 2004). (2004) 823–830 [6] Julián-Iranzo, P., Moreno, G., Penabad, J., Vázquez, C. In: A Declarative Semantics for a Fuzzy Logic Language Managing Similarities and Truth Degrees. Springer International Publishing, Cham (2016) 68–82 [7] Julián-Iranzo, P., Moreno, G., Penabad, J., Vázquez, C.: A fuzzy logic programming environment for managing similarity and truth degrees. (2015) 26 [8] Muñoz-Hernandez, S., Pablos-Ceruelo, V., Strass, H.: Rfuzzy: Syntax, semantics and implementation details of a simple and expressive fuzzy tool over prolog. Information Sciences 181(10) (2011) 1951 – 1970 Special Issue on Information Engineering Applications Based on Lattices. [9] Straccia, U. In: Managing Uncertainty and Vagueness in Description Logics, Logic Programs and Description Logic Programs. Springer Berlin Heidelberg, Berlin, Heidelberg (2008) 54–103 [10] Le, V.H., Liu, F., Tran, D.K.: Fuzzy linguistic logic programming and its applications. Theory and Practice of Logic Programming 9(03) (may 2009) 309–341 [11] Pedersen, T., Patwardhan, S., Michelizzi, J.: Measuring the relatedness of concepts. Wordnet::similarity: In: Demonstration Papers at HLT-NAACL 2004. HLT-NAACL–Demonstrations ’04, Stroudsburg, PA, USA, Association for Computational Linguistics (2004) 38–41 [12] Turksen, I.: Four methods of approximate reasoning with interval- valued fuzzy sets. International Journal of Approximate Reasoning 3(2) (mar 1989) 121–142 [13] Bustince, H.: Interval-valued fuzzy sets in soft computing. International Journal of Computational Intelligence Systems 3(2) (2010) 215–222 [14] Medina, J.: Adjoint pairs on interval-valued fuzzy sets. In: Proceedings of the 13th International Conference on Information Processing and 27 Managment of Uncertainty in Knowledge-Based Systems (IPMU 2010), Springer Berlin Heidelberg (2010) 430–439 [15] Rubio-Manzano, C., Julián-Iranzo, P.: A fuzzy linguistic prolog and its applications. Journal of Intelligent & Fuzzy Systems 26(3) (2014) 1503–1516 [16] Julián-Iranzo, P., Rubio-Manzano, C. In: A Similarity-Based WAM for Bousi˜Prolog. Springer Berlin Heidelberg, Berlin, Heidelberg (2009) 245–252 [17] Pereira-Fariña, M.: Some reflections on the set-based and the conditional-based interpretations of statements in syllogistic reasoning. Archives for the Philosophy and History of Soft Computing 1/2014(1) (2014) 1–16 [18] Hajek, P.: Metamathematics of fuzzy logic. Springer Science and Business Media (1998) [19] Lloyd, J.: Foundations of Logic Programming. Springer-Verlag, Berlin (1987) [20] Julián-Iranzo, P., Rubio-Manzano, C.: A declarative semantics for bousi prolog. In: Proceedings of the 11th ACM SIGPLAN Conference on Principles and Practice of Declarative Programming. PPDP ’09, New York, NY, USA, ACM (2009) 149–160 28 [21] Ebrahim, R.: Fuzzy logic programming. Fuzzy Sets and Systems 117(2) (2001) 215 – 230 [22] Medina, J., Ojeda-Aciego, M., Ruı́z-Calviño, J.: Formal concept analysis via multi-adjoint concept lattices. Fuzzy Sets and Systems 160(2) (2009) 130 – 144 [23] Rodrı́guez-Artalejo, M., Romero-Dı́az, C.A.: A declarative semantics for clp with qualification and proximity. Theory and Practice of Logic Programming 10(4-6) (2010) 627642 [24] Atanassov, K., Georgiev, C.: Intuitionistic fuzzy prolog. Fuzzy Sets and Systems 53(2) (1993) 121 – 128 [25] Guadarrama, S., Muoz, S., Vaucheret, C.: Fuzzy prolog: a new approach using soft constraints propagation. Fuzzy Sets and Systems 144(1) (2004) 127 – 150 29
2cs.AI
TROPICAL LIMITS OF PROBABILITY SPACES, PART I arXiv:1704.00297v2 [math.MG] 16 Jun 2017 THE INTRINSIC KOLMOGOROV-SINAI DISTANCE AND THE ASYMPTOTIC EQUIPARTITION PROPERTY FOR CONFIGURATIONS R. MATVEEV AND J. W. PORTEGIES Abstract. The entropy of a finite probability space X measures the observable cardinality of large independent products X ⊗n of the probability space. If two probability spaces X and Y have the same entropy, there is an almost measure-preserving bijection between large parts of X ⊗n and Y ⊗n . In this way, X and Y are asymptotically equivalent. It turns out to be challenging to generalize this notion of asymptotic equivalence to configurations of probability spaces, which are collections of probability spaces with measure-preserving maps between some of them. In this article we introduce the intrinsic Kolmogorov-Sinai distance on the space of configurations of probability spaces. Concentrating on the large-scale geometry we pass to the asymptotic Kolmogorov-Sinai distance. It induces an asymptotic equivalence relation on sequences of configurations of probability spaces. We will call the equivalence classes tropical probability spaces. In this context we prove an Asymptotic Equipartition Property for configurations. It states that tropical configurations can always be approximated by homogeneous configurations. In addition, we show that the solutions to certain Information-Optimization problems are Lipschitz-continuous with respect to the asymptotic Kolmogorov-Sinai distance. It follows from these two statements that in order to solve an InformationOptimization problem, it suffices to consider homogeneous configurations. Finally, we show that spaces of trajectories of length n of certain stochastic processes, in particular stationary Markov chains, have a tropical limit. 0. Introduction The aim of the present article is to develop a theory of tropical probability spaces, which are asymptotic classes of finite probability spaces. Together with the accompanying techniques, we expect them to be relevant to problems arising in information theory, causal inference, artificial intelligence and neuroscience. As a matter of introduction and motivation of the research presented in the article, we start by considering a few simple examples. 0.1. Single probability spaces. We consider a finite probability space X = (S, p), where S is a finite set, and p is a probability measure on S. For simplicity, assume for now that the measure p has full support. Next, we 1 2 0. Introduction consider the, so-called, Bernoulli sequence of probability spaces X ⊗n = (S n , p⊗n ) where S n denotes the n-fold Cartesian product of S, and p⊗n is the n-fold product measure. This situation arises in several contexts. For example, in physics, X ⊗n would encode the state of the system comprised of many identical non-interacting (weakly interacting) subsystems with state space X. In information theory, X ⊗n would describe the output of an i.i.d. random source. In dynamical systems or stochastic processes the setting corresponds to Bernoulli shifts and Bernoulli processes. The entropy of X is the exponential growth rate of the observable cardinality of tensor powers of X. The observable cardinality, loosely speaking, is the cardinality of the set X ⊗n after (the biggest possible) set of small measure of elements, each with negligible measure, has been removed. It turns out that the observable cardinality of X ⊗n might be much smaller than ∣S∣n , the cardinality of the whole of X ⊗n , in the following sense. The Asymptotic Equipartition Property states that for every ε > 0 and suf(n) ficiently large n one can find a, so-called, typical subset Aε ⊂ S n , such that it takes up almost all of the mass of X ⊗n and the probability distribution on (n) Aε is almost uniform on the normalized logarithmic scale, (n) (i) p⊗n (Aε ) ≥ 1 − ε (n) (ii) For any a, a′ ∈ Aε holds ∣ n1 ln p(a) − n1 ln p(a′ )∣ ≤ ε (n) The cardinality ∣Aε ∣ may be much smaller than ∣S∣n , but it will still grow (n) exponentially with n. Even though there are many choices for such a set Aε , the exponential growth rate with respect to n is well-defined upto 2ε. In fact, (n) there exists a number hX such that for any choice of the typical subset Aε holds (n) en⋅hX −ε ≤ ∣Aε ∣ ≤ en⋅hX +ε The limit of the growth rate as ε → 0+ is called the entropy of X, as explained in more detail in Section 1.3 1 (n) Ent(X) ∶= lim lim ln ∣Aε ∣ ε↓0 n→∞ n By the law of large numbers Ent(X) = hX = − ∑ p(x) ln p(x) x∈S which is the formula by which the Shannon entropy is usually introduced. Entropy is especially easy to evaluate if the space is uniform, since for any finite probability space with the uniform distribution holds (0.1) Ent(X) = ln ∣X∣ This point of view on entropy goes back to the original idea of Boltzmann, according to which entropy is the logarithm of the number of equiprobable 3 0. Introduction states, that a system, comprised of many identical weakly interacting subsystems, may take on. 0.1.1. Asymptotic equivalence. The Asymptotic Equipartion Property implies that the sequence X ⊗n is asymptotically equivalent to a sequence of uniform spaces in the following sense. Let us denote by pU the probability distribution (n) that is supported on Aε , and is uniform on its support. Then a sequence from independent samples according to pU is very hard to discriminate from a sequence of independent samples from p⊗n X . Similarly, when X and Y are probability spaces with the same entropy, the sets X and Y are asymptotically equivalent in the sense that there is a bijection between the typical sets, which can be seen as a change of code. This is essentially the content of Shannon’s source coding theorem. In [Gro12], Gromov proposed this existence of an “almost-bijection” as a basis of an asymptotic equivalence relation on sequences of probability spaces. Even though we were greatly influenced by ideas in [Gro12], we found that Gromov’s definition does not extend easily to configurations of probability spaces. By a configuration of probability spaces we mean a collection of probability spaces with measure-preserving maps between some of them. We will give a precise definition in Section 1.2, but will consider some particular examples below. Formalizing and studying a notion of asymptotic equivalence for configurations of probability spaces is the main topic of the present article. 0.2. Configurations of probability spaces. Suppose that now instead of a single probability space, we consider a pair of probability spaces X = (X, pX ) and Y = (Y , pY ) with a joint distribution, that is a probability measure on X × Y that pushes forward to pX and pY under coordinate projections. In other words, we consider a triple of probability spaces X, Y and U with a pair of measure-preserving maps U → X and U → Y . This is what we later call a minimal two-fan of probability spaces U X Y and is a particular instance of a configuration of probability spaces. 0.2.1. Three examples. Three examples of such an object are shown on Figure 1, which is to be interpreted in the following way. Each of the spaces Xi and Yi , i = 1, 2, 3, have cardinality six and a uniform distribution, where the weight of each atom is 61 . The spaces Ui , i = 1, 2, 3, have cardinality 12 and 1 the distribution is also uniform with all weights being 12 . The support of the measure on Ui ’s is colored grey on the pictures. The maps from Ui to Xi and Yi are coordinate projections. 4 0. Introduction U1 U2 Y1 U3 Y2 X1 Y3 X2 X3 Figure 1. Examples of pairs of probability spaces together with a joint distribution. In view of equation (0.1) we have for each i = 1, 2, 3, Ent(Xi ) = ln 6 Ent(Yi ) = ln 6 Ent(Ui ) = ln 12 Now we would like to ask the following. Question. Is it possible to find an almost-bijection between sufficiently high powers of (Xi⊗n ← Zi⊗n → Yi⊗n ) by (Xj⊗n ← Zj⊗n → Yj⊗n ) for i ≠ j with an arbitrary given precision as in Shannon’s coding theorem as described at the end of the previous subsection 0.1? More generally, what is the proper generalization of an asymptotic equivalence relation as discussed in the previous subsection to sequences of tensor powers of two-fans? We would like to argue that even though the entropies of the constituent spaces are all (pairwise) the same, all three examples above should be pairwise asymptotically different. To establish that the examples in Figure 1 are different, that is, not isomorphic (see also Section 1.2) is relatively easy, since they have non-isomorphic symmetry groups. However, we present a different argument, that lends itself for generalization to prove that the examples at hand are not asymptotically equivalent and that also gives a quantitative difference between them. To distinguish Example 1 from both 2 and 3, one could argue along the following lines. We could try to add a third space Z = (Z, pZ ) to the pair X and Y and provide a joint distribution pQ on Q = (X × Y × Z, pQ ) such that the projection of pQ on the first two factors is pU and on the third factor is pZ . Once we do that, we could evaluate entropies of various push-forwards of pQ . Denote by V = (X × Z, pV ) and W = (Y × Z, pW ), where pV and pW are push-forwards of pQ under corresponding coordinate projections. All the 5 0. Introduction probability spaces now fit into a commutative diagram Q U V W X Y Z where each arrow is a reduction, which is simply a measure-preserving map between probability spaces. We consider the set of all possible extensions of the above form and denote it by Ext(X, Y, U ). For any extension E = (X, Y, Z, U, V, W, Q) in Ext(X, Y, U ) we have four “new” entropies Ent(Q), (0.2) Ent(V ), Ent(W ), Ent(Z) in addition to the “known” entropies of X, Y and U . The vector Ent∗ (E) ∶= ( Ent(X), Ent(Y ), Ent(Z), Ent(U ), Ent(V ), Ent(W ), Ent(Q)) is the entropy vector of the extension E. The set of all possible values of the entropy vector for all extensions of (X, Y, U ) Γ○ (X, Y, U ) ∶= {Ent∗ (E) ∈ R7 ∣ E is an extension of (X, Y, U )} ⊂ R7 is what we call the unstabilized relative entropic set of the two-fan (X ← U → Y ). 0.2.2. The unstabilized relative entropic sets for the examples. It turns out that these unstabilized relative entropic sets of (X1 ← U1 → Y1 ) and (X2 ← U2 → Y2 ) are different Γ○ (X1 , Y1 , U1 ) ≠ Γ○ (X2 , Y2 , U2 ) To see this, let us calculate some particular points in the unstabilized relative entropic sets of the Examples 1–3. We consider the constrained InformationOptimization problem, of finding an extension E = (X, Y, Z, U, V, W, Q) of (X, Y, U ) such that (i) the space Z is a reduction of U , that is Ent(Q) = Ent(U ) (ii) the spaces X and Y are independent conditioned on Z, Ent(Q) + Ent(Z) = Ent(V ) + Ent(W ) (iii) the sum Ent(X∣ Z) + Ent(Y ∣ Z) is maximal, subject to conditions (i) and (ii). 6 0. Introduction It is very easy to read the solutions Ê1 , Ê2 and Ê3 of this optimization problem for Examples 1, 2 and 3 right from the pictures in Figure 1. Indeed, condition (i) says that Zi must be a partition of Ui . Condition (ii) says that each set in the partition must be “rectangular”, that is it must be a Cartesian product of a subset of X i and a subset of Y i . The quantity to be maximized is the average log-area of the sets in the partition. Optima are very easy to find “by hand”. For Example 1 it is a partition of U1 into three 2 × 2 squares. In Examples 2 and 3, one of the solutions is the partition of U2 , (resp. U3 ) into 1 × 2 rectangles. Thus, the optimal values are (2 ln 2) for Example 1, and (ln 2) for Examples 2 and 3. 0.2.3. The stabilized relative entropic set. We have just seen that Examples 1 and 2 can be told apart by determining the unstabilized relative entropic set. However, this is not really what we are interested in. Rather, we wonder whether high tensor powers can be distinguished this way. This relates to why we used the adjective “unstabilized”: because the relative entropic set usually grows (is not stable) under taking tensor powers. That is, for every n, k ∈ N it holds that (0.3) k ⋅ Γ○ (X ⊗n , Y ⊗n , U ⊗n ) ⊂ Γ○ (X ⊗(k⋅n) , Y ⊗(k⋅n) , U ⊗(k⋅n) ) but in general the set on the right-hand side can be strictly larger than the set on the left. In view of the inclusion (0.3) we may define the stabilized relative entropic set 1 Γ(X, Y, U ) = Closure ( lim Γ○ (X ⊗n , Y ⊗n , U ⊗n )) n→∞ n This set turns out to be convex. 0.2.4. The stabilized relative entropic set for the examples. In fact, the stabilized relative entropic set also differentiates between Examples 1 and 2 Γ(X1 , Y1 , U1 ) ≠ Γ(X2 , Y2 , U2 ) The proof of this fact follows the same lines as in Section 0.2.2, but the stabilization makes the argument much more technical. We expect that the stabilized relative entropic set cannot differentiate between Examples 2 and 3. However, there are other types of relative entropic sets, and other Information-Optimization problems that can differentiate between Examples 2 and 3. The relative entropic sets are discussed in Section 7. 0.3. Information-Optimization problems and relative entropic sets. In Section 0.2.2 we used an Information-Optimization problem to find particular points in the (unstabilized) relative entropic set. This is no coincidence, and the link between stabilized Information-Optimization problems and the stable relative entropic set can be made very explicit. Because the stable relative entropic set is convex, it can be completely characterized by InformationOptimization problems and vice versa. 0. Introduction 7 Such Information-Optimization problems play a very important role in information theory [Yeu12], causal inference [SA15], artificial intelligence [VDP13], information decomposition [BRO+ 14], robotics [ABD+ 08], and neuroscience [Fri09]. The techniques developed in the article allow one to address this type of problems easily and efficiently. 0.4. The intrinsic Kolmogorov-Sinai distance. As we mentioned at the end of Section 0.1, one is tempted to define asymptotically equivalent configurations along the lines of Shannon’s source coding theorem following [Gro12]. Two configurations would be asymptotically equivalent if there is an almost measure-preserving bijection between subspaces of almost full measure in their high tensor powers. However, we found this approach inconvenient. Instead of finding an almost measure-preserving bijection between large parts of the two spaces, we consider a stochastic coupling (transportation plan, joint distribution) between a pair of spaces and measure its deviation from being an isomorphism of probability spaces, that is a measure-preserving bijection. Such a measure of deviation from being an isomorphism then leads to the notion of intrinsic KolmogorovSinai distance, and its stable version – the asymptotic Kolmogorov-Sinai distance, as explained in Section 4. In the case of single probability spaces we define the intrinsic KolmogorovSinai distance between two probability spaces X = (X, pX ) and Y = (Y , pY ) by k(X, Y ) ∶= inf {[ Ent(Z) − Ent(X)] + [ Ent(Z) − Ent(Y )]} where the infimum is taken over all choices of the joint distribution Z = (X × Y , pZ ). Note that each of the summands is nonnegative and vanishes if and only if the corresponding marginalization Z → X or Z → Y is an isomorphism of probability spaces. In this sense the distance measures the deviation from the existence of a measure-preserving bijection between X and Y . Furthermore, we define the asymptotic Kolmogorov-Sinai distance between two probability spaces X and Y by 1 κ(X, Y ) = lim k(X ⊗n , Y ⊗n ). n→∞ n This definition could be generalized to configurations of probability spaces and we will say that two configurations are asymptotically equivalent if the asymptotic Kolmogorov-Sinai distance between them vanishes. 0.5. Asymptotic Equipartition Property. Examples 1, 2, and 3 above have the property that the symmetry group acts transitively on the support of the measure on Ui and they are particular instances of what we call homogeneous configurations. In Section 6, we show an Asymptotic Equipartion Property for configurations: Theorem 6.1 states that every sequence of tensor powers of a configuration can be approximated in the asymptotic Kolmogorov-Sinai distance by a sequence of homogeneous configurations. 8 0. Introduction This Asymptotic Equipartition Property allows one to substitute configurations of probability spaces by homogeneous approximations. Homogeneous probability spaces are just uniform probability spaces, and as a first simple consequence of the Asymptotic Equipartition Property, the asymptotic Kolmogorov-Sinai distance between probability spaces X and Y can be computed and equals κ(X, Y ) = ∣ Ent(X) − Ent(Y )∣. Homogeneous configurations are, unlike homogeneous probability spaces, rather complex objects. Nonetheless, they seem to be simpler than arbitrary configurations of probability spaces for the types of problems that we would like to address. More specifically, we show in Section 7 that the optimal values in (stabilized) Information-Optimization problems only depend on the asymptotic class of a configuration and that they are continuous with respect to the asymptotic Kolmogorov-Sinai distance; in many cases, the optimizers are continuous as well. The Asymptotic Equipartition Property implies that for the purposes of calculating optimal values and approximate optimizers, one only needs to consider homogeneous configurations and this can greatly simplify computations. Summarizing, the Asymptotic Equipartition Property and the continuity of Information-Optimization problems are important justifications for the choice of asymptotic equivalence relation and the introduction of the intrinsic and asymptotic Kolmogorov-Sinai distances. 0.6. The article. The article has the following structure. Section 1 is devoted to the basic setup used throughout the text. In Section 2 we explain what we mean by configurations of probability spaces, give examples, describe simple properties and operations. Further, in Section 3 we generalize the notion of probability distribution to that on configurations and discuss the theory of types for configurations. In Section 4 the intrinsic Kolmogorov-Sinai distance and the asymptotic Kolmogorov-Sinai distance are introduced and some technical tools for the estimation of Kolmogorov distance are developed. Section 5 contains estimates on the distances between types. We use these estimates in the proof of the Asymptotic Equipartition Property for configurations in Section 6. Section 7 deals with extensions of configurations. We prove there the Extension Lemma, which is used to show continuity of extensions and implies, in particular, that solutions of the constrained optimization problem for the entropies of extensions are Lipschitz-continuous with respect to the asymptotic Kolmogorov-Sinai distance, thus they only depend on the asymptotic classes of configurations. In Section 8 we briefly discuss a special type of configurations called mixtures, which will play an important role in the construction of tropical probability spaces. Finally, in Section 9 we introduce the notion of tropical probability spaces and configurations thereof, and list some of their properties. We will continue our study of tropical probability spaces and configurations in subsequent articles. 1. Category 9 Some technical and not very illuminating proofs are deferred to Section T Technical Proofs. In the electronic version one can move between the proof in the technical section and the statement in the main text by following the link (arrow up or down). Acknowledgments. We would like to thank Tobias Fritz, František Matúš, Misha Movshev and Johannes Rauh for inspiring discussions. We are grateful to the participants of the Wednesday Morning Session at the CASA group at the Eindhoven University of Technology for valuable feedback on the introduction of the article. Finally, we thank the Max Planck Institute for Mathematics in the Sciences, Leipzig, for its hospitality. 1. Category of probability spaces and configurations This section is devoted to the basic setup used throughout the present article. We introduce a category of probability spaces and reductions, similar to categories introduced in [BFL11] and [Gro12], and define configurations of probability spaces and the corresponding category. The last subsection recalls the notion of entropy and its elementary properties. 1.1. Probability spaces and reductions. Below we will consider probability spaces such that the support of the probability measure is finite. Any such space contains a full-measure subspace isomorphic to a finite space, thus we call such objects finite probability spaces. For a probability space X = (S, pX ) denote by X = supp pX the support of the measure and by ∣X∣ its cardinality. Slightly abusing the language, we call this quantity the cardinality of X. For a pair of probability spaces a reduction X → Y is a class of measurepreserving maps, with two maps being equivalent if they coincide on a set of full measure. The composition of two reductions is itself a reduction. Two probability spaces are isomorphic if there is a measure-preserving bijection between the supports of the probability measures. Such a bijection defines an invertible reduction from one space into another. Clearly the cardinality ∣X∣ is an isomorphism invariant. The automorphism group Aut(X) is the group of all self-isomorphisms of X. A probability space X is called homogeneous if the automorphism group Aut(X) acts transitively on the support X of the measure. The property of being homogeneous is an isomorphism invariant. In the isomorphism class of a homogeneous space there is a representative with uniform measure. The finite probability spaces and reductions form a category, that we denote by Prob. The subcategory of homogeneous spaces will be denoted by Probh . The isomorphism in the category coincides with the notion of isomorphism above. The category Prob is not a small category. However it has a small full subcategory, that contains an object for every isomorphism class in Prob and for every pair of objects in it, it contains all the available morphisms between 10 1. Category them. From now on we imagine that such a subcategory was chosen and fixed and replaces Prob in all considerations below. There is a product in Prob given by the Cartesian product of probability spaces, that we will denote by X ⊗ Y ∶= (X × Y , pX ⊗ pY ). There are canonical reductions X ⊗ Y → X and X ⊗ Y → Y given by projections to factors. For a pair of reductions fi ∶ Xi → Yi , i = 1, 2 their tensor product is the reduction f1 ⊗ f2 ∶ X1 ⊗ X2 → Y1 ⊗ Y2 , which is equal to the class of the Cartesian product of maps representing fi ’s. The tensor product is not however a categorical product. The product leaves the subcategory of homogeneous spaces invariant. The probability measure on X will be usually denoted by pX or simply p, when the risk of confusion is low. 1.2. Configurations of probability spaces. Essentially, a configuration X = {Xi ; fij } is a commutative diagram consisting of a finite number of probability spaces and reductions between some of them, that is transitively closed, while a morphism ρ ∶ X → Y between two configurations X = {Xi ; fij } and Y = {Yi ; gij } of the same combinatorial type is a collection of reductions between corresponding individual objects ρi ∶ Xi → Yi , that commute with the reductions within each configuration, ρj ○ fij = gij ○ ρi . We need to keep track of the combinatorial structure of the collection of reductions within a configuration. There are several possibilities for doing so: ● the reductions form a directed transitively closed graph without loops; ● the spaces in the configuration form a poset; ● the underlying combinatorial structure could be recorded as a finite category. The last option seems to be most convenient since it has many operations necessary for our analysis already built-in. A diagram category G is a finite category such that for each pair of objects O1 , O2 in G the morphism space between them HomG (O1 , O2 ) ∪ HomG (O2 , O1 ) contains at most one element. For a diagram category G a configuration of probability spaces modeled on G is a functor X ∶ G → Prob. The collection of all configurations of probability spaces modeled on a fixed diagram category G forms the category of functors Prob ⟨G⟩ ∶= [G, Prob]. The objects of Prob ⟨G⟩ are configurations, that is functors from G to Prob, while morphisms in Prob ⟨G⟩ are natural transformations between them. For a configuration X ∈ Prob ⟨G⟩, the diagram category G will be called the combinatorial type of X . For a diagram category G or a configuration X ∈ Prob ⟨G⟩ we denote by [[G]] = [[X ]] the number of objects in the category G. An object O in a diagram category G will be called initial, if it is not a target of any morphism except for the identity. Likewise a terminal object is not a source of any morphism, except for the identity morphism. Note that this 11 1. Category terminology is somewhat unconventional from the point of view of category theory. A diagram category is called complete if it has a unique initial object. Thus a configuration modeled on a complete category includes a space that reduces to all other spaces in the configuration. The above terminology transfers to configurations modeled on G: An initial space in X ∈ Prob ⟨G⟩ is one that is not a target space of any reduction within the configuration, a terminal space is not a source of any non-trivial reduction and X is complete if G is, that is there is a unique initial space. The tensor product of probability spaces extends to a tensor product of configurations. For X , Y ∈ Prob ⟨G⟩, such that X = {Xi ; fij } and Y = {Yi ; gij } define X ⊗ Y ∶= {Xi ⊗ Yi ; fij ⊗ gij } Occasionally we will also talk about configuration of sets. Denote by Set the category of finite sets and surjective maps. Then all of the above constructions could be repeated for sets instead of probability spaces. Thus we could talk about the category of configurations of sets Set ⟨G⟩. Given a reduction f ∶ X → Y between two probability spaces, the restriction f ∶ X → Y is a well-defined surjective map. Given a configuration X = {Xi ; fij } of probability spaces, there is an underlying configuration of sets, obtained by taking the supports of measures on each level and restricting reductions on these supports. We will denote it by X = {X i ; fij }, where X i ∶= supp pXi . Thus we have a forgetful functor ⋅ ∶ Prob ⟨G⟩ → Set ⟨G⟩ For now we will consider two important examples of diagram categories and configurations modeled on them. We give further examples in Section 2.1. 1.2.1. Two-fans: A two-fan is a configuration modeled on the category Λ with three objects, one initial and two terminal. Λ = (O1 ← O12 → O2 ) There is a special significance to two-fans, since these are the simplest nontrivial configurations, as we will see later. Essentially, a two-fan X ← Z → Y is a triple of probability spaces and a pair of reductions between them. A reduction of a two-fan X ← Z → Y to another two-fan X ′ ← Z ′ → Y ′ is a triple of reductions Z → Z ′ , Y → Y ′ and X → X ′ that commute with the reductions within each fan, that is, the following diagram is commutative X Z Y X′ Z′ Y′ 12 1. Category Isomorphisms and the automorphism group Aut(⋅) are defined accordingly. Note that terminal spaces in a two-fan are labeled and reductions preserve the labeling. A two-fan X ← Z → Y is called minimal if for a.e. x ∈ X and y ∈ Y there is a unique z ∈ Z, that reduces to y and to x. Given a two-fan X ← Z → Y , there is always a reduction to a minimal two-fan X ← Z ′ → Y . Such minimal reduction is unique up to isomorphism. Explicitly, take Z ′ ∶= X × Y as a set and consider a probability distribution on Z ′ induced by a map Z → Z ′ which is the Cartesian product of the reductions X ← Z → Y in the original two-fan. The notion of being minimal is in fact a categorical notion. It could be equivalently defined by saying that a two-fan X = (X1 ← X12 → X2 ) is minimal if for any reduction λ ∶ X → X ′ holds: if both λ1 and λ2 are isomorphisms, then λ12 is also an isomorphism. Consequently, if one specifies reductions from the terminal spaces of a minimal two-fan to another two-fan, then there exists at most one extension to the reduction of the whole fan. The inclusion of a pair of probability spaces X and Y as terminal vertices in a minimal two-fan is equivalent to specifying a joint distribution on X × Y . An arbitrary configuration X will be called minimal if with every two-fan, it also contains a minimal two-fan with the same terminal spaces. We will denote the space of minimal configurations modelled on a diagram category G by Prob ⟨G⟩m . Given a two-fan F = (X ← Z → Y ) with terminal spaces X and Y , and a point x ∈ X with pX (x) > 0, one may construct a conditional probability distribution pY ( ⋅ ∣ x) on Y . We denote the corresponding space Y ∣ x ∶= (Y , pY ( ⋅ ∣ x)). The usual bar “∣”, that is normally used for conditioning, interferes with our notations for cardinality of spaces. We will give more details in Section 2.7. 1.2.2. A diamond configuration. A “diamond” configuration is modeled on a diamond category ◇, that consists of a two-fan and a “co-fan”: ⎛ ⎜ ⎜ ⎜ ◇ = ⎜ O1 ⎜ ⎜ ⎜ ⎝ O12 O● ⎞ ⎟ ⎟ ⎟ O2 ⎟ ⎟ ⎟ ⎟ ⎠ Of course, there is also a morphism O12 → O● , which lies in the transitive closure of the given four morphisms. As a rule, we will skip writing morphisms, that are implied by the transitive closure. A diamond configuration is minimal if the top two-fan in it is minimal. 1.3. Entropy. Our working definition of entropy will be based on the following version of the asymptotic equipartition theorem for Bernoulli process, see [CT91]. 13 2. Configurations Theorem 1.1. Suppose X is a finite probability space, then for any ε > 0 and (n) any n >> 0 there exists a subset Aε ⊂ X ⊗n such that (n) (i) p(Aε ) ≥ 1 − ε (n) (ii) For any a, a′ ∈ Aε holds ln p(a) ln p(a′ ) ∣ − ∣≤ε n n (n) (n) Moreover, if Aε and Bε are two subsets of X ⊗n satisfying two conditions above, then their cardinalities satisfy RRR (n) R (n) RRR ln ∣Aε ∣ − ln ∣Bε ∣ RRRRR ≤ 2ε (1.1) RRR n n RRRR RR R ⊠ Then we define 1 (n) ln ∣Aε ∣ ε→0 n→∞ n Clearly, in view of the property (1.1) in the Theorem 1.1 the limit above is (n) well-defined and is independent of the choice of the typical subsets Aε . Entropy satisfies the so-called Shannon inequality, see for example [CT91], namely for any minimal diamond configuration Ent(X) ∶= lim lim X12 X1 X2 X● the following inequality holds, (1.2) Ent(X1 ) + Ent(X2 ) ≥ Ent(X12 ) + Ent(X● ) Furthermore, entropy is additive with respect to the tensor product, that is, for a pair of probability spaces X, Y ∈ Prob holds (1.3) Ent(X ⊗ Y ) = Ent(X) + Ent(Y ) Further, for a pair X, Y of probability spaces included in a minimal two-fan (X ← Z → Y ) we define the conditional entropy Ent(X∣ Y ) ∶= Ent(Z) − Ent(X) The above quantity is always non-negative in view of Shannon inequality (1.2). Moreover, the following identity holds, see [CT91] (1.4) Ent(X∣ Y ) = ∫ Ent(X∣ y) d pY (y) Y 2. Configurations In this section we will look at configurations in more detail. We start by considering some important examples. 14 2. Configurations 2.1. Examples of configurations. 2.1.1. Singleton. We denote by ● a diagram category with a single object. Clearly configurations modeled on ● are just probability spaces and we have Prob ≡ Prob ⟨●⟩. 2.1.2. Chains. The chain Cn of length n ∈ N is a category with n objects n {Oi }i=1 and morphisms from Oi to Oj whenever i ≤ j. A configuration X ∈ Prob ⟨Cn ⟩ is a chain of reductions X = (X1 → X2 → ⋯ → Xn ) 2.1.3. Two-fan. The two-fan Λ is a category with three objects {O1 , O12 , O2 } and two non-identity morphisms O12 → O1 and O12 → O2 . See also Section 1.2.1. Two-fans are the simplest configurations for which asymptotic equivalence classes contain more information than just entropies of the entries. Recall that a fan (X ← Z → Y ) is called minimal, if for any pair of points x ∈ X and y ∈ Y with positive weights there exists at most one z ∈ Z, that reduces to x and to y. Equivalently, for any super-configuration Z Z′ X Y the reduction Z → Z ′ must be an isomorphism. 2.1.4. Full configuration. The full category Λn on n objects is a category with objects {OI }I∈2{1,...,n} ∖{∅} indexed by all non-empty subsets I ∈ 2{1,...,n} and a morphism from OI to OJ , whenever J ⊆ I. For a collection of random variables X1 , . . . , Xn one may construct a minimal full configuration X ∈ Prob ⟨Λn ⟩ by considering all joint distributions and “marginalization” reductions. We denote such a configuration by ⟨X1 , . . . , Xn ⟩. On the other hand, the terminal vertices of a full configuration can be viewed as random variables on the domain of definition given by the (unique) initial space. Suppose X ∈ Prob ⟨Λn ⟩ is a minimal full configuration with terminal vertices X1 , . . . , Xn . It is convenient to view X as a distribution on the Cartesian product of the underlying sets of the terminal vertices: pX ∈ ∆(X 1 × ⋯ × X n ) Once the underlying sets of the terminal spaces are fixed, there is a one-to-one correspondence between the full minimal configurations and distributions as above. 15 2. Configurations 2.1.5. “Two-tents” configuration. The “two-tents” category M2 consists of five objects, of which two are initial and three are terminal, and morphisms are as follows ⎛ O O23 ⎞ ⎜ 12 ⎟ ⎟ M2 = ⎜ ⎜ ⎟ ⎜ ⎟ ⎝ O1 O2 O3 ⎠ Thus, a typical two-tents configuration consists of five probability spaces and reduction as in X = (X ← U → Y ← V → Z) The probability spaces U and V are initial and X, Y and Z are terminal. 2.1.6. “Many-tents” configuration. The previous example could be generalized to a “many-tents” category Mn = (O1 ← O12 → O2 ← ⋯ → On−1 ← On−1,n → On ) 2.1.7. “Fence” configuration. The “fence” category W3 consists of six objects and the morphisms are ⎛ ⎜ O12 W3 = ⎜ ⎜ ⎝ O1 O13 O2 ⎞ O23 ⎟ ⎟ ⎟ O3 ⎠ 2.1.8. Co-fan. A co-fan V is a category with three objects and morphisms as in the diagram ⎛ ⎞ O2 ⎟ ⎜ O1 ⎟ V=⎜ ⎜ ⎟ O● ⎝ ⎠ 2.1.9. “Diamond” configurations. A “diamond” configuration ◇ is modeled on a diamond category that consists of a fan and a co-fan ⎛ ⎜ ⎜ ⎜ ◇ = ⎜ O1 ⎜ ⎜ ⎜ ⎝ O12 O● ⎞ ⎟ ⎟ ⎟ O2 ⎟ ⎟ ⎟ ⎟ ⎠ See also Section 1.2.2. Examples 2.1.1, 2.1.2, 2.1.3, 2.1.4 and 2.1.9 are complete. Examples 2.1.1, 2.1.2 and 2.1.8 do not contain a two-fan. Tropical limits of such configurations are very simple. Essentially, such tropical limits correspond to the tuple of numbers corresponding to the entropies of the constituent spaces. Therefore, we call configurations not containing a two-fan simple. 16 2. Configurations 2.2. Constant configurations. Suppose X is a probability space and G is a diagram category. One may form a constant G-configuration by considering a functor that maps all objects in G to X and all the morphisms to the identity morphism X → X. We denote such a constant configuration by X G or simply by X, when G is clear from the context. Any constant configuration is automatically minimal. If Y = {Yi ; fij } is another G-configuration, then a reduction ρ ∶ Y → X G (which we write sometimes simply as ρ ∶ Y → X) is a collection of reductions ρi ∶ Yi → X, such that fij ○ ρi = ρj 2.3. Configurations of configurations. Of course, the operation of “configuration” could be iterated, so given a pair G1 , G2 of diagram categories we could form a G2 -configuration of G1 -configurations, so we could speak, for example, about a two-fan of configurations of the same type. Prob ⟨G1 , G2 ⟩ ∶= Prob ⟨G1 ⟩ ⟨G2 ⟩ = Prob ⟨G1 ◻ G2 ⟩ where G1 ◻ G2 is the “Cartesian product of graphs” (as every diagram category could be considered as a transitively closed directed graph). This operation is commutative, thus, for example, a two-fan of G-configurations is a G-configuration of two-fans. We will rarely need anything beyond a two-fan of configurations. A two-fan F = (X ← Z → Y) of G-configurations is called minimal if in any extension of F of the form Z f Z′ X Y the reduction f ∶ Z → Z ′ must be an isomorphism of G-configurations. Recall that a two-fan of G-configurations could also be viewed as a Gconfiguration of two-fans of probability spaces. In the following lemma we show that in order to verify the minimality of a two-fan of configurations it is sufficient to check the minimality of all the constituent two-fans. Lemma 2.1. ↓ Let G be a diagram category. Then (i) A two-fan F = (X ← Z → Y) of G-configurations is minimal, if and only if the constituent two-fans of probability spaces Fi = (Xi ← Zi → Yi ) are all minimal. (ii) For any two-fan F = (X ← Z → Y) of G-configurations its minimal reduction exists, that is, there exists a minimal two-fan F ′ = (X ← 17 2. Configurations Z ′ → Y) included in the following diagram Z Z′ X Y ⊠ Even though this lemma is rather elementary, there are many similar statements that are not true. Thus we are compelled to provide a proof, which can be found in Section T on page 59. Similarly, a full configuration F of G-configurations is called minimal if for every two-fan of G-configurations in F there is a minimal two-fan in F of G-configurations with the same terminal configurations. Lemma 2.1 has the following corollary and counterpart for full configurations of G-configurations. Corollary 2.2. Let G be a diagram category. Then (i) A full configuration F of G-configurations is minimal, if and only if the constituent full configurations of probability spaces Fi are all minimal. (ii) For any full configuration F of G-configurations its minimal reduction exists. ⊠ 2.4. Restrictions and extensions. Suppose R ∶ G1 → G2 is a functor between two diagram categories. For a configuration X ∶ G2 → Prob, the pullback configuration Y = R∗ X ∈ Prob ⟨G1 ⟩ defined as the composition Y ∶= X ○ R is called an R-restriction of X to G1 and X is the extension of Y. If the functor R is injective then we call Y = R∗ X a sub-configuration of X and write Y ⊂ X , likewise X will be called a super-configuration of Y. The restriction operation is functorial in the sense that given two configurations X , X ′ ∈ Prob ⟨G1 ⟩ and a reduction f ∶ X → X ′ , there is a canonical reduction R∗ f ∶ R∗ X → R∗ X ′ . Thus R∗ can be considered as a functor R∗ ∶ Prob ⟨G2 ⟩ → Prob ⟨G1 ⟩ Some important examples of restrictions and extensions are below. 2.4.1. Restriction of a full configuration to a smaller full configuration. Recall that, as explained in Section 2.1.4, the terminal vertices of a full configuration could be considered as random variables and any collection of random variables “generates” a full configuration. For a full configuration X = ⟨Xi ⟩ni=1 and a subset I ⊂ {1, . . . , n} we denote by RI∗ X = ⟨Xi ⟩i∈I the restriction of X to a full configuration generated by Xi , 18 2. Configurations ∗ for the restriction operator i ∈ I. We will also make use of the notation Rk,l ∗ R{1,...,k} ∶ Prob ⟨Λl ⟩ → Prob ⟨Λk ⟩. 2.4.2. Restriction of a Λ3 -configuration to an M2 -configuration. Given a full configuration X ∈ Prob ⟨Λ3 ⟩ we may “forget” part of the data. If we, for example, forget the top space and the relation between a pair out of three terminal spaces we end up with the two-tents configuration. This operation corresponds to the inclusion functor ⎛ O ⎜ 12 M ∶⎜ ⎜ ⎜ ⎝ O1 O23 O2 O3 ⎛ ⎜ ⎜ ⎞ ⎜ ⎜ ⎟ ⎟ Ð→ ⎜ ⎜ Q12 ⎟ ⎜ ⎟ ⎜ ⎜ ⎠ ⎜ ⎜ ⎝ Q1 Q123 Q31 Q23 Q2 Q3 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ that preserves the sub-indices. We show in Section 2.5 below that the corresponding restriction operator M ∗ ∶ Prob ⟨Λ3 ⟩ → Prob ⟨M3 ⟩ is surjective, both on objects and all morphisms. Thus, as a map of collections of objects it has a right inverse. However, no natural right inverse exists. 2.4.3. Restriction of a Λ3 -configuration to a W3 -configuration. Starting with a full configuration we might choose to forget the initial space (and reductions, for which it was the domain). The remaining configuration has the combinatorial type of a fence. This operation corresponds to the functor ⎛ O ⎜ 12 W ∶⎜ ⎜ ⎜ ⎝ O1 O31 O2 O23 O3 ⎛ ⎜ ⎜ ⎞ ⎜ ⎜ ⎟ ⎟ Ð→ ⎜ ⎜ Q12 ⎟ ⎜ ⎟ ⎜ ⎜ ⎠ ⎜ ⎜ ⎝ Q1 Q123 Q31 Q23 Q2 Q3 ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ The corresponding operator W ∗ ∶ Prob ⟨Λ3 ⟩ → Prob ⟨W3 ⟩ is not surjective. To find out when a W3 -configuration is extendable to a Λ3 -configuration is an interesting problem, see for example, [ABK+ 15] and references therein. It is our hope that the methods developed in this article might be useful to address these questions. 19 2. Configurations 2.4.4. Doubling. This will be the first example of an interesting functor between diagram categories, which is not injective. In this situation the term “restriction” does not really reflect the operation of pull-back well, however we did not come up with a better terminology. The doubling operation is the restriction of a two-fan to a two-tents configuration. Consider the two-fan category Λ = (O1 ← O12 → O2 ) and a two-tents category M2 = (Q1 ← Q12 → Q2 ← Q23 → Q3 ). Define the functor D ∶ M2 → Λ by setting ⎧ ⎪ Q1 ↦ O1 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ Q2 ↦ O2 ⎪ ⎪ ⎪ D ∶ ⎨Q3 ↦ O1 ⎪ ⎪ ⎪ ⎪ Q12 ↦ O12 ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎩Q23 ↦ O12 Note that D extends uniquely to the spaces of morphisms, since each morphism space is either empty or a one-point set. Thus D∗ (X ← Z → Y ) = (X ← Z → Y ← Z → X), where the “left” and “right” two-fans are isomorphic. This operation along with a particular Information-Optimization problem is related to the so-called copy operation, that was used to find many nonShannon information inequalities, as described, for example, in [DFZ11]. 2.5. Adhesion. Given a minimal two-tents configuration X = (X ← U → Y ← V → Z) ∈ Prob ⟨M2 ⟩m one could always construct an extension of X to a full configuration ad(X ) ∈ Prob ⟨Λ3 ⟩m in the following way: As explained in Section 2.1.4, to construct a minimal full configuration with terminal vertices X, Y and Z it is sufficient to provide a distribution on X × Y × Z with the correct marginals. We do this by setting p(x, y, z) ∶= pU (x, y) ⋅ pV (y, z) pY (y) It is straightforward to check that the appropriate restriction of the full configuration defined in the above manner is indeed the original two-tents configuration. Essentially, to extend we need to provide a relationship (coupling) between spaces X and Z and we do it by declaring X and Z independent relative to Y . This is an instance of operation called adhesion, see [Mat07]. If we call the top vertex in the full configuration W , the entropies achieve equality in the Shannon inequality, that is Ent(U ) + Ent(V ) − Ent(W ) − Ent(Y ) = 0. Adhesion provides a right inverse ad to the restriction functor M ∗ described in Section 2.4.2 ∗ Prob ⟨Λ3 ⟩m M Prob ⟨M2 ⟩m ad 20 2. Configurations Figure 2. Examples of homogeneous configurations It is important to note though, that the map ad is not functorial and, in fact, no functorial inverse of M ∗ exists. 2.6. Homogeneous configurations. A configuration X ∈ Prob ⟨G⟩ modeled on some diagram category G is called homogeneous if its automorphism group Aut(X ) acts transitively on every probability space in X . Three examples of homogeneous configurations were given in the introduction. Other examples of a homogeneous configurations (of combinatorial type Λ3 ) are shown in Figure 2. The subcategory of all homogeneous configurations modeled on G will be denoted Prob ⟨G⟩h . In fact, for X to be homogeneous it is sufficient that the Aut(X ) acts transitively on every initial space in X . Thus, if X is complete with initial space X0 , to check homogeneity it is sufficient to check the transitivity of the action of the symmetries of X on X0 . By functoriality of the restriction operator, any restriction of a homogeneous configuration is also homogeneous. In other words, if R ∶ G → G′ is a functor 21 2. Configurations and R∗ ∶ Prob ⟨G′ ⟩ → Prob ⟨G⟩ is the associated restriction operator, then R∗ ( Prob ⟨G′ ⟩h ) ⊂ Prob ⟨G⟩h In particular, all the individual spaces of a homogeneous configuration are homogeneous Prob ⟨G⟩h ⊂ Probh ⟨G⟩ However homogeneity of the whole of the configuration is a stronger property than homogeneity of the individual spaces in the configuration, thus in general Prob ⟨G⟩h ⊊ Probh ⟨G⟩ A single probability space is homogeneous if and only if there is a representative in its isomorphism class with uniform measure and the same holds true for chain configurations, for the co-fan or any other configuration that does not contain a two-fan. However, for more complex configurations, for example for two-fans, no such simple description is available. 2.6.1. Universal construction of homogeneous configurations. Examples of homogeneous configurations could be constructed in the following manner. Suppose Γ is a finite group and {Hi } is a collection of subgroups. Consider a collection of sets X i ∶= Γ/Hi and consider a natural surjection fij ∶ X i → X j whenever Hi is a subgroup of Hj . Equipping each X i with the uniform distribution one can turn the configuration of sets {X i ; fij } into a homogeneous configuration. It will be complete if there is a smallest subgroup (under inclusion) among Hi ’s. Such a configuration will be complete and minimal, if together with any pair of groups Hi and Hj in the collection, their intersection Hi ∩ Hj also belongs to the collection {Hi }. In fact, any homogeneous configuration arises this way. Suppose configuration X = {Xi ; fij } is homogeneous, then we set Γ = Aut(X ) and choose a collection of points xi ∈ Xi such that fij (xi ) = xj and denote by Hi ∶= Stab(xi ) ⊂ Γ. Then, if one applies the construction of the previous paragraph to Γ, with the collection of subgroups {Hi }, one recovers the original configuration X . 2.7. Conditioning. Suppose a configuration X contains a fan f g F = (X ←Ð Z Ð→ Y ) Given a point x ∈ X with a non-zero weight one may consider conditional probability distributions pZ ( ⋅ ∣ x) on Z, and pY ( ⋅ ∣ x) on Y . The distribution pZ ( ⋅ ∣ x) is supported on f −1 (x) and is given by pZ (z∣ x) = pZ (z) pX (x) 22 3. Distributions and types The distribution pY ( ⋅ ∣ x) is the pushforward of pZ ( ⋅ ∣ x) under g pY ( ⋅ ∣ x) = g∗ pZ ( ⋅ ∣ x) Recall that if F is minimal, the underlying set of Z can be assumed to be the product X × Y . In that case pY (y∣ x) = pZ (x, y) pX (x) We denote the corresponding space Y ∣ x ∶= (Y , pY ( ⋅ ∣ x)), as discussed at the end of Section 1.2.1. Under some assumptions it is possible to condition a whole sub-configuration of X . More specifically, if a configuration X contains a sub-configuration Y and a probability space X satisfying the condition that for every Y in Y there is a fan in X with terminal vertices X and Y , then we may condition the whole of Y on x ∈ X given that pX (x) > 0. For x ∈ X with positive weight we denote by Y∣ x the configuration of spaces in Y conditioned on x ∈ X. The configuration Y∣ x has the same combinatorial type as Y and will be called the slice of Y over x ∈ X. Note that the space X itself may or may not belong to Y. The conditioning Y∣ x may depend on the choice of a fan between Y and X, however when X is complete the conditioning Y∣ x is well-defined and is independent of the choice of fans. Suppose now that there are two subconfiguration Y and Z in X and in ′ addition Z is a constant configuration, Z = Z G for some diagram category G′ . Let z ∈ Z, then Y∣ z is well defined and is independent of the choice of the space in Z, the element of which z is to be considered. If X is homogeneous, then Y∣ x is also homogeneous and its isomorphism class does not depend on the choice of x ∈ X. 2.8. Entropy. For a G-configuration X = {Xi , fij } define the entropy function Ent∗ ∶ Prob ⟨G⟩ → R[[G]] , Ent∗ ∶ X = {Xi , fij } ↦ ( Ent(Xi )) ∈ R[[G]] It will be convenient for us to equip the target R[[G]] with the `1 -norm. Thus [[G]] ∣ Ent∗ (X )∣1 = ∑ Ent(Xi ) i=1 If X is a complete G-configuration with initial space X0 , then by Shannon inequality (1.2) there is an obvious estimate Ent(X0 ) ≤ ∣ Ent∗ (X )∣1 ≤ [[X ]] ⋅ Ent(X0 ) 3. Distributions and types In this section we recall some elementary inequalities for (relative) entropies and the total variation distance for distributions on finite sets. Furthermore, we generalize the notion of a probability distribution on a set to a distribution 23 3. Distributions and types on a configuration of sets. Finally, we give a perspective on the theory of types, and also introduce types in the context of complete configurations. 3.1. Distributions. 3.1.1. Single probability spaces. For a finite set S we denote by ∆S the collection of all probability distributions on S. It is a unit simplex in the real vector space RS . We often use the fact that it is a compact, convex set, whose interior points correspond to fully supported probability measures on S. For π1 , π2 ∈ ∆S denote by ∣π1 − π2 ∣1 the total variation of the signed measure (π1 − π2 ) and define the entropy of the distribution π1 by (3.1) h(π1 ) ∶= − ∑ π1 (x) ln π1 (x) x∈X If, in addition, π2 lies in the interior of ∆S define the relative entropy by π1 (x) (3.2) D(π1 ∣∣ π2 ) ∶= ∑ π1 (x) ln π2 (x) x∈X The entropy of a probability space is often defined through formula (3.1). It is a standard fact, and can be verified with the help of Lemma 3.2 below, that for π ∈ ∆S holds (3.3) h(π) = Ent(S, π) which justifies the name “entropy” for the function h ∶ ∆S → R. Define a divergence ball of radius ε > 0 centered at π ∈ Interior ∆S as (3.4) Bε (π) ∶= {π ′ ∈ ∆S ∣ D(π ′ ∣∣ π) ≤ ε} For a fixed π and ε << 1 the ball Bε (π) also lies in the interior of ∆S. Lemma 3.1. Let S be a finite set, then (i) For any π1 , π2 ∈ ∆S, Pinsker’s inequality holds √ ∣π1 − π2 ∣1 ≤ 2D(π1 ∣∣ π2 ) (ii) For any π2 ∈ Interior ∆S there exists a positive constant C = Cπ2 such that for any π1 ∈ ∆S, holds √ ∣π1 − π2 ∣1 ≥ C D(π1 ∣∣ π2 ) (iii) Suppose π is a point in the interior of ∆S and r > 0 is such that Br (π) also lies in the interior of ∆S. There exist a constant C = Cπ,r such that for any ε ≤ r holds √ max {∣h(π1 ) − h(π2 )∣ ∣ π1 , π2 ∈ Bε (π)} ≤ C ε ⊠ The first claim of the Lemma, Pinsker’s inequality, is a well-known inequality in for instance information theory, and a proof can be found in [CT91]. The second claim follows from the fact that for the fixed π2 ∈ Interior ∆S the relative entropy as the function of the first argument is bounded, smooth on the interior of the simplex and has a minimum at π2 . 24 3. Distributions and types To prove the last claim, note that the entropy function h is smooth in the interior of the simplex. Then this last claim follows from the first claim. 3.1.2. Distributions on configurations. A map f ∶ S → S ′ between two finite sets induces an affine map f∗ ∶ ∆S → ∆S ′ . For a configuration of sets S = {Si ; fij } we define the space of distributions on the configuration S by ∆S ∶= {(πi ) ∈ ∏ ∆Si ∣∣ (fij )∗ πi = πj } i Essentially, an element of ∆S is a collection of distributions on the sets Si in S that is consistent with respect to the maps fij . The consistency conditions (fij )∗ πi = πj form a collection of linear equations with integer coefficients with respect to the standard convex coordinates in ∏ ∆Si . Thus, ∆S is a rational affine subspace in the product of simplices. In particular, ∆S has a convex structure. If S is complete with initial set S0 , then specifying a distribution π0 ∈ ∆S0 uniquely determines distributions on all of the Si ’s by setting πi ∶= (f0i )∗ π0 . In such a situation we have (3.5) ∆S ≅ ∆S0 If S is not complete and S0 , . . . , Sk is a collection of its initial sets, then ∆S is isomorphic to an affine subspace of the product ∆S0 × ⋅ ⋅ ⋅ × ∆Sk cut out by linear equations with integer coefficients corresponding to co-fans in S with initial sets among S0 , . . . , Sk . To simplify notation, for a probability space X or a configuration X we will write ∆X ∶= ∆X ∆X ∶= ∆X We now discuss briefly the theory of types. Types are special subspaces of tensor powers that consist of seqences with the same “empirical distribution” as explained in details below. For a more detailed discussion the reader is referred to [CT91] and [Csi98]. We generalize the theory of types to complete configurations of sets and complete configurations of probability spaces. The theory of types for configurations, that are not complete, is more complex and will be addressed in a subsequent article. 3.2. Types for single probability spaces. Let S be a finite set. For n ∈ N denote also 1 (n) ∆ S ∶= ∆S ∩ ZS n a collection of rational points in ∆S with denominator n. (We say that a rational number r ∈ Q has denominator n ∈ N if r ⋅ n ∈ Z) 25 3. Distributions and types Define the empirical distribution map q ∶ S n → ∆S, that sends (si )ni=1 = s ∈ S n to the empirical distribution q(s) ∈ ∆S given by 1 q(s)(a) = ⋅ ∣ {i ∣ si = a} ∣ for any a ∈ S n (n) Clearly the image of q lies in ∆ S. (n) (n) For π ∈ ∆ S, the space Tπ S ∶= q−1 (π) equipped with the uniform measure is called a type over π. The symmetric group Sn acts on S ⊗n by permuting the coordinates. This action leaves the empirical distribution invariant and therefore could be restricted to each type, where it acts transitively. Thus, for (n) (n) π ∈ ∆ S the probability space (Tπ S, u) with u being a uniform (Sn -invariant) distribution, is a homogeneous space. Suppose X = (X, p) is a probability space. Let τn be the pushforward of p⊗n (n) under the empirical distribution map q ∶ X n → ∆X . Clearly supp τn ⊂ ∆ X, thus (∆X, τn ) is a finite probability space. Therefore we have a reduction q ∶ X ⊗n → (∆X, τn ) (n) which we call the empirical reduction. If π ∈ ∆ X is such that τn (π) > 0, then (3.6) (n) Tπ X = X ⊗n ∣ π In particular, it follows that the right-hand side does not depend on the probability p on X as long as π is “compatible” to it. The following lemma records some standard facts about types, which can be checked by elementary combinatorics and found in [CT91]. 26 3. Distributions and types Lemma 3.2. Let X be a probability space and x ∈ X ⊗n , then (i) (n) n + ∣X∣ ∣∆ X∣ = ( ) ≤ e∣X∣⋅ln(n+1) ∣X∣ (ii) [ ( ) ( )] p⊗n (x) = e−n h q(x) +D q(x) ∣∣ p (iii) (n) en⋅h(π)−∣X∣⋅ln(n+1) ≤ ∣Tπ X∣ ≤ en⋅h(π) (iv) (n) e−n⋅D(π ∣∣ p)−∣X∣⋅ln(n+1) ≤ τn (π) = p⊗n (Tπ X) ≤ e−n⋅D(π ∣∣ p) ⊠ If X = (X, pX ) is a probability space with rational probability distribution with denominator n, then the type over pX will be called the true type of X (n) T (n) X ∶= TpX X As a corollary to Lemma 3.2 and equation (3.3) we obtain the following. (n) Corollary 3.3. For a finite set S and π ∈ ∆ S holds (n) n ⋅ h(π) − ∣S∣ ⋅ ln(n + 1) ≤ Ent(Tπ S) ≤ n ⋅ h(π) In particular, for a finite probability space X = (S, p) with a rational distribution p with denominator n holds n ⋅ Ent(X) − ∣S∣ ⋅ ln(n + 1) ≤ Ent(T (n) X) ≤ n ⋅ Ent(X) ⊠ The following important theorem is known as Sanov’s theorem. It can be derived from Lemma 3.2 and found in [CT91]. Theorem 3.4. (Sanov’s Theorem) Let X be a finite probability space and let q ∶ X ⊗n → (∆X, τn ) be the empirical reduction. Then for every r > 0, τn (∆X/Br (p)) ≤ e−n⋅r+∣X∣⋅ln(n+1) where Br (p) is the divergence ball (relative entropy ball) defined in (3.4). ⊠ 3.3. Types for complete configurations. In this subsection we generalize the theory of types for configurations modeled on a complete category. The theory for a non-complete configurations is more complex and will be addressed in our future work. We will give three equivalent definitions of a type for a complete configuration, each of which will be useful in its own way. Before we describe the three approaches we need some preparatory material. 27 3. Distributions and types Lemma 3.5. Given a diamond configuration of probability spaces ⎛ X D=⎜ ⎜ ρ1 ⎝ A Y ⎞ ⎟ ρ2 ⎟ B ⎠ f g the following two conditions are equivalent (i) The minimal reduction of the diamond D is isomorphic to the adhesion of its co-fan or equivalently the following independence condition holds A– Y ∣B (ii) For any a, a′ ∈ A such that f (a) = f (a′ ) = b ∈ B holds Y ∣ a = Y ∣ a′ = Y ∣ b ⊠ Suppose D is the diamond as in the Lemma 3.5. The top row X → Y is a two-chain subconfiguration of D and we can consider a conditioning by an element a ∈ A X∣ a → Y ∣ a If D satisfies any of two conditions in Lemma 3.5, then Y ∣ a = Y ∣ b for b = g(a). Thus, we constructed a reduction X∣ a → Y ∣ b Suppose we have a reduction f ∶ X → Y between a pair of probability spaces. Then for any n ∈ N there is an induced reduction f∗ ∶ (∆X, τn ) → (∆Y, τn ) that can be included in the following diamond configuration f ⊗n X ⊗n Y ⊗n q q (∆X, τn ) f∗ (∆Y, τn ) that satisfies conditions in Lemma 3.5. It means that there is a reduction (n) (n) T f ∶ Tπ X → Tπ′ Y (n) (n) for π ∈ ∆ X and π ′ = f∗ π ∈ ∆ Y . Now we are ready to give the definitions of types. Let X ∈ Prob ⟨G⟩ be a (n) complete configuration, X = {Xi ; fij } with initial space X0 and let π ∈ ∆ X . 3.3.1. Type of a configuration as the configuration of types. Define the type (n) Tπ X as the G-configuration, whose individual spaces are types of the individual spaces of X over the corresponding push-forwards of π (n) (n) Tπ X ∶= {Tπi X i ; T fij } 28 3. Distributions and types 3.3.2. Types as Sn -orbits in the tensor power. By a section in X we mean a consistent collection of points [[X ]]−1 x = (x0 , . . . , x[[X ]]−1 ) ∈ ∏ X i i=0 such that fij xi = xj , whenever fij is defined. For any j define the projection ρj ∶ ∏ X i → X j , so that ρj (x) = xj . The symmetric group Sn acts on the collection of sections in the tensor power X ⊗n , by permuting the coordinates. Let T ⊂ ∏ X i be an orbit of the (n) action such that ρ0 (T ) = Tπ X 0 . Suppose that the pair (i, j) is such, that fij is defined. Since fij⊗n ∶ Xi⊗n → Xj⊗n is Sn -equivariant, we have a map T f ∶ ρi (T ) → ρj (T ) We can turn T into a G-configuration, which we will call a type of X (n) T̂π X ∶= {ρi (T ), T fij } where π is the value of the impirical distribution on ρ0 (T ). (n) (n) Since the initial space in T̂π X coincides with the initial space in Tπ X and all the reductions coincide, we conclude that (n) (n) T̂π X = Tπ X 3.3.3. Type as conditionining of the tensor power. We can extend X ⊗n to a configuration Xˆ by adding (∆X , τn ) and the empirical reduction X0⊗n → (∆X , τn ). Let π ∈ ∆X with τn (π) > 0 and recall ∆X0 ≅ ∆X . We may now define (n) ⊗n X ∣ π as in Section 2.7. Define a type of X over π ∈ ∆ X by (n) Ťπ X ∶= X ⊗n ∣ π By definition, it holds that (n) X0⊗n ∣ π = Tπ X0 Let πi = (f0i )∗ π. Using Lemma 3.5 and discussion thereafter we conclude that Xi⊗n ∣ π = Xi⊗n ∣ πi and therefore (n) (n) Ťπ X = Tπ X 3.3.4. The empirical two-fan. We construct a two-fan of G-configurations with terminal vertices X ⊗n and (∆X , τn )G (the constant G-configuration in which every probability space is (∆X , τn ), and every reduction is an identity) (3.7) ⎛ ⎜ ⎜ Rn (X ) = ⎜ ⎜ ⎜ ⎝ X ⊗n X˜ (n) (n) (∆ X , τn )G ⎞ ⎟ ⎟ ⎟ ⎟ ⎟ ⎠ 29 4. The Kolmogorov-Sinai distance With the help of Lemma 2.1, we construct Rn (X ) as the minimal reduction of the two-fan of G-configurations (X0⊗n )G n f0∗ qG X ⊗n (∆X , τn )G Let π ∈ (∆X , τn ) with τn (π) > 0. Then within Rn (X ) holds (n) X ⊗n ∣ π = Tπ X (n) (n) For every n ∈ N and π ∈ ∆ X 0 the type Tπ X is a homogeneous configuration. Suppose that a complete configuration X is such that the probability distribution p0 on the initial set is rational with the denominator n, then we (n) call Tp X the true type of X and denote T (n) X ∶= Tpn0 X 4. The Kolmogorov-Sinai distance We turn the space of configurations into a pseudo-metric space by introducing the intrinsic Kolmogorov-Sinai distance and asymptotic Kolmogorov-Sinai distance. For brevity, we will usually call it the Kolmogorov distance and asymptotic Kolmogorov distance. The intrinsic Kolmogorov-Sinai distance is obtained by taking an infimum of the shared information distance over all possible joint distributions on two probability spaces. The name is justified by the fact that the shared information distance (not under this name) appears in the proof of the theorem about generating partitions for ergodic systems by Kolmogorov and Sinai, see for example [Sin76]. Note that the Kolmogorov distance in statistics refers to a different notion. 4.1. Kolmogorov distance and asymptotic Kolmogorov distance. 4.1.1. Kolmogorov distance in the case of single probability spaces. For a twofan F = (X ← Z → Y ) define a “distance” kd(F) between probability spaces X and Y with respect to F by kd(F) ∶= Ent(Z∣ Y ) + Ent(Z∣ X) = 2 Ent(Z) − Ent(X) − Ent(Y ) Essentially kd(F) measures the deviation of the statistical map defined by F from being a deterministic bijection between X and Y . The minimal reduction F ′ of F satisfies (4.1) kd(F ′ ) ≤ kd(F) If the two-fan F is minimal the “distance” kd(F) can also be calculated by kd(F) = h(pX ) + h(pY ) − 2D(pZ ∣∣ pX ⊗ pY ), 30 4. The Kolmogorov-Sinai distance where h and D are respectively the entropy and relative entropy functions defined in (3.1) and (3.2). For a pair of probability spaces X, Y define the intrinsic Kolmogorov-Sinai distance as k(X, Y ) ∶= inf {kd(F) ∣ F = (X ← Z → Y ) is a two-fan} The optimization takes place over all two-fans with terminal spaces X and Y . In view of inequality (4.1) one could as well optimize over the space of minimal two-fans, which we will also refer to as couplings between X and Y . The tensor product of X and Y trivially provides a coupling and the set of couplings is compact, therefore an optimum is always achieved and it is finite. The bivariate function k ∶ Prob × Prob → R≥0 defines a notion of pseudodistance and it vanishes exactly on pairs of isomorphic probability spaces. This follows directly from the Shannon inequality (1.2), and a more general statement will be proven in Proposition 4.1 below. 4.1.2. Kolmogorov distance for complete configurations. The definition of Kolmogorov distance for complete configurations repeats almost literally the definition for single spaces. We fix a complete diagram category G and will be considering configurations from Prob ⟨G⟩. Consider three configurations X = {Xi , fij }, Y = {Yi , gij } and Z = {Zi , hij } from Prob ⟨G⟩. Recall that a two-fan F = (X ← Z → Y) is a G-configuration of two-fans Fi = (Xi ← Zi → Yi ) Define kd(F) ∶= ∑ kd(Fi ) i = ∑ (2 Ent(Zi ) − Ent(Xi ) − Ent(Yi )) i The quantity kd(F) vanishes if and only if the fan F provides isomorphisms between all individual spaces in X and Y that commute with the inner structure of the configurations, that is, it provides an isomorphism between X and Y in Prob ⟨G⟩. The intrinsic Kolmogorov-Sinai distance between configurations is defined in analogy with the case of single probability spaces k(X , Y) ∶= inf {kd(F) ∣ F = (X ← Z → Y)} where the infimum is over all two-fans of G-configurations with terminal vertices X and Y. The following proposition records that the intrinsic Kolmogorov distance is in fact a pseudo-distance on Prob ⟨G⟩, provided G is a complete diagram category (that is when G has a unique initial space). Proposition 4.1. ↓ Let G be a complete diagram category. Then the bivariate function k ∶ Prob ⟨G⟩ × Prob ⟨G⟩ → R 4. The Kolmogorov-Sinai distance 31 is a pseudo-distance on Prob ⟨G⟩. Moreover, two configurations X , Y ∈ Prob ⟨G⟩ satisfy k(X , Y) = 0 if and only if X is isomorphic to Y in Prob ⟨G⟩. ⊠ The idea of the proof is very simple. In the case of single probability spaces X, Y, Z a coupling between X and Z can be constructed from a coupling between X and Y and a coupling between Y and Z by adhesion on Y , see Section 2.5. The triangle inequality then follows from a Shannon inequality. However, since we are dealing with configurations the combinatorial structure requires careful treatment. Therefore, we provide a detailed proof on page 61. It is important to note, that the proof uses the fact that G is complete. In fact, even though the definition of k could be easily extended to some bivariate function on the space of configurations of any fixed combinatorial type, it fails to satisfy the triangle inequality in general, because the composition of couplings requires completeness of G. 4.1.3. The asymptotic Kolmogorov-Sinai distance. Let G be a complete diagram category. We define the asymptotic Kolmogorov-Sinai distance between two configurations X , Y ∈ Prob ⟨G⟩ by 1 (4.2) κ(X , Y) = lim k(X ⊗n , Y ⊗n ). n→∞ n We will show in Corollary 4.5, that the sequence n ↦ k(X ⊗n , Y ⊗n ) is subadditive, and therefore the limit in the definition (4.2) of κ(X , Y) always exists and for all n ∈ N holds 1 (4.3) κ(X , Y) ≤ ⋅ k(X ⊗n , Y ⊗n ). n As a corollary of Proposition 4.1 and definition (4.2) we immediately obtain that also the asymptotic Kolmogorov-Sinai distance is a pseudo-distance on Prob ⟨G⟩. Corollary 4.2. Let G be a complete diagram category. Then the bivariate function κ ∶ Prob ⟨G⟩ × Prob ⟨G⟩ → R is a pseudo-distance on Prob ⟨G⟩ satisfying the following homogeneity property. For any pair of configurations X , Y ∈ Prob ⟨G⟩ and any n ∈ N0 holds κ(X ⊗n , Y ⊗n ) = n ⋅ κ(X , Y) ⊠ We will show in a later section, however, that there are probability spaces X and Y for which κ(X, Y ) = 0 that are not isomorphic. In the rest of this section we derive some elementary properties of the intrinsic Kolmogorov distance and the asymptotic Kolmogorov distance. 32 4. The Kolmogorov-Sinai distance 4.2. Lipschitz property for operations. In this section we show that certain natural operations on configurations, namely the tensor product, entropy function and restriction operator, are Lipschitz continuous. In Section 7 we will show Lipschitz continuity of certain extension operations. 4.2.1. Tensor product. We show that the tensor product on the space of configurations is 1-Lipschitz. Later this will allow us to give a simple description of tropical configurations, that is of points in the asymptotic cone of Prob ⟨G⟩, as limits of certain sequences of “classical” configurations. Proposition 4.3. ↓ Let G be a complete diagram category. Then with respect to the Kolmogorov distance on Prob ⟨G⟩ the tensor product ⊗ ∶ (Prob ⟨G⟩ , k)2 → (Prob ⟨G⟩ , k) is 1-Lipschitz in each variable, that is, for every triple X , Y, Y ′ ∈ Prob ⟨G⟩ the following bound holds k(X ⊗ Y, X ⊗ Y ′ ) ≤ k(Y, Y ′ ) ⊠ This statement is a direct consequence of additivity of entropy with respect to the tensor product. Details can be found on page 63. It follows directly from definition (4.2) and Proposition 4.3, that the asymptotic Kolmogorov distance enjoys a similar property. Corollary 4.4. Let G be a complete diagram category. Then with respect to the Kolmogorov distance on Prob ⟨G⟩ the tensor product ⊗ ∶ (Prob ⟨G⟩ , κ)2 → (Prob ⟨G⟩ , κ) ⊠ is 1-Lipschitz in each variable. As another corollary we obtain the subadditivity properties of the intrinsic Kolmogorov distance and asymptotic Kolmogorov distance. Corollary 4.5. Let G be a complete diagram category and let X , Y, U, V ∈ Prob ⟨G⟩, then k(X ⊗ U, Y ⊗ V) ≤ k(X , Y) + k(U, V). and κ(X ⊗ U, Y ⊗ V) ≤ κ(X , Y) + κ(U, V). ⊠ It implies in particular that shifts are non-expanding maps in (Prob ⟨G⟩ , k) or (Prob ⟨G⟩ , κ). Corollary 4.6. Let G be a complete diagram category and δ = k, κ be either Kolmogorov distance or asymptotic Kolmogorov distance on Prob ⟨G⟩. Let U ∈ Prob ⟨G⟩. Then the shift map U ⊗ ⋅ ∶ (Prob ⟨G⟩ , δ) → (Prob ⟨G⟩ , δ), X ↦U ⊗X 33 4. The Kolmogorov-Sinai distance is a non-expanding map with respect to either Kolmogorov distance or asymptotic Kolmogorov distance. ⊠ 4.2.2. Entropy. Recall that we defined the entropy function Ent∗ ∶ Prob ⟨G⟩ → R[[G]] by evaluating the entropy of all individual spaces in a G-configuration. The target space R[[G]] will be endowed with the `1 -norm with respect to the natural coordinate system. With such a choice, the entropy function is 1-Lipschitz with respect to the Kolmogorov distance on Prob ⟨G⟩. Proposition 4.7. ↓ Suppose G is a complete diagram category and δ = k, κ is either Kolmogorov distance or asymptotic Kolmogorov distance on Prob ⟨G⟩. Then the entropy function Ent∗ ∶ (Prob ⟨G⟩ , δ) → (R[[G]] , ∣ ⋅ ∣1 ), X = {Xi , fij } ↦ (EntXi )i ∈ R[[G]] ⊠ is 1-Lipschitz. Again, the proof of the proposition above is an application of Shannon’s inequality, see page 64 for details. 4.2.3. Restrictions. The restriction operators are also Lipschitz, as shown in the next proposition. Proposition 4.8. ↓ Suppose R ∶ G′ → G is a functor between two complete diagram categories and δ stands for either Kolmogorov or asymptotic Kolmogorov distance. Then the restriction operator R∗ ∶ (Prob ⟨G⟩ , δ) → (Prob ⟨G′ ⟩ , δ), X ↦X ○R ⊠ is Lipschitz. As can be seen from the proof on page 64, the Lipschitz constant in the proposition above can be bounded by [[G′ ]]. In fact, a more careful analysis provides a better bound by the maximal number of objects in G′ that are mapped by R to a single object in G. 4.3. The Slicing Lemma. The Slicing Lemma, Proposition 4.9 below, allows to estimate the Kolmogorov distance between two configurations with the integrated Kolmogorov distance between “slices”, which are configurations obtained by conditioning on another probability space. The Slicing Lemma, along with the local estimate in Section 4.4, turned out to be a very powerful tool for estimation of the Kolmogorov distance and will be used below on many occasions. As described in Section 2.2, by a reduction of a configuration X = {Xi , fij } to a single space U we mean a collection of reductions {ρi ∶ Xi → U } from the individual spaces in X to U , that commute with the reductions within X ρj ○ fij = ρi 34 4. The Kolmogorov-Sinai distance Alternatively, whenever a single probability space appears together with a Gconfiguration in a commutative diagram, it should be replaced by a constant G-configuration. Proposition 4.9. ↓ (Slicing Lemma) Suppose G is a complete diagram category and we are given X , Xˆ , Y, Ŷ ∈ Prob ⟨G⟩ – four G-configurations and U, V, W ∈ Prob – probability spaces, that are included into the following threetents configuration Xˆ X Ŷ W U V Y such that the two-fan (U ← W → V ) is minimal. Then the following estimate holds k(X , Y) ≤ ∫ k(X ∣ u, Y∣ v) d pW (u, v) W + [[G]] ⋅ kd(U ← W → V ) + ∑ [ Ent(U ∣ Xi ) + Ent(V ∣ Yi )] i ⊠ The idea of the proof of the Slicing Lemma (page 65) is as follows. For every pair (u, v) ∈ W we consider an optimal two-fan Guv coupling X ∣ u and Y∣ v. These fans have the same underlying configuration of sets. Then we construct a coupling between X and Y as a convex combination of distributions of Guv ’s weighted by pW (u, v). The estimates on the resulting two-fan then imply the proposition. Various implications of the Slicing Lemma are summarized in the next corollary. Corollary 4.10. Let G be a complete diagram category, X , Y ∈ Prob ⟨G⟩ and U ∈ Prob. (i) Given a “two-tents” configuration X ← Xˆ → U ← Ŷ → Y the following inequality holds k(X , Y) ≤ ∫ k(X ∣ u, Y∣ u) d pU (u) + 2 ⋅ [[G]] ⋅ Ent(U ) U (ii) Given a fan X ← Xˆ → U the following inequality holds k(X , Y) ≤ ∫ UV k(X ∣ u, Y) d pU (u) + 2 ⋅ [[G]] ⋅ Ent(U ) 4. The Kolmogorov-Sinai distance 35 (iii) Let X → U be a reduction, then k(X , Y) ≤ ∫ k(X ∣ u, Y) d pU (u) + [[G]] ⋅ Ent(U ) U (iv) For a co-fan X → U ← Y holds k(X , Y) ≤ ∫ k(X ∣ u, Y∣ u) d pU (u) U ⊠ 4.4. Local estimate. Fix a complete diagram category G and consider a Gconfiguration of sets S ∈ Set ⟨G⟩ with S0 being an initial set in S. As discussed in Section 3.1.2, the space of distributions on S could be identified with the space of distributions on the initial set ∆S ≅ ∆S0 Therefore, all G-configurations of probability spaces with the underlying configuration of sets equal to S are in one-to-one correspondence with the interior points of ∆S0 . The set Interior ∆S0 consists of fully supported measures on the set S0 and carries a total variation distance, which is just an `1 -distance with respect to the convex coordinates on the simplex ∆S0 . Our task presently is to compare the total variation distance with the Kolmogorov distance on the space of configurations with the fixed underlying configuration of sets. The upper bound on Kolmogorov distance, that we derive below, has two summands. One is linear in the total variation distance with the slope proportional to the log-cardinality of S0 . The second one is super-linear in the total variation distance, but it does not depend on S. So we have the following interesting observation: of course, the super-linear summand always dominates the linear one locally. However as the cardinality of S becomes large it is the linear summand that starts playing the main role. 4.4.1. The estimate. Suppose we are given a configuration of sets S = {Si , fij } ∈ Set ⟨G⟩ modeled on a complete diagram category G with the initial set S0 . We use once again the isomorphism ≅ ∆S → ∆S0 that sends p ∈ ∆S to its component in the initial space p0 ∈ ∆S0 , while its inverse is given by p = {(f0i )∗ p0 }. For a pair of distributions p0 , q0 ∈ ∆S0 denote by ∣p0 − q0 ∣ the total variation of the difference. For α ∈ [0, 1] consider a binary probability space with the weight of one of the atoms equal to α Λα ∶= ( {◻, ∎} ; pΛα (◻) = 1 − α, pΛα (∎) = α) 36 5. Distance between types Proposition 4.11. ↓ Let S = {Si , fij } ∈ Set ⟨G⟩ be a configuration of sets modeled on a complete diagram category G with the initial set S0 . Let p, q ∈ ∆S be two probability distributions. Denote X ∶= (S, p), Y ∶= (S, q) and α = 1 2 ∣p0 − q0 ∣1 . Then k(X , Y) ≤ 2 ⋅ [[G]] ⋅ (α ⋅ ln ∣S0 ∣ + Ent(Λα )) ⊠ To prove the local estimate we decompose both p and q into a convex combination of a common part p̂ and rests p+ and q + . The coupling between the common parts gives no contribution to the distance, and the worst possible estimate on the other parts is still enough to get the bound in the lemma, by using Corollary 4.10 part (i). Details of the proof can be found on page 67. In fact, the lower bound also holds, more specifically given a complete Gconfiguration of sets S and p ∈ ∆S there is a constant C > 0 such that for any q ∈ ∆S with ∣p − q∣1 << 1 holds C ⋅ Ent(Λα ) ≤ k(X , Y) where X = (S, p), Y = (S, q) and α = 21 ∣p − q∣1 . We will not use this fact and therefore do not include a proof. Once the G-configuration of sets S is fixed, there is a map from ∆S to Prob ⟨G⟩. As can be seen from the discussion above, even though the map is continuous it is not Lipschitz. 5. Distance between types As explained in Section 3.3, given a complete G-configuration S of sets and a (n) rational distribution π ∈ ∆S we construct a homogeneous configuration Tπ S, which is called the type of S over π. Our goal in this section is to estimate the Kolmogorov distance between two types over two different distributions (n) π1 , π2 ∈ ∆ S in terms of the total variation distance ∣π1 − π2 ∣1 . For this purpose we use a “lagging” technique which is explained below. 5.1. The lagging trick. Let Λα be a binary probability space, Λα = ( {◻, ∎} ; pΛα (∎) = α) and let X = {(X i , pi ); fij }, Z = {(Z i , qi ); gij } be two configurations modeled on a complete diagram category G and included in a minimal two-fan λ ρ Λα ←Ð Z Ð→ X Recall that the left terminal vertex in this two-fan should be interpreted as a constant G-configuration ΛG α. Assume further that the distribution q on Z is rational with denominator (n) n ∈ N, that is q ∈ ∆ Z. It follows that p and pΛα are also rational with the same denominator n. 37 5. Distance between types We construct a lagging two-fan (5.1) Tρ l L ∶= (T ((1−α)n) (X ∣ ◻) ←Ð T (n) Z Ð→ T (n) X ) as follows. The right leg T ρ of L is induced by the right leg ρ of the original two-fan. The left leg l ∶ T (n) Z → T ((1−α)n) (X ∣ ◻) is obtained by erasing symbols that reduce to ∎ and applying ρ to the remaining symbols. The target space for the reduction l is the true type of X ∣ ◻ which is “lagging” behind T (n) Z by a factor of (1−α). More specifically, the reduction l is constructed as follows. Let λj ∶ Zj → Λα be the components of the reduction λ ∶ Z → Λα . Given z = (zi )ni=1 ∈ T (n) Zj define the subset of indexes Iz ∶= {i ∣ λj (zi ) = ◻} and define the j th component of l by lj ((zi )ni=1 ) ∶= (ρ(zi ))i∈Iz By equivariance each lj is a reduction of homogeneous spaces, since the inverse image of any point has the same cardinality. Moreover the reductions lj commute with the reductions in T (n) Z as explained in Section 3.3 and therefore l is a reduction of configurations. The next lemma uses the lagging two-fan to estimate the Kolmogorov distance between its terminal configurations. Lemma 5.1. Let X , Z ∈ Prob ⟨G⟩ be two configurations modeled on a complete diagram category G and included in a minimal two-fan λ ρ Λα ←Ð Z Ð→ X where distribution on Z is rational with denominator n ∈ N. Then k (T ((1−α)n) (X ∣ ◻) , T (n) X ) ≤ n ⋅ [[G]] ⋅ [2 Ent(Λα ) + α ⋅ ln ∣X0 ∣] + 2 ⋅ [[G]] ⋅ ∣X0 ∣ ⋅ ln(n + 1) = n ⋅ [[G]] ⋅ [2 Ent(Λα ) + α ⋅ ln ∣X0 ∣] + O (∣X0 ∣ ⋅ ln n) ⊠ The Lemma (and Proposition 5.2 below) are closely related to the local estimate, Proposition 4.11. It is an immediate consequence of the Slicing Lemma, in particular Corollary 4.10 part (ii) that k (X ∣ ◻ , X ) ≤ [[G]] ⋅ [2 Ent(Λα ) + α ⋅ ln ∣X0 ∣] This is a tacit ingredient in the proof of the local estimate. By the subadditivity of the Kolmogorov distance, k ((X ∣ ◻)⊗n , X ⊗n ) ≤ n ⋅ [[G]] ⋅ [2 Ent(Λα ) + α ⋅ ln ∣X0 ∣] 38 5. Distance between types This bound is almost the estimate in Lemma 5.1, except Lemma 5.1 estimates the distance between types rather than tensor powers. We will soon see that tensor powers and types are very close in the Kolmogorov distance. However, for the purpose of the proof of Lemma 5.1, it suffices to know that their entropies are close, an estimate that is provided by Corollary 3.3. Proof (of Lemma 5.1): We will use the lagging two-fan constructed in Equation (5.1), namely l Tρ L ∶= (T ((1−α)n) (X ∣ ◻) ←Ð T (n) Z Ð→ T (n) X ) as a coupling to estimate the Kolmogorov distance k (T ((1−α)n) (X ∣ ◻) , T (n) X ) ≤ kd(L) Recall that by Corollary 3.3 for a probability space X with a rational distribution we have n ⋅ Ent(X) − ∣X∣ ⋅ ln(n + 1) ≤ Ent(T (n) X) ≤ n ⋅ Ent(X) Thus we can estimate kd(L) as follows kd(L) = ∑ [( Ent(T (n) Zi ) − Ent(T (n) Xi )) i + ( Ent(T (n) Zi ) − Ent(T ((1−α)n) (Xi ∣ ◻)))] ≤ n ⋅ ∑ [( Ent(Zi ) − Ent(Xi )) + ( Ent(Zi ) − (1 − α) Ent(Xi ∣ ◻))] i + 2 ⋅ [[G]] ⋅ ∣X0 ∣ ⋅ ln(n + 1) By minimality of the original two-fan and Shannon inequality (1.2) we have a bound Ent(Zi ) − Ent(Xi ) ≤ Ent(Λα ) The second part in the sum can be estimated using relation (1.4) as follows Ent(Zi ) − (1 − α) Ent(Xi ∣ ◻) = Ent(Λα ) + Ent(Xi ∣ Λα ) − (1 − α) Ent(Xi ∣ ◻) = Ent(Λα ) + (1 − α) Ent(Xi ∣ ◻) + α Ent(Xi ∣ ∎)− − (1 − α) Ent(Xi ∣ ◻) ≤ Ent(Λα ) + α ⋅ ln ∣Xi ∣ Combining all of the above we obtain the estimate in the conclusion of the lemma. ⊠ 5.2. Distance between types. In this section we use the lagging trick as described above to estimate the distance between types over two different distributions in ∆S where S is a complete configuration of sets. 39 5. Distance between types Proposition 5.2. Suppose S is a complete G-configuration of sets with initial (n) set S0 . Suppose p, q ∈ ∆ S and let α = 12 ∣p0 − q0 ∣1 . Then (n) (n) k(Tp S, Tq S) ≤ 2n ⋅ [[G]] ⋅ [α ⋅ ln ∣S0 ∣ + 2 Ent(Λα )] + 4[[G]] ⋅ ∣X0 ∣ ⋅ ln(n + 1) = 2n ⋅ [[G]] ⋅ [α ⋅ ln ∣S0 ∣ + 2 Ent(Λα )] + O(∣X0 ∣ ⋅ ln n) ⊠ As in the local estimate, the idea of the proof is to write p and q as a convex combination of a common distribution p̂ and “small amounts” of p+ and q + , respectively. Then we use the lagging trick to estimate distances between types over p and p̂, as well as between types over q and p̂. We now present details of the proof. Proof (of Proposition 5.2): Recall that for a complete configuration S with initial set S0 we have ∆S ≅ ∆S0 (5.2) Our goal now is to write p and q as the convex combination of three other distributions p̂, p+ and q + as in p = (1 − α) ⋅ p̂ + α ⋅ p+ q = (1 − α) ⋅ p̂ + α ⋅ q + We could do it the following way. Let α ∶= 21 ∣p0 − q0 ∣1 . If α = 1 then the proposition follows trivially by constructing a tensor-product fan, so from now on we assume that α < 1. Define three probability distributions p̂0 , p+0 and q0+ on S0 by setting for every x ∈ S0 1 min {p0 (x), q0 (x)} 1−α 1 p+0 ∶= (p0 − (1 − α)p̂0 ) α 1 + q0 ∶= (q0 − (1 − α)p̂0 ) α p̂0 (x) ∶= Denote by p̂, p+ , q + ∈ ∆S the distributions corresponding to p̂0 , p+0 , q0+ ∈ ∆S0 under the affine isomorphism (5.2). Thus we have p = (1 − α)p̂ + α ⋅ p+ q = (1 − α)p̂ + α ⋅ q + Now we construct a pair of two-fans of G-configurations (5.3) Λα ← X˜ → X Λα ← Ỹ → Y 40 6. AEP for configurations by setting X ∶= (S, p) Y ∶= (S, q) X̃i ∶= (Si × Λα ; p̃i (s, ◻) = (1 − α)p̂i (s), p̃i (s, ∎) = α ⋅ p+i (s)) Ỹi ∶= (Si × Λα ; q̃i (s, ◻) = (1 − α)p̂i (s), q̃i (s, ∎) = α ⋅ qi+ (s)) and X˜ ∶= {X̃i ; fij × Id} Ỹ ∶= {Ỹi ; fij × Id} The reductions in (5.3) are given by coordinate projections. We have the following isomorphisms X ∣ ◻ ≅ Y∣ ◻ ≅ (S, p̂) To estimate the distance between types we now apply Lemma 5.1 to the fans in (5.3) (n) (n) k(Tp S, Tq S) = k(T (n) X , T (n) Y) ≤ k (T (n) X , T ((1−α)n) (X ∣ ◻)) + k (T ((1−α)n) (Y∣ ◻), T (n) Y) ≤ 2n ⋅ [[G]] ⋅ [α ⋅ ln ∣S0 ∣ + 2 Ent(Λα )] + 4[[G]] ⋅ ∣X0 ∣ ⋅ ln(n + 1) ⊠ The reason for the similarity between the local estimate and the distance estimate between types will become clear in the next section, when we establish the asymptotic equivalence between the Bernoulli sequence of probability spaces and sequence of types over rational distributions approximating the true distribution. 6. Asymptotic equipartition property for configurations Below we prove that any Bernoulli sequence can be approximated by a sequence of homogeneous configurations. This is essentially the Asymptotic Equipartition Theorem for configurations. Theorem 6.1. Suppose X ∈ Prob ⟨G⟩ is a complete configuration of probab ility spaces. Then there exists a sequence H = (Hn )∞ n=0 of homogeneous configurations of the same c ombinatorial type as X such that √ ⎛ 1 ln3 n ⎞ k(X ⊗n , Hn ) = O n n ⎠ ⎝ 41 6. AEP for configurations More precisely, the sequence H may be chosen such that for all n ≥ ∣X0 ∣ √ 1 ln3 n (6.1) k(X ⊗n , Hn ) ≤ C(∣X0 ∣, [[G]]) ⋅ n n where C(∣X0 ∣, [[G]]) is a constant only depending on ∣X0 ∣ and [[G]]. ⊠ Proof: Denote by S = X the underlying configuration of sets and by pX the true distribution on S, such that X = (S, pX ) We will construct the approximating homogeneous sequence by taking types over rational approximations of pX in ∆S, that converge sufficiently fast to the true distribution pX . (n) More specifically, we select rational distributions pn ∈ ∆ S such that ∣pn − pX ∣1 ≤ ∣S0 ∣ n (n) As homogeneous spaces Hn we set Hn = Tpn S. We will show that the Kolmogorov distance between Hn and X ⊗n satisfies the required estimate (6.1). First we apply slicing along the empirical two-fan Rn (X ) = (X ⊗n ← X˜ (n) → (∆S, τn )G ) defined in Section 3.3, Equation (3.7) on page 28. For the estimate below we use the fact that (n) Ent(∆S, τn ) ≤ ln ∣∆ S∣ ≤ ∣S0 ∣ ⋅ ln(n + 1) By slicing (see Corollary 4.10(ii)) along the empirical two-fan we have (n) k(Tpn S, X ⊗n ) ≤ 2 ⋅ [[G]] ⋅ Ent(∆S, τn ) + ∫ (n) ∆S ≤ 2 ⋅ [[G]] ⋅ ∣S0 ∣ ⋅ ln(n + 1) + ∫ (n) k(Tpn S, Tπ S) d τn (π) (n) ∆S (n) k(Tpn S, Tπ S) d τn (π) To estimate the integral we split the domain into a small divergence ball Bεn = Bεn (pX ) around the “true” distribution and its complement (n) (n) (n) (n) ∫∆S k(Tpn S, Tπ S) d τn (π) = ∫∆S∖B k(Tpn S, Tπ S) d τn (π) εn +∫ (6.2) (n) Bεn (n) k(Tpn S, Tπ S) d τn (π) and we set the radius εn equal to ln(n + 1) n To estimate the first integral on the right-hand side of equality (6.2) note that the distance between two types over the same configuration of sets can always be crudely estimated by εn ∶= (∣S0 ∣ + 1) 2 ⋅ ln ∣S0 ∣ ⋅ [[G]] ⋅ n 42 7. Extensions Moreover, by Sanov’s theorem, Theorem 3.1, we can estimate the empirical measure of the complement of the divergence ball τn (∆S ∖ Bεn ) ≤ e−n⋅εn +∣S0 ∣⋅ln(n+1) ≤ 1 n where we used the definition of εn to conclude the last inequality. Therefore we obtain (n) (n) ∫∆S∖B k(Tpn S, Tπ S) d τn (π) ≤ 2 ⋅ ln ∣S0 ∣ ⋅ [[G]] ⋅ n ⋅ τn (∆S ∖ Bεn ) εn ≤ 2 ⋅ ln ∣S0 ∣ ⋅ [[G]] Define αn = ∣S0 ∣ √ + 2εn n if the right-hand side is smaller than 1 and set αn = 1 otherwise. Then every π ∈ Bεn (pX ) satisfies ∣pn − π∣ ≤ 2αn by Pinsker’s inequality (Lemma 3.1, (i)), and the triangle inequality. Consequently, by the estimate on the distance between types in Proposition 5.2 (n) (n) ∫B k(Tpn S, Tπ S) d τn (π) εn ≤ 2n ⋅ [[G]] ⋅ (αn ln ∣S0 ∣ + 2 Ent(Λαn )) + 4 ⋅ [[G]] ⋅ ∣S0 ∣ ⋅ ln(n + 1) Using the definition of αn and εn we find that ∫B εn √ (n) (n) k(Tpn S, Tπ S) d τn (π) = O ( n ⋅ ln3 n) and hence combining the above estimates ⎛ 1 (n) k(Tpn S, X ⊗n ) = O n ⎝ √ ln3 n ⎞ . n ⎠ A more precise check shows that for n ≥ ∣S0 ∣, the constants appearing in O only depend on ∣S0 ∣ and [[G]]. ⊠ It is worth noting that each type considered as a subspace of the tensor power takes up only small probability. In fact its probability converges to zero with growing n. But as the calculation above shows, most (in terms of probability) of the configuration X ⊗n consists of polynomially many types that are k-similar to each other. Relative to the exponential growth of sizes of all the parts, “polynomially many” is as good as one. This is the difference with the setup used in Gromov’s [Gro12] 43 7. Extensions 7. Extensions In the introduction we have already emphasized the close relationship between relative entropic sets and Information-Optimization problems. There, our definitions were restricted to extensions of two-fans to full configurations corresponding to three random variables. We will now generalize these definitions, and make the relationship between relative entropic sets and InformationOptimization problems explicit. Further we will prove the Extension Lemma and use it to show that the relative entropic set associated to a full configuration depends continuously on the configuration. 7.1. Information-Optimization and the relative entropic set. In Section 2.4.1 we introduced (for k ≤ l) the restriction operator ∗ Rk,l ∶ Prob ⟨Λl ⟩ → Prob ⟨Λk ⟩ as follows. For a minimal full configuration Y = ⟨Yi ⟩li=1 we denote by ∗ Y = ⟨Yi ⟩i∈{1,...,k} Rk,l the restriction of Y to a minimal full configuration generated by Yi , i ∈ {1, . . . , k}. We call a minimal configuration Y ∈ Prob ⟨Λk ⟩ an l-extension of a configuration X if ∗ Y =X Rk,l and we denote the class of all l-extensions by Extl (X ). Recall that for a full configuration Y ∈ Prob ⟨Λl ⟩, we record the entropies of {1,...,l} ∖{∅} all its probability spaces in a vector in R2 that we denote by Ent∗ (Y) ∶= ( Ent(YI ))I∈2{1,...,l} ∖{∅} The entries in this vector are all nonnegative. To simplify notations we set El ∶= (R2 {1,...,l} ∖{∅} , ∣ ⋅ ∣1 ) and denote by E∗l its dual vector-space. As in the introduction, we introduce the unstabilized relative entropic set Γ○l (X ) ∶= {Ent∗ (Y) ∣ Y ∈ Extl (X )} By the additivity property of the entropy with respect to tensor powers, there is the inclusion (7.1) Γ○l (X ⊗m ) + Γ○l (X ⊗n ) ⊂ Γ○l (X ⊗(m+n) ) where the sum on the left hand side is the Minkowski sum. This allows us to define the limit 1 1 lim Γ○l (X ⊗n ) ∶= ⋃ Γ○l (X ⊗n ) n→∞ n n∈N n and we define the stabilized relative entropic set by 1 Γl (X ) ∶= Closure ( lim Γ○l (X ⊗n )) n→∞ n 44 7. Extensions which is a closed convex subset of El by property (7.1). For a vector c ∈ E∗l , we define the Information-Optimization problem IOc (X ) ∶= inf Y∈Extl (X ) ⟨ c , Ent∗ (Y) ⟩ = inf Y∈Extl (X ) ∑ cI ⋅ Ent(YI ) I⊂{1,...,l} where cI ’s are the coordinates of the vector c with respect to the basis in E∗l dual to the standard basis in El . Note that, equation (7.1) implies that the sequence n ↦ IOc (X ⊗n ) is subadditive. Hence, the limit 1 lim IOc (X ⊗n ) n→∞ n always exists (but may be equal to −∞). If for all n ∈ N, 1 IOc (X ⊗n ) = IOc (X ) n we call the optimization problem associated to c stable. In general, we define the stabilized optimization problem 1 IOsc (X ) ∶= lim IOc (Xn⊗n ). n→∞ n As the stabilized relative entropic set is convex, it is the intersection of half-spaces that are defined by linear inequalities on entropies Γk (X ) = ⋂ {x ∈ El ∣ ⟨c, x⟩ ≥ IOsc (X )} c∈E∗l In other words, the stabilized information optimization problems, that occur so often in practice, identify supporting hyper-planes of the convex set. The solution of all such linear problems determine the shape of the relative entropic set and vice versa. 7.2. The entropic set and the entropic cone. The definitions of relative entropic sets are motivated by the more classical notion of the entropic cone, which we will briefly discuss now. For l ∈ N, the entropic set is defined as Γ○l ∶= {Ent∗ (Y) ∣ Y ∈ Prob ⟨Λl ⟩ , Y is minimal} Its closure is usually referred to as the entropic cone Γl ∶= Closure(Γ○l ) Indeed, the entropic cone Γl is a closed, convex cone in R2 −1 [Yeu12]. For l ≤ 3, the entropic cone Γl is polyhedral and completely described by Shannon inequalities. However, for l ≥ 4, the situation is much more complicated. It is known that Γl is not polyhedral for l ≥ 4 [Mat07]. The shape of the entropic cone is not known as of the time of writing this article. It is an important open problem in information theory to find tight bounds on the entropic cone for l ≥ 4. We hope that the techniques developed in this article will eventually lend itself to finding a useful characterization. l 45 7. Extensions In fact, the entropic cone can be considered as the relative entropic set of / ∈ Prob ⟨∅⟩, that corresponds to the empty diagram an empty configuration O category ∅ = Λ0 / Γl = Γl (O) For a diagram category G let us denote by {●} = {●} the constant GΛ configuration of one-point spaces. Given an l-extension Y ∈ Prob ⟨Λl ⟩ of {●} k the restriction to the last l − k terminal spaces induces a linear isomorphism G (7.2) Γl ({●} k ) ≅ Γl−k Λ 7.3. Extension lemma. The Lipschitz continuity of relative entropic sets will follow from the following important proposition, which we will refer to as the Extension Lemma. Proposition 7.1. ↓ (Extension Lemma) Let k, l ∈ N, k ≤ l and let X , X ′ ∈ Prob ⟨Λk ⟩ be minimal full configurations. For every Y ∈ Extl X there exists a Y ′ ∈ Extl X ′ such that k(Y ′ , Y) ≤ 2l−k k(X ′ , X ) ⊠ The key behind the proof of the Extension Lemma, is that there is a full configuration Z that extends both Y and the optimal coupling between X and X ′ . The configuration Y ′ can be chosen to be the restriction of Z to the full configuration generated by X ′ and the terminal spaces in Y which are not in X . The estimate directly follows from Shannon inequalities. We present details at page 69. It follows immediately from the Extension Lemma and the Lipschitz property of the entropy function Ent∗ that asymptotically equivalent configurations have the same solutions to all Information-Optimization problems and, consequently, they have the same stabilized relative entropic set. In fact, we have a much stronger statement. Both the unstabilized and stabilized relative entropic sets have a Lipschitz dependence on the configuration, if the distance between sets is measured by the Hausdorff distance. Let us endow the collection of subsets of El with the Hausdorff metric with respect to the `1 -distance. For two subsets S1 , S2 of El , define the Hausdorff distance between them by dH (S1 , S2 ) = inf {ε > 0 ∣ S1 ⊂ S2 + Bε and S2 ⊂ S1 + Bε } where Bε is the `1 -ball of size ε around the origin in El . In fact, at this point the Hausdorff distance is only an extended pseudometric, in the sense, that it may take infinite values and it may vanish on pairs of non-identical points. Suppose now that we are given two minimal full configurations X , X ′ ∈ Prob ⟨Λk ⟩, and suppose a point y ∈ El lies in the unstabilized relative entropic set of X , that is y ∈ Γ○l (X ) 46 8. Mixtures This means that there is an extension Y ∈ Extl (X ) such that Ent∗ (Y) = y By the Extension Lemma, there exists a configuration Y ′ ∈ Extl (X ′ ) such that k(Y, Y ′ ) ≤ 2l−k k(X , X ′ ) and by the 1-Lipschitz property of the entropy function the point y ′ ∶= Ent∗ (Y ′ ) is close to the point y, that is ∣y − y ′ ∣1 = ∣ Ent∗ (Y) − Ent∗ (Y ′ )∣1 ≤ 2l−k k(X , X ′ ) We have thus obtained the following corollary to the Extension Lemma. Corollary 7.2. Let k ∈ N and X , X ′ ∈ Prob ⟨Λk ⟩. Then the Hausdorff distance between their unstabilized relative entropic sets satisfies the following Lipschitz estimate dH (Γ○l (X ), Γ○l (X ′ )) ≤ 2l−k k(X , X ′ ) ⊠ Note that in particular, the distance between unstabilized relative entropic sets is always finite and dH (Γ○l (X ), Γ○l ({●} k )) ≤ 2l−k k(X , {●} k ) = 2l−k ∣ Ent∗ (X )∣1 . Λ Λ Let us denote by Kk,l the metric space of closed convex sets K in El such that dH (K, Γl ({●} k )) < ∞ Λ endowed with the Hausdorff distance. Theorem 7.3. ↓ Let k ∈ N and X , X ′ ∈ Prob ⟨Λk ⟩. Then for all l ∈ N, the Hausdorff distance between their stabilized relative entropic sets satisfies the Lipschitz estimate dH (Γl (X ), Γl (X ′ )) ≤ 2l−k κ(X , X ′ ) In other words, the map Γl from minimal full configurations in Prob ⟨Λk ⟩ to Kk,l is 2l−k -Lipschitz. ⊠ Finally, as a primer to Section 9, note that for any set K ∈ Kk,l the sequence n↦ 1 K n converges in the Hausdorff distance to Γl ({●} k ). The set K ⊂ El can be viewed as a metric space itself, by just restricting the `1 -metric to it. The above convergence can then be expressed by saying that the asymptotic cone Λ of K equals Γl ({●} k ) and is isomorphic to Γl−k . Λ 47 8. Mixtures 8. Mixtures Mixtures provide some technical tools, which we will use in Section 9. The input data for the mixture operation is a family of G-configurations, parametrized by a probability space. As result one obtains another G-configuration with the pre-specified conditionals. One particular instance of a mixture G is when one mixes two configurations X and {●} , the latter being a constant G-configuration of one-point probability spaces. This operation will be used as a substitute for taking radicals “X ⊗(1/n) ” in Section 9 below. 8.1. Definition and elementary properties. Let G be a complete diagram category and Θ be a probability space. Let {Xθ }θ∈Θ be a family of G-configurations parametrized by Θ. The mixture of the family {Xθ } is the reduction Mix {Xθ } = (Y Ð→ ΘG ) such that Y∣ θ ≅ Xθ (8.1) The mixture exists and is uniquely defined by property (8.1) up to an isomorphism which is identity on ΘG . We denote the top configuration of the mixture Y = ⊕ Xθ θ∈Θ and also call it the mixture of the family {Xθ }. When Θ = Λα = ( {◻, ∎} ; p(∎) = α) is a binary space we write simply X∎ ⊕Λα X◻ for the mixture. The configuration subindexed by the ∎ will always be the first summand. The entropy of the mixture can be evaluated by the following formula Ent∗ (⊕ Xθ ) = ∫ Ent∗ (Xθ ) d p(θ) + Ent∗ (ΘG ) θ∈Θ Θ Mixtures satisfy the distributive law with respect to the tensor product Mix ({Xθ }θ∈Θ ) ⊗ Mix ({Yθ′ }θ′ ∈Θ′ ) ≅ Mix ({Xθ ⊗ Yθ′ }(θ,θ′ )∈Θ⊗Θ′ ) (⊕ Xθ ) ⊗ ( ⊕ Yθ′ ) ≅ θ∈Θ θ′ ∈Θ′ ⊕ (θ,θ ′ )∈Θ⊗Θ′ (Xθ ⊗ Yθ′ ) 48 9. Tropical probability 8.2. The distance estimates. Recall that for a diagram category G we deG note by {●} = {●} the constant G-configuration of one-point spaces. G The mixture of a G-configuration with {●} may serve as an ersatz of taking radicals of the configuration. The following lemma provides a justification of this by some distance estimates related to mixtures and will be used in Section 9. Lemma 8.1. ↓ Let G be a complete diagram category and X , Y ∈ Prob ⟨G⟩. Then (i) κ(X , X ⊗n ⊕Λ1/n {●}) ≤ Ent(Λ1/n ) (ii) κ (X , (X ⊕Λ1/n {●})⊗n ) ≤ n ⋅ Ent(Λ1/n ) (iii) κ ((X ⊗ Y) ⊕Λ1/n {●} , (X ⊕Λ1/n {●}) ⊗ (Y ⊕Λ1/n {●})) ≤ 3 Ent(Λ1/n ) 1 (iv) κ ((X ⊕Λ1/n {●}), (Y ⊕Λ1/n {●})) ≤ κ(X , Y) n ⊠ The proof can be found on page 71. Note, that the distance estimates in the lemma above are with respect to the asymptotic Kolmogorov distance. This is essential, since from the perspective of the intrinsic Kolmogorov distance mixtures are very badly behaved. 9. Tropical probability spaces and their configurations In this section we introduce the notion of tropical probability spaces and their configurations. Configurations of tropical probability spaces are points in the asymptotic cone of the space Prob ⟨G⟩, that is they are “limits” of certain divergent sequences of “normal” configurations. We will first give the construction of an asymptotic cone in an abstract context. Next, we will apply the construction to the particular case of configurations of probability spaces. For some background on asymptotic cones, see for instance [BBI01]. 9.1. Asymptotic cones of metric spaces. The asymptotic cone captures large-scale geometry of a metric space. Abstractly, the asymptotic cone of a pointed metric space is the pointed Gromov-Hausdorff limit of the sequence of spaces obtained from the given one by scaling down the metric. Of course, convergence is in general by no means assured. Sometimes a weaker type of convergence (using ultrafilters) is considered. Since, in our case, the asymptotic cone can be evaluated relatively explicitly we do not give the definition of Gromov-Hausdorff convergence or convergence with respect to an ultrafilter here, but instead give a construction. We would like to understand asymptotic cones of the space of configurations of probability spaces, considered as a metric space with the pseudo-metric k or κ. For a fixed complete diagram category G the space Prob ⟨G⟩ is a monoid with operation ⊗. It has the additional property that shifts are non-expanding maps. This simplifies the construction and analysis of its asymptotic cone. In fact, as we will see later the metric κ is already asymptotic relative to k. The 49 9. Tropical probability application of the asymptotic cone construction to the metric κ allows us to obtain a complete metric space with a simple description of points in it. Note that even though the monoid (Prob ⟨G⟩ , ⊗) is not Abelian it has the property that for any X1 , X2 ∈ Prob ⟨G⟩ one has k(X1 ⊗ X2 , X2 ⊗ X1 ) = 0 Thus, from a metric perspective it is as good as being Abelian. 9.1.1. Metrics versus pseudo-metrics. A pseudo-metric δ on a set X is a bivariate function satisfying all the axioms of a distance function except it is nonnegative definite rather than positive definite. That is, the pseudo-distance function is allowed to vanish on pairs of non-identical points. A set equipped with a pseudo-metric will be called a pseudo-metric space. An isometry of such spaces is a distance-preserving map, such that for any point in the target space there is a point in the image, which is distance zero from it. Given such an pseudo-metric space (X, δ) one could always construct an isometric metric space (X/δ=0 , δ) by identifying all pairs of points that are distance zero apart. Any property formulated in terms of the pseudo-metric holds simultaneously for a pseudo-metric space and its metric quotient. It will be convenient for us to construct pseudo-metrics on spaces instead of passing to the quotient spaces. 9.1.2. Asymptotic cone of a metric Abelian monoid. Let (Γ, ⊗, δ) be a monoid with a pseudo-metric δ, which satisfies the following properties (i) The shifts ⋅ ⊗ γ ′ ∶ Γ → Γ, γ ↦ γ ⊗ γ ′ are non-expanding for any γ ′ ∈ Γ (ii) For any γ, γ ′ ∈ Γ holds δ(γ ⊗ γ ′ , γ ′ ⊗ γ) = 0 We will call a monoid with pseudo-metric that satisfies these conditions a metric Abelian monoid. It follows from the shift-invariance property that for any γ1 , γ2 , γ3 ∈ Γ holds (9.1) δ(γ1 ⊗ γ3 , γ2 ⊗ γ3 ) ≤ δ(γ1 , γ2 ) and for any quadruple γ1 , γ2 , γ3 , γ4 ∈ Γ holds (9.2) δ(γ1 ⊗ γ2 , γ3 ⊗ γ4 ) ≤ δ(γ1 , γ3 ) + δ(γ2 , γ4 ) and, in particular, the monoid operation is 1-Lipschitz with respect to each argument. As a direct consequence, for every n ∈ N, and γ1 , γ2 ∈ Γ also holds (9.3) δ(γ1⊗n , γ2⊗n ) ≤ n δ(γ1 , γ2 ) For a sequence γ = {γ(i)} ∈ ΓN0 define its defect with respect to the distance function δ by Defectδ (γ) = sup δ (γ(i + j), γ(i) ⊗ γ(j)) i,j∈N0 50 9. Tropical probability The sequence γ will be called δ-linear if Defectδ (γ) = 0, and δ-quasi-linear if Defectδ (γ) < ∞. Denote by Lδ (Γ) and QLδ (Γ) the sets of all linear and, respectively, quasi-linear sequences in Γ with respect to the distance δ. For two elements γ 1 , γ 2 ∈ QLd (Γ), define an asymptotic distance between them by 1 δ̂(γ 1 , γ 2 ) ∶= lim δ (γ1 (n), γ2 (n)) n→∞ n Lemma 9.1. ↓ For a pair γ 1 , γ 2 ∈ QLδ (Γ) the limit 1 δ (γ1 (n), γ2 (n)) n→∞ n lim ⊠ exists and is finite. We provide the proof in Section T on page 72. The bivariate function δ̂ is a pseudo-distance on the set QLδ (Γ). We call two sequences γ 1 , γ 2 ∈ QLδ (Γ) asymptotically equivalent if δ̂(γ 1 , γ 2 ) = 0 and write δ̂ γ1 = γ2 We will call a sequence γ weakly quasi-linear, if it is asymptotically equivalent to a quasi-linear sequence. Note that the space of all weakly quasi-linear sequences can also be endowed with the asymptotic distance and it is isometric to the space of quasi-linear sequences. As we will see later all the natural operations we consider are δ̂-Lipschitz and therefore coincide for the asymptotically equivalent sequences. Thus given a weakly quasi-linear sequence we could always replace it by an equivalent quasi-linear sequence without any visible effect. Thus, we take the liberty to omit the adverb “weakly”. Whenever we say quasi-linear sequence, we mean a weakly quasi-linear sequence, that is silently replaced by an asymptotically equivalent genuine quasi-linear sequence, if necessary. The validity of the following constructions is very easy to verify, so we omit the proofs. The set QLδ (Γ) admits an action of the multiplicative semigroup (R≥0 , ⋅ ) defined in the following way. Let λ ∈ R≥0 and γ = {γ(n)} ∈ QLδ (Γ). Then define the action of λ on γ by (9.4) γ λ ∶= {γ(⌊λ ⋅ n⌋)}n∈N0 This is only an action up to asymptotic equivalence. Similarly, in the constructions that follow we are tacitly assuming they are valid up to asymptotic equivalence. The action ⋅ ∶ R≥0 × (QLδ (Γ), δ̂) → (QLδ (Γ), δ̂) is continuous with respect to δ̂ and, moreover it is a homothety (dilation), that is δ̂(γ λ1 , γ λ2 ) = λ ⋅ δ̂(γ 1 , γ 2 ) 51 9. Tropical probability The group operation ⊗ on Γ induces a δ̂-continuous (in fact, 1-Lipschitz) group operation on QLδ (Γ) by multiplying sequences element-wise. The semigroup structure on QLδ (Γ) is distributive with respect to the R≥0 -action (γ 1 ⊗ γ 2 )λ = γ λ1 ⊗ γ λ2 γ λ1 +λ2 = γ λ1 ⊗ γ λ2 δ̂ In particular for n ∈ N γ n = γ ⊗n δ̂ The path ⊗ γ λ2 [0, 1] ∋ λ ↦ γ 1−λ 1 will be called a convex interpolation and is a constant-speed δ̂-geodesic between γ 1 and γ 2 , that is for λ ∈ [0, 1], (1−λ) ⊗ γ λ2 , γ 1 ) = λ δ̂(γ 1 , γ 2 ) (1−λ) ⊗ γ λ2 , γ 2 ) = (1 − λ) δ̂(γ 1 , γ 2 ) δ̂(γ 1 δ̂(γ 1 9.1.3. Conditions for completeness. We would like to call (∞) Γδ ∶= (QLδ (Γ), ⊗, ⋅, δ̂) the asymptotic cone of (Γ, ⊗, δ). However it is not clear in general, whether (∞) Γδ is a complete space. We can simply consider the metric completion, and call it the asymptotic cone of (Γ, ⊗, δ). We feel, however, that it adds just another level of obscurity (∞) as to what the points of Γδ are. Under some circumstances, however, the completeness of the space of quasilinear sequences comes for free. This is the subject of the proposition below. Suppose the metric Abelian monoid (Γ, ⊗, δ) has an additional property: There exists a constant C > 0, such that for any quasi-linear sequence γ ∈ QLδ (Γ), there exists an asymptotically equivalent quasi-linear sequence γ ′ with defect bounded by C. If this is the case, we say that the metric monoid (Γ, ⊗, δ) has the (C-)uniformly bounded defect property. Proposition 9.2. ↓ Suppose (Γ, ⊗, δ) is a metric Abelian monoid such that (i) the distance function δ is homogeneous, that is for any γ1 , γ2 ∈ Γ and n ∈ N0 δ(γ1⊗n , γ2⊗n ) = n ⋅ δ(γ1 , γ2 ) (ii) (Γ, ⊗, δ) has the uniformly bounded defect property. Then the space (QLδ (Γ), δ̂) is complete. The proof of the proposition can be found on page 72. ⊠ 52 9. Tropical probability 9.1.4. On the density of linear sequences. In Section 6 we have shown that Bernoulli sequences of configurations can be approximated by sequences of homogeneous configurations. The proposition below will allow us to extend this statement to a wider class of sequences. It gives a sufficient condition under which the linear sequences are dense in the quasi-linear sequences. Proposition 9.3. ↓ Suppose (Γ, ⊗, δ) has the ε-uniformly bounded defect property for every ε > 0. Then Lδ (Γ) is dense in QLδ (Γ) ⊠ See page 74 for the proof. 9.1.5. Asymptotic metric on original semigroup. Starting with an element γ ∈ → Γ one can construct a linear sequence γ = {γ ⊗i }i∈N0 . In view of inequality (9.3), this map is a contraction (9.5) (Γ, δ ) → ( Lδ (Γ), δ̂ ) By the inclusions in (9.5) we have an induced metric δ̂ on Γ, satisfying for any γ1 , γ2 ∈ Γ (9.6) δ̂(γ1 , γ2 ) ≤ δ(γ1 , γ2 ) and the following scale-invariance condition is gained (9.7) δ̂(γ1⊗n , γ2⊗n ) = n ⋅ δ̂(γ1 , γ2 ) for all n ∈ N0 . Note moreover that if δ was scale-invariant to begin with, then δ̂ coincides with δ on Γ. 9.1.6. Iteration of construction. We may now iterate the constructions above, that is, we may apply them to (Γ, δ̂) instead of (Γ, δ). One may wonder what is the purpose. However, we have already observed that δ̂ satisfies the scaleinvariance condition (9.7), which is one of the conditions going into a proof of completeness in Proposition 9.2. Moreover, when we will later apply the theory in this section to the particular case of Γ = Prob ⟨G⟩, we will see that (Γ, δ̂) = (Prob ⟨G⟩ , κ) and we will show that the latter space has the ε-uniformly bounded defect property for every ε > 0. By virtue of the bound δ̂ ≤ δ, sequences that are quasi-linear with respect to δ̂, are also quasi-linear with respect to δ. Since δ̂ is scale-invariant, the ˆ associated asymptotic distance δ̂ coincides with δ̂ on Γ. We will show (in ˆ Lemma 9.4 below) that δ̂ also corresponds to δ̂ on δ-quasi-linear sequences. In order to organize all these statements, and to be more precise, let us include the spaces in the following commutative diagram. 53 9. Tropical probability ( Lδ (Γ), δ̂) f (9.8) (Γ, δ̂) 1 ( QLδ (Γ), δ̂) ı1 ı2 ϕ ˆ ( Lδ̂ (Γ), δ̂) 2 ˆ ( QLδ̂ (Γ), δ̂) The maps f, ϕ and ı1 are isometries. The maps 1 and 2 are isometric embeddings. The next lemmas show that ı2 is also an isometric embedding, and it has dense image. Lemma 9.4. ↓ The natural inclusion ˆ ı2 ∶ (QLδ (Γ), δ̂) ↪ (QLδ̂ (Γ), δ̂) is an isometric embedding. ⊠ Lemma 9.5. ↓ The image of the isometric embedding ˆ ı2 ∶ (QLδ (Γ), δ̂) ↪ (QLδ̂ (Γ), δ̂) ˆ is dense in (QLδ̂ (Γ), δ̂) ⊠ The proofs of the two lemmas above are to be found on page 75. 9.2. Tropical probability spaces and configurations. Now we apply the above construction to the space of complete configurations with fixed combinatorial type G. Fix a complete diagram category G and consider the space Prob ⟨G⟩ of configurations modeled on G. It carries the following structures: (i) A pseudo-metric k or κ. (ii) A 1-Lipschitz tensor product ⊗. (iii) A 1-Lipschitz entropy function Ent∗ ∶ Prob ⟨G⟩ → R[[G]] . The tensor product of configurations is commutative from a metric perspective. Recall that in Corollary 4.5 the subadditivity of both k and κ was established, namely for any X , Y, U, V ∈ Prob ⟨G⟩ holds k(X ⊗ U, Y ⊗ V) ≤ k(X , Y) + k(U, V). and κ(X ⊗ U, Y ⊗ V) ≤ κ(X , Y) + κ(U, V). The space (Prob ⟨G⟩ , ⊗, k) is a metric Abelian monoid. Note also that k̂ = κ on Prob ⟨G⟩, along the lines of Section 9.1.5. However, the metric k is not scale-invariant. Moreover, it is unclear whether the metric semigroup (Prob ⟨G⟩ , ⊗, k) has the uniformly bounded defect property. This is why we iterate the construction, as announced in Section 9.1.6, and consider the space of κ-quasi-linear sequences instead. 54 9. Tropical probability Lemma 9.6. ↓ For a complete diagram category, and for every ε > 0, the space (Prob ⟨G⟩ , ⊗, κ) has the ε-uniformly bounded defect property, that is for any κ-quasi-linear sequence X ∈ QLκ (Prob ⟨G⟩) there exists an asymptotically equivalent sequence Y with defect not exceeding ε. ⊠ By applying the general setup in the previous section to the metric semigroups (Prob ⟨G⟩ , ⊗, k) and (Prob ⟨G⟩ , ⊗, κ) and as a corollary to Lemma 9.6 we obtain the following theorem. Theorem 9.7. Consider the commutative diagram (9.9) ( Lk (Prob ⟨G⟩), k̂) f (Prob ⟨G⟩ , κ) 1 ( QLk (Prob ⟨G⟩), k̂) ı1 ϕ ı2 ( Lκ (Prob ⟨G⟩), κ̂) 2 ( QLκ (Prob ⟨G⟩), κ̂) Then the following statements hold: (i) The maps f, ϕ, ı1 are isometries. (ii) The maps ı2 , 1 , 2 are isometric embeddings and each map has a dense image in the corresponding target space. (iii) The space in the lower-right corner, ( QLκ (Prob ⟨G⟩), κ̂), is complete. ⊠ We may finally define the space of tropical G-configurations, as the space in the lower-right corner of the diagram (∞) Prob ⟨G⟩ ∶= ( QLκ (Prob ⟨G⟩), ⊗, ⋅, κ̂) By the Theorem 9.7 above, this space is complete. The entropy function Ent∗ ∶ Prob ⟨G⟩ → R[[G]] extends to a linear functional (∞) Ent∗ ∶ Prob ⟨G⟩ → (R[[G]] , ∣ ⋅ ∣1 ) of norm one, defined by 1 Ent∗ (X (n)) n→∞ n Ent∗ (X ) = lim 9.2.1. Sequences of homogeneous configurations are dense. Let L̃k (Prob ⟨G⟩h ) stand for the weakly linear sequences of homogeneous configurations, that is those sequences, that are asymptotically equivalent to a linear sequence (not necessarily of homogeneous spaces). For a sequence of homogeneous spaces H ∈ L̃k (Prob ⟨G⟩h ) define aep(H) to be a k-linear sequence asymptotically equivalent to H. 55 9. Tropical probability Now we can extend the commutative diagram (9.9) as follows L̃k (Prob ⟨G⟩h ) (9.10) (Prob ⟨G⟩ , κ) aep f Lk (Prob ⟨G⟩) 1 QLk (Prob ⟨G⟩) ı2 ı1 ϕ Lκ (Prob ⟨G⟩) 2 (∞) Prob ⟨G⟩ By the Asymptotic Equipartition Property for configurations, Theorem 6.1, the map aep is an isometry, hence we have the following theorem. Theorem 9.8. The map (∞) 2 ○ ı1 ○ aep ∶ L̃k (Prob ⟨G⟩h ) → Prob ⟨G⟩ ⊠ is an isometric embedding with dense image. (∞) (∞) Let Prob ⟨G⟩h ⊂ Prob ⟨G⟩ denote the space of weakly quasi-linear (∞) sequences of configurations H ∈ Prob ⟨G⟩ , such that for every n ∈ N0 , the (∞) configuration H(n) is homogeneous. We will refer to Prob ⟨G⟩h as the space of homogeneous tropical configurations. Denote by aep the embedding (∞) aep ∶ Prob ⟨G⟩h (∞) ↪ Prob ⟨G⟩ Theorem 9.9. (Asymptotic Equipartition Theorem for tropical configurations) Let G be a complete diagram category. Then the map (∞) aep ∶ Prob ⟨G⟩h (∞) ↪ Prob ⟨G⟩ ⊠ is an isometry. (∞) Proof: We need to show that for every tropical configuration X ∈ Prob ⟨G⟩ , (∞) there exists a homogeneous tropical configuration H ∈ Prob ⟨G⟩h such that κ̂(H, X ) = 0 By Lemma 9.6 and Proposition 9.3, for every j ∈ N there exists a sequence Y j ∈ Lκ (Prob ⟨G⟩) ≅ Lk (Prob ⟨G⟩) such that κ̂(Y j , X ) ≤ 1 j By the Asymptotic Equipartition Property for configurations, Theorem 6.1, there are sequences of homogeneous configurations Hj such that κ̂(Y j , Hj ) = 0 Define i(j) such that for all k ≥ i(j) 1 1 κ(Yj (k), Hj (k)) ≤ k j 56 9. Tropical probability and moreover 1 2 κ(Yj (k), X (k)) ≤ k j The function i can be chosen monotonically increasing. For every i ∈ N0 there is a unique j(i) ∈ N0 such that i(j(i)) ≤ i < i(j(i) + 1) Define then H(k) = Hj(k) (k) It follows that for k > i(1), 3 1 κ(H(k), X (k)) ≤ k j(k) Since j is a non-decreasing, divergent sequence, the theorem follows. ⊠ Thus we have shown that all arrows in diagram (9.10) are isometric embeddings with dense images. We would like to conjecture, that, in fact, they are all isometries. In any case, the difference between metrics κ̂ and κ is so small (κ is defined on the dense subset of the domain of definition of κ̂ and they coincide whenever both are defined), that we will not write the hat anymore (∞) and just use notation κ for the metric on Prob ⟨G⟩ . 9.3. Tropical probability spaces and tropical chains. In this section we (∞) evaluate the spaces Prob(∞) and Prob ⟨Cn ⟩ , where Cn is a chain, which is the diagram category introduced in 2.1.2 on page 14. Recall that a finite probability space U is homogeneous if Aut(U ) acts transitively on the support of the measure. The property of being homogeneous is invariant under isomorphism and every homogeneous space is isomorphic to a probability space with the uniform distribution. Homogeneous chains also have a very simple description. A chain of reductions is homogeneous, if and only if all the individual spaces are homogeneous. This simple description allows us to evaluate explicitly the Kolmogorov distance on the spaces of weakly linear sequences of homogeneous chains and consequently the space of tropical chains. Theorem 9.10. (i) Prob(∞) ≅ (R≥0 , ∣ ⋅ − ⋅ ∣, +, ⋅) (∞) (ii) Prob ⟨Cn ⟩ ⎧ ⎫ RRRRRR x ⎪ ⎪ ⎪ ⎪ RR ⎪⎛ 1 ⎞ ⎪ n RRRR ≅ ⎨⎜ ⋮ ⎟ ∈ R RRRRRR 0 ≤ xn ≤ ⋯ ≤ x1 ⎬ ⎪ ⎪ RRRRRR ⎪ ⎝ xn ⎠ ⎪ ⎪ ⎪ ⎩ ⎭ RR where the right-hand side is a cone in (Rn , ∣ ⋅ ∣1 ). ⊠ 57 9. Tropical probability To prove the Theorem 9.10 we evaluate first the isometry class of the space of weakly linear sequences of homogeneous spaces (or chains). We will only present an argument for single spaces, since the argument for chains is very similar. Lemma 9.11. L̃k (Probh ) ≅ (R≥0 , ∣ ⋅ − ⋅ ∣, +, ⋅) ⊠ Note that the right-hand side is a complete metric space, thus the Asymptotic Equipartition Theorem for tropical configurations, Theorem 9.8, together with Lemma 9.11, imply Theorem 9.10. To prove Lemma 9.11 we need to evaluate the Kolmogorov distance between two homogeneous spaces, or chains of homogeneous spaces. This is the subject of the next lemma, from which Lemma 9.11 follows immediately. Lemma 9.12. ↓ Denote by Un a finite uniform probability space of cardinality n, then (i) n k(Un , Um ) ≤ 2 ln 2 + ∣ln ∣ m (ii) κ(Un , Um ) = ∣ Ent(Un ) − Ent(Um )∣ ⊠ 9.4. Stochastic processes. Often, stochastic processes naturally give rise to κ-quasi-linear sequences. We include this last subsection as an indication that our statements, together with the construction of the tropical cone, have a much larger reach than sequences of independent random variables. We will be brief, and come back to the topic in a subsequent article. For a minimal diamond configuration C A B D we define the conditional mutual information between A and B given D by I(A; B ∣ D) ∶= Ent(A) + Ent(B) − Ent(C) − Ent(D) Shannon’s inequality (1.2) says that the conditional mutual information is always non-negative. Any minimal two-fan A ← C → B can be completed to a diamond with the one-point probability space {●} as the terminal vertex, and the mutual information between A and B is defined as I(A; B) = I(A; B ∣ {●}) = Ent(A) + Ent(B) − Ent(C) 58 T. Technical proofs Let . . . , X−1 , X0 , X1 , . . . be a stationary stochastic process with finite state space X. Thus, for any I = {k, k + 1, . . . , l} ⊂ Z we have jointly distributed random variables Xk , . . . , Xl , that generate a full configuration XI = ⟨Xk , . . . , Xl ⟩ = {XJ }J⊂I as explained in Section 2.1.4. This collection of full configurations is consistent in the sense that for k ≤ k ′ ≤ l′ ≤ l there are canonical isomorphisms XI ′ ≅ RI∗′ ,I XI where I ∶= {k, . . . , l}, I ′ ∶= {k ′ , . . . , l′ } and RI∗′ ,I is the restriction operator introduced in Section 2.4.1. The property of being stationary means that there are canonical isomorphisms for any finite subset I ⊂ Z and l ∈ Z ≅ XI Ð→ XI+l For I = {k, k + 1, . . . , l} we call the initial space XI of the configuration XI the space of trajectories of the process over I and denote it Xkl . Note that by stationarity, for every m ∈ Z, k ∈ N and l ∈ N0 , 0 m+k−1 m+k+l−1 ; X1l ) ) = I(X−k+1 I(Xm ; Xm+k Moreover the right-hand side is an increasing function of both k and l. We make the following important observation. The defect of the sequence n ↦ X1n is equal to Defectκ ({X1n }) = sup κ (X1m+n , X1m ⊗ X1n ) m,n∈N0 = sup ∣Ent(X1m ⊗ X1n ) − Ent(X1m+n )∣ m,n∈N0 0 ⊗ X1n ) − Ent(X1m+n )∣ = sup ∣Ent(X−m+1 m,n∈N0 0 = sup I(X−m+1 , X1n ) m,n∈N0 Therefore, the sequence n ↦ X1n is κ-quasi-linear if and only if (9.11) 0 lim I(X−k+1 , X1l ) < ∞ k,l→∞ Once condition (9.11) is satisfied for a stochastic process, it defines a tropical probability space X ∈ Prob. Note that condition (9.11) is satisfied for any stationary, finite-state Markov chains. T. Technical proofs This section contains some proofs that did not make it into the main text. 59 T. Technical proofs T.2. Statements from the section “Configurations”. Lemma 2.1. ↑ Let G be a diagram category. Then (i) A two-fan F = (X ← Z → Y) of G-configurations is minimal, if and only if the constituent two-fans of probability spaces Fi = (Xi ← Zi → Yi ) are all minimal. (ii) For any two-fan F = (X ← Z → Y) of G-configurations its minimal reduction exists, that is, there exists a minimal two-fan F ′ = (X ← Z ′ → Y) included in the following diagram Z Z′ X Y ⊠ Proof: We will need the following lemma Lemma T.1. Suppose we are given two two-fans of probability spaces β α F = (X ←Ð Z Ð→ Y ) β ′′ α′′ F ′′ = (X ′′ ←Ð Z ′′ Ð→ Y ′′ ) such that F ′′ is minimal. Let β′ α′ µ F Ð→ F ′=(X ←ÐZ ′ Ð→Y ) be a minimal reduction of F. Then for any reduction ρ ∶ F → F ′′ , there exists a reduction ρ′ ∶ F ′ → F ′′ such that ρ = ρ′ ○ µ ⊠ Proof: We define ρ′ on the terminal spaces of F ′ to coincide with ρ. To prove the lemma we just need to provide a dashed arrow that makes the following diagram commutative Z µ α α′ ρ β ρ′ Z′ Z ′′ β′ X α′′ Y ρ=ρ′ X ′′ β ′′ Y ′′ ρ=ρ′ The reduction ρ′ is constructed by simple diagram chasing and by using the minimality of F ′′ . Suppose z ′ ∈ Z ′ and z1 , z2 ∈ Z are such that z ′ = µ(z1 ) = µ(z2 ). By commutativity of the solid arrows in the diagram above, we have α′′ ○ ρ(z1 ) = ρ ○ α′ ○ µ(z1 ) = ρ ○ α′ ○ µ(z2 ) = α′′ ○ ρ(z2 ) 60 T. Technical proofs Similarly β ′′ ○ ρ(z1 ) = β ′′ ○ ρ(z2 ) Thus by minimality of F ′′ it follows that ρ(z1 ) = ρ(z2 ). Hence, ρ′ can be constructed by setting ρ′ (z ′ ) = ρ(z1 ). ⊠ Now we proceed to prove claim (i) of Lemma 2.1. Let G = {Oi ; mij } be a diagram category, X , Y, Z ∈ Prob ⟨G⟩ be three G-configurations and F = (X ← Z → Y) be a two-fan. Recall that it can also be considered as a Gconfiguration of two-fans F = {Fi ; fij } Any minimizing reduction F =(X ←Z →Y) Ð→ F ′ =(X ←Z ′ →Y) induces reductions Fi =(Xi ←Zi →Yi ) Ð→ Fi =(Xi ←Zi′ →Yi ) for all i in the index set I. It follows that if all Fi ’s are minimal, then so is F. Now we prove the implication in the other direction. Suppose F is minimal. We have to show that all Fi are minimal as well. Suppose there exist a nonminimal fan among Fi ’s. For an index i ∈ I let ˇ ∶= {j ∈ I ∣ HomG (Oj , Oi ) ≠ ∅} J(i) ˆ ∶= {j ∈ I ∣ HomG (Oi , Oj ) ≠ ∅} J(i) Choose an index i0 such that (i) Fi0 is not minimal ˆ 0 )/{i0 } the two-fan Fj is minimal. (ii) for any j ∈ J(i Consider now the minimal reduction µ ∶ Fi0 → Fi′0 and construct a two-fan G = {Gi ; gij } of G-configurations by setting Gi ∶= { and where fi′0 j Fi′ Fi if i = i0 otherwise ⎧ ˇ 0) ⎪ µ ○ fij if j = i0 and i ∈ J(i ⎪ ⎪ ⎪ ′ ˆ 0) gij ∶= ⎨fij if i = i0 and j ∈ J(i ⎪ ⎪ ⎪ ⎪ otherwise ⎩fij is the reduction provided by the Lemma T.1 applied to the diagram F i0 fi 0 j µ Fi′0 fi′ 0j Fj We thus constructed a non-trivial reduction F → G which is identity on the terminal G-configurations X and Y. This contradicts the minimality of F. 61 T. Technical proofs To address the second assertion of the Lemma 2.1 observe that the argument above gives an algorithm for the construction of a minimal reduction of any two-fan of G-configurations. ⊠ T.4. Statements from the section “Kolmogorov distance”. Proposition 4.1. ↑ Let G be a complete diagram category. Then the bivariate function k ∶ Prob ⟨G⟩ × Prob ⟨G⟩ → R is a pseudo-distance on Prob ⟨G⟩. Moreover, two configurations X , Y ∈ Prob ⟨G⟩ satisfy k(X , Y) = 0 if and only if X is isomorphic to Y in Prob ⟨G⟩. ⊠ Proof: The symmetry of k is immediate. The non-negativity of k follows from the fact that entropy of the target space of a reduction is not greater then the entropy of the domain, which is a particular instance of the Shannon inequality (1.2). We proceed to prove the triangle inequality. We will make use of the following lemma Lemma T.2. For a minimal full configuration of probability spaces ⎛ ⎜ ⎜ ⎜ ⟨X, Y, Z⟩ = ⎜ XY ⎜ ⎜ ⎜ ⎝ X XY Z XZ Y ⎞ ⎟ ⎟ ⎟ YZ ⎟ ⎟ ⎟ ⎟ Z ⎠ holds kd(X ← XZ → Z) ≤ kd(X ← XY → Y ) + kd(Y ← Y Z → Z) ⊠ Proof: By Shannon inequality (1.2) on page 13 we have Ent(X∣ Z) ≤ Ent(XY ∣ Z) ≤ Ent(X∣ Y ) + Ent(Y ∣ Z) Similarly, Ent(Z∣ X) ≤ Ent(Z∣ Y ) + Ent(Y ∣ X) and therefore kd(X ← XZ → Z) ≤ kd(X ← XY → Y ) + kd(Y ← Y Z → Z) ⊠ Now we continue with the proof of Proposition 4.1. Let G be an arbitrary complete reduction category. Suppose X = {Xi ; fij }, Y = {Yi ; gij } and Z = {Zi ; hij } are G-configurations, with initial spaces being X0 , Y0 and Z0 , respectively. Let F̂ = (X ← F → Y) Ĝ = (Y ← G → Z) 62 T. Technical proofs be two optimal minimal two-fans satisfying k(X , Y) = kd(F̂) k(Y, Z) = kd(Ĝ) Recall that each two-fan of G-configurations is a G-configuration of two-fans between the individual spaces, that is F = {Fi = (Xi ← Fi → Yi )} G = {Gi = (Yi ← Gi → Zi )} We construct a coupling H between X and Z in the following manner. Starting with the two-tents configuration between the initial spaces, we use adhesion to extend it to a full configuration, thus constructing a coupling between X0 and Z0 . This full configuration could then be “pushed down” and provides full extensions of two-tents on all lower levels. Thus we could “compose” couplings F and G and use a Shannon inequality to establish the triangle inequality for the Kolmogorov distance. Details are as follows. Consider a two-tents configuration X0 ← F0 → Y0 ← G0 → Z0 and extend it by adhesion, as described in Section 2.5 to a Λ3 -configuration A0 F0 H0 G0 X0 Y0 Z0 Together with the reductions (X0 )G → X (Y0 )G → Y (Z0 )G → Z it gives rise to a Λ3 -configuration of G-configurations (A0 )G (T.1) (F0 )G (H0 )G (G0 )G X Y Z Note that the minimal reductions of the two-fan subconfigurations of (T.1) X ← (F0 )G → Y Y ← (G0 )G → Z are the two-fans F̂ and Ĝ, respectively, by Lemma 2.1. 63 T. Technical proofs Now consider the “minimization” of the above configuration A (T.2) F H G X Y Z It could also be viewed as a G-configuration of Λ3 configurations, Ai Fi Hi Gi Xi Yi Zi each of which is minimal by Corollary 2.2. Now we can apply Lemma T.2 to each level to conclude that k(X , Z) ≤ kd(X ← H → Z) ≤ kd(X ← F → Y) + kd(X ← G → Y) = k(X , Y) + k(Y, Z) Finally, if k(X , Y) = 0, then there is a two-fan F of G-configurations between X and Y with kd(F) = 0, from which it follows that X and Y are isomorphic.⊠ Proposition 4.3. ↑ Let G be a complete diagram category. Then with respect to the Kolmogorov distance on Prob ⟨G⟩ the tensor product ⊗ ∶ (Prob ⟨G⟩ , k)2 → (Prob ⟨G⟩ , k) is 1-Lipschitz in each variable, that is, for every triple X , Y, Y ′ ∈ Prob ⟨G⟩ the following bound holds k(X ⊗ Y, X ⊗ Y ′ ) ≤ k(Y, Y ′ ) ⊠ Proof: The claim follows easily from the additivity of entropy in equation (1.3). Suppose that X = {Xi ; fij }, Y = {Yi ; gij } and Y ′ = {Yi′ ; gij′ } are three G-configurations and F = (Y ← Z → Y ′ ) is an optimal fan, so that k(Y, Y ′ ) = ∑ [2 Ent(Zi ) − Ent(Yi ) − Ent(Yi′ )] i Consider the fan G = (X ⊗ Y ← X ⊗ Z → X ⊗ Y ′ ) 64 T. Technical proofs Then, by additivity of entropy, in equation (1.3), we have kd(F) = ∑ [2 Ent(Xi ⊗ Zi ) − Ent(Xi ⊗ Yi ) − Ent(Xi ⊗ Yi′ )] i = ∑ [2 Ent(Zi ) − Ent(Yi ) − Ent(Yi′ )] i = kd(G) and, therefore, k(X ⊗ Y, X ⊗ Y ′ ) ≤ kd(G) = kd(F) = k(Y, Y ′ ) Thus, the tensor product of probability spaces is 1-Lipschitz with respect to each argument. ⊠ Proposition 4.7. ↑ Suppose G is a complete diagram category and δ = k, κ is either Kolmogorov distance or asymptotic Kolmogorov distance on Prob ⟨G⟩. Then the entropy function Ent∗ ∶ (Prob ⟨G⟩ , δ) → (R[[G]] , ∣ ⋅ ∣1 ), X = {Xi , fij } ↦ (EntXi )i ∈ R[[G]] ⊠ is 1-Lipschitz. Proof: Let X , Y ∈ Prob ⟨G⟩ and let G = (X ← Z → Y) be an optimal fan with components Gi = (Xi ← Zi → Yi ) For a fixed index i we can estimate the difference of entropies Ent(Xi ) − Ent(Yi ) = 2( Ent(Xi ) − Ent(Zi )) + kd(Gi ) ≤ kd(Gi ) By symmetry we then have ∣ Ent(Xi ) − Ent(Yi )∣ ≤ kd(Gi ) Adding above inequalities for all i we have ∣ Ent∗ (X ) − Ent∗ (Y)∣1 ≤ kd(G) = k(X , Y) By the additivity of entropy we also obtain the 1-Lipschitz property of the entropy function with respect to the asymptotic Kolmogorov distance κ. ⊠ Proposition 4.8. ↑ Suppose R ∶ G′ → G is a functor between two complete diagram categories and δ stands for either Kolmogorov or asymptotic Kolmogorov distance. Then the restriction operator R∗ ∶ (Prob ⟨G⟩ , δ) → (Prob ⟨G′ ⟩ , δ), is Lipschitz. X ↦X ○R ⊠ 65 T. Technical proofs Proof: The claim follows from the functoriality of the restriction operator. We argue as follows. Suppose that R ∶ G′ → G is a functor and R∗ is the corresponding restriction operator. For X1 , X2 ∈ Prob ⟨G⟩ let F = (X1 ← Y → X2 ) be an optimal fan. Then F ′ ∶= (R∗ X1 ← R∗ Y → R∗ X2 ) is a fan with the terminal vertices being the restrictions of X1 and X2 . It can be considered as a G′ -configuration of two-fans over individual spaces in R∗ X1 and R∗ X2 each of which also appears as a fan in F. Thus, we obtain the rough estimate k(R∗ X1 , R∗ X2 ) ≤ [[G′ ]] ⋅ k(X1 , X2 ) Since the restriction operator commutes with tensor powers, the same estimate also holds for the asymptotic Kolmogorov distance κ. ⊠ Proposition 4.9. ↑ (Slicing Lemma) Suppose G is a complete diagram category and we are given X , Xˆ , Y, Ŷ ∈ Prob ⟨G⟩ – four G-configurations and U, V, W ∈ Prob – probability spaces, that are included into the following threetents configuration Xˆ X Ŷ W U V Y such that the two-fan (U ← W → V ) is minimal. Then the following estimate holds k(X , Y) ≤ ∫ k(X ∣ u, Y∣ v) d pW (u, v) W + [[G]] ⋅ kd(U ← W → V ) + ∑ [ Ent(U ∣ Xi ) + Ent(V ∣ Yi )] i ⊠ Proof: Since the two-fan (U ← W → V ) is minimal the probability space W could be considered having underlying set to be a subset of the Cartesian product of the underlying sets of U and V . For any pair (u, v) ∈ W with a positive weight consider an optimal two-fan (T.3) πX πY Guv = (X ∣ u ←Ð Zuv Ð→ Y∣ v) where Zuv = {Zuv,i ; ρij }. Let puv,i be the probability distributions on Zuv,i – the individual spaces in the configuration Zuv . The next step is to take a convex combination of distributions puv,i weighted by pW to construct a coupling X ← Z → Y. 66 T. Technical proofs First we extend the 7-vertex configuration to a full Λ4 -configuration of Gconfigurations, such that the top vertex has the distribution pi (x, y, u, v) ∶= puv,i (x, y)pW (u, v) (T.4) as described in the Section 2.1.4. If we integrate over y, we obtain ∑ pi (x, u, v, y) = ((πX ,i )∗ puv,i )(x)pW (u, v) y Then we use that by (T.3) it holds that (πX ,i )∗ puv,i = pXi ( ⋅ ∣ u) and therefore ∑ pi (x, y, u, v) = pXi (x∣ u)pW (u, v). y In the same way, ∑ pi (x, y, u, v) = pYi (y∣ v)pW (u, v). x Note that this exactly corresponds to adhesion, as described in Section 2.5. It follows that X ∣ uv = X ∣ u and Y∣ uv = Y∣ v (T.5) and (T.6) Ent(Xi ∣ U V ) = Ent(Xi ∣ U ) and Ent(Yi ∣ U V ) = Ent(Yi ∣ V ) The extended configuration contains a two-fan of configurations F = (X ← Z → Y) with terminal vertices X and Y. We call its initial vertex Z = {XYi , fij }. The following estimates conclude the proof the the Slicing Lemma. First we use the definitions of intrinsic Kolmogorov distance k and of kd(F) to estimate k(X , Y) ≤ kd(F) = ∑ kd(Fi ) i = ∑ [2 Ent(XYi ) − Ent(Xi ) − Ent(Yi )] i Next, we apply the definition of the conditional entropy to rewrite the righthand side k(X , Y) ≤ ∑ [2 Ent(XYi ∣ U V ) + 2 Ent(U V ) − 2 Ent(U V ∣ XYi ) i − Ent(Xi ∣ U ) − Ent(U ) + Ent(U ∣ Xi ) − Ent(Yi ∣ V ) − Ent(V ) + Ent(V ∣ Yi )] We now use (T.6) and rearrange terms to obtain k(X , Y) ≤ ∑ [2 Ent(XYi ∣ U V ) − Ent(Xi ∣ U V ) − Ent(Yi ∣ U V ) i + 2 Ent(U V ) − Ent(U ) − Ent(V ) − 2 Ent(U V ∣ XYi ) + Ent(U ∣ Xi ) + Ent(V ∣ Yi )] 67 T. Technical proofs By the integral formula for conditional entropy (1.4) applied to the first three terms we get ∑ [2 Ent(XYi ∣ U V ) − Ent(Xi ∣ U V ) − Ent(Yi ∣ U V )] i =∫ UV k(X ∣ uv, Y∣ uv) d pW (u, v) However, because of (T.5) this simplifies to ∫U V k(X ∣ uv, Y∣ uv) d pW (u, v) = ∫U V k(X ∣ u, Y∣ v) d pW (u, v) Therefore, k(X , Y) ≤ ∫ UV k(X ∣ u, Y∣ v) d pW (u, v) + [[G]] ⋅ kd(U ← W → V ) + ∑ [ Ent(U ∣ Xi ) + Ent(V ∣ Yi )] i ⊠ Proposition 4.11. ↑ Let S = {Si , fij } ∈ Set ⟨G⟩ be a configuration of sets modeled on a complete diagram category G with the initial set S0 . Let p, q ∈ ∆S be two probability distributions. Denote X ∶= (S, p), Y ∶= (S, q) and α = 1 2 ∣p0 − q0 ∣1 . Then k(X , Y) ≤ 2 ⋅ [[G]] ⋅ (α ⋅ ln ∣S0 ∣ + Ent(Λα )) ⊠ Proof: We will need the following obvious rough estimate of the Kolmogorov distance that holds for any p, q ∈ ∆S: (T.7) 2 ⋅ k(X , Y) ≤ 2[[G]] ⋅ ln ∣S0 ∣ It can be obtained by taking a tensor product for the coupling between X and Y. Our goal now is to write p and q as the convex combination of three other distributions p̂, p+ and q + as in p = (1 − α) ⋅ p̂ + α ⋅ p+ q = (1 − α) ⋅ p̂ + α ⋅ q + with the smallest possible α ∈ [0, 1]. We could do it the following way. Let α ∶= 21 ∣p0 − q0 ∣. If α = 1 then the proposition follows from the rough estimate (T.7), so from now on we assume that α < 1. Define three probability distributions p̂0 , p+0 and q0+ on S0 by setting 68 T. Technical proofs for every x ∈ S0 1 min {p0 (x), q0 (x)} 1−α 1 p+0 ∶= (p0 − (1 − α)p̂0 ) α 1 q0+ ∶= (q0 − (1 − α)p̂0 ) α Denote by p̂, p+ , q + ∈ ∆S the distributions corresponding to p̂0 , p+0 , q0+ ∈ ∆S0 under isomorphism (3.5). Thus we have p̂0 (x) ∶= p = (1 − α)p̂ + α ⋅ p+ q = (1 − α)p̂ + α ⋅ q + Now we construct a “two-tents” configuration of G-configurations (T.8) X ← X˜ → Λα ← Ỹ → Y by setting X̃i ∶= (Si × Λα ; p̃i (s, ◻) = (1 − α)p̂i (s), p̃i (s, ∎) = α ⋅ p+i (s)) Ỹi ∶= (Si × Λα ; q̃i (s, ◻) = (1 − α)p̂i (s), q̃i (s, ∎) = α ⋅ qi+ (s)) and X˜ ∶= {X̃i ; fij × Id} Ỹ ∶= {Ỹi ; fij × Id} The reductions in the “two-tents” sub-configurations of (T.8) are given by coordinate projections. Note that the following isomorphisms hold X ∣ ◻ ≅ (S, p̂) X ∣ ∎ ≅ (S, p+ ) Y∣ ◻ ≅ (S, p̂) ≅ X ∣ ◻ Y∣ ∎ ≅ (S, q + ) Now we apply part (i) of Corollary 4.10 to obtain the desired inequality k(X , Y) ≤ (1 − α) k(X ∣ ◻, Y∣ ◻) + α ⋅ k(X ∣ ∎, Y∣ ∎) + ∑ [ Ent(Λα ∣ Xi ) + Ent(Λα ∣ Yi )] i ≤ 2 ⋅ [[G]] ⋅ (α ⋅ ln ∣S0 ∣ + Ent(Λα )) ⊠ 69 T. Technical proofs T.7. Statements from the section “Extensions”. Proposition 7.1. ↑ (Extension Lemma) Let k, l ∈ N, k ≤ l and let X , X ′ ∈ Prob ⟨Λk ⟩ be minimal full configurations. For every Y ∈ Extl X there exists a Y ′ ∈ Extl X ′ such that k(Y ′ , Y) ≤ 2l−k k(X ′ , X ) ⊠ Proof: Denote by X0 , X0′ the initial spaces in the configurations X , X ′ , respectively. Let Y0 be the initial space of the full sub-configuration of Y generated by Yk+1 , . . . , Yl . Let K0 be the initial space in the optimal coupling between X and X ′ F = (X ′ ← K → X ) Recall that X0 could be considered as the Cartesian product of the underlying sets of spaces generating X with some distribution on it. A similar view holds for X0′ , Y0 and K0 . Thus we have in particular K 0 = X ′0 × X 0 Define a full minimal configuration Z ∈ Prob ⟨Λ2k+l ⟩ by providing a distribution on X ′0 × X 0 × Y 0 = K 0 × Y 0 as explained in the Section 2.1.4. The distribution will be defined by p(x′ , x, y) ∶= pF (x′ , x) ⋅ pY (x, y)/pX ′ (x) It is clear that Z contains both the coupling F and configuration Y as restrictions. It also contains the minimal full configuration Y ′ = ⟨X1′ , . . . , Xk′ , Yk+1 , . . . , Yl ⟩ and a coupling G between Y and Y ′ . For a pair of spaces A and B in Z we denote by AB the initial space of a minimal fan in Z with the terminal spaces A and B. The two-fan of Λk+l -configurations G can be considered as a Λk+l -configuration of two-fans GIJ ∶= (XI YJ ←Ð GIJ Ð→ XI′ YJ ) Using this notation we estimate for I ⊂ {1, . . . , k} and J ⊂ {k + 1, . . . , l} k(Y, Y ′ ) ≤ kd G = ∑ kd(GIJ ) I,J = ∑ [2 Ent(GIJ ) − Ent(XI YJ ) − Ent(XI′ YJ )] I,J ≤ ∑ [2 Ent(XI XI′ ) − Ent(XI ) − Ent(XI′ )+ I,J + (2 Ent(YJ ∣ XI XI′ ) − Ent(YJ ∣ XI ) − Ent(YJ ∣ XI′ ))] ≤ 2k−l ∑ kd(FI ) I ≤2 k−l kd(F) = 2k−l k(X , X ′ ) ⊠ 70 T. Technical proofs Theorem 7.3. ↑ Let k ∈ N and X , X ′ ∈ Prob ⟨Λk ⟩. Then for all l ∈ N, the Hausdorff distance between their stabilized relative entropic sets satisfies the Lipschitz estimate dH (Γl (X ), Γl (X ′ )) ≤ 2l−k κ(X , X ′ ) In other words, the map Γl from minimal full configurations in Prob ⟨Λk ⟩ to Kk,l is 2l−k -Lipschitz. ⊠ Proof: Note that by Corollary 7.2, or more directly by Proposition 7.1, for n∈N 1 1 dH (Γ○l ((X )⊗n ), Γ○l ((X ′ )⊗n )) ≤ 2l−k k ((X )⊗n , (X ′ )⊗n ) n n Hence, by the scaling properties of the Hausdorff distance 1 1 1 dH ( Γ○l ((X )⊗n ), Γ○l ((X ′ )⊗n )) ≤ 2l−k k ((X )⊗n , (X ′ )⊗n ) n n n For convenience, we introduce the notation 1 Kn = Closure ( Γ○l ((X )⊗n )) n 1 Kn′ = Closure ( Γ○l ((X ′ )⊗n )) n K = Γ○l (X ) K ′ = Γl (X ′ ) Recall that by definition, K = Closure ( ⋃ Kn ) n∈N K ′ = Closure ( ⋃ Kn′ ) n∈N Note that by the superadditivity property of the unstabilized relative en′ tropic sets (see inclusion (7.1)) the sequences n ↦ Kn! and n ↦ Kn! are monotonically increasing sequences of sets, and n ⋃ Ki ⊂ Kn! i=1 n ′ ⋃ Ki′ ⊂ Kn! i=1 Now select a large radius R > 0. Let BR (0) denote the ball of radius R {1,...,l} around the origin in R2 . By compactness and the definition of the stabilized relative entropic set dH (Kn! ∩ BR (0), K ∩ BR (0)) → 0 ′ dH (Kn! ∩ BR (0), K ′ ∩ BR (0)) → 0 as n → ∞. Therefore also dH (K ∩ BR (0), K ′ ∩ BR (0)) ≤ 2l−k κ (X , X ′ ) Because this inequality holds for every R > 0, the estimate in the lemma follows. ⊠ 71 T. Technical proofs T.8. Statements from the section “Mixtures”. Lemma 8.1. ↑ Let G be a complete diagram category and X , Y ∈ Prob ⟨G⟩. Then (i) κ(X , X ⊗n ⊕Λ1/n {●}) ≤ Ent(Λ1/n ) (ii) κ (X , (X ⊕Λ1/n {●})⊗n ) ≤ n ⋅ Ent(Λ1/n ) (iii) κ ((X ⊗ Y) ⊕Λ1/n {●} , (X ⊕Λ1/n {●}) ⊗ (Y ⊕Λ1/n {●})) ≤ 3 Ent(Λ1/n ) 1 (iv) κ ((X ⊕Λ1/n {●}), (Y ⊕Λ1/n {●})) ≤ κ(X , Y) n ⊠ Proof: Recall that for the empirical reduction q ∶ Λ⊗N 1/n → ∆Λ1/n the quantity N ⋅ q(λ)(∎) counts the number of black squares in the sequence λ. It is a binomially distributed random variable with the mean N /n and variance Nn (1 − n1 ). The first claim is then proven by the following calculation κ(X , X ⊗n ⊕Λ1/n {●}) 1 = lim k (X ⊗N , (X ⊗n ⊕Λ1/n {●})⊗N ) N →∞ N ⎞ 1 ⎛ ⊗N k ⎜X , ⊕ X ⊗n⋅N ⋅q(λ)(∎) ⎟ = lim N →∞ N ⎠ ⎝ λ∈Λ⊗N 1/n 1 k(X ⊗N , X ⊗(N ⋅n⋅q(λ)(∎)) ) d p(λ) ∫ ⊗n N →∞ N λ∈Λ 1/n n ⋅ ∫ ⊗N ∣N /n − N ⋅ q(λ)(∎)∣ d p(λ) ≤ Ent(Λ1/n ) + ∣ Ent∗ (X )∣1 ⋅ lim N →∞ N λ∈Λ1/n √ n 1 1 ≤ Ent(Λ1/n ) + ∣ Ent∗ (X )∣1 ⋅ lim ⋅ N ⋅ (1 − ) N →∞ N n n = Ent(Λ1/n ) ≤ Ent(Λ1/n ) + lim The second claim is proven similarly and the third follows from the second and the 1-Lipschitz property of the tensor product. Finally, the fourth follows from Corollary 4.10(iv), by slicing both arguments along Λ1/n . ⊠ T.9. Statements from the section “Tropical Probability”. Lemma T.3. Suppose the sequence {a(i)}i∈N0 of real numbers is bounded from below and is quasi-subadditive, that is there is a constant C ∈ R such that for any i, j ∈ N0 holds a(i + j) ≤ a(i) + a(j) + C Then the limit 1 lim a(i) i→∞ i 72 T. Technical proofs ⊠ exists and is finite. Proof: The lemma is standard and is sometimes refered to as Fekete’s subadditive lemma. We include a proof for the convenience of the reader. Assume first that C = 0. Then the sequence satisfies a(k ⋅ i) ≤ k ⋅ a(i) and in particular a(i) ≤ i ⋅ a(1). Let l ∶= lim inf 1i a(i) ∈ [0, ∞). Choose ε > 0. Then we can find k ∈ N such that k1 a(k) ≤ l + ε. For n ∈ N let q, r be the quotient and the reminder of the integer division of n by k, that is n = q ⋅ k + r, 0≤r<k Then 1 1 1 1 a(n) ≤ (q ⋅ a(k) + a(r)) ≤ (q ⋅ a(k)) + a(r) ≤ l + ε + ε = l + 2ε n n q⋅k+r n The last inequality holds once n is sufficiently large, specifically when 1 n ≥ max a(i) ε 0≤i≤k Therefore 1 lim a(i) = l i→∞ i Now if C > 0 then the sequence b(i) ∶= a(i) + C is subadditive and 1i b(i) converges by the previous argument. Thus we have 1 1 1 lim b(i) = lim (a(i) + C) = lim a(i) i→∞ i i→∞ i i→∞ i ⊠ Lemma 9.1. ↑ For a pair γ 1 , γ 2 ∈ QLδ (Γ) the limit 1 lim δ (γ1 (n), γ2 (n)) n→∞ n exists and is finite. ⊠ Proof: Suppose γ 1 and γ 2 are two quasi-linear sequences of elements of Γ, then for any i, j ∈ N0 δ (γ1 (i + j),γ2 (i + j)) ≤ δ (γ1 (i + j), γ1 (i) ⊗ γ1 (j)) + δ (γ2 (i + j), γ2 (i) ⊗ γ2 (j)) + δ (γ1 (i) ⊗ γ1 (j), γ2 (i) ⊗ γ2 (j)) ≤ Defectδ (γ 1 ) + Defectδ (γ 2 ) + δ (γ1 (i), γ2 (i)) + δ (γ1 (j), γ2 (j)) Thus the sequence δ(γ1 (i), γ2 (i)) is quasi-subadditive and by Lemma T.3 the limit 1 lim δ (γ1 (i), γ2 (i)) i→∞ i exists and is finite. ⊠ Proposition 9.2. ↑ Suppose (Γ, ⊗, δ) is a metric Abelian monoid such that 73 T. Technical proofs (i) the distance function δ is homogeneous, that is for any γ1 , γ2 ∈ Γ and n ∈ N0 δ(γ1⊗n , γ2⊗n ) = n ⋅ δ(γ1 , γ2 ) (ii) (Γ, ⊗, δ) has the uniformly bounded defect property. Then the space (QLδ (Γ), δ̂) is complete. ⊠ Proof: Given a Cauchy sequence {γ i } of elements in (QLδ (Γ), δ̂) we need to find a limiting element ϕ ∈ QLδ (Γ). We will do that by a version of the diagonal process, that is we define ϕ(n) to have value γi (n) for i sufficiently large depending on n. The quasi-linearity of ϕ would follow from the fact that for a fixed n and all sufficiently large i the set {γi (n)} is uniformly bounded. Now we give the detailed argument. First we replace each element of the sequence {γ i } by an asymptotically equivalent element with defect bounded by the constant C according to assumption (ii) of the lemma. We will still call the new sequence {γ i }. The Cauchy sequence {γ i } satisfies sup δ̂(γ i , γ j ) → 0 as i → ∞ i,j≥i By assumption (ii) of the lemma for any n, k ∈ N0 holds k ⋅ δ (γi (n), γj (n)) = δ (γi (n)⊗k , γj (n)⊗k ) ≤ δ (γi (kn), γj (kn)) + 2k ⋅ C Dividing by k we obtain δ(γi (n), γj (n)) ≤ 1 δ(γi (kn), γj (kn)) + 2C k Now we pass to the limit sending k to infinity, while keeping n fixed: δ(γi (n), γj (n)) ≤ n ⋅ δ̂(γ i , γ j ) + 2C Given n let i(n) be a number such that for any i, j ≥ i(n) holds δ̂(γ i , γ j ) ≤ 1 n We may assume that i(n) is nondecreasing as a function of n. Then for any i, j, n ∈ N with i, j ≥ i(n) we have the following bound (T.9) δ (γi (n), γj (n)) ≤ 2C + 1 Now we are ready to define the limiting sequence ϕ by setting ϕ(n) ∶= γi(n) (n) 74 T. Technical proofs First we verify that ϕ is quasi-linear δ(ϕ(n + m), ϕ(n) ⊗ ϕ(m)) = δ (γi(n+m) (n + m), γi(n) (n) ⊗ γi(m) (m)) ≤ δ (γi(n+m) (n + m), γi(n+m) (n) ⊗ γi(n+m) (m)) + δ (γi(n+m) (n) ⊗ γi(n+m) (m), γi(n) (n) ⊗ γi(m) (m)) ≤ C + δ (γi(n+m) (n), γi(n) (n)) + δ (γi(n+m) (m), γi(m) (m)) ≤ C + 2(2C + 1) = 5C + 2 =∶ C ′ The convergence of γ i to ϕ is shown as follows. For n, k ∈ N let q, r ∈ N0 be the quotient and the remainder of the division of n by k, that is n = q ⋅ k + r and 0 ≤ r < k. Fix k ∈ N and let i ≥ i(k), then 1 δ (γi (n), ϕ(n)) n→∞ n 1 = lim δ (γi (q ⋅ k + r), γi(n) (q ⋅ k + r)) n→∞ n 1 ≤ lim (q ⋅ δ (γi (k), γi(n) (k)) + δ (γi (r), γi(n) (r)) + 2qC ′ + 2C ′ ) n→∞ n 1 ≤ lim ((3q + 3) ⋅ C ′ ) n→∞ n 3C ′ = k δ̂(γ i , ϕ) = lim Since k ∈ N is arbitrary we have lim δ̂(γ i , ϕ) = 0 i→∞ ⊠ Proposition 9.3. ↑ Suppose (Γ, ⊗, δ) has the ε-uniformly bounded defect property for every ε > 0. Then Lδ (Γ) is dense in QLδ (Γ) ⊠ Proof: Let γ = {γ(n)} be a δ-quasi-linear sequence. We need to approximate it with linear sequences. For i ∈ N, let γ i be a sequence asymptotically equivalent to γ and satisfying Defectδ γ i ≤ 1/i as provided by the 1/i-uniformly bounded defect property. Define a δ-linear sequence η i by ηi (n) ∶= γi (1)⊗n T. Technical proofs 75 Then δ̂(γ, η i ) = δ̂(γ i , η i ) 1 = lim δ(γi (n), ηi (n)) n→∞ n 1 = lim δ(γi (n), γi (1)⊗n ) n→∞ n 1 ≤ lim ⋅ n ⋅ Defectδ (γ i ) n→∞ n 1 ≤ i Thus lim η i = γ. Lemma 9.4. ↑ The natural inclusion ⊠ ˆ ı2 ∶ (QLδ (Γ), δ̂) ↪ (QLδ̂ (Γ), δ̂) is an isometric embedding. ⊠ Proof: Let γ 1 , γ 2 ∈ QLδ (Γ) be two sequences of δ-quasi-linear sequences. We have to show that the two numbers 1 δ̂(γ 1 , γ 2 ) = lim δ (γ1 (n), γ2 (n)) n→∞ n and 1 ˆ δ̂(γ 1 , γ 2 ) = lim δ̂ (γ1 (n), γ2 (n)) n→∞ n are equal. Since shifts are non-expanding maps, we have δ̂ ≤ δ and it follows immediately that ˆ δ̂(γ 1 , γ 2 ) ≤ δ̂(γ 1 , γ 2 ) and we are left to show the opposite inequality. We will do it as follows. Fix n > 0, then 1 δ̂(γ 1 , γ 2 ) = lim δ (γ1 (kn), γ2 (kn)) k→∞ kn 1 ≤ lim ( δ (γ1 (n)⊗k , γ2 (n)⊗k ) + k ⋅ ( Defectδ (γ 1 ) + Defectδ (γ 2 ))) k→∞ kn 1 1 ≤ δ̂ (γ1 (n), γ2 (n)) + ( Defectδ (γ 1 ) + Defectδ (γ 2 )) n n Passing to the limit with respect to n gives required inequality ˆ δ̂(γ 1 , γ 2 ) ≤ δ̂(γ 1 , γ 2 ) Lemma 9.5. ↑ The image of the isometric embedding ˆ ı2 ∶ (QLδ (Γ), δ̂) ↪ (QLδ̂ (Γ), δ̂) ˆ is dense in (QLδ̂ (Γ), δ̂) ⊠ ⊠ 76 T. Technical proofs ˆ Proof: Given an element γ = {γ(n)} in QLδ̂ (Γ) we have to find a δ̂-approximating sequence γ i = {γi (n)} in QLδ (Γ). Define γi (n) ∶= γ(i)⊗⌊ i ⌋ n i→∞ ˆ We have to show that each γ i is δ-quasi-linear and that δ̂(γ i , γ) Ð→ 0. These follow from δ̂ (γi (m + n), γi (m) ⊗ γi (n)) = δ̂ (γ(i)⊗⌊ m+n ⌋ i , γ(i)⊗⌊ i ⌋ ⊗ γ(i)⊗⌊ i ⌋ ) m n ≤ δ̂ (γ(i), 1) and 1 ˆ δ̂(γ i , γ) = lim δ̂ (γi (n), γ(n)) n→∞ n 1 n = lim δ̂ (γ(i)⊗⌊ i ⌋ , γ(n)) n→∞ n 1 1 ≤ lim [ δ̂ (γ (i⌊ ni ⌋) , γ(n)) + ⌊ ni ⌋ Defectδ̂ (γ)] n→∞ n n i 1 1 ≤ lim [ max δ̂ (1, γ(k)) + Defectδ̂ (γ)] + Defectδ̂ (γ) n→∞ n k=0,...,i−1 n i 1 ≤ Defectδ̂ (γ) i It is worth noting, that the defect of γ i need not to be uniformly bounded with respect to i. ⊠ Lemma 9.6. ↑ For a complete diagram category, and for every ε > 0, the space (Prob ⟨G⟩ , ⊗, κ) has the ε-uniformly bounded defect property, that is for any κ-quasi-linear sequence X ∈ QLκ (Prob ⟨G⟩) there exists an asymptotically ⊠ equivalent sequence Y with defect not exceeding ε. Proof: Let X = {X (i)} be a quasi-linear sequence and let ε > 0. We will find an asymptotically equivalent sequence with defect less than ε. Define a new sequence Y = {Y(i)} by Y(i) ∶= [X (k ⋅ i)] ⊕Λ1/k {●} where the number k ∈ N will be chosen later. First we verify that the sequences X and Y are asymptotically equivalent, that is 1 κ̂(X , Y) ∶= lim κ (X (i), Y(i)) = 0 i→∞ i We estimate the asymptotic distance between individual members of sequences X and Y using Lemma 8.1 as follows κ(X (i), Y(i)) = κ (X (i), X (k ⋅ i) ⊕Λ1/k {●} ) ≤ κ (X (i), X (i)⊗k ⊕Λ1/k {●}) + κ (X (i)⊗k ⊕Λ1/k {●} , X (k ⋅ i) ⊕Λ1/k {●}) ≤ Ent(Λ1/k ) + Defectκ (X ) 77 T. Technical proofs Thus κ̂(X , Y) = 0 and the two sequences are asymptotically equivalent. Next we show that the sequence Y is κ-quasi-linear and evaluate its defect using Lemma 8.1. Let i, j ∈ N, then κ(Y(i + j), Y(i) ⊗ Y(j)) = κ (X (k ⋅ i + k ⋅ j) ⊕Λ1/k {●} , [X (k ⋅ i) ⊕Λ1/k {●} ] ⊗ [X (k ⋅ j) ⊕Λ1/k {●} ]) ≤ κ ([X (k ⋅ i)⊗X (k ⋅ j)] ⊕Λ1/k {●} , [X (k ⋅ i) ⊕Λ1/k {●} ] ⊗ [X (k ⋅ j) ⊕Λ1/k {●} ]) 1 Defect(X ) k 1 ≤ 3 Ent(Λ1/k ) + Defectκ (X ) k Thus, by choosing k to be a solution to the inequality 1 3 Ent(Λ1/k ) + Defectκ (X ) ≤ ε k we can make sure that Defectκ (Y) ≤ ε + ⊠ Lemma 9.12. ↑ Denote by Un a finite uniform probability space of cardinality n, then (i) n k(Un , Um ) ≤ 2 ln 2 + ∣ln ∣ m (ii) κ(Un , Um ) = ∣ Ent(Un ) − Ent(Um )∣ ⊠ f g Proof: Consider a two-fan Un ← Unm → Um . To construct specific reductions f and g we identify Unm , Un and Um with the cyclic groups of the corresponding order Unm ↔ Znm Un ↔ Zn Um ↔ Zm Consider the short exact sequences ×m mod m ×n mod n {0} Ð→ Zn Ð→ Znm Ð→ Zm Ð→ {0} {0} Ð→ Zm Ð→ Znm Ð→ Zn Ð→ {0} Choose for f the left splitting in the first exact sequence, and for g the left splitting in the second exact sequence. 78 10. Technical proofs f g Now that we constructed a two-fan Un ← Unm → Um , let Un ← Z → Um be its minimal reduction. Now we estimate ∣Z∣ ≤ n + m, which implies that k(Un , Um ) ≤ 2 Ent(Z) − Ent(Un ) − Ent(Um ) ≤ 2 ln(n + m) − ln n − ln m ≤ 2 ln 2 + 2 ln max {n, m} − ln n − ln m n = 2 ln 2 + ∣ln ∣ m To prove the second assertion note that entropy is a k-1-Lipschitz function. Therefore we have ∣ Ent(Un ) − Ent(Um )∣ ≤ k(Un , Um ) ≤ ∣ Ent(Un ) − Ent(Um )∣ + 2 ln 2 Substituting in the definition of asymptotic Kolmogorov distance we obtain the required equality. ⊠ References [ABD+ 08] Nihat Ay, Nils Bertschinger, Ralf Der, Frank Güttler, and Eckehard Olbrich. Predictive information and explorative behavior of autonomous robots. The European Physical Journal B, 63(3):329–339, 2008. [ABK+ 15] Samson Abramsky, Rui Soares Barbosa, Kohei Kishida, Raymond Lal, and Shane Mansfield. Contextuality, cohomology and paradox. arXiv preprint arXiv:1502.03097, 2015. [BBI01] Dmitri Burago, Yuri Burago, and Sergei Ivanov. A course in metric geometry, volume 33 of Graduate Studies in Mathematics. American Mathematical Society, Providence, RI, 2001. [BFL11] John C. Baez, Tobias Fritz, and Tom Leinster. A characterization of entropy in terms of information loss. Entropy, 13(11):1945–1957, 2011. [BRO+ 14] Nils Bertschinger, Johannes Rauh, Eckehard Olbrich, Jürgen Jost, and Nihat Ay. Quantifying unique information. Entropy, 16(4):2161–2183, 2014. [Csi98] Imre Csiszár. The method of types. IEEE Trans. Inform. Theory, 44(6):2505– 2523, 1998. Information theory: 1948–1998. [CT91] Thomas M. Cover and Joy A. Thomas. Elements of information theory. Wiley Series in Telecommunications. John Wiley & Sons, Inc., New York, 1991. A Wiley-Interscience Publication. [DFZ11] Randall Dougherty, Chris Freiling, and Kenneth Zeger. Non-shannon information inequalities in four random variables. arXiv preprint arXiv:1104.3602, 2011. [Fri09] Karl Friston. The free-energy principle: a rough guide to the brain? Trends in cognitive sciences, 13(7):293–301, 2009. [Gro12] Misha Gromov. In a search for a structure, part 1: On entropy. Preprint available at http://www.ihes.fr/gromov, 2012. [Mat07] Frantisek Matus. Infinitely many information inequalities. In Information Theory, 2007. ISIT 2007. IEEE International Symposium on, pages 41–44. IEEE, 2007. [SA15] Bastian Steudel and Nihat Ay. Information-theoretic inference of common ancestors. Entropy, 17(4):2304–2327, 2015. [Sin76] Ya. G. Sinai. Introduction to ergodic theory. Princeton University Press, Princeton, N.J., 1976. Translated by V. Scheffer, Mathematical Notes, 18. 10. Technical proofs [VDP13] [Yeu12] 79 Sander G Van Dijk and Daniel Polani. Informational constraints-driven organization in goal-directed behavior. Advances in Complex Systems, 16(02n03):1350016, 2013. Raymond W Yeung. A first course in information theory. Springer Science & Business Media, 2012.
7cs.IT
Under consideration for publication in Theory and Practice of Logic Programming 1 arXiv:1605.01352v1 [cs.PL] 4 May 2016 Default Rules for Curry∗ SERGIO ANTOY Computer Science Dept., Portland State University, Oregon, U.S.A. (e-mail: [email protected]) MICHAEL HANUS Institut für Informatik, CAU Kiel, D-24098 Kiel, Germany. (e-mail: [email protected]) submitted January 31, 2016; revised April 13, 2016; accepted May 2, 2016 Abstract In functional logic programs, rules are applicable independently of textual order, i.e., any rule can potentially be used to evaluate an expression. This is similar to logic languages and contrary to functional languages, e.g., Haskell enforces a strict sequential interpretation of rules. However, in some situations it is convenient to express alternatives by means of compact default rules. Although default rules are often used in functional programs, the non-deterministic nature of functional logic programs does not allow to directly transfer this concept from functional to functional logic languages in a meaningful way. In this paper we propose a new concept of default rules for Curry that supports a programming style similar to functional programming while preserving the core properties of functional logic programming, i.e., completeness, non-determinism, and logic-oriented use of functions. We discuss the basic concept and propose an implementation which exploits advanced features of functional logic languages. To appear in Theory and Practice of Logic Programming (TPLP) KEYWORDS: functional logic programming, semantics, program transformation 1 Motivation Functional logic languages combine the most important features of functional and logic programming in a single language (see (Antoy and Hanus 2010; Hanus 2013) for recent surveys). In particular, the functional logic language Curry (Hanus (ed.) 2016) conceptually extends Haskell with common features of logic programming, i.e., nondeterminism, free variables, and constraint solving. Moreover, the amalgamated features of Curry support new programming techniques, like deep pattern matching through the use of functional patterns, i.e., evaluable functions at pattern positions (Antoy and Hanus 2005). ∗ This is an extended version of a paper presented at the international symposium on Practical Aspects of Declarative Languages (PADL 2016), invited as a rapid communication in TPLP. The authors acknowledge the assistance of the conference program chairs Marco Gavanelli and John Reppy. 2 Sergio Antoy and Michael Hanus For example, suppose that we want to compute two elements x and y in a list l with the property that the distance between the two elements is n, i.e., in l there are n − 1 elements between x and y. We will use this condition in the n-queens program discussed later. Of course, there may be many pairs of elements in a list satisfying the given condition (“++” denotes the concatenation of lists): dist n (_++[x]++zs++[y]++_) | n == length zs + 1 = (x,y) Defining functions by case distinction through pattern matching is a very useful feature. Functional patterns make this feature even more convenient. However, in functional logic languages, this feature is slightly more delicate because of the possibility of functional patterns, which typically stand for an infinite number of standard patterns, and because there is no textual order among the rules defining an operation. The variables in a functional pattern are bound like the variables in ordinary patterns. As a simple example, consider an operation isSet intended to check whether a given list represents a set, i.e., does not contain duplicates. In Curry, we might think to implement it as follows: isSet (_++[x]++_++[x]++_) = False isSet _ = True The first rule uses a functional pattern: it returns False if the argument matches a list where two identical elements occur. The intent of the second rule is to return True if no identical elements occur in the argument. However, according to the semantics of Curry, which ensures completeness w.r.t. finding solutions or values, all rules are tried to evaluate an expression. Therefore, the second rule is always applicable to calls of isSet so that the expression isSet [1,1] will be evaluated to False and True. The unintended application of the second rule can be avoided by the additional requirement that this rule should be applied only if no other rule is applicable. We call such a rule a default rule and mark it by adding the suffix ’default to the function’s name (in order to avoid a syntactic extension of the base language). Thus, if we define isSet with the rules isSet (_++[x]++_++[x]++_) = False isSet ’default _ = True then isSet [1,1] evaluates only to False and isSet [0,1] only to True. In this paper we propose a concept for default rules for Curry, define its precise semantics, and discuss implementation options. In the next section, we review the main concepts of functional logic programming and Curry. Our intended concept of default rules is informally introduced in Sect. 3. Some examples showing the convenience of default rules for programming are presented in Sect. 4. In order to avoid the introduction of a new semantics specific to default rules, we define the precise meaning of default rules by transforming them into already known concepts in Sect. 5. Options to implement default rules efficiently are discussed and evaluated Default Rules for Curry 3 in Sect. 6. Some benchmarking of alternative implementations of default rules are shown in Sect. 7 before we relate our proposal to other work and conclude. 2 Functional Logic Programming and Curry Before presenting the concept and implementation of default rules in more detail, we briefly review those elements of functional logic languages and Curry that are necessary to understand the contents of this paper. More details can be found in recent surveys on functional logic programming (Antoy and Hanus 2010; Hanus 2013) and in the language report (Hanus (ed.) 2016). Curry is a declarative multi-paradigm language combining in a seamless way features from functional, logic, and concurrent programming (concurrency is irrelevant as our work goes, hence it is ignored in this paper). The syntax of Curry is close to Haskell (Peyton Jones 2003), i.e., type variables and names of defined operations usually start with lowercase letters and the names of type and data constructors start with an uppercase letter. α → β denotes the type of all functions mapping elements of type α into elements of type β (where β can also be a functional type, i.e., functional types are “curried”), and the application of an operation f to an argument e is denoted by juxtaposition (“f e”). In addition to Haskell, Curry allows free (logic) variables in conditions and right-hand sides of rules and expressions evaluated by an interpreter. Moreover, the patterns of a defining rule can be nonlinear, i.e., they might contain multiple occurrences of some variable, which is an abbreviation for equalities between these occurrences. Example 1 The following simple program shows the functional and logic features of Curry. It defines an operation “++” to concatenate two lists, which is identical to the Haskell encoding. The second operation, dup, returns some list element having at least two occurrences:1 (++) :: [a] → [a] → [a] [] ++ ys = ys (x:xs) ++ ys = x : (xs ++ ys) dup :: [a] → a dup xs | xs == _ ++ [x] ++ _ ++ [x] ++ _ = x where x free Operation applications can contain free variables. They are evaluated lazily where free variables as demanded arguments are non-deterministically instantiated. Hence, the condition of the rule defining dup is solved by instantiating x and the anonymous free variables “-”. This evaluation method corresponds to narrowing (Slagle 1974; Reddy 1985), but Curry narrows with possibly non-most-general unifiers to ensure the optimality of computations (Antoy et al. 2000). 1 Note that Curry requires the explicit declaration of free variables, as x in the rule of dup, to ensure checkable redundancy. 4 Sergio Antoy and Michael Hanus Note that dup is a non-deterministic operation since it might deliver more than one result for a given argument, e.g., the evaluation of dup [1,2,2,1] yields the values 1 and 2. Non-deterministic operations, which are interpreted as mappings from values into sets of values (González-Moreno et al. 1999), are an important feature of contemporary functional logic languages. Hence, there is also a predefined choice operation: x ? _ _ ? y = = x y Thus, the expression “0?1” evaluates to 0 and 1 with the value non-deterministically chosen. Some operations can be defined more easily and directly using functional patterns (Antoy and Hanus 2005). A functional pattern is a pattern occurring in an argument of the left-hand side of a rule containing defined operations (and not only data constructors and variables). Such a pattern abbreviates the set of all standard patterns to which the functional pattern can be evaluated (by narrowing). For instance, we can rewrite the definition of dup as dup (_++[x]++_++[x]++_) = x Functional patterns are a powerful feature to express arbitrary selections in tree structures, e.g., in XML documents (Hanus 2011). Details about their semantics and a constructive implementation of functional patterns by a demand-driven unification procedure can be found in (Antoy and Hanus 2005). Set functions (Antoy and Hanus 2009) allow the encapsulation of non-deterministic computations in a strategy-independent manner. For each defined operation f , fS denotes the corresponding set function. fS encapsulates the non-determinism caused by evaluating f except for the non-determinism caused by evaluating the arguments to which f is applied. For instance, consider the operation decOrInc defined by decOrInc x = (x-1) ? (x+1) Then “decOrIncS 3” evaluates to (an abstract representation of) the set {2, 4}, i.e., the non-determinism caused by decOrInc is encapsulated into a set. However, “decOrIncS (2 ? 5)” evaluates to two different sets {1, 3} and {4, 6} due to its nondeterministic argument, i.e., the non-determinism caused by the argument is not encapsulated. This property is desirable and essential to define and implement default rules by a transformational approach, as shown in Sect. 5. In the following section, we discuss default rules and their intended semantics. 3 Default Rules: Concept and Informal Semantics Default rules are often used in both functional and logic programming. In languages in which rules are applied in textual order, such as Haskell and Prolog, loosely speaking every rule is a default rule of all the preceding rules. For instance, the following standard Haskell function takes two lists and returns the list of corresponding pairs, where excess elements of a longer list are discarded: Default Rules for Curry 5 zip (x:xs) (y:ys) = (x,y) : zip xs ys zip _ _ = [] The second rule is applied only if the first rule is not applicable, i.e., if one of the argument lists is empty. We can avoid the consideration of rule orderings by replacing the second rule with rules for the patterns not matching the first rule: zip (x:xs) (y:ys) = (x,y) : zip xs ys zip (_:_) [] = [] zip [] _ = [] In general, this coding is cumbersome since the number of additional rules increases if the patterns of the first rule are more complex (e.g., we need three additional rules for the operation zip3 combining three lists). Moreover, this coding might be impossible in conjunction with some functional patterns, as in the first rule of isSet above. Some functional patterns conceptually denote an infinite set of standard patterns (e.g., [x,x], [x,-,x], [-,x,-,x], . . . ) and the complement of this set is infinite too. In Prolog, one often uses the “cut” operator to implement the behavior of default rules. For instance, zip can be defined as a Prolog predicate as follows: zip([X|Xs],[Y|Ys],[(X,Y)|Zs]) :- !, zip(Xs,Ys,Zs). zip(_,_,[]). Although this definition behaves as intended for instantiated lists, the completeness of logic programming is destroyed by the cut operator. For instance, the goal zip([],[],[]) is provable, but Prolog does not compute the answer {Xs=[],Ys=[], Zs=[]} for the goal zip(Xs,Ys,Zs) . These examples show that neither the functional style nor the logic style of default rules is suitable for functional logic programming. The functional style, based on textual order, curtails non-determinism. The logic style, based on the cut operator, destroys the completeness of some computations. Thus, a new concept of default rules is required for functional logic programming if we want to keep the strong properties of the base language, in particular, a simple-to-use non-determinism and the completeness of logic-oriented evaluations. Before presenting the exact definition of default rules, we introduce them informally and discuss their intended semantics. We intend to extend a “standard” operation definition by one default rule. Hence, an operation definition with a default rule has the following form (ok denotes a sequence of objects o1 . . . ok ):2 f tk1 | c1 = e1 . . . f tkn | cn = en f ’default tkn+1 | cn+1 = en+1 2 We consider only conditional rules since an unconditional rule can be regarded as a conditional rule with condition True. 6 Sergio Antoy and Michael Hanus We call the first n rules standard rules and the final rule the default rule of f . Informally, the default rule is applied only if no standard rule is applicable, where a rule is applicable if the pattern matches and the condition is satisfied. Hence, an expression e = f sk , where sk are expressions, is evaluated as follows: 1. The arguments sk are evaluated enough to determine whether a standard rule of f is applicable, i.e., whether there exists a standard rule whose left-hand side matches the evaluated e and the condition is satisfied (i.e., evaluable to True). 2. If a standard rule is applicable, it is applied; otherwise the default rule is applied. 3. If some argument is non-deterministic, the previous points apply independently for each non-deterministic choice of the combination of arguments. In particular, if an argument is a free variable, it is non-deterministically instantiated so that every potentially applicable rule can be used. As usual in a non-strict language like Curry, arguments of an operation application are evaluated as they are demanded by the operation’s pattern matching and condition. However, any non-determinism or failure during argument evaluation is not passed inside the condition evaluation. A precise definition of “inside” is in (Antoy and Hanus 2009, Def. 3). This behavior is quite similar to set functions to encapsulate internal non-determinism. Therefore, we will exploit set functions to implement default rules. Before discussing the advantages and implementation of default rules, we explain and motivate the intended semantics of our proposal. First, it should be noted that this concept distinguishes non-determinism outside and inside a rule application. This difference is irrelevant in purely functional programming but essential in functional logic programming. Example 2 Consider the operation zip defined with a default rule: zip (x:xs) (y:ys) = (x,y) : zip xs ys zip ’default _ _ = [] Since the standard rule is applicable to zip [1] [2], the default rule is ignored so that this expression is solely reduced to (1,2):zip [] []. Since the standard rule is not applicable to zip [] [], the default rule is applied and yields the value []. Altogether, the only value of zip [1] [2] is [(1,2)]. However, if some argument has more than one value, we use the evaluation principle above for each combination. Thus, the call zip ([1] ? []) [2] yields the two values [(1,2)] and []. These considerations are even more relevant if the evaluation of the condition might be non-deterministic, as the following example shows. Example 3 Consider an operation to look up values for keys in an association list: lookup key assoc | assoc == (_ ++ [(key ,val)] ++ _) = Just val Default Rules for Curry 7 where val free lookup ’default _ _ = Nothing Note that the condition of the standard rule can be evaluated in various ways. In particular, it can be evaluated (non-deterministically) to True and False for a fixed association list and key. Therefore, using if-then-else (or an otherwise branch as in Haskell) instead of the default rule might lead to unintended results. If we evaluate lookup 2 [(2,14),(3,17),(2,18)] , the condition of the standard rule is satisfiable so that the default rule is ignored. Since the condition has the two solutions {val 7→ 14} and {val 7→ 18}, we yield the values Just 14 and Just 18. If we evaluate lookup 2 [(3,17)], the condition of the standard rule is not satisfiable but the default rule is applicable so that we obtain the result Nothing. On the other hand, non-deterministic arguments might trigger different rules to be applied. Consider the expression lookup (2 ? 3) [(3,17)]. Since the non-determinism in the arguments leads to independent evaluations of the expressions lookup 2 [(3,17)] and lookup 3 [(3,17)], we obtain the results Nothing and Just 17. Similarly, free variables as arguments might lead to independent results since free variables are equivalent to non-deterministic values (Antoy and Hanus 2006). For instance, the expression lookup 2 xs yields the value Just v with the binding {xs 7→ (2,v): }, but also the value Nothing with the binding {xs 7→ []} (as well as many other solutions). The latter desirable property also has implications for the handling of failures occurring when arguments are evaluated. For instance, consider the expression lookup 2 failed (where failed is a predefined operation which always fails whenever it is evaluated). Because the evaluation of the condition of the standard rule demands the evaluation of failed and the subsequent failure comes from “outside” the condition, the entire expression evaluation fails instead of returning the value Nothing. This is motivated by the fact that we need the value of the association list in order to check the satisfiability of the condition and, thus, to decide the applicability of the standard rule, but this value is not available. Example 4 To see why our design decision is reasonable, consider the following contrived definition of an operation that checks whether its argument is the unit value () (which is the only value of the unit type): isUnit x | x == () = True isUnit ’default _ = False In our proposal, the evaluation of “isUnit failed” fails. In an alternative design (like Prolog’s if-then-else construct), one might skip any failure during condition checking and proceed with the next rule. In this case, we would return the value False for the expression isUnit failed. This is quite disturbing since the (deterministic!) operation isUnit, which has only one possible input value, could return two values: True for the call isUnit () and False for the call isUnit failed. Moreover, if we call this operation with a free variable, like isUnit x, we obtain the single binding {x 7→ ()} and value True (since free variables are never bound to failures). Thus, 8 Sergio Antoy and Michael Hanus either our semantics would be incomplete for logic computations or we compute too many values. In order to get a consistent behavior, we require that failures of arguments demanded for condition checking lead to failures of evaluations. 4 Examples To show the applicability and convenience of default rules for functional logic programming, we sketch a few more examples in this section. Example 5 Default rules are important in combination with functional patterns, since functional patterns denote an infinite set of standard patterns which often has no finite complement. Consider again the operation lookup as introduced in Example 3. With functional patterns and default rules, this operation can be conveniently defined: lookup key (_ ++ [(key ,val)] ++ _) = Just val lookup ’default _ _ = Nothing Example 6 Functional patterns are also useful to check the deep structure of arguments. In this case, default rules are useful to express in an easy manner that the check is not successful. For instance, consider an operation that checks whether a string contains a float number (without an exponent but with an optional minus sign). With functional patterns and default rules, the definition of this predicate is easy: isFloat (("-" ? "") ++ n1 ++ "." ++ n2) | (all isDigit n1 && all isDigit n2) = True isFloat ’default _ = False Example 7 In the classical n-queens puzzle, one must place n queens on a chess board so that no queen can attack another queen. This can be solved by computing some permutation of the list [1..n], where the i-th element denotes the row of the queen placed in column i, and check whether this permutation is a safe placement so that no queen can attack another in a diagonal. The latter property can easily be expressed with functional patterns and default rules where the non-default rule fails on a non-safe placement: safeDiag (_++[x]++zs++[y]++_) | abs (x-y) == length zs + 1 = failed safeDiag ’default xs = xs Hence, a solution can be obtained by computing a safe permutation: queens n = safeDiag (permute [1..n]) This example shows that default rules are a convenient way to express negation-asfailure from logic programming. Default Rules for Curry 9 Example 8 This programming pattern can also be applied to solve the map coloring problem. Our map consists of the states of the Pacific Northwest and a list of adjacent states: data State = WA | OR | ID | BC adjacent = [(WA,OR),(WA,ID),(WA,BC),(OR,ID),(ID,BC)] Furthermore, we define the available colors and an operation that associates (nondeterministically) some color to a state: data Color = Red | Green | Blue color x = (x, Red ? Green ? Blue) A map coloring can be computed by an operation solve that takes the information about potential colorings and adjacent states as arguments, i.e., we compute correct colorings by evaluating the initial expression solve (map color [WA,OR,ID,BC]) adjacent The operation solve fails on a coloring where two states have an identical color and are adjacent, otherwise it returns the coloring: solve (_++[(s1,c)]++_++[(s2,c)]++_) (_++[(s1,s2)]++_) = failed solve ’default cs _ = cs Note that the compact definition of the standard rule of solve exploits the ordering in the definition of adjacent. For arbitrarily ordered adjacency lists, we have to extend the standard rule as follows: solve (_++[(s1,c)]++_++[(s2,c)]++_) (_++[(s1,s2) ? (s2,s1)]++_) = failed 5 Transformational Semantics In order to define a precise semantics of default rules, one could extend an existing logic foundation of functional logic programming (e.g., (González-Moreno et al. 1999)) to include a meaning of default rules. This approach has been partially done in (López-Fraguas and Sánchez-Hernández 2004) but without considering the different sources of non-determinism (inside vs. outside) which is important for our intended semantics, as discussed in Sect. 3. Fortunately, the semantic aspects of these issues have already been discussed in the context of encapsulated search (Antoy and Hanus 2009; Christiansen et al. 2013) so that we can put our proposal on these foundations. Hence, we do not develop a new logic foundation of functional logic programming with default rules, but we provide a transformational semantics, i.e., we specify the meaning of default rules by a transformation into existing constructs of functional logic programming. We start the description of our transformational approach by explaining the translation of the default rule for zip. A default rule is applied only if no standard rule is applicable (because the rule’s pattern does not match the argument or the rule’s condition is not satisfiable). Hence, we translate a default rule into a regular 10 Sergio Antoy and Michael Hanus rule by adding the condition that no other rule is applicable. For this purpose, we generate from the original standard rules a set of “test applicability only” rules where the right-hand side is replaced by a constant (here: the unit value “()”). Thus, the single standard rule of zip produces the following new rule: zip ’TEST (x:xs) (y:ys) = () Now we have to add to the default rule the condition that zip’TEST is not applicable. Since we are interested in the failure of attempts to apply zip’TEST to the actual argument, we have to check that this application has no value. Furthermore, non-determinism and failures in the evaluation of actual arguments must be distinguished from similar outcomes caused by the evaluation of the condition. All these requirements call for the encapsulation of a search for values of zip’TEST where “inside” and “outside” non-determinism are distinguished and handled differently. Fortunately, set functions (Antoy and Hanus 2009) (as sketched in Sect. 2) provide an appropriate solution to this problem. Since set functions have a strategyindependent denotational semantics (Christiansen et al. 2013), we will use them to specify and implement default rules. Using set functions, one could translate the default rule into zip xs ys | isEmpty (zip ’TEST S xs ys) = [] Hence, this rule can be applied only if all attempts to apply the standard rule fail. To complete our example, we add this translated default rule as a further alternative to the standard rule so that we obtain the transformed program zip ’TEST (x:xs) (y:ys) = () zip (x:xs) (y:ys) = (x,y) : zip xs ys zip xs ys | isEmpty (zip ’TEST S xs ys) = [] Thanks to the logic features of Curry, one can also use this definition to generate appropriate argument values for zip. For instance, if we evaluate the equation zip xs ys == [] with the Curry implementation KiCS2 (Braßel et al. 2011), the search space is finite and computes, among others, the solution {xs=[]}. Unfortunately, this scheme does not yield the best code to ensure optimal computations. To understand the potential problem, consider the following operation: f 0 1 = 1 f _ 2 = 2 Intuitively, the best strategy to evaluate a call to f starts with a case distinction on the second argument, since its value determines which rule to apply. If the value is 1, and only in this case, the strategy checks the first argument, since its value determines whether to apply the first rule. A formal characterization of operations that allow this strategy (Antoy 1992) and a discussion of the strategy itself will be presented in Sect. 6.2. In this example, the pattern matching strategy is as follows: 1. Evaluate the second argument (to head normal form). 2. If its value is 2, apply the second rule. 3. If its value is 1, evaluate the first argument and try to apply the first rule. Default Rules for Curry 11 4. Otherwise, no rule is applicable. In particular, if loop denotes a non-terminating operation, the call f loop 2 evaluates to 2. This is in contrast to Haskell (Peyton Jones 2003) which performs pattern matching from left to right so that Haskell loops on this call. This strategy, which is optimal for the class of programs referred to as inductively sequential (Antoy 1992) for which it is intended, has been extended to functional logic computations (needed narrowing (Antoy et al. 2000)) and to overlapping rules (Antoy 1997) in order to cover general functional logic programs. Now consider the following default rule for f: f’default _ x = x If we apply our transformation scheme sketched above, we obtain the following Curry program: f’TEST 0 1 = () f’TEST _ 2 = () f 0 1 = 1 f _ 2 = 2 f x y | isEmpty (f’TEST S x y) = y As a result, the definition of f is no longer inductively sequential since the left-hand sides of the first and third rule overlap. Since there is no argument demanded by all rules of f, the rules could be applied independently. In fact, the Curry implementation KiCS2 (Braßel et al. 2011) loops on the call f loop 2 (since it tries to evaluate the first argument in order to apply the first rule), whereas it yields the result 2 without the default rule. To avoid this undesirable behavior when adding default rules, we could try to use the same strategy for the standard rules and the test in the default rule. This can be done by translating the original standard rules into an auxiliary operation and redefining the original operation into one that either applies the standard rules or the default rules. For our example, we transform the definition of f (with the default rule) into the following functions: f’TEST 0 1 = () f’TEST _ 2 = () f’INIT 0 1 = 1 f’INIT _ 2 = 2 f’DFLT x y | isEmpty (f’TEST S x y) = y f x y = f’INIT x y ? f’DFLT x y Now, both f’TEST and f’INIT are inductively sequential so that the optimal needed narrowing strategy can be applied, and f simply denotes a choice (without an argument evaluation) between two expressions that are evaluated optimally. Observe that at most one of these expressions is reducible. As a result, the Curry implementation KiCS2 evaluates f loop 2 to 2 and does not run into a loop. The overall transformation of default rules can be described by the following 12 Sergio Antoy and Michael Hanus scheme (its simplicity is advantageous to obtain a comprehensible definition of the semantics of default rules). The operation definition f tk1 | c1 = e1 . . . f tkn | cn = en f ’default tkn+1 | cn+1 = en+1 is transformed into (where f ’TEST, f ’INIT, f ’DFLT are new operation identifiers): f ’TEST tk1 | c1 = () . . . f ’TEST tkn | cn = () f ’INIT tk1 | c1 = e1 . . . f ’INIT tkn | cn = en f ’DFLT tkn+1 | isEmpty (f ’TEST S tkn+1 ) && cn+1 = en+1 f xk = f ’INIT xk ? f ’DFLT xk Note that the patterns and conditions of the original rules are not changed. Hence, this transformation is also compatible with other advanced features of Curry, like functional patterns, “as” patterns, non-linear patterns, local declarations, etc. Furthermore, if an efficient strategy exists for the original standard rules, the same strategy can be applied in the presence of default rules. This property can be formally stated as follows: Proposition 1 Let R be a program without default rules, and R′ be the same program except that default rules are added to some operations of R. If R is overlapping inductively sequential, so is R′ . Proof Let f be an operation of R. The only interesting case is when a default rule of f is in R′ . Operation f of R produces four different operations of R′ : f , f ’DFLT, f ’INIT, and f ’TEST. The first two are overlapping inductively sequential since they are defined by a single rule. The last two are overlapping inductively sequential when f of R is overlapping inductively sequential since they have the same definitional tree as f modulo a renaming of symbols. The above proposition could be tightened a little when operation f is non-overlapping. In this case three of the four operations produced by the transformation are non-overlapping as well. Prop. 1 is important for the efficiency of computations. In overlapping inductively sequential systems, needed redexes exist and can be easily and efficiently computed (Antoy 1997). If the original system has a strategy that reduces only needed redexes, the transformed system has a strategy that reduces Default Rules for Curry 13 only needed redexes. This ensures that optimal computations are preserved by the transformation regardless of non-determinism. This result is in contrast to Haskell (or Prolog), where the concept of default rules is based on a sequential testing of rules, which might inhibit optimal evaluation and prevent or limit non-determinism. Hence, our concept of default rules is more powerful than existing concepts in functional or logic programming (see also Sect. 8). We now relate values computed in the original system to those computed in the transformed system and vice versa. As expected, extending an operation with a default rule preserves the values computed without the default rule. Proposition 2 Let R be a program without default rules, and R′ be the same program except that default rules are added to some operations of R. If e is an expression of R that evaluates to the value t w.r.t. R, then e evaluates to t w.r.t. R′ . Proof Let f tk → u w.r.t. R, for some expression u, a step of the evaluation of e. The only interesting case is when a default rule of f is in R′ . By the definitions of f and f ’INIT in R′ , f tk → f ’INIT tk → u w.r.t. R′ . A trivial induction on the length of the evaluation of e completes the proof. The converse of Prop. 2 does not hold because R′ typically computes more values than R—that is the reason why there are default rules. The following statement relates values computed in R′ to values computed in R. Proposition 3 Let R be a program without default rules, and R′ be the same program except that default rules are added to some operations of R. If e is an expression of R that evaluates to the value t w.r.t. R′ , then either e evaluates to t w.r.t. R or some ∗ default rule of R′ is applied in e → t in R′ . Proof ∗ Let A denote an evaluation e → t in R′ that never applies default rules. For any operation f of R, the steps of A are of two kinds: (1) f tk → f ’INIT tk or (2) f ’INIT tk → t ′ , for some expressions tk and t ′ . If we remove from A the steps of kind (1) and replace f ’INIT with f , we obtain an evaluation of e to t in R. In Curry, by design, the textual order of the rules is irrelevant. A default rule is a constructive alternative to a certain kind of failure. For these reasons, a single default rule, as opposed to multiple default rules without any order, is conceptually simpler and adequate in practical situations. Nevertheless, a default rule of an operation f may invoke an auxiliary operation with multiple ordinary rules, thus, producing the same behavior of multiple default rules of f . 14 Sergio Antoy and Michael Hanus 6 Implementation The implementation of default rules for Curry based on the transformational approach is available as a preprocessor. The preprocessor is integrated into the compilation chain of the Curry systems PAKCS (Hanus et al. 2016) and KiCS2 (Braßel et al. 2011). In some future version of Curry, one could also add a specific syntax for default rules and transform them in the front end of the Curry system. The transformation scheme shown in the previous section is mainly intended to specify the precise meaning of default rules (similarly to the specification of the meaning of guards in Haskell (Peyton Jones 2003)). Although this transformation scheme leads to a reasonably efficient implementation, the actual implementation can be improved in various ways. In the following, we present two approaches to improve the implementation of default rules. 6.1 Avoiding Duplicated Condition Checking Our transformation scheme for default rules generates from a set of standard rules the auxiliary operations f ’TEST and f ’INIT. f ’TEST is used in the condition of the translated default rule to check the applicability of a standard rule, whereas f ’INIT actually applies a standard rule. Since both alternatives (standard rules or default rule) are eventually tried for application, the pattern matching and condition checking of some standard rule might be duplicated. For instance, if a standard rule is applicable to some call and the same call matches the pattern of the default rule, it might be tried twice: (1) the standard rule is applied by f ’INIT, and (2) its pattern and condition is tested by f ’TEST in order to test the (non-)emptiness of the set of all results. Although the amount of duplicated work is difficult to assess accurately due to Curry’s lazy evaluation strategy (e.g., to check the non-emptiness in the condition of f ’DFLT, it suffices to compute at most one element of the set), there is some risk for operationally complex conditions or patterns, e.g., functional patterns. This kind of duplicated work can be avoided by a more sophisticated transformation scheme where the common parts of the definitions of f ’TEST and f ’INIT are joined into a single operation. This operation first tests the application of a standard rule and, in case of a successful test, returns a continuation to proceed with the corresponding rule. For instance, consider the rules for zip presented in Example 2. The operations zip’TEST and zip’INIT generated by our first transformation scheme can be joined into a single operation zip’TESTC by the following transformation: zip ’TESTC (x:xs) (y:ys) = \_ → (x,y) : zip xs ys zip ’DFLT _ _ = [] zip xs ys = let cs = zip ’TESTC S xs ys in if isEmpty cs then zip ’DFLT xs ys else (chooseValue cs) () Now, the standard rule is translated into a rule for the new operation zip’TESTC where the rule’s right-hand side is encapsulated into a lambda abstraction to avoid Default Rules for Curry 15 its immediate evaluation if this rule is applied. The actual implementation of zip first checks whether the set of all such lambda abstractions is empty. If this is the case, the standard rule is not applicable so that the default rule is applied. Otherwise, we continue with the right-hand sides of all applicable standard rules collected as lambda abstractions in the set cs.3 The general transformation scheme to obtain this behavior is defined as follows. An operation definition of the form f tk1 | c1 = e1 . . . f tkn | cn = en f ’default tkn+1 | cn+1 = en+1 is transformed into: f ’TESTC tk1 | c1 = \_ → e1 . . . f ’TESTC tkn | cn = \_ → en f ’DFLT tkn+1 | cn+1 = en+1 f xk = let cs = f ’TESTC S xk in if isEmpty cs then f ’DFLT xk else (chooseValue cs) () Obviously, this modified scheme avoids the potentially duplicated condition checking in standard rules, but it is more sophisticated since it requires the handling of sets of continuations. Depending on the implementation of set functions, this might be impossible if the values are operations. If the results computed by set functions are actually sets (and not multi-sets), this scheme cannot be applied since sets require an equality operation on elements in order to eliminate duplicated elements. Fortunately, this scheme is applicable with PAKCS (Hanus et al. 2016), which computes multi-sets as results of set functions so that it does not require equality on elements. Thus, we compare the run times of both schemes for some of the operations shown above which contain complex applicability conditions (functional patterns). All benchmarks were executed on a Linux machine (Debian Jessie) with an Intel Core i7-4790 (3.60Ghz) processor and 8GB of memory. Figure 1 shows the run times (in seconds) to evaluate some operations with both schemes. These benchmarks indicate that the new scheme might yield a reasonable performance gain, although this clearly depends on the particular example. A further alternative transformation scheme is discussed in the following section. 3 The operation chooseValue non-deterministically chooses some value of the given set. 16 Sergio Antoy and Michael Hanus System: PAKCS 1.14.0 (Hanus et al. 2016) Operation: Arguments: isSet [1..1000] isSet [1000,1..1000] lookup 5001 [(1,.)..(5000,.)] lookup 5000 [(1,.)..(5000,.)] queens 6 Sect. 5: 7.04 4.78 3.56 3.54 0.23 Sect. 6.1: 2.27 2.28 1.81 3.57 0.23 Fig. 1. Performance comparison of different transformation schemes. 6.2 Transforming Default Rules into Standard Rules In some situations, the behavior of a default rule can be provided by a set of standard rules. Almost universally, standard rules are more efficient. An example of this situation is provided with the operation zip. In Example 2 this operation is defined with a default rule. A definition using standard rules is shown at the beginning of Sect. 3. The input/output relations of the two definitions are identical. In this section, we introduce a few concepts to describe how to obtain, under sufficient conditions, a set of standard rules that behave as a default rule. The programs considered in this section are constructor-based (O’Donnell 1977) (the extension to functional patterns is discussed later). Thus, there are disjoint sets of operation symbols, denoted by f , g, . . ., and constructor symbols, denoted by c, d , . . . An f -rooted pattern is an expression of the form f tn where f is an operation symbol of arity n, each ti is an expression consisting of variables and/or constructor symbols only, and f tn is linear, i.e., there are no repeated occurrences of some variable. A pattern is an f -rooted pattern for some operation f . A pattern is ground if it does not contain any variable. A program rule has the form l = r where the left-hand side l is a pattern (the extension to conditional rules is discussed later). Given a redex t and a step t → u, u is called a contractum (of t ). Although Curry allows non-linear patterns for the convenience of the programmer, they are transformed into linear ones through a simple syntactic transformation. In the following, we first consider a specific class of programs, called inductively sequential, where the rules of each operation can be organized in a definitional tree (Antoy 1992). Definition 1 (Definitional tree) The symbols rule, exempt, and branch, appearing below, are uninterpreted functions for classifying the nodes of a tree. A partial definitional tree with an f -rooted pattern p is either a rule node rule(p = r ), an exempt node exempt (p), or a branch node branch(p, x , Tk ), where x is a variable in p (also called the inductive variable), {c1 , . . . , ck } is the set of all the constructors of the type of x , the substitution σi maps x to ci xai (where xai are all fresh variables and ai is the arity of ci ), and Ti is a partial definitional tree with pattern σi (p) (for i = 1, . . . , k ). A definitional tree T of an operation f is a finite partial definitional tree with pattern f xn , where Default Rules for Curry 17 n is the arity of f and xn are pairwise different variables, such that T contains all and only the rules defining f (up to variable renaming). In this case, we call f inductively sequential. Definitional trees have a comprehensible graphical representation. For instance, the definitional tree of the operation “++” defined in Example 1 is shown in Fig. 2. In this graphical representation, the pattern of each node is shown. The root node is a branch and its children are rule nodes. The inductive variable of the branch is the left operand of “++”. Referring to Def. 1, σ1 maps this variable to “[]” and σ2 to (x : xs). For rule nodes, the right-hand side of the rule is shown below the arrow. Exempt nodes are marked by the keyword exempt, as shown in Figures 3 and 4. - ++ ys ◗ ◗◗◗◗ (x:xs) ++ ys [] ++ ys s sss   ys x : (xs ++ ys) Fig. 2. A definitional tree of the operation “++” . For the sake of completeness, we sketch how definitional trees are used by the evaluation strategy. The details can be found in (Antoy 1997). We discuss how to compute a rewrite of an expression rooted by an operation. More general cases are reduced to that. It can be shown that any step so computed is needed. Thus, let t be an expression rooted by an operation f and T a definitional tree of f . A traversal of T finds the deepest node N in T whose pattern p matches t . Such a node, and pattern, exist for every t . If N is a rule node, then t is a redex and is reduced. If N is an exempt node, then the computation is aborted because t has no value as in, e.g., head [], the head of an empty list. If N is a branch node, then the match of the inductive variable of p is an expression t ′ rooted by some operation and the strategy recursively seeks to compute a step of t ′ . Before presenting our transformation, we state an important property of definitional trees. Definition 2 (Mutually exclusive and exhaustive patterns) Let f be an operation symbol and S a set of f -rooted patterns. We say that the patterns of S are mutually exclusive iff for any ground f -rooted pattern p, no two distinct patterns of S match p, and we say that the patterns of S are exhaustive iff for any ground f -rooted pattern p, there exists a pattern in S that matches p. Lemma 1 (Uniqueness) Let f be an operation defined by a set of standard rules. If T is a definitional tree of the rules of f , then the patterns in the leaves of T are exhaustive and mutually exclusive. 18 Sergio Antoy and Michael Hanus Proof Let p be any ground f -rooted pattern, π the pattern in a node N of T , and suppose that π matches p. Initially, we show that if N is not a leaf of T , there is exactly one child N ′ of N such the pattern π ′ of N ′ matches p. Let x be the inductive variable of π and q the subexpression of p matched by x . Since p is ground and q is a proper subexpression of p, q is rooted by some constructor symbol c. Let {c1 , . . . ck } be the set of all the constructors of the type defining c and let ai be the arity of ci , for all appropriate i. By Def. 1, N has k children with patterns σi (π), where σi = {x 7→ ci x ai } and x ai is a fresh variable, for all appropriate i. Hence, exactly one of these patterns matches p since ci x ai matches q iff ci = c. Going back to the proposition’s claim, since the pattern in the root of T matches p, by induction on the depth of T , there is exactly one leaf whose pattern matches p. Inductive sequentiality is sufficient, but not necessary for a set of exhaustive and mutually exclusive patterns. We will later show a non-inductively sequential operation with exhaustive and mutually exclusive patterns. Nevertheless, inductive sequentiality supports a constructive method to transform default rules. Since not every definitional tree is useful to define our transformation, we first restrict the set of definitional trees. Definition 3 (Minimal definitional tree) A definitional tree is minimal iff there is some rule node below any branch node of the tree. For example, consider the operation isEmpty defined by the single rule isEmpty [] = True Fig. 3 shows a non-minimal tree of the rules defining isEmpty. The right child of the root is a branch node that has no rule node below it. In a minimal tree of the rules defining isEmpty, the right child would be an exempt node. isEmpty ❙ ❧❧ ❧❧❧❧ ❙❙❙❙ ❙ isEmpty (-:-) ❘ isEmpty []  True ♠♠ ♠♠♠ isEmpty (-:[]) (exempt) ❘❘❘❘ ❘ isEmpty (-:(-:-)) (exempt) Fig. 3. A non-minimal definitional tree of the operation isEmpty . We now investigate sufficient conditions for the equivalence between an operation defined with a default rule and an operation defined by standard rules only. Definition 4 (Replacement of a default rule) Let f be an operation defined by a set of standard rules and a default rule f xk = t , where xk are pairwise different variables and t some expression, and let T be a minimal definitional tree of the standard rules of f . Let N1 , N2 , . . . Nn be the exempt 19 Default Rules for Curry nodes of T , tki the pattern of node Ni and σi the substitution {xk 7→ tki }, for 1 6 i 6 n. The following set of standard rules of f is called a replacement of the default rule of f : σi (f xk = t ), for 1 6 i 6 n (1) Fig. 4 shows a minimal definitional tree of the single standard rule of operation zip defined at the beginning of Sect. 3. The right-most leaf of this tree holds this rule. Since this leaf is below both branch nodes, the definitional tree is minimal according to Def. 3. The remaining two leaves hold the patterns that match all and only the combinations of arguments to which the default rule would be applicable. These patterns are more instantiated than that of the default rule, but we will see that any expression reduced by these rules does not need any additional evaluation with respect to the default rule. zip [] (exempt) zip - PPP PPP P zip (x:xs) P q qqq ♣♣ ♣♣♣ zip (x:xs) [] (exempt) PPP PPP PP zip (x:xs) (y:ys)  (x,y) : zip xs ys Fig. 4. A definitional tree of the standard rule of operation zip defined in Sect. 3 . Lemma 2 (Correctness) Let f be an operation defined by a set S of standard rules and a default rule r of the form f xk = t , where each xi is a variable, for all appropriate i, and some expression t , and let R be the replacement of r . For any ground f -rooted pattern p, p is reduced at the root to some q by the default rule r iff p is reduced at the root to q by some rule of R. Proof The proof is done in two steps. First, we prove that p is reduced by r iff p is reduced by some rule of R. Then we prove that the contracta by the two rules are the same. By Lemma 1, the patterns in the rules of S ∪ R are exhaustive and mutually exclusive. Therefore, p is reduced by r if and only if p is not reduced by any rule of S if and only if p is reduced by some rule of R. We now prove the equality of the contracta. In the remainder of this proof, all the substitutions are restricted to xk , the argument variables of r . If p is reduced by r with some match σ, then p = σ(f xk ) and q = σ(t ). Pattern p is also reduced by some rule of R which, by Def. 4, is of the form σi (r ), for some substitution σi . Consequently, p = σ ′ (σi (f xk )) for some match σ ′ . Since p is ground, σ = σ ′ ◦ σi . Thus, the contractum of p by the rule of R is σ ′ (σi (t )) = σ(t ) = q. 20 Sergio Antoy and Michael Hanus In Def. 4, the replacement of a default rule is constructed for a minimal definitional tree. The hypothesis of minimality is not used in the proof of Lemma 2. The reason is that the lemma claims a property of f -rooted ground patterns. During the execution of a program, the default rule may be applied to some f -rooted expression e that may neither be a pattern nor ground. The hypothesis of minimality ensures that, in this case, no additional evaluation of e is required when a replacement rule is applied instead of the default rule. This fact is counter intuitive and non-trivial since the pattern of the default rule matches any f -rooted expression, whereas the patterns in the replacement rules do not, except in the degenerate case in which the set of standard rules is empty. However, a default rule is applicable only if no standard rule is applicable. Therefore, expression e must have been evaluated “enough” to determine that no standard rule is applicable. The following lemma shows that this evaluation is just right for the application of a replacement rule. Lemma 3 (Evaluation) Let e be an f -rooted expression reduced by the default rule of f according to the transformational semantics of Sect. 5. Let T be a minimal definitional tree of (the standard rules of) f . There exists an exempt node of T whose pattern matches e. Proof First note that the standard rules of f and the rules of f ’TEST, as defined in Sect. 5, have identical left-hand sides. Hence T is also a minimal definitional tree of the rules of f ’TEST, which are used to check the applicability of the default rule. To prove the claim, we construct a path N0 , N1 , . . . Np in the definitional tree T of f with the following invariant properties: (a) the pattern πi of each Ni unifies with e, and, (b) if the last node Np is a leaf of T , Np is an exempt node. Establishing the invariant: N0 is the root node of T . By definition, its pattern π0 is f xk , where xk are fresh distinct variables. Hence π0 unifies with e so that invariant (a) holds. Furthermore, if N0 is a leaf of T , then it cannot be a rule node, otherwise e would never be reduced by a default rule. Hence N0 is an exempt node, i.e., invariant (b) holds. Maintaining the invariant: We assume that the invariant (a) holds for node Nk , for some k > 0. If Nk is a leaf of T , then, as in the base case, Nk must be an exempt node. Hence we assume Nk is a branch of T and show that invariant (a) can be extended to some child Nk +1 of Nk . Since Nk is a branch node, e and πk unify. For each child N ′ of Nk , let π ′ be the pattern of N ′ , and let v be the inductive variable of the branch node Nk . By the definition of T , π ′ = σ ′ (πk ), where σ ′ = {v 7→ c xac }, c is a constructor symbol of arity ac , and xi is a fresh variable for any appropriate i. Let σ be the match of πk to e and t = σ(v ). If t is a variable, then any child of Nk satisfies invariant (a). Otherwise, t must be rooted by some constructor symbol, say d , for the following reasons. Because T is minimal, there are one or more rule nodes below Nk . The pattern in any of these rules is an instance of πk that has some constructor symbol in the position matched by v . Hence, unless t is constructor-rooted, it would be impossible to tell which, if any, of these rules reduces e, hence it would be impossible to say whether e must be reduced by a standard rule or the default rule. Hence, Nk +1 is the child in which v is mapped to d xad so that invariant (a) also holds for Nk +1 . Default Rules for Curry 21 We define the replacement of a default rule by a set of standard rules under four assumptions. We assess the significance of these assumptions below. Inductive sequentiality. The standard rules are inductively sequential. This is a very mild requirement in practice. For instance, every operation of the Curry Prelude, except for the non-deterministic choice operator “?” shown in Sect. 2, is inductively sequential. Non-inductively sequential operations are problematic to evaluate efficiently. E.g., the following operation, adapted from (Berry 1976, Prop. II.2.2), is defined by rules that do not admit a definitional tree: f False True x = ... f x False True = ... f True x False = ... To apply f , the evaluation to constructor normal form of two out of the three arguments is both necessary and sufficient. No practical way is known to determine which these two arguments are without evaluating all three. Furthermore, since the evaluation of an argument may not terminate, the three arguments must be evaluated concurrently (but see (Antoy and Middeldorp 1996)). Most general pattern. We assumed in our transformation that the pattern of the default rule is most general, i.e., the arguments of the operation are all variables. Choosing the most general pattern keeps the statement of Lemma 3 simple and direct. With this assumption, no extra evaluation of the arguments is needed for the application of a replacement rule. To relax this assumption, we can modify Def. 4 as follows. If the left-hand side of the default rule is f uk , we look for a most general unifier, say σi , of uk and tki . Then rule σi (f uk → t ) is in the replacement of the default rule iff such a σi exists. Unconditional rules. Both standard rules and the default rule are unconditional. Adding a condition to the default rule is straightforward, similar to the transformation shown in Sect. 5. The condition of a default rule is directly transferred to each replacement rule by extending display (1) in Def. 4 with the condition. By contrast, conditions in standard rules require some care. With a modest loss of generality, assume that the standard rules have a definitional tree where each leaf node has a conditional rule of the form: f tk | c = t (2) where c is a Boolean expression and t is any expression. Lemma 1 proves that if p is any f -rooted ground pattern matched by f tk no other standard rule matches p. Hence, p is reduced at the root by the default rule of f iff c is not satisfied by p. Therefore, we need the following rule in the replacement of the default rule f tk | ¬c = t (3) where ¬c denotes the “negation” of c, i.e., the condition satisfied by all the patterns matched by f tk that do not satisfy c. In the spirit of functional logic programming, c is evaluated non-deterministically. For example, consider an operation that takes a list of colors, say Red, Green and Blue, and removes all Red occurrences from the list: 22 Sergio Antoy and Michael Hanus data Color = Red | Green | Blue remred cs | cs == x++[Red]++y = remred (x++y) where x,y free remred ’default cs = cs The first rule is applied if there exist x and y that satisfy the condition. E.g., for the list [Red,Green,Red,Blue] there are two such combinations of x and y. Thus, the “negation” of this condition must negate the existence of any such x and y. This can be automatically done according to the transformational semantics presented in Sec. 5, but applied to a single rule. This example’s replacement of the default rule is shown below: remred cs | isEmpty (remred ’TEST S cs) = cs remred ’TEST cs | _++[Red]++_ == cs = () Constructor patterns. The standard rules defining an operation have constructor patterns. Curry also provides functional patterns, presented in Sec. 2. Rules defined by functional patterns can be transformed into ordinary rules (Antoy and Hanus 2005, Def. 4) by moving the functional pattern matching into the condition of a rule. Hence, the absence of functional patterns from our discussion is not an intrinsic limitation. Since functional patterns are quite expressive, operations defined with functional patterns often consist of a single program rule and a default rule (as in all examples shown in in Sect. 4). For instance, the previous operation remred can be defined with a functional pattern as follows: remred (x++[Red]++y) = remred (x++y) remred ’default cs = cs Hence, the improved transformation scheme presented in Sect. 6.1 is still useful and should be applied in combination with the transformation shown in this section. 7 Benchmarking To show the practical advantage of the transformation described in the previous section, we evaluated a few simple operations defined in a typical functional programming style with default rules. For instance, the Boolean conjunction can be defined with a default rule: and True True = True and ’default _ _ = False The replacement of the default rule consists of two rules so that the transformation yields the following standard rules: and True True = True and True False = False and False _ = False Similarly, the computation of the last element of a list can be defined with a default rule: Default Rules for Curry 23 last [x] = x last’default (_:xs) = last xs Our final example extracts all values in a list of optional (“Maybe”) values: catMaybes [] = [] catMaybes (Just x : xs) = x : catMaybes xs catMaybes ’default (_:xs) = catMaybes xs With the introduction of default rules, the order of evaluation may become more arbitrary, even though only needed steps are executed. For example, in the first definition of operation and both arguments must be evaluated, in any order, for the application of the standard rule. If the evaluation of one argument does not terminate and the other one evaluates to False, the order in which the two arguments are evaluated becomes observable. This situation is not directly related to the presence of a default rule. There are two “natural” inductive definitions of operation and, one evaluates the first argument first, as in the second definition of and, and another evaluates the second argument first. From the single standard rule of and, we cannot say which of the two definitions was intended. If the default rule of operation and is replaced by a set of standard rules, as per Sec. 6.2, the resulting definition, which is inductively sequential, will explicitly and arbitrarily encode which of the two arguments is to be evaluated first. As discussed earlier, functional logic computations execute narrowing steps, i.e., steps in which some variable of an expression is instantiated and the rule reducing the expression depends on the instantiation of the variable. For example, consider again the and operation for its simplicity. The evaluation of and x True, where x is a free variable, narrows x to True to apply the standard rule and narrows x to False to apply the default rule. In a narrowing step, a variable is instantiated by the unification of the expression being evaluated and the left-hand side of a rule. This does not work with a default rule, since the arguments in the left-hand side are themselves variables. In particular, the transformational semantics of and has no rule to unify x with False. To obtain the intended behavior in narrowing steps variables are instantiated by generators (Antoy and Hanus 2006). In the example being discussed, the Boolean generator is True ? False. Figure 5 shows the run times (in seconds) to evaluate the operations discussed in this section with the different transformation schemes (i.e., the scheme of Sect. 5 and the replacement of default rules presented in this section) and different Curry implementations (where “call size” denotes the number of calls to and and the lengths of the input lists for the other examples). The benchmarks were executed on the same machine as the benchmarks in Sect. 6.1. The results clearly indicate the advantage of replacing default rules by standard rules, in particular for PAKCS, which has a less sophisticated implementation of set functions than KiCS2. 8 Related Work In this section, we compare our proposal of default rules for Curry with existing proposals for other rule-based languages. 24 Sergio Antoy and Michael Hanus System: Operation / call size: PAKCS 1.14.0 (Hanus et al. 2016) zip / 1000 and / 100000 last / 2000 catMaybes / 2000 Sect. 5: 3.66 8.46 2.53 2.45 Sect. 6.2: 0.01 0.25 0.01 0.01 System: KiCS2 0.5.0 (Braßel et al. 2011) zip / 106 and / 106 last / 105 catMaybes / 106 Sect. 5: 2.72 1.35 0.38 0.40 Sect. 6.2: 0.04 0.08 0.01 0.01 Operation / call size: Fig. 5. Performance comparison of different schemes for different compilers for some operations discussed in this section. The functional programming language Haskell (Peyton Jones 2003) has no explicit concept of default rules. Since Haskell applies the rules defining a function sequentially from top to bottom, it is a common practice in Haskell to write a “catch all” rule as a final rule to avoid writing several nearly identical rules (see example zip at the beginning of Sect. 3). Thus, our proposal for default rules increases the similarities between Curry and Haskell. However, our approach is more general, since it also supports logic-oriented computations, and it is more powerful, since it ensures optimal evaluation for inductively sequential standard rules, in contrast to Haskell (as shown in Sect. 5). Since Haskell applies rules in a sequential manner, it is also possible to define more than one default rule for a function, e.g., where each rule has a different specificity. This cannot be directly expressed with our default rules where at most one default rule is allowed. However, one can obtain the same behavior by introducing a sequence of auxiliary operations where each operation has one default rule. The logic programming language Prolog (Deransart et al. 1996) is based on backtracking where the rules defining a predicate are sequentially applied. Similarly to Haskell, one can also define “catch all” rules as the final rules of predicate definitions. In order to avoid the unintended application of these rules, one has to put “cut” operators in the preceding standard rules. As already discussed in Sect. 3, these cuts are only meaningful for instantiated arguments, otherwise the completeness of logic programming might be destroyed. Hence, this kind of default rules can be used only if the predicate is called in a particular mode, in contrast to our approach. The completeness for arbitrary modes might require the addition of concepts from Curry into Prolog, like the demand-driven instantiation of free variables. Various encapsulation operators have been proposed for functional logic programs Default Rules for Curry 25 (Braßel et al. 2004) to encapsulate non-deterministic computations in some data structure. Set functions (Antoy and Hanus 2009) have been proposed as a strategyindependent notion of encapsulating non-determinism to deal with the interactions of laziness and encapsulation (see (Braßel et al. 2004) for details). One can also use set functions to distinguish successful and non-successful computations, similarly to negation-as-failure in logic programming, exploiting the possibility to check result sets for emptiness. When encapsulated computations are nested and performed lazily, it turns out that one has to track the encapsulation level in order to obtain intended results, as discussed in (Christiansen et al. 2013). Thus, it is not surprising that set functions and related operators fit quite well to our proposal. Actually, many explicit uses of set functions in functional logic programming to implement negation-as-failure can be implicitly and more tersely encoded with our concept of default rules, as shown in Examples 7 and 8. Default rules and negation-as-failure have been also explored in (López-Fraguas and Sánchez-Hernández 2004; Sánchez-Hernández 2006) for functional logic programs. In these works, an operator, fails, is introduced to check whether every reduction of an expression to a head-normal form is not successful. (López-Fraguas and Sánchez-Hernández 2004) proposes the use of this operator to define default rules for functional logic programming. However, the authors propose a scheme where the default rule is applied if no standard rule was able to compute a head normal form. This is quite unusual and in contrast to functional programming (and our proposal) where default rules are applied if pattern matching and/or conditions of standard rules fail, but the computations of the rules’ right-hand sides are not taken into account to decide whether a default rule should be applied. The same applies to an early proposal for default rules in an eager functional logic language (Moreno-Navarro 1994). Since the treatment of different sources of non-determinism and their interaction were not explored at that time, nested computations with failures are not considered by these works. As a consequence, the operator fails might yield unintended results if it is used in nested expressions. For instance, if we use fails instead of set functions to implement the operation isUnit defined in Example 4, the evaluation of isUnit failed yields the value False in contrast to our intended semantics. Finally, we proposed in (Antoy and Hanus 2014) to change Curry’s rule selection strategy to a sequential one. However, it turned out that this change has drawbacks w.r.t. the evaluation strategy, since formerly optimal reductions are no longer possible in particular cases. For instance, consider the operation f defined in Sect. 5 and the call f loop 2. In a sequential rule selection strategy, one starts by testing whether the first rule is applicable. Since both arguments are demanded by this rule, one might evaluate them from left to right (as done in the implementation (Antoy and Hanus 2014)) so that this evaluation does not terminate. This problem is avoided with our proposal which returns 2 even in the presence of a default rule for f. Moreover, the examples presented in (Antoy and Hanus 2014) can be expressed with default rules in a similar way. 26 Sergio Antoy and Michael Hanus 9 Conclusions We proposed a new concept of default rules for Curry. Default rules are available in many rule-based languages, but a sensible inclusion into a functional logic language is demanding. Therefore, we used advanced features for encapsulating search to define and implement default rules. Thanks to this approach, typical logic programming features, like non-determinism and evaluating operations with unknown arguments, are still applicable with our new semantics. This distinguishes our approach from similar concepts in logic programming which simply cut alternatives. Our approach can lead to more elegant and comprehensible declarative programs, as shown by several examples in this paper. Moreover, many uses of negationas-failure, which are often implemented in functional logic programs by complex applications of encapsulation operators, can easily be expressed with default rules. Since encapsulated search is more costly than simple pattern matching, we have also shown some opportunities to implement default rules more efficiently. In particular, if the standard rules are inductively sequential and unconditional, one can replace the default rules by a set of standard rules so that the usage of encapsulated search can be completely avoided. Acknowledgments. The authors are grateful to Sandra Dylus and the anonymous reviewers for their suggestions to improve a previous version of this paper. This material is based in part upon work supported by the National Science Foundation under Grant No. 1317249. References Antoy, S. 1992. Definitional trees. In Proc. of the 3rd International Conference on Algebraic and Logic Programming. Springer LNCS 632, 143–157. Antoy, S. 1997. Optimal non-deterministic functional logic computations. In 6th Int’l Conf. on Algebraic and Logic Programming (ALP’97). Vol. 1298. Springer LNCS, Southampton, UK, 16–30. Antoy, S., Echahed, R., and Hanus, M. 2000. A needed narrowing strategy. Journal of the ACM 47, 4, 776–822. Antoy, S. and Hanus, M. 2005. Declarative programming with function patterns. In Proceedings of the International Symposium on Logic-based Program Synthesis and Transformation (LOPSTR’05). Springer LNCS 3901, 6–22. Antoy, S. and Hanus, M. 2006. Overlapping rules and logic variables in functional logic programs. In Proceedings of the 22nd International Conference on Logic Programming (ICLP 2006). Springer LNCS 4079, 87–101. Antoy, S. and Hanus, M. 2009. Set functions for functional logic programming. In Proceedings of the 11th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP’09). ACM Press, 73–82. Antoy, S. and Hanus, M. 2010. Functional logic programming. Communications of the ACM 53, 4, 74–85. Antoy, S. and Hanus, M. 2014. Curry without Success. In Proc. of the 23rd International Workshop on Functional and (Constraint) Logic Programming (WFLP 2014). CEUR Workshop Proceedings, vol. 1335. CEUR-WS.org, 140–154. Default Rules for Curry 27 Antoy, S. and Middeldorp, A. 1996. A sequential strategy. Theoretical Computer Science 165, 75–95. Berry, G. 1976. Bottom-up computation of recursive programs. Braßel, B., Hanus, M., and Huch, F. 2004. Encapsulating non-determinism in functional logic computations. Journal of Functional and Logic Programming 2004, 6. Braßel, B., Hanus, M., Peemöller, B., and Reck, F. 2011. KiCS2: A new compiler from Curry to Haskell. In Proc. of the 20th International Workshop on Functional and (Constraint) Logic Programming (WFLP 2011). Springer LNCS 6816, 1–18. Christiansen, J., Hanus, M., Reck, F., and Seidel, D. 2013. A semantics for weakly encapsulated search in functional logic programs. In Proc. of the 15th International Symposium on Principle and Practice of Declarative Programming (PPDP’13). ACM Press, 49–60. Deransart, P., Ed-Dbali, A., and Cervoni, L. 1996. Prolog - the standard: reference manual. Springer. González-Moreno, J., Hortalá-González, M., López-Fraguas, F., and Rodrı́guez-Artalejo, M. 1999. An approach to declarative programming based on a rewriting logic. Journal of Logic Programming 40, 47–87. Hanus, M. 2011. Declarative processing of semistructured web data. In Technical Communications of the 27th International Conference on Logic Programming. Vol. 11. Leibniz International Proceedings in Informatics (LIPIcs), 198–208. Hanus, M. 2013. Functional logic programming: From theory to Curry. In Programming Logics - Essays in Memory of Harald Ganzinger. Springer LNCS 7797, 123–168. Hanus, M., Antoy, S., Braßel, B., Engelke, M., Höppner, K., Koj, J., Niederau, P., Sadre, R., and Steiner, F. 2016. PAKCS: The Portland Aachen Kiel Curry System. Available at http://www.informatik.uni-kiel.de/∼pakcs/. Hanus (ed.), M. 2016. Curry: An integrated functional logic language (vers. 0.9.0). Available at http://www.curry-language.org. López-Fraguas, F. and Sánchez-Hernández, J. 2004. A proof theoretic approach to failure in functional logic programming. Theory and Practice of Logic Programming 4, 1, 41–74. Moreno-Navarro, J. 1994. Default rules: An extension of constructive negation for narrowing-based languages. In Proc. Eleventh International Conference on Logic Programming. MIT Press, 535–549. O’Donnell, M. J. 1977. Computing in Systems Described by Equations. Springer LNCS 58. Peyton Jones, S., Ed. 2003. Haskell 98 Language and Libraries—The Revised Report. Cambridge University Press. Reddy, U. 1985. Narrowing as the operational semantics of functional languages. In Proc. IEEE Internat. Symposium on Logic Programming. Boston, 138–151. Sánchez-Hernández, J. 2006. Constructive failure in functional-logic programming: From theory to implementation. Journal of Universal Computer Science 12, 11, 1574– 1593. Slagle, J. 1974. Automated theorem-proving for theories with simplifiers, commutativity, and associativity. Journal of the ACM 21, 4, 622–642.
6cs.PL
arXiv:1609.00325v1 [math.GR] 1 Sep 2016 CONJUGACY SEARCH PROBLEM AND THE ANDREWS–CURTIS CONJECTURE DMITRY PANTELEEV AND ALEXANDER USHAKOV Abstract. We develop new computational methods for studying potential counterexamples to the Andrews–Curtis conjecture, in particular, Akbulut–Kurby examples AK(n). We devise a number of algorithms in an attempt to disprove the most interesting counterexample AK(3). To improve metric properties of the search space (which is a set of balanced presentations of 1) we introduce a new transformation (called an ACMmove here) that generalizes the original Andrews-Curtis transformations and discuss details of a practical implementation. To reduce growth of the search space we introduce a strong equivalence relation on balanced presentations and study the space modulo automorphisms of the underlying free group. Finally, we prove that automorphism-moves can be applied to AK(n)-presentations. Unfortunately, despite a lot of effort we were unable to trivialize any of AK(n)-presentations, for n > 2. Keywords. Andrews-Curtis conjecture, Akbulut-Kurby presentations, trivial group, conjugacy search problem, computations. 2010 Mathematics Subject Classification. 20-04, 20F05, 20E05. 1. Introduction The Andrews–Curtis conjecture (AC-conjecture, or ACC) is a long-standing open problem in low-dimensional topology and combinatorial group theory. It was proposed by Andrews and Curtis in [1] while categorizing possible counterexamples to the Poincaré conjecture. Later, Wright in [29] formulated an equivalent conjecture about 3-deformations of 2-CW-complexes associated with all finitely presented groups, thus showing that Zeeman conjecture [30] implies AC-conjecture. It is known that Zemman conjecture also implies the Poincaré conjecture and is implied by Poincaré in some cases, e.g. [12]. Despite recent progress and solution to Poincaré conjecture, validity of the AC-conjecture remains open. Although most of motivating examples come from topology, the conjecture is usually formulated in the language of combinatorial group theory, as a question of equivalence of presentations of the trivial group. In this paper we use the language of combinatorial group theory, omitting any topological aspects of the problem. Date: September 2, 2016. The second author has been partially supported by NSF grant DMS-1318716. 1 2 D. PANTELEEV AND A. USHAKOV 1.1. Balanced presentations of the trivial group. Let X = {x1 , . . . , xn }, F = F (X) be the free group on X, and R a finite subset of F . The normal closure of R, denoted by ncl(R), is the smallest normal subgroup in F (X) containing R. A pair (X; R) defines a quotient group F/ ncl(R), P denoted by hX | Ri, and is called a presentation of hX | Ri. The sum r∈R |r| is called the total length of the presentation (X; R) and is denoted by L(R). We say that R ⊆ F (X) is symmetrized if R contains only cyclically reduced words and is closed under taking inverses and cyclic permutations. Denote by R? the minimal symmetrized set containing R (with all the words cyclically reduced). A presentation (X; R) is symmetrized if R = R? . A finite presentation can be efficiently symmetrized and symmetrization does not change the computational properties of the fundamental problems. We say that a group presentation (X; R) is balanced if |X| = |R|. Some group presentations define the trivial group 1. The “most trivial” presentation of 1 on generators {x1 , . . . , xn } is, of course, (x1 , . . . , xn ; x1 , . . . , xn ) called the canonical presentation of 1 on {x1 , . . . , xn }. Define a set Bn ⊆ Fnn of balanced relator-tuples of the trivial group: Bn = { (r1 , . . . , rn ) | ncl(r1 , . . . , rn ) = Fn } . We use vector notation for tuples in Fnn . The problem of deciding if (X; R) defines the trivial group is undecidable (see [24, 4]). It is an open problem if the same is true for balanced presentations (see Magnus’ problem [18, Problem 1.12]). 1.2. Transformations of group presentations. There are several types of transformations that for a general group presentation (x1 , . . . , xn ; r1 , . . . , rn ) produce a new presentation (x1 , . . . , xn ; r10 , . . . , rn0 ) on the same set of generators of the same group. The Andrews-Curtis transformations AC1 , AC2 , AC3 (or simply AC-moves) are of that type: (AC1 ) ri → ri rj for i 6= j, (AC2 ) ri → ri−1 , (AC3 ) ri → w−1 ri w for some w ∈ Fn . The transformations AC1 , AC2 can be recognized as Nielsen transformations of the tuple (r1 , . . . , rn ) and the transformation AC3 is a conjugation of any element in a tuple. Since the AC-moves are invertible, we can say that u and v are AC-equivalent (and write u ∼AC v) if there exists a sequence of AC-moves transforming u into v. More generally, a transformation (named here an ACM-move) that replaces a single element ui in u with an element u0i satisfying: 0 u±1 i ∼ ui in hx1 , . . . , xn | u1 , . . . , ui−1 , ui+1 , . . . , un i produces an isomorphic presentation. It is easy to see that AC-moves are particular types of the ACM-move. Also, the ACM-move can be recognized as a slightly generalized M -transformation of [9]. It is easy to see that u ON ANDREWS–CURTIS CONJECTURE 3 can be transformed to v by AC-moves if and only if the same can done by ACM-moves. Therefore, to check AC-equivalence one can use ACM-moves. Yet another transformation of a group presentation that does not change the group is an automorphism move, which is an application of ϕ ∈ Aut(Fn ) to every component of u. It is not known if the system of AC-moves with automorphism-moves is equivalent to the system of AC-moves. More on automorphism-moves in Section 3. 1.3. The conjecture. Denote by C the set of all tuples that can be obtained from the canonical tuple by a sequence of AC-moves. More generally, for u ∈ Bn denote by Cu the set of tuples in Bn AC-equivalent to u. The Andrews-Curtis conjecture [2] states that C = Bn , i.e., every balanced presentation of the trivial group can be converted to the canonical presentation by a sequence of AC-moves. Despite nearly 50 years of research the conjecture is still open. It is widely believed that the AndrewsCurtis conjecture is false with most theoretic works attempting to disprove it. A common approach is to fix some group G, a homomorphism ϕ : Fn → G, and investigate if for any u ∈ Bn there exists a sequence of AC-moves taking ϕ(u) into (ϕ(x1 ), . . . , ϕ(xn )). Clearly, if the answer is negative for some choice of G and ϕ, then the original conjecture does not hold. Several classes of groups were investigated that way, e.g., solvable groups [21], finite groups [5], the Grigorchuk group [23], but the (negative) answer is not found. 1.4. Potential counterexamples. A big obstacle towards the solution of the problem is that there is no algorithm to test if a particular balanced presentation of the trivial group satisfies the conjecture, or not. There is a number of particular balanced presentations that are not known to satisfy the conjecture. • Akbulut–Kurby examples: AK(n) = x, y | xyx = yxy, xn+1 = y n for n ≥ 3. • Miller–Schupp examples: x, y | x−1 y 2 x = y 3 , x = w , where w has exponent sum 0 on x. • B. H. Neumann example x, y, z | z −1 yz = y 2 , x−1 zx = z 2 , y −1 xy = x2 . These examples are referred to as potential counterexamples to ACC. More examples of balanced presentations of 1 (known to be AC-equivalent to the canonical presentation) can be found in [15, 16, 8]. It was shown in [19] by means of a computer experiment that there are no counterexamples of total length 12 or less. Later it was shown in [13] that every balanced presentation of total length 13 is either AC-equivalent to the canonical presentation or to AK(3) = hx, y | x3 = y 4 , xyx = yxyi, which makes AK(3) the shortest potential counterexample. 4 D. PANTELEEV AND A. USHAKOV 1.5. Computational approach to disproving a counterexample. To check if a given tuple u is AC-equivalent to the canonical presentation, one can enumerate equivalent presentations (by applying AC-moves) until the canonical presentation is found (see [19, 13, 6]). There are several general computational problems associated with that approach that we would like to mention here: • Cu is infinite and there is no terminating condition which allows an enumeration procedure to stop with a negative answer. The enumeration procedure can only terminate with a positive answer when it finds the canonical presentation. • Lengths of tuples are unbounded. • Cu has exponential growth. To alleviate some of the problems one can bound the lengths of the words in tuples by some constant L and do not process a tuple v which is ACequivalent to the given u if v contains a (cyclic) word of length greater than L. This approach (used in [13, 6]) allows to use fixed memory slots for words and makes the search space finite. Also, it is a good heuristic to process shorter tuples first. In this paper we consider the case n = 2 only. We use compact memory representation for balanced pairs (u, v) ∈ B2 . We represent each letter by a 2-bit number, thus packing 32 letters into a 64-bit machine-word. This approach saves memory and allows to implement operations such as a cyclic shift in just a few processor instructions, compared to a usual approach which includes several memory writes. 1.6. Our work. In this paper we develop new efficient techniques to enhance algorithmic search in C (or Cu ). Our work is similar to previous computational investigations of ACC, but goes much further. The presentation AK(3) is the main object of study and most of the algorithms are tested on AK(3). Our big goal was to prove that AK(3) is not a counterexample, i.e., it satisfies ACC. Unfortunately, we were not able to achieve our goal. Below we list the key features of our work. • In Section 2 we show that ACM-moves can be used in practice. Notice that for n = 2 that requires enumerating (short!) conjugates in a one relator group for a given element. The later problem does not have an efficient solution as of now. It is not even known if the conjugacy problem is decidable or not in one relator groups. Based on techniques described in [22] we design a heuristic procedure enumerating short conjugates and discuss the details of implementation. • We prove in Section 3 that automorphism-moves can be used with the AC-moves for Akbulut-Kurby presentations AK(n), regardless of whether the conjecture holds for AK(n). • In Section 4 we introduce an equivalence relation ∼ on pairs in B2 and define normal forms for the equivalence classes. We show that in practice equivalence of two pairs can be checked and normal forms ON ANDREWS–CURTIS CONJECTURE 5 computed. That allows us to work with the quotient space B2 / ∼ which elements are (infinite) equivalence classes. Working in B2 / ∼ we work with large blocks of elements from B2 . Thus, we can say that the space B2 / ∼ is much smaller than B2 , even though both sets are infinite countable. • In Section 5 we use heuristics to investigate if certain properties of one-relator groups described in [8] and [16] could be the reason of our unsuccessful search of trivialization for AK(3). • In Section 6 we present results of our experiments. 2. ACM-move In this section we describe our implementation of the ACM-move, i.e., an algorithm which for a given pair u, v ∈ F = F (x, y) constructs a subset of the set:  U = U (u, v) = u0 ∈ F (x, y) u0 ∼ u in hx, y | vi and |u0 | ≤ L , where L ∈ N is a fixed parameter value. Ideally, the algorithm should construct the whole set U (u, v). The algorithm is based on weighted Xdigraphs. 2.1. Weighted X-digraphs. Formally, a weighted X-digraph is a tuple (V, E, µ, γ) where (V, E) defines a directed graph, µ : E → X ± is the labeling function, and γ : E → Z is the weight function. x,k We often use the following notation a → b for the edge with origin a, terminus b, label x, and weight k. We say that an edge b x,k e−1 . x−1 ,−k → a is the inverse to e = a → b and denote it by We say that a weighted Xdigraph Γ is: • folded, if for every a ∈ V and x ∈ X ± there exists at most one edge with the origin a labeled with x; • inverse, if with every edge e the graph Γ contains e−1 ; • rooted, if Γ comes with a designed vertex called the root. A path p in Γ is a sequence of adjacent edges e1 . . . en , its label is µ(p) = µ(e1 ) . . . µ(ek ) and the weight γ(p) = γ(e1 ) + . . . + γ(ek ). A circuit is a path with the same origin and terminus. An inverse weighted labeled digraph Γ with a root v0 and a number N ∈ N ∪ {∞} is called a pseudo conjugacy graph for u in G = hx, y | vi if the following conditions are satisfied: (CG1) µ(l) ∼v uγ(l) for any circuit l. (CG2) N = ∞ or uN = 1 in G. The simplest nontrivial example of a pseudo conjugacy graph Loop(u) for u in hx, y | vi is shown in Fig. 1. To implement ACM-move we generate a sufficiently large pseudo-conjugacy graph Γ for u and then “harvest” circuits of weight 1. A large pseudoconjugacy graph Γ can be generated starting with Loop(u) and applying 6 D. PANTELEEV AND A. USHAKOV (w1 , 0) (w0 , 0) v0 (wk , 1) (wk−1 , 0) Figure 1. A pseudo conjugacy graph Loop(u). R-completion procedure D times. R-completion is a variation of coset enumeration first described in [28, 22] and reviewed for more precise complexity bounds below. Harvest is shortly discussed in Section 2.4. 2.2. Operations on weighted X-digraphs. Here we shortly describe several operations with graphs used later in the sequel. 2.2.1. Vertex-identification. Given a folded X-digraph Γ and distinct v1 , v2 ∈ V (Γ) define a graph Id(Γ, v1 , v2 ) obtained from Γ as follows: • add a new vertex v to V (Γ); x,a x,a • for each edge vi → u add an edge v → u; x,a x,a • for each edge u → vi add an edge u → v; • remove v1 and v2 . In general, the graph Id(Γ, v1 , v2 ) is not folded. 2.2.2. Weight-shift. For v ∈ V (Γ) and δ ∈ Z define a graph Shift(v, δ) obtained from Γ by changing weights of edges incident to v as follows: x,a • the weight a of e = v → u (where v 6= u) is increased by δ; x,a • the weight a of e = u → v (where v 6= u) is decreased by δ. It is easy to see that a weight-shift preserves the weights of circuits in Γ and, hence, preserves the property to be a pseudo-conjugacy graph. The number of arithmetic operations required for this operation is clearly bounded by the number of edges Ev incident on v. x,a 2.2.3. Folding. If Γ is not folded, then it contains two edges e1 = u → v1 x,b and e2 = u → v2 . Consider several cases. • If v1 = v2 and a ≡ b mod N , then we remove one of the edges. • If v1 = v2 and a 6≡ b mod N , then we replace the modulus N with the number gcd(N, b − a) and remove one of the edges. • If v1 6= v2 , then: – apply Shift(v1 , a−b) (or Shift(v2 , b−a)) to achieve γ(e1 ) = γ(e2 ); – identify v1 and v2 ; – remove e2 . ON ANDREWS–CURTIS CONJECTURE 7 It is straightforward to check that the described operation produces a pseudoconjugacy graph from a pseudo-conjugacy graph Γ (see [28] for more detail). Since folding e1 with e2 decreases the number of edges, a sequence of folds eventually stops with a folded graph. The final result of folding is unique up to shifts of weights. Denote it by Fold(Γ). 2.2.4. R-completion. Recall that a (finite) set R ⊂ F (X) is called symmetrized if R with every r ∈ R contains all cyclic permutations of r. To complete a given weighted X-digraph Γ with (symmetrized) relators R ⊂ F (X) means to add a circuit at v labeled with r to Γ of weight 0 for every v ∈ V and r ∈ R. It is easy to check that if Γ is a pseudo-conjugacy graph then the result is a pseudo-conjugacy graph as well. It clearly requires linear time (in |Γ|) to R-complete a given graph Γ. In general, the result is not folded. 2.3. Complexity of weighted X-digraph folding. Let Γ = (V, E, µ, γ) be a weighted X-digraph. It follows from the description of folding that Fold(Γ) as an X-digraph (i.e., if we forget about the weight function) is the same as the result of folding of the X-digraph (V, E, µ). The only difference between weighted X-digraph folding and X-digraph folding is weightprocessing (applications of Shift(v1 , a−b) or Shift(v2 , b−a) in Section 2.2.3). The idea is to modify the procedure and take weights into account. 2.3.1. X-digraph folding. Recall that X-digraph folding can be done in nearly linear time O(|V | log∗ (|V |)), where log∗ is inverse-Ackermann function (see [27]). In some sense, folding of an X-digraph Γ describes the following equivalence relation ∼ on V (Γ): • v1 ∼ v2 ⇔ there exists a path from v1 to v2 in Γ with µ(p) = ε; and results into the graph Γ/ ∼. To effectively represent the sets of identified vertices (equivalence classes) one can use compressed tree representation (as in [26]). Each vertex v ∈ V contains a pointer p(v) to its parent, the root points to itself. Vertex and its parent always belong to the same equivalence class, thus each tree represents an equivalence class. This presentation allows to compare and merge two classes very efficiently, which results in O(|V | log∗ (|V |)) complexity bound. 2.3.2. Weighted X-digraph folding. To achieve a similar complexity bound for weighted X-digraph folding we need to take into account shifts of weight. Since in the middle of the folding process we work with equivalence classes (as in Section 2.3.1 above), weight-shift requires shifting weights for a whole class. To avoid shifting weights many times with each vertex v we keep a number δ(v) called shift value. That defines the total shift ∆(v) of a vertex v as: ( 0, if p(v) = v; ∆(v) = δ(v) + ∆(v 0 ), if p(v) = v 0 6= v. Hence, to perform weight-shift of v2 while identifying v1 and v2 (case v1 6= v2 in the Folding procedure, section 2.2.3) we set p(v2 ) = v1 and instead of 8 D. PANTELEEV AND A. USHAKOV doing Shif t(v, c) immediately, we just set δ(v) = c. Comparison and merge of two vertex equivalence classes can be easily extended to tree presentations with shifts δ. Therefore, the following proposition holds. Proposition 2.1. The number of additions performed by the folding procedure is O(|V | log∗ (|V |)).  We would like to point out that the values of the weight function can grow exponentially fast (linearly in binary). Nevertheless, in all our experiments we never encountered values greater than 264 . Corollary 2.2. Let (X; R) be a symmetrized presentation. The total number of additions required to apply R-completion to a weighted graph Γ is O (|Γ| L (R) log∗ (|Γ| L (R))). 2.4. Harvest. Here we describe a procedure that for a weighted folded Xdigraph Γ and L ∈ N finds all circuits in Γ of weight 1 and length up to L. Since the number of such circuits is expected to grow exponentially with L one can not expect a very efficient implementation. Nevertheless, certain heuristics allow to speed up enumeration significantly. For every vertex v ∈ Γ we find all reduced paths P in Γ from v of length up to dL/2e and distribute them into bins Pu,x,ν,l : Pu,x,γ,l = {p ∈ P | t(p) = u, γ(p) = γ, |p| = l, µ(p) ends with x}. Then we consider pairs of “compatible” bins: T = {(Pu1 ,x1 ,γ1 ,l1 , Pu2 ,x2 ,γ2 ,l2 ) | u1 = u2 , x1 6= x2 , γ1 −γ2 ≡N 1, 0 ≤ l1 −l2 ≤ 1}. The set of circuits at v is constructed as: {p1 p−1 2 | p1 ∈ P1 , p2 ∈ P2 , (P1 , P2 ) ∈ T }. Finally, the vertex v is removed from Γ and the same process is applied to another vertex in Γ. Note that we may skip vertices which has no adjacent edges of a non-trivial weight. The number of operations is bounded by (2 · |X|)dL/2e , but it was much smaller in practice. 2.5. ACM-move implementation efficiency. The implementation of the ACM-move described above constructs a subset of the set of conjugates for a given u in hx, y | vi of bounded length. In general, it can be a proper subset of U (u, v). The result depends on the value of D – the number of completion steps used to construct pseudo-conjugacy graphs. We denote it by UD (u, v). In this section we shortly prove that: ∞ [ UD (u, v) = U (u, v), D=1 and define the parameter δ (called depth) of a conjugate u0 ∈ U (u, v) responsible for “complexity” of u. For a set S ⊂ R2 let ∂S be its boundary and S the closure of S in R2 . Let D be a finite connected planar X-digraph with set of vertices V (D) and set of ON ANDREWS–CURTIS CONJECTURE 9 edges E(D). Let C(D) be a set of cells of D which are connected and simply connected bounded components of R2 \ D. The unbounded component of R2 \ D is called the outer cell of D denoted by cout . An edge e ∈ E(D) is free if it does not belong to ∂c for any c ∈ C(D). For any e ∈ E(D) we denote its label by µ(e) ∈ X ± . The boundary of a cell c ∈ C(D) traversed in a counterclockwise direction starting from some vertex of c makes a closed path e1 . . . en giving the word µ(c) = µ(e1 ) . . . µ(en ) ∈ (X ± )∗ called a boundary label of c. Depending on a starting vertex we get a cyclic permutation of the same word. For the rest of this subsection let D be a finite connected planar X-digraph with a base vertex v0 ∈ V (D)∩∂cout . The graph D is a van Kampen diagram over hX | Ri if µ(c) ∈ R? for every c ∈ C(D). The boundary label µ(D) of D is the boundary label of ∂cout read starting from v0 in a counterclockwise direction. Note that we need also to specify the first edge to read from v0 , that is, the starting boundary position, but it is not important for our considerations so we omit this issue. Now let us exclude one of the cells from C(D) and call it the inner cell cin of D. Denote v0 by vout and pick any vertex vin ∈ V (D) ∩ ∂cin . We call D an annular (Schupp) diagram (see [25]) over hX | Ri if µ(c) ∈ R? for any c ∈ C(D). Its two boundary labels µin (D) = µ(cin ) and µout (D) = µ(cout ) read in a counterclockwise direction from vin and vout correspondingly, are called the inner and outer labels of D. For any w1 , w2 ∈ (X ± )∗ we have that w1 ∼G w2 if and only if there exists an annular diagram D over hX | Ri with µin (D) = w1 and µout (D) = w2 . We measure diagram complexity using a notion of depth (introduced in [28]). For a van Kampen or annular diagram D define the dual graph D∗ = (V ∗ , E ∗ ) as an undirected graph with V ∗ = C(D) ∪ cout (for annular diagrams we add cin ) and E ∗ = {(c1 , c2 ) | ∂c1 ∩ ∂c2 6= ∅}. We denote the graph distance in D∗ by d∗ . The depth of a (generalized) van Kampen diagram D is defined by: δ(D) = max d∗ (c, cout ). c∈C(D) The depth of an annular diagram D is: δ∼ (D) = max [min (d∗ (c, cout ), d∗ (c, cin ))] . c∈C(D) (There is a similar notion of a diagram radii (see [10, 7]).) Define the conjugate depth of two words w1 , w2 ∈ F (X) as: δ∼ (w1 , w2 ) = min D is an annular diagram { δ(D) | µin (D) = w1 , µout (D) = w2 } if w1 ∼G w2 and ∞ otherwise. The next theorem shows a relation between complexity of the conjugacy search problem and the conjugacy depth. Theorem (Theorem 3.5 in [20]). There exists an algorithm which for a given finite symmetrized presentation hX | Ri and words w1 , w2 ∈ F (X) 10 D. PANTELEEV AND A. USHAKOV terminates with the affirmative answer if and only if w1 ∼G w2 . Furthermore, its complexity can be bounded above by:   2δ∼ (w1 ,w2 ) Õ |w1 ||w2 |L(R) . For our purposes it will be useful to define another characteristic of annular diagrams, the inner conjugacy depth: in δ∼ (D) = max d∗ (c, cin ), c∈C(D) and the conjugacy depth from w1 to w2 as: w1 δ∼ (w2 ) = min D is an annular diagram w1 { δ∼ (D) | µin (D) = w1 , µout (D) = w2 } , if w1 ∼G w2 and ∞ otherwise. Theorem 2.3. Assume that u and u0 are conjugate in hx, y | vi and δ = u (u0 ). If δ ≤ D (where D is the number of R-completions applied to δ∼ Loop(u)), then our implementation of the ACM-move applied for (u, v) produces the pair (u0 , v). Proof. Same proof as that of [22, Theorem 17.6.12].  It easily follows from Corollary 2.2 that, in general, D iterations of Rcompletion procedure require exponential time. Fortunately, in our experiments with AK(3), we observed that the value D = 2 is sufficient. Application of more than two R-completions did not produce any additional conjugates and did not change highlighted figures in Table 1, section 6.1. 3. Nielsen automorphisms and AC-equivalence In this section we discuss automorphism-moves, namely applications of an automorphism ϕ ∈ Aut(F2 ): (u, v) → (ϕ(u), ϕ(v)). It is not known if adding these transformations to AC-moves results in an equivalent system of transformations or not (even for presentations of 1). Nevertheless, the following is true. Lemma 3.1 ([9, Proposition 1(iii)] or [19, Lemma 1]). If (u, v) can be transformed into (x, y) using AC-moves and automorphisms, then (u, v) can be transformed into (x, y) using AC-moves only.  With any (u, v) we can associate ϕ(u,v) ∈ End(F2 ) defined by ϕ(u,v) (x) = u and ϕ(u,v) (y) = v. That way we can treat B2 as a monoid. By Lemma 3.2, B2 naturally acts on AC-components. Lemma 3.2. Assume that (u, v) ∼AC (u0 , v 0 ) and ϕ ∈ B2 . Then: (ϕ(u), ϕ(v)) ∼AC (ϕ(u0 ), ϕ(v 0 )). ON ANDREWS–CURTIS CONJECTURE 11 Proof. Clearly, it is sufficient to prove the result for the case when (u0 , v 0 ) is obtained from (u, v) by a single ACM-move, i.e., we may assume that u ∼ u0 in hx, y | vi and v = v 0 . Hence, ϕ(u) ∼ ϕ(u0 ) in hx, y | ϕ(v)i and (ϕ(u), ϕ(v)) ∼AC (ϕ(u0 ), ϕ(v 0 )).  Lemma 3.3 immediately implies Lemma 3.1 since (x, y) ∼AC (ϕ(x), ϕ(y)) for every ϕ ∈ Aut(F (X)). Lemma 3.3. Let u, v ∈ F (X), ϕ ∈ End(F (X)), and (u, v) ∼AC (ϕ(u), ϕ(v)). Then for any u0 , v 0 ∈ F (X) the following holds: (u, v) ∼AC (u0 , v 0 ) ⇒ (u0 , v 0 ) ∼AC (ϕ(u0 ), ϕ(v 0 )) Proof. As above, we may assume that u ∼ u0 in hx, y | vi and v = v 0 . Hence (ϕ(u0 ), ϕ(v 0 )) ∼AC (ϕ(u), ϕ(v)) ∼AC (u, v) ∼AC (u0 , v 0 ).  With (u, v) ∈ B2 we can associate a monoid: EndAC (u, v) = { ϕ ∈ End(F2 ) | (u, v) ∼AC (ϕ(u), ϕ(v)) } , under the usual composition. Lemma 3.3 implies that: • EndAC (u, v) = EndAC (u0 , v 0 ) whenever (u, v) ∼AC (u0 , v 0 ); • Aut(F2 ) ≤ EndAC (x, y). • EndAC (x, y) = { ϕ | ϕ(x) = u, ϕ(y) = v, (u, v) ∈ B2 } if and only if ACC holds. Below we prove that Aut(F2 ) ≤ EndAC (AK(n)) for every n ∈ N. 3.1. Akbulut-Kurby examples. Lemmas 3.4, 3.5, and 3.6 show that: ϕ(AK(n)) ∼AC AK(n), for some ϕ ∈ Aut(F2 ). Proofs were obtained using a computer program. Below for brevity we use X and Y as x−1 and y −1 . Lemma 3.4. ϕ(AK(n)) ∼AC AK(n) for ϕ ∈ Aut(F2 ) defined by ϕ(x) = y, ϕ(y) = x. Proof. The pair (ϕ(xyxY XY ), ϕ(xk Y k+1 )) = (yxyXY X, y k X k+1 ) can be modified as follows: ∼AC2 ∼ACM ∼AC3 (xyxY XY, y k X k+1 ) (xyxY XY, c−1 xk Y k+1 c) where c = xyx (xyxY XY, xk Y k+1 ). Appendix A provides more detail for each ACM-move used.  Lemma 3.5. ϕ(AK(n)) ∼AC AK(n) for ϕ ∈ Aut(F2 ) defined by ϕ(x) = x, ϕ(y) = Y . 12 D. PANTELEEV AND A. USHAKOV Proof. The pair (ϕ(xyxY XY ), ϕ(xk Y k+1 )) = (xY xyXy, xk y k+1 ) can be modified as follows: ∼AC2 ∼AC3 ∼ACM ∼AC3 ∼ACM ∼AC3 ∼AC2 ∼ACM ∼AC3 ∼AC2 ∼ACM ∼AC3 ∼ACM ∼AC3 ∼ACM ∼AC3 (xY xyXy, Y k+1 X k ) (xyXyxY, Y k+1 X k ) (xyXyxY, c−1 xyXy k+1 xY k+2 c), c = y k+1 (xyXyxY, xyXy k+1 xY k+2 ) (c−1 xyXyxY Y Xyc, xyXy k+1 xY k+2 ), c = y k+2 XyxY (xyXyxY Y Xy, xyXy k+1 xY k+2 ) (xyXyxY Y Xy, y k+2 XY k+1 xY X) (xyXyxY Y Xy, c−1 xyXy k XY k c), c = xyXy (xyXyxY Y Xy, xyXy k XY k ) (Y xyyXY xY X, xyXy k XY k ) (c−1 Y xyyXY xY Xc, xyXy k XY k ), c = Y k−1 xY k−1 xY Y Xy (Y xyyXY xY X, xyXy k XY k ) (c−1 xk Y k+1 c, xyXy k XY k ), c = Y k−1 xY k−1 xY Y Xy (xk Y k+1 , xyXy k XY k ) (xk Y k+1 , c−1 xyxY XY c), c = Y k (xk Y k+1 , xyxY XY )  Lemma 3.6. ϕ(AK(n)) ∼AC AK(n) for ϕ ∈ Aut(F2 ) defined by ϕ(x) = x, ϕ(y) = yx. Proof. The pair (ϕ(xyxY XY ), ϕ(xk Y k+1 )) = (xyxY XXY, xk−1 (Y X)k Y ) can be modified as follows: = (xyxY XXY, xk−1 (Y X)k Y ) ∼AC3 (Y xyxY XX, xk−1 (Y X)k Y ) ∼AC3 (xxyXY Xy, xk−1 (Y X)k Y ) ∼ACM (xxyXY Xy, c−1 xk−1 yX k−1 yXY c), c = xk−3 (Y X)k Y ∼AC3 (xxyXY Xy, xk−1 yX k−1 yXY ) ∼AC2 (Y xyxY XX, xk−1 yX k−1 yXY ) ∼ACM (c−1 xk Y k+1 c, xk−1 yX k−1 yXY ), c = xyX k−1 yXY Xy ∼AC3 (xk Y k+1 , xk−1 yX k−1 yXY ) ∼AC2 (xk Y k+1 , yxY xk−1 Y X k−1 ) ∼ACM (xk Y k+1 , c−1 xyxY XY c), c = yX k−1 yXY ∼AC3 (xk Y k+1 , xyxY XY )  Proposition 3.7. ϕ(AK(n)) ∼AC AK(n) for any n > 2 and ϕ ∈ Aut(F2 ). Proof. Automorphisms considered in Lemmas 3.4, 3.5 and 3.6 generate Aut(F2 ). Hence the proposition holds for any ϕ ∈ Aut(F2 ).  The next corollary implies that adding automorphism-moves to AC-moves does not increase orbits for AK(n) presentations. ON ANDREWS–CURTIS CONJECTURE 13 Corollary 3.8. If (u, v) ∼AC AK(3), then (ϕ(u), ϕ(v)) ∼AC AK(3) for every ϕ ∈ Aut(F2 ).  It is natural to raise a question if a similar result holds for all balanced presentations of 1. We performed experiments with several randomly generated Miller–Schupp presentations. The results were not always positive, i.e., for some presentations we were unable to prove AC-equivalence to their automorphic images. Conjecture. It is not true that for every (u, v) ∈ B2 and ϕ ∈ Aut(F2 ) (u, v) ∼AC (ϕ(u), ϕ(v)). Note that the conjecture above immediately implies negative answer to ACC. In Table 2 the reader can find particular balanced presentations suspected to satisfy the conjecture above. 4. Canonical forms of presentations For a given relation tuple u ∈ Bn the search space Cu is infinite and no computer procedure can exhaust all of its elements. To reduce the search space one can introduce an equivalence relation ∼ on Cu (or on Fnn ), define efficiently computable representatives N F (u) for equivalence classes, and study the quotient space: Bn / ∼ = {NF(u) | u ∈ Bn }. That way one can achieve compression of the search space as a single element NF(u) representing its (infinite) equivalence class. Clearly, coarser relations on Fnn give better compression. Below we consider two equivalence relations on B2 . Same results hold for Bn with n > 2. The first one (referred to as a cyclic relation here) was used by Casson in a series of unpublished work (according to Bowman–McCaul) and by Bowman–McCaul (who “followed” Casson). The second relation is new and is significantly stronger. 4.1. Cyclic relation. Let ∼ be the transitive closure of the following pairs in F22 : • (u, v) ∼ (v, u), • (u, v) ∼ (u−1 , v), • (u, v) ∼ (u, c−1 vc), where u, v, c are arbitrary words in F2 . We call ∼ a cyclic relation on F22 . To define canonical representatives for the cyclic relation we do the fol−1 lowing. Fix any order on generators, say x1 < x−1 1 < x2 < x2 and denote by < the corresponding shortlex order on F2 and, further, the corresponding lexicographic order on F22 . Let (u, v) ∈ F22 . It is easy to see that taking the least cyclic permutation of u±1 , the least cyclic permutation of v ±1 , and “sorting” the obtained words, produces the least representative of the equivalence class of (u, v), denoted by NF(u, v). Clearly, so-defined normal form is an efficiently computable. 14 D. PANTELEEV AND A. USHAKOV It easily follows from the definition that NF(u, v) ∈ B2 for any (u, v) ∈ B2 . Hence, AC-moves can be naturally defined on B2 / ∼: ν NF(u, v) = (u, v) 7→ NF(ν(u, v)), where ν is an AC-move. The problem with this approach is that computing the cyclic normal form negates applications of the AC3 -move. That can result in the component Cu being broken into subcomponents (i.e., Cu can become disconnected). In particular, Bowman–McCaul implementation (found here http://www.math.utexas.edu/users/sbowman/ac-bfs.tar. gz) does not take the normal form of a pair obtained by an AC3 -move, which completely negates the advantage of using normal forms. As we explain below, ACM-moves can solve this problem. 4.2. Cyclic relation with automorphisms. Define an equivalence relation ∼ on F22 by taking a closure of the following pairs: • • • • (u, v) ∼ (v, u), (u, v) ∼ (u−1 , v), (u, v) ∼ (u, c−1 vc), (u, v) ∼ (ϕ(u), ϕ(v)), where u, v, c are arbitrary words in F2 and ϕ is an arbitrary automorphism in Aut(F2 ). Note that the defined relation makes (u, v) equivalent to (ϕ(u), ϕ(v)) which, in general, is not known to be AC-equivalent to (u, v). Hence, it is possible that an equivalence class of (u, v) contains an element which is not AC-equivalent to (u, v). Nevertheless, the following is true. Proposition 4.1. For every u, v, u0 , v 0 ∈ F2 if • AK(n) ∼AC (u, v), and • (u, v) ∼ (u0 , v 0 ), then AK(n) ∼AC (u0 , v 0 ). Proof. Follows from Corollary 3.8.  Proposition 4.1 allows us to replace the original component C = CAK(3) with its factor C/ ∼ which is much smaller. The problem that taking a normal form of a pair negates AC3 -moves is still relevant if we use the original AC-moves. That is where ACM-moves really help. It follows from Theorem 2.3 that choosing sufficiently large value of the parameter D we can produce any conjugate of u in hx, y | vi. As in Section 4.1, the normal form of the pair (u, v) is defined as the minimal pair in its equivalence class. Below we show that normal forms can be computed efficiently. Our main tool is the following classic result. Theorem (Whitehead theorem, see [17, Proposition 4.20]). Let w1 , . . . , wt , w10 , . . . , wt0 be cyclic words in a free group F such that: w10 = α(w1 ), . . . , wt0 = α(wt ) ON ANDREWS–CURTIS CONJECTURE 15 P 0 P 0 for some α ∈ Aut(F ). If |wk | is minimal among all |α (wk )| for α0 ∈ Aut(F ), then α = τ1 . . . τn , n ≥ 0,P where τ1 , . . . , τn arePWhitehead automorphisms and forP each i the k |τ1 · · · τi (wk )| ≤ k |wk | with Plength 0 strict inequality unless |wk | = |wk |.  Recall [17, Section 1.4] that Whitehead automorphisms are automorphisms of two types: • (length-preserving) automorphisms that permute the letters X ± ; • automorphisms that for some fixed “multiplier” a ∈ X ± carry each of the elements x ∈ X into one of x, xa, a−1 x, or a−1 xa. There are exactly 20 Whitehead automorphisms for a free group of rank 2. According to the Whitehead theorem if the total length of a given tuple of cyclic words can be decreased by an application of an automorphism, then it can be decreased by an application of a single Whitehead automorphism. Hence, to compute the normal form of a pair (u, v) we do the following. • First, minimize the total length |u|+|v| of (u, v) by applying 12 nonlength-preserving Whitehead automorphisms while the total length decreases. • Then, construct a set of all equivalent pairs of the least total length by applying all automorphisms. • Finally, choose the least cyclic normal form among the pairs of the least length. The procedure described above is efficient except, maybe, the second step, where we construct the set of all pairs of the least total length. Currently there are no theoretical polynomial bounds on the size of that set. Nevertheless, in our computations the maximal size observed was 112 for AK(3) equivalent presentations with |r| ≤ 20 bound. The average size of the set of all pairs of the least total length was 9. 5. Groups with high Dehn function One potential challenge for computer enumeration techniques is described by Bridson in [8] and Lishak in [16]. Both papers use a similar idea based on properties of the following one-relator group: (1) x, y | y −1 x−1 yxy −1 xy = x2 , introduced by Baumslag in [3], satisfying the inequality: (2) Dehn(n) ≥ T ower2 (log2 (n)), first observed in [11]. Lishak constructs a particular sequence of balanced presentations parametrized by n ∈ N: un = (r, wn y −1 ) ∈ B2 , where wn ∈ F (X), satisfying the following conditions. • un is AC-equivalent to the canonical presentation. 16 D. PANTELEEV AND A. USHAKOV • The number of steps required to obtain the canonical presentation is super-exponential in n. The later property comes as a consequence of the inequality (2). Being very curious about possibility that that is the reason why our program fails to find AC-trivialization of AK(3) we tested all words obtained in our experiments. For each word r we attempted to bound the Dehn function of the group hx, y | ri. For that purpose we used D. Holt’s package [14] to identify automatic groups (automatic groups have at most quadratic Dehn functions) that left us with 5356 “perhaps non-automatic” one-relator groups. Among those 1205 we classified as Baumslag–Solitar type presentations, i.e., the presentations with the relation (un )v = um for some u, v ∈ F2 . None of Baumslag–Solitar type presentations satisfied the condition u ∼F v, i.e., no presentations were identified as Baumslag-type presentations (1). Clearly, this is a heuristic approach and we can not guarantee that our list of presentations does not contain Baumslag groups, as isomorphism problem for one-relator groups is not known to be decidable/undecidable. Also, we were unable to classify 4151 remaining presentations. In case someone would like to further investigate this, we have published the obtained lists here: https://github.com/stevens-crag/ak3_types. In light of these heuristic results it seems to be a very interesting computational problem to classify short one-relator groups hx, y | ri with |r| ≤ 20. Find precise upper bounds on their Dehn functions. Conjecture. Baumslag’s group x, y | y −1 x−1 yxy −1 xy = x2 has the highest Dehn function among all one-relator groups. 6. Results The described algorithms were tested on several known potential counterexamples. Our attention was mainly focused on AK(3) and Miller– Schupp presentations. To test performance and compare with other experimental results we also ran our programs on AK(2) and other presentations that are known to be AC-equivalent to the canonical presentation. As we already mentioned in Section 2.4, we set a bound L on the length on the conjugates obtained during harvest phase. We also set a limit on the total length of pairs to be 2L + 2. Notice that we need to do that as taking a normal form described in Section 4.2 can increase length of one of the words beyond L (which is allowed in our implementation). Experiments were run on a machine with two 8-core 3.1 Ghz Intel Xeon CPU E5-2687W and 64 GB RAM. 6.1. Enumeration of AK(3)-equivalent presentations. As shown in Section 3, automorphism-moves can be used together with ACM-moves when applied to AK(3)-equivalent presentations. In particular, one can use normal forms from Section 4.2 to compress the array of stored presentations. Table 1 shows dynamics of growth of a component of CAK(3) constructed by ON ANDREWS–CURTIS CONJECTURE 17 our program for different values of L. Each cell in Table 1 corresponds to a value L and a value T and presents the number of pairs of the total length equal to T constructed by the program with the single-word-bound L. T\L 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 10 4 10 70 64 220 98 240 10 20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 4 10 70 86 416 392 764 442 746 438 112 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 12 4 10 70 86 454 398 1382 522 1624 570 1462 42 110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13 4 10 70 86 458 590 2854 2004 3870 2812 4474 3400 4350 4306 710 52 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14 4 10 70 86 458 590 3226 2082 8334 3714 9194 3858 11246 5384 13548 494 1652 2 0 0 0 0 0 0 0 0 0 0 0 0 15 4 10 70 86 458 590 3226 3352 16948 12288 21678 12978 22422 17930 28176 26008 30934 20430 5854 326 0 0 0 0 0 0 0 0 0 0 16 4 10 70 86 458 590 3226 3352 19666 12584 41492 15458 42550 19668 51590 27874 77162 24146 62178 3338 6314 62 0 0 0 0 0 0 0 0 17 4 10 70 86 458 590 3226 3356 19690 23174 101544 61100 102262 62874 96714 76930 123178 128556 159086 122164 151550 128556 22772 1848 0 0 0 0 0 0 18 4 10 70 86 458 590 3226 3356 19690 23174 128356 64686 236860 83902 196098 83864 230774 138478 368336 130302 353810 150518 374246 19030 51496 522 0 0 0 0 19 4 10 70 86 458 590 3226 3356 19692 23188 128380 150264 631000 375818 538380 289920 445036 355754 546680 597064 730650 538278 872784 762768 1016332 848998 209668 19332 0 0 20 4 10 70 86 458 590 3226 3356 19692 23192 128388 150276 843778 394172 1269016 364040 953378 405746 1041462 639362 1758270 585132 1519374 813708 2112918 946260 2414958 120852 270942 12062 Table 1. Each cell shows the number of pairs AC-equivalent to AK(3) of total length T obtained by the program when run with the length bound L. Highlighted cells do not increase when L is increased. It took our program 10 days to finish enumeration with the bound L = 20, consuming 207 days of CPU time. The running time with the bound L = 21 is expected to be 60 days. We decided not to proceed beyond the value L = 20. Memory usage during the experiments was moderate and never exceeded 8Gb. CPU time is the main obstacle. However, we can notice that the numbers in rows of Table 1 stabilize, at least for values T = 13, . . . , 20. For instance, we can conjecture that the number of normal forms of AK(3)equivalent presentations of total length 20 or less is 3356 and there is no canonical one among them. 6.2. Old non-counterexamples. We also tested our program on some balanced presentations that were eliminated from the list of potential counterexamples before us. Our program trivializes any of them almost immediately (in less than 10 seconds on a single computational core) in less than 5 ACM-moves. 18 D. PANTELEEV AND A. USHAKOV • AK(2): (x2 y −3 , xyx(yxy)−1 ) ∼AC (x, xyx−1 yxy −3 ) ∼AC (x, y) • Gordon presentation (x−1 yx2 y −1 : xy 3 x−1 y −4 ) ∼AC (xyx−1 y −2 , x) ∼AC (x, y), also considered in [6]. 6.3. Miller–Schupp type presentations. We analyzed several randomly generated Miller–Schupp presentations: x, y | x−1 y 2 x = y 3 , x = w , where w has exponent sum 0 on x. We attempted to trivialize them or show AC-equivalence with their automorphic images. Both tasks were dealt with different success. Table 2 contains pairs (u, v) for which the program failed to prove equivalence (u, v) ∼AC (ϕ(u), ϕ(v)) for ϕ ∈ Aut(F2 ) defined by y → y −1 , y → yx and x → y, y → x. (In particular, we could not trivialize the corresponding presentations.) Table 3 contains Miller-Schupp type presentations for which the program proved automorphic equivalence (u, v) ∼AC (ϕ(u), ϕ(v)) for any ϕ ∈ Aut(F2 ), but was not able to trivialize them. Table 4 contains trivializable Miller-Schupp presentations. The purpose of Tables 2, 3, and 4 is to provide reference for future experiments. (xyyyXYY,xxxyXYXY) (xyyyXYY,xxxYXXyXXY) (xyyyXYY,xxxyxyXXXy) (xyyyXYY,xxxxyXyXXY) (xyyyXYY,xxxyXyXXXy) (xyyyXYY,xxxYxyXXXY) (xyyyXYY,xxxxYXyXXY) (xyyyXYY,xxxxyXXyXY) (xyyyXYY,xxxyxYXXXY) (xyyyXYY,xxxyXXYXXy) (xyyyXYY,xxxYXyXy) (xyyyXYY,xxxxYXyXXy) (xyyyXYY,xxxxYXYXXY) (xyyyXYY,xxxxyXXyXy) (xyyyXYY,xxxxYXXYXY) (xyyyXYY,xxxxYXXyXy) (xyyyXYY,xxxyxYXXXy) (xyyyXYY,xxxxYXYXXy) (xyyyXYY,xxxxyXXyXy) (xyyyXYY,xxxxyXyXXy) (xyyyXYY,xxxYxyXXXy) (xyyyXYY,xxxxyXXYXy) (xyyyXYY,xxxxyXYXXY) (xyyyXYY,xxxyXyXXXY) (xyyyXYY,xxxxyXXYXY) (xyyyXYY,xxxxYXXYXy) (xyyyXYY,xxxxYXXyXY) (xyyyXYY,xxxyxyXXXY) (xyyyXYY,xxxxyXYXXy) Table 2. Miller-Schupp pairs (u, v) with unknown equivalence (u, v) ∼AC (ϕ(u), ϕ(v)) for ϕ ∈ Aut(F2 ). (xxxyXXY,xyyyyXYYY) (xxxyXXY,xxyyyXYY) (xxxYXXy,xyyyxYYYY) (xxxYXXy,xxYYxyyy) (xyyyXYY,xxxyXyXy) (xyyyXYY,xxxyXYXy) (xxxyXXY,xyyyXYYYY) (xxxYXXy,xxYYYXyy) (xyyyXYY,xxxxYXXXY) (xyyyXYY,xxxyyXXy) (xxxyXXY,xxyyxYYY) (xyyyXYY,xxxyyXXY) (xyyyXYY,xxxyXyXY) (xxxyXXY,xyyyyxYYY) (xyyyXYY,xxxxyXXXy) (xyyyXYY,xxxYXyXY) Table 3. Miller-Schupp pairs (u, v) with equivalence (u, v) ∼AC (ϕ(u), ϕ(v)) for ϕ ∈ Aut(F2 ), but not known if trivializable. (XyyxYYY,xxYYYXYxYXYY) (XyyxYYY,xxYXyXyyxyy) (XyyxYYY,xyxYXyy) (XyyxYYY,xyxYYXyyyyyy) (XyyxYYY,xxyyyXYYXyxY) (XyyxYYY,xxyyyXYxYXYY) (XyyxYYY,xxYYXYXYXyy) (XyyxYYY,xyXyyxYXyyxY) (XyyxYYY,xxYXyxyyyXY) (XyyxYYY,xyxYYYYYYXy) (XyyxYYY,xyyxYYYXYYY) (XyyxYYY,xyyyXyyXyy) Table 4. Trivializable Miller-Schupp presentations. ON ANDREWS–CURTIS CONJECTURE 19 7. Conclusion Despite a lot of effort, we were unable to disprove any new Akbulut– Kurby type presentations. In fact, the numbers in Table 1 rows stabilize as the value of the parameter L increases, suggesting that the AC-equivalence class of AK(3) does not contain the canonical presentation, thus supporting a common opinion that ACC does not hold. Appendix A. Used ACM-moves justification In this section we prove the one-relator groups identities used in lemmas 3.4, 3.5 and 3.6 for the ACM moves. Every proof demonstrates that c−1 uc(u0 )−1 = 1 in hx, y | vi. A.1. Used in lemma 3.4. c = xyx, u = xk Y k+1 , v = xyxY XY , u0 = y k X K+1 : XY X · xk (Y k+1 · xyx · xk+1 )Y k =XY X(xk · xyx · Y K ) (Y xyx = xy) =XY Xxyx (xyxY = yx) =1 A.2. Used in lemma 3.5. u = xyXy k+1 xY k+2 , v = xyXyxY , c = y k+1 , u0 = Y k+1 X k : (Y k+1 ) · xyXy k+1 x(Y k+2 · y k+1 ) · xk (y k+1 ) = (xk+1 yXy k+1 )x · Y =(xk yXy k ) · xY = . . . = yXxY = 1 u = xyXyxY Y Xy, v = xyXy k+1 xY k+2 , c = y k+2 XyxY , u0 = xyXyxY : yXY xY k+2 · xyXyxY Y X(y · y k+2 XyxY · yXY xY )X =yXY (xY k+2 xyXy)xY Y X · y k+2 X = yXY · Y k · xY (Y Xy k+2 X) =(yX)Y k+1 (xY · Xy k+1 ) = Y k+1 · y k+1 = 1 u = xyXy k XY k , v = xyXyxY Y Xy, c = xyXy, u0 = y k+2 XY k+1 xY X: (Y xY X) · (xyXy k )XY k · xyXy · xyXy k+1 x(Y k+2 ) =XY k xy(XyxyXy k+1 )x · Y 3 = X(Y k xy · y)yXy k · xY 3 =X · Y k−1 xy(Xyx · yXy k )xY 3 = X(Y k−1 xy · y)yXy k−1 · xY 3 =Xxy · yyX · xY 3 = 1 20 D. PANTELEEV AND A. USHAKOV u = xk Y k+1 , v = xyXy k XY k , c = Y k−1 xY k−1 xY Y Xy, u0 = Y xyyXY xY X: (Y xyyX)y k−1 Xy k−1 · xk Y k+1 · Y k−1 xY k−1 xY Y Xy ·xyXy(xY Y Xy) = (y k−1 X)y k−1 xk Y 2k xY k−1 xY Y Xy(xyXy) =(y k · y k−1 )xk Y 2k xY k−1 xY Y X(y) =y k x(Xy k · xk )Y 2k xY k−1 xY Y X (xyXy k X = y k ) (shift) =y k x · y(Xy k · xk−1 )Y 2k xY k−1 xY Y X ... (Xy k x = yXy k ) =y k x · y k X(y k · Y 2k )xY k−1 xY Y X =y k x(y k X · Y k · x)Y k−1 xY Y X = (y k x) · xY · Y k−1 xY (Y X) =(Xy k · x)Y k xY = (Xy k · x)Y k (xY ) = y k · Y k = 1 u = xyxY XY , v = xk Y k+1 , c = Y k , u0 = y k xY k xY X: (y k · xy)xY XY · Y k · xyX(y k XY k ) = xY X(Y Y k )xyX · y k+1 = xY (X · X k x)yXy k+1 = x(Y · Y k+1 · y)Xy k+1 = . . . = Y k+1 y k+1 A.3. Used in lemma 3.6. u = xk−1 yX k−1 yXY , v = xxyXY Xy, c = xk−3 (Y X)k Y , u0 = xk−1 (Y X)k Y : y(xy)k (X k−3 · xk−1 )yX k−1 yXY · (xk−3 (Y X)k Y · y(xy)k X k−1 ) =y(xy)k · x2 yX k−1 (yXY · X)X = (yx)k yx2 yX k−1 · XX(Y · X) = . . . = yx2 yX k−1 XX · xk Y X = yx2 yXY X = 1 u = xk Y k+1 , v = xk−1 yX k−1 yXY , c = xyX k−1 yXY Xy, u0 = Y xyxY XX: (Y xyxY )xk−1 Y (X · xk )Y k+1 · xyX k−1 yXY Xy · xx(yXY Xy) =(xk−1 Y xk−1 Y k+1 ) · xyX k−1 yXY Xy(xx) = . . . =Y (xk−1 · xyX k−1 yXY )Xy = Y · x · Xy = 1 u = xyxY XY , v = xk Y k+1 , c = yX k−1 yXY , u0 = yxY xk−1 Y X k−1 : (yxY xk−1 Y ) · xyxY X(Y · y)X k−1 yXY · xk−1 (yX k−1 yXY ) =(x)yxY X k yX(Y xk−1 ) = (y)xY X k yX · (y k ) =(xY )X k y(X · xk ) = X k y · y k = 1 ON ANDREWS–CURTIS CONJECTURE 21 References [1] J. J. Andrews and M. L. Curtis. Free groups and handlebodies. Proceedings of the American Mathematical Society, 16(2):192–195, 1965. [2] J. J. Andrews and M. L. Curtis. Extended Nielsen operations in free groups. Amer. Math. Month., 73:21–28, 1966. [3] G. Baumslag. A non-cyclic one-relator group all of whose finite factor groups are cyclic. J. Australian Math. Soc., 10:497–498, 1969. [4] W. Boone. The word problem. Proc. Natl. Acad. Sci., 44:1061–1065, 1958. [5] A. Borovik, A. Lubotzky, and A. Myasnikov. The finitary andrews-curtis conjecture. In Infinite Groups: Geometric, Combinatorial and Dynamical Aspects, volume 248 of Progress in Mathematics, pages 15–30. Birkhuser Basel, 2005. [6] R. Bowman and S. McCaul. Fast searching for andrews-curtis trivializations. Experiment. Math., 15(2):193–198, 2006. [7] N. Brady, T. Riley, and H. Short. The geometry of the word problem for finitely generated groups. Advanced Courses in Mathematics CRM Barcelona. Birkhauser, 2007. [8] M. Bridson. The complexity of balanced presentations and the andrews-curtis conjecture. arXiv preprint arXiv:1504.04187, 2015. [9] R. Burns and O. Macedonska. Balanced presentations of the trivial group. Bull. London Math. Soc., 25:514–526, 1992. [10] S. Gersten and T. Riley. Filling length in finitely presentable groups. Geometriae Dedicata, 92:41–58, 2002. [11] S. M. Gersten. Dehn functions and l1-norms of finite presentations. In Algorithms and Classification in Combinatorial Group Theory, pages 195–225, Berlin, 1992. Springer. [12] D. Gillman and D. Rolfsen. The Zeeman conjecture for standard spines is equivalent to the Poincaré conjecture. Topology, 22(3):315–323, 1983. [13] G. Havas and C. Ramsay. Breadth-first search and the Andrews–Curtis conjecture. Int. J. Algebra Comput., 13(01):61–68, 2003. [14] D. Holt. kbmag2 (version 2.4). Downloaded from http://homepages.warwick.ac. uk/~mareg/download/kbmag2/, December 2000. [15] S. Ivanov. On balanced presentations of the trivial group. Invent. Math., 165:525–549, 2006. [16] B. Lishak. Balanced finite presentations of the trivial group. Preprint. Available at http://arxiv.org/abs/1504.00418, 2015. [17] R. Lyndon and P. Schupp. Combinatorial group theory. Springer, 2015. [18] V. Mazurov and E. Khukhro. Unsolved Problems in Group Theory. The Kourovka Notebook. No. 18. Available at http://arxiv.org/abs/1401.0300, 2014. [19] A. D. Miasnikov. Genetic algorithms and the andrews-curtis conjecture. International Journal of Algebra and Computation, 9:671–686, 1999. [20] P. Morar and A. Ushakov. Search problems in groups and branching processes. Int. J. Algebra Comput., 25:445–480, 2015. [21] A. G. Myasnikov. Extended nielsen transformations and the trivial group. Mat. Zametki, 35:491–495, 1984. [22] A. G. Myasnikov, V. Shpilrain, and A. Ushakov. Non-commutative Cryptography and Complexity of Group-theoretic Problems, chapter 17. Mathematical surveys and monographs. American Mathematical Society, 2011. [23] A. Myropolska. Andrews-Curtis and Nielsen equivalence relations on some infinite groups. Preprint. Available at http://arxiv.org/abs/1304.2668, 2013. [24] P. Novikov. On the algorithmic unsolvability of the word problem in group theory. Proc. Steklov Inst., 44:1–143, 1955. [25] P. E. Schupp. On Dehn’s algorithm and the conjugacy problem. Mathematische Annalen, 178:119–130, 1968. 22 D. PANTELEEV AND A. USHAKOV [26] R. Tarjan and J. van Leeuwen. Worst-case analysis of set union algorithms. J. ACM, 31(2):245–281, March 1984. [27] N. Touikan. A fast algorithm for stallings folding process. International Journal of Algebra and Computation, 16(06):1031–1045, 2006. [28] A. Ushakov. Fundamental search problems in groups. PhD thesis, CUNY/Graduate Center, 2005. [29] P. Wright. Group presentations and formal deformations. Transactions of the American Mathematical Society, 208:161–169, 1975. [30] E. C. Zeeman. On the dunce hat. Topology, 2(4):341–358, 1963. Department of Mathematics, Stevens Institute of Technology, Hoboken, NJ, USA E-mail address: dpantel1,[email protected]
4math.GR
THE NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS arXiv:1802.09658v1 [math.AG] 27 Feb 2018 HAROLD BLUM AND YUCHEN LIU Abstract. We show that in any Q-Gorenstein flat family of klt singularities, normalized volumes are lower semicontinuous with respect to the Zariski topology. A quick consequence is that smooth points have the largest normalized volume among all klt singularities. Using an alternative characterization of K-semistability developed by Li, Liu and Xu, we show that K-semistability is a very generic or empty condition in any Q-Gorenstein flat family of log Fano pairs. 1. Introduction Given an n-dimensional complex klt singularity (x ∈ (X, D)), Chi Li [Li15a] introduced the normalized volume function on the space Valx,X of real valuations of C(X) centered at x. More precisely, for any such valuation v, its normalized volume is defined c x,(X,D) (v) := AX,D (v)n vol(v), where AX,D (v) is the log discrepancy of v with respect as vol to (X, D) according to [JM12, BdFFU15], and vol(v) is the volume of v according to [ELS03]. Then we can define the normalized volume of a klt singularity (x ∈ (X, D)) by c x,(X,D) (v) c X, D) := min vol vol(x, v∈Valx,X c was shown recently in [Blu16]. We also denote where the existence of minimizer of vol c X) := vol(x, c X, 0). vol(x, The normalized volume of a klt singularity x ∈ (X, D) carries interesting information of c X, D) ≤ its geometry and topology. It was shown by the second author and Xu that vol(x, n n and equality holds if and only if (x ∈ X \ Supp(D)) is smooth (see [LiuX17, Theorem A.4] or Theorem 33). By [Xu14] the local algebraic fundamental group π̂1loc (X, x) of a klt singularity x ∈ X is always finite. Moreover, assuming the conjectural finite degree formula of normalized volumes [LiuX17, Conjecture 4.1], the size of π̂1loc (X, x) is bounded c X) (see Remark 37). If X is a Gromov-Hausdorff limit of Kählerfrom above by nn /vol(x, c X) = nn · Θ(x, X) Einstein Fano manifolds, then Li and Xu [LX17] showed that vol(x, where Θ(x, X) is the volume density of a closed point x ∈ X (see [HS16, SS17] for background materials). In this article, it is shown that the normalized volume of a singularity is lower semicontinuous in families. Theorem 1. Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of complex klt singularities over a normal variety T . Then the function t 7→ c vol(σ(t), Xt , Dt ) on T (C) is lower semicontinuous with respect to the Zariski topology. Date: February 28, 2018. 1 2 HAROLD BLUM AND YUCHEN LIU One quick consequence of Theorem 1 is that smooth points have the largest normalized volumes among all klt singularities (see Theorem 33 or [LiuX17, Theorem A.4]). Another natural consequence is that if X is a Gromov-Hausdorff limit of Kähler-Einstein Fano manifolds, then the volume density function x 7→ Θ(x, X) on X(C) is lower semicontinuous in the Zariski topology, which is stronger than being lower semicontinuous in the Euclidean topology mentioned in [SS17] (see Corollary 35). We also state the following natural conjecture on constructibility of normalized volumes of klt singularities (see also [Xu17, Conjecture 4.11]). Conjecture 2. Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of complex klt singularities over a normal variety T . Then the function t 7→ c vol(σ(t), Xt , Dt ) on T (C) is constructible. Verifying the Zariski openness of K-semistability is an important step in the construction of an algebraic moduli space of K-polystable Q-Fano varieties. In a smooth family of Fano manifolds, Odaka [Oda13] and Donaldson [Don15] showed that the locus of fibers admitting Kähler-Einstein metrics (or equivalently, being K-polystable) with discrete automorphism groups is Zariski open. This was generalized by Li, Wang and Xu [LWX14] where they proved the Zariski openness of K-semistability in a Q-Gorenstein flat families of smoothable Q-Fano varieties in their construction of the proper moduli space of smoothable K-polystable Q-Fano varieties (see [SSY16, Oda15] for related results). A common feature is that analytic methods were used essentially in proving these results. Using the alternative characterization of K-semistability by the affine cone construction developed by Li, the second author, and Xu in [Li15b, LL16, LX16], we apply Theorem 1 to prove the following result on weak openness of K-semistability. Unlike the results described in the previous paragraph, our result is proved using purely algebraic methods and hence can be applied to Q-Fano families with non-smoothable fibers (or more generally, families of log Fano pairs). Theorem 3. Let ϕ : (Y, E) → T be a Q-Gorenstein flat family of complex log Fano pairs over a normal base T . If (Yo, Eo ) is log K-semistable for some closed point o ∈ T , then the following statements hold: (1) There exists an intersection U of countably many Zariski open neighborhoods of o, such that (Yt , Et ) is log K-semistable for any closed point t ∈ U. In particular, (Yt , Et ) is log K-semistable for a very general closed point t ∈ T . (2) Denote by η the generic point of T , then the geometric generic fiber (Yη̄ , Eη̄ ) is log K-semistable. (3) Assume Conjecture 2 is true, then such U from (1) can be chosen as a genuine Zariski open neighborhood of o. The following corollary generalizes [Li17, Theorem 4] and follows easily from Theorem 3. Corollary 4. Suppose a complex log Fano pair (Y, E) specially degenerates to a log Ksemistable log Fano pair (Y0 , E0 ), then (Y, E) is also log K-semistable. Our strategy to prove Theorem 1 is to study invariants of ideals instead of invariants of valuations. From Liu’s characterization of normalized volume by normalized multiplicities NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 3 of ideals (see [Liu16, Theorem 27] or Theorem 5), we know c vol(σ(t), Xt , Dt ) = inf lct(Xt , Dt ; a)n · e(a) a where the infimum is taken over all ideals a ⊂ OXt cosupported at σ(t). These ideals are parametrized by a relative Hilbert scheme of X /T with countably many components. Clearly a 7→ lct(Xt , Dt ; a) is lower semicontinuous on the Hilbert scheme, but a 7→ e(a) may only be upper semicontinuous. Thus, it is unclear what semicontinuity properties a 7→ lct(a)n · e(a) may have. To fix this issue, we introduce the normalized colength of singularities ℓc c,k (σ(t), Xt , Dt ) n by taking the infimum of lct(Xt , Dt ; a) · ℓ(Oσ(t),Xt /a) for ideals a satisfying a ⊃ mkσ(t) and ℓ(Oσ(t),Xt /a) ≥ ck n . The normalized colength function behaves better in families since the colength function a 7→ ℓ(Oσ(t),Xt /a) is always locally constant in the Hilbert scheme, so a 7→ lct(Xt , Dt ; a)n · ℓ(Oσ(t),Xt /a) is constructibly lower semicontinuous on the Hilbert scheme. Thus, the properness of Hilbert schemes implies that t 7→ ℓc c,k (σ(t), Xt , Dt ) is constructibly lower semicontinuous on T . Then we prove a key equality between the asymptotic normalized colength ℓd c,∞ (σ(t), Xt , Dt ) and the normalized c volume vol(σ(t), Xt , Dt ) when c is small (see Theorem 12) using local Newton-Okounkov bodies following [Cut13, KK14] (see Lemma 13) and convex geometry (see Appendix A). Then by establishing a uniform approximation of volumes by colengths (see Theorem 16) and generalizing Li’s Izumi and properness estimates [Li15a] to families (see Theorems 21 and 22), we show that the normalized colengh functions uniformly approximate the normalized volume function from above (see Theorem 27). Putting these ingredients together, we get the proof of Theorem 1. This paper is organized as follows. In Section 2, we give the preliminaries including notations, normalized volumes of singularities, and Q-Gorenstein flat families of klt pairs. In Section 3.1, we introduce the concept of normalized colengths of singularities. We show in Theorem 12 that the normalized volume of a klt singularity is the same as its asymptotic normalized colength. The proof of Theorem 12 uses a comparison of colengths and multiplicities established in Lemma 13. In Section 3.2, we study the normalized volumes and normalized colength after algebraically closed field extensions. In Section 4, we establish a uniform approximation of volume of a valuation by colengths of its valuation ideals. In Section 5, we generalize Li’s Izumi and properness estimates to families. The results from Sections 4 and 5 enable us to prove the uniform approximation of normalized volumes by normalized colengths from above in families (see Section 6.1). The proofs of main theorems are presented in Section 6.2. We give applications of our main theorems in Section 6.3. Theorem 33 generalizes the inequality part of [LiuX17, Theorem A.4]. We show that the volume density function on a Gromov-Hausdorff limit of Kähler-Einstein manifolds is lower semicontinuous in the Zariski topology (see Corollary 35). We give an effective upper bound on the degree of finite quasi-étale maps over klt singularities on Gromov-Hausdorff limits of Kähler-Einstein Fano manifolds (see Theorem 36). In Appendix A we provide certain convex geometric results on lattice points counting that are needed in proving Lemma 13. In Appendix B, we provide results on constructbility of Hilbert–Samuel funtions that are needed in proving uniform approximation results in Section 4. 4 HAROLD BLUM AND YUCHEN LIU Acknowledgements. The first author would like to thank his advisor Mircea Mustaţă for numerous useful discussions and his constant support. In addition, he would like to thank Mattias Jonsson, Ilya Smirnov, and Tommaso de Fernex for many useful conversations. The second author would like to thank Chi Li and Chenyang Xu for fruitful discussions. We wish to thank János Kollár, Linquan Ma, Sam Payne, Xiaowei Wang, and Ziquan Zhuang for helpful comments. We are also grateful to Ruixiang Zhang for his help on Proposition 39. 2. Preliminaries 2.1. Notations. In this paper, all varieties are assumed to be irreducible, reduced, and defined over a (not necessarily algebraically closed) field k of characteristic 0. For a variety T over k, we denote the residue field of any scheme-theoretic point t ∈ T by κ(t). Given a morphism π : X → T between varieties over k, we write Xt := X ×T Spec(κ(t)) for the scheme theoretic fiber over t ∈ T . We also denote the geometric fiber of π over t ∈ T by Xt := X ×T Spec(κ(t)). Suppose X is a variety over k and x ∈ X is a k-rational point. Then for any field extension K/k, we denote (xK , XK ) := (x, X) ×Spec(k) Spec(K). Let X be a normal variety over k and D be an effective Q-divisor on X. We say that (X, D) is a Kawamata log terminal (klt) pair if (KX +D) is Q-Cartier and KY −f ∗ (KX +D) has coefficients > −1 on some log resolution f : Y → (X, D). A klt pair (X, D) is called a log Fano pair if in addition X is proper and −(KX + D) is ample. A klt pair (X, D) together with a closed point x ∈ X is called a klt singularity (x ∈ (X, D)). Let (X, D) be a klt pair. For an ideal sheaf a on X, we define the log canonical threshold of a with respect to (X, D) by lct(X, D; a) := inf E AX,D (ordE ) , ordE (a) where the infimum is taken over all prime divisors E on a log resolution f : Y → (X, D). We will often use the notation lct(a) to abbreviate lct(X, D; a) once the klt pair (X, D) is specified. If a is co-supported at a single closed point x ∈ X, we define the Hilbert–Samuel multiplicity of a as ℓ(Ox,X /am ) e(a) := lim m→∞ mn /n! where n := dim(X) and ℓ(Ox,X /am ) denotes the length of Ox,X /am as an Ox,X -module. 2.2. Valuations. Let X be a variety defined over a field k and x ∈ X closed point. By a valuation of the function field K(X), we mean a valuation v : K(X)× → R that is trivial on k. By convention, we set v(0) := +∞. Such a valuation v has center x if v is ≥ 0 on Ox,X and > 0 on the maximal ideal of Ox,X . We write Valx,X for the set of valuations of K(X) with center x. To any valuation v ∈ Valx,X and m ∈ Z>0 there is an associated valuation ideal defined locally by am (v) := {f ∈ OX | v(f ) ≥ m}. Note that am (v) is mx -primary for each m ∈ Z>0 . For an ideal a ⊂ OX and v ∈ Valx,X , we set v(a) := min{v(f ) | f ∈ a · Ox,X } ∈ [0, +∞]. NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 5 2.3. Normalized volumes of singularities. Let k be an algebraically closed field of characteristic 0. For an n-dimensional klt singularity x ∈ (X, D) over k, C. Li [Li15a] c x,(X,D) : Valx,X → R>0 ∪ {+∞}. Recall introduced the normalized volume function vol that for v ∈ Valx,X , ( n c x,(X,D) (v) := AX,D (v) · vol(v) if AX,D (v) < +∞ , vol +∞ if AX,D (v) = +∞ where AX,D (v) and vol(v) denote the log discrepancy and volume of v. As defined in [ELS03], the volume of v is given by vol(v) := lim sup m→∞ ℓ(Ox,X /am (v)) . mn /n! By [ELS03, Mus02, LM09, Cut13], e(am (v)) . m→∞ mn The log discrepancy of v, denoted AX,D (v), is defined in [JM12, BdFFU15] (and [LL16] for the case of klt pairs). The normalized volume of the singularity x ∈ (X, D) is given by vol(v) = lim c X, D) := vol(x, inf v∈Valx,X c x,(X,D) (v). vol When k is uncountable, the above infimum is a minimum [Blu16]. The following characterization of normalized volumes using log canonical thresholds and multiplicities of ideals is crucial in our study. Note that the right hand side of (2.1) was studied by de Fernex, Ein and Mustaţă [dFEM04] when x ∈ X is smooth and D = 0. Theorem 5 ([Liu16, Theorem 27]). With the above notation, we have (2.1) c X, D) = vol(x, inf a : mx -primary lct(X, D; a)n · e(a). The following theorem provides an alternative characterization of K-semistability using the affine cone construction. Here we state the most general form, and special cases can be found in [Li15b, LL16]. Theorem 6 ([LX16, Proposition 4.6]). Let (Y, E) be a log Fano pair of dimension (n − 1) over an algebraically closed field k of characteristic 0. For r ∈ N satisfying L := −r(KY + E) is Cartier, the affine cone X = C(Y, L) is defined by X := Spec ⊕m≥0 H 0 (Y, L⊗m ). Let D be the Q-divisor on X corresponding to E. Denote by x the cone vertex of X. Then c X, D) ≤ r −1 (−KY − E)n−1 , vol(x, and the equality holds if and only if (Y, E) is log K-semistable. 2.4. Q-Gorenstein flat families of klt pairs. In this section, the field k is not assumed to be algebraically closed. Definition 7. 6 HAROLD BLUM AND YUCHEN LIU (a) Given a normal variety T , a Q-Gorenstein flat family of klt pairs over T consists of a surjective flat morphism π : X → T from a variety X , and an effective Q-divisor D on X avoiding codimension 1 singular points of X , such that the following conditions hold: • All fibers Xt are connected, normal and not contained in Supp(D); • KX /T + D is Q-Cartier; • (Xt , Dt ) is a klt pair for any t ∈ T . (b) A Q-Gorenstein flat family of klt pairs π : (X , D) → T together with a section σ : T → X is called a Q-Gorenstein flat family of klt singularities. We denote by σ(t) the unique closed point of Xt lying over σ(t) ∈ Xt . Proposition 8. Let π : (X , D) → T be a Q-Gorenstein flat family of klt pairs over a normal variety T . The following hold. (1) There exists a closed subset Z of X of codimension at least 2, such that Zt has codimension at least 2 in Xt for every t ∈ T , and π : X \ Z → T is a smooth morphism. (2) X is normal. (3) For any morphism f : T ′ → T from a normal variety T ′ to T , the base change πT ′ : (XT ′ , DT ′ ) = (X , D) ×T T ′ → T ′ is a Q-Gorenstein flat family of klt pairs over T ′ , and KXT ′ /T ′ + DT ′ = g ∗ (KX /T + D) where g : XT ′ → X is the base change of f . Proof. (1) Assume π is of relative dimension n. Let Z := {x ∈ X | dimκ(x) ΩX /T ⊗ κ(x) > n}. It is clear that Z is Zariski closed. Since k is of characteristic 0, Zt = Z ∩ Xt is the singular locus of Xt . Hence codimXt Zt ≥ 2 because Xt is normal. (2) From (1) we know that Z is of codimension at least 2 in X , and X \ Z is smooth over T . Thus X \ (Z ∪ π −1 (Tsing )) is regular, and Z ∪ π −1 (Tsing ) has codimension at least 2 in X . So X satisfies property (R1 ). Since π is flat, for any point x ∈ Xt we have depth(Ox,X ) = depth(Ox,Xt ) + depth(Ot,T ) by [Mat80, (21.C) Corollary 1]. Hence it is easy to see that X satisfies property (S2 ) since both Xt and T are normal. Hence X is normal. (3) Let ZT ′ := Z ×T T ′ , and note that XT ′ \ ZT ′ is smooth over T ′ . Since the fibers of πT ′ and T ′ are irreducible, XT ′ is also irreducible. Thus the same argument of (2) implies that XT ′ satisfies both (R1 ) and (S2 ), which means XT ′ is normal. Since π|X \Z is smooth, we know that KXT ′ /T ′ + DT ′ and g ∗ (KX /T + D) are Q-linearly equivalent after restriting to XT ′ \ ZT ′ . Since ZT ′ is of codimension at least 2 in XT ′ , the Q-linear equivalence over  XT ′ \ ZT ′ extends to XT ′ . Thus we finish the proof. Definition 9. (a) Let Y be a normal projective variety. Let E be an effective Qdivisor on Y . We say that (Y, E) is a log Fano pair if (Y, E) is a klt pair and −(KY + E) is Q-Cartier and ample. We say Y is a Q-Fano variety if (Y, 0) is a log Fano pair. (b) Let T be a normal variety. A Q-Gorenstein family of klt pairs ϕ : (Y, E) → T is called a Q-Gorenstein flat family of log Fano pairs if ϕ is proper and −(KY/T + E) is ϕ-ample. NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 7 The following proposition states a well known result on the behaviour of the log canonical threshold in families. See [Amb16, Corollary 1.10] for a similar statement. The proof is omitted because it follows from arguments similar to those in [Amb16]. Proposition 10. Let π : (X , D) → T be a Q-Gorenstein flat family of klt pairs over a normal variety T . Let a be an ideal sheaf of X . Then (1) The function t 7→ lct(Xt , Dt ; at ) on T is constructible; (2) If in addition V (a) is proper over T , then the function t 7→ lct(Xt , Dt ; at ) is lower semicontinuous with respect to the Zariski topology on T . 3. Comparison of normalized volumes and normalized colengths 3.1. Normalized colengths of klt singularities. Definition 11. Let x ∈ (X, D) be a klt singularity over an algebraically closed field k of characteristic 0. Denote its local ring by (R, m) := (Ox,X , mx ). (a) Given constants c ∈ R>0 and k ∈ N, we define the normalized colength of x ∈ (X, D) with respect to c, k as lct(a)n · ℓ(R/a). ℓc inf c,k (x, X, D) := n! · mk ⊂a⊂m ℓ(R/a)≥ck n Note that the assumption mk ⊂ a ⊂ m implies a is an m-primary ideal. (b) Given a constant c ∈ R>0 , we define the asymptotic normalized colength function of x ∈ (X, D) with respect to c as c ℓd c,∞ (x, X, D) := lim inf ℓc,k (x, X, D). k→∞ It is clear that ℓc c,k is an increasing function in c. The main result in this section is the following theorem. Theorem 12. For any klt singularity x ∈ (X, D) over an algebraically closed field characteristic 0, there exists c0 = c0 (x, X, D) > 0 such that c (3.1) ℓd whenever 0 < c ≤ c0 . c,∞ (x, X, D) = vol(x, X, D) k of Proof. We first show the “≤” direction. Let us take a sequence of valuations {vi }i∈N such c i ) = vol(x, c X, D). We may rescale vi so that vi (m) = 1 for any i. Since that limi→∞ vol(v c i )}i∈N are bounded from above, by [Li15a, Theorem 1.1] we know that there exists {vol(v C1 > 0 such that AX,D (vi ) ≤ C1 for any i ∈ N. Then by Li’s Izumi type inequality [Li15a, Theorem 3.1], there exists C2 > 0 such that ordm (f ) ≤ vi (f ) ≤ C2 ordm (f ) for any i ∈ N and any f ∈ R. As a result, we have mk ⊂ ak (vi ) ⊂ m⌈k/C2 ⌉ for any i, k ∈ N. Thus e(m) n e(m) ℓ(R/ak (vi )) ≥ ℓ(R/m⌈k/C2 ⌉ ) ∼ n!C n k . Let us take c0 = 2n!C n , then for k ≫ 1 we have 2 2 ℓ(R/ak (vi )) ≥ c0 k n for any i ∈ N. Therefore, for any i ∈ N we have n n c ℓ[ c0 ,∞ (x, X, D) ≤ n! lim inf lct(ak (vi )) ℓ(R/ak (vi )) = lct(a• (vi )) vol(vi ) ≤ vol(vi ). k→∞ In the last inequality we use lct(a• (vi )) ≤ AX,D (vi ) as in the proof of [Liu16, Theorem c c 27]. Thus ℓ[ c0 ,∞ (x, X, D) ≤ limi→∞ vol(vi ) = vol(x, X, D). This finishes the proof of the “≤” direction. 8 HAROLD BLUM AND YUCHEN LIU c For the “≥” direction, we will show that ℓd c,∞ (x, X, D) ≥ vol(x, X, D) for any c > 0. By a logarithmic version of the Izumi type estimate [Li15a, Theorem 3.1], there exists a constant c1 = c1 (x, X, D) > 0 such that v(f ) ≤ c1 AX,D (v)ordm (f ) for any valuation v ∈ Valx,X and any function f ∈ R. For any m-primary ideal a, there exists a divisorial valuation v0 ∈ Valx,X computing lct(a) by [Liu16, Lemma 26]. Hence we have the following Skoda type estimate: lct(a) = AX,D (v0 ) AX,D (v0 ) 1 ≥ = . v0 (a) c1 AX,D (v0 )ordm (a) c1 ordm (a) Let 0 < δ < 1 be a positive number. If a 6⊂ m⌈δk⌉ and ℓ(R/a) ≥ ck n , then lct(a)n · ℓ(R/a) ≥ ck n c ≥ n n. n n c1 (⌈δk⌉ − 1) c1 δ c If we choose δ sufficiently small such that δ n ·cn1 vol(x, X, D) ≤ n!c, then for any m-primary k ⌈δk⌉ n ideal a satisfying m ⊂ a 6⊂ m and ℓ(R/a) ≥ ck we have Thus it suffices to show c n! · lct(a) · ℓ(R/a) ≥ vol(x, X, D). c vol(x, X, D) ≤ n! · lim inf inf k→∞ mk ⊂a⊂m⌈δk⌉ ℓ(R/a)≥ck n lctn (a)ℓ(R/a). By Lemma 13, we know that for any ǫ > 0 there exists k0 = k0 (δ, ǫ, (R, m)) such that for any k ≥ k0 we have n! · inf mk ⊂a⊂m⌈δk⌉ lctn (a)ℓ(R/a) ≥ (1 − ǫ) Hence the proof is finished. inf mk ⊂a⊂m⌈δk⌉ c X, D). lct(a)n e(a) ≥ (1 − ǫ)vol(x,  The following result on comparison between colengths and multiplicities is crucial in the proof of Theorem 12. Note that Lemma 13 is a special case of Lech’s inequality [Lec60, Theorem 3] when R is a regular local ring. Lemma 13. Let (R, m) be an n-dimensional analytically irreducible Noetherian local domain. Assume that the residue field R/m is algebraically closed. Then for any positive numbers δ, ǫ ∈ (0, 1), there exists k0 = k0 (δ, ǫ, (R, m)) such that for any k ≥ k0 and any ideal mk ⊂ a ⊂ m⌈δk⌉ , we have n! · ℓ(R/a) ≥ (1 − ǫ)e(a). Proof. By [KK14, 7.8] and [Cut13, Section 4], R admits a good valuation ν : R → Zn for some total order on Zn . Let S := ν(R \ {0}) ⊂ Nn and C(S) be the closed convex hull of S. Then we know that • C(S) is a strongly convex cone; • There exists a linear functional ξ : Rn → R such that C(S) \ {0} ⊂ ξ>0 ; • There exists r0 ≥ 1 such that for any f ∈ R \ {0}, we have (3.2) ordm (f ) ≤ ξ(ν(f )) ≤ r0 ordm (f ). NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 9 Suppose a is an ideal satisfying mk ⊂ a ⊂ m⌈δk⌉ . Then we have ν(mk ) ⊂ ν(a) ⊂ ν(m⌈δk⌉ ). By (3.2), we know that S ∩ ξ≥r0 k ⊂ ν(a) ⊂ S ∩ ξ≥δk . Similarly, we have S ∩ ξ≥r0 ik ⊂ ν(ai ) ⊂ S ∩ ξ≥δik for any positive integer i. Let us define a semigroup Γ ⊂ Nn+1 as follows: Γ := {(α, m) ∈ Nn × N : x ∈ S ∩ ξ≤2r0 m }. For any m ∈ N, denote by Γm := {α ∈ Nn : (α, m) ∈ Γ}. It is easy to see Γ satisfies [LM09, (2.3-5)], thus [LM09, Proposition 2.1] implies #Γm lim = vol(∆), m→∞ mn where ∆ := ∆(Γ) is a convex body in Rn defined in [LM09, Section 2.1]. It is easy to see that ∆ = C(S) ∩ ξ≤2r0 . Let us define Γ(k) := {(α, i) ∈ Nn × N : (α, ik) ∈ Γ}. Then we know that ∆(k) := ∆(Γ(k) ) = k∆. For an ideal a and k ∈ N satisfying mk ⊂ a ⊂ m⌈δk⌉ , we define (k) Γ(k) : α ∈ ν(ai )}. a := {(α, i) ∈ Γ (k) (k) Then it is clear that Γa also satisfies [LM09, (2.3-5)]. Since ν(ai ) = (S ∩ ξ>2r0 ik ) ∪ Γa,i (k) (k) and R/m is algebraically closed, we have ℓ(R/ai ) = #(Γi \ Γa,i ) because ν has onedimensional leaves. Again by [LM09, Proposition 2.11], we have (k) (k) #(Γi \ Γa,i ) ℓ(R/ai ) = lim = vol(∆(k) ) − vol(∆(k) n!e(a) = lim a ), n n i→∞ i→∞ i i (k) (k) (k) (k) where ∆a := ∆(Γa ). Since Γa,i ⊂ ν(ai ) ⊂ ξ≥δik , we know that ∆a ⊂ ξ≥δk . Denote by (k) ∆′ := C(S) ∩ ξ<δ , then it is clear that ∆a ⊂ k(∆ \ ∆′ ). On the other hand, (k) (k) n ℓ(R/a) = #(Γ1 \ Γa,1 ) ≥ #Γk − #(∆(k) a ∩ Z ). (k) Denote by ∆a,k := k1 ∆a , then ∆a,k ⊂ ∆ \ ∆′ . Since vol(∆a,k ) ≤ vol(∆) − vol(∆′ ), there exists positive numbers ǫ1 , ǫ2 depending only on ∆ and ∆′ such that  ǫ2 ǫ1  vol(∆) − . (3.3) vol(∆a,k ) ≤ vol(∆) − vol(∆′ ) ≤ 1 − ǫ ǫ k ⌈δk⌉ Let us pick k0 such that for any k ≥ k0 and any m ⊂ a ⊂ m , we have (k) #(∆a ∩ Zn ) #Γk ≥ (1 − ǫ )vol(∆), ≤ vol(∆a,k ) + ǫ2 . 1 kn kn Here the second inequality is guaranteed by applying Proposition 39 to ∆a,k as a sub convex body of a fixed convex body ∆. Thus (k) #Γk #(∆a ∩ Zn ) ℓ(R/a) − (1 − ǫ)n!e(a) ≥ n − − (1 − ǫ)(vol(∆) − vol(∆a,k )) kn k kn ≥ (1 − ǫ1 )vol(∆) − vol(∆a,k ) − ǫ2 − (1 − ǫ)(vol(∆) − vol(∆a,k )) = (ǫ − ǫ1 )vol(∆) − ǫ(∆a,k ) − ǫ2 ≥ 0. 10 HAROLD BLUM AND YUCHEN LIU Here the last inequality follows from (3.3). Hence we finish the proof.  3.2. Normalized volumes under field extensions. In the rest of this section, we use Hilbert schemes to describe normalized volumes of singularities after a field extension K/k. Let (X, D) be a klt pair over k and x ∈ X be a k-rational point. Let Zk := Spec(Ox,X /mkx,X ) denote the k-th thickening of x. Consider the Hilbert scheme Hk,d := Hilbd (Zk /k). For any field extension K/k we know that Hk,d(K) parametrizes ideal sheaves c of XK satisfying c ⊃ mkxK ,XK and ℓ(OxK ,XK /c) = d. In particular, any scheme-theoretic point h ∈ Hk,d corresponds to an ideal b of Oxκ(h) ,Xκ(h) satisfying those two conditions, and we denote by h = [b]. Proposition 14. Let k be a field of characteristic 0. Let (X, D) be a klt pair over k. Let x ∈ X be a k-rational point. Then (1) For any field extension K/k with K algebraically closed, we have ℓc c,k (xK , XK , DK ) = n! · inf d≥ck n , [b]∈Hk,d d · lct(Xκ([b]) , Dκ([b]) ; b)n . (2) With the assumption of (1), we have c K , XK , DK ) = vol(x c k̄ , Xk̄ , Dk̄ ). vol(x Proof. (1) We first prove the “≥” direction. By definition, ℓbc,k (xK , XK , DK ) is the infimum of n! · lct(XK , DK ; c)n ℓ(OXK /c) where c is an ideal on XK satisfying mkxK ⊂ c ⊂ mxK and ℓ(OXK /c) =: d ≥ ck n . Hence [c] represents a point in Hk,d(K). Suppose [c] is lying over a scheme-theoretic point [b] ∈ Hk,d , then it is clear that (XK , DK , c) ∼ = (Xκ([b]), Dκ([b]) , b) ×Spec(κ([b])) Spec(K). Hence lct(XK , DK ; c) = lct(Xκ([b]) , Dκ([b]); b), and the “≥” direction is proved. Next we prove the “≤” direction. By Proposition 10, we know that the function [b] 7→ cl lct(Xκ([b]) , Dκ([b]) ; b) on Hk,d is constructible and lower semicontinuous. Denote by Hk,d the set of closed points in Hk,d. Since the set of closed points are dense in any stratum of Hk,d with respect to the lct function, we have the following equality: n! · inf d≥ck n , [b]∈Hk,d d · lct(Xκ([b]) , Dκ([b]) ; b)n = n! · inf cl d≥ck n , [b]∈Hk,d d · lct(Xκ([b]) , Dκ([b]) ; b)n cl Any [b] ∈ Hk,d satisfies that κ([b]) is an algebraic extension of k. Since K is algebraically closed, κ([b]) can be embedded into K as a subfield. Hence there exists a point [c] ∈ Hk,d (K) lying over [b]. Thus similar arguments implies that lct(XK , DK ; c) = lct(Xκ([b]) , Dκ([b]) ; b), and the “≤” direction is proved. c (2) From (1) we know that ℓc c,k (xK , XK , DK ) = ℓc,k (xk̄ , Xk̄ , Dk̄ ) for any c, k. Hence it follows from Theorem 12.  The following corollary is well-known to experts. We present a proof here using normalized volumes. Corollary 15. Let (Y, E) be a log Fano pair over a field k of characteristic 0. The following are equivalent: (i) (Yk̄ , Ek̄ ) is log K-semistable; (ii) (YK , EK ) is log K-semistable for some field extension K/k with K = K; NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 11 (iii) (YK , EK ) is log K-semistable for any field extension K/k with K = K. We say that (Y, E) is geometrically log K-semistable if one (or all) of these conditions holds. Proof. Let us take the affine cone X = C(Y, L) with L = −r(KY + E) Cartier. Let D be the Q-divisor on X corresponding to E. Denote byx ∈ X the cone vertex of X. Let K/k be a field extension with K = K. Then Theorem 6 implies that (YK , EK ) is log c K , XK , DK ) = r −1 (−KY − E)n−1 . Hence the corollary is K-semistable if and only if vol(x a consequence of Proposition 14 (2).  We finish this section with a natural speculation. Suppose x ∈ (X, D) is a klt singularity over a field k of characteristic zero that is not necessarily algebraically closed. The definition of normalized volume of singularities extend verbatimly to x ∈ (X, D) which c X, D). Then we expect vol(x, c X, D) = vol(x c k̄ , Xk̄ , Dk̄ ), i.e. we also denote by vol(x, normalized volumes are stable under base change to algebraic closures. Such a speculation should be a consequence of the Stable Degeneration Conjecture (SDC) stated in [Li15a, c Conjecture 7.1] and [LX17, Conjecture 1.2] which roughly says that a vol-minimizing valuation vmin over xk̄ ∈ (Xk̄ , Dk̄ ) is unique and quasi-monomial, so vmin is invariant under the action of Gal(k̄/k) and hence has the same normalized volume as its restriction to x ∈ (X, D). 4. Uniform approximation of volumes by colengths In this section, we prove the following result that gives an approximation of the volume of valuation by the colengths of its valuation ideals. The result is a consequence of arguments in [Blu16, Section 3.4] (which in turn relies on ideas in [ELS03]) and properties of the Hilbert–Samuel function. Theorem 16. Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of klt singularities. Set n = dim(X ) − dim(T ). For every A ∈ R>0 and ǫ > 0, there exists a positive integer N so that the following holds: If t ∈ T and v ∈ Valσ(t),Xt satisfies v(mσ(t) ) = 1 and AXt ,Dt (v) ≤ A, then ℓ(Oσ(t),Xt /am (v)) ≤ vol(v) + ǫ mn /n! for all positive integers m divisible by N. We begin by approximating the volume of a valuation by the multiplicity of its valuation ideals. Proposition 17. Let x ∈ (X, D) be a klt singularity defined over an algebraically closed field k and r a positive integer such that r(KX + D) is Cartier. Fix v ∈ Valx,X satisfying v(mx ) = 1 and AX,D (v) < +∞. (a) If x ∈ Xsing ∪ Supp(D), then for all m ∈ Z>0 we have 1/n e(am (v))1/n ⌈AX,D (v)⌉ e(mx )1/n e (OX (−rD) · JacX +mm x ) ≤ vol(v)1/n + + . m m m 12 HAROLD BLUM AND YUCHEN LIU (b) If x ∈ / Xsing ∪ Supp(D), then for all m ∈ Z>0 we have ⌈AX,D (v)⌉ e(mx )1/n e(am (v))1/n ≤ vol(v)1/n + . m m Proof. Fix v ∈ Valx,X satisfying v(mx ) = 1 and AX,D (v) < +∞. To simplify notation, we set a• := a• (v) and A := ⌈AX,D (v)⌉. By [Blu16, Theorem 7.2], (4.1) (JacX ·OX (−rD))ℓ a(m+A)ℓ ⊂ (am )ℓ for all m, ℓ ∈ Z>0 . Since v(mx ) = 1, we see mm x ⊂ am for all m ∈ Z>0 . As in the proof of [Blu16, Proposition 3.7], it follows from the previous inclusion combined with (4.1) that (4.2) ℓ ℓ (JacX ·OX (−rD) + mm x ) a(m+A)ℓ ⊂ (am ) . for all m ∈ Z>0 . We now apply Teissier’s Minkwoski inequality [Laz04, Example 1.6.9] to the previous inclusion and find that (4.3) 1/n ℓ e(am )1/n ≤ ℓ · e(JacX ·OX (−rD) + mm + e(a(m+A)ℓ )1/n . x ) Dividing both sides of (4.3) by m · ℓ and taking the limit as ℓ → ∞ gives   1/n e(am )1/n e(JacX ·OX (−rD) + mm m+A x ) vol(v)1/n . ≤ + m m m Since mm x ⊂ am for all m ∈ Z>0 , vol(v) ≤ e(mx ) and the desired inequality follows. In the case when x ∈ / Xsing ∪ Supp(D), the stronger inequality follows from a similar argument and the observation that (JacX ·OX (−rD)) is trivial in a neighborhood of x.  Before proceeding, we recall basic properties of the Jacobian ideal. Let f : A → B be a flat finite type morphism of Noetherian rings. Assume the induced map Spec(B) → Spec(A) has constant relative dimension d. The relative Jacobian ideal JacB/A is defined as the d-th fitting ideal of ΩB/A . This means, we take a free resolution ψ B ⊕p → B ⊕m → ΩB/A → 0 and view ψ as a matrix with elements in B. Now, JacB/A is given by the (m − d)-minors of ψ. The previous definition gives a local description for JacX/Y when X → Y is a flat finite type morphism of Noetherian schemes. Lemma 18. With the same assumptions as in Theorem 16, there exists a nonempty open set U ⊂ T such that JacXt = JacX /T ·OXt for all t ∈ U. Proof. It is sufficient to consider the case when X and T are affine. Now, choose a free resolution E1 → E0 → ΩX /T . By generic flatness, we may choose a nonempty open set U ⊂ T such that the restriction of E1 → E0 → ΩX /T to Xt is a free resolution of ΩXt /k(t) .  Thus, JacXt = JacX /T ·OXt for all t ∈ U. Proposition 19. With the same assumptions as in Theorem 16, fix a positive integer r such that r(KX /T + D) is Cartier. Then, for every ǫ > 0, there exists M so that the following holds: If t ∈ T satisfies σ(t) ∈ V (JacXt ) ∪ Supp(Dt ), then   e JacXt ·OXt (−rDt ) + mm σ(t) ≤ ǫ. mn for all m ≥ M. NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 13 Proof. To simplify notation, set Z = {t ∈ T |σ(t) ∈ V (JacXt ) ∪ Supp(Dt )}. By the Noetherianity of T , it suffices to prove the following claim: for each ǫ > 0, there exists a e(JacXt +mm ) σ(t) nonempty open set U ⊂ T and a positive integer M such that the ≤ ǫ for all mn m ≥ M and t ∈ Z ∩ U. We proceed to prove the claim. Fix ǫ > 0 and apply Lemma 18 to choose a nonempty open affine set U ⊂ T such that JacXt = JacX /T ·OX for all t ∈ U. Now, by applying Chevalley’s Theorem, we see Z ∩ U is constructible in U. Thus, we may shrink U further so that either (1) U ∩ Z = ∅ or (2) U ∩ Z = U holds. In case (1), the claim is complete. Therefore, we assume (2) holds and shrink U accordingly. Next, choose a nonzero element g ∈ JacX /T ·OX (−rD)(U) such that the restriction of e t = mσ(t) · Rt g to Oσ(t),Xt , denoted gt , is nonzero for all t ∈ U. Set Rt := Oσ(t),Xt /gt and m for each t ∈ U. Note that Rt is n − 1 dimensional for all t ∈ U . Now, m m e(JacXt ·OXt (−rDt ) + mm σ(t) ) ≤ e(gt + mσ(t) ) ≤ n! · ℓ(Oσ(t),Xt /(gt + mσ(t) )) · e(mσ(t) ), m where the first inequality follows from the inclusion JacXt ·OXt (−rDt ) + mm σ(t) ⊂ gt + mσ(t) and the second is precisely Lech’s inequality [Lec60, Theorem 3]. Thus,   e(JacXt ·OXt (−rDt ) + mm em ℓ(Rt /m σ(t) ) t ) (4.4) · e(mσ(t) ). ≤ n! mn mn em for all t ∈ U. By Proposition 42, we may shrink U again so that e(mσ(t) ) and ℓ(Rt /m t )) m n−1 e t ) = O(m ). are constant for all t ∈ U and m ≥ 1. Since dim Rt = n−1, we have ℓ(Rt /m Therefore, there exists an integer M so that   em ℓ(Rt /m t ) n! · e(mσ(t) ) ≤ ǫ mn for all m ≥ M and t ∈ U. This completes the claim.  The following proposition is a consequence of results in Appendix B. Proposition 20. Keep the assumptions and notation in Theorem 16, and fix an integer k ∈ Z>0 . Then, for any ǫ > 0, there exists M ∈ Z>0 so that the following holds: For any point t ∈ T and ideal a ⊂ Oσ(t),Xt satisfying mkσ(t) ⊂ a ⊂ mσ(t) , ℓ(Oσ(t),Xt /am ) ≤ e(a) + ǫ mn /n! for all m ≥ M. Proof. Set d := max{ℓ(Oσ(t),Xt /mkσ(t) ) | t ∈ T }, and consider the union of Hilbert schemes S k H := dm=1 Hilbm (Zk /T ), where Zk = Spec(OX /Iσ(T ) ). Let τ denote the morphism H → T . A point h ∈ H corresponds to the ideal bh = b·OX ×T κ(h) , where b is the universal ideal sheaf on X ×T H. By applying Proposition 42 to the irreducible components of H endowed with reduced scheme structure, we see that the set of functions {Hbh | h ∈ H} is finite. Next, fix ǫ > 0. By the previous paragraph, there exists M ∈ Z>0 so that (4.5) Hbh (m)) ≤ e(bh ) + ǫ mn /n! 14 HAROLD BLUM AND YUCHEN LIU for all m ≥ M. Now, consider a point t ∈ T and an ideal a ⊂ OXt satisfying mkσ(t) ⊂ a ⊂ mσ(t) . Since ℓ(Oσ(t),Xt /a) ≤ ℓ(Oσ(t),Xt /mkσ(t) ) = ℓ(Oσ(t),Xt /mkσ(t) ) ≤ d, there is a map ρ : Spec(κ(t)) → H such that a = bρ(0) · OX ×T κ(t) . Therefore, Ha = Hbρ(0) and (4.5) implies ℓ(Oσ(t),Xt /am ) ≤ e(a) + ǫ mn /n! for all m ≥ M.  We will now deduce Theorem 16 from Propositions 17, 19, and 20. Proof of Theorem 16. To simplify notation, we set Wt = {v ∈ Valσ(t),Xt | v(mσ(t) ) = 1 and AXt ,Dt (v) ≤ A} for each t ∈ T . In order to prove the theorem, it suffices to prove the following claim: for every ǫ > 0, there exists an integer N so that if t ∈ T , then   ℓ(Oσ(t),Xt /am (v)) 1/n ≤ vol(v)1/n + ǫ (m)n /n! for all v ∈ Wt and m ∈ Z>0 divisible by N. Indeed, if v ∈ Wt , then vol(v) ≤ e(mσ(t) ). Since the set {e(mσ(t) ) | t ∈ T } is bounded from above by Proposition 42, the claim implies the conclusion of the theorem. We now fix ǫ > 0 and proceed to bound the latter two terms in Proposition 17.1. First, we apply Proposition 20 to find a positive integer M1 so that A · e(mσ(t) )1/n ≤ ǫ/4 M1 for all t ∈ T . Next, we apply Proposition 19 to find a positive integer M2 so that the following holds: if t ∈ T and σ(t) ∈ V (JacXt ) ∪ Supp(Dt ), then ′ ′ e(JacXt ·OXt (−rDt ) + mσ(t) m )1/n e(JacXt ·OXt (−rDt ) + mσ(t) m )1/n = < ǫ/4. m′ m′ for all m′ ≥ M2 . Now, set m′ := max{M1 , M2 }. Proposition 17 implies that if t ∈ T , then (4.6) e(am′ (v))1/n ≤ vol(v)1/n + ǫ/2 m′ for all v ∈ Wt . ′ Next, note that if t ∈ T and v ∈ Wt , then mm ⊂ am′ (v). Therefore, we may apply σ(t) Proposition 20 to find an integer M such that if t ∈ T and v ∈ Wt , then !1/n ℓ(Oσ(t),Xt /(am′ (v))ℓ ) e(am′ (v))1/n + ǫ/2 ≤ (4.7) (m′ · ℓ)n /n! m′ for all ℓ ≥ M. Thus, if t ∈ T and v ∈ Wt , then   ℓ(Oσ(t),Xt /(am′ ·ℓ (v))) 1/n e(am′ (v))1/n ≤ + ǫ/2 ≤ vol(v) + ǫ (m′ · ℓ)n /n! m′ NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 15 for all ℓ ≥ M, where the first inequality follows from (4.7) combined with the inclusion am′ (v)ℓ ⊂ am′ ·ℓ (v) and the second inequality from (4.6). Therefore, setting N := m′ · M completes the claim.  5. Li’s Izumi and properness estimates in families In this section, we generalize results of [Li15a] to families of klt singularities. These results will be used to prove Theorem 27. Theorem 21 (Izumi-type Estimate). Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of klt singularities over a variety T . There exists a constant K0 > 0 so that the following holds: If t ∈ T and v ∈ Valσ(t),Xt satisfies AXt ,Dt (v) < +∞, then v(g) ≤ K0 · AXt ,Dt (v) · ordσ(t) (g) for all g ∈ Oσ(t),Xt . Theorem 22 (Properness Estimate). Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of klt singularities over a variety T . There exists a constant K1 > 0 so that the following holds: If t ∈ T and v ∈ Valσ(t),Xt satisfies AXt ,Dt (v) < +∞, then K1 · AXt ,Dt (v) ≤ AXt ,Dt (v)n · vol(v). v(mσ(t) ) The proofs of these theorems rely primarily on the result and techniques found in [Li15a]. The main new ingredient can be found in Proposition 25, which is proved using arguments of [BFJ14] and [Li15a, Appendix II]. 5.1. Order functions. Let X be a normal variety defined over an algebraically closed field k and x ∈ X a closed point. For g ∈ Ox,X the order of vanishing of g at x is defined as ordx (g) := max{j ≥ 0 | g ∈ mjx }. If X is smooth at x, then ordx is a valuation of the function field of X. In the singular case, ordx may fail to be a valuation. For example, the inequality ′ ′ ordx (g n+n ) ≥ ordx (g n ) + ordx (g n ) c x , which is may be strict. Following [BFJ14], we consider an alternative function ord defined by c x (g) := lim 1 ordx (g n ) = sup 1 ordx (g n ). ord n→∞ n n n + Let ν : X → X denote the normalized blowup of mx and write ! r X ai Ei , mx · OX + = OX − i=1 where the Ei are prime divisors on X and each ai ∈ Z>0 . The following statement, c x in terms of the which was proved in [BFJ14, Theorem 4.3], gives an interpretation of ord exceptional divisors of ν. 16 HAROLD BLUM AND YUCHEN LIU Proposition 23. For any function g ∈ Ox,X and m ∈ Z>0 , c x (g) = mini=1,...,r ordEi (g) and (1) ord ai c x (g) ≥ m if and only if g ∈ mm . (2) ord x Building upon results in [BFJ14, Section 4.1], we show a comparison between ordx and c ordx . Proposition 24. If there exists a Q-divisor D such that (X, D) is klt pair, then c x (g) ≤ (n + 1)ordx (g) ordx (g) ≤ ord for all g ∈ Ox,X and n = dim(X). c x (g) as a supremum. For the Proof. The first inequality follows from the definition of ord second inequality, assume m := ordx (g) > 0 and note that g ∈ / mm+1 . Since x mm+n ⊂ J ((X, D), mm+n ) = mm+1 · J ((X, D), mxn−1 ) ⊂ mx m+1 , x x x where the first inclusion follows from the fact that (X, D) is klt and the second from c x (g) < m + n, and the . Therefore, ord Skoda’s Theorem [Laz04, 9.6.39], we see g ∈ / mm+n x claim is complete.  5.2. Izumi type estimates. The propositions in the section concern the following setup, which will arise in the proof of Theorem 21. Let x ∈ (X, D) be an affine klt singularity over an algebraically closed field k. Fix a projective compactification X ⊂ X and a resolution of singularities π : Y → X. Assume there exists a very ample line bundle L on Y and the restriction of π to X, denoted π : Y → X, is a log resolution of (X, D, mx ). Proposition 25. There exists a constant C0 so that the following holds: For any closed point y ∈ π −1 (x) and g ∈ Ox,X , we have ordy (π ∗ g) ≤ C0 · ordx (g). P Furthermore, if we write mx · OY = OY (− ri=1 ai Ei ) where each Ei is a prime divisor on Y and ai ∈P Z>0 , then there is a formula for such a constant C0 given in terms of the coefficients of ai Ei , the intersection numbers (Ei · Ej · Ln−2 ) for 1 ≤ i, j ≤ r, and the dimension of X. The proposition is a refined version of [Li15a, Theorem 3.2]. Its proof relies on ideas in [BFJ14] and [Li15a, Appendix II]. Proof. Fix a closed point y ∈ π −1 (x) and an element g ∈ Ox,X . Let ρ : By Y → Y denote the blowup of Y at y with exceptional divisor F0 . We write µ := π ◦ ρ and Fi for the strict transform of Ei . Consider the divisor G given by the closure of {µ∗ g = 0} and write G= r X i=0 e bi Fi + G, where no Fi lies in the support of G̃. Note that b0 = ordy (π ∗ g) and bi := ordEi (g) for 1 ≤ i ≤ r. Since Y → X factors through the normalized blowup of X along mx , NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 17 Proposition 23 implies ordEi (g) bi c x (g). = min ≤ ord 1≤i≤r 1≤i≤r ai ai To simplify notation, we set a := max{ai }. Our goal will be to find a constant C such that b0 ≤ C · bi for all i ∈ {1, . . . , r}. After finding such a C, we will have that c x (g) ≤ (C/a)(n + 1)ordx (g), ordy (π ∗ g) = b0 ≤ (C/a)ord min where the last inequality follows from Proposition 24. Thus, the desired inequality will hold with C0 = (C/a)(n + 1). We now proceed to find such a constant C. Set M = ρ∗ L − (1/2)F0 and note that M is ample [Laz04, Example 5.1.6]. For each i ∈ {1, . . . , r}, we consider r X e · Fi · M n−2 ≤ G · Fi · M n−2 = 0, bj (Fi · Fj · M n−2 ) = G · Fi · M n−2 − G j=0 where the last equality follows from the fact that G is a principal divisor in a neighborhood of π −1 (0). Now, we set cij := (Fi · Fj · M n−2 ). and see X bj cij ≤ −bi cii ≤ bi |cii |. j6=i Note that if i 6= j, then cij 6= 0 if and only if Fi ∩ Fj 6= ∅. When that is the case, bj ≤ (5.1) |cii | bi . cij Computing the cij in terms of intersection numbers on Y , we find that for i, j ∈ {1, . . . , r} ( (Ei · Ej · Ln−2 ) − (1/2)n−2 if 0′ ∈ Ei ∩ Ej cij = . (Ei · Ej · Ln−2 ) otherwise Additionally, ( (1/2)n−2 c0i = 0 if 0′ ∈ Ei . otherwise Now, for each i, j ∈ {1, . . . , r} such that i 6= j and Ei ∩ Ej 6= ∅, we set Cij = |(Ei · Ei · Ln−2 )| + (1/2)n−2 . (Ei · Ej · Ln−2 ) − (1/2)n−2 Note that |cii |/cij ≤ Cij . For each i, we set Ci0 = |(Ei · Ei · Ln−2 )| + (1/2)n−2 . (1/2)n−2 Similarly, note that |cc0iii | ≤ Ci0 if 0′ ∈ Ei . Now, set C ′ = max{1, Cij , Ci0 }. By our choice of C ′ , if i, j ∈ {0, 1, . . . , r} are distinct and Fi ∩ Fj 6= ∅, then bj ≤ C ′ · bi . Now, Zariski’s Main Theorem implies ∪Fi is connected. Therefore, we set C = 1+C ′ +C ′2 +· · · C ′r and conclude b0 ≤ C·bi for all i ∈ {1, . . . , r}.  18 HAROLD BLUM AND YUCHEN LIU Proposition 26. There exists a constant C1 such that the following holds: If v ∈ Valx,X satisfies AX,D (v) < +∞ and y ∈ cY (v), then v(g) ≤ C1 · AX,D (v)ordy (π ∗ g) for all g ∈ Ox,X . Furthermore, if KY − π ∗ (KX + D) has coefficients > −1 + ǫ with 0 < ǫ < 1, then the condition holds when C1 := 1/ǫ. Proof. A proof of the statement can be found in the proof [Li15a, Theorem 3.1] in the case when D = 0. The more general statement follows from a similar argument.  5.3. Proofs of Theorems 21 and 22. Proof of Theorem 21. It is sufficient to prove the theorem in the case when both X and T are affine. We will show that there exists a nonempty open set U ⊂ T and a constant K0 > 0 such that the conclusion of the theorem holds for all t ∈ U. By induction on the dimension of T , the proof will be complete. Fix a (relative) projective compactification π : X → T . Denote the ideal sheaf of σ(T ) in X by Iσ(T ) . Fix a projective resolution of singularities ρ : Y → X such that its restriction to X , denoted ρ : Y → X , is a log resolution of (X , D, Iσ(T ) ). Set µ = π ◦ ρ. We write ! k k X X ∗ ai Ei bi Ei and KY − ρ (KX + D) = Iσ(T ) · OY = OY − i=1 i=1 where each Ei is a prime divisor on Y. We order these prime divisors so that each Ei dominates T if and only if 1 ≤ i ≤ r for some positive integer r ≤ k. By generic smoothness, there exists a nonempty open set U1 ⊂ T such that Yt → Xt is a log resolution of (Xt , Dt , mσ(t) ) for all t ∈ U1 and µ−1 (U1 ) → U1 is smooth. Further shrinking U1 , we may assume Ei,t 6= ∅ if and only if 1 ≤ i ≤ r. Let us assume i ≤ r for the rest of the proof. Now, we have ! r r X X mσ(t) · OYσ(t) = OY − bi Ei,t and KYt − ρt∗ (KXt + Dt ) = ai Ei,t i=1 i=1 for each t ∈ U1 . Note that the divisors Ei |t may have multiple irreducible components. Next, we apply [SPA, Tag 0551] to find and an étale morphism T ′ → U1 , with T ′ irreducible and so that all irreducible components of the generic fiber of E ′ = Ei ×T T ′ → T ′ are geometrically irreducible. Denote by (X ′ , D ′ , Y ′ , Ei′) := (X , D, Y, Ei) ×T T ′ , and η ′ the generic points of T ′ . Write E ′ i,η′ = E ′ i,1,η′ ∪ · · · ∪ E ′ i,mi ,η′ ′ for the decomposition of Ei,η ′ into irreducible components, and set Ei,j equal to the closure ′ ′ of Ei,j,η′ in Y . Applying [SPA, Tag 0559], we may find an open subset U ′ ⊂ T ′ so that each divisor Ei,j,t is geometrically irreducible for all t ∈ U ′ . Further shrinking U ′ , we may assume that the divisors Ei,j,t for 1 ≤ i ≤ r and 1 ≤ j ≤ mi are distinct. We choose U ⊂ T to be a nonempty open subset contained in the image of U ′ in T . We seek to find a constant C0 such that if t ∈ U, then (5.2) ordσ(t) (g) ≤ C0 · ordy (ρt∗ (g)) NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 19 for all g ∈ Oσ(t),Xt and y ∈ ρt−1 (σ(t)). Since (X ′ , D ′, Y ′ )|t′ ∼ = (X , D, Y)|t if t is the ′ image of t , it suffices to establish an inequality of the form (5.2) on the singularities σ(t′ ) ∈ (Xt′′ , Dt′′ ) for t′ ∈ U ′ . Let L be a line bundle on Y such that Lt is very ample for all t ∈ T , and write L′ for the pullback of L to Y ′ . Now, fix 1 ≤ i1 , i2 ≤ r such that bi1 , bi2 > 0. For fixed 1 ≤ j1 ≤ mi1 and 1 ≤ j2 ≤ mi2 , the function that sends U ′ ∋ t′ to (Ei1 ,j1 ,t′ · Ei2 ,j2 ,t′ · L′t′ n−2 ) is constant [Kol96, Lemma VI.2.9]. From our choice of U ′ , we know that Ei,j,t′ is irreducible for any t′ ∈ U ′ . Therefore, we may apply Proposition 25 to find such a constant C0 such that the desired inequality holds for all t′ ∈ U ′ . Next, choose 0 < ǫ < 1 so that ai < 1 − ǫ for all 1 ≤ i ≤ r. Set C1 := 1/ǫ. By Proposition 26, if t ∈ U and v ∈ Valσ(t),Xt , then (5.3) v(g) ≤ C1 · AXt ,Dt ordy (ρt∗ g) for all g ∈ Oσ(t),Xt and y ∈ cYt (v). Combining (5.2) and (5.3), we see that the desired inequality holds when K0 = C0 · C1 .  Proof of Theorem 22. The theorem follows immediately Theorem 21 and [Li15a, Theorem 4.1], as in the proof of [Li15a, Theorem 4.3].  6. Proofs and applications 6.1. A convergence result for normalized colengths. Theorem 27. Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of klt singularities. For every ǫ > 0, there exists a constant c1 > 0 and integer N so that the following holds: if t ∈ T , then c ℓd c,m (σ(t), Xt , Dt ) ≤ vol(σ(t), Xt , Dt ) + ǫ for all m divisible by N and 0 < c ≤ c1 . Before beginning the proof of the previous theorem, we record the following statement. Proposition 28. Let π : (X , D) → T together with a section σ : T → X be a QGorenstein flat family of klt singularities. There exists a constant A so that o n c c Xt , Dt ) = inf vol(v) vol(σ(t), | v ∈ Valσ(t),Xt with v(mσ(t) ) = 1 and AXt ,Dt (v) ≤ A for all t ∈ T . c Xt , Dt ) ≤ B Proof. We first note that there exists a real number B so that vol(σ(t), n n c for all t ∈ T . Indeed, vol(σ(t), Xt , Dt ) ≤ lct(mσ(t) ) e(mσ(t) ) = lct(mσ(t) ) e(mσ(t) ) and the function that sends t ∈ T to lct(mσ(t) )n e(mσ(t) ) takes finitely many values by Propositions 10 and 42. Thus, o n c c c vol(σ(t), Xt , Dt ) = inf vol(v) | v ∈ Valσ(t),Xt with v(mσ(t) ) = 1 and vol(v) ≤ B for all t ∈ T . Next, fix a constant K1 ∈ R>0 satisfying the conclusion of Theorem 22. If v ∈ Valσ(t),Xt c ≤ B, then AXt ,Dt (v) ≤ B/K2 . Therefore, the proposition satisfies v(mσ(t) ) = 1 and vol(v) holds with A := B/K2 .  20 HAROLD BLUM AND YUCHEN LIU Proof of Theorem 27. Fix ε > 0 and a constant A ∈ R>0 satisfying the conclusion of the previous proposition. To simplify notation, set Wt = {v ∈ Valσ(t),Xt | v(mσ(t) ) = 1 and A(Xt ,Dt ) (v) ≤ A} for each t ∈ T . We proceed by proving the following two claims. Claim 1: There exist constants c1 ∈ R>0 and M1 ∈ Z>0 such that the following holds: if t ∈ T , then n ℓd c,m (σ(t), Xt , Dt ) ≤ inf n! · lct(am (v)) ℓ(Oσ(t),X /am (v)) t v∈Wt for all 0 < c < c1 , and m ≥ M1 . Proposition 42 implies there exist constants c1 > 0 and M1 ∈ Z>0 such that n ℓ(Oσ(t),Xt /mm σ(t) ) ≥ m · c1 for all t ∈ T and m ≥ M1 . Now, consider v ∈ Wt for some t ∈ T . Since v(mσ(t) ) = 1, mm ⊂ am (v) for all m ∈ Z>0 . Therefore, ℓ(Oσ(t),Xt /am (v)) ≥ ℓ(Oσ(t),Xt /mm )). The σ(t) σ(t) claim now follows from definition of ℓd c,m (σ(t), Xt , Dt ). Claim 2: There exists M2 ∈ Z>0 such that the following holds: if t ∈ T and v ∈ Wt , then c +ε n! · lct(am (v))n · ℓ(Oσ(t),X /am (v)) ≤ vol(v) t for all integers m divisible by M2 . By Theorem 16, there exists M2 ∈ Z>0 such the following holds: If t ∈ T and v ∈ Wt , then (6.1) ℓ(Oσ(t),Xt /am (v)) ≤ vol(v) + ε/An n m /n! for all integers m divisible by M2 . Note that m · lct(am (v)) ≤ lct(a• (v)) ≤ AXt ,Dt (v). Therefore, multiplying (6.1) by (m · lct(am (v)))n yields the desired result. We return to the proof of the corollary. Fix constants M1 , M2 , and c1 satisfying the conclusions of the Claims 1 and 2. Set M = M1 · M2 . Now, if t ∈ T , m is a postive integer divisible by M, and c satisfies 0 < c < c1 , then n ℓd c,m (σ(t), Xt , Dt ) ≤ inf n! · lct(am (v)) ℓ(Oσ(t),Xt /am (v)) v∈Wt c ≤ inf vol(v) +ε v∈Wt c Xt , Dt ) + ε, = vol(σ(t), where the first (in)equality follows from Claim 1, the second from Claim 2, and the third from our choice of A.  NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 21 6.2. Proofs. The following theorem is a stronger result that implies Theorem 1. Theorem 29. Let π : (X , D) → T together with a section σ : T → X be a Q-Gorenstein flat family of klt singularities over a field k of characteristic 0. Then the function t 7→ c vol(σ(t), Xt , Dt ) on T is lower semicontinuous with respect to the Zariski topology. k Proof. Let Zk → T be the k-th thickening of the section σ(T ), i.e. Zk = SpecT (OX /Iσ(T ) ). k Let dk := maxt∈T ℓ(Oσ(t),Xt /mσ(t),Xt ). For any d ∈ N, denote Hk,d := Hilbd (Zk /T ). Since n Zk is proper over T , we know that Hk,d is also proper over T . Let Hk,d be the normalization of Hk,d. Denote by τk,d : Hk,d → T . After pulling back the universal ideal sheaf on n n X ×T Hk,d over Hk,d to Hk,d , we obtain an ideal sheaf bk,d on X ×T Hk,d . Denote by n n n πk,d : (X ×T Hk,d , D ×T Hk,d ) → Hk,d the projection, then πk,d provides a Q-Gorenstein flat family of klt pairs. n Following the notation of Proposition 14, assume h is scheme-theoretic point of Hk,d lying over [b] ∈ Hk,d . Denote by t = τk,d ([b]) ∈ T . By construction, the ideal sheaf bk,d,h on X ×T Spec(κ(h)) is the pull back of b under the flat base change Spec(κ(h)) → Spec(κ([b])). Hence lct((X , D) ×T Spec(κ(h)); bk,d,h ) = lct((X , D) ×T Spec(κ([b])); b). For simplicity, we abbreviate the above equation to lct(bk,d,h ) = lct(b). Applying Propon sition 10 to the family πk,d and the ideal bk,d implies that the function Φn : Hk,d → R>0 n defined as Φ (h) := lct(bk,d,h ) is constructible and lower semicontinuous with respect to n the Zariski topology on Hk,d . Since lct(bk,d,h ) = lct(b), Φn descends to a function Φ on Hk,d as Φ([b]) := lct(b). Since Hk,d is proper over T , we know that the function φ : T → R>0 defined as φ(t) := n! · nmin Φ([b])n ck ≤d≤dk −1 (t) [b]∈τk,d is constructible and lower semicontinuous with respect to the Zariski topology on T . Then Proposition 14 implies φ(t) = ℓc Thus we conclude that t 7→ c,k (σ(t), Xt , Dt ). c ℓc,k (σ(t), Xt , Dt ) is constructible and lower semicontinuous with respect to the Zariski topology on T . Let us fix ǫ > 0 and a scheme-theoretic point o ∈ T . By Theorem 27, there exist c1 > 0 and N ∈ N such that ǫ c (6.2) vol(σ(t), Xt , Dt ) ≥ ℓc c,k (σ(t), Xt , Dt ) − 2 for any t ∈ T , k divisible by N and 0 < c ≤ c1 . Since t 7→ ℓc c,k (σ(t), Xt , Dt ) is constructibly lower semicontinuous on T , there exists a Zariski open neighborhood U of o such that c (6.3) ℓc c,k (σ(t), Xt , Dt ) ≥ ℓc,k (σ(o), Xo , Do ) for any t ∈ U. By Theorem 12, there exist c0 > 0 and N0 ∈ N such that ǫ c ℓc c,k (σ(o), Xo , Do ) ≥ vol(σ(o), Xo , Do ) − 2 for any 0 < c ≤ c0 and any k ≥ N0 . Let us choose c = min{c0 , c1 } and k = N · N0 . Then combining (6.2), (6.3) and (6.4) yields that (6.4) c c Xt , Dt ) ≥ vol(σ(o), Xo , Do ) − ǫ for any t ∈ U. vol(σ(t), 22 HAROLD BLUM AND YUCHEN LIU The proof is finished.  The following theorem is a stronger result that implies Theorem 3. Theorem 30. Let ϕ : (Y, E) → T be a Q-Gorenstein flat family of log Fano pairs over a field k of characteristic 0. Assume that some geometric fiber (Yo , Eo) is log K-semistable for a point o ∈ T . Then (1) There exists an intersection U of countably many Zariski open neighborhoods of o, such that (Yt , Et) is log K-semistable for any point t ∈ T . If, in addition, k = k̄ is uncountable, then (Yt , Et ) is log K-semistable for a very general closed point t ∈ T . (2) The geometrically log K-semistable locus T K-ss := {t ∈ T : (Yt , Et ) is log K-semistable} is stable under generalization. Proof. (1) For r ∈ N satisfying L = −r(KY/T + E) is Cartier, we define the relative affine cone X of (Y, L) by X := SpecT ⊕m≥0 ϕ∗ (L⊗m ). Assume r is sufficiently large, then it is easy to see that ϕ∗ (L⊗m ) is locally free on T for all m ∈ N. Thus we have Xt ∼ = Spec ⊕m≥0 H 0 (Yt , L⊗m t ) := C(Yt , Lt ). Let D be the Qdivisor on X corresponding to E. By [Kol13, Section 3.1], the projection π : (X , D) → T together with the section of cone vertices σ : T → X is a Q-Gorenstein flat family of klt singularities. Since (Yo , Eo) is K-semistable, Theorem 6 implies c vol(σ(o), Xo , Do ) = r −1 (−KYo − Eo )n−1 . Then by Theorem 29, there exists an intersection U of countably many Zariski open c c Xt , Dt ) ≥ vol(σ(o), Xo , Do) for any t ∈ U. Since neighborhoods of o, such that vol(σ(t), the global volumes of log Fano pairs are constant in Q-Gorenstein flat families, we have c c vol(σ(t), Xt , Dt ) ≥ vol(σ(o), Xo , Do ) = r −1 (−KYo − Eo)n−1 = r −1 (−KYt − Et )n−1 . Then Theorem 6 implies that (Yt , Et ) is K-semistable for any t ∈ U. (2) Let o ∈ T K-ss be a scheme-theoretic point. Then by (1) there exists countably many Zariski open neighborhoods Ui of o such that ∩i Ui ⊂ T K-ss . If t is a generalization of o, then t belongs to all Zariski open neighborhoods of o, so t ∈ T K-ss .  Proof of Theorem 3. It is clear that (1) and (2) follows from Theorem 30. For (3), the constructibility of normalized volumes implies that the set U in the proof of Theorem 30 (1) can be chosen as a Zariski open neighborhood of o. Then the same argument in the proof of Theorem 30 (1) works.  The following corollary is a stronger result that implies Corollary 4. Corollary 31. Let π : (Y, E) → T be a Q-Gorenstein family of complex log Fano pairs. Assume that π is isotrivial over a Zariski open subset U ⊂ T , and (Yo , Eo ) is log Ksemistable for a closed point o ∈ T \ U. Then (Yt , Et ) is log K-semistable for any t ∈ U. NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 23 Proof. Since (Yo , Eo) is log K-semistable, Theorem 30 implies that (Yt , Et ) is log Ksemistable for very general closed point t ∈ T . Hence there exists (hence any) t ∈ U such that (Yt , Et ) is log K-semistable.  Remark 32. If the ACC of normalized volumes (in bounded families) were true, then Conjecture 2 follows by applying Theorem 1. Moreover, we suspect that a much stronger result on discreteness of normalized volumes away from 0 (see also [LiuX17, Question 4.3]) might be true, but we don’t have much evidence yet. 6.3. Applications. In this section we present applications of Theorem 1. The following theorem generalizes the inequality part of [LiuX17, Theorem A.4]. Theorem 33. Let x ∈ (X, D) be a complex klt singularity of dimension n. Let a be the c X, D) ≤ (1 − a)nn . largest coefficient of components of D containing x. Then vol(x, Proof. Suppose Di is the component of D containing x with coefficient D. Let Din be the normalization of Di . By applying Theorem 1 to pr2 : (X×Din , D×Din ) → Din together with c c X, D) the natural diagonal section σ : Din → X × Din , we have that vol(x, X, D) ≤ vol(y, for a very general closed point y ∈ Di . We may pick y to be a smooth point in both X and c X, D) ≤ vol(0, c An , aAn−1 ) where An−1 is a coordinate hyperplane of An . Let D, then vol(x, us take local coordinates (z1 , · · · , zn ) of An such that An−1 = V (z1 ). Then the monomial 1 valuation va on An with weights ((1 − a)−1 , 1, · · · , 1) satisfies AAn (v) = 1−a + (n − 1), 1 n−1 ordva (A ) = 1−a and vol(va ) = (1 − a). Hence c c 0,(An ,aAn−1 ) (va ) = (AAn (v) − aordv (An−1 ))n · vol(va ) = (1 − a)nn . vol(x, X, D) ≤ vol a The proof is finished.  Theorem 34. Let (X, D) be a klt pair over C. Then c (1) The function x 7→ vol(x, X, D) on X(C) is lower semicontinuous with respect to the Zariski topology. (2) Let Z be an irreducible subvariety of X. Then for a very general closed point z ∈ Z we have c X, D) = sup vol(x, c X, D). vol(z, x∈Z In particular, there exists a countable intersection U of non-empty Zariski open c X, D)|U is constant. subsets of Z such that vol(·, Proof. Part (1) follows quickly by applying Theorem 1 to pr2 : (X × X, D × X) → X together with the diagonal section σ : X → X × X. For part (2), denote by Z n the normalization of Z. Then the proof follows quickly by applying Theorem 1 to pr2 : (X × Z n , D × Z n ) → Z n together with the natural diagonal section σ : Z n → X × Z n .  Next we study the case when X is a Gromov-Hausdorff limit of Kähler-Einstein Fano c X) = nn · Θ(x, X) is lower semicontinuous manifolds. Note that the function x 7→ vol(x, with respect to the Euclidean topology on X by [SS17, LX17]. The following corollary improves this result and follows easily from part (1) of Theorem 34. Corollary 35. Let X be a Gromov-Hausdorff limit of Kähler-Einstein Fano manifolds. c X) = nn · Θ(x, X) on X(C) is lower semicontinuous with Then the function x 7→ vol(x, respect to the Zariski topology. 24 HAROLD BLUM AND YUCHEN LIU The following theorem partially generalizes [SS17, Lemma 3.3 and Proposition 3.10]. Theorem 36. Let X be a Gromov-Hausdorff limit of Kähler-Einstein Fano manifolds. Let x ∈ X be any closed point. Then for any finite quasi-étale morphism of singularities π : (y ∈ Y ) → (x ∈ X), we have deg(π) ≤ Θ(x, X)−1 . In particular, we have (1) |π̂1loc (X, x)| ≤ Θ(x, X)−1 . (2) For any Q-Cartier Weil divisor L on X, we have ind(x, L) ≤ Θ(x, X)−1 where ind(x, L) denotes the Cartier index of L at x. c Y) = Proof. By [LX17, Theorem 1.7], the finite degree formula holds for π, i.e. vol(y, c X). Since vol(y, c Y ) ≤ nn by [LiuX17, Theorem A.4] or Theorem 33 and deg(π) · vol(x, c X) = nn · Θ(x, X) by [LX17, Corollary 5.7], we have deg(π) ≤ nn /vol(x, c X) = vol(x, −1 Θ(x, X) .  Remark 37. If the finite degree formula [LiuX17, Conjecture 4.1] were true for any klt c X) holds for any finite quasi-étale morphism singularity, then clearly deg(π) ≤ nn /vol(x, π : (y, Y ) → (x, X) between n-dimensional klt singularities. In particular, we would get c X) where π̂ loc (X, x) is known to be finite an effective upper bound |π̂1loc (X, x)| ≤ nn /vol(x, 1 by [Xu14, BGO17] (see [LiuX17, Theorem 1.5] for a partial result in dimension 3). Theorem 38. Let V be a K-semistable complex Q-Fano variety of dimension (n − 1). Let q be the largest integer such that there exists a Weil divisor L satisfying −KV ∼Q qL. Then q · (−KV )n−1 ≤ nn . Proof. Consider the orbifold cone X := C(V, L) = Spec(⊕m≥0 H 0 (V, OV (⌊mL⌋)) with the cone vertex x ∈ X. Let X̃ := SpecV ⊕m≥0 OV (⌊mL⌋) be the partial resolution of X with exceptional divisor V0 . Then by [Kol04, 40-42], x ∈ X is a klt singularity, and (V0 , 0) ∼ = (V, 0) is a K-semistable Kollár component over x ∈ X. Hence [LX16, c x,X . By [Kol04, 40-42] we have AX (ordV ) = Theorem A] implies that ordV0 minimizes vol 0 n−1 q, vol(ordV0 ) = (L ). Hence c X) = AX (ordV )n vol(ordV ) = q n (Ln−1 ) = q(−KV )n−1 , vol(x, 0 0 c X) ≤ nn by [LiuX17, Theorem A.4] or Theorem and the proof is finished since vol(x, 33.  Appendix A. Asymptotic lattice points counting in convex bodies In this appendix, we will prove the following proposition. Proposition 39. For any positive number ǫ, there exists k0 = k0 (ǫ, n) such that for any closed convex body ∆ ⊂ [0, 1]n and any integer k ≥ k0 , we have (A.1) #(k∆ ∩ Zn ) − vol(∆) ≤ ǫ. kn Proof. We do induction on dimensions. If n = 1, then k∆ is a closed interval of length kvol(∆), hence we know kvol(∆) − 1 ≤ #(k∆ ∩ Z) ≤ kvol(∆) + 1. NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 25 So (A.1) holds for k0 = ⌈1/ǫ⌉. Next, assume that the proposition is true for dimension n − 1. Denote by (x1 , · · · , xn ) the coordinates of Rn . Let ∆t := ∆ ∩ {xn = t} be the sectional convex body in [0, 1]n−1 . Let [t− , t+ ] be the image R t+ of ∆ under the projection onto the last coordinate. Then we know that vol(∆) = t− vol(∆t )dt. By induction hypothesis, there exists k1 ∈ N such that ǫ #(k∆t ∩ Zn−1 ) ǫ vol(∆t ) − ≤ ≤ vol(∆t ) + for any k ≥ k1 . n−1 3 k 3 It is clear that X #(k∆ ∩ Zn ) = #(k∆t ∩ Zn−1 ), t∈[t− ,t+ ]∩ k1 Z so for any k ≥ k1 we have (A.2) #(k∆ ∩ Zn ) − k n−1 · X t∈[t− ,t+ ]∩ k1 Z ǫ 1 2ǫ vol(∆t ) ≤ k n−1 · #([t− , t+ ] ∩ Z) ≤ k n . 3 k 3 Next, we know that the function t 7→ vol(∆t )1/(n−1) is concave on [t− , t+ ] by the BrunnMinkowski theorem. In particular, we can find t0 ∈ [t− , t+ ] such that g(t) := vol(∆t ) reaches its maximum at t = t0 . Hence g is increasing on [t− , t0 ] and decreasing on [t0 , t+ ]. Then applying Proposition 40 to g|[t− ,t0 ] and g|[t0,t+ ] respectively yields Z Z t0 vol(∆t )dt − t− t+ t0 vol(∆t )dt − 1 k 1 k Since 0 ≤ vol(∆t0 ) ≤ 1, we have Z t+ 1 vol(∆t )dt − (A.3) k t− X vol(∆t ) ≤ 2 , k X vol(∆t ) ≤ 2 . k X vol(∆t ) ≤ 5 . k t∈[t− ,t0 ]∩ k1 Z t∈[t0 ,t+ ]∩ k1 Z t∈[t+ ,t− ]∩ k1 Z Therefore, by setting k0 = max(k1 , ⌈15/ǫ⌉), the inequality (A.1) follows easily by combining (A.2) and (A.3).  Proposition 40. For any monotonic function g : [a, b] → [0, 1] and any k ∈ N, we have Z b 1 X 2 g(s)ds − g(t) ≤ . k k a 1 t∈[a,b]∩ k Z and bk := ⌊kb⌋ , Proof. We may assume that g is an increasing function. Denote ak := ⌈ka⌉ k k R t 1 1 so [a, b] ∩ k Z = [ak , bk ] ∩ k Z. Since t−1/k g(s)ds ≤ g(t)/k whenever t ∈ [ak + 1/k, bk ], we have Z bk X 1 X 1 g(t) ≤ g(t), g(s)ds ≤ k k ak 1 1 t∈[ak +1/k,bk ]∩ k Z t∈[a,b]∩ k Z 26 HAROLD BLUM AND YUCHEN LIU Similarly, R t+1/k t g(s)ds ≥ g(t)/k for any t ∈ [ak , bk − 1/k], we have Z bk X 1 1 X 1 g(s)ds ≥ g(t) ≥ g(t) − . k k k ak 1 1 t∈[ak ,bk −1/k]∩ k Z t∈[a,b]∩ k Z It is clear that ak ∈ [a, a + 1/k] and bk ∈ [b − 1/k, b], so we have Z b Z bk Z b Z bk 2 g(s)ds ≥ g(s)ds − , g(s)ds ≤ g(s)ds. k ak a ak a As a result, we have 1 k X t∈[a,b]∩ k1 Z 1 g(t) − ≤ k Z b g(s)ds ≤ a 1 k X t∈[a,b]∩ k1 Z g(t) + 2 k  Appendix B. Families of Ideals and the Hilbert–Samuel Function The following proposition concerns the behavior of the Hilbert–Samuel function along a family of ideals. The statement is not new. The proof we give follows arguments found found in [FM00]. Definition 41. If (R, m) is a local ring and I is an m-primary ideal, then the Hilbert– Samuel function of I, denoted HI : N → N, is given by HI (m) := ℓR (R/I m ). Note that e(I) = limn→∞ HI (m)/mn , where n = dim(R). Proposition 42. Let π : X → T be a morphism of finite type k-schemes. Assume T is integral and π has a section σ : T → X . If a ⊂ OX is an ideal and at = a · OXσ(t) is mσ(t) -primary for all t ∈ T , then T has a filtration ∅ = T0 ⊂ T1 ⊂ · · · T1 ⊂ Tm = T such that for every 1 ≤ i ≤ m, Ti is closed in T and the function Ti \ Ti−1 ∋ t 7→ Hat is constant. Proof. To prove the result, it is sufficient to show that there exists a nonempty open set proceed to find such a set U. U ⊂ T such that Hat is constant for all P t ∈ U. iWei+1 ℓ(a /a For each t ∈ T , we have Hat (m) = m−1 t ). Therefore, we consider the finitely t i=0 i i+1 generated OX -algebra gra := ⊕i≥0 a /a . By generic flatness, we may choose a nonempty open set U ⊂ T such that both OX |π−1 (U ) and gra |π−1 (U ) are flat over U. For each i ∈ N, the function U ∋ t 7→ dimκ(t) (ai /ai+1 |t ) is constant, since each ai /ai+1 is flat over U and ai /ai+1 |t has zero dimensional support for each t ∈ U. Since κ(t) ≃ Oσ(t),X /mσ(t) , dimκ(t) (ai /ai+1 |t ) = ℓ(ai /ai+1 |t ) for all t ∈ T . Furthermore, Lemma 43, proved below, implies ai /ai+1 |t = ait /ai+1 for all t ∈ U. Therefore, U ∋ t 7→ ℓ(ait /ai+1 t t ) is constant, and the proof is complete.  Before stating the following lemma, we introduce some notation. Let A be a ring, I ⊂ A an ideal, and M an A-module. We set M I mM grI (M) := . I m+1 M m≥0 NORMALIZED VOLUME OF A SINGULARITY IS LOWER SEMICONTINUOUS 27 Lemma 43. Let B → A be a morphism of rings, I ⊂ A an ideal, and M ∈ Mod(A). If grI M and M are both flat over B, then for any N ∈ Mod(B) (grI M) ⊗B N ≃ grI (M ⊗B N). Proof. We follow the argument given in [FM00]. Consider the surjective map αm : (I m M) ⊗B N → I m (M ⊗B N). We claim that, for each m ∈ Z>0 , αm is injective and I m M is flat over B. In order to prove the claim, we induct on m. The claim holds when m = 0, since α0 is clearly an isomorphism and M is flat over B by assumption. Next, consider the exact sequence 0 → I m+1 M → I m M → I m M/I m+1 M → 0 and assume the claim holds for a positive integer m. Since I m M and I m M/I m+1 M are flat over B, so is I m+1 M. By the flatness of I m M/I m+1 M, we may tensor by N to get an exact sequence 0 → I m+1 M ⊗B N → I m M ⊗B N → I m M/I m+1 M ⊗B N → 0. By the above exact sequence, the injectivity of αm implies the injectivity of αm+1 . Now that the claim has been proven, the lemma follows from applying the claim to the previous short exact sequence.  References [Amb16] F. Ambro: Variation of log canonical thresholds in linear systems. Int. Math. Res. Not. (2016), no. 14, 4418–4448. [BGO17] B. Bhatt, O. Gabber and M. Olsson: Finiteness of étale fundamental groups by reduction modulo p. Preprint available at arXiv:1705.07303. [Blu16] H. Blum: Existence of valuations with smallest normalized volume. To appear in Compos. Math., available at arXiv:1606.08894. [BdFFU15] S. Boucksom, T. de Fernex, C. Favre and S. Urbinati: Valuation spaces and multiplier ideals on singular varieties. Recent advances in algebraic geometry, 29-51, London Math. Soc. Lecture Note Ser., 417, Cambridge Univ. Press, Cambridge, 2015. [BFJ14] S. Boucksom, C. Favre, and M. Jonsson: A refinement of Izumi’s theorem. In Valuation theory in interaction, 55-81, EMS Ser. Congr. Rep., Eur. Math. Soc., Zürich (2014). [Cut13] S. Cutkosky: Multiplicities associated to graded families of ideals. Algebra Number Theory 7 (2013), no. 9, 2059-2083. [dFEM04] T. de Fernex, L. Ein and M. Mustaţă: Multiplicities and log canonical threshold. J. Algebraic Geom. 13 (2004), no. 3, 603-615. [Don15] S. Donaldson: Algebraic families of constant scalar curvature Kähler metrics. Surveys in differential geometry 2014. Regularity and evolution of nonlinear equations, 111-137, Surv. Differ. Geom., 19, Int. Press, Somerville, MA, 2015. [ELS03] L. Ein, R. Lazarsfeld and K. Smith: Uniform approximation of Abhyankar valuation ideals in smooth function fields. Amer. J. Math. 125 (2003), no. 2, 409-440. [FM00] H. Flenner and M. Manaresi: Equimultiplicity and equidimensionality of normal cones. In: Recent progress in intersection theory (Bologna, 1997). Trends Math., 199–215. [Fuj15] K. Fujita: Optimal bounds for the volumes of Kähler-Einstein Fano manifolds. To appear in Amer. J. Math., available at arXiv:1508.04578. [HS16] H. Hein and S. Sun: Calabi-Yau manifolds with isolated conical singularities. To appear in Publ. Math. Inst. Hautes Études Sci., available at arXiv:1607.02940. [JM12] M. Jonsson and M. Mustaţă: Valuations and asymptotic invariants for sequences of ideals. Ann. Inst. Fourier (Grenoble) 62 (2012), no. 6, 2145-2209 (2013). 28 HAROLD BLUM AND YUCHEN LIU [KK14] K. Kaveh and A. Khovanskii: Convex bodies and multiplicities of ideals. Proc. Steklov Inst. Math. 286 (2014), no. 1, 268-284. [Kol96] J. Kollár: Rational curves on algebraic varieties. Ergebnisse der Mathematik und ihrer Grenzgebiete, 32. Springer-Verlag, Berlin, 1996. [Kol04] J. Kollár: Seifert Gm -bundles. Preprint available at arXiv:math/0404386. [Kol13] J. Kollár: Singularities of the minimal model program, volume 200 of Cambridge Tracts in Mathematics. Cambridge University Press, Cambridge, 2013. With a collaboration of S. Kovács. [Laz04] R. Lazarsfeld: Positivity in algebraic geometry. I-II. Ergebnisse der Mathematik und ihrer Grenzgebiete, 48–49. Springer-Verlag, Berlin, 2004. [LM09] R. Lazarsfeld and M. Mustaţă: Convex bodies associated to linear series. Ann. Sci. Éc. Norm. Supér. (4) 42 (2009), no. 5, 783-835. [Lec60] C. Lech: Note on multiplicities of ideals. Ark. Mat. 4 (1960), 63-86. [Li15a] C. Li: Minimizing normalized volumes of valuations. To appear in Math. Z., available at arXiv:1511.08164. [Li15b] C. Li: K-semistability is equivariant volume minimization. To appear in Duke Math. J., available at arXiv:1512.07205. [Li17] C. Li: Yau-Tian-Donaldson correspondence for K-semistable Fano manifolds. J. Reine Angew. Math. 733 (2017), 55-85. [LL16] C. Li and Y. Liu: Kähler-Einstein metrics and volume minimization. To appear in Adv. Math., available at arXiv:1602.05094. [LWX14] C. Li, X. Wang and C. Xu: On proper moduli space of smoothable Kähler-Einstein Fano varieties. Preprint available at arXiv:1411.0761v3. [LX16] C. Li and C. Xu: Stability of valuations and Kollár components. Preprint available at arXiv:1604.05398. [LX17] C. Li and C. Xu: Stability of valuations: higher rational rank. Preprint available at arXiv:1707.05561. [Liu16] Y. Liu: The volume of singular Kähler-Einstein Fano varieties. To appear in Compos. Math., available at arXiv:1605.01034. [LiuX17] Y. Liu and C. Xu: K-stability of cubic threefolds. Preprint available at arXiv:1706.01933. [Mat80] H. Matsumura: Commutative algebra. Second edition. Mathematics Lecture Note Series, 56. Benjamin/Cummings Publishing Co., Inc., Reading, Mass., 1980. xv+313 pp. [Mus02] M. Mustaţǎ. On multiplicities of graded sequences of ideals. J. Algebra 256 (2002), 229–249. [Oda13] Y. Odaka: On the moduli of Kähler-Einstein Fano manifolds. Proceeding of Kinosaki algebraic geometry symposium, 2013. [Oda15] Y. Odaka: Compact moduli spaces of Kähler-Einstein Fano varieties. Publ. Res. Inst. Math. Sci. 51 (2015), no. 3, 549-565. [SS17] C. Spotti and S. Sun: Explicit Gromov-Hausdorff compactifications of moduli spaces of KählerEinstein Fano manifolds. Preprint available at arXiv:1705.00377. [SSY16] C. Spotti, S. Sun and C. Yao: Existence and deformations of Kähler-Einstein metrics on smoothable Q-Fano varieties. Duke Math. J. 165 (2016), no. 16, 3043-3083. [SPA] The Stacks Project Authors: Stracks Project. Available at http://stacks.math.columbia.edu. [Xu14] C. Xu: Finiteness of algebraic fundamental groups. Compos. Math. 150 (2014), no. 3, 409-414. [Xu17] C. Xu: Interaction between singularity theory and the minimal model program. Submitted to 2018 ICM Algebraic and Complex Geometry Session, available at arXiv:1712.01041. Department of Mathematics, University of Michigan, Ann Arbor, MI 48109–1043, USA E-mail address: [email protected] Department of Mathematics, Yale University, New Haven, CT 06511, USA. E-mail address: [email protected]
0math.AC
SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS arXiv:1311.5927v1 [math.CO] 22 Nov 2013 CARLOS A. ALFARO AND CARLOS E. VALENCIA Abstract. The critical ideals of a graph are the determinantal ideals of the generalized Laplacian matrix associated to a graph. In this article we provide a set of minimal forbidden graphs for the set of graphs with at most three trivial critical ideals. Then we use these forbidden graphs to characterize the graphs with at most three trivial critical ideals and clique number equal to 2 and 3. 1. Introduction Given a connected graph G = (V, E) and a set of indeterminates XG = {xu : u ∈ V (G)}, the generalized Laplacian matrix L(G, XG ) of G is the matrix with rows and columns indexed by the vertices of G given by ( xu if u = v, L(G, XG )uv = −muv otherwise, where muv is the number of the edges between vertices u and v of G. Definition 1.1. For all 1 ≤ i ≤ |V |, the i-th critical ideal of G is the determinantal ideal given by Ii (G, XG ) = h{det(m) : m is an i × i submatrix of L(G, XG )}i ⊆ Z[XG ]. We say that a critical ideal is trivial when it is equal to h1i. Critical ideals were firstly defined in [8] and have been studied in a more general framework in [2]. The algebraic co-rank γ(G) of G is the number of trivial critical ideals of G. The algebraic co-rank allows to separate the set of all simple connected graphs in the following graph families: Γ≤i = {G : G is a simple connected graph with γ(G) ≤ i}. In [8] it was proven that if H is an induced subgraph of G, then Ii (H, XH ) ⊆ Ii (G, XG ) for all i ≤ |V (H)|. Thus γ(H) ≤ γ(G). This implies that the set Γ≤i is closed under induced subgraphs. Therefore we can say that a graph G is forbidden for Γ≤k when γ(G) ≥ k + 1. Moreover, we define the set of minimal forbidden as follows: Definition 1.2. Let Forb(Γ≤k ) be the set of minimal (under induced subgraphs property) forbidden graphs for Γ≤k . A graph G is called γ-critical if γ(G − v) < γ(G) for all v ∈ V (G). Then Forb(Γ≤k ) is equal to the set of γ-critical graphs with γ(G) ≥ k + 1 and γ(G − v) ≤ k for all v ∈ V (G). Given a family F of graphs, a graph G is called F-free if no induced subgraph of G is isomorphic to a member of F. Thus G ∈ Γ≤k if and only if G is Forb(Γ≤k )-free. Therefore, characterizing Forb(Γ≤k ) leads to a characterization of Γ≤k . 2000 Mathematics Subject Classification. Primary 05C25; Secondary 05C50, 05E99. Key words and phrases. Critical ideal, Critical group, Laplacian matrix, Forbidden induced subgraph. Both authors were partially supported by CONACyT grant 166059, the first author was partially supported by CONACyT and the second author was partially supported by SNI. 1 2 CARLOS A. ALFARO AND CARLOS E. VALENCIA In [1], these ideas were used to obtain a characterization of Γ≤1 and Γ≤2 . More precisely, it was found that Forb(Γ≤1 ) = {P3 } and thus Γ≤1 consists of the complete graphs. On the other hand, Forb(Γ≤2 ) consists of 5 graphs: P4 , K2 \ P2 , K6 \ M2 , cricket and dart. And Γ≤2 consists of the graphs isomorphic to an induced subgraph of one of the following graphs: tripartite complete graph Kn1 ,n2 ,n3 or Tn1 ∨ (Kn2 + Kn3 ), where G + H denote the disjoint union of the graphs of G and H, and G ∨ H denote the join of G and H. The main goal of this paper is to provide a set of minimal forbidden graphs for Γ≤3 and a partial description of Γ≤3 . Specifically, we will characterize the graphs in Γ≤3 with clique number equal to 2 and 3. Therefore, we prove that if a graph G ∈ Γ≤3 has clique number at most 3, then G is an induced subgraph of one graph in the family F1 (see Figure 1). The converse is stronger, each induced subgraph of a graph in F1 belongs to Γ≤3 , but not all graphs in F11 have clique number less than 4. n5 n2 n1 n7 n1 n6 n4 n3 (i) graph G1 (ii) family of graphs F11 (iii) family of graphs F12 Figure 1. The family of graphs F1 . A black vertex represents a clique of cardinality nv , a white vertex represents a stable set of cardinality nv and a gray vertex represents a single vertex. This article is divided as follows. In Section 1.1, we will show how the characterization of Γ≤i leads to a characterization of the graphs having critical group with i invariant factors equal to 1. In Section 2, we will construct a graph Gd by replacing its vertices by cliques and stable sets. And we will show a novel method to verify whether the k-th critical ideal of Gd is trivial or not. This method will be applied to prove that each induced subgraph of a graph in the family F1 belongs to Γ≤3 . In Section 3, we will give a family of minimal forbidden graphs for Γ≤3 , and it will be used to prove that a graph G ∈ Γ≤3 has clique number 2 if and only if G is an induced subgraph of a graph in F2 (see Figure 3). Section 4 is devoted to prove that if a graph G ∈ Γ≤3 and has clique number 3, then G is an induced subgraph of one graph in the family F1 . 1.1. Applications to the critical group. The Laplacian matrix L(G) of G is the evaluation of L(G, XG ) at XG = DG , where DG is the degree vector of G. By considering L(G) as a linear map L(G) : ZV → ZV , the cokernel of L(G) is the quotient module ZV /Im L(G). The torsion part of this module is the critical group K(G) of G. The critical group has been studied intensively on several contexts over the last 30 years: the group of components [14, 15], the Picard group [3, 4], the Jacobian group [3, 4], the sandpile group [7], chip-firing game [4, 17], or Laplacian unimodular equivalence [10, 18]. It is known [13, Theorem 1.4] that the critical group of a connected graph G with n vertices can be described as follows: K(G) ∼ = Zd1 ⊕ Zd2 ⊕ · · · ⊕ Zdn−1 , where d1 , d2 , ..., dn−1 are positive integers with di | dj for all i ≤ j. These integers are called invariant factors of the Laplacian matrix of G. Besides, if ∆i (G) is the greatest common divisor of the i-minors SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 3 of the Laplacian matrix L(G) of G, then the i-th invariant factor di is equal to ∆i (G)/∆i−1 (G), where ∆0 (G) = 1 (for details see [12, Theorem 3.9]). Definition 1.3. Given an integer number k, let fk (G) be the number of invariant factors of the critical group of G equal to k. Also, let Gi = {G : G is a simple connected graph with f1 (G) = i}. The study and characterization of Gi is of great interest. In particular, some results and conjectures on the graphs with cyclic critical group can be found in [15, Section 4] and [20, Conjectures 4.3 and 4.4]. On the other hand, it is easy to see [7, 14, 18] that G1 consists only of the complete graphs. Besides, several people (see [17]) posed interest on the characterization of G2 and G3 . In this sense, few attempts have been done. In [19] it was characterized the graphs in G2 whose third invariant factor is equal to n, n − 1, n − 2, or n − 3. Later in [6] the characterizations of the graphs in G2 with a cut vertex, and the graphs in G2 with number of independent cycles equal to n − 2 are given. Recently, a complete characterization of G2 was given in [1]. However, nothing is known about G3 . A crucial result linking critical groups and critical ideals is [8, Theorem 3.6], which states if DG is the degree vector of G, and d1 | · · · | dn−1 are the invariant factors of K(G), then + * i Y dj = h∆i (G)i for all 1 ≤ i ≤ n − 1. Ii (G, DG ) = j=1 Thus if the critical ideal Ii (G, XG ) is trivial, then ∆i (G) and di are equal to 1. Equivalently, if ∆i (G) and di are not equal to 1, then the critical ideal Ii (G, XG ) is not trivial. The critical ideals behave better than critical group under induced subgraph property. It is not difficult to see that unlike of Γ≤k , Gk is not closed under induced subgraphs. For instance, the cone of the claw graph c(K1,3 ) belongs to G2 , but the claw graph K1,3 belongs to G3 . Also, K6 \ {2P2 } belongs to G3 , meanwhile K5 \ {2P2 } belongs to G2 . Moreover, if H is an induced subgraph of G, then it is not always true that K(H) E K(G). For example, K(K4 ) ∼ = Z35 . = Z24 5 K(K5 ) ∼ On the other hand, a consequence of [8, Theorem 3.6] is that Gi ⊆ Γ≤i for all i ≥ 0. Therefore, after an analysis of the i-th invariant factor of the Laplacian matrix of the graphs in Γ≤i , the characterization of Gi can be obtained. See for instance [1] for the characterizations of G1 and G2 . 2. Cliques, stable sets and critical ideals Let G = (V, E) a simple graph. Suppose that V ′ is a subset of V , the induced subgraph G[V ′ ] of G is the subgraph of G whose vertex set is V ′ and whose edge set is the set of those edges of G that have both ends in V ′ . If E ′ is a subset of E, the edge-induced subgraph G[E ′ ] is the subgraph of G whose edge set is E ′ and whose vertex set consists of all ends of edges of E ′ . Let P, Q be two subsets of V , we denote by E(P, Q) the set of edges of G with one end in P and the other end in Q. A clique of G is a subset S of V of mutually adjacent vertices, and the maximum size of a clique of G is the clique number ω(G) of G. A subset S of V is called an independent set, or stable set, of G if no two vertices of S are adjacent in G. The graph with n vertices whose vertex set induces a stable set is called the trivial graph, and denoted by Tn . The cardinality of a maximum stable set in G is called the stability number of G and is denoted by α(G). Given a simple graph G = (V, E) and a vector d ∈ ZV , the graph Gd is constructed as follows. For each vertex u ∈ V is associated a new vertex set Vu , where Vu is a clique of cardinality −du if du is negative, and Vu is a stable set of cardinality du if du is positive. And each vertex in Vu is adjacent with each vertex in Vv if and only if u and v are adjacent in G. Then the graph G is called the underlying graph of Gd . 4 CARLOS A. ALFARO AND CARLOS E. VALENCIA A convenient way to visualize Gd is by means of a drawing of G, where the vertex u is colored in black if du is negative, and colored in white if du is positive. We indicate the cardinality of Vu by writing it inside the drawing of vertex u. When |du | = 1, we may color u in gray and avoid writing the cardinality (see Figure 1). On the other hand, it will be useful to avoid writing the cardinality when |du | = 2 (see Figure 2). In general, the computation of the Gröbner bases of the critical ideals is more than complicated. However, in the rest of this section we will show a novel method, developed in [2], to decide for i ≤ |V (G)| whether the i-th critical ideal of Gd is trivial or not. ′ For V ′ ⊆ V (G) and d ∈ ZV , we define φ(d) as follows: ( 0 if dv > 0, φ(d)v = −1 if dv < 0. Theorem 2.1. [2, Theorem 3.7] Let n ≥ 2 and G be a graph with n vertices. For V ′ ⊆ V (G), ′ 1 ≤ j ≤ n and d ∈ ZV , the critical ideal Ij (Gd , XGd ) is trivial if and only if the evaluation of Ij (G, XG ) at XG = φ(d) is trivial. Thus the procedure of verify whether a family of graphs belongs to Γ≤i becomes in an evaluation of the i-th critical ideal of the underlying graph of the family. Let G2 be the underlying graph of the family of graphs F11 (see Figure 1.ii) with vertex set V = {v1 , v2 , v3 , v4 , v5 , v6 , v7 }. Let d ∈ ZV such that d1 , d2 , d3 are positive integers and d4 , d5 , d6 , d7 are negative integers. Thus φ(d) = (0, 0, 0, −1, −1, −1, −1). By using a computer algebra system we can check that I4 (G2 , XG2 ) = h2, x1 , x2 , x3 , x4 + 1, x5 + 1, x6 + 1, x7 + 1i. Since the evaluation I4 (G2 , XG2 ) at XG2 = φ(d) is equal to h2i, then by Theorem 2.1 the critical ideal I4 (Gd2 , XGd ) is non-trivial. Therefore, each graph in this family of graphs has algebraic co-rank 2 at most 3. Now let G3 be the underlying graph of the family of graphs F12 (see Figure 1.iii) with vertex set V = {v1 , v2 , v3 , v4 , v5 , v6 }. Let d1 be positive integer. By using a computer algebra system we can check that I4 (G3 , XG3 ) = hx21 + 5x1 + 5, x1 + x2 + 3, x1 + x3 + 3, x1 + x4 + 3, x1 + x5 + 3, x1 + x6 + 3i. Since the evaluation of I4 (G3 , XG3 ) at x1 = 0 is non-trivial, then by Theorem 2.1 the critical ideal I4 (Gd3 , XGd ) is non-trivial. Therefore, each graph in F12 has algebraic co-rank at most 3. 3 On the other hand, it can be verified that γ(G1 ), γ(G2 ) and γ(G3 ) are equal to 3. Then the graphs in F1 have algebraic co-rank 3, and so each induced subgraph of a graph in F1 has algebraic co-rank at most 3. Proposition 2.2. Each graph in F1 belongs to Γ≤3 . 3. A description of Γ≤3 It is possible to compute the algebraic co-rank of all connected graphs with at most 9 vertices using the software Macaulay2 [9] and Nauty [16]. The computation of the algebraic co-rank of the connected graphs with at most 8 vertices required at most 3 hours on a MacBookPro with a 2.8 GHz Intel i7 quad core processor and 16 GB RAM. Besides, the computation of the algebraic co-rank of the connected graphs with 9 vertices required 4 weeks of computation on the same computer. Let F3 be the family of graphs shown in Figure 2. This family represents the graphs in Forb(Γ≤3 ) with at most 8 vertices. Since there exists no minimal forbidden graph with 9 vertices for Γ≤3 , then it is likely that F3 = Forb(Γ≤3 ). SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS P5 G6,1 G6,2 G6,3 G6,4 G6,5 G6,6 G6,7 G6,8 5 G6,9 G6,10 G6,11 G6,12 G6,13 G6,14 G6,15 G6,16 G6,17 G6,18 G6,19 G6,20 G6,21 G6,22 G6,23 G6,24 G6,25 G6,26 G6,27 G7,1 G7,2 G7,3 G7,4 G7,13 G7,14 G7,5 G7,6 G7,15 G7,7 G7,8 G7,16 G7,17 G7,9 G8,1 G7,10 G8,2 G7,11 G8,3 G7,12 G8,4 Figure 2. The family of graphs F3 . A black vertex represents a clique of cardinality 2, a white vertex represents a stable set of cardinality 2 and a gray vertex represent a single vertex. Proposition 3.1. Each graph in F3 belongs to Forb(Γ≤3 ). Proof. It can easily checked, using a computer algebra system, that each graph in F3 is γ-critical and has algebraic co-rank equal to 4.  One of the main results of this article is the following: Theorem 3.2. If a graph G ∈ Γ≤3 has clique number at most 3, then G is an induced subgraph of a graph in F1 . We divide the proof in two characterizations: the graphs in Γ≤3 with clique number equal to 2 and 3. The converse of Theorem 3.2 is stronger, by Proposition 2.2 we have that each induced subgraph of a graph in F1 belongs to Γ≤3 . However, it is not difficult to recognize the graphs in F11 with clique number greater or equal than 4. Theorem 3.3. Let G be a simple connected graph with ω(G) = 2. Then, G is F3 -free if and only if G is isomorphic to an induced subgraph of a graph in F2 (see Figure 3). n1 n2 (i) Kn1 ,n2 n1 n2 (ii) F21 n1 n2 (iii) F22 n1 n2 (iv) F23 Figure 3. The family of graphs F2 . A white vertex represents a stable set of cardinality nv and a gray vertex represents a single vertex. 6 CARLOS A. ALFARO AND CARLOS E. VALENCIA Since each graph in F2 is isomorphic to an induced subgraph of a graph in F11 , then Proposition 2.2 implies that each graph in F2 belongs to Γ≤3 . Note that the graphs in Γ≤1 and Γ≤2 are induced subgraph of a graph in F11 (see Figure 1.ii). Theorem 3.4. Let G be a simple connected graph with ω(G) = 3. Then, G is F3 -free if and only if G is isomorphic to an induced subgraph of a graph in F1 with clique number 3. Section 4 is devoted to the proof of the Theorem 3.4. Now we give the proof of Theorem 3.3. Proof of Theorem 3.3. Since each graph in F2 belongs to Γ≤3 , then each graph in F2 is F3 -free. Thus, we get one implication. Suppose G is F3 -free. Let a, b ∈ V (G) such that ab ∈ E(G). Since ω(G) = 2, then there is no vertex adjacent with a and b at the same time. For a vertex v ∈ V (G), the neighbor set NG (v) of v in G is the set of all vertices adjacent with v. Let A = NG (a) − b and B = NG (b) − a. Clearly, each of the sets A and B induces a trivial graph. Let us define A = {u ∈ A : ∃v ∈ B such that uv ∈ E}, A′ = {u ∈ A : ∄v ∈ B such that uv ∈ E} B = {u ∈ B : ∃v ∈ A such that uv ∈ E}, and B ′ = {u ∈ B : ∄v ∈ A such that uv ∈ E}. Thus we have two possible cases: when A and B are not empty and when A and B are empty. First we consider when A and B are not empty. In this case we have the following statements: Claim 3.5. One of the sets A′ or B ′ is empty, and the other has cardinality at most one. Proof. Suppose A′ and B ′ are not empty. Let u ∈ A, v ∈ B, s ∈ A′ and t ∈ B ′ . Then the vertex set {a, b, u, v, s, t} induces a graph isomorphic to G6,9 , which is impossible. Now suppose A′ has cardinality more than 1. Take w1 , w2 ∈ A′ . Then {x, y, u, v, w1 , w2 } induces a graph isomorphic to G6,3 ; a contradiction. Thus A′ has cardinality at most one.  Claim 3.6. The edge set E(A, B) induces either a complete bipartite graph or a complete bipartite graph minus an edge. Proof. First note that each vertex in A is incident with each vertex in B, except for at most one vertex. It is because if u ∈ A and v1 , v2 , v3 ∈ B such that uv1 ∈ E(G) and uv2 , uv3 ∈ / E(G), then the induced subgraph G[{x, y, u, v1 , v2 , v3 }] is isomorphic to G6,3 ; which is impossible. In a similar way, each vertex in B is incident with each vertex in A, except for at most one vertex. Thus the edge set E(A, B) must be equal to the edge set {uv : u ∈ A, v ∈ B} minus a matching. In fact, the cardinality of this matching must be at most one. Otherwise, if u, v ∈ A and s, t ∈ B such that us, vt ∈ / E(G) and ut, vs ∈ E(G), then the induced subgraph G[{t, u, a, v, s}] is isomorphic to P5 ; which is a contradiction.  Claim 3.7. It is not possible that, at the same time, the edge set E(A, B) induces a complete bipartite graph minus an edge and A′ ∪ B ′ 6= ∅. Proof. Suppose both situations occur at the same time. Let u1 , u2 ∈ A and v1 , v2 ∈ B such that u1 v1 , u1 v2 , u2 v1 ∈ E(G) and u2 v2 ∈ / E(G). And let w ∈ A′ . Then the vertex set {u1 , u2 , v1 , v2 , y, w} induces a graph isomorphic to G6,9 ; which is a contradiction.  Thus there are three possible cases: (a) E(A, B) = {uv : u ∈ A, v ∈ B} and A′ ∪ B ′ = ∅, (b) E(A, B) = {uv : u ∈ A, v ∈ B} and A′ = T1 , B ′ = ∅ or (c) E(A, B) induces a bipartite complete graph minus an edge and A′ ∪ B ′ = ∅. SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 7 Let V∅ denote the set of vertices that are not adjacent with a nor b. In what follows we will describe the vertex set V∅ . Case (a). Let w1 , w2 ∈ V∅ , u1 , u2 ∈ A, and v1 ∈ B. Note that it is not possible that a vertex in V∅ is adjacent with a vertex in A and a vertex in B at the same time, because then we get ω(G) ≥ 3. Moreover Claim 3.8. There exist no two vertices in V∅ such that one is adjacent with a vertex in A and the other one is adjacent with a vertex in B. Proof. Suppose w1 u1 , w2 v1 ∈ E(G). There are two cases: either w1 w2 ∈ E(G) or w1 w2 ∈ / E(G). If w1 w2 ∈ E(G), then G[{w1 , w2 , v1 , b, a}] ≃ P5 ; which is impossible. And if w1 w2 ∈ / E(G), then G[{w1 , w2 , v1 , u1 , b, a}] ≃ G6,9 ; which is a contradiction.  Without loss of generality, suppose w1 ∈ V∅ is adjacent with u1 ∈ A. Thus Claim 3.9. The vertex set V∅ has cardinality at most 1. Proof. There are two possible cases: either each vertex in V∅ is adjacent with a common vertex in A or not. Suppose there exists w2 ∈ V∅ such that u1 is adjacent with both w1 and w2 . Then w1 w2 ∈ / E(G), because otherwise w1 , w2 and u1 induce a K3 . Thus the vertex set {w1 , w2 , u1 , v1 , a, b} induces a graph isomorphic to G6,3 ; which is forbidden. Then this case is not possible. Now suppose w1 and w2 are not adjacent with a common vertex in A. We have the following possible cases: (1) w1 u1 , w2 u2 ∈ E(G), (2) w1 u1 , w2 u2 , w1 w2 ∈ E(G), or (3) w1 w2 ∈ E(G). This yields a contradiction since in case (1) the vertex set {w1 , u1 , v1 , u2 , w2 } induces a graph isomorphic to P5 , in case (2) the vertex set {w2 , w1 , u1 , v1 , b} induces a graph isomorphic to P5 , and in case (3) the vertex set {w2 , w1 , u1 , v1 , b} induces a graph isomorphic to P5 .  If |A| = 2, there are two possibilities: either w1 is adjacent with each vertex in A or w1 is adjacent with only one vertex of A. If |A| ≥ 3, then w1 is adjacent with either all vertex in A or only one vertex in A. It is because if w1 is adjacent with both u1 , u2 ∈ A and w is not adjacent with u3 ∈ A, then the vertex set {w1 , u1 , u2 , u3 , a, b} induces a graph isomorphic to G6,3 . Note that when w1 is adjacent with each vertex in A, then the graph is isomorphic to an induced subgraph of a graph in F22 . Meanwhile, when w1 is adjacent only with one vertex of A, then the graph is isomorphic to an induced subgraph of a graph in F21 . Finally, when V∅ = ∅, the graph is a complete bipartite graph. Case (b). Suppose without loss of generality that A′ 6= ∅. By Claims 3.8 and 3.9, the vertex set V∅ has cardinality at most one. Let w ∈ V∅ , u1 ∈ A, u2 ∈ A′ and v1 ∈ B. We have two cases: w is adjacent with either a vertex in A or a vertex in B. Let us consider when w is adjacent with a vertex in A. Here we have two possibilities: either wu2 ∈ E(G) or wu2 ∈ / E(G). However, none of the two cases is allowed, since in the first case we get that the vertex set {w, u2 , a, b, v1 } induces a graph isomorphic to P5 , and in the second case the vertex set {w, u2 , a, b, u1 , v1 } induces a graph isomorphic to G6,9 . Thus the remaining case is that w is adjacent with a vertex in B. In this case w must be adjacent with u2 and each vertex in B, because otherwise the graph P5 appears as induced subgraph. Note that this graph is isomorphic to an induced subgraph of a graph in F23 . Case(c). Let w ∈ V∅ , u1 , u2 ∈ A, and v1 , v2 ∈ B such that u1 v2 ∈ / E(G) and u1 v1 , u2 v1 , u2 v2 ∈ E(G). Note that if w is adjacent with u1 or v2 , then w is adjacent with both u1 and v2 , because since u1 v2 ∈ / E(G), we would obtain P5 as induced subgraph; which is not possible. In this case, when w is adjacent with u1 and v2 , the graph is isomorphic to an induced subgraph of F23 . Now we consider 8 CARLOS A. ALFARO AND CARLOS E. VALENCIA when w is adjacent with a vertex in (A − u1 ) ∪ (B − v2 ). Without loss of generality, we can suppose w is adjacent with u2 . The vertex w is not adjacent with v1 or v2 , because otherwise a clique of cardinality 3 is obtained. On the other hand, w is not adjacent with u1 , because otherwise w would be adjacent with both vertices u1 and v1 . Thus w is adjacent only with u2 , but the vertex set {w, u1 , u2 , v2 , a, b, } induces a graph isomorphic to G6,9 ; a contradiction. Thus V∅ is empty, and the graph is isomorphic to an induced subgraph of F22 . Now we consider the case when A and B are empty. One of the vertex sets A′ or B ′ has cardinality at most one, because otherwise A′ ∪ B ′ ∪ {a, b} would contain G6,1 as induced subgraph. Thus, let us assume that A′ = {u} and |B ′ | > 1. Let V∅ denote the vertex set whose vertices are not adjacent with both a and b. Claim 3.10. If A′ and B ′ are not empty, and w ∈ V∅ is adjacent with a vertex in A′ ∪ B ′ , then w is adjacent with each vertex in A′ ∪ B ′ . Proof. Let v ∈ B ′ . Suppose one of the edges uw or vw does not exist. Then {w, u, a, b, v} induces a graph isomorphic to P5 ; which is a contradiction.  B′ Note that the vertex set V∅ induces a stable set, because otherwise ω(G) > 2. Thus when A′ and are not empty, the graph G is isomorphic to an induced subgraph of a graph in F23 . Now consider the case when B = ∅ and |A| > 1. Claim 3.11. Each vertex w ∈ V∅ is adjacent with either a unique vertex in A or each vertex in A. Proof. The result is easy to check when |A| ≤ 2. So suppose A has cardinality greater or equal than 3. Let u1 , u2 , u3 ∈ A such that w is adjacent with both u1 , u2 , and w is not adjacent with u3 . Since the vertex set {w, u1 , u2 , u3 , a, b} induces a graph isomorphic to G6,3 , then we get a contradiction and the result follows.  Claim 3.12. Let w ∈ V∅ such that it is adjacent with u ∈ A. If V∅ has cardinality greater than 1, then each vertex in V∅ is adjacent either with u or with each vertex in A. Proof. Suppose there exists w′ ∈ V∅ such that w′ is not adjacent with u. Let u′ ∈ A such that w′ is adjacent with w′ . There are four possible cases: • • • • wu′ , ww′ ∈ E(G), ww′ ∈ E(G) and wu′ ∈ / E(G), wu′ ∈ E(G) and ww′ ∈ / E(G), wu′ , ww′ ∈ / E(G). In the cases when ww′ ∈ E(G), the vertex set {w, u, a, u′ , w′ } induces a graph isomorphic to P5 ; those cases do not occur. On the other hand if wu′ ∈ E(G) and ww′ ∈ / E(G), then {w, w′ , u, u′ , a, b} induces a graph isomorphic to G6,9 , and this case can not occur. Finally, if wu′ , ww′ ∈ / E(G), then ′ ′ the vertex set {w, u, a, u , w } induces a graph isomorphic to P5 . Which is a contradiction. Thus each pair of vertices in V∅ are adjacent with the same vertices in A. And the result follows.  Thus there are two cases: when each vertex in V∅ is adjacent with a unique vertex u in A, and when each vertex in V∅ is adjacent with each vertex in A. Note that V∅ induces a stable set, because otherwise ω(G) > 2. In the first case we have that either |V∅ | ≥ 2 or the vertex set A − u is empty. It is because otherwise G would have G6,1 as induced subgraph. Therefore, in each case G is isomorphic  to a graph in F11 . SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 9 4. Proof of Theorem 3.4 One implication is easy because Proposition 2.2 implies that each graph in F1 is F3 -free. The other implication is much more complex. Suppose G is F3 -free. Let W = {a, b, c} be a clique of cardinality 3. For each X ⊆ {a, b, c}, let VX = {u ∈ V (G) : NG (u) ∩ {a, b, c} = X}. Note that V∅ denote the vertex set whose vertices are not adjacent with a vertex in {a, b, c}. Since ω(G) = 3, then the vertex set Va,b,c is empty, and for each pair {x, y} ⊂ {a, b, c}, the vertex set Vx,y induces a stable set. Furthermore Claim 4.1. For x ∈ {a, b, c}, the induced subgraph G[Vx ] is isomorphic to either Km,n , 2K2 , K2 +K1 , or Tn . Proof. First consider K3 , P4 , K2 + T2 and P3 + T1 as induced subgraphs of G[Vx ]. Since G[K3 ∪ x] ≃ K4 , G[P4 ∪ {x, y}] ≃ G6,12 , G[K2 + T2 ∪ {a, b, c}] ≃ G7,1 , G[P3 + T1 ∪ {x, y}] ≃ G6,4 and all of them are forbidden for G, then the graphs K3 , P4 , K2 + T2 and P3 + T1 are forbidden in G[Vx ]. Thus ω(G[Vx ]) ≤ 2. If ω(G[Vx ]) = 2, then there exist u, v ∈ Vx such that uv ∈ E(G[Vx ]). Clearly, NG[Vx ] (u) ∩ NG[Vx ] (v) = ∅, and each vertex set NG[Vx ] (u) and NG[Vx ] (u) induces a trivial subgraph. Since G[Vx ] is P4 -free, then st ∈ E(Vx ) for all s ∈ NVx (u) \ {v} and t ∈ NVx (v) \ {u}. Therefore, each component in G[Vx ] is a complete bipartite subgraph. If a component in G[Vx ] has cardinality at least three, then G[Vx ] does not have another component, because the existence of another component makes that P3 + T1 appears as an induced subgraph in G[Vx ]; which is impossible. If there is a component in G[Vx ] of cardinality at least two, then there is at most another component in G[Vx ] since K2 + T2 is forbidden in G[Vx ]. And thus the result turns out.  Claim 4.2. If there is x ∈ {a, b, c} such that the induced subgraph G[Vx ] has at least 2 components or is isomorphic to a complete bipartite with at least three vertices, then the vertex set Vy is empty for each y ∈ {a, b, c} − x. Proof. Let G[Vx ] be as above. Then there are two vertices u, v ∈ Vx that are not adjacent. Suppose Vy is not empty, that is, there is w ∈ Vy . There are three possibilities: • uw, vw ∈ E(G), • uw ∈ E(G) and vw ∈ / E(G), and • uw, vw ∈ / E(G). But in each case the vertex set {a, b, c, u, v, w} induces a graph isomorphic to G6,15 , G6,11 , and G6,2 , respectively. Since these graphs are forbidden, then we obtain a contradiction and then Vy is empty.  Claim 4.3. If there is x ∈ {a, b, c} such that G[Vx ] has at least 2 components or is isomorphic to a complete bipartite with at least three vertices, then the vertex set Vx,y is empty for each y ∈ {a, b, c} − x. Proof. Let G[Vx ] be as above. Then there are two vertices u1 , u2 ∈ Vx that are not adjacent. Suppose Vx,y 6= ∅. Let v ∈ Vx,y . There are three possibilities: • u1 v ∈ E(G) and u2 v ∈ E(G), • u1 v ∈ E(G) and u2 v ∈ / E(G), and • u1 v ∈ / E(G) and u2 v ∈ / E(G). 10 CARLOS A. ALFARO AND CARLOS E. VALENCIA Then in each case, G[{a, b, c, u1 , u2 , v}] is isomorphic to G6,16 , G6,12 and G6,4 , respectively. Since these graphs are forbidden, we have that Vx,y is empty.  Remark 4.4. Claims 4.2 and 4.3 imply that when Vx has connected 2 components or is a complete bipartite graph of at least 3 vertices, then the only non-empty vertex sets are V∅ , Vx and Vy,z , where x, y and z are different elements of {a, b, c} Moreover, by Claim 4.1, the vertex set Vx is one of the following vertex sets: • Tn , where n ≥ 2, • complete bipartite graph with cardinality at least 3, • K1 + K2 or 2K2 . Next result describes the induced subgraph G[Va ∪ Vb ∪ Vc ] when each set Vx is connected of cardinality at most 2. Claim 4.5. Suppose for each x ∈ {a, b, c} the vertex set Vx is connected of cardinality at most 2. If for all x ∈ {a, b, c} the set Vx is not empty, then G[Va ∪ Vb ∪ Vc ] is isomorphic (where x, y and z are different elements of {a, b, c}) to one of the following sets: • Vx ∨ (Vy + Vz ) where Vx = K1 , Vy = Km , Vz = Kn and m, n ∈ {1, 2}, • Vx ∨ (Vy + Vz ) where Vx = K2 , Vy = K1 , Vz = K1 , or • Vx ∨ (Vy ∨ Vz ) where Vx = K1 , Vy = K1 , Vz = K1 . If Vz = ∅, then G[Vx ∪ Vy ] is isomorphic to one of the following sets: • Vx + Vy , where Vx = Km , Vy = Kn and m, n ∈ {1, 2}, or • Vx ∨ Vy , where Vx = K1 , Vy = Km and m ∈ {1, 2}. If Vy = Vz = ∅, then Vx is isomorphic to K1 or K2 . Proof. It is not difficult to prove that either E(Vx , Vy ) is empty or E(Vx , Vy ) induces a complete bipartite graph. The result follows by checking the possibilities with a computer algebra system.  In the rest of the proof, for each case obtained in Remark 4.4 and Claim 4.5, we will analyze the remaining edges sets and the vertex set V∅ . As before, we may refer to x, y or z as different elements of {a, b, c}. Each case will be consider in a subsection. 4.1. When Va ∪ Vb ∪ Vc = ∅. Now we describe the induced subgraph G[Va,b ∪ Va,c ∪ Vb,c ]. Claim 4.6. If the vertex sets Vx,y and Vy,z are not empty, and the edge set E(Vx,y , Vy,z ) is empty, then |Vx,y | = |Vy,z | = 1. Proof. Suppose |Vx,y | ≥ 2 and Vy,z 6= ∅. Take u, u′ ∈ Vx,y and v ∈ Vy,z . The result follows since the vertex set {a, b, c, u, u′ , v} induces a graph isomorphic to the forbidden graph G6,16 .  Claim 4.7. If E(Vx,y , Vy,z ) 6= ∅, E(Vx,y , Vx,z ) = ∅ and E(Vy,z , Vx,z ) = ∅, then Vx,z is empty. Proof. Let u ∈ Vx,y and v ∈ Vy,z such that uv ∈ E(G). Suppose there exists w ∈ Vx,z . Then uw, vw ∈ / E(G). Since the induced subgraph G[{a, b, c, u, w, v}] is isomorphic to G6,24 , then we get a contradiction. Then Vx,z is empty.  Claim 4.8. If E(Vx,y , Vy,z ) 6= ∅, then E(Vx,y , Vy,z ) induces either a complete bipartite graph or a complete bipartite graph minus an edge. SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 11 Proof. Let u ∈ Vx,y . Suppose there exist v, v ′ ∈ Vy,z such that uv, uv ′ ∈ / E(G). Since the induced subgraph G[{a, b, c, u, v, v ′ }] is isomorphic to G6,16 , which is forbidden, then the vertex u is adjacent with at least all but one vertices in Vy,z . In a similar way, we have that each vertex in Vy,z is adjacent with at at least all but one vertices in Vx,y . Therefore, the edge set E(Vx,y , Vy,z ) induces a complete bipartite graph minus a matching. Now suppose this matching has cardinality greater or equal to 2. Then there exist u, u′ ∈ Vx,y and v, v ′ ∈ Vy,z such that uv ′ , u′ v ∈ / E(G) and uv, u′ v ′ ∈ E(G). Since ′ ′ G[{v, u, x, u , v }] is isomorphic to P5 , then we get a contradiction and the matching has cardinality at most 1. Therefore, E(Vxy , Vy,z ) induces a complete bipartite graph or a complete bipartite graph minus an edge.  Claim 4.9. If E(Vx,y , Vy,z ) 6= ∅, E(Vy,z , Vx,z ) 6= ∅ and E(Vx,y , Vx,z ) = ∅, then Vx,y = {v1 }, Vx,z = {v2 } and one of the following two statements holds: • E(v1 , Vy,z ) = {v1 v : v ∈ Vy,z } and E(v2 , Vy,z ) = {v2 v : v ∈ Vy,z }, or • there exists v3 ∈ Vy,z such that E(v1 , Vy,z ) = {v1 v : v ∈ Vy,z − v3 } and E(v2 , Vy,z ) = {v2 v : v ∈ Vy,z − v3 }. Proof. Since there is no edge joining a vertex in Vx,y and a vertex in Vx,z , then Claim 4.6 implies that |Vx,y | = |Vx,z | = 1. Let Vx,y = {v1 } and Vx,z = {v2 }. By Claim 4.8, each edge set E(Vx,y , Vy,z ) and E(Vy,z , Vx,z ) induces either a complete bipartite graph or a complete bipartite graph minus an edge. If both sets E(Vx,y , Vy,z ) and E(Vy,z , Vx,z ) induce either a complete bipartite graph, then we are done. So it remains to check two cases: • when one edge set induces a complete bipartite graph and the other one induces a complete bipartite graph minus an edge, and • when both edge sets induce a complete bipartite graph minus an edge. First consider the former case. Suppose there exists v3 ∈ Vy,z such that E(v1 , Vy,z ) = {v1 v : v ∈ Vy,z − v3 } and E(v2 , Vy,z ) = {v2 v : v ∈ Vy,z }. Since G[{a, b, c, v1 , v2 , v3 }] is isomorphic to G6,24 , then this case is not possible. Now consider second case. Let v3 , v4 ∈ Vy,z . There are two possible cases: either v1 v3 , v2 v3 ∈ / E(G), or v1 v3 , v2 v4 ∈ / E(G). Suppose v1 v3 , v2 v4 ∈ / E(G). Since G[{v4 , v1 , z, v2 , v3 }] is isomorphic to P5 , then this case is impossible. And therefore v1 v3 , v2 v3 ∈ / E(G).  Claim 4.10. If each edge set E(Vx,y , Vy,z ) is not empty, then the induced subgraph G[Va,b ∪Va,c ∪Vb,c ] is isomorphic to one of the following graphs: • a complete tripartite graph, • a complete tripartite graph minus an edge, or • a complete tripartite graph minus the edges v1 v2 , v2 v3 , v3 v1 , where v1 ∈ Vx,y , v2 ∈ Vy,z , v3 ∈ Vx,z . Proof. By Claim 4.8, the induced subgraph G[Va,b ∪ Va,c ∪ Vb,c ] is a complete tripartite graph minus at most three edges. We will analyze the cases where 2 or 3 edges have been removed. Suppose G[Va,b ∪ Va,c ∪ Vb,c ] induces a complete tripartite graph minus 2 edges. Since E(Vx,y , Vy,z ) induces complete bipartite graph or complete bipartite graph minus an edge, then the 2 edges cannot be removed from a unique edge set E(Vx,y , Vy,z ). Then there are two possibilities: • there exist u, u′ ∈ Vx,y , v ∈ Vy,z and w ∈ Vx,z such that uv, u′ w ∈ / E(G), or • there exist u ∈ Vxy , v ∈ Vy,z and w ∈ Vx,z such that uv, uw ∈ / E(G). In the first case the graph induced by the set {x, v, u, u′ , w, z} is isomorphic to the forbidden graph G6,17 ; which is impossible. And in the second case, the the induced subgraph G[{a, b, c, u, v, w}] is 12 CARLOS A. ALFARO AND CARLOS E. VALENCIA isomorphic to G6,13 , which is impossible. Thus the case where 2 edges are removed from G[Va,b ∪ Va,c ∪ Vb,c ] is not possible. Suppose G[Va,b ∪ Va,c ∪ Vb,c ] is a complete tripartite graph minus 3 edges. Since E(Vx,y , Vy,z ) induces a complete bipartite graph or a complete bipartite graph minus an edge, then the 3 edges cannot be removed from a unique edge set E(Vx,y , Vy,z ). Thus there are four possible cases: (a) (b) (c) (d) v1 v4 , v3 v6 , v5 v2 v1 v3 , v2 v5 , v5 v4 v2 v4 , v4 v5 , v5 v2 v1 v3 , v3 v5 , v5 v2 ∈ / E(G), ∈ / E(G), ∈ / E(G), ∈ / E(G), where where where where v1 , v2 v1 , v2 v1 , v2 v1 , v2 ∈ Vx,y , ∈ Vx,y , ∈ Vx,y , ∈ Vx,y , v3 , v4 v3 , v4 v3 , v4 v3 , v4 ∈ Vy,z ∈ Vy,z ∈ Vy,z ∈ Vy,z and and and and v5 , v6 ∈ Vx,z v5 ∈ Vx,z v5 ∈ Vx,z and v5 ∈ Vx,z . Cases (a), (b) and (d) are impossible, the argument is the following. Case (a) is impossible because the induced subgraph G[{v2 , v3 , v5 , v6 , x, y}] is isomorphic to the forbidden graph G6,17 . In case (b), the induced subgraph G[{v2 , v5 , v4 , a, b, c}] is isomorphic to the forbidden graph G6,24 . And in case (d), the induced subgraph G[{v2 , v3 , v5 , a, b, c}] is isomorphic to the forbidden graph G6,24 . Thus when 3 edges are removed the only possible case is (c).  By previous Claims we have the following cases: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) when the set Vx,y is the only not empty set, when Vx,z = ∅, Vx,y = {vxy }, Vy,z = {vyz } and vxy vyz ∈ / E(G), when Vx,z = ∅ and E(Vx,y , Vy,z ) induces a bipartite complete graph, when Vx,z = ∅ and E(Vx,y , Vy,z ) induces a bipartite complete graph minus an edge, when Va,b = {vab }, Va,c = {vac }, Vb,c = {vbc } and vab vac , vab vbc , vac vbc ∈ / E(G), when Vx,z = {vxz }, Vy,z = {vyz }, vxz vyz ∈ / E(G), and the edge sets E(vxz , Vx,y ) and E(vyz , Vx,y ) induce a complete bipartite graph, when Vx,z = {vxz }, Vy,z = {vyz }, vxz vyz ∈ / E(G), and there exists vxy ∈ Vx,y such that E(vxz , Vx,y ) = {vxz v : v ∈ Vx,y − vxy } and E(vyz , Vx,y ) = {vyz v : v ∈ Vx,y − vxy }. when G[Va,b ∪ Va,c ∪ Vb,c ] is isomorphic to a complete tripartite graph, when G[Va,b ∪ Va,c ∪ Vb,c ] is isomorphic to a complete tripartite graph minus an edge, when G[Va,b ∪ Va,c ∪ Vb,c ] is isomorphic to a complete tripartite graph, where v1 ∈ Vx,y , v2 ∈ Vy,z , v3 ∈ Vx,z and v1 v2 , v2 v3 , v3 v1 ∈ / E(G). Now we describe the vertex set V∅ . Remark 4.11. Let w, w′ ∈ V∅ . Suppose w is adjacent with a vertex in Vx,y and with w′ . Then the vertex w′ is adjacent with a vertex in Vx,y , because otherwise the shortest path from w′ to z would contains a graph isomorphic to P5 . Thus each vertex in V∅ is adjacent with a vertex in Vx,y for some {x, y} ⊂ {a, b, c}. Claim 4.12. If w ∈ V∅ is adjacent with v ∈ Vx,y , then either w is adjacent only with v and with no other vertex in Vx,y , or w is adjacent with each vertex in Vx,y . Moreover, if each vertex in V∅ is adjacent with a vertex in Vx,y , then either exists a vertex v ∈ Vv,x such that each vertex in V∅ is adjacent with v, or each vertex in V∅ is adjacent with each vertex in Vx,y . Proof. Since the first statement is easy when Vx,y has cardinality at most 2, then we assume that Vx,y has cardinality at least 3. Let v ′ , v ′′ ∈ Vx,y . Suppose w is adjacent with v and v ′ but not adjacent with v ′′ . Since G[{x, z, v, v ′ , v ′′ , w}] is isomorphic to G6,3 , then we get a contradiction. And then w is adjacent only with v or with v, v ′ and v ′′ . Let w, w′ ∈ V∅ . Suppose there is v ∈ Vx,y such that wv ∈ E(G) and w′ v ∈ / E(G). The vertex w is ′ not adjacent with w , because otherwise by Remark 4.11 we get a contradiction. Let v ′ ∈ Vx,y such that w′ is adjacent with w′ . Thus there are two possible cases: SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 13 • ww′ , wv ′ ∈ / E(G), and • wv ′ ∈ E(G) and ww′ ∈ / E(G). Since in the first case G[{w, v, x, v ′ , w′ }] is isomorphic to P5 and in the second case G[{x, z, v, v ′ , w, w′ }] is isomorphic to G6,9 , then we get a contradiction and thus there is no vertex in Vx,y adjacent with a vertex in V∅ and not adjacent with other vertex in V∅ .  Claim 4.13. Let v ∈ Vx,y . If each vertex in V∅ is adjacent with v, then V∅ induces either K2 or it is a trivial graph. If furthermore there exists v ′ ∈ Vx,y such that no vertex in V∅ is adjacent with v ′ , then V∅ is a clique of cardinality at most 2. Proof. First note that P3 is forbidden as induced subgraph in G[V∅ ]. It is because if the vertices w1 , w2 , w3 ∈ V∅ induce a graph isomorphic to P3 , then G[{x, y, v, w1 , w2 , w3 }] ≃ G6,7 . Now we will see that each component in G[V∅ ] is a clique. Let C be a component in G[V∅ ]. Suppose C is not a clique, then there are two vertices not adjacent in C, say w and w′ . Let P be the smallest path contained in C between w and w′ . The length of P is greater or equal to 3. So P3 is an induced subgraph of P , and hence of C. Which is a contradiction, and therefore, C is a clique. On the other hand, the graph K2 + K1 is forbidden as induced subgraph in G[V∅ ]. It is because if w1 , w2 , w3 ∈ V∅ such that G[{w1 , w2 , w3 }] ≃ K2 + K1 , then G[{x, y, v, w1 , w2 , w3 }] ≃ G6,8 . Therefore, if G[V∅ ] has more than one component, then each component has cardinality one. Let v, v ′ ∈ Vx,y such that each vertex in V∅ is adjacent with v, and no vertex in V∅ is adjacent with v ′ . Suppose V∅ induces a stable set of cardinality at least 2. Take w, w′ ∈ V∅ . Then we get a contradiction since the induced graph G[{w, w′ , v, v ′ , x, z}] is isomorphic to G6,1 . Thus V∅ is a clique of cardinality at most 2.  Thus by Claims 4.12 and 4.13, in case (1) we have the following possible cases: • V∅ is a clique of cardinality at most 2, and each vertex in V∅ is adjacent with only one vertex in Vx,y , and • V∅ is a trivial graph and E(V∅ , Vx,y ) induces a complete bipartite graph. Note that these graphs are isomorphic to an induced subgraph of a graph in F11 . Claim 4.14. If E(Vx,y , Vy,z ) = ∅ and E(V∅ , Vx,y ∪ Vy,z ) 6= ∅, then V∅ is a clique of cardinality at most 2, and each vertex in V∅ is adjacent each vertex in Vx,y ∪ Vy,z Proof. Let vxy ∈ Vx,y , vyz ∈ Vy,z such that vxy vyz ∈ / E(G). It is easy to see that if w is adjacent with vxy or vyz , then w is adjacent with both vertices, because otherwise G has an induced subgraph isomorphic to P5 . Thus each vertex in V∅ is adjacent with each vertex in Vx,y ∪ Vy,z . Now suppose w, w′ ∈ V∅ such that w and w′ are not adjacent. Since the induced subgraph G[{w, w′ , x, y, vxy , vyz }] is isomorphic to G6,15 , then we get a contradiction and V∅ induces a clique of cardinality at most 2.  By previous Claim we get that in case (2), V∅ is a clique of cardinality at most 2 and each vertex in V∅ is adjacent each vertex in Vx,y ∪ Vy,z . This graph is isomorphic to an induced subgraph of a graph in F11 . Claim 4.15. If the edge set E(Vx,y , Vy,z ) induces a complete bipartite graph and E(V∅ , Vx,y ∪Vy,z ) 6= ∅, then V∅ is a clique of cardinality at most 2, and each vertex in V∅ is adjacent only to one vertex in Vx,y ∪ Vy,z . 14 CARLOS A. ALFARO AND CARLOS E. VALENCIA Proof. First we prove that there each vertex in V∅ is adjacent with a vertex in only one of the sets Vx,y or Vy,z . Suppose there exists a vertex w ∈ V∅ adjacent with v ∈ Vx,y and u ∈ Vy,z . Since the induced subgraph G[{w, a, b, c, v, u}] is isomorphic to G6,24 , then we get a contradiction and each vertex in V∅ is adjacent only with vertices of one of the vertex sets Vx,y or Vy,z . Suppose there are two vertices w, w′ ∈ V∅ such that w is adjacent with v ∈ Vx,y , and w′ is adjacent with u ∈ Vy,z . Since G[{w, w′ , u, v, x, z}] is isomorphic to G6,9 , then this is impossible and the vertices of V∅ are adjacent only to vertices in one of the vertex sets either Vx,y or Vy,z . Now suppose that w ∈ V∅ is adjacent with two vertices in Vx,y , say v and v ′ . Take u ∈ Vy,z . So u is adjacent with both v and v ′ . Since the induced subgraph G[{w, v, v ′ , u, a, b, c}] is isomorphic to G7,10 , then this cannot occur. Thus each vertex in V∅ is adjacent only with one vertex in Vx,y ∪ Vy,z . Finally suppose V∅ induces a trivial graph of cardinality at least 2. Let w, w′ ∈ V∅ adjacent with v ∈ Vx,y . Take u ∈ Vy,z , so u is adjacent with both v. Since the induced subgraph G[{w, w, v, u, x, z}] is isomorphic to G6,6 , we get a contradiction and the result follows.  By previous Claim we have that in case (3) the vertex set V∅ induces a clique of cardinality at most 2 and each vertex in V∅ is adjacent only to one vertex in Vx,y ∪ Vy,z . In this case, the graph is isomorphic to an induced subgraph of a graph in F11 . Claim 4.16. Let u ∈ Vx,y and v, v ′ ∈ Vy,z such that u is adjacent with v but not with v ′ . If w ∈ V∅ , then w is not adjacent with v. Proof. Suppose w is adjacent with v. Note that if w is adjacent with u or v ′ , then w is adjacent with both u and v ′ . Thus there are two cases: either w is adjacent only with v, or w is adjacent with v, v ′ and u. Both cases are impossible because in the former case G[{x, z, u, v, v ′ , w}] is isomorphic to G6,9 , meanwhile in the second case G[{y, z, u, v, v ′ , w}] is isomorphic to G6,17 ; which is a contradiction.  Consider case (4). Let u ∈ Vx,y and v ∈ Vy,z such that u is not adjacent with v. By Claim 4.16, each vertex in V∅ is adjacent with u or with v. It is not difficult to see that in fact each vertex in V∅ is adjacent with both u and v, because otherwise G would contain P5 as induced subgraph. By applying Claim 4.14 to the induced subgraph G[{u, v} ∪ V∅ ], we get that V∅ is a clique of cardinality at most 2. And this graph is isomorphic to an induced subgraph of a graph in F11 . Now consider case (5), by Claim 4.14, we get that V∅ is a clique of cardinality at most 2, and each vertex in V∅ is adjacent each vertex in Va,b ∪ Vb,c ∪ Va,c . And this graph is isomorphic to an induced subgraph of a graph in F11 . Claim 4.17. Let u1 ∈ Vx,y , u2 ∈ Vy,z and u3 ∈ Vx,z such that u1 is adjacent with both u2 and u3 , and u2 u3 ∈ / E(G). If w ∈ V∅ , then w is not adjacent with u1 . Proof. Suppose w is adjacent with u1 . Note that if w is adjacent with u2 or u3 , then w is adjacent with both u2 and u3 . Thus there are two cases: either w is adjacent only with u1 , or w is adjacent with u1 , u2 and u3 . Both cases are impossible because in the former case G[{x, y, u1 , u2 , u3 , w}] is isomorphic to G6,12 , meanwhile in the second case G[{x, z, u1 , u2 , u3 , w}] is isomorphic to G6,25 ; which is a contradiction.  Consider the Cases (6) and (9). Let vxz ∈ Vx,z and vyz ∈ Vy,z such that vxz is not adjacent with vyz . By Claims 4.14 and 4.17, each vertex in V∅ is adjacent only with both vxz and vyz . And by Claim 4.14, we get that V∅ is a clique of cardinality at most 2. And these graphs are isomorphic to an induced subgraph of a graph in F11 . Now consider the Case (7) and (10). Let vxy ∈ Vx,y , vxz ∈ Vx,z and vyz ∈ Vy,z such that vxy is not adjacent with vxz and vyz , and vxz is not adjacent with vyz . By Claims 4.17 and 4.14, each vertex in SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 15 V∅ is adjacent only with vxy , vxz and vyz . And by Claim 4.14, we get that V∅ is a clique of cardinality at most 2. And these graphs are isomorphic to an induced subgraph of a graph in F11 . Finally in the case (8), by Claim 4.15 we have that the vertex set V∅ is a clique of cardinality at most 2 and each vertex in V∅ is adjacent with only one vertex in Va,b ∪ Vb,c ∪ Va,c . This case corresponds to a graph that is isomorphic to an induced subgraph of a graph in F11 . 4.2. Case Vx = Tn , where n ≥ 2. First we will obtain that E(Vx , Vy,z ) satisfies one of the following statements: • it induces a complete bipartite graph, • there exists a vertex s ∈ Vx , we called the apex, such that E(Vx , Vy,z ) = {uv : u ∈ Vx − s and v ∈ Vy,z }, or • there exists a vertex s ∈ Vy,z , we called the apex, such that E(Vx , Vy,z ) = {uv : u ∈ Vx and v ∈ Vy,z − s}. To do it, we will prove the following claims. Claim 4.18. Let u1 , u2 ∈ Vx and v1 , v2 ∈ Vy,z such that u1 v1 , u2 v2 ∈ / E(G). Then either u1 = u2 or v1 = v2 . Proof. Suppose u1 6= u2 and v1 6= v2 . There are three possible cases: • u1 v2 , u2 v1 ∈ / E(G), • u1 v2 ∈ / E(G) and u2 v1 ∈ E(G), or • u1 v2 , u2 v1 ∈ E(G). The first two cases are not possible since the induced subgraph G[{x, y, u1 , u2 , v1 , v2 }] would be isomorphic to G6,1 and G6,9 , respectively. In the last case, the induced subgraph G[{x, u1 , u2 , v1 , v2 }] is isomorphic to P5 ; which is impossible. Thus the result follows.  The last claim implies that all non-edges in E(Vx , Vy,z ) are incident to a one vertex: the apex s. Suppose the vertex s is in Vx , and there are vertices v1 , v2 ∈ Vy,z such that sv1 ∈ E(G), and sv2 ∈ / E(G). By Claim 4.18, each vertex in Vx − s is adjacent with v1 and v2 . Then the induced subgraph G[{a, b, c, u1 , u2 , v1 , v2 }] ≃ G7,9 , that is impossible. This implies that if the vertex s ∈ Vx is not adjacent with a vertex in Vy,z , then s is not adjacent with all vertices in Vy,z . A similar argument yields that if the apex vertex s is in Vy,z and s is not adjacent with a vertex in Vx , then s is not adjacent with all vertices in Vx . Thus, we have three cases: (a) E(Vx , Vy,z ) is complete bipartite minus the edges between a vertex s (the apex) in Vx and all vertices of Vy,z , (b) E(Vx , Vy,z ) is complete bipartite minus the edges between a vertex s (the apex) in Vy,z and all vertices in Vx , and (c) E(Vx , Vy,z ) is complete bipartite. Claim 4.19. If |Vx | ≥ 3 and v ∈ Vy,z , then E(v, Vx ) either it induces a complete bipartite graph or it is empty. Proof. Let u1 , u2 , u3 ∈ Vx . Suppose one of the two following possibilities happen: vu1 ∈ E(G) and vu2 , vu3 ∈ / E(G) , or vu1 , vu2 ∈ E(G) and vu3 ∈ / E(G). In the first case the induced subgraph G[{u1 , u2 , u3 , v, x, y}] is isomorphic to G6,3 , meanwhile in the second case the induced subgraph G[{u1 , u2 , u3 , v, x, y, z}] is isomorphic to G7,2 . Then both cases cannot occur, and we get the result.  16 CARLOS A. ALFARO AND CARLOS E. VALENCIA Thus case (a) occur only when |Vx | = 2. In what follows we describe the vertex set V∅ , that is, the vertex set whose vertices have no edge in common with the vertex set {a, b, c}. Remark 4.20. Let w ∈ V∅ . The vertex w is adjacent with a vertex in Vx ∪Vy,z , because otherwise the shortest path from w to {a, b, c} would contains the graph P5 as induced subgraph. Let u1 , u2 ∈ Vx . If w is adjacent with u1 or u2 , then w is adjacent with both vertices, because otherwise the induced subgraph G[{a, b, c, u1 , u2 , w}] would be isomorphic to G6,6 , which is forbidden. In case (a), we will see that each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z . Let w in V∅ . Supppose s ∈ Vx is the vertex that is not adjacent with any vertex in Vy,z . If w ∈ V∅ is adjacent with one of the vertices in {s} ∪ Vy,z , then w must to be adjacent with s and each vertex in Vy,z , because otherwise let v ∈ Vy,z , then the induced subgraph G[{x, y, s, w, v}] would be isomorphic to P5 . Then by Remark 4.20, w is adjacent with each vertex in Vx ∪ Vy,z . Claim 4.21. The vertex set V∅ induces a stable set. Proof. Suppose w1 , w2 ∈ V∅ are adjacent. Since both w1 and w2 are adjacent with u ∈ Vx − s and v ∈ Vy,z , then the induced subgraph G[{u, v, w1 , w2 }] is isomorphic to K4 ; which is forbidden. Thus w1 and w2 are not adjacent, and therefore V∅ is a stable set.  Thus this case corresponds to a graph that is isomorphic to an induced subgraph of a graph in F11 . Now consider case (b). Let u1 , u2 ∈ Vx and s ∈ Vy,z such that s is not adjacent with u1 and u2 . Claim 4.22. If w ∈ V∅ is adjacent with a vertex in Vy,z \ {s}, then each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z . Proof. Let w ∈ V∅ . Suppose w is adjacent with v ∈ Vy,z \ {s}. If w is not adjacent with both vertices u1 , u2 ∈ Vx , then we get that the induced subgraph G[{a, b, c, w, u1 , u2 , v}] is isomorphic to G7,2 , which cannot be. Thus w is adjacent with at least one vertex in Vx . Then by Remark 4.20, w is adjacent with both vertices u1 and u2 . If there exist v ′ ∈ Vy,z \ {s} such that w is not adjacent with v ′ , then the vertex set {w, u1 , x, y, v, v ′ } would induce a graph isomorphic to G6,15 . On the other hand, if w is not adjacent with s, then the vertex set {w, u1 , x, y, s} induces the subgraph P5 . Therefore, w is adjacent with each vertex in Vx ∪ Vy,z . Suppose there is another vertex w′ ∈ V∅ . By the above argument if w′ is adjacent with a vertex in Vy,z \ {s}, then it must be adjacent with each vertex in Vx ∪ Vy,z . Also if w′ is adjacent with a vertex in {s} ∪ Vx , then w′ must be adjacent with each vertex in {s} ∪ Vx . So suppose w′ is adjacent with each vertex in s ∪ Vx and w′ is not adjacent with each vertex in Vy,z \ {s}. Then there are two possibilities: either ww′ ∈ / E(G) or ww′ ∈ E(G). Let v ∈ Vy,z \ {s}. In the first case ′ G[{x, y, s, v, w, w }] ≃ G6,15 and in the second case G[{x, y, v, w, w′ }] ≃ P5 . Since both graphs are forbidden, then we get a contradiction and thus w′ is adjacent with v. And therefore w′ is adjacent with each vertex in Vx ∪ Vy,z .  Claim 4.23. Either each vertex in V∅ is adjacent with each vertex in Vx ∪ {s}, or each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z . Proof. Let w ∈ V∅ . Clearly, if w is adjacent with a vertex in Vx ∪ {v}, then w is adjacent with each vertex in Vx ∪ {v}, because otherwise P5 would be an induced subgraph. By Claim 4.22, we have that if there is a vertex w ∈ V∅ adjacent with a vertex in Vy,z , different to the apex s, then each vertex in V∅ is adjacent with each vertex in Vx and Vy,z \ {s}. Thus we get the result.  SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 17 Claim 4.24. The vertex set V∅ induces either a clique of cardinality at most 2 or a trivial graph. Proof. First note that P3 is forbidden as induced subgraph in V∅ . It is because if w1 , w2 , w3 ∈ V∅ induce P3 , then G[{x, y, u1 , w1 , w2 , w3 }] ≃ G6,7 . Now we will get that each component in G[V∅ ] is a clique. Let C be a component in G[V∅ ]. Suppose C is not a clique, then it has two vertices not adjacent, say u and v. Let P be the smallest path in C between u and v. Thus the length of P is greater or equal to 3. So P3 is an induced subgraph of P , and hence of C. Therefore, C is a complete graph. On the other hand, the graph K2 + K1 is forbidden for G[V∅ ]. It is because if w1 , w2 , w3 ∈ V∅ such that G[{w1 , w2 , w3 }] ≃ K2 + K1 , then G[{x, y, u1 , w1 , w2 , w3 }] ≃ G6,8 ; which cannot happen. Therefore, if G[V∅ ] has more than one component, then each component has cardinality one.  In the first case of Claim 4.23, if |Vy,z | ≥ 2, then V∅ is either K1 or K2 , because if u1 ∈ Vx , v ∈ Vy,z \ {s}, and w1 , w2 ∈ V∅ are adjacent, then G[{w1 , w2 , u1 , v, x, y}] ≃ G6,3 . Otherwise if Vy,z = {s}, then both possibilities in Claim 4.24 are allowed. In the second case of Claim 4.23, if |Vy,z | ≥ 3, we have that V∅ = ∅, because if w ∈ V∅ is adjacent with u1 , u2 ∈ Vx and with two vertices v1 , v2 ∈ Vy,z \ {s}, we get G[{x, y, u1 , u2 , v1 , v2 , w}] ≃ G7,13 as forbidden subgraph. If |Vy,z | = 2, then V∅ is trivial since ω(G) = 3. And if Vy,z = {s}, then both possibilities in Claim 4.24 are allowed. With no much effort the reader can see that each of these cases corresponds to a graph isomorphic to an induced subgraph of a graph in F11 . Case (c). By Claim 4.23, there are two possible cases: • either each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z , or • each vertex in V∅ is adjacent with each vertex in Vx , and no vertex in V∅ is adjacent with any vertex in Vy,z . In first case when |Vy,z | ≥ 2, the vertex set V∅ is empty. Because if w ∈ V∅ is adjacent with the vertices v1 , v2 ∈ Vy,z , and u1 , u2 ∈ Vx , then the induced subgraph G[{x, y, u1 , u2 , v1 , v2 , w}] ≃ G7,13 which is forbidden. Then the vertex set V∅ is empty. Otherwise when |Vy,z | = 1, then the vertex set V∅ must be a stable set, because if there exist two adjacent vertices in V∅ , then by taking a vertex in Vx and a vertex in Vy,z we get K4 that is forbidden. Finally, in the case when each vertex in V∅ is adjacent with each vertex in Vx , and no vertex in V∅ is adjacent with a vertex in Vy,z , we get that V∅ is a clique of cardinality at most 2. It is because if w1 , w2 ∈ V∅ are such that w1 w2 ∈ / E(G), then we get G[{w1 , w2 , u1 , v, x, y}] ≃ G6,3 that is forbidden. And each of these graphs are isomorphic to an induced subgraph of a graph in F11 . 4.3. Case Vx is a complete bipartite graph of cardinality at least 3. Assume Vx is a complete bipartite graph of cardinality at lest three with (A, B) the bipartition of Vx . Claim 4.25. If v ∈ Vy,z , then E(v, Vx ) 6= ∅. Proof. Suppose E(v, Vx ) = ∅. There exist u1 , u2 , u3 ∈ Vx such that G[{u1 , u2 , u3 }] ≃ P3 . And then we get contradiction since the induced subgraph G[{u1 , u2 , u3 , x, y, v}] ≃ G6,7 ; which is forbidden.  Claim 4.26. Let u ∈ Vx and v ∈ Vy,z . If u and v are adjacent, then v is adjacent with each vertex in the part (A or B) containing u. Proof. Suppose u ∈ A and v is not adjacent with any vertex in A \ {u}. If |A| = 1, then the result follows, so we may assume |A| ≥ 2. Since G[Vx ] is connected and has cardinality at least 3, then there exists u′ ∈ A and u′′ ∈ B such that G[{u, u′′ , u′ }] ≃ P3 . We have u′ and v are not adjacent. There are two possibilities: either u′′ v ∈ E(G) or u′′ v ∈ / E(G). In the first case 18 CARLOS A. ALFARO AND CARLOS E. VALENCIA the induced subgraph G[{u′ , u′′ .u, v, y}] is isomorphic to P5 , and in the second case the induced subgraph G[{x, y, u, u′ , u′′ , v}] is isomorphic to G6,17 . Since both cases are forbidden, we get a contradiction.  Previous Claims suggest to divide the vertex set Vy,z in three subsets: A , the vertices in V • Vy,z y,z that are adjacent with each vertex in A, B • Vy,z , the vertices in Vy,z that are adjacent with each vertex in B, and AB , the vertices in V • Vy,z y,z that are adjacent with each vertex in A ∪ B. In what follows, we assume |A| ≥ |B|. A and V B is no more than 1. Claim 4.27. The cardinality of the sets Vy,z y,z A . Let u ∈ A, and u′ ∈ B. Since G[{u, u′ , v, v ′ , x, y}] is Proof. Suppose there exist v, v ′ ∈ Vy,z B is similar. isomorphic to G6,15 , which is forbidden, then we get a contradiction. The case Vy,z  B or V AB is empty. Claim 4.28. If |B| ≥ 2 and Vy,z 6= ∅, then one of the sets Vy,z y,z B and v ′ ∈ V AB . Let u, u′ ∈ B, and u′′ ∈ A. Thus G[{v, v ′ , u, u′ , u′′ , x, y}] ≃ Proof. Suppose v ∈ Vy,z y,z G7,13 . Which is impossible.  A or V AB is empty. Since |A| ≥ 2, then by applying previous Claim to A, one of the sets Vy,z y,z Thus the possible cases we have are the following: (a) (b) (c) (d) (e) (f) Vy,z = ∅, B ∪ V AB = ∅ and |V A | = 1, Vy,z y,z y,z A AB = ∅ and |V B | = 1, Vy,z ∪ Vy,z y,z AB = ∅ and |V A | = |V B | = 1, Vy,z y,z y,z A = ∅, |B| = 1, |V B | = 1 and |V AB | ≥ 1, and Vy,z y,z y,z A ∪ V B = ∅ and |V AB | ≥ 1. Vy,z y,z y,z Now we describe V∅ , that is, the set of vertices not adjacent with any vertex in {a, b, c}. Let w ∈ V∅ . The vertex w is adjacent with a vertex in Vx ∪ Vy,z , because otherwise the shortest path from w to {x, y} would contains the graph P5 as induced subgraph. Claim 4.29. Let w ∈ V∅ . If w is adjacent with a vertex in Vx , then w is adjacent with each vertex in the parts of the partition (A, B) with cardinality greater or equal to 2. Proof. Let v ∈ Vx be a vertex adjacent with w. Suppose v ∈ B. we will prove two things: (1) if |B| ≥ 2, then w is adjacent with each vertex in B, and (2) w is adjacent with each vertex in A. Let us consider case when |B| ≥ 2. We will see that w is adjacent with each vertex in B. Suppose there is a vertex v ′ ∈ B not adjacent with w. Take u ∈ A. Thus there are two possibilities: either u and w are adjacent or not. The case uw ∈ E(G) is impossible because G[{u, v, v ′ , w, x, y}] ≃ G6,10 , which is forbidden. Meanwhile, the case uw ∈ / E(G) is impossible because G[{u, v, v ′ , w, x, y}] ≃ G6,14 , which is forbidden. Thus w is adjacent with v ′ , and therefore w is adjacent with each vertex in B. Now we see that w is adjacent with each vertex in A. Note that in this case |B| may be equal to 1. Suppose w is not adjacent with any vertex in A. Let u, u′ ∈ A. Since the induced subgraph G[{w, v, u, u′ , x, y}] is isomorphic to the forbidden graph G6,5 , then we get a contradiction. Thus w is adjacent with a vertex in A. Now applying the previous case (1) to A, we get that w is adjacent with each vertex in A.  SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 19 Next Claim show us what happens in the case when |B| = 1. Claim 4.30. If |B| = 1 and E(V∅ , Vx ) 6= ∅, then only one of the edges sets E(V∅ , Vx ) or E(V∅ , A) induces a complete bipartite graph. Proof. Let w, w′ ∈ V∅ , u ∈ B, and u′ ∈ A. By Claim 4.29, vertices w and w′ are adjacent with each vertex in A. Suppose w is adjacent with u, and w′ is not adjacent with u. There are two possibilities: either w and w′ are adjacent or not. If ww′ ∈ E(G), then the induced subgraph G[w, w′ , u, x, y] is isomorphic to P5 ; which is impossible. On the other hand, if ww′ ∈ / E(G), then G[{w, w′ , u, u′ , x, y}] is isomorphic to G6,10 , which is forbidden. So we get a contradiction, and the result follows.  Claim 4.31. Let w ∈ V∅ . If w is adjacent with v ∈ Vy,z , then w is adjacent with each vertex in A ∪ V AB and the parts of partition (A, B) with cardinality greater or equal to 2. Moreover, if v ∈ Vy,z y,z |B| = 1, then w is adjacent with the unique vertex in B. Proof. Let w ∈ V∅ and v ∈ Vy,z such that w and v are adjacent. By Claim 4.25, E(v, Vx ) 6= ∅, and A , v ∈ V AB , or v ∈ V B . therefore there are three cases: v ∈ Vy,z y,z y,z A . If E(w, V ) = ∅, then by taking u, u ∈ A, the forbidden induced subgraph Suppose v ∈ Vy,z x ′ G[W ∪ {w, v, u, u }] ≃ G7,2 would appear and we get a contradiction. Thus E(w, Vx ) 6= ∅. By Claim 4.29, w is adjacent with each vertex in the parts of Vx with cardinality greater or equal to 2. When |B| = 1, take u′′ ∈ B. If wu′′ ∈ / E(G), then G[{w, v, y, x, u′′ }] would be isomorphic to the forbidden graph P5 . Therefore, wu′′ ∈ E(G). AB . In a similar way than in previous case we get that E(w, V ) 6= ∅, and v is Suppose v ∈ Vy,z x adjacent with each vertex in the parts of the partition (A, B) of cardinality greater or equal to 2. In the case when |B| = 1, suppose u ∈ B with wu ∈ / E(G). Take u′ ∈ A, we know that u′ w ∈ E(G). Since G[{w, u, u′ , x, y, v}] ≃ G6,24 , then we get a contradiction. Thus wu ∈ E(G). B . It is easy to see that v is adjacent with each vertex in A, because otherwise Now suppose v ∈ Vy,z P5 would appear. Therefore E(w, Vx ) 6= ∅, and by Claim 4.29, we have that w is adjacent with each vertex in the parts of the partition (A, B) of cardinality greater or equal to 2.  AB ) = ∅. Moreover, if E(V , B) 6= ∅ and E(V , V B ) 6= ∅, Claim 4.32. If E(V∅ , B) 6= ∅, then E(V∅ , Vy,z ∅ ∅ y,z AB = ∅. then Vy,z AB . Suppose w and v are adjacent. Take u ∈ A and u ∈ B. Since v Proof. Let w ∈ V∅ and v ∈ Vy,z 1 2 AB is in Vy,z and u1 is adjacent with u2 , then G[{v, u1 , u2 }] is isomorphic to K3 . On the other hand, by Claims 4.29 and 4.30, w is adjacent with each vertex in A ∪ B. Thus the induced subgraph G[{w, v, u1 , u2 }] is isomorphic to K4 that is forbidden, and therefore w cannot be adjacent with v. B , and suppose there exists a vertex v ∈ V AB . Since w Let w is adjacent with u2 ∈ B and v ′ ∈ Vy,z y,z is not adjacent with v, then G[{w, v, v ′ , u2 , x, y}] is isomorphic to G6,15 ; which it is not possible.  Claim 4.33. Let w ∈ V∅ and v ∈ Vy,z . If w and v are adjacent, then each vertex in V∅ is adjacent with v. Proof. Suppose w′ ∈ V∅ such that w′ is not adjacent with v. By Claims 4.29 and 4.30, both vertices w and w′ are adjacent with each vertex in A. Let u ∈ A. There are four cases obtained by the A combinations of the following possible cases: either ww′ ∈ E(G) or ww′ ∈ / E(G), and either v ∈ Vy,z B . When ww ′ ∈ E(G) and v ∈ V B , the induced subgraph G[{w ′ , w, v, y, x}] is isomorphic to or v ∈ Vy,z y,z B , the induced subgraph G[{w ′ , u, w, v, y}] P5 ; which is not possible. When ww′ ∈ / E(G) and v ∈ Vy,z A , the induced subgraph is isomorphic to P5 ; which is not possible. When ww′ ∈ E(G) and v ∈ Vy,z 20 CARLOS A. ALFARO AND CARLOS E. VALENCIA A, G[{w′ , w, v, y, x}] is isomorphic to P5 ; which is not possible. Finally, when ww′ ∈ / E(G) and v ∈ Vy,z ′ ′ the induced subgraph G[{w , w, x, y, v, u}] is isomorphic to G6,11 ; which is not possible. Thus w is adjacent with v.  A and v ′ ∈ V B . If w ∈ V is adjacent with v or v ′ , then w is adjacent with Claim 4.34. Let v ∈ Vy,z ∅ y,z both v and v ′ . Proof. First suppose w is adjacent with v and not with v ′ . Let u ∈ A. By Claim 4.31, w is adjacent with a vertex u ∈ A. Thus G[{w, u, x, y, v ′ }] is isomorphic to P5 that is a contradiction. Therefore w and v ′ are adjacent. Now suppose w is adjacent with v ′ and not with v. Let u ∈ B. If u is adjacent with w, then a P5 is obtained in a similar way than previous case. Thus assume u is not adjacent with w. Then G[{w, x, y, u, v, v ′ }] is isomorphic to G6,9 ; which is impossible. Therefore, w and v are adjacent.  AB 6= ∅, then E(V , B) = ∅. Claim 4.35. If Vy,z ∅ AB . By Claim 4.29, w is adjacent with u and Proof. Let u1 , u2 ∈ A, u3 ∈ B, w ∈ V∅ and v ∈ Vy,z 1 u2 . Suppose w is adjacent with u3 . By Claim 4.32, the vertices w and v are not adjacent. Thus G[{x, y, u1 , u2 , u3 , v, w}] is isomorphic to G7,10 , which is a contradiction. Therefore, E(V∅ , B) = ∅.  Thus applying previous Claims to cases (a) - (f), we obtain the following possibilities: (1) (2) (3) (4) (5) (6) (7) (8) Vy,z = ∅, |B| = 1, and E(V∅ , A) induces a complete bipartite graph, Vy,z = ∅, |B| ≥ 1, and E(V∅ , Vx ) induces a complete bipartite graph, B ∪ V AB = ∅, |V A | = 1, |B| ≥ 1 and E(V , V ∪ V ) induces a complete bipartite graph, Vy,z y,z ∅ x y,z y,z A AB B Vy,z ∪ Vy,z = ∅, |Vy,z | = 1, |B| = 1 and E(V∅ , A ∪ Vy,z ) induces a complete bipartite graph, A ∪ V AB = ∅, |V B | = 1, |B| ≥ 1 and E(V , V ∪ V ) induces a complete bipartite graph, Vy,z y,z ∅ x y,z y,z AB = ∅, |V A | = |V B | = 1, |B| ≥ 1 and E(V , V ∪ V ) induces a complete bipartite graph, Vy,z x y,z ∅ y,z y,z A B AB Vy,z ∪ Vy,z = ∅, |Vy,z | ≥ 1, |B| = 1 and E(V∅ , A) induces a complete bipartite graph, A ∪V B = ∅, |V AB | ≥ 1, |V B | = 1, |B| = 1 and E(V , A∪V B ) induces a complete bipartite Vy,z ∅ y,z y,z y,z y,z graph. With a similar argument as in Claim 4.24, we obtain that V∅ is either trivial or K2 . In cases (1), (4), (7) and (8), V∅ cannot be Tn with n ≥ 2, since taking w, w′ ∈ V∅ , u ∈ A, u′ ∈ B, then G[{w, w′ , u, u′ , x, y}] ≃ G6,2 . On the other hand, since ω(G) = 3, then V∅ is not isomorphic to K2 in the cases (2), (3), (5) and (6). It is not difficult to see that in each case G is isomorphic to an induced subgraph of a graph in F11 . 4.4. Case when Vx induces K1 +K2 or 2K2 . Through this case we assume that Vx = {u1 , u2 , u3 , u4 } such that u1 u2 , u3 u4 ∈ E(G). That is, G[{u1 , u2 , u3 , u4 }] ≃ 2K2 . Let A = {u1 , u2 } and B = {u3 , u4 }. The following discussion also applies when one of the vertex set A or B has cardinality 1. Claim 4.36. If v ∈ Vy,z , then E(v, Vx ) 6= ∅. Moreover, if v ∈ Vy,z , then v is adjacent with each vertex in one of the following sets A, B or Vx . Proof. Suppose there is no edge joining v and a vertex in Vx . Since G[{u1 , u2 , u3 , x, y, v}] ≃ G6,6 is a forbidden induced subgraph, then a contradiction is obtained. Then v is adjacent with some vertex in Vx . Suppose v is adjacent with one of the vertices in A. We will prove that v cannot be adjacent only with one vertex of A, say u1 . Thus suppose v is adjacent with u1 , and v is not adjacent with u2 , u3 SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 21 and u4 . Since G[{u1 , u2 , u3 , v, x, y}] ≃ G6,11 , then v is adjacent with u2 or a vertex in B, say u3 . If v is adjacent with u2 , then we are done. So we assume v is adjacent with u1 , but v is not adjacent with u2 . This is not possible because G[{u1 , u2 , u3 , v, y, z}] ≃ G6,10 . Therefore, either v is adjacent with both u1 and u2 , or v is not adjacent with neither of u1 and u2  Claim 4.37. If |Vy,z | ≥ 2, then each vertex in Vy,z is adjacent with each vertex of only one of the following sets A, B or Vx . Proof. Let v, v ′ ∈ Vy,z . Consider the following cases: (a) v is adjacent with each vertex in A and v ′ is adjacent with each vertex in B, (b) v is adjacent with each vertex in Vx and v ′ is adjacent with each vertex in B, and (c) v is adjacent with each vertex in Vx and v ′ is adjacent with each vertex in A. Case (a) is impossible because G[{u1 , v, y, v ′ , u3 }] ≃ P5 , which is forbidden. On the other hand, cases (b) and (c) are not allowed because G[{a, b, c, v, v ′ , u1 , u3 }] ≃ G7,9 ; which is forbidden. Thus, the result follows.  Thus E(Vx , Vy,z ) satisfies only one of the following three cases: (1) E(Vy,z , A) induces a complete bipartite graph, (2) E(Vy,z , B) induces a complete bipartite graph, or (3) E(Vy,z , Vx ) induces a complete bipartite graph. Now we describe V∅ , the set of vertices not adjacent with any vertex in {a, b, c}. Let w ∈ V∅ . The vertex w is adjacent with a vertex in Vx ∪ Vy,z , because otherwise the shortest path from w to {x, y} would contains the graph P5 as induced subgraph. Claim 4.38. If w ∈ V∅ is adjacent with a vertex in Vx , then w is adjacent with each vertex in Vx . Proof. Suppose w is adjacent with u1 and not with u3 . Since G[W ∪ {w, u1 , u3 }] ≃ G7,4 is forbidden, w also must be adjacent with u3 . In a similar way we get the opposite case and it turns out the result.  Consider Cases (1) and (2). The following arguments works on both cases. First note that if there exists w ∈ V∅ adjacent with v ∈ Vy,z , then w is adjacent with each vertex in Vx . The reason is the following. Suppose w is not adjacent with any vertex in Vx . Since v is not adjacent with a vertex in Vx , say u, and the vertices w and u are not adjacent, then we have that G[{w, v, y, x, u}] ≃ P5 ; which is a contradiction. Then w and u are adjacent. And by Claim 4.38, the edge set E(w, Vx ) induces a complete bipartite graph. On the other hand, we can prove in a similar way that if there exists w ∈ V∅ adjacent with each vertex in Vx , then w is adjacent with each vertex in Vy,z . Therefore, each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z . Furthermore, the set V∅ is a stable set. It is because if w, w′ ∈ V∅ were adjacent, then by taking u ∈ Vx and v ∈ Vy,z such that u and v are adjacent, the induced subgraph G[{w, w′ , u, v, x, y}] would be isomorphic to G6,20 ; which is impossible. These cases correspond to a graph isomorphic to an induced subgraph of a graph in F11 . Now let us consider case (3). Claim 4.39. If w ∈ V∅ is adjacent with a vertex in Vy,z , then each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z . Proof. Let w ∈ V∅ and v ∈ Vy,z such that wv ∈ E(G). Suppose w is not adjacent with any vertex in Vx . Take u2 , u3 ∈ Vx such that u2 u3 ∈ E(G). Since the induced subgraph G[{a, b, c, w, u2 , u3 , v}] 22 CARLOS A. ALFARO AND CARLOS E. VALENCIA is isomorphic to G7,2 , then we get a contradiction; and w is adjacent with a vertex in Vx . Thus by Claim 4.38, w is adjacent with each vertex in Vx . Suppose that there exists v ′ ∈ Vy,z such that w is not adjacent with v ′ . Since the vertex set {w, u1 , x, y, v, v ′ } would induce G6,15 , this does not occur. Therefore, w is adjacent with each vertex in Vx ∪ Vy,z . Suppose there is another vertex w′ ∈ V∅ . By the above argument, if w′ is adjacent with a vertex in Vy,z , then it must be adjacent with each vertex in Vx ∪ Vy,z . And we are done. On the other hand, by Claim 4.38, if w′ is adjacent with a vertex in Vx , then w′ must be adjacent with each vertex in Vx . So suppose w′ is adjacent with each vertex in Vx , but not adjacent with each vertex in Vy,z . Then there are two possibilities: either ww′ ∈ / E(G) or ww′ ∈ E(G). In the first case ′ G[{x, y, u1 , v, w, w }] ≃ G6,11 and in the second case G[{x, y, v, w, w′ }] ≃ P5 . Since both graphs are forbidden, then w′ is adjacent with v. And therefore w′ is adjacent with each vertex in Vx ∪ Vy,z .  By Claims 4.38 and 4.39, we obtain that there are two possible cases: either each vertex in V∅ is adjacent with each vertex in Vx ∪ Vy,z , or each vertex in V∅ is adjacent only with each vertex in Vx . Consider first case. If there exists a vertex w ∈ V∅ , then w adjacent with the vertices v ∈ Vy,z , and u1 , u2 ∈ Vx . Thus G[{w, v, u1 , u2 }] is isomorphic to K4 that is not allowed, then V∅ is empty. Now consider second case. Let w ∈ V∅ and v ∈ Vy,z . Thus w is adjacent with u1 , u2 and u3 . Since G[{w, u1 , u2 , u3 , v, x, y}] is isomorphic to G7,9 , we get a contradiction. Then V∅ = ∅. The graph in this case is isomorphic to an induced subgraph of a graph in F11 . 4.5. Cases when G[Va ∪ Vb ∪ Vc ] = Vx ∨ (Vy + Vz ) is one of the following graphs: K1 ∨ 2K1 , K1 ∨ (K1 + K2 ), K1 ∨ 2K2 , or K2 ∨ 2K1 . For the sake of clarity, we suppose E(Va , Vb ) and E(Va , Vc ) induce a complete bipartite graph, and E(Vb , Vc ) is empty. Now we are going to obtain some claims that describe the edge sets joining Vx and Vy,z . Claim 4.40. Let x, y ∈ {a, b, c}. If E(Vx , Vy ) is not empty, then E(Vx , Vxy ) and E(Vy , Vxy ) are empty. Proof. Let vx ∈ Vx , vy ∈ Vy and vxy ∈ Vx,y . Suppose vxy is adjacent with both vx and vy . Then G[{a, b, c, vxy , vx , vy }] ≃ G6,24 ; which is a contradiction. Now suppose vxy is adjacent with vx and not with vy . In this case G[{a, b, c, vxy , vx , vy }] ≃ G6,17 ; which is impossible. And therefore result turns out.  Claim 4.40 implies that E(Va,b , Va ∪ Vb ) = ∅ and E(Va,c , Va ∪ Vc ) = ∅. Claim 4.41. Let x, y ∈ {a, b, c}. If Vx,y 6= ∅ and E(Vx , Vy ) = ∅, then each edge set E(Vx , Vx,y ) and E(Vy , Vx,y ) induces a complete bipartite graph. Proof. Let vx ∈ Vx , vy ∈ Vy and vxy ∈ Vx,y . Suppose vxy is not adjacent with both vx and vy . Then G[{a, b, c, vxy , vx , vy }] ≃ G6,5 ; which is a contradiction. Finally, suppose vxy is adjacent with vx and not with vy . Since G[{a, b, c, vx,y , vx , vy }] ≃ G6,14 is forbidden, then we get a contradiction. And the result turns out.  Claim 4.41 implies that each vertex in Vb,c is adjacent with each vertex in Vb ∪ Vc . Claim 4.42. If Vb,c 6= ∅, then E(Va , Vb,c ) is empty. Proof. Let va ∈ Va , vb ∈ Vb and vbc ∈ Vb,c . Suppose vbc is adjacent with va . Then G[{a, b, c, va , vb , vbc }] is isomorphic to G6,25 that is forbidden. Therefore, there is no edge joining a vertex in Va with a vertex in Vb,c .  SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 23 Claim 4.43. Let x ∈ {b, c}. If Va,x 6= ∅, then E(Va,x , Vx ) induces a complete bipartite graph. Proof. Let vb ∈ Vb , vc ∈ Vc and vax ∈ Va,x . Suppose vax is not adjacent with vx . Since G[{a, b, c, vax , vb , vc }] is isomorphic to G6,10 that is forbidden, then each vertex in Vx is adjacent with each vertex in Va,x .  Claim 4.44. The edge set E(Va,b , Va,c ) induces a complete bipartite graph. Proof. Let va ∈ Va , vb ∈ Vb , vab ∈ Va,b , and vac ∈ Va,c . We know that va is not adjacent with both vab and vac , and vb is adjacent with vac , but vb is not adjacent with vab . Suppose vab and vac are not adjacent. Then G[{b, c, va , vb , vab , vac , }] ≃ G6,9 ; which is impossible. And therefore, each vertex in Va,b is adjacent with each vertex in Va,c .  Claim 4.45. Let x ∈ {b, c} The edge set E(Va,x , Vb,c ) induces a complete bipartite graph. Proof. Let vb ∈ Vb , vc ∈ Vc , vax ∈ Va,x , and vbc ∈ Vb,c . We know that vb vbc , vbc vc , vc vab , vb vac ∈ E(G) and vx vax , vb vc ∈ / E(G). Suppose vax and vbc are not adjacent. Then G[{b, c, vb , vc , vax , vbc , }] ≃ G6,14 ; which is impossible. Therefore each vertex in Va,x is adjacent with each vertex in Vb,c .  Now we analyze V∅ . Claim 4.46. If w ∈ V∅ , then w cannot be adjacent with any vertex in Va ∪ Vb ∪ Vc . Proof. Let x ∈ {b, c}, y ∈ {b, c} − x, va ∈ Va and vx ∈ Vx . Suppose w ∈ V∅ such that E(w, Va ∪ Vb ∪ Vc ) 6= ∅. Consider the following cases: (a) w is adjacent only with va , (b) w is adjacent only with vx , or (c) w is adjacent with both va and vx . Cases (a) and (b) are impossible, because G would have P5 as induced subgraph obtained by G[{w, va , vx , x, y}] and G[{w, vx , va , a, y}], respectively. Finally in case (c), the induced subgraph G[{a, b, c, w, va , vx }] is isomorphic to G6,21 ; which is impossible.  Claim 4.47. There exists no vertex in V∅ adjacent with a vertex in Vb,c . Proof. Let w ∈ V∅ , va ∈ Va , vb ∈ Vb , vc ∈ Vc , and vbc ∈ Vb,c . Suppose w is adjacent with vbc . A contradiction is obtained since G[{w, va , vb , vc , vbc , w}] ≃ G6,11 . Thus w is not adjacent with any vertex in Vb,c  Claim 4.48. There exists no vertex in V∅ adjacent with a vertex in Va,b ∪ Va,c . Proof. Let x ∈ {b, c}, y ∈ {b, c} − x, va ∈ Va , vb ∈ Vb and vax ∈ Va,x . Suppose w is adjacent with vax . Since the induced subgraph G[{w, vax , va , vb , vc }] is isomorphic to G6,5 , then we get a contradiction. And then the result follows.  Claims 4.46, 4.47 and 4.48 imply that no vertex in V∅ is adjacent with a vertex in G \ V∅ , which implies that V∅ = ∅. Thus the graph is isomorphic to an induced subgraph of a graph in F11 . 4.6. Case G[Va ∪ Vb ∪ Vc ] = K1,1,1 , where each vertex set Vx = K1 . Let Va = {va }, Vb = {vb }, and Vc = {vc }. By Claim 4.40, the edge sets E(Vx,y , Vx ) and E(Vx,y , Vy ) are empty for x, y ∈ {a, b, c}. By Claim 4.42, the edge set E(Vx,y , Vz ) is empty for x, y, z ∈ {a, b, c}. Now let vxy ∈ Vx,y . Since G[{vy , vz , z, x, vx,y }] is isomorphic to P5 which is a forbidden, then Vxy is empty for each pair x, y ∈ {a, b, c}. On the other hand, by Claim 4.46 the edge set V∅ is empty. This graph is isomorphic to G1 , see Figure 1.i. 24 CARLOS A. ALFARO AND CARLOS E. VALENCIA 4.7. Case Vz = ∅ and G[Vx ∪ Vy ] = Vx + Vy , where Vx = Km , Vy = Kn and m, n ∈ {1, 2}. Without loss of generality, suppose Vc = ∅, and E(Va , Vb ) is empty. By Claim 4.41, each vertex in Va,b is adjacent with each vertex in Va ∪ Vb . Claim 4.49. Let x ∈ {a, b}. If Vx,c 6= ∅, then E(Vx , Vx,c ) = ∅. Proof. Let y ∈ {a, b} − x, vxc ∈ Vx,c , va ∈ Va and vb ∈ Vb . Suppose vx and vxc are adjacent. There are two possible cases: either vy and vxc are adjacent or not. Since in the first case G[{a, b, c, va , vb , vxc }] ≃ G6,17 and in the second case G[{va , vb , y, vxc , c}] is isomorphic to P5 , then we get a contradiction. Thus vx and vxc are not adjacent.  By Claim 4.43, each vertex in Va,c is adjacent with each vertex in Vb , and each vertex in Vb,c is adjacent with each vertex in Va . Claim 4.50. Each vertex in Va,b is adjacent with each vertex in Va,c ∪ Vb,c . Proof. Let vab ∈ Va,b , va ∈ Va and vb ∈ Vb . Suppose there exists vxc ∈ Vxc with x ∈ {a, b} such that vab vxc ∈ / E(G). Since G[{va , vb , vab , vxc , c}] is isomorphic to P5 , then we get a contradiction; and the vertices vab and vxc are adjacent. And the result turns out.  Claim 4.51. Each vertex in Va,c is adjacent with each vertex in Vb,c . Proof. Suppose there are vac ∈ Va,c and vbc ∈ Vb,c such that vbc vac ∈ / E(G). Let va ∈ Va and vb ∈ Vb Since G[{vb , vac , c, vbc , va }] ≃ P5 , then we get a contradiction.  Now we describe the vertex set V∅ , that is, the set of vertices that are not adjacent with any vertex in {a, b, c}. Claim 4.52. If w ∈ V∅ , then w cannot be adjacent with any vertex in Va ∪ Vb . Proof. Let va ∈ Va and vb ∈ Vb . Suppose w ∈ V∅ such that E(w, Va ∪ Vb ) 6= ∅. Consider the following cases: (a) w is adjacent only with va , or (b) w is adjacent with both va and vb . Cases (a) and (b) are impossible, because G would have P5 as induced subgraph obtained by G[{w, vb , b, a, va }] and G[{va , w, vb , b, c}], respectively. Thus w is not adjacent with any vertex in Va ∪ Vb .  Claim 4.53. There is no vertex w ∈ V∅ adjacent with a vertex in Va,b . Proof. Suppose w ∈ V∅ is adjacent with vab ∈ Va,b . Let va ∈ Va and vb ∈ Vb . Since G[{va , vb , va,b , w, a, c}] is isomorphic to G6,2 , then we get a contradiction and w and vab are not adjacent.  Claim 4.54. There is no vertex w ∈ V∅ adjacent with a vertex in Va,c ∪ Vb,c . Proof. Let x ∈ {a, b}, vxc ∈ Vx,c , y ∈ {a, b} − x and vy ∈ Vy . Suppose w ∈ V∅ is adjacent with vxc . Since G[{vy , y, c, vxc , w}] is isomorphic to P5 , then we get a contradiction and w is not adjacent with vxc .  Thus there is no edge between W and G \ W , and therefore W is empty. Therefore, the graph is isomorphic to an induced subgraph of a graph in F11 . SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 25 4.8. Case Vz = ∅ and G[Vx ∪ Vy ] = Vx ∨ Vy , where Vx = K1 , Vy = Km and m ∈ {1, 2}. Without loss of generality, suppose Vc = ∅, and E(Va , Vb ) is complete. By Claim 4.40, E(Va,b , Vx ) = ∅ for x ∈ {a, b}. Claim 4.55. Let x ∈ {a, b}. Either E(Vx,c , Va ) induces a complete bipartite graph and E(Vx,c , Vb ) = ∅, or E(Vx,c , Va ) = ∅ and E(Vx,c , Vb ) induces a complete bipartite graph. Proof. Let va ∈ Va , vb ∈ Vb , vxc ∈ Vx,c and y ∈ {a, b} − x. First note that vxc cannot be not adjacent with va and vb at the same time, because otherwise G[{va , vb , y, c, vxc }] would be isomorphic to P5 . Also vxc cannot be adjacent with va and vb at the same time, because otherwise G[{a, b, c, va , vb , vxc }] would be isomorphic to G6,25 . Thus vxc is adjacent only with one vertex either va or vb . ′ ∈ V . If v ′ Suppose vxc is adjacent with vy . Let vy′ ∈ Vy and vxc x,c xc is not adjacent with vy , then G[{vy , vy′ , x, c, vx , vxc }] is isomorphic to G6,21 . Thus E(Vy , vxc ) induces a complete bipartite graphs. ′ are not adjacent, then G[{v , v , v , c, v ′ }] is isomorphic to P . On the other hand, if vy and vxc a b xc 5 xc Then E(Vx,c , Vy ) induces a complete bipartite graph. ′ ∈ V . If v ′ and v Suppose vxc is adjacent with vx . Let vx′ ∈ Vx and vxc x,c xc are not adjacent, then x ′ G[{va , vb , vx , x, c, vxc }] is isomorphic to G6,22 . Thus E(Vx , vxc ) induces a complete bipartite graph. ′ and v are not adjacent, then G[{v , v , v , c, v ′ }] is isomorphic to P . On the other hand, if vxc 5 x y x xc xc Thus E(Vx,c , Vx ) induces a complete bipartite graph.  Claim 4.56. If Va,c and Vb,c are not empty, then each vertex in Va,c ∪ Vb,c is adjacent with each vertex in either Va or Vb . Proof. Let vac ∈ Va,c , vbc ∈ Vb,c , va ∈ Va and vb ∈ Vb . Suppose vac is adjacent with va , and vbc is adjacent with vb . Then there are two cases: either vac and vbc are adjacent or not. In the first case G[{a, b, c, vb , vac , vbc }] is isomorphic to G6,24 ; then this case is impossible. And in the second case G[{a, b, va , vb , vac , vbc }] is isomorphic to G6,21 ; then this case is not possible. Suppose vac is adjacent with vb and vbc is adjacent with va . Then there are two cases: either vac and vbc are adjacent or not. In the first case G[{a, b, c, va , vb , vac , vbc }] is isomorphic to G7,13 ; then this case is impossible. And in the second case G[{a, b, c, vb , vac , vbc }] is isomorphic to G6,17 ; then this case is not possible. Thus vac and vbc are adjacent with the same vertex: either va or vb . And the result follows.  Claim 4.57. If Va,c and Vb,c are not empty, then the set E(Vac , Vbc ) induces a complete bipartite graph. Proof. Let x ∈ {a, b} and y ∈ {a, b} − x, vac ∈ Va,c , vbc ∈ Vb,c , va ∈ Va and vb ∈ Vb . Suppose vxc and Vyc are not adjacent, and vxc and vyc are adjacent with vx . Since G[{x, y, vx , vy , vx,c , vy,c }] ≃ G6,15 , we get a contradiction. And then E(Vac , Vbc ) induces a complete bipartite graph.  Claim 4.58. Let x ∈ {a, b}. If Vx,c 6= ∅, then E(Vx,c , Va,b ) induces a complete bipartite graph. Proof. Let y ∈ {a, b} − x, vxc ∈ Vx,c , vab ∈ Va,b , va ∈ Va and vb ∈ Vb . Suppose vxc and vab are not adjacent. There are two cases: either vxc is adjacent with vx or vxc is adjacent with vy . If vxc is adjacent with vx , then the induced subgraph G[{vab , y, vy , vx , vxc }] is isomorphic to P5 ; which is a contradiction. Then this case is impossible. On the other hand, if vxc is adjacent with vy , then the induced subgraph G[{vac , va , vb , a, b, vxc }] is isomorphic to G6,9 ; which is a contradiction. Thus this case is also impossible, and therefore E(Vx,c , Va,b induces a complete bipartite graph.  26 CARLOS A. ALFARO AND CARLOS E. VALENCIA Now let us describe V∅ . By Claim 4.46, there exists no vertex in V∅ adjacent with a vertex in Va ∪ Vb . Claim 4.59. There is no vertex in V∅ adjacent with a vertex in Va,b . Proof. Let vab ∈ Va,b and w ∈ V∅ . Suppose vab and w are adjacent. Since G[{w, va,b , a, va , vb }] is isomorphic to P5 , then we get a contradiction. And therefore vab and w are not adjacent.  Claim 4.60. Let x ∈ {a, b}. There is no vertex in V∅ adjacent with a vertex in Vx,c . Proof. Let y ∈ {a, b} − x, vxc ∈ Vx,c , vab ∈ Va,b , va ∈ Va and vb ∈ Vb . Suppose the vertex w ∈ V∅ is adjacent with vxc . There are two cases: either vxc is adjacent with x or vxc is adjacent with y. First case is impossible since G[{w, vxc , vx , vy , y}] is isomorphic to P5 ; which is forbidden. And second case cannot occur because G[{w, y, vxc , c, va , vb }] ≃ G6,9 . Then it follows that w is adjacent with no vertex in Vx,c .  Thus by previous Claims, the vertex set V∅ is empty, because there is no vertex in V∅ adjacent with a vertex in G \ V∅ . Then G is isomorphic to an induced subgraph of a graph in F11 . 4.9. Case Vy ∪ Vz = ∅ and Vx is K1 or K2 . Without loss of generality, suppose Vb = Vc = ∅ and Va = {u1 , u2 }. Claim 4.61. Let x ∈ {b, c}. If Va,x 6= ∅, then either E(Va , Va,x ) induces a complete bipartite graph or E(Va , Va,x ) is empty. Proof. Let u ∈ Va . Suppose there exist v1 , v2 ∈ Va,x such that uv1 ∈ E(G) and uv2 ∈ / E(G). Since the induced subgraph G[{a, b, c, u, v1 , v2 }] is isomorphic to G6,16 , then we get a contradiction. Thus this case is not possible and therefore u is adjacent with either each vertex in Va,x or no vertex in Va,x . Now we are going to discard the possibility that E(u1 , Va,x ) induces a complete bipartite graph and E(u2 , Va,x ) = ∅. Suppose there is a vertex v ∈ Va,x such that u1 v ∈ E(G) and u2 v ∈ / E(G). Since the induced subgraph G[{c, b, v, u1 , u2 }] is isomorphic to P5 , then we get a contradiction. Thus either E(Va , Va,x ) induces a complete bipartite graph or E(Va , Va,x ) is empty.  Claim 4.62. Let u ∈ Va . If Vb,c 6= ∅, then E(u, Vb,c ) satisfies only one of the following: • it induces a complete bipartite graph, • it is an empty edge set, or • it induces a complete bipartite graph minus an edge. Proof. Suppose there exist v1 , v2 , v3 ∈ Vb,c such that uv1 ∈ E(G) and uv2 , uv3 ∈ / E(G). Since the induced subgraph G[{a, b, u, v1 , v2 , v3 }] is isomorphic to G6,3 , then we get a contradiction. Thus this case is not possible and the result follows.  Claim 4.63. If Va = {u1 , u2 } and Vb,c 6= ∅, then E(Va , Vb,c ) satisfies one of the following: • • • • • it it it it it induces a complete bipartite graph, is an empty edge set, induces a complete bipartite graph minus an edge, induces a perfect matching and |Va | = |Vb,c | = 2, or induces a complete bipartite graph minus two edges u1 v and u2 v, where v ∈ Vb,c . Proof. Since cases where |Vb,c | ≤ 2 can be checked easily with a computer algebra system or with similar arguments to the rest of the proof, then we asume |Vb,c | ≥ 3. By Claim 4.62, we only have SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 27 to check the possibilities of the edge sets E(u1 , Vb,c ) and E(u2 , Vb,c ). The possible cases we have to discard are the following: • E(u1 , Vb,c ) = ∅ and E(u2 , Vb,c ) induces a complete bipartite graph, • E(u1 , Vb,c ) = ∅ and E(u2 , Vb,c ) induces a complete bipartite graph minus an edge, and • each edge set E(u1 , Vb,c ) and E(u2 , Vb,c ) induces a complete bipartite graph minus an edge and the two removed edges don’t share a common vertex. Let v1 , v2 , v3 ∈ Vb,c . Suppose we are in the first case. Thus u1 is adjacent with no vertex in Vb,c , and u2 is adjacent with each vertex in Vb,c . Since the induced subgraph G[{a, b, u1 , u2 , v1 , v2 }] is isomorphic to G6,15 , then we get a contradiction and this case is not possible. Suppose we are in the second case. Thus u1 is adjacent with no vertex in Vb,c , and u2 is adjacent only with each vertex in Vb,c − v1 . Since the induced subgraph G[{v1 , b, v2 , u2 , u1 }] is isomorphic to P5 , then we get a contradiction and this case is not possible. Finally, suppose we are in the third case. Thus u1 is adjacent with each vertex in Vb,c − v1 , and u2 is adjacent with each vertex in Vb,c − v2 . Since the induced subgraph G[{a, u1 , u2 , v1 , v2 , v3 }] is isomorphic to G6,5 , then we get a contradiction and this case is not possible. And the result turns out.  Claim 4.64. If E(Va , Va,b ) and E(Va , Va,c ) are empty, then E(Va,b , Va,c ) induces a complete bipartite graph. Proof. Let vab ∈ Va,b and vac ∈ Va,c . Suppose vab and vac are not adjacent. Since the induced subgraph G[{a, b, c, u1 , vab , vac }] is isomorphic to G6,12 , then we get a contradiction. And thus each vertex in Va,b is adjacent with each vertex in Va,c .  Claim 4.65. If each of the edge sets E(Va , Va,b ) and E(Va , Va,c ) induces a complete bipartite graph, then |Va | = |Va,b | = |Va,c | = 1 and E(Va,b , Va,c ) = ∅. Proof. First we will prove that E(Va,b , Va,c ) = ∅. Let vab ∈ Va,b and vac ∈ Va,c . Suppose vab and vac are adjacent. Since the induced subgraph G[{a, b, c, vab , vac , va }] is isomorphic to G6,26 , then we get a contradiction. And thus E(Va,b , Va,c ) = ∅. ′ ∈V Now let x ∈ {b, c}. Suppose Va,x has cardinality at least 2. Let y ∈ {b, c} − x, vax , vax a,x and ′ v ∈ Va,y . Then vax v, vax v ∈ / E(G). Since the induced subgraph G[{a, y, vax , vax , va , v}] is isomorphic to G6,16 , then we get a contradiction. And then |Va,b | = |Va,c | = 1 Finally suppose that |Va | = 2. Let vab ∈ Va,b and vac ∈ Va,c . Since G[{vab , vac , u1 , u2 , a, x}] is isomorphic to G6,23 , then we get a contradiction. Thus Va has cardinality at most 1.  Claim 4.66. Let x ∈ {b, c} and y ∈ {b, c} − x. If E(Va , Va,x ) = ∅ and E(Va , Va,y ) induces a complete bipartite graph, then E(Va,b , Va,c ) induces a complete bipartite graph. Proof. Let vab ∈ Va,b and vac ∈ Va,c . Suppose vab and vac are not adjacent. Since the induced subgraph G[{va , vay , y, x, vax }] is isomorphic to P5 , then we get a contradiction. And thus E(Va,b , Va,c ) induces a complete bipartite graph.  Claim 4.67. Let x ∈ {b, c}. If Va,x 6= ∅, Vb,c 6= ∅ and E(Va , Va,x ) = ∅, then only one of the following statements is true: • E(Va , Vb,c ) = ∅ and E(Va,x , Vb,c ) induces a complete graph, or • each edge set E(Va , Vb,c ) and E(Va,x , Vb,c ) induce a complete bipartite graph. Proof. We will analyze the following four cases: • when E(Va , Vb,c ) = ∅, 28 CARLOS A. ALFARO AND CARLOS E. VALENCIA • when E(Va , Vb,c ) induces a complete bipartite graph, • when there exist u ∈ Va and v1 , v2 ∈ Vb,c such that uv1 ∈ E(G) and uv2 ∈ / E(G), and • when there exists v ∈ Vb,c such that u1 v ∈ E(G) and u2 v ∈ / E(G), where u1 , u2 ∈ Va . Consider the first case. Let vax ∈ Va,x and vbc ∈ Vb,c . Suppose vax and vbc are not adjacent. Since the induced subgraph G[{a, b, c, u1 , vax , vbc }] is isomorphic to G6,14 , then we get a contradiction. And thus E(Va,x , Vb,c ) induces a complete bipartite graph. Now consider the second case. Let vax ∈ Va,x and vbc ∈ Vb,c . Suppose vax and vbc are not adjacent. Since the induced subgraph G[{a, b, c, u1 , vax , vbc }] is isomorphic to G6,17 , then we get a contradiction. And thus E(Va,x , Vb,c ) induces a complete bipartite graph. In what follows we will prove that the last two cases are impossible which implies that the rest possibilities of Claim 4.63 are impossible. Now consider the third case. Let vax ∈ Va,x . Suppose there exist u ∈ Va and v1 , v2 ∈ Vb,c such that uv1 ∈ E(G) and uv2 ∈ / E(G). There are four possible cases: • • • • vax v1 , vax v2 ∈ E(G), vax v1 , vax v2 ∈ / E(G), vax v1 ∈ E(G) and vax v2 ∈ / E(G), or vax v1 ∈ / E(G) and vax v2 ∈ E(G). Since in first case G[{a, b, c, u, vax , v1 , v2 }] ≃ G7,10 , in second case G[{b, c, u, vax , v1 , v2 }] ≃ G6,10 , in third case G[{b, c, u, vax , v1 , v2 }] ≃ G6,14 and in fourth case G[{u, v1 , vy , v2 , vax }] ≃ P5 , then we get a contradiction. In the last case, we get a contradiction because otherwise by first case: va,x v ∈ / E(G), but by second case: va,x v ∈ E(G). Thus this case is impossible.  Claim 4.68. Let x ∈ {b, c}. If Va,x 6= ∅, Vb,c 6= ∅, and E(Va , Va,x ) induces a complete bipartite graph, then the edge sets E(Va , Vb,c ) and E(Va,x , Vb,c ) induce complete bipartite graphs. Proof. Let vax ∈ Va,x , v ∈ Vb,c and u ∈ Va . Suppose uv ∈ / E(G). There are two cases: either vvax ∈ E(G) or vvax ∈ / E(G). Since the induced subgraph G[{a, b, c, u, v, vax }] is isomorphic to G6,24 and G6,22 , in the first case and in the second case, respectively, then we get a contradiction. Thus uv ∈ E(G) and therefore the edge set E(Va , Vb,c ) induces a complete bipartite graph. Now suppose vvax ∈ / E(G). By previous result, uv ∈ E(G). Since the induced subgraph G[{a, b, c, u, v, vax }] is isomorphic to G6,25 , then we get a contradiction and thus vvax ∈ E(G). Therefore E(Va,x , Vb,c ) induces a complete bipartite graph.  By previous Claims we have the following cases: (1) E(Va , Va,b ∪ Vac ∪ Vb,c ) = ∅, and each edge set E(Va,b , Va,c ) and E(Va,b ∪ Va,c , Vb,c ) induces a complete bipartite graph, (2) E(Va , Va,b ∪ Vac ) = ∅, and each edge set E(Va,b , Va,c ) and E(Va ∪ Va,b ∪ Va,c , Vb,c ) induces a complete bipartite graph, (3) E(Va , Va,b ) = ∅, and each edge set E(Va ∪ Va,b , Va,c ) and E(Va ∪ Va,b ∪ Va,c , Vb,c ) induces a complete bipartite graph, (4) E(Va,b , Va,c ) = ∅, and each edge set E(Va , Va,b ∪ Va,c ∪ Vb,c ) and E(Va,b ∪ Va,c , Vb,c ) induces a complete bipartite graph and |Va | = |Va,b | = |Va,c | = 1, (5) Vb,c = ∅, E(Va , Va,b ∪ Vac ) = ∅, and E(Va,b , Va,c ) induces a complete bipartite graph, (6) Vb,c = ∅, E(Va , Va,x ) = ∅, and E(Va ∪ Va,x , Va,y ) induces a complete bipartite graph, where x ∈ {a, b} and y ∈ {a, b} − x, SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 29 (7) Vb,c = ∅, E(Va , Va,b ∪ Va,c ) induce a complete bipartite graph, E(Va,b , Va,c ) = ∅ and |Va | = |Va,b | = |Va,c | = 1, (8) Va,y = ∅, E(Va , Va,x ∪ Vb,c ) = ∅, and E(Va,x , Vb,c ) induces a complete bipartite graph, where x ∈ {a, b} and y ∈ {a, b} − x, (9) Va,y = ∅, E(Va , Va,x ) = ∅, and E(Va ∪ Va,x , Vb,c ) induces a complete bipartite graph, where x ∈ {a, b} and y ∈ {a, b} − x, (10) Va,y = ∅, E(Va , Va,x ∪ Vb,c ) and E(Va,x , Vb,c ) induce a complete bipartite graph, where x ∈ {a, b} and y ∈ {a, b} − x, (11) Va,b ∪ Va,c = ∅, and E(Va , Vb,c ) induces a complete bipartite graph, (12) Va,b ∪ Va,c = ∅ and E(Va , Vb,c ) = ∅, (13) Va,b ∪ Va,c = ∅, and E(Va , Vb,c ) induces a complete bipartite graph minus an edge, (14) Va,b ∪ Va,c = ∅, |Vb,c | ≥ 2 and E(Va , Vb,c ) induces a complete bipartite graph minus two edges u1 v and u2 v, where v ∈ Vb,c , (15) Va,b ∪ Va,c = ∅, |Va | = |Vb,c | = 2 and E(Va , Vb,c ) induces a perfect matching, (16) Va,y ∪ Vb,c = ∅ and E(Va , Va,x ) induces a complete bipartite graph, where x ∈ {a, b} and y ∈ {a, b} − x, and (17) Va,y ∪ Vb,c = ∅ and E(Va , Va,x ) = ∅, where x ∈ {a, b} and y ∈ {a, b} − x. Now we describe V∅ , the set of vertices that are not adjacent with any vertex in {a, b, c}. Let w ∈ V∅ . The vertex w is adjacent with a vertex in Va ∪ Va,b ∪ Va,c ∪ Vb,c , because otherwise the shortest path from w to {a, b, c} would contains the graph P5 as induced subgraph. Claim 4.69. If Va,x 6= ∅ for some x ∈ {b, c}, then E(V∅ , Va ∪ Va,x ) = ∅. Proof. Let w ∈ V∅ , vax ∈ Va,x and u ∈ Va . Suppose w is adjacent with u or vax . Then there are three possible cases: (a) w is adjacent only with u, (b) w is adjacent only with vax , or (c) w is adjacent with both vertices u and vax . First consider case (a). This case has two subcases: either u is adjacent with vax or not. If they are adjacent, then G[{u, w, vax , b, c}] is isomorphic to P5 . Since it is forbidden, then va is not adjacent with vax . On the other hand, if they are not adjacent, then G[{a, b, c, w, u, vax }] is isomorphic to G6,7 . Therefore, case (a) is impossible. Now consider case (b). There are two possible cases: either u is adjacent with vax or not. If they are adjacent, then G[{a, b, c, w, u, vax }] is isomorphic to G6,14 ; which is forbidden. Thus u is not adjacent with vax . But if they are not adjacent, then we have that G[{a, b, c, w, u, vax }] is isomorphic to G6,10 . Thus case (b) cannot occur. Finally, consider case (c). The subcases are: either u is adjacent to vax or not. If they are adjacent, then G[{a, b, c, w, u, vax }] is isomorphic to G6,22 ; which is forbidden. Then u is not adjacent with vax But if they are not adjacent, then the induced subgraph G[{u, w, vax , b, c}] is isomorphic to P5 ; which is forbidden. Thus, we get that case (c) is impossible. And therefore, w is not adjacent with u or vax . From which the result follows.  Claim 4.70. Let x ∈ {b, c}. If Va,x 6= ∅, then E(V∅ , Vb,c ) = ∅. Moreover, if Va,x 6= ∅, then V∅ = ∅. Proof. Let w ∈ V∅ , vax ∈ Va,x , va ∈ Va and vbc ∈ Vb,c . Suppose w is adjacent with vbc . By Claim 4.69, we have that w is not adjacent with a vertex in Va ∪ Va,x . By Claims 4.67 and 4.68, the vertex vax is adjacent with vbc , and one of the following three cases occur: (a) va is adjacent with vax and vbc , (b) va is adjacent only with vbc , and 30 CARLOS A. ALFARO AND CARLOS E. VALENCIA (c) va is not adjacent with both vax and vbc . Case (a) is not possible because the induced subgraph G[{va , vax , b, c, vbc , w}] would be isomorphic to G6,12 ; which is impossible. In case (b), we have that G[{va , vax , b, c, vbc , w}] is isomorphic to G6,4 . Since it is forbidden, then this case is not possible. Finally, case (c) is not possible since G[{va , a, x, vbc , w}] is isomorphic to P5 that is forbidden. Thus w is not adjacent with vbc . And there is no vertex in V∅ adjacent with a vertex in G \ V∅ . Therefore V∅ is empty.  Thus by previous Claim, in cases (1) to (10), (16) and (17) the vertex set V∅ is empty. The cases when Va,b ∪ Va,c = ∅ (cases (4) and (7)) correspond to a graph isomorphic to an induced subgraph of F12 . The rest of these cases correspond to a graph isomorphic to an induced subgraph of F11 . Claim 4.71. Let wa ∈ V∅ such that wa is adjacent with u ∈ Va , and wa is not adjacent with a vertex in Vb,c . Let wbc ∈ V∅ such that wbc is adjacent with v ∈ Vb,c and wbc is not adjacent with a vertex in Va . Let w ∈ V∅ such that w is adjacent with u′ ∈ Va and v ′ ∈ Vb,c . If E(Va , Vb,c ) induces a complete bipartite graph, then no two vertices of {wa , wbc , w} exist at the same time. Proof. Suppose wa and wbc exist at the same time. There there are two possible cases: either wa and wbc are adjacent or not. If wa and wbc are adjacent, then G[{b, a, u, wa , wbc }] is isomorphic to P5 ; which is impossible. If wa and wbc are not adjacent, then G[{b, c, u, v, wa , wbc }] is isomorphic to G6,6 ; which is impossible. Then wa and wbc do not exist at the same time. Suppose wa and w exist at the same time. There there are two possible cases: either u = u′ or u 6= u′ . Suppose u = u′ , then we have two possible cases: either wa and w are adjacent or not. If wa and w are adjacent, then G[{wa , w, v ′ , b, a}] is isomorphic to P5 ; which is impossible. But if wa and w are not adjacent, then G[{b, c, u, v ′ , wa , w}] is isomorphic to G6,11 ; which is impossible. Then u 6= u′ . Thus suppose u 6= u′ . Note that in the induced subgraph G[{a, b, c, u, v ′ , wa , w}], the vertex w is only adjacent with v ′ , and wa is only adjacent with u. Then applying previous (wa , wbc ) case in this induced subgraph, we get that w and wa do not exist at the same time. Suppose wbc and w exist at the same time. There are two possible cases: either v = v ′ or v 6= v ′ . Suppose v = v ′ , then we have two possible cases: either wbc and w are adjacent or not. If wa and wbc are adjacent, then G[{wbc , w, u, a, b}] is isomorphic to P5 ; which is impossible. But if wa and wbc are not adjacent, then G[{b, c, u, v, wbc , w}] is isomorphic to G6,11 ; which is impossible. Then v 6= v ′ . Suppose v 6= v ′ . Note that in the induced subgraph G[{a, b, c, u, v, wa , w}], the vertex w is only adjacent with u, and wbc is only adjacent with v. Thus by applying first case in this induced subgraph, we get that w and wbc do not exist at the same time.  Claim 4.72. Let w ∈ V∅ , u ∈ Va and v ∈ Vb,c . If E(Va , Vb,c ) induces a complete bipartite graph and w is adjacent with u and v, then E(w, Va ∪ Vb,c ) induces a complete graph. Proof. First we see that if v ′ ∈ Vb,c − v, then w is adjacent with v ′ . Suppose w and v ′ are not adjacent. Since the induced subgraph G[{a, b, u, v, v ′ , w}] is isomorphic to the forbidden graph G6,15 , then we get a contradiction. Thus w is adjacent with each vertex in Vb,c . Now we see that if u′ ∈ Va − u, then w is adjacent with u′ . Suppose w and u′ are not adjacent. Since the induced subgraph G[{a, b, u, u, u′ , w}] is isomorphic to G6,15 , then we get a contradiction. Therefore, w is adjacent with each vertex in Va ∪ Vb,c .  Claim 4.73. If |Va | = 2 and E(V∅ , Va ) 6= ∅, then either each vertex in V∅ is adjacent only with one vertex in Va and V∅ is a clique, or each vertex in V∅ is adjacent with u1 and u2 , and V∅ is trivial. Proof. Let w, w′ ∈ V∅ and i, j ∈ {1, 2} with i 6= j. By proving that the following cases are not possible, it follows that the only possible cases are that either E({u1 , u2 }, {w, w′ }) is equal to {wui , w′ uj } SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 31 and ww′ ∈ E(G), or E({u1 , u2 }, {w, w′ }) is equal to {wui , wuj , w′ ui , w′ uj } and ww′ ∈ E(G). Which implies the result. (a) (b) (c) (d) (e) (f) ww′ , wuj , w′ uj ∈ / E(G) and wui , w′ ui ww′ , wuj , w′ ui ∈ / E(G) and wui , w′ uj ′ wuj , w ui ∈ / E(G) and ww′ , wui , w′ uj ′ ′ ww , w uj ∈ / E(G) and wui , wuj , w′ ui ′ w uj ∈ / E(G) and ww′ , wui , wuj , w′ ui w′ uj , ww′ , wui , wuj , w′ ui ∈ E(G). ∈ E(G), ∈ E(G), ∈ E(G), ∈ E(G), ∈ E(G), and Since in cases (a), (b) and (d) the induced subgraph G[{a, b, u1 , u2 , w, w′ }] is isomorphic to G6,2 , G6,8 , G6,10 , respectively, then these cases are impossible. On the other hand, in case (c) the induced graph G[{w, w′ , uj , a, b}] is isomorphic to P5 : which is impossible. Also in case (e) the induced subgraph G[{w′ , w, uj , a, b}] is isomorphic to P5 ; which is not possible. Finally in case (f) the induced subgraph G[{a, b, c, u1 , u2 , w, w′ }] is isomorphic to G7,14 ; which is not possible.  Claim 4.74. If E(Va , Vb,c ) induces a complete bipartite graph, and each vertex in V∅ is adjacent only with one vertex in Va , then there is no vertex in V∅ adjacent with a vertex in Vb,c . Proof. Let w ∈ V∅ , v ∈ Vb,c . Suppose w is adjacent with u1 and v, but w is not adjacent with u2 . Since the induced subgraph G[{a, b, w, u1 , u2 , v}] is isomorphic to G6,17 , then we get a contradiction and the result follows.  Claim 4.75. Let w ∈ V∅ and u ∈ Va . If E(Va , Vb,c ) induces a complete bipartite graph, E(w, Vb,c ) 6= ∅ and E(w, Va ) = ∅, then each vertex in V∅ is adjacent with only one vertex in Vb,c , and V∅ is a clique of cardinality at most 2. Proof. Let v, v ′ ∈ Vb,c . Suppose w is adjacent with v and v ′ . Since G[{a, b, c, u, v, v ′ , w}] is isomorphic to G7,9 , then we get a contradiction. And we have that w is adjacent only with one vertex in Vb,c Now let w, w′ ∈ V∅ and v, v ′ ∈ Vb,c such that wv ∈ E(G) and w′ v ′ ∈ / E(G). Suppose v 6= v ′ . There ′ ′ are two cases: either w and w are adjacent or not. If w and w are adjacent, then the induced subgraph G[{b, c, v, u, w, w′ }] is isomorphic to G6,6 , then we get a contradiction and ww′ ∈ / E(G). Now if w and w′ are not adjacent, then the induced subgraph G[{w, v, u, v ′ , w′ }] is isomorphic to P5 and we get a contradiction. Thus v = v ′ . Finally, let w, w′ ∈ V∅ adjacent with v ∈ Vb,c . Suppose w and w′ are not adjacent. Since the induced subgraph G[{a, b, v, u, w, w′ }] is isomorphic to G6,3 , then we get a contradiction and ww′ ∈ E(G).  In case (11), by Claims 4.71, 4.72, 4.73, 4.74 and 4.75, we have the following possible cases: • each vertex in V∅ is adjacent with each vertex in Va ∪ Vb,c , and V∅ is a trivial graph, • each vertex in V∅ is adjacent only with a vertex in Va , and V∅ is a clique of cardinality at most 2, or • each vertex in V∅ is adjacent only with a vertex in Vb,c , and V∅ is a clique of cardinality at most 2. Each of these cases corresponds to a graph isomorphic to an induced subgraph of F11 . Remark 4.76. Let w ∈ V∅ , u ∈ Va and v ∈ Vb,c . If uv ∈ / E(G), and w adjacent with u or v, then w is adjacent with both vertices u and v. In case (12), by Claim 4.73 and Remark 4.76, we have that each vertex in V∅ is adjacent with each vertex in Va ∪ Vb,c , and 32 CARLOS A. ALFARO AND CARLOS E. VALENCIA • V∅ is a clique or a trivial graph when |Va | = 1, or • V∅ is a clique when |Va | = 2. It is not difficult to see that each of these graphs are isomorphic to an induced subgraph of F11 Claim 4.77. Let w ∈ V∅ , u ∈ Va and v ∈ Vb,c . Suppose u is adjacent with each vertex in Vb,c − v. If E(w, Vb,c ∪ {u}) 6= ∅, then one of the following statements holds: • each vertex in V∅ is adjacent with u and v,or • E(w, Vb,c ∪ {u}) induces a complete bipartite graph and |Vb,c − v| = 1. Proof. First case follows by Remark 4.76. Now we check when w is adjacent with a vertex in Vb,c − v. Let v ′ ∈ Vb,c . Then u is adjacent with v ′ . Suppose w is adjacent only with v ′ . Since the induced subgraph G[{a, b, u, v, v ′ , w}] is isomorphic to G6,9 , then we have a contradiction and w is adjacent also with u or v. Thus by Remark 4.76, w is adjacent with u, v and v ′ . Finally by applying Claim 4.72 to the induced subgraph G[{w, u} ∪ (Vb,c − v)], we get that w also is adjacent with each vertex in Vb,c − v. Thus w is adjacent with each vertex in {u} ∪ Vb,c . Suppose the cardinality of Vb,c − v is at least 2. Take v, v ′ ∈ Vb,c − v. Thus w is adjacent with v, v ′ and v ′′ . Since the induced subgraph G[{u, v, v ′ , v ′′ , a, w}] is isomorphic to G6,5 , then we get a contradiction. Thus the cardinality of Vb,c − v is at most 1.  Claim 4.78. Let w ∈ V∅ and v ∈ Vb,c . Suppose u1 is adjacent with each vertex in Vb,c , and u2 is adjacent with each vertex in Vb,c − v. If E(w, Vb,c ) 6= ∅, then either w is adjacent only with u2 and v, or |Vb,c | = 1 and E(w, Va ∪ Vb,c ) induces a complete bipartite graph. Proof. First case follows by Remark 4.76. Now we prove that if w is adjacent with u1 , then w is adjacent with u2 and v. Suppose w is adjacent only with u1 . Since the induced subgraph G[{a, b, u1 , u2 , v, w}] is isomorphic to G6,11 , then we have a contradiction and w is adjacent also with u2 or v. Thus by Remark 4.76, w is adjacent with u1 , u2 and v. Finally, suppose |Vb,c | ≥ 2. Let v ′ ∈ Vb,c . By applying Claim 4.72 to the induced subgraph G[{w, u1 } ∪ Vb,c ], we get that w also is adjacent with each vertex in Vb,c . Thus w is adjacent with each vertex in Va ∪ Vb,c . But since G[{a, u1 , u2 , v, v ′ , w}] is isomorphic to G6,18 , then we get a contradiction, and |Vb,c | = 1.  Let u ∈ Va and v ∈ Vb,c such that uv ∈ / E(G). Therefore, in case (13), by Claims 4.73, 4.77 and 4.78, we have that one of the following cases holds: • V∅ is a clique of cardinality at most 2, and each vertex in V∅ is adjacent with u and v, • Va = {u}, |Vb,c \ {v}| ≤ 1, V∅ is trivial and each vertex in V∅ is adjacent with each vertex in {u} ∪ Vb,c , or • |Va | = 2, V∅ is trivial and Vb,c = {v} and each vertex in V∅ is adjacent with u1 , u2 and v. It can be checked that each of these graphs is isomorphic to an induced subgraph or a graph in F11 . Claim 4.79. Let w ∈ V∅ and v ∈ Vb,c such that v is not adjacent with u1 and u2 . Suppose |Vb,c | ≥ 2 and E(Va , Vb,c − v) induces a complete bipartite graph. If E(w, Vb,c ) 6= ∅, then V∅ = {w}, and w is adjacent with u1 , u2 and v. Proof. By Remark 4.76, we have that if w is adjacent with one vertex of {v, u1 , u2 }, then w is adjacent with v, u1 and u2 . Now we see that w is not adjacent to any other vertex. Suppose w is adjacent with v ′ ∈ Vb,c − v. First consider the case when w is not adjacent with v, u1 and u2 . Since G[{b, v, v ′ , u1 , u2 , w}] is isomorphic to G6,6 , then we get a contradiction and thus w is adjacent with v, v ′ , u1 , and u2 . But if w is adjacent with v, v ′ , u1 , and u2 , then G[{b, v, v ′ , u1 , u2 , w}] is isomorphic to G6,20 ; which is impossible. Then w is not adjacent with any vertex in Vb,c − v. SMALL CLIQUE NUMBER GRAPHS WITH THREE TRIVIAL CRITICAL IDEALS 33 Suppose there exist another vertex w′ ∈ V∅ . By previous discussion w′ is adjacent with v, u1 and u2 . Since G[{a, b, w, w′ , v, v ′ }] is isomorphic to G6,1 , then we get a contradiction. Thus V∅ has cardinality at most 1.  Let v ∈ Vb,c such that u1 v, u2 v ∈ / E(G). Therefore, in case (14), by Claims 4.73 and 4.79, we have that V∅ = {w} and w is adjacent with u1 , u2 and v. Then G is isomorphic to an induced subgraph of F11 . Claim 4.80. Let Vb,c = {v, v ′ } such that vu1 , v ′ u2 ∈ E(G) and vu2 , v ′ u1 ∈ / E(G). If w ∈ V∅ and E(w, Va ∪ Vb,c ) 6= ∅, then w is adjacent with u1 , u2 , v and v ′ . Proof. Since w is adjacent with a vertex in {u1 , u2 , v, v ′ }, then w is adjacent with u1 and v ′ , or w is adjacent with u2 and v. Suppose w is adjacent with u1 and v ′ , but w is not adjacent with u2 and v. Since G[{a, u1 , u2 , v, v ′ , w}] is isomorphic to G6,11 , then we get a contradiction, and therefore w is also adjacent with u2 and v.  Let Vb,c = {v, v ′ } such that vu1 , v ′ u2 ∈ E(G) and vu2 , v ′ u1 ∈ / E(G). Thus in case (15), by Claims 4.73 and 4.80, we have that V∅ is trivial and each vertex in V∅ is adjacent only with u1 , u2 , v and v ′ . Therefore, G is isomorphic to an induced subgraph of F11 . References [1] C.A. Alfaro and C.E. Valencia, Graphs with two trivial critical ideals, to appear in Discrete Appl. Math. [2] C.A. Alfaro, H.H. Corrales and C.E. Valencia, Critical ideals of signed graphs with twin vertices, preprint. [3] R. Bacher, P. de la Harpe and T. Nagnibeda, The lattice of integral flows and the lattice of integral cuts on a finite graph, Bull. Soc. Math. France 125 (1997) 167-198. [4] N. Biggs, Chip-firing and the critical group of a graph, J. Alg. Combin. 9 (1999) 25-46. [5] J.A. Bondy and U.S.R. Murty, Graph Theory, Grad. Texts in Math., vol. 244, Springer, 2008. [6] W.H. Chan, Y. Hou, W.C. Shiu, Graphs whose critical groups have larger rank, Acta Math. Sinica 27 (2011) 1663–1670. [7] R. Cori and D. Rossin, On the sandpile group of dual graphs, European J. Combin. 21 (4) (2000) 447–459. [8] H.H. Corrales and C.E. Valencia, On the critical ideals, to appear. [9] D.R. Grayson and M.E. Stillman, Macaulay2, a software system for research in algebraic geometry, available at www.math.uiuc.edu/Macaulay2/. [10] R. Grone, R. Merris and W. Watkins, Laplacian unimodular equivalence of graphs. In: R. Brualdi, S. Friedland and V. Klee (Eds.) Combinatorial and Graph-Theoretical Problems in Linear Algebra, Springer-Verlag (1993) 175-180. [11] C. Godsil and G. Royle, Algebraic Graph Theory, Grad. Texts in Math., vol. 207, Springer-Verlag, New York, 2001. [12] N. Jacobson, Basic Algebra I, Second Edition, W. H. Freeman and Company, New York, 1985. [13] D.J. Lorenzini, Arithmetical Graphs, Math. Ann. 285 (1989) 481–501. [14] D.J. Lorenzini, A finite group attached to the laplacian of a graph, Discrete Math. 91 (1991) 277–282. [15] D.J. Lorenzini, Smith normal form and Laplacians, J. Combin. Theory B 98 (2008) 1271-1300. [16] B.D. McKay, nauty Users Guide (Version 2.4), available at http://cs.anu.edu.au/∼bdm/nauty/. [17] C. Merino, The chip-firing game, Discrete Math. 302 (2005) 188–210. [18] R. Merris, Unimodular Equivalence of Graphs, Linear Algebra Appl. 173 (1992),181-189 [19] Y. Pan and J. Wang, A note on the third invariant factor of the Laplacian matrix of a graph, preprint, math.CO/0912.3608v1 [20] D.G. Wagner, The critical group of a directed graph, preprint, arXiv:math/0010241v1 [math.CO] Departamento de Matemáticas, Centro de Investigación y de Estudios Avanzados del IPN, Apartado Postal 14–740, 07000 Mexico City, D.F. E-mail address: [email protected],[email protected]
0math.AC
Connectivity of Natura 2000 forest sites in Europe Christine Estreguil 1,* , Giovanni Caudullo 1 , and Daniele de Rigo 1,2 1 European Commission, Joint Research Centre, Institute for Environment and Sustainability , Via E. Fermi 2749, I-21027 Ispra (VA), Italy arXiv:1406.1501v2 [cs.CE] 20 Jun 2014 2 Politecnico di Milano, Dipartimento di Elettronica, Informazione e Bioingegneria, Via Ponzio 34/5, I-20133 Milano, Italy Background/Purpose: In the context of the European Biodiversity policy, the Green Infrastructure Strategy is one supporting tool to mitigate fragmentation, inter-alia to increase the spatial and functional connectivity between protected and unprotected areas. The Joint Research Centre has developed an integrated model to provide a macro-scale set of indices to evaluate the connectivity of the Natura 2000 network, which forms the backbone of a Green Infrastructure for Europe. The model allows a wide assessment and comparison to be performed across countries in terms of structural (spatially connected or isolated sites) and functional connectivity (least-cost distances between sites influenced by distribution, distance and land cover). Main conclusion: The Natura 2000 network in Europe shows differences among countries in terms of the sizes and numbers of sites, their distribution as well as distances between sites. Connectivity has been assessed on the basis of a 500 m average inter-site distance, roads and intensive land use as barrier effects as well as the presence of "green" corridors. In all countries the Natura 2000 network is mostly made of sites which are not physically connected. Highest functional connectivity values are found for Spain, Slovakia, Romania and Bulgaria. The more natural landscape in Sweden and Finland does not result in high inter-site network connectivity due to large inter-site distances. The distribution of subnets with respect to roads explains the higher share of isolated subnets in Portugal than in Belgium. Cite as: Estreguil, C., Caudullo, G., de Rigo, D., 2014. Connectivity of Natura 2000 forest sites in Europe. F1000Posters 2014, 5: 485. DOI: 10.6084/m9.figshare.1063300. ArXiv: 1406.1501 * Corresponding author: [email protected] Europe’s Green Infrastructure Strategy is a holistic policy initiative integrating nature, biodiversity and sustainable development [2]; it is one supporting tool to implement the European Biodiversity Strategy and achieve 2020 targets [8]. One of its aims is to mitigate fragmentation and render protection more effective. One condition to achieve this is to increase the spatial T and functional connectivity between natural and semi-natural protected and unprotected areas. Protected areas such as Natura 2000 (N2K) [6] sites form the backbone of a Green Infrastructure for Europe [4, 9]. Besides their size and quality, their connectivity contributes to the movement and dispersal of animals and plants. HE 1 Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. Figure 1: Illustration of the site rasterization method: five N2K sites (left) resulting three subnets (right, from [12]). from the perspective of influencing factors related to site distribution, grey infrastructure and inter-site distance: connectivity indices, isolated sites. The unprotected landscape plays a role in enhancing or reducing the conservation and resilience of protected habitats; for example, grey infrastructure (artificial lands and roads) and intensive land use often pose the biggest threats or disturbances for biodiversity conservation. There is a need for conservation tools accounting for connectivity in tandem with landscape planning [16]. Connectivity measures should not necessarily be to link individual habitat patches with physical structures (such as corridors of similar habitat), but to ensure the existence of required functional connections between protected sites (e.g. inter-site distances or/and landscape permeability) and identify potentially isolated sites. The Joint Research Centre has developed an integrated spatially explicit model to provide a macro-scale European vision of the connectivity of N2K sites on [12, 13]: Pattern of Natura 2000 site network The network of Natura 2000 sites designated under the "Habitat" [6] and "Birds" Directives [7] covers circa 18% of the European Union (728,744 km2 ); 80% of the sites include forest. All N2K polygons [5] representing the extracted site areas have been converted to a raster layer in order to generate sub-network (subnet) components which were formed by one or more Natura 2000 sites in cases of overlap (sites physically connected) (Figure 1). There are differences among countries in terms of the sizes and numbers of sites, their distribution as well as distances between sites (Figure 2). In the small frames of Figure 2, Ireland (frame 1) has a well-connected network; Portugal (frame 2) has large and isolated subnets; Spain (frame 3) has large and connected sites; Germany (frame 4) has small and densely distributed sites; Sweden (frame 5) has mainly small and distant subnets; Bulgaria (frame 6) has large subnets. • Site network pattern in terms of size and number. • Intra-site network structural connectivity with morphological criteria: complex, simple subnets. • Inter-site network functional connectivity 2 Figure 2: Natura 2000 forest site network with six zoom frames showing network differences. Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. 3 Extract Sitestwithtfocalthabitat 4 Rasterize Merge Landtuse)covertshares1 Artificial Agriculture Natural Landscapehmatrix Sharehofhroadhnetwork LANDtCOVERtSHARES Subnettstatistics1 N2Khcoverage NumberhofhN2Khsites Numberhofhsubnets SubnethsizehCmax,hmedianL N2KhSubnethmap Reclassify Structuralhsubnethmap Sharetof1 Simplehsubnets l,tnodeb Complexhsubnets l>,tnodeb (tSimpletlnodesb (tComplextllinksmtnodesb Reclassify frictiontvaluestllogtscaleb forteachtlandtuse Frictionhmap Inter-subnet least-costhpath TXTtfiles Connectivitytindices1 RPC sitetareatweighetdtconnectivity RAPC unweightedtconnectivity Sharetin isolatedhsubnets Functionalhconnectivity CONEFOR INTER(SITEtNETWORKtFUNCTIONALtCONNECTIVITY MSPAhmap coremtedgemtbridge loopmtbranchmtislet GUIDOStMSPA INTRA(SITEtNETWORKtSTRUCTURALtCONNECTIVITY Figure 3: The data input and information flow to compute the analysis on Natura 2000 network connectivity. The intermediate steps generate ::categorical:: raster ::matrix:: layers from the input data. The categorical variables are then transformed into ::nonnegative:: friction maps and functional distance (cost) estimates, from which least-cost paths are computed. Most derived indices are dimensionless ::proportion:: values in [0, 1] with the exception of the ::nonnegative:: indices summarising the number of N2K sites and of subnets, and their size. The notation in the workflow follows the Semantic Array Programming paradigm as applied in [11, 13] where the array-based semantics is based on [3]. Details on the less obvious data-transformation modules may be found in [14]. 11nonnegative11 11proportion11 Simplifiedhlandhusehmap Xtclasses1tartificialm pintensiveptagriculturem natural)semi(natural Mainhroadhnetwork highwaysmttrunksmtprimary roadstwithouttbridges)tunnels 11binary11 Reclassify Extract Rasterize 11categorical11 CLC OSM Pythontprocessing withtESRItspatialtlibraries Pythontprocessing Indextfamily Derivedtindices Specializedtsoftware Derivedtmap Intermediatetstep Inputtdata NvK SITE NETWORKtPATTERN Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. Figure 4: Structural connectivity morphological analysis of subnets based on GUIDOS software (left), reclassification into simple/complex subnets (right, from [12]). of landscape resistance to species dispersal and to identify "green" corridors, a new European land use based friction map was created from the Corine Land Cover map of year 2006 at 100 m spatial resolution [10] and the OpenStreetMap layer [1, 15]. Spatially-explicit model of connectivity of protected areas The model is based on two available software packages (free-download GUIDOS [18] and free software Conefor [17]) integrated with GIS Python programming tools for automated processing [19] (Figure 3). The approach is harmonized and applies both structural and functional criteria. It represents a compromise between biological species models and commonly used connectedness measures. Figure 5: Illustration of functional connectivity and parameters: a i and a j refer to subnet areas, p i , j is the probability of connectivity, A L the area of the landscape unit. Intra-site network structural connectivity The spatial configuration of the sites is characterized in terms of simple subnets, made of one node, and of complex subnets, made of several interconnected nodes and links (Figure 4). For each country two structural connectivity indices are proposed: • Share of Complex subnets. • Share of Simple subnets. The probability of connectivity (pi j ) is measured as a function of the landscape resistance (costi j ) between subnets (ai , a j ). It applies 50% probability of connectivity at 500 m average inter-subnets distance (dist 50% ). It also accounts for the presence of "green" corridors in-between subnets (Figure 5). Inter-site network functional connectivity The model is based on a probabilistic power weighted dispersal function [13]. As a proxy 5 ln(0.5) d i st 50% k = pi , j = e k · costi , j Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. Figure 6: Functional connectivity illustrated for two subnets; the tunnel along the main road (left) is accounted for identifying the least-cost (from [12]). Intra-site structural connectivity Site network pattern Country name 2 Natura Number Number Subnet size (km ) 2000 sites subnets Median Max coverage Simple Complex subnet subnet Inter-site functional connectivity Land cover shares Road RPC RAPC Isolated AUSTRIA 15.8% 203 297 1.4 2813 80.4% 19.6% 6.7% 22.3% 71.0% 2.2% 5.8% 17.5% 7.4% BELGIUM 13.6% 397 1036 0.9 385 76.8% 23.2% 24.5% 43.3% 32.2% 3.7% 5.3% 23.3% 4.2% BULGARIA 35.1% 273 131 12.6 10656 60.4% 39.6% 7.3% 50.9% 41.8% 0.7% 16.9% 21.3% 7.6% CYPRUS 12.4% 35 44 1.1 635 75.0% 25.0% 11.1% 47.3% 41.6% 1.9% 9.6% 42.6% 6.8% CZECH REP. 15.0% 782 665 0.8 2196 84.5% 15.5% 8.1% 44.6% 47.3% 1.4% 4.5% 10.6% 3.2% GERMANY 16.0% 4287 6931 0.8 4398 82.9% 17.1% 11.3% 47.7% 41.0% 2.4% 3.8% 12.1% 1.7% DENMARK 7.2% 185 178 5.1 223 76.9% 23.1% 9.2% 67.7% 23.1% 1.3% 1.2% 9.9% 36.5% ESTONIA 18.9% 506 699 1.3 729 90.9% 9.1% 3.1% 23.0% 73.9% 0.6% 4.9% 17.2% 5.0% SPAIN 26.3% 1100 849 5 25191 77.8% 22.2% 3.9% 47.3% 48.7% 1.8% 10.9% 13.9% 7.5% FINLAND 12.9% 1524 2952 0.7 7557 93.1% 6.9% 2.4% 6.2% 91.4% 0.7% 5.0% 4.5% FRANCE 13.2% 1401 3965 0.5 5412 87.2% 12.8% 6.9% 43.9% 49.2% 1.8% 3.5% 9.3% 2.8% GREECE 25.0% 258 227 30.9 2930 90.3% 9.7% 3.7% 33.5% 62.7% 1.3% 5.3% 9.1% 41.9% HUNGARY 20.1% 377 611 2.5 2632 80.4% 19.6% 8.3% 67.2% 24.5% 1.5% 6.0% 12.9% 2.8% IRELAND 13.0% 217 284 0.8 2624 80.6% 19.4% 3.4% 10.7% 85.9% 1.4% 8.7% 38.5% 2.8% ITALY 17.2% 1873 1230 5.1 2238 87.1% 12.9% 5.5% 36.1% 58.4% 2.0% 3.0% 8.3% 12.6% LITHUANIA 13.0% 417 312 2.1 948 83.4% 16.6% 5.0% 51.8% 43.3% 1.7% 3.4% 11.5% 3.5% LUXEMBOURG 22.1% 57 79 0.5 88 76.0% 24.0% 14.2% 33.7% 52.1% 6.6% 11.5% 43.7% 0.0% LATVIA 12.0% 302 296 2.7 936 94.9% 5.1% 2.8% 25.5% 71.7% 1.7% 2.9% 11.6% 5.4% MALTA 12.2% 9 9 0.9 30 88.9% 11.1% 35.8% 4.0% 60.1% 6.7% 9.7% 57.9% 11.1% 13.0% NETHERLANDS Urban Agricult. Natural 9.5% 8.5% 144 184 3.1 1012 80.4% 19.6% 17.1% 36.8% 46.0% 3.6% 3.5% 14.3% POLAND 20.5% 846 854 2.6 9729 84.7% 15.3% 5.5% 56.9% 37.6% 1.0% 7.1% 11.8% 4.4% PORTUGAL 17.1% 61 69 4.9 1842 85.5% 14.5% 6.2% 33.1% 60.7% 2.9% 4.9% 29.9% 18.8% ROMANIA 22.6% 404 371 6.5 18649 77.9% 22.1% 8.4% 49.6% 42.0% 1.2% 11.3% 14.7% 7.8% SWEDEN 10.9% 2919 3088 0.6 15908 93.8% 6.2% 2.3% 8.3% 89.5% 0.6% 5.7% 4.0% 6.3% SLOVAKIA 30.1% 361 207 1.2 6837 90.4% 9.6% 8.4% 44.9% 46.7% 1.5% 15.5% 20.1% 6.3% 5.7% 464 1090 0.9 2704 82.7% 17.3% 10.2% 28.0% 61.8% 2.7% 1.4% 9.4% 6.4% UN. KINDOM Table 1: Country based table of indices highlighting their highest value (orange) and their lowest (purple). 6 Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. For each country three functional connectivity indices are applied to the subnets1 : • Site area weighted Root Probability of Connectivity (RPC) which is sensitive to the size of subnets. v u n n uX X u ai · a j · p i j u u i =1 j =1 RPC = t A 2L Country based results on the Natura 2000 network connectivity In all countries, the N2K network is mostly made of simple subnets. Share of complex subnets ("physically connected" sites) range from 40% in Bulgaria to 5% in Latvia. Large numbers of subnets and similar small median sizes are found in Germany and France, their inter-site connectivity with emphasis on the sites’ sizes is rather low (RPC approx. 3%) but higher when the intersite distances and landscape are at focus (RAPC approx. 10%). Highest RPC are found for Spain, Slovakia, Romania and Bulgaria. The more natural landscape in Sweden and Finland does not result in high inter-site network connectivity due to large inter-site distances. The distribution of subnets with respect to roads explains the higher share of isolated subnets in Portugal than in Belgium. • Root un-weighted Average Probability of Connectivity (RAPC) which is sensitive to the unprotected landscape resistance and functional distances between subnets. v u n n uX X u pi j u t i =1 j =1 RAPC = n2 • Share of functionally Isolated subnets in the Natura 2000 network. Figure 7: European map of the root un-weighted average probability of connectivity (RAPC) and the share of N2K subnets functionally isolated. 1 RPC and RAPC are special cases of the general family of indices Power Weighted Probability of Dispersal (PWPD) [13]. They also belong to its simplified formulation s-PWPD [11] as instances in which the s-PWPD parameters {α, β, γ1 , γ2 } are respectively {0, 1/2, 1, 1} for RPC and {0, 1/2, 0, 0} for RAPC. 7 Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. Figure 8: National profile of site area weighted root probability of connectivity (RPC). The chart includes the N2K cover percentage per country and a proxy of the gap in connectivity computed as their difference (from [12]). For further datails please refer to: Estreguil, C., Caudullo, G., San-Miguel-Ayanz, J., 2013. Connectivity of Natura 2000 Forest Sites. EUR 26087EN. Luxemburg: Publications Office of the European Union. JRC 83104. DOI:10.2788/95065 Estreguil, C., de Rigo, D., Caudullo, G., 2014. A proposal for an integrated modelling framework to characterise habitat pattern. Environmental Modelling & Software 52, 176-191. DOI:10.1016/j.envsoft.2013.10.011 References [1] Bennett, J., 2010. OpenStreetMap. Packt Publishing. ISBN: 978-1-84719-750-4 (page 5). [2] Bennett, G., Bento Pais, R., Berry, P., Didicescu, P. S., Fichter, M., Hlaváč, V., Hoellen, K., Jones-Walters, L., Miko, L., Onida, M., Plesník, J., Smith, D., Wakenhut, F., 2010. Green Infrastructure Implementation: Proceedings of the European Commission Conference 19 November 2010. (Ed: Karhu, J.). European Commission, 28 pp. http://ec.europa.eu/environment/nature/ecosystems/green_infrastructure.htm (page 1). [3] de Rigo, D., 2012. Applying semantic constraints to array programming: the module ”check_is” of the Mastrave modelling library. In: Semantic Array Programming with Mastrave - Introduction to Semantic Computational Modelling. http://mastrave.org/doc/mtv_m/check_is (page 4). [4] Directorate-General for Environment (DG ENV), 2012. The Multifunctionality of Green Infrastructure. Science for Environment Policy. http://ec.europa.eu/environment/nature/ecosystems/docs/Green_Infrastructure.pdf (page 1). 8 Estreguil C., Caudullo G., de Rigo D., 2014. Connectivity of Natura 2000 forest sites in Europe. [5] Directorate-General for Environment (DG ENV), 2012. Natura 2000 data - the European network of protected sites. Temporal coverage: 2011. European Environment Agency web portal. http://www.eea.europa.eu/data-and-maps/data/ds_resolveuid/60860bd4-28d6-44aa-93c7d9354a8205e3 (page 2). [6] European Commission, 1992. Council directive 92/43/EEC of 21 may 1992 on the conservation of natural habitats and of wild fauna and flora. Official Journal of the European Union 35 (L 206), 7-50. (pages 1 and 2). [7] European Commission, 2010. Directive 2009/147/EC of the European Parliament and of the Council of 30 November 2009 on the conservation of wild birds. Official Journal of the European Union 53 (L 20), 7-25. (page 2). [8] European Commission, 2011. Our life insurance, our natural capital: an EU biodiversity strategy to 2020. Brussel, COM (2011) 244 final. http://ec.europa.eu/environment/nature/biodiversity/ comm2006/pdf/2020/1_EN_ACT_part1_v7%5B1%5D.pdf (page 1). [9] European Commission, 2013. Green Infrastructure (GI) - Enhancing Europe’s Natural Capital. Brussel, COM (2013) 249 final. http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=COM:2013:0249:FIN:EN:PDF (page 1). [10] European Environment Agency, 2012a. Corine Land Cover 2006 raster data - version 16. European Environment Agency web portal. http://www.eea.europa.eu/data-andmaps/data/ds_resolveuid/ef13cef8-2ef5-49ae-9545-9042457ce4c6 (page 5). [11] Estreguil, C., Caudullo, G., de Rigo, D., Whitmore, C., San-Miguel-Ayanz, J., 2012. Reporting on European forest fragmentation: standardized indices and web map services. IEEE Earthzine 5 (2), 384031+. http://www.earthzine.org/?p=384031 (2nd quarter theme: Forest Resource Information). (pages 4 and 7). [12] Estreguil, C., Caudullo, G., San-Miguel-Ayanz, J., 2013. Connectivity of Natura 2000 Forest Sites. EUR 26087EN. Luxemburg: Publications Office of the European Union. JRC 83104. DOI:10.2788/95065 (pages 2, 5, 6, and 8). [13] Estreguil, C., de Rigo, D., Caudullo, G., 2014. A proposal for an integrated modelling framework to characterise habitat pattern. Environmental Modelling & Software 52, 176-191. DOI:10.1016/j.envsoft.2013.10.011 (pages 2, 4, 5, and 7). [14] Estreguil, C., de Rigo, D., Caudullo, G., 2014. Supplementary materials for: A proposal for an integrated modelling framework to characterise habitat pattern. http://mastrave.org/bib/Estreguil_etal_EMSsuppl_2014.pdf (Extended version of the supplementary materials as published in Environmental Modelling & Software 52, 176-191, DOI:10.1016/j.envsoft.2013.10.011). (page 4). [15] Haklay, M., Weber, P., 2008. OpenStreetMap: User-Generated Street Maps. Pervasive Computing 7(4). doi: 10.1109/MPRV.2008.80. (page 5). [16] McHugh, N., Thompson, S., 2011. A rapid ecological network assessment tool and its use in locating habitat extension areas in a changing landscape. Journal for Nature Conservation 19 (2011) 236-244. DOI:10.1016/j.jnc.2011.02.002. (page 2). [17] Saura, S., Torné, J., 2009. Conefor Sensinode 2.2: a software package for quantifying the importance of habitat patches for landscape connectivity. Environmental Modelling & Software 24 (1), 135-139. DOI:10.1016/j.envsoft.2008.05.005. (page 5). [18] Soille, P., Vogt, P., 2009. Morphological segmentation of binary patterns. Pattern Recogn. Lett. 30 (4), 456-459. DOI:10.1016/j.patrec.2008.10.015. (page 5). [19] Van Rossum, G., Drake Jr., F., 2011. The Python Language Reference Manual (version 3.2). Network Theory Limited, ISBN 978-1-906966-14-0. (page 5). 9
5cs.CE
arXiv:1709.01427v1 [stat.ML] 5 Sep 2017 Stochastic Gradient Descent: Going As Fast As Possible But Not Faster Alice Schoenauer Sebag Altschuler&Wu lab, Dpt of Pharm. Chem. UCSF, San Francisco, CA 94158 [email protected] Marc Schoenauer INRIA-CNRS-UPSud-UPSay TAU, U. Paris-Sud, 91405 Orsay [email protected] Michèle Sebag CNRS-UPSud-INRIA-UPSay TAU, U. Paris-Sud, 91405 Orsay [email protected] Abstract When applied to training deep neural networks, stochastic gradient descent (SGD) often incurs steady progression phases, interrupted by catastrophic episodes in which loss and gradient norm explode. A possible mitigation of such events is to slow down the learning process. This paper presents a novel approach to control the SGD learning rate, that uses two statistical tests. The first one, aimed at fast learning, compares the momentum of the normalized gradient vectors to that of random unit vectors and accordingly gracefully increases or decreases the learning rate. The second one is a change point detection test, aimed at the detection of catastrophic learning episodes; upon its triggering the learning rate is instantly halved. Both abilities of speeding up and slowing down the learning rate allows the proposed approach, called SAL E RA, to learn as fast as possible but not faster. Experiments on standard benchmarks show that SAL E RA performs well in practice, and compares favorably to the state of the art. Machine Learning (ML) algorithms require efficient optimization techniques, whether to solve convex problems (e.g., for SVMs), or non-convex ones (e.g., for Neural Networks). In the convex setting, the main focus is on the order of the convergence rate [Nesterov, 1983, Defazio et al., 2014]. In the non-convex case, ML is still more of an experimental science. Significant efforts are devoted to devising optimization algorithms (and robust default values for the associated hyper-parameters) tailored to the typical regime of ML models and problem instances (e.g. deep convolutional neural networks for MNIST [Le Cun et al., 1998] or ImageNet [Deng et al., 2009]) [Duchi et al., 2010, Zeiler, 2012, Schaul et al., 2013, Kingma and Ba, 2014, Tieleman and Hinton, 2012]. As the data size and the model dimensionality increase, mainstream convex optimization methods are adversely affected. Hessian-based approaches, which optimally handle convex optimization problems however ill-conditioned they are, do not scale up and approximations are required [Martens et al., 2012]. Overall, Stochastic Gradient Descent (SGD) is increasingly adopted both in convex and non-convex settings, with good performances and linear tractability [Bottou and Bousquet, 2008, Hardt et al., 2015]. Within the SGD framework, one of the main issues is to know how to control the learning rate: the objective is to reach a satisfactory learning speed without triggering any catastrophic event, manifested by the sudden rocketing of the training loss and the gradient norm. Finding "how much is not too much" in terms of learning rate is a slippery game. It depends both on the current state of the system (the weight vector) and the current mini-batch. Often, the eventual convergence of SGD is ensured √ by decaying the learning rate as O(t) [Robbins and Monro, 1951, Defazio et al., 2014] or O( t) [Zinkevich, 2003] with the number t of mini-batches. While learning rate decay effectively prevents catastrophic events, it is a main cause for the days or weeks of computation behind the many breakthroughs of deep learning. Many and diverse approaches have thus been designed to achieve the learning rate adaptation [Amari, 1998, Duchi et al., 2010, Schaul et al., 2013, Kingma and Ba, 2014, Tieleman and Hinton, 2012, Andrychowicz et al., 2016] (more in Section 1). This paper proposes a novel approach to adaptive SGD, called SAL E RA (Safe Agnostic LEraning Rate Adaptation). SAL E RA is based on the conjecture that, if learning catastrophes are well taken care of, the learning process can speed up whenever successive gradient directions show general agreement about the direction to go. The frequent advent of catastrophic episodes, long observed by neural net practitioners [Goodfellow et al., 2016, Chapter 8] raises the question of how to best mitigate their impact. The answer depends on whether these events could be anticipated with some precision. Framing catastrophic episodes as random events1 , we adopt a purely curative strategy (as opposed to a preventive one): detecting and instantly curing catastrophic episodes. Formally, a sequential cumulative sum change detection test, the Page-Hinkley (PH) test [Page, 1954, Hinkley, 1970] is adapted and used to monitor the learning curve reporting the minibatch losses. If a change in the learning curve is detected, the system undergoes an instant cure by halving the learning rate and backtracking to its former state. Such instant cure can be thought of in terms of a dichotomic approximation of line search (see e.g. Defazio et al. [2014], Eq. (3)). Once the risk of catastrophic episodes is well addressed, the learning rate can be adapted in a more agile manner: the AL E RA (Agnostic LEarning Rate Adaptation) process increases (resp. decreases) the learning rate whenever the correlation among successive gradient directions is higher (resp. lower) than random, by comparing the actual gradient momentum and the agnostic momentum built from random unit vectors. The contribution of the paper is twofold. First, it proposes an original and efficient way to control learning dynamics (section 2.1). Secondly, it opens a new approach for handling catastrophic events and salvaging a significant part of doomed-to-fail runs (section 2.2). The experimental validation thereof compares favorably with the state of the art on the MNIST and CIFAR-10 benchmarks (section 3). 1 Related work SGD was revived in the last decade as an effective method for training deep neural networks with linear computational complexity in the size of the dataset [Bottou and Bousquet, 2008, Hardt et al., 2015]. SGD faces two limitations, depending on the learning rate: too large, and the learning trajectory leads to catastrophic episodes; too small, and its convergence takes ages. The dynamic adjustment of the learning rate was therefore acknowledged a key issue since the early SGD days [Robbins and Monro, 1951]. Dealing with catastrophic events in deep learning The exploding gradient problem, described in [Goodfellow et al., 2016, Chapter 8] as the encounter of steep cliff structures in the derivative landscape during learning, is frequently met while training neural networks (and even more so when training recurrent neural networks [Bengio et al., 1994]). When it comes to dealing with such events, most published work focuses on creating the conditions so that they do not arise. Among the possibilities are the use of regularizations, e.g., L1 or L2 regularization [Pascanu et al., 2013] or Max-norm regularization [Srivastava et al., 2014]. Gradient clipping, constraining the gradient norm to remain smaller than a constant [Pascanu et al., 2013], is another possibility. The introduction of batch normalization [Ioffe and Szegedy, 2015] also helps diminishing the frequency of such events. Finally, proper initialization [Glorot and Bengio, 2010, Sutskever et al., 2013] or unsupervised pre-training [Erhan et al., 2010], i.e. initializing the optimization trajectory in a good region of the parameter space, also diminish the frequency of such events. Learning rate adaptation Addressing the slow speed of SGD, learning rate adaptation has been acknowledged a key issue since the late 80s (see George and Powell [2006] for a review). Using the 1 As far as tractable computational resources are involved in their prediction. 2 information contained in the correlation of successive gradient directions was already at the heart of the delta-delta and delta-bar-delta update rules proposed by Jacobs [1988]. Briefly, the delta-bar-delta rule states that for each parameter, if the current gradient and the relaxed sum of past gradients have the same sign, the learning rate is incremented additively; and if they are of opposite sign, then the learning rate is decremented multiplicatively. Decrementing the learning rates faster than increasing them was already advocated by the author to adapt faster in case of catastrophic events. The natural gradient descent (NGD) approach [Amari, 1998] considers the Riemaniann geometry of the parameter space, using the Fisher information matrix (estimated by the gradient covariance matrix), to precondition the gradient. Due to its quadratic complexity in the dimension of the parameter space, NGD approximations have been designed for deep networks [Pascanu and Bengio, 2014]. Notably, approaches such as the Hessian-Free from Martens [2010] can be interpreted as NGD [Pascanu and Bengio, 2014]. A DAGRAD [Duchi et al., 2010] also uses the information of past gradients to precondition each update in a parameter-wise manner, dividing the learning rate by the sum of squared past gradients. Several approaches have been proposed to refine A DAGRAD and mitigate its learning rate decay to 0, including A DADELTA [Zeiler, 2012], RMSProp [Tieleman and Hinton, 2012], and A DAM [Kingma and Ba, 2014]. A DAM is based on estimating the first and second moments of the gradient w.r.t. each parameter, and using their ratio to update the parameters. Moment estimates are maintained by exponential moving averages of different weight factors, such that by default the inertia of the first moment is higher by two orders of magnitude than the second. As will be seen, SAL E RA also builds upon the use of the gradient second moment, with the difference that it is compared with a fixed agnostic counterpart. In [Schaul et al., 2013], the learning rate is computed at each time-step to approximately maximally decrease the expected loss, where the loss function is locally approximated by a parabola. Finally, Andrychowicz et al. [2016] address learning rate adaptation as a reinforcement learning problem, exploiting the evidence gathered in the current time steps to infer what would have been the good decisions earlier on, and accordingly optimizing a hyper-parameter adjustment policy. More remotely related are the momentum approaches, both its classic [Polyak, 1964] and Nesterov versions [Nesterov, 1983] as derived by Sutskever et al. [2013], that rely on a relaxed sum of past gradients for indicating a more robust descent direction than the current gradient. 2 SAL E RA SAL E RA involves two components: a learning rate adaptation scheme, which ensures that the learning system goes as fast as it can; and a catastrophic event manager, which is in charge of detecting undesirable behaviors and getting the system back on track. 2.1 Agnostic learning rate adaptation Rationale The basic idea of the proposed learning rate update is to compare the current gradient descent to a random walk with uniformly chosen gradient directions. Indeed, the sum of successive normalized gradient vectors, referred to as cumulative path in the following, has a larger norm than the sum of uniformly drawn unit vectors if and only if gradient directions are positively correlated. In such cases, the learning process has a global direction and the process can afford to speed up. On the opposite, if the norm of the cumulative path is smaller than its random equivalent, gradient directions are anti-correlated: the process is alternating between opposite directions (e.g., bouncing on the sides of a narrow valley, or hovering around some local optimum) and the learning rate should be decreased. The AL E RA scheme takes inspiration from the famed CMA-ES [Hansen and Ostermeier, 2001] and NES [Wierstra et al., 2014] algorithms, today considered among the best-performing derivative-free continuous optimization algorithms. These approaches de facto implement natural gradient optimization [Amari, 1998] and instantiate the Information-Geometric Optimization paradigm [Ollivier et al., 2017] in the space of normal distributions on IRd . Formally, CMA-ES maintains a normal distribution. The variance of the normal distribution, aka step-size, is updated on the basis of a comparison of the cumulative path of the algorithm (moving exponential average of successive steps) with that of a random walk with Gaussian moves of fixed step-sizes. This mechanism is said to be agnostic as it makes no assumption whatsoever on the properties of the optimization objective. 3 The AL E RA algorithm The partial adaptation of the CMA-ES scheme to the minimization of a loss function L on a d-dimensional parameter space is defined as follows. Let θt be the solution at time t, gt = ∇θ L(θt ) the gradient of the current loss, and ηt the current learning rate. SGD computes the solution at time t + 1 by θt+1 = θt − ηt gt . Let k.k denote the L2 norm and < ., . > the associated dot product. Definition. For t > 0, the exponential moving average of the normalized gradients with weight α, pt , and its random equivalent rt are defined as: p0 = 0; r0 = 0 pt = α gt /kgt k + (1 − α) pt−1 rt = α ut + (1 − α) rt−1 (1) (2) (3) where (ut )t>0 are independent random unit vectors in IRd . Proposition. For t > 0, the expectation µ(t) and variance σ 2 (d, t) of krt k2 as defined above are: α µ(t) = E(krt k2 ) = [1 − (1 − α)2t ] (4) 2−α σ 2 (d, t) = V ar(krt k2 ) = 1 2α2 (1 − α)2 [1 − (1 − α)t ][1 − (1 − α)t−1 ] d (2 − α)2 ((1 − α)2 + 1) (5) Proof: Appendix A. Let µ and σ 2 (d) denote the limits of respectively µ(t) and σ 2 (d, t) as t → +∞. At time step t, the AL E RA scheme updates the cumulative path pt by comparing its norm with the distribution of the agnostic momentum defined from µ and σ 2 (d). The learning rate is increased or decreased depending on the normalized gap between the squared norm of pt and rt :   kpt k2 − µ ηt+1 = ηt exp C (6) σ(d) with C a hyper-parameter of the algorithm. The approach is implemented in the AL E RA algorithm (non-greyed lines in Algorithm 1). Given hyper-parameters α and C, as well as η0 , the initial learning rate, and ρ the mini-batch size, each iteration over a mini-batch computes the new exponential moving average of the normalized gradient (line 13), performs the agnostic update of the learning rate (line 14) before updating parameter θ the usual way (line 15). The learning rate can be controlled in a layer-wise fashion, independently maintaining an exponentiated moving average and updating the learning rate for each layer of the neural network (lines 13-14). This algorithm is used in all experiments of Section 3. Parameter-wise learning rate adaptation As noted by Kingma and Ba [2014], the parameterwise control of the learning rate is desirable in some contexts. The above scheme is extended to achieve the parameter-wise update of the learning rate as follows. For t > 0 let r2t,i denote the squared ith coordinate of rt . It is straightforward to show that the expectation (respectively the standard deviation) of r2t,i is the expectation of rt divided by d (respectively the standard deviation of √ rt divided by d). Given t > 0 and i ∈ [|1; d|], the squared ith coordinate of pt noted r2t,i , can thus likewise be adjusted by comparison with its random counterpart r2t,i . The update therefore becomes: ( ) r2 − µ 0 1 t,i ηi,t+1 = ηi,t exp C √ (7) d σ(d) See Appendix B for a full derivation of the parameter-wise algorithm. 2.2 Catastrophic event management As said, the ability to learn fast requires an emergency procedure, able both to detect an emergency and to recover from it. 4 Algorithm 1: S-AL E RA: Agnostic LEarning Rate Adaptation and Page-Hinkley change detection 1 2 3 4 Input: Model with loss function L Parameters : Memory rate α, factor C //algorithm parameters Initial learning rate η0 , mini-batch ratio ρ // run parameters Initialize : t ← 0; p ← 0; η ← η0 ; init(θ) // initialization ¯ ← 0; ∆ ← L(θ, first mini-batch)/10 L, Lmin , `, `, // initialize Page-Hinkley while stopping criterion not met do M B ← new mini-batch ; t ← t + 1 // perform forward pass ` = ρL(θ, MB) + (1 − ρ)` ¯ `¯ ← (` + t`)/(t + 1) // empirical mean of batch losses 5 ¯ L ← L + (` − `) 6 Lmin ← min(Lmin , L) 7 if L − Lmin > ∆ then 8 θ ← θ(b) ; η ← η/2 9 ¯ ` ← 0; t ← 0 L, Lmin , `, 10 11 12 13 14 15 16 17 // cumulated deviations from mean // lower bound of deviations // Page-Hinkley triggered: backtrack // and re-initialize Page-Hinkley2 else θ(b) ← θ g ← ∇θ L(θ, MB) p ← αg/kgk + (1 − α)p  η ← η exp C(kpk22 − µ)/σ(d) θ ← θ − ηg end end // save for possible backtracks // compute gradient with backward pass // exponential moving average of normalized gradients // agnostic learning rate update // standard parameter update Recovery In a healthy learning regime, the training error should decrease along time − up to the noise due to the inter-batch variance − unless the learning system abruptly meets a cliff structure [Goodfellow et al., 2016], usually blamed on too large a learning rate in an uneven gradient landscape. In a convex noiseless optimization setting, if computationally tractable, the best strategy is to compute (an approximation of) the optimal learning rate η ∗ through line search3 . In such context, as a thought experiment, let η − > 0 be such that, if used to update θt , the resulting θt+1 would yield the same performance as θt . For η > η − , θt+1 yields a worse performance than θt , and if continued the optimization process is likely to diverge. For η < η ∗ , θt+1 yields a performance improvement. For η ∗ < η < η − , θt+1 yields a performance improvement too; the further θ trajectory is likely to bounce back and forth on the walls of the optimum valley. Overall, the safety zone for the learning rate is ]0, η − [ (with the caveat that the safety zone is narrower for ill-conditioned optimization problems). The proposed safeguard strategy primarily aims to detect when η steps outside of its safety zone (see the change point detection test below), and to apply a correction as to get back in it. Upon change detection in the mini-batch loss, SAL E RA implements a straightforward correction: halving the learning rate and recovering the last solution before test − triggering. The halving process is iterated if needed, sending ηt back in ] η2 , η − ] exponentially fast (except for the perturbations in the gradient due to the mini-batch variance). The rationale for the halving trick is based on a trade-off between the number of successive dividing iterations, that could indeed be made even smaller by using a larger dividing factor, and the required standard AL E RA iterations that will be needed to reach the optimal learning rate η ∗ after having reached the safety zone again. The choice of the 2 dividing factor is further discussed in Appendix C. 2 There are in fact two time counters in the full SAL E RA Algorithm, the global usual one and the one related to the Page-Hinkley test. Only one is used here for simplicity reasons. 3 See Defazio et al. [2014] on how to handle the noise in the case of a composite loss function. 5 Detection SAL E RA applies a change detection test on the signal given as the minibatch loss `t . The PH detection test [Page, 1954, Hinkley, 1970] is chosen as it provides optimal guarantees about the trade-off between the detection delay upon a change (affecting the average or standard deviation of the signal) and the mean time between false alarms. For t > 0, it maintains the empirical mean `¯t of the signal, and the cumulative deviation4 Lt from the empirical mean (Lt = Lt−1 + (`t − `¯t )). Finally, it records the empirical bounds of Lt (Lmin = mint Lt ; Lmax = maxt Lt ). In case of a stationary signal, the expectation of Lt is 0 by construction; the PH change test is thus triggered when the gap between Lt and its empirical bounds is higher than a problem-dependent threshold ∆, which controls the alarm rate. The PH test is implemented in the SAL E RA algorithm as follows (greyish lines in Algorithm 1). ∆ is set to L(θ, first mini-batch)/λ, with λ = 10, that is, one tenth of the empirical loss on the first minibatch in all experiments (this issue is further discussed in Section 3.2). Variables `¯t , L and Lmax are maintained (lines 5- 6). In the learning context, a decrease of the loss signal is welcomed and expected. Only the case of an increasing signal is thus monitored. Upon test triggering (Lmax − L > ∆), the learning rate is halved and the weight vector θ is reset to the last solution before then (line 8), and the PH test is reinitialized (line 9). 3 Experiments The goal of the following experiments is to validate the algorithmic ideas introduced in section 2 by comparing their application with that of widely used optimization techniques (see Section 1) on some straightforward NN architectures. 3.1 Experimental Setting Datasets All experiments are performed on the MNIST [Le Cun et al., 1998] and CIFAR10 [Krizhevsky, 2009] datasets, which respectively contain 60k and 50k training examples. Both contain 10k test examples, which are to be classified in 10 classes. The data is normalized according to the mean and standard deviation along each coordinate on the training set. Algorithms Adagrad, NAG, and Adam are used as baselines. The agnostic adaptation rule and the change detection can be applied independently. In order to separate their effect, 3 original algorithms are studied here: ALeRA (the white lines in Algorithm 1) implements the agnostic learning rate adaptation without the change detection; Ag-Adam uses the same agnostic adaptation for the learning rate on top of the A DAM algorithm. Finally, the change detection mechanism is implemented with the agnostic adaptation, yielding SALeRA as described in Algorithm 1, as well as its parameter-wise version SPALeRA (Algorithm 2 in Appendix B). Hyperparameters The exploration of the hyper-parameter space for all algorithms has been done on a grid of possible values (with the exception of Adagrad which has no hyper-parameter): - NAG: the momentum γ ∈ {.8, .9, .99, .999}. - Adam: β1 ∈ {.8, .9, .99} and β2 ∈ {.99, .999, .9999}; - ALeRA: α ∈ {.001, .01, .1, .25} and C ∈ {3.10−8 , 3.10−7 , 3.10−6 , 3.10−5 } (see Algorithm 1). The parameters for SALeRA and SPALeRA are the same, as there is no additional parameter for the Page-Hinkley part. - Ag-Adam: the recommended values for A DAM (β1 = .9 and β2 = .999) are used for the A DAM part, the same values than for AL E RA are used for the AL E RA part. The initial learning rate η0 ranges from 10−5 to 1 depending on the algorithm. Finally, the mini-batch size was set to either 1% or 1h of the training set size. All reported results are based on 5 independent runs performed for each hyperparameter set unless otherwise specified. Network Models All experiments consider the following 4 network architectures: - M0: a softmax regression model with cross-entropy loss (i.e. no hidden layers), 4 The PH test takes into account the extreme value phenomenon by considering an upper cumulative deviation and a lower cumulative deviation, defined from Lt by adding (resp. subtracting) a margin δ to Lt . In SAL E RA δ is set to 0. 6 - M2: 2 fully connected hidden layers with ReLU activation, on top of M0. The hidden layers are of respective sizes (500, 300) for MNIST, (1 500, 900) for CIFAR-10. - M2b is identical to Model M2 above, except that Batch Normalization layers [Ioffe and Szegedy, 2015] are added in each hidden layer. - M4: LeNet5-inspired convolutional models [Le Cun et al., 1998]. These models contain 2 convolutional layers with max-pooling followed by 2 fully connected layers, all with ReLU activation. They are of respective sizes (32, 64, 128, 128) for MNIST, and (32, 64, 384, 384) for CIFAR-10. Batch normalization is used in each layer. These architectures are not specifically optimized for the task at hand, but rather chosen to compare the performances of past and novel algorithms in a wide variety of situations. Experimental conditions All computations are performed on 46 GPUs (5 TITAN X(Pascal), 9 GTX 1080 and 32 Tesla K80) using the Torch library [Collobert et al., 2011] in double precision. A typical run on a TITAN X (Pascal) GPU for 20k mini-batches of size 50 for CIFAR-10 on M4 takes between 8 and 10 minutes for all algorithms. Metrics MNIST and CIFAR-10 are classification problems. We therefore report classification accuracy on the test set at 5 epochs (i.e. 5 full passes on the training set) and 20 epochs (end of all runs), as well as their standard deviations on the 5 independent runs. 3.2 Experimental results MNIST M0 M2 M2b M4b CIFAR M0 M0 M2 M2 M2b M2b M4b M4b 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. NAG 7.75 (.14) 7.59 (.07) 1.95 (.17) 1.58 (.08) 1.82 (.13) 1.47 (.10) .85 (.08) .72 (.09) 60.37 (.55) 59.73 (.19) 45.82 (.93) 45.08 (.32) 45.01 (.84) 42.50 (.48) 27.74 (.48) 27.45 (.39) Adagrad 7.73 (.06) 7.51 (.09) 2.00 (.06) 1.71 (.08) 1.72 (.07) 1.48 (.06) 1.02 (.09) .82 (.08) 60.49 (.71) 59.76 (.36) 44.81 (.62) 43.59 (.51) 44.18 (.62) 43.79 (.25) 34.93 (.96) 29.15 (.67) A DAM 7.72 (.12) 7.43 (.10) 2.07 (.11) 1.56 (.06) 1.81 (.07) 1.57 (.94) .89 (.31) .80 (.08) 60.60 (.45) 59.81 (.24) 45.68 (.39) 44.43 (.50) 44.30 (.96) 43.60 (.64) 28.50 (.68) 27.84 (.59) AG -A DAM AL E RA 7.31 (.09) 7.51 (.09) 7.29 (.09) 7.43 (.03) 1.93 (.17) 1.86 (.11) 1.57 (.04) 1.55 (.10) 1.66 (.08) 1.59 (.08) 1.53 (.05) 1.43 (.04) .91 (.06) .82 (.30) .79 (.05) .63 (.05) 59.62 (.27) 59.89 (.19) 59.34 (.24) 59.31 (.11) 44.91 (.42) 44.69 (17.58) 43.25 (.40) 43.19 (.21) 43.33 (.33) 43.08 (.17) 42.72 (.33) 42.12 (.15) 25.60 (.29) 28.61 (.50) 25.30 (.18) 26.35 (.64) SAL E RA 7.51 (.09) 7.44 (.04) 1.87 (.05) 1.59 (.09) 1.59 (.08) 1.48 (.09) .82 (.30) .64 (.07) 59.69 (.33) 59.31 (.25) 44.42 (.24) 42.72 (.41) 43.08 (.17) 42.50 (.29) 28.61 (.50) 25.93 (.64) SPAL E RA 8.03 (.09) 7.60 (.08) 1.93 (.14) 1.55 (.09) 1.78 (.08) 1.50 (.09) .82 (.14) .63 (.11) 61.32 (.65) 59.71 (.48) 45.74 (.85) 44.48 (.65) 44.92 (.89) 43.23 (.27) 29.61 (.99) 27.94 (.22) Table 1: Best performances (test error over all tested parameter settings) at 5 and 20 epochs of NAG, A DAGRAD, A DAM, AG -A DAM, AL E RA and SAL E RA (average and standard deviation on 5 runs). For each line, the best results are in bold, and results less than 1 std.dev. away are in italics. Learning performances The experimental evidence (Table 1) shows that AG -A DAM quite often slightly but statistically significantly improves on A DAM. A possible explanation is that AG -A DAM has a more flexible adjustment of the learning rate than A DAM (possibly increasing η by a few orders of magnitude). In many cases, AL E RA and SAL E RA yield similar results; indeed, whenever AL E RA does not meet catastrophic episodes, AL E RA and SAL E RA have the same behaviors. A representative run, where AL E RA and SAL E RA undergo catastrophic episodes is depicted on Fig. 1 (both runs with same random seed). AL E RA faces a series of catastrophic episodes, where the training error reaches up to 80%. It eventually stabilizes itself with a medium training loss, but with test error above 80%. In the meanwhile, SAL E RA reacts upon the first catastrophic episode around epoch 8, by halving the learning rate on each layer. It faces a further catastrophic episode around epoch 13, and halves the learning rates again. Overall, it faces less frequent and less severe (in terms of train loss and test error deteriorations) accidents. Eventually, SAL E RA recovers acceptable train and test errors. 7 MNIST M0 M2 M2b M4b CIFAR M0 M2 M2b M4b 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. 5ep. 20ep. NAG 7.91 (.14) 7.59 (.07) 1.95 (.17) 1.64 (.06) 1.85 (.05) 1.47 (.10) .85 (.08) .76 (.12) 60.73 (.44) 59.73 (.19) 46.62 (.12) 45.08 (.32) 45.48 (.67) 43.86 (.52) 27.74 (.48) 27.70 (.76) A DAM AG -A DAM AL E RA 7.87 (.25) 7.86 (.20) 7.96 (.13) 7.45 (.08) 7.34 (.08) 7.53 (.10) 2.30 (.17) 2.04 (.15) 1.89 (.07) 1.59 (.06) 1.80 (.45) 1.68 (.04) 1.93 (.09) 1.99 (.11) 1.71 (.11) 1.62 (.09) 1.82 (.26) 1.59 (.05) 1.03 (.08) 1.08 (.13) .99 (.11) .80 (.08) .91 (.08) .83 (.01) 60.74 (.39) 60.55 (.49) 60.46 (.81) 60.08 (.22) 59.34 (.24) 59.31 (.11) 45.71 (.54) 45.15 (.15) 44.84 (17.52) 44.44 (.61) 44.30 (.42) 43.92 (1.43) 44.90 (.50) 43.33 (.33) 44.15 (.29) 43.60 (.64) 43.11 (.35) 42.70 (.31) 29.34 (.83) 28.15 (.21) 28.61 (.50) 28.00 (.72) 27.46 (.54) 27.60 (.26) SAL E RA 7.96 (.13) 7.53 (.06) 1.87 (.05) 1.68 (.05) 1.72 (.04) 1.59 (.05) .99 (.14) .83 (.01) 60.43 (.42) 59.37 (.10) 45.01 (.14) 43.68 (.25) 44.49 (.18) 42.70 (.31) 28.61 (.50) 27.60 (.26) SPAL E RA 8.06 (.10) 7.60 (.08) 1.94 (.13) 1.63 (.05) 1.80 (.08) 1.52 (.02) .94 (.09) .63 (.11) 61.71 (.76) 59.79 (.57) 46.08 (.90) 44.62 (.56) 45.45 (.57) 43.51 (.80) 30.09 (.73) 28.05 (.43) Table 2: Best performance (test error) for the robust algorithm-parameter settings (over all runparameters settings for η0 and batch size): momentum .9 for NAG, β1 = .8 and β2 = .9999 for A DAM, α = .001 and C = 3.10−6 for AG -A DAM α = .01 and C = 3.10−6 for AL E RA and SAL E RA, and α = .1 and C = 3.10−8 for SPAL E RA. It is interesting to note that the learning rates on Fig. 1 are constantly increasing, in contradiction with common knowledge. In practice, the learning rate behavior depends on the dataset, the neural architecture and the seed, and can be very diverse (constant decrease, constant increase, or most of the time, an increase followed by a decrease). The diverse learning rate behavior is viewed as an original feature of the proposed approach, made possible by the ability to detect, and recover from, catastrophic explosions of the training loss. The actual behavior of all algorithms is depicted for CIFAR-10, model M4 on Fig. 2, with AG -A DAM, AL E RA and SAL E RA respectively getting first, second and third rank in terms of test error at 20 epochs. In terms of optimization per se, SAL E RA (respectively AL E RA) reaches a training error close to 0 at epoch 10 (resp. epoch 20) whereas AG -A DAM reaches a plateau after epoch 15. In the meanwhile, the test error decreases and the test loss increases for all three algorithms. A tentative interpretation for this fact is that the neural net yields more crisp output, close to 0 or 1; this does not change the error while increasing the loss. This result suggests several perspectives for further work (Section 4). In order to determine to which extent the best results in Table 1 depend on the hyper-parameter settings, and define best configurations for the considered benchmarks, a sensitivity analysis was performed, comparing the results on all models and all epochs for each setting, and choosing the one with lowest sum of ranks. The results for these robust settings are displayed table 2 (as A DAGRAD has no hyper-parameter, it is not mentioned there). The proposed hyper-parameters for AL E RA and SAL E RA are found to be α = .01 and C = 3.10−6 . Interestingly enough, we find that the optimal hyper-parameters for A DAM are β1 = .8 and β2 = .9999 instead of β1 = .9 and β2 = .999 as is suggested in the original paper [Kingma and Ba, 2014]. The proposed approaches still show some advantage over A DAM and NAG, though they seem more sensitive to their parameter tuning. It is left for further work to derive precise recommendations depending on model characteristics. Catastrophe management performances Let us define a failed run as a run which attains more than 80% test error after 20 epochs. AL E RA is observed to have 18.3% failed runs over the parameter range as defined in 3.1. Our catastrophe management scheme makes it possible for SAL E RA to avoid approximately 40% of these failures, reaching a rate of failure of 11.7% on the same parameter range. It would of course be possible to further diminish the failure rate of SAL E RAby setting the PH alarm threshold ∆ to L(θ, first mini-batch)/λ with λ = 100 (or 1, 000), rather than 10 as used in all experiments reported above. However, this would potentially interfere with learning rate adaptation by triggering learning rate halvings even when there is no serious alert to be made, thus preventing it to be as bold as possible. Indeed, setting λ = 100 causes a decline of more than half 8 Figure 1: Comparison, on a representative run on MNIST M2 (with same random seed), of AL E RA and SAL E RA: test error (top row), minibatch error (middle row) and learning rates (bottom row). A first catastrophic episode is met around epoch 8: SAL E RA reacts by dividing the learning rate for all three layers. Note that the further catastrophic events met by SAL E RA are more rare and less severe than for AL E RA: SAL E RA eventually yields a better training loss and a considerably better test error than AL E RA. Better seen in color. Figure 2: Comparative behaviors on CIFAR-10, model M4 (best configuration for each algorithm, see text). Left: test error. Middle: test loss. Right: mini-batch error. Better seen in color. 9 of SAL E RA performances (data not shown), even though it manages to approximately halve the number of failed runs. Furthermore, setting λ = 1 000 does not further diminish the failure rate, therefore only harming SAL E RA learning performances. On the other hand, setting λ = 1 does not significantly improve the best performances, but has a higher failure rate. One tenth of the initial loss is therefore a very good balance between the aggressive learning rate adaptation scheme and its braking counterpart, at least on these datasets and architectures. 4 Discussion The first proposed contribution relies on the comparison of the gradient momentum with a fixed reference. It is meant to estimate the overall correlation among the sequence of gradients, which can be thought of as a signal-to-noise ratio in the process generated from the current solution, the objective and the successive mini-batches. Depending on this ratio, the process can be accelerated or slowed down. The AL E RA procedure, which implements this idea, proves to be significantly able to increase and decrease the learning rate. Furthermore, this process can be plugged on A DAM, with a performance improvement on average. The price to pay for this flexibility is that it increases the risk of catastrophic episodes, with instant rocketing of the training loss and gradient norm. The proposed approach relies on the conjecture that catastrophic episodes can be rigorously observed and detected. A second conjecture is that a neural net optimizer is almost doomed to face such episodes along the optimization process. These events are mostly detrimental to optimization: before the run, one often chooses small learning rates (and thus slow convergence) to prevent them, and during the run, they are mostly not recovered from. Based on these two conjectures, the second contribution of the paper is an agnostic and principled way to detect and address such episodes. The detection relies on the Page-Hinkley change point detection test. As soon as an event is detected, learning rates are halved and the previous solution recovered. A short-term perspective for further research is to apply the proposed approach to recurrent neural networks, and to consider more complex datasets. Another perspective is to replace the halving trick by approximating the line search, e.g. by exploiting the gaps between the actual momentum and the reference one, for several values of the momentum weight factor. A third perspective regards the adaptation of the PH detection threshold ∆ during learning. In some runs, the PH test is triggered over and over, resulting in a very small learning rate preventing any further improvement. The goal is to adapt ∆ when the PH mechanism is re-initialized (line 9 of Algorithm 1) from the current loss values. Another perspective is to apply SAL E RA to Acknowledgments We heartfully thank Steve Altschuler and Lani Wu for making this work possible, supporting it, as well as for very insightful discussions. We also thank Yann Ollivier and Sigurd Angenent for other insightful discussions, and the anonymous reviewers of a preliminary version of this paper for their accurate and constructive comments. References S.-I. Amari. Natural gradient works efficiently in learning. Neural Comput., 10(2):251–276, Feb. 1998. ISSN 0899-7667. doi: 10.1162/089976698300017746. URL http://dx.doi.org/10. 1162/089976698300017746. M. Andrychowicz, M. Denil, S. G. Colmenarejo, M. W. Hoffman, D. Pfau, T. Schaul, and N. de Freitas. Learning to learn by gradient descent by gradient descent. In D. D. Lee, M. Sugiyama, U. von Luxburg, I. Guyon, and R. Garnett, editors, NIPS 16, pages 3981–3989, 2016. Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. Trans. Neur. Netw., 5(2):157–166, Mar. 1994. ISSN 1045-9227. doi: 10.1109/72.279181. URL http://dx.doi.org/10.1109/72.279181. L. Bottou and O. Bousquet. The tradeoffs of large scale learning. In J. Platt, D. Koller, Y. Singer, and S. Roweis, editors, Advances in Neural Information Processing Systems, volume 20, pages 161– 10 168. NIPS Foundation (http://books.nips.cc), 2008. URL http://leon.bottou.org/papers/ bottou-bousquet-2008. R. Collobert, K. Kavukcuoglu, and C. Farabet. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop, 2011. A. Defazio, F. R. Bach, and S. Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, NIPS14, pages 1646–1654, 2014. J. Deng, K. Li, M. Do, H. Su, and L. Fei-Fei. Construction and Analysis of a Large Scale Image Ontology. Vision Sciences Society, 2009. J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Technical Report UCB/EECS-2010-24, EECS Department, University of California, Berkeley, Mar 2010. URL http://www2.eecs.berkeley.edu/Pubs/TechRpts/2010/ EECS-2010-24.html. D. Erhan, Y. Bengio, A. Courville, P.-A. Manzagol, P. Vincent, and S. Bengio. Why does unsupervised pre-training help deep learning? J. Mach. Learn. Res., 11:625–660, Mar. 2010. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id=1756006.1756025. A. P. George and W. B. Powell. Adaptive stepsizes for recursive estimation with applications in approximate dynamic programming. Mach. Learn., 65(1):167–198, Oct. 2006. ISSN 0885-6125. doi: 10.1007/s10994-006-8365-9. URL http://dx.doi.org/10.1007/s10994-006-8365-9. X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, AISTATS 2010, Chia Laguna Resort, Sardinia, Italy, May 13-15, 2010, pages 249–256, 2010. URL http://www.jmlr.org/proceedings/papers/v9/glorot10a.html. I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. MIT Press, 2016. http://www. deeplearningbook.org. N. Hansen and A. Ostermeier. Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 9(2):159–195, 2001. M. Hardt, B. Recht, and Y. Singer. Train faster, generalize better: Stability of stochastic gradient descent. CoRR, abs/1509.01240, 2015. URL http://arxiv.org/abs/1509.01240. D. Hinkley. Inference about the change point from cumulative sum-tests. Biometrika, 58:509–523, 1970. S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 448–456, 2015. URL http://jmlr.org/ proceedings/papers/v37/ioffe15.html. R. A. Jacobs. Increased rates of convergence through learning rate adaptation. Neural Networks, 1 (4):295–307, 1988. D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://dblp.uni-trier.de/db/journals/corr/corr1412.html#KingmaB14. A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. Y. Le Cun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pages 2278–2324, 1998. J. Martens. Deep learning via hessian-free optimization. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), June 21-24, 2010, Haifa, Israel, pages 735–742, 2010. URL http://www.icml2010.org/papers/458.pdf. J. Martens, I. Sutskever, and K. Swersky. Estimating the hessian by back-propagating curvature. In ICML. icml.cc / Omnipress, 2012. 11 Y. Nesterov. A method of solving a convex programming problem with convergence rate O(1/sqr(k)). Soviet Mathematics Doklady, 27:372–376, 1983. Y. Ollivier, L. Arnold, A. Auger, and N. Hansen. Information-geometric optimization algorithms: A unifying picture via invariance principles. Journal of Machine Learning Research, 18(18):1–65, 2017. URL http://jmlr.org/papers/v18/14-467.html. E. Page. Continuous inspection schemes. Biometrika, 41:100–115, 1954. R. Pascanu and Y. Bengio. Revisiting natural gradient for deep networks. In International Conference on Learning Representations 2014 (Conference Track), Apr. 2014. URL http://arxiv.org/ abs/1301.3584. R. Pascanu, T. Mikolov, and Y. Bengio. On the difficulty of training recurrent neural networks. In Proceedings of the 30th International Conference on International Conference on Machine Learning - Volume 28, ICML’13, pages III–1310–III–1318. JMLR.org, 2013. URL http://dl. acm.org/citation.cfm?id=3042817.3043083. B. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964. H. Robbins and S. Monro. A stochastic approximation method. Annals of Mathematical Statistics, 22:400–407, 1951. T. Schaul, S. Zhang, and Y. Le Cun. No More Pesky Learning Rates. In Proceedings of the 30th International Conference on International Conference on Machine Learning, volume 28, pages 343–351, 2013. N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res., 15(1):1929–1958, Jan. 2014. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id=2627435.2670313. I. Sutskever, J. Martens, G. Dahl, and G. Hinton. On the importance of initialization and momentum in deep learning. In Proceedings of the 30th International Conference on International Conference on Machine Learning, volume 28 of ICML’13, pages III–1139–III–1147. JMLR.org, 2013. URL http://dl.acm.org/citation.cfm?id=3042817.3043064. T. Tieleman and G. Hinton. Lecture 6.5 - RMSProp, COURSERA: Neural Networks for Machine Learning. Technical report, Technical report, 2012. D. Wierstra, T. Schaul, T. Glasmachers, Y. Sun, J. Peters, and J. Schmidhuber. Natural evolution strategies. J. Mach. Learn. Res., 15(1):949–980, 2014. ISSN 1532-4435. M. D. Zeiler. ADADELTA: an adaptive learning rate method. CoRR, abs/1212.5701, 2012. URL http://arxiv.org/abs/1212.5701. M. Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the Twentieth International Conference on International Conference on Machine Learning, ICML’03, pages 928–935. AAAI Press, 2003. ISBN 1-57735-189-4. URL http: //dl.acm.org/citation.cfm?id=3041838.3041955. 12 Appendix A: Derivation of formula 4 Let us define r0 = 0, and for t > 0 rt = αut + (1 − α)rt−1 with ut a unit vector uniformly drawn in IRd . We have by recurrence for t > 0 rt = α t X (1 − α)(t−l) ul l=1 Thus   t X X (1 − α)2t−l−k < ul , uk > krt k2 = α2  (1 − α)2(t−l) kul k2 + l=1 (8) l6=k We are dealing with unit vectors which are uniformly drawn. Thus with δ denoting the Kronecker delta ∀ l > 0 kul k2 = 1 ∀ l, k > 0 E(< ul , uk >) = δlk Taking the expectation in 8 we have t X E(krt k ) = α (1 − α)2(t−l) 2 2 (9) l=1 that is, 1 − (1 − α)2t 1 − (1 − α)2  α = 1 − (1 − α)2t 2−α E(krt k2 ) = α2 The derivation of formula 5 is similar. 13 (10) (11) Appendix B: Safe Parameter-wise Agnostic LEarning Rate Adaptation Algorithm 2 gives the detailed implementation of the parameter-wise version of both AL E RA (white lines) and SAL E RA (plus greyed lines), as briefly described in√ Section 2.1. In line 17, denotes the 0 0 coordinate-wise multiplication, and µ = µ/d, σ(d) = σ(d)/ d. Algorithm 2: SPAL E RA: Parameter-wise AL E RA and Page-Hickley change detection 1 2 3 4 Input: Model with parameter θ in Rd and loss function L Parameters : Memory rate α, factor C //algorithm parameters Initial learning rate η0 , mini-batch ratio ρ // run parameters Initialize : t = 0; p ← 0; ∀ i ∈ [|1; d|] ηi ← 1; init(θ) // initialization ¯ L, Lmin , `, `, ← 0; ∆ ← L(θ, first mini-batch)/10 // initialize Page-Hinkley while stopping criterion not met do M B ← new mini-batch ; t ← t + 1 // perform forward pass ` = ρL(θ, MB) + (1 − ρ)` ¯ `¯ ← (` + t`)/(t + 1) // empirical mean of batch losses 5 ¯ L ← L + (` − `) 6 Lmin ← min(Lmin , L) 7 if L − Lmin > ∆ then 8 θ ← θ(b) ; η ← η/2 9 ¯ ` ← 0; t ← 0 L, Lmin , `, 10 11 12 13 14 15 16 17 18 19 // cumulated deviations from mean // lower bound of deviations // Page-Hinkley triggered: backtrack // and re-initialize Page-Hinkley else θ(b) ← θ // save for possible backtracks g ← ∇θ L(θ, MB) // compute gradient with backward pass p ← αg/kgk + (1 − α)p // exponential moving average of normalized gradients for i=1,d do  ηi ← η0 ηi exp C(p2i − µ0 )/σ(d)0 // parameter-wise agnostic learning rate update end θ ←θ−η g // standard parameter update end end 14 Appendix C. Analysis of the dividing factor in 1D We use here the context and notations of Section 2.2, and make it even simpler by assuming one dimension (the gradient direction does not change), and minimizing the 1D parabola F (θ) = 12 aθ2 . It is straightforward to show that, independently of the current solution θt , the optimal value for the learning rate η is η ∗ = 1/a, and that the value above which the loss will deteriorate is η − = 2η ∗ . Let us assume that the current learning rate is ηt > η − , and that the recovery phase of SAL E RA will be used to prevent further catastrophic event, with a dividing factor ζ > 1, and let us show that ζ = 2 is the best trade-off between bringing η back into ]0, η − ] and then reaching the optimal value η ∗ , as discussed in Section 2.2. After the PH test has been triggered, a first phase brings ηt below η − by successive divisions by ζ. The number of such divisions is S = logζ ηη−t + 1 = log( ηη−t )/ log(ζ). − The second phase uses the standard AL E RA procedure to reach η ∗ from this value ηt+1 ∈] ηζ , η − ]. In the 1D context, let us assume a simplified procedure, that updates η by multiplying it by some 1 − ε if η > η ∗ and by 1 + ε if ηt < η ∗ , for some small ε. Let us consider two cases, depending on whether ζ is smaller or greater than 2. We can compute the expectation of the number of iteration of SAL E RA that are needed to reach η ∗ from ηt+1 . − If ζ ≤ 2, ηζ ≥ η ∗ , hence the further standard update phase decreases η by multiplying it by 1 − ε until becoming less than (and very close to) η ∗ . The length of this update phase increases with ηt+1 , thus by construction it is minimal for ζ = 2. In the meanwhile, the length of the division phase decreases as ζ increases; thus the optimal value for ζ ∈]1, 2] is ζ = 2. If ζ ≥ 2, then ηηt+1 ∈] ζ1 , 1[. Let us consider the two intervals ] ζ1 , 12 [ and ] 12 , 1[, and U and T the − respective expectations of the number of AL E RA iterations to reach η ∗ . The expectation of the total number of iteration is the sum of U and T, weighted by the probability of arriving in the respective ζ−2 ζ intervals, i.e., the lengths of these intervals. These weights are hence 12 ζ−1 for U and 12 ζ−1 for T. The expected value for T is independent of ζ. For u ∈] 12 , 1[, and only counting the number of log(2u) multiplications needed to get close to 12 , the number of iterations is − log(1−ε) ≡ log(2u) . Integrating ε 1 over ] − 2 , 1[ gives Z 1 1 1 1 1 T = log(2u) = [t log(t) − t + t log(2)]11 = (log(2) − ) 2 ε 12 ε ε 2 Similarly, the expected value for U can be computed over the interval ζ1 , 21 [ using the same approach. Only counting again the number of multiplications needed to get close to 12 , it comes U= 1 ε 1 2 Z − log(2u) = 1 ζ 1 1 1 [−t log(t) + t − t log(2)] 21 = ζ ε ε  1 log(ζ) 1 − log(2) − − 2 ζ ζ  Let us summarize now the different computational costs involved after a catastrophe has been detected and before the η ∗ grail is reached. The cost of the dividing iterations only involves a forward pass on the current minibatch. Let us denote this cost by cF . On the other hand, the standard AL E RA iterations have a larger cost, involving a forward pass plus a backward pass and the weights update. Let us denote this cost by cB . We are looking for the value of ζ that will minimize the total cost of reaching η ∗ after a catastrophic event has been detected, i.e., that minimizes 1ζ −2 1 ζ cF S + cB ( U+ T) 2ζ −1 2ζ −1 or, equivalently, that minimizes   C 1 ζ − 2 1 log(ζ) 1 − log(2) 1 ζ 1 J(ζ) = + − − + (log(2) − ) (12) log(ζ) 2 ζ − 1 2 ζ ζ 2ζ −1 2 15 Average cost of SALeRA C=0.1 C=0.01 C=0.001 J 0.5 0.4 0.3 3 5 7 9 Zeta Figure 3: Cost function J (Equation 12) for different values of constant C. The plots for smaller values of C are indistinguishable from that of C = 0.001. with C= cF ηt ε log( − ) cB η It is easy to empirically check (Figure 3) that J(ζ) has its global minimum between 3 and 5, that depends on the value of the constant C, assumed small here (C ∈]0, 0.1]). Then J increases to some asymptotic value. However, the value ζ = 2 was initially chosen for historical reasons, by reference to the famed doubling trick frequently used in different areas of Machine Learning. In the light of these results in the simple 1D case, further work will investigate slightly larger values. 16
9cs.NE
Discrete Mathematics and Theoretical Computer Science DMTCS vol. 19:1, 2017, #16 arXiv:1601.06456v5 [math.CO] 1 Jun 2017 On universal partial words Herman Z. Q. Chen1 Sergey Kitaev2 Torsten Mütze3 Brian Y. Sun4∗ 1 2 3 4 School of Science, Tianjin Chengjian University, P.R. China Department of Computer and Information Sciences, University of Strathclyde, Glasgow, UK Institut für Mathematik, TU Berlin, Germany College of Mathematics and System Science, Xinjiang University, Urumqi, Xinjiang 830046, P.R. China received 10th Nov. 2016, revised 8th May 2017, accepted 16th May 2017. A universal word for a finite alphabet A and some integer n ≥ 1 is a word over A such that every word in An appears exactly once as a subword (cyclically or linearly). It is well-known and easy to prove that universal words exist for any A and n. In this work we initiate the systematic study of universal partial words. These are words that in addition to the letters from A may contain an arbitrary number of occurrences of a special ‘joker’ symbol ✸ ∈ / A, which can be substituted by any symbol from A. For example, u = 0✸011100 is a linear partial word for the binary alphabet A = {0, 1} and for n = 3 (e.g., the first three letters of u yield the subwords 000 and 010). We present results on the existence and non-existence of linear and cyclic universal partial words in different situations (depending on the number of ✸s and their positions), including various explicit constructions. We also provide numerous examples of universal partial words that we found with the help of a computer. Keywords: universal word, partial word, De Bruijn graph, Eulerian cycle, Hamiltonian cycle 1 Introduction De Bruijn sequences are a centuries-old and well-studied topic in combinatorics, and over the years they found widespread use in real-world applications, e.g., in the areas of molecular biology [CPT11], computer security [Ral82], computer vision [PSCF05], robotics [Sch01] and psychology experiments [SBSH97]. More recently, they have also been studied in a more general context by constructing universal cycles for other fundamental combinatorial structures such as permutations or subsets of a fixed ground set (see e.g. [Hur90, CDG92, HRW12, SW14]). In the context of words over a finite alphabet A, we say that a word u is universal for An if u contains every word of length n ≥ 1 over A exactly once as a subword. We distinguish cyclic universal words and linear universal words. In the cyclic setting, we view u as a cyclic word and consider all subwords of length n cyclically across the boundaries of u. In the linear setting, on the other hand, we view u as a linear word and only consider subwords that start and end within the index range of letters of u. From ∗ The last author was supported by the Scientific Research Program of the Higher Education Institution of Xinjiang Uygur Autonomous Region (No. XJEDU2016S032) and the Natural Science Foundation of Xinjiang University. ISSN 1365–8050 c 2017 by the author(s) Distributed under a Creative Commons Attribution 4.0 International License 2 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun this definition it follows that the length of a cyclic or linear universal word must be |A|n or |A|n + n − 1, respectively. For example, for the binary alphabet A = {0, 1} and for n = 3, u = 0001011100 is a linear universal word for A3 . Observe that a cyclic universal word for An can be easily transformed into a linear universal word for An , so existence results in the cyclic setting imply existence results for the linear setting. Note also that reversing a universal word, or permuting the letters of the alphabet yields a universal word again. The following classical result is the starting point for our work (see [dB46, Yoe62, Lem71]). Theorem 1 For any finite alphabet A and any n ≥ 1, there exists a cyclic universal word for An . The standard proof of Theorem 1 is really beautiful and concise, using the De Bruijn graph, its line graph and Eulerian cycles (see [CDG92] and Section 2 below). 1.1 Universal partial words In this paper we consider the universality of partial words, which are words that in addition to letters from A may contain any number of occurrences of an additional special symbol ✸ ∈ / A. The idea is that every occurrence of ✸ can be substituted by any symbol from A, so we can think of ✸ as a ‘joker’ or ‘wildcard’ symbol. Formally, we define A✸ := A ∪ {✸} and we say that a word v = v1 v2 · · · vn ∈ An appears as a factor in a word u = u1 u2 · · · um ∈ Am ✸ if there is an integer i such that ui+j = ✸ or ui+j = vj for all j = 1, 2, . . . , n. In the cyclic setting we consider the indices of u in this definition modulo m. For example, in the linear setting and for the ternary alphabet A = {0, 1, 2}, the word v = 021 occurs twice as a factor in u = 120✸120021 because of the subwords 0✸1 and 021 of u, whereas v does not appear as a factor in u′ = 12✸11✸. Partial words were introduced in [BB99], and they too have real-world applications (see [BS08] and references therein). In combinatorics, partial words appear in the context of primitive words [BS05], of (un)avoidability of sets of partial words [BSBK+ 09, BBSGR10], and also in the study of the number of squares [HHK08] and overlap-freeness [HHKS09] in (infinite) partial words. The concept of partial words has been extended to pattern-avoiding permutations in [CJJK11]. The notion of universality given above extends straightforwardly to partial words, and we refer to a universal partial word as an upword for short. Again we distinguish cyclic upwords and linear upwords. The simplest example for a linear upword for An is ✸n := ✸✸ · · · ✸, the word consisting of n many ✸s, which we call trivial. Let us consider a few more interesting examples of linear upwords over the binary alphabet A = {0, 1}. We have that ✸✸0111 is a linear upword for A3 , whereas ✸✸01110 is not a linear upword for A3 , because replacing the first two letters ✸✸ by 11 yields the same factor 110 as the last three letters. Similarly, 0✸1 is not a linear upword for A2 because the word 10 ∈ A2 does not appear as a factor (and the word 01 ∈ A2 appears twice as a factor). 1.2 Our results In this work we initiate the systematic study of universal partial words. It turns out that these words are rather shy animals, unlike their ordinary counterparts (universal words without ‘joker’ symbols). That is, in stark contrast to Theorem 1, there are no general existence results on upwords, but also many non-existence results. The borderline between these two cases seems rather complicated, which makes the subject even more interesting (this is true also for non-binary alphabets, as the constructions of the follow-up paper [GGH+ 16] indicate). In addition to the size of the alphabet A and the length n of the factors, we also consider the number of ✸s and their positions in an upword as problem parameters. 3 On universal partial words n 1 2 3 4 5 k 1 1 2 1 2 3 4 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ✸ ✸011 (Thm. 9, Thm. 17) — (Thm. 6) ✸00111010 (Thm. 9) 0✸011100 (Thm. 10) — (Thm. 6) — (Thm. 7) ✸00011110100101100 (Thm. 9) 0✸010011011110000 (Thm. 10) 01✸0111100001010 (Thm. 10) — (Thm. 6) — (Thm. 7) 01100✸011110100 — (Thm. 7) 0011110✸0010110 ✸0000111110111001100010110101001000 (Thm. 9) 0✸01011000001101001110111110010001 (Thm. 10) 01✸011000001000111001010111110100 (Thm. 10) 011✸0111110000010100100011010110 (Thm. 10) — (Thm. 6) 00101✸0010011101111100000110101 010011✸010000010101101111100011 0100110✸01000001110010111110110 01110010✸0111110110100110000010 010011011✸010001111100000101011 0101000001✸01011111001110110001 01010000011✸0101101111100010011 001001101011✸001010000011111011 0011101111100✸00110100010101100 01010000010011✸0101101111100011 001000001101011✸001010011111011 Tab. 1: Examples of linear upwords for An , A = {0, 1}, with a single ✸ at position k from the beginning or end for n = 1, 2, 3, 4, 5 and all possible values of k (upwords where the ✸ is closer to the end of the word than to the beginning can be obtained by reversal). A dash indicates that no such upword exists. We first focus on linear upwords. For linear upwords containing a single ✸, we have the following results: For non-binary alphabets A (i.e., |A| ≥ 3) and n ≥ 2, there is no linear upword for An with a single ✸ at all (Theorem 5 below). For the binary alphabet A = {0, 1}, the situation is more interesting (see Table 1): Denoting by k the position of the ✸, we have that for n ≥ 2, there is no linear upword for An with k = n (Theorem 6), and there are no linear upwords in the following three cases: n = 3 and k = 4, and n = 4 and k ∈ {5, 7} (Theorem 7). We conjecture that these are the only non-existence cases 4 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun n 2 3 4 5 ✸✸ (Cor. 12) ✸✸0111 (Cor. 12, Thm. 17) ✸001011✸ ✸00011✸1001011 (Thm. 13) ✸0001011✸10011 001✸110✸001 ✸0100✸101011000001110111110010 ✸0000111✸100010010101100110111 (Thm. 13) ✸00001001✸10001101011111011001 ✸0000100111✸100011001010110111 ✸00001010111✸10001101100100111 0✸0011✸0100010101101111100000 0✸010110✸00011101111100100110 0✸0101110✸0001101100100111110 0✸010111110✸00011011001001110 0✸0101101110✸0001100100111110 00✸0011✸00101011011111010000 01✸01100101110✸0100000111110 01✸0110010111110✸01000001110 01✸0100000101011000111110✸110 001✸0101✸001110111110000010 011✸011010010✸0111110000010 011✸0110101001000✸011111000 011✸0111110001101010000010✸10 011✸011010000011111000100101✸1 01001✸1110✸010000011011001 Tab. 2: Examples of linear upwords for An , A = {0, 1}, with two ✸s for n = 2, 3, 4, 5. for a binary alphabet (Conjecture 8). To support this conjecture, we performed a computer-assisted search and indeed found linear upwords for all values of 2 ≤ n ≤ 13 and all possible values of k other than the ones excluded by the beforementioned results. Some of these examples are listed in Table 1, and the remaining ones are available on the third author’s website [www]. We also prove the special cases k = 1 and k ∈ {2, 3, . . . , n − 1} of our conjecture (Theorems 9 and 10, respectively). For linear upwords containing two ✸s we have the following results: First of all, Table 2 shows examples of linear upwords with two ✸s for the binary alphabet A = {0, 1} for n = 2, 3, 4, 5. We establish a sufficient condition for non-existence of binary linear upwords with two ✸s (Theorem 11), which in particular shows that a (1 − o(1))-fraction of all ways of placing two ✸s among the N = Θ(2n ) positions does not yield a valid upword. Moreover, we conclude that there are only two binary linear upwords where the two ✸s are adjacent (Corollary 12), namely ✸✸ for n = 2 and ✸✸0111 for n = 3 (see Table 2). We also construct an infinite family of binary linear upwords with two ✸s (Theorem 13). Let us now discuss cyclic upwords. Note that the trivial solution ✸n is a cyclic upword only for n = 1. On universal partial words 5 For the cyclic setting we have the following rather general non-existence result: If gcd(|A|, n) = 1, then there is no cyclic upword for An (Corollary 16). In particular, for a binary alphabet |A| = 2 and odd n, there is no cyclic upword for An . In fact, we know only of a single cyclic upword for the binary alphabet A = {0, 1} and any n ≥ 2, namely ✸001✸110 for n = 4 (up to cyclic shifts, reversal and letter permutations). 1.3 Outline of this paper This paper is organized as follows. In Section 2 we introduce some notation and collect basic observations that are used throughout the rest of the paper. In Sections 3 and 4 we prove our results on linear upwords containing a single or two ✸s, respectively. Section 5 contains the proofs on cyclic upwords. Finally, Section 6 discusses possible directions for further research, including some extensions of our results to non-binary alphabets. 2 Preliminaries For the rest of this paper, we assume w.l.o.g. that the alphabet is A = {0, 1, . . . , α − 1}, so α ≥ 2 denotes the size of the alphabet. We often consider the special case α = 2 of the binary alphabet, and then for x ∈ {0, 1} we write x for the complement of x. Moreover, for any word u, we let |u| denote its length. As we mentioned before, reversing a universal word and/or permuting the letters of the alphabet again yields a universal word. We can thus assume w.l.o.g. that in an upword u the letters of A appear in increasing order from left to right, i.e., the first occurence of symbol i is before the first occurence of symbol j whenever i < j. Moreover, if u can be factored as u = xyz, where x and z do not contain any ✸s, then we can assume that |x| ≤ |z|. One standard approach to prove the existence of universal words is to define a suitable graph and to search for a Hamiltonian path/cycle in this graph (another more algebraic approach uses irreducible polynomials). Specifically, the De Bruijn graph GnA has as vertices all elements from An (all words of length n over A), and a directed edge from a vertex u to a vertex v whenever the last n − 1 letters of u are the same as the first n − 1 letters of v. We call such an edge (u, v) an x-edge, if the last letter of v equals x. Figure 1 (a) and (b) shows the graph GnA , A = {0, 1}, for n = 2 and n = 3, respectively. Clearly, a linear universal word for An corresponds to a Hamiltonian path in GnA , and a cyclic universal word to n−1 a Hamiltonian cycle in this graph. Observe furthermore that GnA is the line graph of GA . Recall that the line graph L(G) of a directed graph G is the directed graph that has a vertex for every edge of G, and a directed edge from e to e′ if in G the end vertex of e equals the starting vertex of e′ . Therefore, the problem of finding a Hamiltonian path/cycle in GnA is equivalent to finding an Eulerian path/cycle in n−1 GA . The existence of an Eulerian path/cycle follows from the fact that the De Bruijn graph is connected and that each vertex has in- and out-degree α (this is one of Euler’s famous theorems [Eul36], see also [BJG08, Theorem 1.6.3]). This proves Theorem 1. In fact, this existence proof can be easily turned into an algorithm to actually find (many) universal words (using Hierholzer’s algorithm [HW73] or Fleury’s algorithm [Fle83]). We now discuss how this standard approach of proving the existence of universal words can be extended to universal partial words. Specifically, we collect a few simple but powerful observations that will be used in our proofs later on. For any vertex v of GnA , we let Γ+ (v) and Γ− (v) denote the sets of out-neighbours and in-neighbours 6 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun G3A = L(G2A ) G2A 000 00 S(u, 1, n) S(u, 2, n) 01 100 10 001 010 S(u, 3, n) S(u, 5, n) 11 S(u, 4, n) 101 110 011 111 (a) (b) S(u, 6, n) H(u, n), u = 0✸011100 (c) Fig. 1: The De Bruijn graphs G2A (a) and G3A = L(G2A ) (b) for A = {0, 1} with a spanning subgraph H(u, n) of G3A for the linear upword u = 0✸011100 for A3 (H(u, n) is shown by solid edges). Part (c) if the figure shows a schematic drawing of the graph H(u, n). H(u, n) is the line graph of the highlighted sequences of edges in G2A . of v, respectively (both are sets of vertices of GnA ). As we mentioned before, we clearly have |Γ+ (v)| = |Γ− (v)| = α. Observation 2 For any vertex v = v1 v2 · · · vn of GnA and its set of out-neighbours Γ+ (v), there are α − 1 vertices different from v with the same set of out-neighbours Γ+ (v), given by xv2 v3 · · · vn , where x ∈ A \ {v1 }. For any vertex v = v1 v2 · · · vn of GnA and its set of in-neighbours Γ− (v), there are α − 1 vertices different from v with the same set of in-neighbours Γ− (v), given by v1 v2 · · · vn−1 x, where x ∈ A \ {vn }. For any linear upword u for An , we define a spanning subgraph H(u, n) of the De Bruijn graph GnA as follows, see Figure 1 (c): For any i = 1, 2, . . . , N − n + 1, we let S(u, i, n) denote the set of all words that are obtained from the subword of u of length n starting at position i by replacing any occurences of ✸ by a letter from the alphabet A. Clearly, if there are d many ✸s in this subword, then there are αd different possibilities for substitution, so we have |S(u, i, n)| = αd . Note that the sets S(u, i, n) form a partition of the vertex set of GnA (and H(u, n)). The directed edges of H(u, n) are given by all the edges of GnA induced between every pair of consecutive sets S(u, i, n) and S(u, i + 1, n) for i = 1, 2, . . . , N − n. For example, for the linear upword u = 0✸011100 over the binary alphabet A = {0, 1} for n = 3 we have S(u, 1, n) = {000, 010}, S(u, 2, n) = {001, 101}, S(u, 3, n) = {011}, S(u, 4, n) = {111}, S(u, 5, n) = {110} and S(u, 6, n) = {100}, and the spanning subgraph H(u, n) of G3A is shown in Figure 1 (c). To give another example with the same A and n, for the linear upword u = ✸✸0111 we have S(u, 1, n) = {000, 010, 100, 110}, S(u, 2, n) = {001, 101}, S(u, 3, n) = {011}, S(u, 4, n) = {111}, and then H(u, n) is a binary tree of depth 2 with an additional edge emanating from the root. 7 On universal partial words H(u, n) (solid edges) vx vx = v1 · · · vn−1 x, x ∈ A \ {vn } v v = v1 v2 · · · vn ... S(u, k + 1, n) S(u, 1, n) S(u, k, n) Fig. 2: Illustration of the proof of Lemma 4. The following observation follows straightforwardly from these definitions. Observation 3 Let u = u1 u2 · · · uN be a linear upword for An . A vertex in S(u, i, n), i = 1, 2, . . . , N − n, has out-degree 1 in H(u, n) if ui+n ∈ A, and out-degree α if ui+n = ✸. A vertex in S(u, i, n), i = 2, 3, . . . , N − n + 1, has in-degree 1 in H(u, n) if ui−1 ∈ A, and in-degree α if ui−1 = ✸. The vertices in S(u, 1, n) have in-degree 0, and the vertices in S(u, N − n + 1, n) have out-degree 0. By this last observation, the graph H(u, n) is determined only by the positions of the ✸s in u. Intuitively, the ✸s lead to branching in the graph H(u, n) due to the different possibilities of substituting symbols from A. In particular, if u has no ✸s, then H(u, n) is just a spanning path of GnA (i.e., a Hamiltonian path, so we are back in the setting of Theorem 1). So when searching for a linear universal partial word u with a particular number of ✸s at certain positions, we essentially search for a copy of the spanning subgraph H(u, n) in GnA . We will exploit this idea both in our existence and non-existence proofs. For the constructions it is particularly useful (and for our computer-searches it is computationally much more efficient) to not search for a copy of H(u, n) in GnA directly, but to rather search for the correspondn−1 ing sequences of edges in GA , which can be seen as generalizations of Eulerian paths that were used before in the proof of Theorem 1 (see Figure 1 (a)). For example, to search for a linear upword u with a single ✸ at position k ∈ {1, 2, . . . , n − 1}, we can prescribe the first k − 1 letters and the n letters after the ✸ (with a particular choice of symbols from A, or by iterating over all possible choices), and search n−1 that remains when deleting from it all edges that correspond for an Eulerian path in the subgraph of GA to the prescribed prefix of u (see the proofs of Theorems 9 and 10 below). This idea can be generalized straightforwardly to search for upwords with other ✸ patterns (see for example the proof of Theorem 13 below). The next lemma will be used repeatedly in our proofs (both for existence and non-existence of upwords). The proof uses the previous two graph-theoretical observations to derive dependencies between letters of an upword. Lemma 4 Let u = u1 u2 · · · uN be a linear upword for An , A = {0, 1, . . . , α − 1}, n ≥ 2, such that uk = ✸ and uk+n 6= ✸ (we require k + n ≤ N ). Then for all i = 1, 2, . . . , n − 1 we have that if ui 6= ✸, then uk+i = ui . Moreover, we have that if un 6= ✸, then α = 2 and uk+n = un . Proof: By Observation 3, each vertex in the set S(u, k + 1, n) has in-degree α in H(u, n), and each vertex in S(u, k, n) has out-degree 1. By Observation 2, for each v = v1 v2 · · · vn ∈ S(u, k + 1, n) there are α − 1 other vertices (different from the ones in S(u, k + 1, n)) in GnA with the same set Γ− (v) of α 8 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun many in-neighbors, namely vx := v1 · · · vn−1 x, where x ∈ A \ {vn } (see Figure 2). As the in-degree of every vertex of GnA is exactly α, and in H(u, n) all vertices except the ones in S(u, 1, n) already have in-degree at least 1, it follows that each of the vertices vx must be equal to one of the vertices in S(u, 1, n). It follows that if ui 6= ✸ then uk+i 6= ✸ and ui = vi = uk+i for all i = 1, 2, . . . , n − 1. Moreover, if un 6= ✸ and α ≥ 3, then there are at least two vertices vx , x ∈ A \ {vn }, ending with different symbols x, each of which must be equal to one of the vertices in S(u, 1, n), which is impossible because all words in this set end with the same symbol un . It follows that if un 6= ✸ then we must have α = 2 ✷ and un = x 6= vn = uk+n , so uk+n = un . 3 Linear upwords with a single ✸ 3.1 Non-existence results Our first result completely excludes the existence of linear upwords with a single ✸ for non-binary alphabets. Theorem 5 For A = {0, 1, . . . , α − 1}, α ≥ 3, and any n ≥ 2, there is no linear upword for An with a single ✸. Proof: Suppose that such an upword u = u1 u2 · · · uk−1 ✸uk+1 · · · uN exists. We claim that the ✸ in u is preceded or followed by at least n symbols from A. If not, then u would have at most αn different factors, which is strictly less than αn for α ≥ 3 and n ≥ 2. So we assume w.l.o.g. that the ✸ in u is followed by at least n symbols from A, i.e., k + n ≤ N . By Lemma 4 we have ui = ✸ or uk+i = ui for all i = 1, 2, . . . , n − 1 and un = ✸, which implies k = n and therefore un+i = ui for all i = 1, . . . , n − 1. But this means that the word v := un+1 · · · u2n ∈ An appears twice as a factor in u starting at positions 1 and n + 1 (in other words, the vertex v ∈ S(u, n + 1, n) is identical to a vertex from S(u, 1, n) in H(u, n)), a contradiction. ✷ Our next result excludes several cases with a single ✸ for a binary alphabet. Theorem 6 For A = {0, 1} and any n ≥ 2, there is no linear upword for An with a single ✸ at position n from the beginning or end. Proof: We first consider the case n = 2. Suppose that there is an upword u = u1 ✸u3 for An . Assuming w.l.o.g. that u1 = 0, we must have u3 = 1, otherwise the word 00 would appear twice as a factor. But then the word 10 does not appear as a factor in u = 0✸1, while 01 appears twice, a contradiction. For the rest of the proof we assume that n ≥ 3. Suppose there was an upword u = u1 u2 · · · un−1 ✸un+1 · · · uN with N = 2n −1. Note that N −n ≥ n, or equivalently 2n ≥ 2n+1, holds by our assumption n ≥ 3, so the ✸ in u is followed by at least n more symbols from A. Applying Lemma 4 yields that un+i = ui for all i = 1, . . . , n − 1, which means that the word v := un+1 · · · u2n ∈ An appears twice as a factor in u starting at positions 1 and n + 1, a contradiction. ✷ In contrast to Theorem 5, for a binary alphabet we can only exclude the following three more (small) cases in addition to the cases excluded by Theorem 6 (all the exceptions are marked in Table 1). Theorem 7 For A = {0, 1}, there is no linear upword for An with a single ✸ at position k from the beginning or end in the following three cases: n = 3 and k = 4, and n = 4 and k ∈ {5, 7}. On universal partial words 9 Proof: Suppose that there is an upword u = u1 u2 u3 ✸u5 u6 u7 for the case n = 3. Applying Lemma 4 twice to u and its reverse we obtain that u5 u6 u7 = u1 u2 u3 and u1 u2 u3 = u5 u6 u7 , a contradiction. To prove the second case suppose that there is an upword of the form u = u1 u2 u3 u4 ✸u6 · · · u15 for n = 4. Applying Lemma 4 twice to u and its reverse we obtain that u has the form u = u1 u2 u3 u4 ✸u1 u2 u3 u4 u10 u11 u1 u2 u3 u4 . We assume w.l.o.g. that u1 = 0. The word z := 0000 must appear somewhere as a factor in u, and since u12 = u1 = 1, the only possible starting positions for z in u are 1, 2, . . . , 8. However, the starting positions 1, 2, 5, 6, 7 can be excluded immediately, as they would cause z to appear twice as a factor in u. On the other hand, if z starts at positions 3, 4 or 8, then the neighboring letters must both be 1, causing 0101, 1010 or 1101, respectively, to appear twice as a factor in u, a contradiction. The proof of the third case proceeds very similarly to the second case, and allows us to conclude that such an upword u must have the form u = u1 u2 u3 u4 u5 u6 ✸u1 u2 u3 u4 u3 u4 u5 u6 . We assume w.l.o.g. that u3 = 0. The word z := 0000 must appear somewhere as a factor in u, and since u12 = u3 = 1 the only possible starting positions for z in u are 1, 2, . . . , 8. The starting positions 1, 3, 4, 6, 8 can be excluded immediately, as they would cause z to appear twice as a factor in u. On the other hand, if z starts at positions 2, 5 or 7, then the neighboring letters must both be 1, causing 0011, 0101 or 0000, respectively, to appear twice as a factor in u, a contradiction. ✷ 3.2 Existence results We conjecture that for a binary alphabet and a single ✸, the non-existence cases discussed in the previous section are the only ones. Conjecture 8 For A = {0, 1} and any n ≥ 1, there is a linear upword for An containing a single ✸ at position k in every case not covered by Theorem 6 or Theorem 7. Recall the numerical evidence for the conjecture discussed in the introduction. In the remainder of this section we prove some cases of this general conjecture. Theorem 9 For A = {0, 1} and any n ≥ 2, there is a linear upword for An with a single ✸ at the first position that begins with ✸0n−1 1. Note that by Lemma 4, every linear upword for An with a single ✸ of the form u = ✸u2 u3 · · · uN satisfies the conditions u2 = u3 = · · · = un = un+1 , i.e., w.l.o.g. it begins with ✸0n−1 1 (up to letter permutations). Proof: Consider the word v = v1 v2 · · · vn+1 := ✸0n−1 1 and the corresponding three edges n−1 (0n−1 , 0n−1 ), (10n−2 , 0n−1 ) and (0n−1 , 0n−2 1) in the De Bruijn graph GA . Denote the graph obn−1 tained from GA by removing these three edges and the isolated vertex 0n−1 by G′ . Clearly, the edges of G′ form a connected graph, and every vertex in G′ has in- and out-degree exactly two, except the vertex y := 0n−2 1 which has one more out-edge than in-edges and the vertex z := 10n−2 which has one more in-edge than out-edges. Therefore, G′ has an Eulerian path starting at y and ending at z, and this Eulerian path yields the desired upword that begins with v. ✷ For any binary word w ∈ Ak , A = {0, 1}, and any n ≥ 1, we write c(w, n) = c1 c2 · · · cn for the word given by ci = wi for i = 1, 2, . . . , k, ci = ci−k for all i = k + 1, k + 2, . . . , n − 1 and 10 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun V1 ... V0 1 vk−1 v31 vk1 v21 ... v10 v20 v30 0 vk−1 vk0 v11 = vk+1 V2 vk+2 Fig. 3: Subgraph of Gn−1 constructed in the proof of Theorem 10. A cn = cn−k . Informally speaking, c(w, n) is obtained by concatenating infinitely many copies of w, truncating the resulting word at length n and complementing the last symbol. For example, we have c(011, 7) = 0110111 and c(011, 8) = 01101100. Using this terminology, the starting segment of the linear upword from Theorem 9 can be written as ✸c(0, n). The next result is a considerable extension of the previous theorem. Theorem 10 For A = {0, 1}, any n ≥ 3 and any k ∈ {2, 3, . . . , n − 1}, there is a linear upword for An with a single ✸ at the k-th position that begins with 01k−2 ✸c(01k−1 , n). The idea of the proof of Theorem 10 is a straightforward generalization of the approach we used to n−1 prove Theorem 9 before, and boils down to showing that the De Bruijn graph GA without the edges that are given by the prescribed upword prefix still has an Eulerian path. Proof: The words 0✸c(01, 3)100 = 0✸011100, 0✸c(01, 4)11011110000 = 0✸010011011110000 and 01✸c(011, 4)100001010 = 01✸0111100001010 from Table 1 show that the statement is true for n = 3 and n = 4. For the rest of the proof we assume that n ≥ 5. Consider the word w = w1 w2 · · · wk+n := 01k−2 ✸c(01k−1 , n). For i = 1, 2, . . . , k we let vi0 and vi1 denote the two words from S(w, i, n − 1) obtained by substituting ✸ in w by 0 or 1, respectively. Moreover, let vk+1 = wk+1 · · · wk+n−1 be the unique word from S(w, k +1, n−1) and vk+2 = wk+2 · · · wk+n the unique word from S(w, k +2, n−1), and define V 0 := {vi0 | i = 1, 2, . . . , k}, V 1 := {vi1 | i = 1, 2, . . . , k}, V 2 := {vk+1 , vk+2 } and V ′ := V 0 ∪ V 1 ∪ V 2 . We proceed to show that |V ′ | = 2k + 1, i.e., only two of the words just defined coincide, namely v11 = vk+1 (v11 is given by the first n − 1 letters of w = 01k−1 c(01k−1 , n), and vk+1 is given by the first n − 1 letters of c(01k−1 , n), which are equal). In other words, the corresponding n−1 set of vertices in GA has size 2k + 1 (see Figure 3). If k = 2, then this can be verified directly by considering the number of leading and trailing 0s and 1s of the vertices in V 0 , V 1 and V 2 . We now assume that k ≥ 3. Every word from V 0 , except possibly v10 , contains the factor 00 exactly once and is uniquely identified by the position of this factor, proving that |V 0 | = k. The words in V 1 are all uniquely identified by the number of leading 1s, which equals 0 for v11 and k − i + 1 for i = 2, 3, . . . , k, implying that |V 1 | = k. We now show that V 0 and V 1 are disjoint. To prove this we use again that all the words in V 0 , except possibly v10 , contain the factor 00, and that moreover no word from V 1 contains this factor. However v10 does not contain the factor 00 only in the case k = n − 1, and then v10 starts and ends with 0, unlike any of the words from V 1 in this case, proving that V 0 and V 1 are disjoint. It remains to show that vk+2 ∈ / V 0 ∪V 1 . If k = n−1, then vk+2 = 1n−1 and all other words from V 0 and V 1 contain at least one On universal partial words 11 0, so vk+2 ∈ / V 0 ∪ V 1 . If k ≤ n − 2, then the word vk+2 = wk+2 · · · wk+n satisfies wk+n = wn , i.e., its last letter and the one k positions to the left of it are complementary (recall the definition of c(01k−1 , n)), a property that does not hold for any of the words in V 1 , implying that vk+2 ∈ / V 1 . Moreover, in this case 0 all words from V contain the factor 00 exactly once and are uniquely identified by the position of this factor, and vk+2 might contain the factor 00 only at the last two positions, so the only potential conflict could arise in the case k = n−2 when v10 = 01n−4 00 ends with 00. However, in this case vk+2 = 1n−3 00 is still different from v10 . We conclude that vk+2 ∈ / V 0 ∪ V 1 in all cases. Combining these observations ′ 0 1 2 shows that |V | = |V | + |V | + |V | − 1 = 2k + 1, as claimed. 0 1 Consider the set of 2k + 1 edges E ′ := {(vi0 , vi+1 ) | i = 1, 2, . . . , k − 1} ∪ {(vi1 , vi+1 ) | i = n−1 0 1 1, 2, . . . , k − 1} ∪ {(vk , vk+1 ), (vk , vk+1 ), (vk+1 , vk+2 )} in the De Bruijn graph GA (see Figure 3). They span a subgraph on V ′ that has the following pairs of out-degrees and in-degrees: (1, 0) for the vertex v10 , (0, 1) for the vertex vk+2 , (1, 1) for the vertices vi0 and vi1 , i = 2, 3, . . . , k, (2, 2) for the vertex v11 = vk+1 . n−1 We denote the graph obtained from GA by removing the edges in E ′ and the isolated vertex v11 = ′ ′ vk+1 by G . Clearly, every vertex in G has the same in- and out-degree (1 or 2), except the vertex vk+2 which has one more out-edge than in-edges, and the vertex v10 which has one more in-edge than out-edges. To complete the proof of the theorem we show that G′ contains an Eulerian path (which must start at vk+2 and end at v10 ), and to do this, it suffices (by the before-mentioned degree conditions) to show that G′ is connected. We first consider the case k ≤ n − 2: From any vertex v ∈ G′ , we follow 0-edges until we either reach the vertex 0n−1 or a vertex from V ′ for which the next 0-edge is from E ′ (this could happen right at the beginning if v ∈ V ′ ). In this case we follow 1-edges until we reach the vertex 1n−1 , and from there we follow 0-edges until we reach 0n−1 . (We only ever follow edges in forward direction.) We claim that in this process we never use an edge from E ′ , which shows that G′ is connected. To see this suppose we encounter a vertex v ′ from V ′ for which the next 0-edge is from E ′ . This means that v ′ has k − 1 trailing 1s (here we use that k ≤ n − 2), so following a 1-edge leads to a vertex that has k trailing 1s, and in the next step to a vertex that has k + 1 trailing 1s. Note that the vertices in V ′ \ {vk+2 } have at most k − 1 trailing 1s, and vk+2 has at most k trailing 1s, so we avoid any edges from E ′ on our way to 1n−1 . Moreover, on the way from 1n−1 to 0n−1 via 1n−1−i 0i , i = 1, 2, . . . , n − 1, we do not use any edges from E ′ either, because any vertex from V ′ \ {vk+2 } that starts with a 1 has at least two transitions from 1s to 0s, or vice versa, when reading it from left to right (using again k ≤ n − 2), and 0n−1 ∈ / V ′. Now consider the case k = n − 1: From any vertex v ∈ G′ , we follow 0-edges until we either reach the vertex 0n−1 or the only vertex v10 = 01n−3 0 from V ′ \ {vk+1 } for which the next 0-edge is from E ′ . In this case we follow a single 1-edge to 1n−3 01 = v31 , and from there we follow 0-edges until we reach 0n−1 . Similarly to before, we need to argue that we never use an edge from E ′ in this process. On the way from 1n−3 01 = v31 to 0n−1 we never use any edges from E ′ , because any vertices on this path except the first one 1n−3 01 and the last two 10n−2 and 0n−1 contain the factor 010, so all these vertices are different from V ′ (for n ≥ 5 and k = n − 1 no word from V ′ contains 010 as a factor), implying that all edges except possibly the last one are safe. However, since 0n−1 ∈ / V ′ , the last edge is safe, too. These arguments show that G′ is connected, so it has an Eulerian path, and this Eulerian path yields the desired upword that begins with w. This completes the proof. ✷ 12 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun 4 Linear upwords with two ✸s In this section we focus on binary alphabets. Many of the non-existence conditions provided in this section can be generalized straightforwardly to non-binary alphabets, as we briefly discuss in Section 6 below. 4.1 Non-existence results Theorem 11 For A = {0, 1} and any n ≥ 5, there is no linear upword for An with two ✸s of the form u = x✸y✸z if |x|, |y|, |z| ≥ n or |x| = n − 1 or |z| = n − 1 or |y| ≤ n − 2. As Table 2 shows, there are examples of linear upwords with two ✸s whenever the conditions in Theorem 11 are violated. Put differently, for every upword u = x✸y✸z in the table for n ≥ 5 we have that one of the numbers |x|, |y|, |z| is at most n − 1, |x| 6= n − 1, |z| 6= n − 1 and |y| ≥ n − 1. Note that already by the first condition |x|, |y|, |z| ≥ n, a (1 − o(1))-fraction of all choices of placing two ✸s among N = Θ(2n ) positions are excluded as possible candidates for upwords. Proof: We first assume that |x|, |y|, |z| ≥ n, i.e., yn , zn ∈ A. Applying Lemma 4 yields zi = yi = xi ∈ A for i = 1, 2, . . . , n − 1 and zn = yn = xn , so the word y1 y2 · · · yn = z1 z2 · · · zn appears twice as a factor in u, a contradiction. We now assume that |x| = n − 1 (the case |z| = n − 1 follows by symmetry). Note that the number of factors of u is at most 2(|y| + 1) + 4(|z| + 1): This is because every subword ending at the first ✸ or at a letter from y contains at most one ✸, giving rise to two factors, and every subword ending at the second ✸ or at a letter from z contains at most two ✸s, giving rise to four factors. This number is at most 2n + 4n = 6n for |y|, |z| ≤ n − 1, which is strictly less than 2n for n ≥ 5. Therefore, we must have |y| ≥ n or |z| ≥ n in this case. We assume w.l.o.g. that |y| ≥ n, i.e., yn ∈ A. Applying Lemma 4 yields yi = xi ∈ A for i = 1, 2, . . . , n − 1, implying that the word y1 y2 · · · yn appears twice as a factor in u, a contradiction. We now assume that |y| ≤ n−2. In this case we must have |x| ≥ n or |z| ≥ n, because if |x|, |z| ≤ n−1 then the number of factors of u is at most 2(|y| + 1) + 4(|z| + 1) ≤ 2(n − 1) + 4n ≤ 6n, which is strictly less than 2n for n ≥ 5. We assume w.l.o.g. that |z| ≥ n. Let k := |y| + 1 ≤ n − 1 and consider the subword y ′ := y✸z1 z2 · · · zn−k of u, which is well-defined since |z| ≥ n (k is the position of the ✸ in y ′ ). Since k ≤ n − 1 we have yn′ = zn−k ∈ A. Applying Lemma 4 yields that |x| = |y|. ′ Moreover, if k = 1 (|x| = |y| = 0) then the same lemma yields y2′ = y3′ = · · · = yn−1 = yn′ , i.e., z1 = z2 = · · · = zn−2 = zn−1 and zn−1 = zn−3 , a contradiction. On the other hand, if k ≥ 2, then zi+kℓ = yi = xi for all i = 1, 2, . . . , k − 1 and ℓ = 0, 1, . . . with i + kℓ ≤ n − 1, i.e., the factors obtained from the subword y ′ in u appear twice, starting at position 1 and position k + 1, a contradiction. ✷ Corollary 12 For A = {0, 1} and any n ≥ 2, ✸✸ for n = 2 and ✸✸0111 for n = 3 are the only linear upwords for An containing two ✸s that are adjacent (up to reversal and letter permutations). Proof: The non-existence of linear upwords with two adjacent ✸s for n ≥ 5 follows from Theorem 11, because for such an upword u = x✸✸z the subword y between the two ✸s is empty, so |y| = 0 ≤ n − 2. For n = 4 and |y| = 0 the estimate in the third part in the proof of Theorem 11 can be strengthened to show that if |x|, |z| ≤ n − 1, then the number of factors of u is strictly less than 4n ≤ 2n unless u = u1 u2 u3 ✸✸u6 u7 u8 , which means we can continue the argument as before, leading to a contradiction. The exceptional case u = u1 u2 u3 ✸✸u6 u7 u8 can be excluded as follows: Applying Lemma 4 shows that On universal partial words 13 u2 = u6 and u3 = u7 , and then it becomes clear that the factor 0000, at whatever position within u it is placed, would appear twice. For n = 3 the only possible linear upwords with two adjacent ✸s by Lemma 4 are u = ✸✸u3 u3 u3 u6 , which leads to ✸✸0111 (w.l.o.g. u3 = 0, and for 111 to be covered we must have u6 = 1), and u = u1 ✸✸u4 is impossible because u1 0u4 appears twice as a factor (starting at positions 1 and 2). For n = 2 the only possible linear upword with two ✸s is ✸✸. ✷ 4.2 Existence results Our next result provides an infinite number of binary linear upwords with two ✸s (see Table 2). Theorem 13 For A = {0, 1} and any n ≥ 4, there is a linear upword for An with two ✸s that begins with ✸0n−1 1n−2 ✸10n−2 1. Proof: Consider the word w = w1 w2 · · · w3n−1 := ✸0n−1 1n−2 ✸10n−21. It is easy to check that w yields 3n + 1 different factors x1 x2 · · · xn ∈ An , and each of these factors gives rise to an edge n−1 (x1 x2 · · · xn−1 , x2 x3 · · · xn ) in the De Bruijn graph GA . The set E ′ of these edges and their end ′ vertices V form a connected subgraph that has in- and out-degree 1 for all vertices in V ′ except for v0′ := 0n−1 , v1′ := 1n−1 , v2′ := 10n−2 and v3′ := 1n−2 0 which have in- and out-degree 2, and y := 0n−2 1 and z := 01n−2 which have in-degree 2 and out-degree 1, or in-degree 1 and out-degree 2, respectively. n−1 We denote the graph obtained from GA by removing the edges in E ′ and the vertices v0′ , v1′ , v2′ and v3′ ′ ′ by G . Clearly, every vertex in G has the same in- and out-degree (1 or 2), except the vertex y which has only one outgoing edge, and the vertex z which has only one incoming edge. To complete the proof of the theorem we show that G′ contains an Eulerian path (which must start at y and end at z), and to do this, it suffices (by the before-mentioned degree conditions) to show that G′ is connected. If n = 4, then G′ consists only of the edges (y, 010), (010, 101), (101, z) (a connected graph), so for the rest of the proof we assume that n ≥ 5. Consider a vertex v in G′ other than z. If v ends with 0, consider the (maximum) number k of trailing 0s. Note that k ≤ n − 3, as the vertices v2′ and v0′ that correspond to the cases k ∈ {n − 2, n − 1} are not in G′ . From v we follow 1-edges and 0-edges alternatingly, starting with a 1-edge, until we either reach the vertex s := 1n−3 01 or the vertex t := 010101 · · · ∈ An−1 (this could happen right at the beginning if v = t). From s or t we follow 1-edges until the vertex z. If v ends with 1, then we do the following: If v 6= s we follow a single 0-edge, and then proceed as before until the vertex z. If v = s we directly follow 1-edges until z. (Note that we only ever follow edges in forward direction.) We claim that in this process we never use an edge from E ′ , which shows that G′ is connected. To see this we first consider the case that we start at a vertex v with k ≤ n − 3 trailing 0s. If k ≥ 2, then the vertex reached from v via a 1-edge is not in V ′ , because no vertex in V ′ has a segment of k ≤ n − 3 consecutive 0s surrounded by 1s. Also, none of the next vertices before reaching t is from V ′ , because all contain the factor 0010, unlike any word in V ′ . If k = 1, then the vertex reached from v by following a 1-edge is either s ∈ V ′ (then we stop) or not in V ′ , as no other vertex from V ′ ends with 101. If it is not in V ′ , then the next vertex reached via a 0-edge could be in V ′ , but all the subsequent vertices until (and including) t are not, since they all contain the factor 0101, unlike any word in V ′ . This shows that none of the edges traversed from v to s or t is from E ′ . Moreover, none of the vertices traversed between s and z or between t and z is from V ′ , because they all contain the factor 0101 or 1011, unlike any word in V ′ , so we indeed reach z without using any edges from E ′ . 14 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun Now consider the case that we start at a vertex v that ends with 1. The only interesting case is v 6= s. There are only two 0-edges in E ′ starting at a vertex that ends with 1, namely the edges starting at v1′ and s. However, v is different from v1′ because v1′ is not part of G′ , and v is different from s by assumption. We conclude that the 1-edge we follow is not from E ′ . These arguments show that G′ is connected, so it has an Eulerian path, and this Eulerian path yields the desired upword that begins with w. This completes the proof. ✷ 5 Cyclic upwords Throughout this section, all indices are considered modulo the size of the corresponding word. All the notions introduced in Section 2 can be extended straightforwardly to cyclic upwords, where factors are taken cyclically across the word boundaries. In particular, when defining the graph H(u, n) for some cyclic upword = u1 u2 · · · uN we consider the subsets of words S(u, i, n) cyclically for all i = 1, 2, . . . , N . Then the first two statements of Observation 3 hold for all vertices S(u, i, n), i = 1, 2, . . . , N . The next lemma is the analogue of Lemma 4 for cyclic upwords. Lemma 14 Let u = u1 u2 · · · uN be a cyclic upword for An , where A = {0, 1, . . . , α − 1} and n ≥ 2. If uk = ✸ then uk+n = ✸. Proof: Suppose that uk = ✸ and uk+n 6= ✸. By Observation 3, each vertex in the set S(u, k + 1, n) has in-degree α in H(u, n), and each vertex in S(u, k, n) has out-degree 1. By Observation 2, for each v = v1 v2 · · · vn ∈ S(u, k + 1, n) there are α − 1 other vertices (different from the ones in S(u, k + 1, n)) in GnA with the same set Γ− (v) of α many in-neighbors, namely vx := v1 · · · vn−1 x, where x ∈ A \ {vn }. As the in-degree of every vertex of GnA is exactly α, and in H(u, n) all vertices already have in-degree at least 1, it follows that the vertices vx can not be part of H(u, n), a contradiction to the fact that H(u, n) is a spanning subgraph of GnA . ✷ Lemma 15 immediately yields the following corollary, which captures various rather severe conditions that a cyclic upword must satisfy, relating its length N , the size α of the alphabet, and the value of the parameter n. Corollary 15 Let u = u1 u2 · · · uN be a cyclic upword for An , where A = {0, 1, . . . , α − 1} and n ≥ 2, with at least one ✸. Then we have N = αn−d for some d, 1 ≤ d ≤ n − 1, such that n divides dN . Proof: By Lemma 14, for any ✸ in u, the other two symbols in distance n from it must be ✸s as well. Thus, the indices 1, 2, . . . , N are partitioned into gcd(n, N ) many residue classes modulo n, and all symbols at positions from the same residue class are either all ✸s or all letters from A. Let d denote the number of ✸s among any n consecutive symbols of u, then we have 1 ≤ d ≤ n − 1 (there is at least one ✸, but not all letters can be ✸s), and any starting position in u gives rise to αd different factors, implying that N = αn−d . Furthermore, the d many ✸s within any n consecutive letters of u are partitioned into n/ gcd(n, N ) many blocks with the same ✸ pattern, so n/ gcd(n, N ) must divide d, and this condition is equivalent to n dividing d gcd(n, N ) and to n dividing dN . ✷ As an immediate corollary of our last result, we can exclude the existence of cyclic upwords for many combinations of α and n. On universal partial words 15 Corollary 16 Let A = {0, 1, . . . , α − 1} and n ≥ 2. If gcd(α, n) = 1, then there is no cyclic upword for An . In particular, for α = 2 and odd n, there is no cyclic upword for An . Proof: Suppose that such an upword u = u1 u2 · · · uN exists. Then by Corollary 15 we have N = αn−d for some d, 1 ≤ d ≤ n − 1, such that n divides dN . However, as gcd(α, n) = 1, n does not divide N = αn−d , so n must divide d, which is impossible, yielding a contradiction. ✷ By Corollaries 15 and 16, for a binary alphabet (α = 2), the only remaining potential parameter values for cyclic upwords are n = 2 and d = 1, n = 4 and d ∈ {1, 2}, n = 6 and d = 3, n = 8 and d ∈ {1, 2, . . . , 6}, n = 10 and d = 5, n = 12 and d ∈ {3, 6, 9}, etc. The case n = 2 and d = 1 can be easily exluded: w.l.o.g. such a word has the form ✸0, leading to the factor 00 appearing twice (and 11 does not appear as a factor at all). However, for n = 4 and d = 1 we have the cyclic upword ✸001✸110, which we already mentioned in the introduction. This is the only cyclic upword for a binary alphabet that we know of. Cyclic upwords for any even alphabet size α ≥ 4 and n = 4 have been constructed in the follow-up paper [GGH+ 16]. 6 Outlook In this paper we initiated the systematic study of universal partial words, and we hope that our results and the numerous examples of upwords provided in the tables (see also the extensive data available on the website [www]) generate substantial interest for other researchers to continue this exploration, possibly in one of the directions suggested below. Concerning the binary alphabet A = {0, 1}, it would be interesting to achieve complete classification of linear upwords containing a single ✸, as suggested by Conjecture 8. For two ✸s such a task seems somewhat more challenging (recall Table 2, Theorem 11 and see the data from [www]). Some examples of binary linear upwords with three ✸s are listed in Table 3, and deriving some general existence and non-existence results for this setting would certainly be of interest. The next step would be to consider the situation of more than three ✸s present in a linear upword. The following easy-to-verify example in this direction was communicated to us by Rachel Kirsch [GGH+ 16]. Theorem 17 For A = {0, 1} and any n ≥ 2, ✸n−1 01n is a linear upword for An with n − 1 many ✸s. Complementing Theorem 17, we can prove the following non-existence result in this direction, but it should be possible to obtain more general results. Theorem 18 For A = {0, 1}, any n ≥ 4 and any 2 ≤ d ≤ n − 2, there is no linear upword for An that begins with ✸d xd+1 xd+2 . . . xn+2 with xi ∈ A for all i = d + 1, . . . , n + 2. The proof of Theorem 18 is easy by applying Lemma 4 to the first and second ✸. We leave the details to the reader. It would also be interesting to find examples of binary cyclic upwords other than ✸001✸110 for n = 4 mentioned before. Finally, a natural direction would be to search for (linear or cyclic) upwords for non-binary alphabets, but we anticipate that no non-trivial upwords exist in most cases (recall Theorem 5). As evidence for this we have the following general non-existence result in this setting. Theorem 19 For A = {0, 1, . . . , α − 1}, α ≥ 3, and any d ≥ 2, for large enough n there is no linear or cyclic upword for An with exactly d many ✸s. 16 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun n 3 4 5 ✸✸✸ ✸✸✸01111 (Thm. 17) ✸✸001✸11010 ✸001✸110✸00 0✸001✸110✸0 ✸0010✸0111✸10011011000001 ✸0000111✸10001001101100101✸1 ✸00001110✸100010100110101111✸ ✸0000100111✸10001101100101✸1 ✸0000101110✸1000110101001111✸ ✸00001111101✸10001011001✸01 ✸000010101110✸10001101001111✸ ✸0000101001110✸1000110101111✸ ✸00001101100111✸1000100101✸1 ✸0000110101001110✸1000101111✸ ✸00001101100100111✸1000101✸1 ✸000010010101111100✸1101✸00 0✸1100✸001111101101000101✸1 Tab. 3: Examples of linear upwords for An , A = {0, 1}, with three ✸s for n = 3, 4, 5. Theorem 19 shows in particular that for a fixed alphabet size α and a fixed number d ≥ 2 of diamonds, there are only finitely many possible candidates for upwords with d diamonds (which in principle could all be checked by exhaustive search). The proof idea is that for fixed d and large enough n, such an upword must contain a ✸ and a symbol from A in distance n, and then applying Lemma 4 or Lemma 14 yields a contradiction (recall the proof of Theorem 5). We omit the details here. On the positive side, upwords for even alphabet sizes α ≥ 4 and n = 4 have been constructed in [GGH+ 16] (and these upwords are even cyclic). A question that we have not touched in this paper is the algorithmic problem of efficiently generating upwords. As a preliminary observation in this direction we remark here that some of the linear upwords constructed in Theorem 9 and 10 can also be obtained by straightforward modifications of the FKM de Bruijn sequences constructed in [FM78, FK86], for which efficient generation algorithms are known [RSW92]. Acknowledgements The authors thank Martin Gerlach for his assistance in our computer searches, Rachel Kirsch and her collaborators [GGH+ 16], as well as Artem Pyatkin for providing particular examples of small upwords. The second author is grateful to Sergey Avgustinovich for helpful discussions on universal partial words, and to Bill Chen and Arthur Yang for their hospitality during the author’s visit of the Center for Combinatorics at Nankai University in November 2015. This work was supported by the 973 Project, the PCSIRT Project of the Ministry of Education and the National Science Foundation of China. We also thank the On universal partial words 17 anonymous referees of this paper for several valuable suggestions and references that helped improving the presentation. References [BB99] J. Berstel and L. Boasson. Partial words and a theorem of Fine and Wilf. Theoret. Comput. Sci., 218(1):135–141, 1999. WORDS (Rouen, 1997). [BBSGR10] B. Blakeley, F. Blanchet-Sadri, J. Gunter, and N. Rampersad. On the complexity of deciding avoidability of sets of partial words. Theoret. Comput. Sci., 411(49):4263–4271, 2010. [BJG08] J. Bang-Jensen and G. Z. Gutin. Digraphs: Theory, Algorithms and Applications. Springer, 2nd edition, 2008. [BS05] F. Blanchet-Sadri. Primitive partial words. Discrete Applied Mathematics, 148(3):195–213, 2005. [BS08] F. Blanchet-Sadri. Open problems on partial words. In G. Bel-Enguix, M. D. JiménezLópez, and C. Martín-Vide, editors, New Developments in Formal Languages and Applications, pages 11–58. Springer Berlin Heidelberg, Berlin, Heidelberg, 2008. [BSBK+ 09] F. Blanchet-Sadri, N. C. Brownstein, A. Kalcic, J. Palumbo, and T. Weyand. Unavoidable sets of partial words. Theory Comput. Syst., 45(2):381–406, 2009. [CDG92] F. Chung, P. Diaconis, and R. Graham. Universal cycles for combinatorial structures. Discrete Math., 110(1-3):43–59, 1992. [CJJK11] A. Claesson, V. Jelínek, E. Jelínková, and S. Kitaev. Pattern avoidance in partial permutations. Electron. J. Combin., 18(1):Paper 25, 41, 2011. [CPT11] P. E. C. Compeau, P. A. Pevzner, and G. Tesler. How to apply De Bruijn graphs to genome assembly. Nature biotechnology, 29(11):987–991, 2011. [dB46] N. G. de Bruijn. A Combinatorial Problem. Koninklijke Nederlandse Akademie v. Wetenschappen, 49:758–764, 1946. [Eul36] L. Euler. Solutio problematis ad geometriam situs pertinentis. Comment. Academiae Sci. I. Petropolitanae, 8:128–140, 1736. [FK86] H. Fredricksen and I. J. Kessler. An algorithm for generating necklaces of beads in two colors. Discrete Math., 61(2-3):181–188, 1986. [Fle83] M. Fleury. Deux problemes de geometrie de situation. Journal de mathematiques elementaires, pages 257–261, 1883. [FM78] H. Fredricksen and J. Maiorana. Necklaces of beads in k colors and k-ary de Bruijn sequences. Discrete Math., 23(3):207–210, 1978. 18 Herman Z. Q. Chen, Sergey Kitaev, Torsten Mütze, Brian Y. Sun [GGH+ 16] B. Goeckner, C. Groothuis, C. Hettle, B. Kell, P. Kirkpatrick, R. Kirsch, and R. Solava. Universal partial words over non-binary alphabets. arXiv:1611.03928, Nov 2016. [HHK08] V. Halava, T. Harju, and T. Kärki. Square-free partial words. Inform. Process. Lett., 108(5):290–292, 2008. [HHKS09] V. Halava, T. Harju, T. Kärki, and P. Séébold. Overlap-freeness in infinite partial words. Theoret. Comput. Sci., 410(8-10):943–948, 2009. [HRW12] A. E. Holroyd, F. Ruskey, and A. Williams. Shorthand universal cycles for permutations. Algorithmica, 64(2):215–245, 2012. [Hur90] G. H. Hurlbert. Universal cycles: On beyond de Bruijn. ProQuest LLC, Ann Arbor, MI, 1990. Thesis (Ph.D.)–Rutgers The State University of New Jersey - New Brunswick. [HW73] C. Hierholzer and C. Wiener. Ueber die Möglichkeit, einen Linienzug ohne Wiederholung und ohne Unterbrechung zu umfahren. Math. Ann., 6(1):30–32, 1873. [Lem71] A. Lempel. m-ary closed sequences. J. Combinatorial Theory Ser. A, 10:253–258, 1971. [PSCF05] J. Pagès, J. Salvi, C. Collewet, and J. Forest. Optimised De Bruijn patterns for one-shot shape acquisition. Image and Vision Computing, 23(8):707 – 720, 2005. [Ral82] A. Ralston. De Bruijn sequences—a model example of the interaction of discrete mathematics and computer science. Math. Mag., 55(3):131–143, 1982. [RSW92] F. Ruskey, C. Savage, and T. M. Y. Wang. Generating necklaces. J. Algorithms, 13(3):414– 430, 1992. [SBSH97] H. Sohn, D. L. Bricker, J. R. Simon, and Y. Hsieh. Optimal sequences of trials for balancing practice and repetition effects. Behavior Research Methods, Instruments, & Computers, 29(4):574–581, 1997. [Sch01] E. R. Scheinerman. Determining planar location via complement-free De Brujin sequences using discrete optical sensors. IEEE Transactions on Robotics and Automation, 17(6):883– 889, Dec 2001. [SW14] B. Stevens and A. Williams. The coolest way to generate binary strings. Theory Comput. Syst., 54(4):551–577, 2014. [www] currently http://www.math.tu-berlin.de/~muetze. [Yoe62] M. Yoeli. Binary ring sequences. Amer. Math. Monthly, 69:852–855, 1962.
7cs.IT
Online Stochastic Matching: New Algorithms and Bounds∗ Brian Brubach†, Karthik A. Sankararaman‡, Aravind Srinivasan§, and Pan Xu¶ arXiv:1606.06395v3 [cs.DS] 15 Nov 2017 Department of Computer Science, University of Maryland, College Park, MD 20742, USA Original Version: May 2016 This Version: November 2017 Abstract Online matching has received significant attention over the last 15 years due to its close connection to Internet advertising. As the seminal work of Karp, Vazirani, and Vazirani has an optimal (1−1/e) competitive ratio in the standard adversarial online model, much effort has gone into developing useful online models that incorporate some stochasticity in the arrival process. One such popular model is the “known I.I.D. model” where different customer-types arrive online from a known distribution. We develop algorithms with improved competitive ratios for some basic variants of this model with integral arrival rates, including: (a) the case of general weighted edges, where we improve the best-known ratio of 0.667 due to Haeupler, Mirrokni and Zadimoghaddam [12] to 0.705; and (b) the vertex-weighted case, where we improve the 0.7250 ratio of Jaillet and Lu [13] to 0.7299. We also consider an extension of stochastic rewards, a variant where each edge has an independent probability of being present. For the setting of stochastic rewards with non-integral arrival rates, we present a simple optimal non-adaptive algorithm with a ratio of 1 − 1/e. For the special case where each edge is unweighted and has a uniform constant probability of being present, we improve upon 1 − 1/e by proposing a strengthened LP benchmark. One of the key ingredients of our improvement is the following (offline) approach to bipartitematching polytopes with additional constraints. We first add several valid constraints in order to get a good fractional solution f; however, these give us less control over the structure of f. We next remove all these additional constraints and randomly move from f to a feasible point on the matching polytope with all coordinates being from the set {0, 1/k, 2/k, . . . , 1} for a chosen integer k. The structure of this solution is inspired by Jaillet and Lu (Mathematics of Operations Research, 2013) and is a tractable structure for algorithm design and analysis. The appropriate random move preserves many of the removed constraints (approximately with high probability and exactly in expectation). This underlies some of our improvements and could be of independent interest. ∗ A preliminary version of this appeared in the European Symposium on Algorithms (ESA), 2016 Email: [email protected] Supported in part by NSF Awards CNS 1010789 and CCF 1422569. ‡ Email: [email protected] Supported in part by NSF Awards CNS 1010789 and CCF 1422569. § Email: [email protected] Supported in part by NSF Awards CNS 1010789 and CCF 1422569, and by research awards from Adobe, Inc. ¶ Email: [email protected] Supported in part by NSF Awards CNS 1010789 and CCF 1422569. † 1 1 Introduction. Applications to Internet advertising have driven the study of online matching problems in recent years [20]. In these problems, we consider a bipartite graph G = (U, V, E) in which the set of vertices U is available offline while the set of vertices in V arrive online. Whenever some vertex v arrives, it must be matched immediately (and irrevocably) to (at most) one vertex in U . Each offline vertex u can be matched to at most one v. In the context of Internet advertising, U is the set of advertisers and V is the set of impressions. The edges E define the impressions that interest a particular advertiser. When an impression v arrives, we must choose an available advertiser (if any) to match with it. WLOG we consider the case where v ∈ V can be matched at most once. Since advertising forms the key source of revenue for many large Internet companies, finding good matching algorithms and obtaining even small performance gains can have high impact. In the stochastic known I.I.D. model of arrival, we are given a bipartite graph G = (U, V, E) and a finite online time horizon T (here we assume T = n). In each round, a vertex v is sampled with replacement from a known distribution over V . The sampling distributions are independent and identical over all of the T online rounds. This captures the fact that we often have historical data about the impressions and can predict the frequency with which each type of impression will arrive. Edge-weighted matching [9] is a general model in the context of advertising: every advertiser gains a given revenue for being matched to a particular type of impression. Here, a type of impression refers to a class of users (e.g., a demographic group) who are interested in the same subset of advertisements. A special case of this model is vertex-weighted matching [1], where weights are associated only with the advertisers. In other words, a given advertiser has the same revenue generated for matching any of the user types interested in it. In some modern business models, revenue is not generated upon matching advertisements, but only when a user clicks on the advertisement: this is the pay-per-click model. From historical data, one can assign the probability of a particular advertisement being clicked by a type of user. Works including [21, 22] capture this notion of stochastic rewards by assigning a probability to each edge. One unifying theme in most of our approaches is the use of an LP benchmark with additional valid constraints that hold for the respective stochastic-arrival models. We use the optimal solution of this LP to guide our online actions. To do so, we use various modifications of dependent randomized rounding. 2 Preliminaries and technical challenges. In the Unweighted Online Known I.I.D. Stochastic Bipartite Matching problem, we are given a bipartite graph G = (U, V, E). The set U is available offline while the vertices v arrive online and are drawn with replacement from an I.I.D. distribution on V . For each v ∈ V , we are given an arrival rate rv , which is the expected number of times v will arrive. With the exception of Sections 5, this paper will focus on the integral arrival rates setting where all rv ∈ Z+ . For reasons described in [12], we can further assume WLOG that each v has rv = 1 under the assumption of integral arrival rates. In this case, we have that |V | = n where n is the total number of online rounds. In the vertex-weighted variant, every vertex u ∈ U has a weight wu and we seek a maximum weight matching. In the edge-weighted variant, every edge e ∈ E has a weight we and we again seek a maximum weight matching. In the stochastic rewards variant, each edge has both a 2 weight we and a probability pe of being present once we probe edge e1 and we seek to maximize the expected weight of the matching. Asymptotic assumption and notation. We will always assume n is large and analyze algorithms as n goes to infinity: e.g., if x ≤ 1 − (1 − 2/n)n , we will just write this as “x ≤ 1 − 1/e2 ” instead of the more-accurate “x ≤ 1 − 1/e2 + o(1)”. These suppressed o(1) terms will subtract at most o(1) from our competitive ratios. Another fact to note is that the competitive ratio is defined slightly differently than usual for this set of problems (Similar to notation used in [20]). In E[ALG] particular, it is defined as E[OPT] . Algorithms can be adaptive or non-adaptive. When v arrives, an adaptive algorithm can modify its online actions based on the realization of the online vertices thus far, but a non-adaptive algorithm has to specify all of its actions before the start of the online phase. Throughout, we use “WS” to refer to the worst case instance for various algorithms. 2.1 LP benchmark for deterministic rewards. As in prior work (e.g, see [20]), we use the following LP to upper bound the optimal offline expected performance and also use it to guide our algorithm in the case where rewards are deterministic. For the case of stochastic rewards, we use slightly modified LPs, whose definitions we defer until Sections 5 and 6. We first show an LP for the unweighted variant, then describe the changes for the vertex-weighted and edge-weighted settings. As usual, we have a variable fe for each edge. Let P ∂(w) be the set of edges adjacent to a vertex w ∈ U ∪ V and let fw = e∈∂(w) fe . maximize X fe (1) e∈E subject to X fe ≤ 1 ∀u ∈ U (2) X fe ≤ 1 ∀v ∈ V (3) ∀e ∈ E (4) e∈∂(u) e∈∂(v) 0 ≤ fe ≤ 1 − 1/e 2 ′ fe + fe′ ≤ 1 − 1/e ∀e, e ∈ ∂(u), ∀u ∈ U (5) Variants: The objective function is to maximize u∈U e∈∂(u) fe wu in the vertex-weighted P variant and maximize e∈E fe we in the edge-weighted variant (here we refers to w(u,v) ). Constraint 2 is the matching constraint for vertices in U . Constraint 3 is valid because each vertex in V has an arrival rate of 1. Constraint 4 is used in [19] and [12]. It captures the fact that the expected number of matches for any edge is at most 1 − 1/e. This is valid for large n because the probability that a given vertex does not arrive during n rounds is 1/e. Constraint 5 is similar to the previous one, but for pairs of edges. For any two neighbors of a given u ∈ U , the probability that neither of them arrive is 1/e2 . Therefore, the sum of variables for any two distinct edges in ∂(u) cannot exceed 1 − 1/e2 . Notice that constraints 4 and 5 reduces the gap between the optimal LP solution and the performance of the optimal online algorithm. In fact, without constraint 4, we cannot in general achieve a competitive ratio better than 1 − 1/e. P 1 P The edge realization process is independent for different edges. At each step, the algorithm “probes” an edge. With probability pe the edge e exists and with the remaining probability it does not. Once realization of an edge is determined, it does not affect the random realizations for the rest of the edges. 3 Note that the work of [19] does not use an LP to upper-bound the optimal value of the offline instance. Instead they use Monte-Carlo simulations wherein they simulate the arrival sequence and compute the vector f by approximating (via Monte-Carlo simulation) the probability of matching an edge e in the offline optimal solution. We do not use a similar approach for our problems for a few reasons. (1) For the weighted variants, namely the edge and vertex-weighted versions, the number of samples depends on the maximum value of the weight, making it expensive. (2) In the unweighted version, the running time of the sampling based algorithm is O(|E|2 n4 ); on the other hand, we show in Section 2.6 that the LP based algorithm can be solved much faster, Õ(|E|2 ) time in the worst case and even faster than that in practice. (3) For the stochastic rewards setting, the offline problem is not known to be polynomial-time solvable. The paper [4] shows under the assumption of constant p and OPT = ω(1/p), they can obtain a (1 − ǫ) approximation to the optimal solution. However, these assumptions are too strong to be used in our setting. Finally, for the stochastic rewards setting, one might be tempted to use an LP to achieve the same property obtained from Monte-Carlo simulation via adding extra constraints. In the context of uniform stochastic rewards where each edge e is associated with a uniform constant probability p, what we really need is: X 1 − exp(−|S|p) fe ≤ ∀S ⊆ ∂(u), (6) p e∈S To guarantee this via the LP, a straightforward approach is to add this family of constraints into the LP. However, the number of such constraints is exponential and there seems to be no obvious separation oracle. We overcome this challenge by showing it suffices to ensure that Inequality (6) above holds for all S with |S| ≤ 2/p, which is a constant and thus the resultant LP is polynomial solvable. 2.2 Overview of vertex-weighted algorithm and contributions. A key challenge encountered by [13] was that their special LP could lead to length four cycles of type C1 shown in Figure 1. In fact, they used this cycle to show that no algorithm could perform better than 1 − 2/e2 ≈ 0.7293 using their LP. They mentioned that tighter LP constraints such as 4 and 5 in the LP from Section 2 could avoid this bottleneck, but they did not propose a technique to use them. Note that the {0, 1/3, 2/3} solution produced by their LP was an essential component of their Random List algorithm. We show a randomized rounding algorithm to construct a similar, simplified {0, 1/3, 2/3} vector from the solution of a stricter benchmark LP. This allows for the inclusion of additional constraints, most importantly constraint 5. Using this rounding algorithm combined with tighter constraints, we will upper bound the probability of a vertex appearing in the cycle C1 from Figure 1 at 2−3/e ≈ 0.89. (See Lemma 4) Additionally, we show how to deterministically break all other length four cycles which are not of type C1 without creating any new cycles of type C1 . Finally, we describe an algorithm which utilizes these techniques to improve previous results in both the vertex-weighted and unweighted settings. For this algorithm, we first solve the LP in Section 2 on the input graph. In Section 4, we show how to use the technique in sub-section 2.7 to obtain a sparse fractional vector. We then present a randomized online algorithm (similar to the one in [13]) which uses the sparse fractional vector as a guide to achieve a competitive ratio of 0.7299. Previously, there was gap between the best unweighted algorithm with a ratio of 1 − 2e−2 due to [13] and the negative result of 1 − e−2 4 Figure 1: This cycle is the source of the negative result described by Jaillet and Lu [13]. Thick edges have fe = 2/3 while thin edges have fe = 1/3. (C1 ) u1 v1 u2 v2 due to [19]. We take a step towards closing that gap by showing that an algorithm can achieve 0.7299 > 1 − 2e−2 for both the unweighted and vertex-weighted variants with integral arrival rates. In doing so, we make progess on Open Questions 3 and 4 from the book [20]. 2 2.3 Overview of edge-weighted algorithm and contributions. A challenge that arises in applying the power of two choices to this setting is when the same edge (u, v) is included in both matchings M1 and M2 . In this case, the copy of (u, v) in M2 can offer no benefit and a second arrival of v is wasted. To use an example from related work, Haeupler et al. [12] choose two matchings in the following way. M1 is attained by solving an LP with constraints 2, 3 and 4 and rounding to an integral solution. M2 is constructed by finding a maximum weight matching and removing any edges which have already been included in M1 . A key element of their proof is showing that the probability of an edge being removed from M2 is at most 1 − 1/e ≈ 0.63. The approach in this paper is to construct two or three matchings together in a correlated manner to reduce the probability that some edge is included in all matchings. We show a general technique to construct an ordered set of k matchings where k is an easily adjustable parameter. For k = 2, we show that the probability of an edge appearing in both M1 and M2 is at most 1 − 2/e ≈ 0.26. For the algorithms presented, we first solve an LP on the input graph. We then round the LP solution vector to a sparse integral vector and use this vector to construct a randomly ordered set of matchings which will guide our algorithm during the online phase. We begin Section 3 with a simple warm-up algorithm which uses a set of two matchings as a guide to achieve a 0.688 competitive ratio, improving the best known result for this problem. We follow it up with a slight variation that improves the ratio to 0.7 and a more complex 0.705-competitive algorithm which relies on a convex combination of a 3-matching algorithm and a separate pseudo-matching algorithm. 2.4 Overview of stochastic rewards and contributions. This algorithm (Algorithm 9) is presented in Section 5 and 6. We believe the known I.I.D. model with stochastic rewards is an interesting new direction motivated by the work of [21] and [22] in the adversarial model. We introduce a new, more general LP (see LP (9)) specifically for this setting and show that a simple algorithm using the LP solution directly can achieve a competitive ratio of 1 − 1/e, which is proved to be optimal among all non-adaptive algorithms. In [22], it is shown that no randomized algorithm can achieve a ratio better than 0.62 < 1 − 1/e in the adversarial 2 Open Questions 3 and 4 state the following: “In general, close the gap between the upper and lower bounds. In some sense, the ratio of 1 − 2e−2 achieved in [13] for the integral case, is a nice ‘round’ number, and one may suspect that it is the correct answer.” 5 Table 1: Summary of Contributions Problem Previous Work This Paper Edge-Weighted (Section 3) 0.667 [12] 0.705 Vertex-Weighted (Section 4) 0.725 [13] 0.7299 Unweighted 1 − 2/e2 [13] 0.7299 (> 1 − 2/e2 ) Stochastic Rewards (Section 5 and 6) N/A 1 − e−1 for general version 0.702 for the restricted version model. Hence, achieving a 1 − 1/e for the i.i.d. model shows that this lower bound does not extend to this model. Further, the paper [5] shows that using LP (9) one cannot achieve a ratio better than 1 − 1/e. We discuss some challenges relating to why the techniques used in prior work do not directly extend to this model. Finally, we consider a restricted version of the problem where each edge is unweighted and has a uniform constant probability p ∈ (0, 1] under integral arrival rates. By proposing a family of valid constraints, we are able to show that in this restricted setting, one can indeed beat 1 − 1/e. 2.5 Summary of our contributions Theorem 1. For vertex-weighted online stochastic matching with integral arrival rates, online algorithm VW achieves a competitive ratio of at least 0.7299. Theorem 2. For edge-weighted online stochastic matching with integral arrival rates, there exists an algorithm which achieves a competitive ratio of at least 0.7 and algorithm EW[q] with q = 0.149251 achieves a competitive ratio of at least 0.70546. Theorem 3. For edge-weighted online stochastic matching with arbitrary arrival rates and stochastic rewards, online algorithm SM (9) achieves a competitive ratio of 1 − 1/e, which is optimal all among all non-adaptive algorithms. Theorem 4. For unweighted online stochastic matching with integral arrival rates and uniform stochastic rewards, there exists an adaptive algorithm which achieves a competitive ratio of at least 0.702. 2.6 Runtime of algorithm. In this section, we discuss the implementation details of our algorithm. All of our algorithms solve an LP in the pre-processing step. The dimension of the LP is determined by the constraint matrix which consists of O(|E| + |U | + |V |) rows and O(|E|) columns. However, note that the number of non-zero entries in this matrix is of the order O((|U | + |V |)|E|). Some recent work (e.g., [17]) shows that such sparse programs can be solved in time Õ(|E|2 ) using interior point methods (which are 6 known to perform very well in practice). This sparsity in the LP is the reason we can solve very large instances of the problem. The second critical step in pre-processing is to perform randomized rounding. Note that we have O(|E|) variables and in each step of the randomized rounding due to [11], they incur a running time of O(|E|). Hence the total running time to obtain a rounded solution is of the order O(|E|2 ). Finally, recall that both these operations are part of the pre-processing step. Hence in the online phase the algorithm incurs a per-time-step running time of at most O(|U |) for the stochastic rewards case (in fact, a smarter implementation using binary search runs as fast as O(log |U |)) and O(1) for the edge-weighted and the vertex-weighted algorithms in Section 3 and 4. 2.7 LP rounding technique DR[f, k]. For the algorithms presented, we first solve the benchmark LP in sub-section 2.1 for the input instance to get a fractional solution vector f. We then round f to an integral solution F using a two step process we call DR[f, k]. The first step is to multiply f by k. The second step is to apply the dependent rounding techniques of Gandhi, Khuller, Parthasarathy, and Srinivasan [11] to this new vector. In this paper, we will always choose k to be 2 or 3. This is because a vertex in V may appear more than once, but probably not more than two or three times. While dependent rounding is typically applied to values between 0 and 1, the useful properties extend naturally to our case in which kfe may be greater than 1 for some edge e. To understand this process, it is easiest to imagine splitting each kfe into two edges with the integer value fe′ = ⌊kfe ⌋ and fractional value fe′′ = kfe − ⌊kfe ⌋. The former will remain unchanged by the dependent rounding since it is already an integer while the latter will be rounded to 1 with probability fe′′ and 0 otherwise. Our final value Fe would be the sum of those two rounded values. The two properties of dependent rounding we use are: 1. Marginal distribution: For every edge e, let pe = kfe − ⌊kfe ⌋. Then, Pr[Fe = ⌈kfe ⌉] = pe and Pr[Fe = ⌊kfe ⌋] = 1 − pe . 2. Degree-preservation: For any vertex w ∈ U ∪ V , let its fractional degree kfw be P P e∈∂(w) kfe and integral degree be the random variable Fw = e∈∂(w) Fe . Then Fw ∈ {⌊kfw ⌋, ⌈kfw ⌉}. 2.8 Related work. The study of online matching began with the seminal work of Karp, Vazirani, Vazirani [14], where they gave an optimal online algorithm for a version of the unweighted bipartite matching problem in which vertices arrive in adversarial order. Following that, a series of works have studied various related models. The book by Mehta [20] gives a detailed overview. The vertex-weighted version of  this problem was introduced by Aggarwal, Goel and Karande [1], where they give an optimal 1 − 1e ratio for the adversarial arrival model. The edge-weighted setting has been studied in the adversarial model by Feldman, Korula, Mirrokni and Muthukrishnan [9], where they consider an additional relaxation of “free-disposal”. In addition to the adversarial and known I.I.D. models, online matching is also studied under several other variants such as random arrival order, unknown distributions, and known adversarial distributions. In the setting of random arrival order, the arrival sequence is assumed to be a random permutation over all online vertices, see e.g., [6, 15, 16, 18]. In the case of unknown distributions, in each round an item is sampled from a fixed but unknown distribution. If the sampling distributions 7 are required to be the same during each round, it is called unknown I.I.D. ([7, 8]); otherwise, it is called adversarial stochastic input ([7]). As for known adversarial distributions, in each round an item is sampled from a known distribution, which is allowed to change over time ([2, 3]). Another variant of this problem is when the edges have stochastic rewards. Models with stochastic rewards have been previously studied by [21, 22] among others, but not in the known I.I.D. model. Related Work in the Vertex-Weighted and Unweighted Settings. The vertex-weighted and unweighted settings have many results starting with Feldman, Mehta, Mirrokni and Muthukrishnan [10] who were the first to beat 1 − 1/e with a competitive ratio of 0.67 for the unweighted problem. This was improved by Manshadi, Gharan, and Saberi [19] to 0.705 with an adaptive algorithm. In addition, they showed that even in the unweighted variant with integral arrival rates, no algorithm can achieve a ratio better than 1 − e−2 ≈ 0.86. Finally, Jaillet and Lu [13] presented an adaptive algorithm which used a clever LP to achieve 0.725 and 1 − 2e−2 ≈ 0.729 for the vertex-weighted and unweighted problems, respectively. Related Work in the Edge-Weighted Setting. For this model, Haeupler, Mirrokni, Zadimoghaddam [12] were the first to beat 1 − 1/e by achieving a competitive ratio of 0.667. They use a discounted LP with tighter constraints than the basic matching LP (a similar LP can be seen in 2.1) and they employ the power of two choices by constructing two matchings offline to guide their online algorithm. √Other Related Work. Devanur et al [8] gave an algorithm which achieves a ratio of 1 − 1/ 2πk for the Adwords problem in the Unknown I.I.D. arrival model with knowledge of the optimal budget utilization and when the bid-to-budget ratios are at most 1/k. Alaei et al. [2] considered the Prophet-Inequality Matching problem, √ in which v arrives from a distinct (known) distribution Dt , in each round t. They gave a 1 − 1/ k + 3 competitive algorithm, where k is the minimum capacity of u. 3 Edge-weighted matching with integral arrival rates 3.1 A simple 0.688-competitive algorithm. As a warm-up, we describe a simple algorithm which achieves a competitive ratio of 0.688 and introduces key ideas in our approach. We begin by solving the LP in sub-section 2.1 to get a fractional solution vector f and applying DR[f, 2] as described in Subsection 2.7 to get an integral vector F. We construct a bipartite graph GF with Fe copies of each edge e. Note that GF will have max degree 2 since for all w ∈ U ∪ V , Fw ≤ ⌈2fw ⌉ ≤ 2 and thus we can decompose it into two matchings using Hall’s Theorem. Finally, we randomly permute the two matchings into an ordered pair of matchings, [M1 , M2 ]. These matchings serve as a guide for the online phase of the algorithm, similar to [12]. The entire warm-up algorithm for the edge-weighted model, denoted by EW0 , is summarized in Algorithm 1. 3.1.1 Analysis of algorithm EW0 . We will show that EW0 (Algorithm 1) achieves a competitive ratio of 0.688. Let [M1 , M2 ] be our randomly ordered pair of matchings. Note that there might exist some edge e which appears in 8 Algorithm 1: [EW0 ] 1 2 3 4 5 6 Construct and solve the benchmark LP in sub-section 2.1 for the input instance. Let f be an optimal fractional solution vector. Call DR[f, 2] to get an integral vector F. Create the graph GF with Fe copies of each edge e ∈ E and decompose it into two matchings. Randomly permute the matchings to get a random ordered pair of matchings, say [M1 , M2 ]. When a vertex v arrives for the first time, try to assign v to some u1 if (u1 , v) ∈ M1 ; when v arrives for the second time, try to assign v to some u2 if (u2 , v) ∈ M2 . When a vertex v arrives for the third time or more, do nothing in that step. both matchings if and only if fe > 1/2. Therefore, we consider three types of edges. We say an edge e is of type ψ1 , denoted by e ∈ ψ1 , if and only if e appears only in M1 . Similarly e ∈ ψ2 , if and only if e appears only in M2 . Finally, e ∈ ψb , if and only if e appears in both M1 and M2 . Let P1 , P2 , and Pb be the probabilities of getting matched for e ∈ ψ1 , e ∈ ψ2 , and e ∈ ψb , respectively. According to the result in Haeupler et al. [12], Lemma 1 bounds these probabilities. Lemma 1. (Proof details in Section 3 of [12]) Given M1 and M2 , in the worst case (1) P1 = 0.5808; (2) P2 = 0.14849 and (3) Pb = 0.632. We can use Lemma 1 to prove that the warm-up algorithm EW0 achieves a ratio of 0.688 by examining the probability that a given edge becomes type ψ1 , ψ2 , or ψb . Proof. (Analysis for EW0 ) Consider the following two cases. • Case 1: 0 ≤ fe ≤ 1/2: By the marginal distribution property of dependent rounding, there can be at most one copy of e in GF and the probability of including e in GF is 2fe . Since an edge in GF can appear in either M1 or M2 with equal probability 1/2, we have Pr[e ∈ ψ1 ] = Pr[e ∈ ψ2 ] = fe . Thus, the ratio is (fe P1 + fe P2 )/fe = P1 + P2 = 0.729. • Case 2: 1/2 ≤ fe ≤ 1 − 1/e: Similarly, by marginal distribution, Pr[e ∈ ψb ] = Pr[Fe = ⌈2fe ⌉] = 2fe −⌊2fe ⌋ = 2fe −1. It follows that Pr[e ∈ ψ1 ] = Pr[e ∈ ψ2 ] = (1/2)(1−(2fe −1)) = 1 − fe . Thus, the ratio is (noting that the first term is from case 1 while the second term is from case 2) ((1 − fe )(P1 + P2 ) + (2fe − 1)Pb )/fe ≥ 0.688, where the WS is for an edge e with fe = 1 − 1/e. 3.2 A 0.7-competitive algorithm. In this section, we describe an improvement upon the previous warm-up algorithm to get a competitive ratio of 0.7. We start by making an observation about the performance of the warm-up algorithm. After solving the LP, let edges with fe > 1/2 be called large and edges with fe ≤ 1/2 be called small. Let L and S, be the sets of large and small edges, respectively. Notice that in the previous analysis, small edges achieved a much higher competitive ratio of 0.729 versus 0.688 for 9 large edges. This is primarily due to the fact that we may get two copies of a large edge in GF . In this case, the copy in M1 has a better chance of being matched, since there is no edge which can “block” it (i.e. an edge with the same offline neighbor that gets matched first), but the copy that is in M2 has no chance of being matched. To correct this imbalance, we make an additional modification to the fe values before applying DR[f, k]. The rest of the algorithm is exactly the same. Let η be a parameter to be optimized later. For all large edges ℓ ∈ L such that fℓ > 1/2, we set fℓ = fℓ + η. For all small edges s ∈ S which are adjacent to some large edge, let ℓ ∈ L be the largest edge adjacent to s such that fℓ > 1/2. Note that it is possiblefor s to have two large neighbors, but we only care about the largest one. We set ℓ +η) . fs = fs 1−(f 1−fℓ In other words, we increase the values of large edges while ensuring that for all w ∈ U ∪ V , fw ≤ 1 by reducing the values of neighboring small edges proportional to their original values. Note that it is not possible for two large edges to be adjacent since they must both have fe > 1/2. For all other small edges which are not adjacent to any large edges, we leave their values unchanged. We then apply DR[f, 2] to this new vector, multiplying by 2 and applying dependent rounding as before. 3.2.1 Analysis. We can now prove Theorem 2. Proof. As in the warm-up analysis, we’ll consider large and small edges separately • 0 ≤ fs ≤ 21 : Here we have two cases – Case 1: s is not adjacent to any large edges. In this case, the analysis is the same as the warm-up algorithm and we still get a 0.729 competitive ratio for these edges. – Case 2: s is adjacent to some large edge ℓ. For this case, let fℓ be the value of the largest neighboring edge in the original LP solution. Then s achieves a ratio of fs  1 − (fℓ + η) (0.1484 + 0.5803)/fs = 1 − fℓ   1 − (fℓ + η) (0.1484 + 0.5803) 1 − fℓ  This follows from Lemma 1; in particular, the first two terms are the result of how we set fs in the algorithm, while the two numbers, 0.1484 and 0.5803, are the probabilities that s is matched when it is in M2 and M1 , respectively. Note that for fℓ ∈ [0, 1) this is a decreasing function with respect to fℓ . So the worst case is fℓ = 1 − 1/e (due to constraint 4 in LP 2.1) and we have a ratio of  • 1 2 1 − (1 − 1/e + η) (0.1484 + 0.5803) = 1 − (1 − 1/e)  < fℓ ≤ 1 − 1e :  1/e − η (0.1484 + 0.5803) 1/e  Here, the ratio is ((1 − (fℓ + η))(P1 + P2 ) + (2(fℓ + η) − 1)Pb )/fℓ , where the WS is for an edge e with fℓ = 1 − 1/e. This follows because of the fact that it is a decreasing function 10 with respect to fℓ . To see that it is a decreasing function, note that it can be rearranged as (P1 + P2 − Pb + η(2Pb − P1 − P2 ) + fℓ (2Pb − P1 − P2 ))/fℓ . Substituting the appropriate values, we have that the value of (2Pb − P1 − P2 ) = 0.535. Hence, the expression can be written as (c1 + 0.535fℓ )/fℓ . If we show that c1 ≥ 0, we are done. The optimal value of η we choose turns out to be 0.0142. Hence we have c1 = P1 + P2 − Pb + 0.0142 · 0.535 = 0.1048 > 0. Choosing the optimal value of η = 0.0142, yields an overall competitive ratio of 0.7 for this new algorithm. We now need to show that this value of η ensures that both fℓ and fs are less than 1 after modification. Since fℓ ≤ 1 − 1/e we have that fℓ + η ≤ 1 − 1/e + 0.0142 ≤ 1. Note that fℓ ≥ 1/2. Hence, the modified value of fs is always less than or equal to the original value, ℓ +η) is decreasing in the range fℓ ∈ [1/2, 1 − 1/e] and has a value less than 0.98 at since 1−(f 1−fℓ fℓ = 1/2. 3.3 A 0.705-competitive algorithm. In the next few subsections, we describe our final edge-weighted algorithm with all of the attenuation factors. To keep it modular, we give the following guide to the reader. We note that the definition of large and small edges given below in Subsection 3.3.1 is different from the definition in the previous subsection. • Section 3.3.1 describes the main algorithm which internally invokes two algorithms, EW1 and EW2 , which are described in sections 3.3.2 and 3.3.3, respectively. • Theorem 2 proves the final competitive ratio. This proof depends on the performance guarantees of EW1 and EW2 , which are given by Lemmas 2 and 3, respectively. • The proof of Lemma 2 depends on claims 4, 5, and 6 (Found in the Appendix). Each of those claims is a careful case-by-case analysis. Intuitively, 4 refers to the case where the offline vertex u is incident to one large edge and one small edge (here the analysis is for the large edge), 5 refers to the case where u is incident to three small edges and 6 refers to the case where u is incident to a small edge and large edge (here the analysis is for the small edge). • The proof of Lemma 3 depends on claims 7 and 8 (Found in the Appendix). Again, both of those claims are proven by a careful case-by-case analysis. Since there are many cases, we have given a diagram of the cases when we prove them. 3.3.1 A 0.705-competitive algorithm. In this section, we describe an algorithm EW (Algorithm 2), that achieves a competitive ratio of 0.705. The algorithm first solves the benchmark LP in subsection 2.1 and obtains a fractional optimal solution f. By invoking DR[f, 3], it obtains a random integral solution F. Notice that from LP constraint 4 we see fe ≤ 1 − 1/e ≤ 2/3. Therefore after DR[f, 3], each Fe ∈ {0, 1, 2}. Consider the graph GF where each edge e is associated with the value of Fe . We say an edge e is large if Fe = 2 and small if Fe = 1 (note that this differs from the definition of large and small in Subsection 3.2). We design two non-adaptive algorithms, denoted by EW1 and EW2 , which take the sparse graph GF as input. The difference between the two algorithms EW1 and EW2 is that EW1 favors the small 11 edges while EW2 favors the large edges. The final algorithm is to take a convex combination of EW1 and EW2 i.e. run EW1 with probability q and EW2 with probability 1 − q. Algorithm 2: EW[q] 1 2 3 Solve the benchmark LP in sub-section 2.1 for the input. Let f be the optimal solution vector. Invoke DR[f, 3] to obtain the vector F. Independently run EW1 and EW2 with probabilities q and 1 − q respectively on GF . The details of algorithm EW1 and EW2 and the proof of Theorem 2 are presented in the following sections. 3.3.2 Algorithm EW1 . In this section, we describe the randomized algorithm EW1 (Algorithm 3). Suppose we view the graph of GF in another way where each edge has Fe copies. Let PM[F, 3] refer to the process of constructing the graph GF with Fe copies of each edge, decomposing it into three matchings, and randomly permuting the matchings. EW1 first invokes PM[F, 3] to obtain a random ordered triple of matchings, say [M1 , M2 , M3 ]. Notice that from the LP constraint 4 and the properties of DR[f, 3] and PM[F, 3], an edge will appear in at most two of the three matchings. For a small edge e = (u, v) in GF , we say e is of type Γ1 if u has two other neighbors v1 and v2 in GF with F(u,v1 ) = F(u,v2 ) =1. We say e is of type Γ2 if u has exactly one other neighbor v1 with F(u,v1 ) = 2. WLOG we can P assume that for every u, Fu = e∈∂(u) Fe = 3; otherwise, we can add a dummy node v ′ to the neighborhood of u. Note, we use the terminology, assign v to u to denote that edge (u, v) is matched by the algorithm if u is not matched until that step. Algorithm 3: EW1 [h] 1 2 3 4 5 Invoke PM[F, 3] to obtain a random ordered triple matchings, say [M1 , M2 , M3 ]. When a vertex v comes for the first time, assign v to some u1 with (u1 , v) ∈ M1 . When v comes for the second time, assign v to some u2 with (u2 , v) ∈ M2 . When v comes for the third time, if e is either a large edge or a small edge of type Γ1 then assign v to some u3 with e = (u3 , v) ∈ M3 . However, if e is a small edge of type Γ2 then with probability h, assign v to some u3 with e = (u3 , v) ∈ M3 ; otherwise, do nothing. When v comes for the fourth or more time, do nothing in that step. Here, h is a parameter we will fix at the end of analysis. Let R[EW1 , 1/3] and R[EW1 , 2/3] be the competitive ratio for a small edge and large edge respectively. Lemma 2. For h = 0.537815, EW1 achieves a competitive ratio R[EW1 , 2/3] = 0.679417, R[EW1 , 2/3] = 0.751066 for a large and small edge respectively. Proof. In case of the large edge e, we divide the analysis into three cases where each case corresponds to e being in one of the three matchings. And we combine these conditional probabilities using Bayes’ theorem to get the final competitive ratio for e. For each of the two types of small edges, 12 we similarly condition them based on the matching they can appear in, and combine them using Bayes’ theorem. A complete version of proof can be found in Section A.1.1 of Appendix. 3.3.3 Algorithm EW2 . Algorithm EW2 (Algorithm 5) is a non-adaptive algorithm which takes GF as input and performs well on the large edges. Recall that the previous algorithm, EW1 , first invokes PM[F, 3] to obtain a random ordered triple of matchings. In contrast, EW2 will invoke a routine, denoted by PM∗ [F, 2] (Algorithm 4), to generate a (random ordered) pair of pseudo-matchings from F. Recall that F is an integral solution vector where ∀e we have Fe ∈ {0, 1, 2}. WLOG, we can assume that Fv = 1 for every v in GF ; otherwise we can dummy vertex to ensure this is the case. Algorithm 4: PM∗ [F, 2][y1 , y2 ] 1 2 Suppose v has two neighbors in GF , say u1 , u2 , with e1 = (u1 , v) being a large edge while e2 = (u2 , v) being a small edge. Add e1 to the primary matching M1 and e2 to the secondary matching M2 . Suppose v has three neighbors in GF and the incident edges are ∂(v) = (e1 , e2 , e3 ). Take a random permutation of ∂(v), say (π1 , π2 , π3 ) ∈ Π(∂(v)). Add π1 to M1 with probability y1 and π2 to M2 with probability y2 . Here 0 ≤ y1 , y2 ≤ 1 are parameters which will be fixed after the analysis. Algorithm 5 describes EW2 . Algorithm 5: [EW2 ][y1 , y2 ] 1 2 3 Invoke PM∗ [F, 2][y1 , y2 ] to generate a random ordered pair of pseudo-matchings, say [M1 , M2 ]. When a vertex v comes for the first time, assign v to some u1 if (u1 , v) ∈ M1 ; When v comes for the second time, try to assign v to some u2 if (u2 , v) ∈ M2 . When a vertex v comes for the third or more time, do nothing in that step. Let R[EW2 , 1/3] and R[EW2 , 2/3] be the competitive ratios for small edges and large edges, respectively. Lemma 3. For y1 = 0.687 and y2 = 1, EW2 [y1 , y2 ] achieves a competitive ratio of R[EW2 , 2/3] = 0.8539 and R[EW2 , 1/3] = 0.4455 for a large and small edge respectively. Proof. We analyze this on a case-by-case basis by considering the local neighborhood of the edge. A large edge can have two possible cases in its neighborhood, while a small edge can have eight possible cases. This is because of the fact that a large edge can have only small edges in its neighborhood while a small edge can have both large and small edges in its neighborhood. Choosing the worst case among the two for large edge and the worst case among the eight for the small edge, we prove the claim. Complete details of the proof can be found in section A.1.2 of Appendix. 3.3.4 Convex combination of EW1 and EW2 . In this section, we prove theorem 2. 13 Proof. Let (a1 , b1 ) be the competitive ratios achieved by EW1 for large and small edges, respectively. Similarly, let (a2 , b2 ) denote the same for EW2 . We have the following two cases. • 0 ≤ fe ≤ 31 : By marginal distribution property of DR[f, 3], we know that Pr[Fe = 1] = 3fe . Thus, the final ratio is 3fe (qb1 /3 + (1 − q)b2 /3)/fe = qb1 + (1 − q)b2 • 1/3 ≤ fe ≤ 1 − 1/e: By the same properties of DR[f, 3], we know that Pr[Fe = 2] = 3fe − 1 and Pr[Fe = 1] = 2 − 3fe . Thus, the final ratio is   (3fe − 1)(2qa1 /3 + 2(1 − q)a2 /3) + (2 − 3fe )(qb1 /3 + (1 − q)b2 /3) /fe The competitive ratio of the convex combination is maximized at q = 0.149251 with a value of 0.70546. 4 Vertex-weighted stochastic I.I.D. matching with integral arrival rates. In this section, we consider vertex-weighted online stochastic matching on a bipartite graph G under the known I.I.D. model with integral arrival rates. We present an algorithm in which each offline vertex u has a competitive ratio of at least 0.72998 > 1 − 2e−2 . Recall that after invoking DR[f, 3], we can obtain a (random) integral vector F with Fe ∈ {0, 1, 2}. Define H = F/3 and let GH be the graph induced by H. Each edge e in GH thus takes a value He ∈ {0, 1/3, 2/3}. Notice . P that for each u, Hu = e∈∂(u) He ≤ 1, which implies that u has at most 3 neighbors in GH (we ignore all edges e with He = 0). In this section, we focus on the sparse graph GH . The main idea of our algorithm is as follows. 1. Solve the vertex-weighted benchmark LP in Section 2.1. Let f be an optimal solution vector. 2. Invoke DR[f, 3] to obtain an integral vector F and a fractional vector H with H = F/3. 3. Apply a series of modifications to H and transform it to another solution H′ (See Section 4.2). 4. Run the Randomized List Algorithm [13] based on H′ , denoted by RLA[H′ ], on the graph GH . We first briefly describe how we overcome the bottleneck case for the algorithm in [13] and then explain the algorithm in full detail. The WS for the vertex-weighted case in [13] is shown in Figure 2, which happens at a node u with a competitive ratio of 0.725 (recall that [13] analyze their algorithm by considering cases for various neighborhood structure at a given offline vertex). From the analysis of [13], we have that the node u1 (in Figure 2) has a competitive ratio of at least 0.736. Hence, we can boost the performance of u at the cost of u1 . Specifically, we increase the value of H(u,v1) and decrease the value H(u1 ,v1 ) . Cases (10) and (11) in Figure 4 illustrate this. After this modification, the new WS for vertex-weighted is now the C1 cycle shown in both Figures 1 and 2. 14 In fact, this is the WS for the unweighted case in [13] as well. However, Lemma 4 implies that C1 cycles can be avoided with probability at least 3/e − 1. This helps us improve the ratio even for the unweighted case in [13]. Lemma 4 describes this formally. Lemma 4. For any given u ∈ U , u appears in a C1 cycle after DR[f, 3] with probability at most 2 − 3/e. Proof. Consider the graph GH obtained after DR[f, 3]. Notice that for some vertex u to appear in a C1 cycle, it must have a neighboring edge with He = 2/3. Now we try to bound the probability of this event. It is easy to see that for some e ∈ ∂(u) with fe ≤ 1/3, Fe ≤ 1 after DR[f, 3], and hence He = Fe /3 ≤ 1/3. Thus only those edges e ∈ ∂(u) with fe > 1/3 will possibly be rounded P to He = 2/3. Note that, there can be at most two such edges in ∂(u), since e∈∂(u) fe ≤ 1. Hence, we have the following two cases. • Case 1: ∂(u) contains only one edge e with fe > 1/3. Let q1 = Pr[He = 1/3] and q2 = Pr[He = 2/3] after DR[f, 3]. By DR[f, 3], we know that E[He ] = E[Fe ]/3 = q2 (2/3) + q1 (1/3) = fe . Notice that q1 + q2 = 1 and hence q2 = 3fe − 1. Since this is an increasing function of fe and fe ≤ 1 − 1/e from LP constraint 4, we have q2 ≤ 3(1 − 1/e) − 1 = 2 − 3/e. • Case 2: ∂(u) contains two edges e1 and e2 with fe1 > 1/3 and fe2 > 1/3. Let q2 be the probability that after DR[f, 3], either He1 = 2/3 or He2 = 2/3. Note that, these two events are mutually exclusive since Hu ≤ 1. Using the analysis from case 1, it follows that q2 = (3fe1 − 1) + (3fe2 − 1) = 3(fe1 + fe2 ) − 2. From LP constraint 5, we know that fe1 + fe2 ≤ 1 − 1/e2 , and hence q2 ≤ 3(1 − 1/e2 ) − 2 < 2 − 3/e. Now we present the details of RLA based on a given H′ in Section 4.1 and then discuss the two modifications transforming H to H′ in Section 4.2. We give a formal statement of our algorithm in Section 4.3 and the related analysis. 4.1 RLA algorithm. Now we discuss how to apply RLA based on H′ to the sparse graph GH . Let δH (v) be the set . P of neighboring nodes of v in GH . Here we assume WLOG that Hv = e∈∂(v) He = 1 and thus each v has at least 2 neighbors in GH since each non-zero He satisfies He ∈ {1/3, 2/3} (we are in a better situation when Hv < 1). Additionally, we will see in Section 4.2 that during the two modifications, we have the sum of all edge values incident to v (i.e., Hv ) unchanged and hence we have H′v = Hv = 1 for each v. Each time when a vertex v comes, RLA first generates a random list Rv , which is a permutation over δH (v), based on H′ as follows. • If |δH (v)| = 2, say δH (v) = (u1 , u2 ), then sample a random list Rv such that ′ ′ Pr[Rv = (u1 , u2 )] = H(u , Pr[Rv = (u2 , u1 )] = H(u 1 ,v) 2 ,v) 15 (7) • If |δH (v)| = 3, say δH (v) = (u1 , u2 , u3 ). Then we sample a permutation of (i, j, k) over {1, 2, 3} such that ′ H(u j ,v) ′ (8) Pr[Rv = (ui , uj , uk )] = H(ui ,v) ′ ′ H(uj ,v) + H(u k ,v) We can verify that the sampling distributions described in Equations (7) and (8) are valid since P H′v = e∈∂(v) He′ = 1. The full details of the Random List Algorithm, RLA[H′ ], are shown in Algorithm 6. Algorithm 6: RLA[H′ ] (Random List Algorithm based on H′ ) 1 2 4.2 When a vertex v comes, generate a random list Rv satisfying Equation (7) or (8) If all u in the list are matched, then drop the vertex v; otherwise, assign v to the first unmatched u in the list. Two kinds of modifications to H. As stated earlier, we first modify H before running the RLA algorithm. In this section, we describe the modifications. 4.2.1 The first modification to H (C1 ) (WS) 1 u1 1 u (C2 ) (C3 ) u1 v1 u1 v1 u1 v1 u2 v2 u2 v2 u2 v2 u1 v1 u1 v1 u2 v2 u2 v2 v1 v2 1 u2 1 u3 Figure 2: Left: The WS for Jaillet and Lu [13] for their vertex-weighted case. Right: The three possible types of cycles of length 4 after applying DR[f, 3]. Thin edges have He = 1/3 and thick edges have He = 2/3. The first modification is to break the cycles deterministically. There are three possible cycles of length 4 in the graph GH , denoted C1 , C2 , and C3 . In [13], they give an efficient way to break C2 and C3 , as shown in Figure 2. Cycle C1 cannot be modified further and hence, is the bottleneck for their unweighted case. Notice that, while breaking the cycles of C2 and C3 , new cycles of C1 can be created in the graph. Since our randomized construction of solution H gives us control on the probability of cycles C1 occurring, we would like to break C2 and C3 in a controlled way, so as not to create any new C1 cycles. This procedure is summarized in Algorithm 7 and its correctness is proved in Lemma 6. 16 Algorithm 7: [Cycle breaking algorithm] Offline Phase 1 2 3 While there is some cycle of type C2 or C3 , Do: Break all cycles of type C2 . Break one cycle of type C3 and return to the first step. Lemma 5. After applying Algorithm 7 to GH , we have (1) the value Hw is preserved for each w ∈ U ∪ V ; (2) no cycle of type C2 or C3 exists; (3) no new cycle of type C1 is added. Proof of Lemma 5. Lemma 5 follows from the following three Claims: Claim 1. Breaking cycles will not change the value Hw for any w ∈ U ∪ V . Claim 2. After breaking a cycle of type C2 , the vertices u1 , u2 , v1 , and v2 can never be part of any length four cycle. Claim 3. When all length four cycles are of type C1 or C3 , breaking exactly one cycle of type C3 cannot create a new cycle of type C1 . Proof of Claim 1. As shown in Figure 2, we increase and decrease edge values fe in such a way that their sums Hw at any vertex w will be preserved. Notice that C2 cycles can be freely broken without creating new C1 cycles. After removing all cycles of type C2 , removing a single cycle of type C3 cannot create any cycles of type C1 . Hence, Algorithm 7 removes all C2 and C3 cycles without creating any new C1 cycles. Proof of Claim 2. Consider the structure after breaking a cycle of type C2 . Note that the edge (u2 , v2 ) has been permanently removed and hence, these four vertices together can never be part of a cycle of length four. The vertices u1 and v1 have Hu1 = 1 and Hv1 = 1 respectively. So they cannot have any other edges and therefore cannot appear in any length four cycle. The vertices u2 and v2 can each have one additional edge, but since the edge (u2 , v2 ) has been removed, they can never be part of any cycle with length less than six. Proof of Claim 3. First, we note that since no edges will be added during this process, we cannot create a new cycle of length four or join with a cycle of type C1 . Therefore, the only cycles which could be affected are of type C3 . However, every cycle c of type C3 falls into one of two cases: Case 1: c is the cycle we are breaking. In this case, c cannot become a cycle of type C1 since we remove two of its edges and break the cycle. Case 2: c is not the cycle we are breaking. In this case, c can have at most one of its edges converted to a 2/3 edge. Let c′ be the length four cycle we are breaking. Note that c and c′ will differ by at least one vertex. When we break c′ , the two edges which are converted to 2/3 will cover all four vertices of c′ . Therefore, at most one of these edges can be in c. Note that breaking one cycle of type C3 could create cycles of type C2 , but these cycles are always broken in the next iteration, before breaking another cycle of type C3 . 4.2.2 The Second modification to H. Informally, this second modification decreases the rates of lists associated with those nodes u with Hu = 1/3 or Hu = 2/3 and increases the rates of lists associated with nodes u with Hu = 1. We will illustrate our intuition on the following example. 17 1/3 u1 v1 1 1/3 u1 u 0.1 v1 v2 2/3 u2 1 u 0.9 Figure 3: An example of the need for the second modification. For the left: competitive analysis shows that in this case, u1 and u2 can achieve a high competitive ratio at the expense of u. For the right: an example of balancing strategy by making v1 slightly more likely to pick u when it comes. Consider the graph G in Figure 3. Let thin and thick edges represent He = 1/3 and He = 2/3 respectively. We will now calculate the competitive ratio after applying RLA on G. Let Pu denote the probability that u gets matched after the algorithm. Let Bu denote the event that among the n random lists, there exists a list starting with u and Gvu denote the event that among the n lists, there exists successive lists such that (1) Each of those lists starts with a u′ 6= u and u′ ∈ δ(v) and (2) The lists arrive in an order which ensures u will be matched by the algorithm. From lemma 4 and Corollary 1 in [13], the following lemma follows: Lemma 6. Suppose u is not a part of any cycle of length 4. We have Pu = 1 − (1 − Pr[Bu ]) Y v∼u (1 − Pr[Gvu ]) + o(1/n) For the node u, we have Pr[Bu ] = 1 − e−1 . From definition, Gvu1 is the event that among the n lists, the random list Rv1 = (u1 , u) comes at least twice. Notice that the list Rv1 = (u1 , u) comes 1 with probability 3n . Thus we have Pr[Gvu1 ] = Pr[X ≥ 2] = 1 − e−1/3 (1 + 1/3), where X ∼ Pois(1/3). 20 Similarly, we can get Pr[Gvu2 ] = 1 − e−2/3 (1 + 2/3) and the resultant Pu = 1 − 9e 2 ∼ 0.699. Observe −1/3 −2/3 that Pu1 ≥ Pr[Bu1 ] = 1 − e and Pu2 ≥ Pr[Bu2 ] = 1 − e . Let R[RLA, 1], R[RLA, 1/3] and R[RLA, 2/3] be the competitive ratio achieved by RLA for u, u1 and u2 respectively. Hence, we have R[RLA, 1] ∼ 0.699 while R[RLA, 1/3] ≥ 3(1 − e−1/3 ) ∼ 0.8504 and R[RLA, 2/3] ≥ 0.729. Intuitively, one can improve the worst case ratio by increasing the arrival rate for Rv1 = (u, u1 ) ′ while reducing that for Rv1 = (u1 , u). Suppose one modifies H(u1 ,v1 ) and H(u,v1 ) to H(u = 0.1 1 ,v1 ) ′ and H(u,v1 ) = 0.9, the arrival rate for Rv1 = (u, u1 ) and Rv1 = (u1 , u) gets modified to 0.1/n and 0.9/n respectively. The resulting changes are Pr[Bu ] = 1 − e−0.9−1/3 , Pr[Gvu1 ] = 1 − e−0.1 (1 + 0.1), R[RLA, 1] = 0.751, Pr[Bu1 ] = 1 − e−1/3 , Pr[Gvu11 ] ∼ 0.227 and R[RLA, 1/3] ≥ 0.8. Hence, the ′ performance on WS instance improves. Notice that after the modifications, Hu′ = H(u,v +H(u,v2 ) = 1) 0.9 + 1/3. Figure 4 describes the various modifications applied to H vector. The values on top of the edge, denote the new values. Cases (11) and (12) help improve upon the WS described in Figure 2. 4.3 4.3.1 Vertex-Weighted Algorithm VW Analysis of algorithm VW. The full details of our vertex-weighted algorithm are stated as follows. 18 1/3 u1 2/3 u1 0.1 v 1 u2 0.9 1 u2 1 u3 0.2 0.4 1 u2 1/3 u1 0.4 2/3 u2 1 u3 (5) 2/3 u1 2/3 u1 0.3 2/3 u2 0.7 1 (9) 0.85 1 u2 0.15 0.2 1/3 u1 v 1/3 u2 0.65 u3 0.25 0.25 1 u2 1 u3 0.4 (3) 1 u3 (6) v 2/3 u2 v (2) v 1/3 u1 0.6 v (1) 2/3 u1 2/3 u1 0.15 0.1 0.1 u1 v 1/3 u1 1 0.5 0.75 (8) 1 u1 v 1 − x2 x2 1 (11) (10) 0.25 v 2/3 u2 1 − x1 u2 0.45 v 0.8 x1 v (4) (7) 1 0.1 0.45 v u2 (12) Figure 4: Illustration for second modification to H. The value assigned to each edge represents the value after the second modification. Here, x1 = 0.2744 and x2 = 0.15877. Algorithm 8: VW 1 Construct and solve the LP in sub-section 2.1 for the input instance. 2 Invoke DR[f, 3] to output F and H. Apply the two kinds of modifications to morph H to H′ . ′ 3 Run RLA[H ] on the graph GH . The algorithm VW consists of two different random processes: sub-routine DR[f, 3] in the offline phase and RLA in the online phase. Consequently, the analysis consists of two parts. First, for a given graph GH , we analyze the ratio of RLA[H′ ] for each node u with Hu = 1/3, Hu = 2/3 and Hu = 1. The analysis is similar to [13]. Second, we analyze the probability that DR[f, 3] transforms each u, with fractional fu values, into the three discrete cases seen in the first part. By combining the results from these two parts we get the final ratio. Let us first analyze the competitive ratio for RLA[H′ ]. For a given H and GH , let Pu be the probability that u gets matched in RLA[H′ ]. Notice that the value Pu is determined not just by the algorithm RLA itself, but also the modifications applied to H. We define the competitive ratio of a vertex u achieved by RLA as Pu /Hu , after modifications. Lemma 7 gives the respective ratio values. The proof can be found in section A.2.1 in the Appendix. Lemma 7. Consider a given H and a vertex u in GH . The respective ratios achieved by RLA after the modifications are as described below. 19 • If Hu = 1, then the competitive ratio R[RLA, 1] = 1 − 2e−2 ∼ 0.72933 if u is in the first cycle C1 and R[RLA, 1] ≥ 0.735622 otherwise. • If Hu = 2/3, then the competitive ratio R[RLA, 2/3] ≥ 0.7847. • If Hu = 1/3, then competitive ratio R[RLA, 1/3] ≥ 0.7622. Now we have all essentials to prove Theorem 1. Proof. From Lemmas 4 and 5, we know that any u is present in cycle C1 with probability at most (2 − 3/e). Consider a node u with 2/3 ≤ fu ≤ 1 and let q1 , q2 , q3 be the probability that after DR[f, 3] and the first modification, Hu = 1 and u is in the first cycle C1 , Hu = 1 and u is not in C1 , Hu = 2/3 respectively. From Lemma 7, we get that the final ratio for u should be at least (0.72933q1 + 0.735622q2 + (2/3) ∗ 0.7847q3 )/(q1 + q2 + (2/3)q3 ) Minimizing the above expression subject to (1) q1 + q2 + q3 = 1; (2) 0 ≤ qi , 1 ≤ i ≤ 3; (3) q1 ≤ 2 − 3/e, we get a minimum value of 0.729982 for q1 = 2 − 3/e and q2 = 3/e − 1. For any node u with 0 ≤ u ≤ 2/3, we know that the ratio is at least the min value of R[RLA, 2/3] and R[RLA, 1/3], which is 0.7622. This completes the proof of Theorem 1. 5 Non-integral arrival rates with stochastic rewards. The setting here is strictly generalized over the previous sections in the following ways. Firstly, it allows an arbitrary arrival rate (say rv ) which can be fractional for each stochastic vertex v. P Notice that, v rv = n where n is the total number of rounds. Secondly, each e = (v, u) ∈ E is associated with a value pe , which captures the probability that the edge e = (u, v) is present when we probe it, i.e., we try to assign v to u. We assume this process is independent of the stochastic arrival of each v. We will show that the simple non-adaptive algorithm introduced in [12] can be extended to this general case. This achieves a competitive ratio of (1 − 1e ). Note that Manshadi et al. [19] show that no non-adaptive algorithm can possibly achieve a ratio better than (1 − 1/e) for the non-integral arrival rates, even for the case of all pe = 1. Thus, our algorithm is an optimal non-adaptive algorithm for this model. We use an LP similar to [13] for the case of non-integral arrival rates. For each e = (u, v) ∈ E, let fe be the expected number of probes on edge e. When there are multiple copies of v, we count the sum of probes among all copies of e in the offline optimal and thus some realizations of fe can be greater than 1. max X we fe pe : (9) e∈E s.t. X fe pe ≤ 1, X f e ≤ rv , e∈∂(u) e∈∂(v) 20 ∀u ∈ U ∀v ∈ V (10) (11) Our algorithm is summarized in Algorithm 9. Notice that the last constraint ensures that step 2 in the algorithm is valid. Let us now prove theorem 3. Algorithm 9: SM 1 2 Construct and solve LP (9). WLOG assume {fe |e ∈ E} is an optimal solution. When a vertex v arrives, assign v to each of its neighbors u with a probability f(u,v) rv . Proof. Let B(u, t) be the event that u is safe at beginning of round t and A(u, t) to be the event that vertex u is matched during the round t conditioned on B(u, t). From the algorithm, we know Pr[A(u, t)] ≤ P v∼u rv fu,v n rv p e ≤ n1 , which follows by P r[B(u, t)] = Pr i hV t−1  i=1 (¬A(u, i)) ≥ 1 − 1 n t−1 . Consider an edge e = (u, v) in the graph. Notice that the probability that e gets matched in SM should be Pr[e is matched] = ≥ 6 n X Pr[v arrives at t and B(u, t) ] · t=1 n  X t=1 1 1− n t−1 f e pe rv 1 rv fe pe ≥ 1− f e pe n rv e   Integral arrival rates with uniform stochastic rewards. In this section, we consider a special case of the model studied in Section 5 and show that we can indeed surpass the 1 − 1/e barrier. We specialize the model in the following two ways. (1) We consider the unweighted case with uniform constant edge probabilities (i.e., we = 1 and pe = p for some constant p ∈ (0, 1] for all e ∈ E). The constant p is arbitrary, but independent of the problem parameters. (2) Each vertex v that comes online has an integral arrival rate rv (as usual WLOG rv = 1 and |V | = n). We refer to this special model as unweighted online stochastic matching with integral arrival rates and uniform stochastic rewards. Note that even for this special case, given an offline instance (i.e., the sequence of realizations for the online arrival), it is unclear if we can efficiently solve or approximate the exact offline optimal within (1 − ǫ) without any extra assumptions. Hence we cannot directly apply the Monte-Carlo simulation technique in [19] to approximate the exact expected offline optimal within an arbitrary desired accuracy. Here we present a strengthened LP as the benchmark to upper bound the offline optimal. max p · s.t. X fe : (12) e∈E X fe · p ≤ 1, ∀u ∈ U (13) X fe ≤ 1, ∀v ∈ V (14) fe p ≤ 1 − exp(−|S|p), ∀S ⊆ ∂(u), |S| ≤ 2/p (15) e∈∂(u) e∈∂(v) X S⊆∂(u) 21 Lemma 8. LP (12) is a valid upper bound for the expected offline optimal. Proof. It suffices to show that the constraint (15) is valid (the correctness of the other constraints follows from the previous section). Consider a given S ⊆ ∂(u). Let X(I) be the number of copies of all edges in S in an offline instance I and Y (I) be the probability that any edge in S is included in an offline optimal on I. From a straightforward calculation, it follows that Y (I) ≤ 1 − (1 − p)X(I) and using linearity of expectation we get, E[Y (I)] ≤ 1 − E[(1 − p)X(I) ] By definition we have E[Y (I)] = e∈S fe · p. Since n is assumed to be sufficiently large, X(I) follows a Poisson distribution with mean |S|. Substituting the fact that E[(1 − p)X(I) ] = exp(−p|S|) into the equation above, we prove the lemma. P Note that it is impossible to beat 1 − 1/e using LP (12) as the benchmark without the extra constraint (15) (see the hardness instance shown in [5]). Our main idea in the online phase is primarily based on [19]. In the offline phase, we first solve LP (12) and get an optimal solution {fe∗ }. When a vertex v arrives, we generate a random list of two choices based on {fe∗ |e ∈ ∂(v)}, denoted by Lv = (Lv (1), Lv (2)), where Lv (1), L(2) ∈ ∂(v). Our online decision based on Lv is as follows: if Lv (1) = (u, v) is safe, i.e., u is available, then match v to u; else if the second choice Lv (2) is safe match v to Lv (2). The random list Lv generated based on {fe∗ |e ∈ ∂(v)} satisfies the following two properties: (P1) : Pr[Lv (1) = e] = fe∗ and Pr[Lv (2) = e] = fe∗ for each e ∈ ∂(v).   (P2) : Pr[Lv (1) = e ∧ Lv (2) = e] = max 2fe − 1, 0 for each e ∈ ∂(v). Algorithm 10: 1 2 3 Solve LP (12) and let {fe∗ |e ∈ E} be an optimal solution. When a vertex v arrives, generate a random list Lv of two choices based on {fe∗ |e ∈ ∂(v)} such that Lv satisfies Property (P1) and (P2). If Lv (1) = (u, v) is safe, i.e., u is available, then assign v to u; else if the second choice Lv (2) is safe, match v to it. There are several ways to generate Lv satisfying (P1) and (P2). One simple way is shown in Section 4 of [19]. We can verify that all of the calculations shown in [19] can be extended here if we incorporate the independent process that each e will be present with probability p after we assign v to u. Hence, the final ratio is as follows (this can be viewed as a counterpart to Equation (15) on page 11 of [19]).  E[ALG]  ≥ min  u∈U E[OPT] where fu′ = that ′ (1 − e−fu ) + qu′ e−2 − (qu′ )2 e−1 fu′ ′ ∗ e∈∂(u) fe · p ≤ 1 and qu = p · P qu′ ≤ p ·  X e=(u,v)∈∂(u) P  1 2   . ′ ′  = F (fu , qu )  (16) e=(u,v)∈∂(u) Pr[Lv (2) = e ∧ Lv (1) 6= e] . Observe  Pr[Lv (2) = e] = p · 22  − e−1 − e−2 fu′ (1 − fu′ )  X e∈∂(u)  fe∗ = fu′ ≤ 1 We can verify that for each given fu′ ≤ 1, the RHS expression in inequality (16) is an increasing function of qu′ during the interval [0, 1]. Thus an important step is to lower bound qu′ for a given fu′ . The following key lemma can be viewed as a counterpart to Lemma 4.7 of [19]: Lemma 9. For each given fu′ ≥ ln 2/2, we have that qu′ ≥ fu′ − (1 − ln 2). Proof. Consider a given u with fu′ ≥ ln 2/2. Define ∆ = fu′ − qu′ . Thus we have: ∆=p· =p· =p· =p· X e=(u,v)∈∂(u)  fe∗ − Pr[Lv (2) = e ∧ Lv (1) 6= e] X e=(u,v)∈∂(u)  Pr[Lv (2) = e] − Pr[Lv (2) = e ∧ Lv (1) 6= e] X  Pr[Lv (2) = e ∧ Lv (1) = e] e=(u,v)∈∂(u) X e∈∂(u)   From Property P1    max 2fe∗ − 1, 0 From Property P2 Thus to lower bound qu′ , we essentially need to maximize ∆. Let S ∗ ⊆ ∂(u) be the set of edges in ∂(u) with fe∗ ≥ 1/2, which is called a contributing edge. Thus we have ∆=p· Observe that X e∈∂(u)   max 2fe∗ − 1, 0 = p · X e∈S ∗ (2fe∗ − 1) = X e∈S ∗ 2pfe∗ − p|S ∗ | X 2f ′ 2 p ∗ |S | ≤ fe∗ · p ≤ fu′ ⇒ |S ∗ | ≤ u ≤ 2 p p e∈S ∗ From Constraint (15), we have into Equation (17), we get P ∗ e∈S ∗ (pfe ) (17) (18) ≤ 1 − exp(−|S ∗ |p). Substituting this inequality back ∆ ≤ 2 − 2 exp − |S ∗ | · p − |S ∗ | · p  It is easy to verify that when fu′ ≥ ln 2/2, the above expression has a maximum value of 1 − ln 2 when |S ∗ | · p = ln 2. Thus we have that ∆ ≤ 1 − ln 2 and qu′ ≥ fu′ − (1 − ln 2). Let us now complete the proof of Theorem 4. Proof. We need to prove that F (fu′ , qu′ ) defined in 16 has a lower bound of 0.702 for all fu′ ∈ [0, 1]. Consider the first case when fu′ ≤ ln 2/2. It is easy to verify that F (fu′ , qu′ ) ≥ F (fu′ , 0) ≥ F (ln 2/2, 0) ∼ 0.8. Consider the second case when fu′ ≥ ln 2/2. From Lemma 9, we have qu′ ≥ fu′ − (1 − ln 2). Once again, simple calculations show that F (fu′ , qu′ ) ≥ F fu′ , fu′ − (1 − ln 2) ≥ F (1, 1 − (1 − ln 2)) ∼ 0.702  23 7 Conclusion and future directions. In this paper, we gave improved algorithms for the Edge-Weighted and Vertex-Weighted models. Previously, there was a gap between the best unweighted algorithm with a ratio of 1 − 2e−2 due to [13] and the negative result of 1 − e−2 due to [19]. We took a step towards closing that gap by showing that an algorithm can achieve 0.7299 > 1 − 2e−2 for both the unweighted and vertexweighted variants with integral arrival rates. In doing so, we made progess on Open Questions 3 and 4 in the online matching and ad allocation survey [20]. This was possible because our approach of rounding to a simpler fractional solution allowed us to employ a stricter LP. For the edgeweighted variant, we showed that one can significantly improve the power of two choices approach by generating two matchings from the same LP solution. For the variant with edge weights, nonintegral arrival rates, and stochastic rewards, we presented a (1 − 1/e)-competitive algorithm. This showed that the 0.62 < 1−1/e bound given in [22] for the adversarial model with stochastic rewards does not extend to the known I.I.D. model. A natural next step in the edge-weighted setting is to use an adaptive strategy. For the vertexweighted problem, one can easily see that the stricter LP we use still has a gap. In addition, we only utilize fractional solutions {0, 1/3, 2/3}. However, dependent rounding gives solutions in {0, 1/k, 2/k, . . . , ⌈k(1 − 1/e)⌉/k}; allowing for random lists of length greater than three. Stricter LPs and longer lists could both yield improved results. In the stochastic model with non  rewards integral arrival rates, an open question is to either improve upon the 1 − 1e ratio in the general case. In this work, we showed how for certain restrictions it is possible to beat 1 − 1/e. However, the serious limitation comes from the fact that a polynomial sized LP is insufficient to capture the complexity of the problem. Acknowledgments. The authors would like to thank Aranyak Mehta and the anonymous reviewers for their valuable comments, which have significantly helped improve the presentation of this paper. References [1] Aggarwal, G., Goel, G., Karande, C., and Mehta, A. Online vertex-weighted bipartite matching and single-bid budgeted allocations. In Proceedings of the twenty-second annual ACM-SIAM symposium on Discrete Algorithms (2011), SIAM, pp. 1253–1264. [2] Alaei, S., Hajiaghayi, M., and Liaghat, V. Online prophet-inequality matching with applications to ad allocation. In Proceedings of the 13th ACM Conference on Electronic Commerce (2012), ACM, pp. 18–35. [3] Alaei, S., Hajiaghayi, M., and Liaghat, V. The online stochastic generalized assignment problem. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques. Springer, 2013, pp. 11–25. [4] Assadi, S., Khanna, S., and Li, Y. The stochastic matching problem with (very) few queries. In Proceedings of the 2016 ACM Conference on Economics and Computation (2016), ACM, pp. 43–60. 24 [5] Brubach, B., Sankararaman, K. A., Srinivasan, A., and Xu, P. Attenuate locally, win globally: An attenuation-based framework for online stochastic matching with timeouts. In Proceedings of the 16th Conference on Autonomous Agents and MultiAgent Systems (Richland, SC, 2017), AAMAS ’17, International Foundation for Autonomous Agents and Multiagent Systems, pp. 1223–1231. [6] Devanur, N. R., and Hayes, T. P. The adwords problem: online keyword matching with budgeted bidders under random permutations. In Proceedings of the 10th ACM conference on Electronic commerce (2009), ACM, pp. 71–78. [7] Devanur, N. R., Jain, K., Sivan, B., and Wilkens, C. A. Near optimal online algorithms and fast approximation algorithms for resource allocation problems. In Proceedings of the 12th ACM conference on Electronic commerce (2011), ACM, pp. 29–38. [8] Devanur, N. R., Sivan, B., and Azar, Y. Asymptotically optimal algorithm for stochastic adwords. In Proceedings of the 13th ACM Conference on Electronic Commerce (2012), ACM, pp. 388–404. [9] Feldman, J., Korula, N., Mirrokni, V., Muthukrishnan, S., and Pál, M. Online ad assignment with free disposal. In Internet and network economics. Springer, 2009, pp. 374–385. [10] Feldman, J., Mehta, A., Mirrokni, V., and Muthukrishnan, S. Online stochastic matching: Beating 1-1/e. In Foundations of Computer Science (FOCS) (2009), IEEE, pp. 117– 126. [11] Gandhi, R., Khuller, S., Parthasarathy, S., and Srinivasan, A. Dependent rounding and its applications to approximation algorithms. Journal of the ACM (JACM) 53, 3 (2006), 324–360. [12] Haeupler, B., Mirrokni, V. S., and Zadimoghaddam, M. Online stochastic weighted matching: Improved approximation algorithms. In Internet and Network Economics, vol. 7090 of Lecture Notes in Computer Science. Springer Berlin Heidelberg, 2011, pp. 170–181. [13] Jaillet, P., and Lu, X. Online stochastic matching: New algorithms with better bounds. Mathematics of Operations Research 39, 3 (2013), 624–646. [14] Karp, R. M., Vazirani, U. V., and Vazirani, V. V. An optimal algorithm for on-line bipartite matching. In Proceedings of the twenty-second annual ACM symposium on Theory of computing (1990), ACM, pp. 352–358. [15] Kesselheim, T., Radke, K., Tönnis, A., and Vöcking, B. An optimal online algorithm for weighted bipartite matching and extensions to combinatorial auctions. In European Symposium on Algorithms (ESA). Springer, 2013, pp. 589–600. [16] Korula, N., and Pál, M. Algorithms for secretary problems on graphs and hypergraphs. In Automata, Languages and Programming. Springer, 2009, pp. 508–520. [17] Lee, Y. T., and Sidford, A. Efficient inverse maintenance and faster algorithms for linear programming. In Foundations of Computer Science (FOCS), 2015 IEEE 56th Annual Symposium on (2015), IEEE, pp. 230–249. 25 [18] Mahdian, M., and Yan, Q. Online bipartite matching with random arrivals: an approach based on strongly factor-revealing LPs. In Proceedings of the forty-third annual ACM symposium on Theory of computing (2011), ACM, pp. 597–606. [19] Manshadi, V. H., Gharan, S. O., and Saberi, A. Online stochastic matching: Online actions based on offline statistics. Mathematics of Operations Research 37, 4 (2012), 559–573. [20] Mehta, A. Online matching and ad allocation. Foundations and Trends in Theoretical Computer Science 8, 4 (2012), 265–368. [21] Mehta, A., and Panigrahi, D. Online matching with stochastic rewards. In Foundations of Computer Science (FOCS) (2012), IEEE, pp. 728–737. [22] Mehta, A., Waggoner, B., and Zadimoghaddam, M. Online stochastic matching with unequal probabilities. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms (2015), SIAM. A Appendix A.1 A.1.1 Complementary materials in section 3 (Edge-weighted model). Proof of Lemma 2 We will prove Lemma 2 using the following three Claims. Recall that we had one kind of large edge, while two kinds of small edges. Hence, the following claim characterizes the performance of each of them. Claim 4. For a large edge e, EW1 [h] (3) with parameter h achieves a competitive ratio of R[EW1 , 2/3] = 0.67529 + (1 − h) ∗ 0.00446. Claim 5. For a small edge e of type Γ1 , EW1 [h] (3) achieves a competitive ratio of R[EW1 , 1/3] = 0.751066, regardless of the value h. Claim 6. For a small edge e of type Γ2 , EW1 [h] (3) achieves a competitive ratio of R[EW1 , 1/3] = 0.72933 + h ∗ 0.040415. By setting h = 0.537815, the two types of small edges have the same ratio and we get that EW1 [h] achieves (R[EW1 , 2/3], R[EW 1 , 1/3]) = (0.679417, 0.751066). Thus, this proves Lemma 2. Proof of Claim 4 Proof. Consider a large edge e = (u, v1 ) in the graph GF . Let e′ = (u, v2 ) be the other small edge incident to u. Edges e and e′ can appear in [M1 , M2 , M3 ] in the following three ways. • α1 : e ∈ M1 , e′ ∈ M2 , e ∈ M3 . 26 • α2 : e′ ∈ M1 , e ∈ M2 , e ∈ M3 . • α3 : e ∈ M1 , e ∈ M2 , e′ ∈ M3 . Notice that the random triple of matchings [M1 , M2 , M3 ] is generated by invoking PM[F, 3]. From the property of PM[F, 3], we know that αi will occur with probability 1/3 for 1 ≤ i ≤ 3. For α1 and α2 , we can ignore the second copy of e in M3 and from Lemma 1 we have Pr[e is matched | α1 ] ≥ 0.580831 and Pr[e is matched | α2 ] ≥ 0.148499 For α3 , we have Pr[e is matched | α3 ] =  n X 1 n 1− n X 1  t=1 + t=1 n +(1 − h) 2 n t−1 +   n X 1 t−1 t=1 (t − 1)(t − 2) 2n2 n 1− n 2 1− n  !   n X t−1 1 1 t=1 n n3 3 2 n t−2 t−3 2 1− n t−4 ≥ 0.621246 + (1 − h) ∗ 0.00892978 Hence, we have Pr[e is matched] = 3 2 1X Pr[e is matched | αi ] ≥ R[EW1 , 2/3] 3 i=1 3 where R[EW1 , 2/3] = 0.67529 + (1 − h) ∗ 0.00446489. Proof of Claims 5 and 6 Proof. Consider a small edge e = (u, v) of type Γ1 . Let e1 and e2 be the two other small edges incident to u. For a given triple of matchings [M1 , M2 , M3 ], we say e is of type ψ1 if e appears in M1 while the other two in the remaining two matchings. Similarly, we define the type ψ2 and ψ3 for the case where e appears in M2 and M3 respectively. Notice that the probability that e is of type ψi , 1 ≤ i ≤ 3 is 1/3. Similar to the calculations in the proof of Claim 4, we have Pr[e is matched| ψ1 ] ≥ 0.571861, Pr[e is matched| ψ2 ] ≥ 0.144776 and Pr[e is matched| ψ3 ] ≥ 0.0344288. Therefore we have Pr[e is matched] = 3 1 1X Pr[e is matched | ψi ] ≥ R[EW1 , 1/3] 3 i=1 3 where R[EW1 , 1/3] = 0.751066. Consider a small edge e = (u, v) of type Γ2 , we define type βi , 1 ≤ i ≤ 3, if e appears in Mi while the large edge e′ incident to u appears in the remaining two matchings. Similarly, we have Pr[e is matched| ψ1 ] ≥ 0.580831, Pr[e is matched| ψ2 ] ≥ 0.148499 and Pr[e is matched| ψ3 ] ≥ h ∗ 0.0404154. Hence, the ratio for a small edge of type Γ2 is R[EW1 , 1/3] = 0.72933 + h ∗ 0.0404154. 27 A.1.2 Proof of Lemma 3 We will prove Lemma 3 using the following two Claims. Claim 7. For a large edge e, EW2 [y1 , y2 ] (5) achieves a competitive ratio of   R[EW2 , 2/3] = min 0.948183 − 0.099895y1 − 0.025646y2 , 0.871245 Claim 8. For a small edge e, EW2 [y1 , y2 ] (5) achieves a competitive ratio of R[EW2 , 1/3] = 0.4455, when y1 = 0.687, y2 = 1. Therefore, by setting y1 = 0.687, y2 = 1 we get that R[EW2 , 2/3] = 0.8539 and R[EW2 , 1/3] = 0.4455, which proves Lemma 3. Proof of Claim 7 Proof. Figure 5 shows the two possible configurations for a large edge. (A) (B) v1 v1 u u v2 v2 Figure 5: Diagram of configurations for a large edge e = (u, v1 ). Thin and Thick lines represent small and large edges respectively. Consider a large edge e = (u, v1 ) with the configuration (A). From PM∗ [F, 2][y1 , y2 ], we know that e will always be in M1 while e′ = (u, v2 ) will be in M1 and M2 with probability y1 /3 and y2 /3 respectively. We now have the following cases • α1 : e ∈ M1 and e′ ∈ M1 . This happens with probability y1 /3 and Pr[e is matched | α1 ] ≥ 0.432332. • α2 : e ∈ M1 and e′ ∈ M2 . This happens with probability y2 /3 and Pr[e is matched | α2 ] ≥ 0.580831. • α3 : e ∈ M1 and e′ 6∈ M1 , e′ 6∈ M2 . This happens with probability (1 − y1 /3 − y2 /3) and Pr[e is matched| α1 ] ≥ 0.632121. 28 Therefore we have y2 Pr[e is matched | α2 ] 3  y1 y2 +(1 − − ) Pr[e is matched | α3 ] 3 3 2 (0.948183 − 0.099895y1 − 0.025646y2 ) ≥ 3 Pr[e is matched] = y 1 3 Pr[e is matched | α1 ] + Consider the configuration (B). From PM∗ [F, 2][y1 , y2 ], we know that e will always be in M1 and e′ = (u, v2 ) will always be in M2 . Thus we have Pr[e is matched] = Pr[e is matched | α2 ] = 2 ∗ 0.871245 3 Hence, this completes the proof of Claim 7. Proof of Claim 8 Proof. Figure 6 shows all possible configurations for a small edge. (1a) (1b) v1 u (2a) v1 (2b) v1 u v2 u v2 v1 u v2 v2 v3 v3 (3a) v1 (3b) v1 (4a) v1 (4b) v1 u v2 u v2 u v2 u v2 v3 v3 v3 v3 Figure 6: Diagram of configurations for a small edge e = (u, v1 ). Thin and Thick lines represent small and large edges respectively. Similar to the proof of Claim 7, we will do a case-by-case analysis on the various configurations. Let ei = (u, vi ) for 1 ≤ i ≤ 3 and E be the event that e1 gets matched. For a given ei , denote ei ∈ M0 if ei ∈ / M1 , ei 6∈ M2 . • (1a). Observe that e1 ∈ M2 and e2 ∈ M1 . Thus we have Pr[E] = 1 3 ∗ 0.44550. • (1b). Observe that we have two cases: {α1 : e2 ∈ M1 , e1 ∈ M1 } and {α2 : e2 ∈ M1 , e1 ∈ M2 }. Case α1 happens with probability y1 /3 and the conditional probability is Pr[E |α1 ] = 0.432332. Case α2 happens with probability y2 /3 and the conditional is Pr[E |α2 ] = 0.148499. Thus we have 1 Pr[E] = y1 /3 ∗ Pr[E |α1 ] + y2 /3 ∗ Pr[E |α2 ] ≥ (0.432332y1 + 0.148499y2 ) 3 29 • (2a). Observe that e1 ∈ M2 , e2 ∈ M2 , e3 ∈ M2 . Pr[E] = 1 3 ∗ 0.601704 • (2b). Observe that we have two cases: {α1 : e1 ∈ M1 , e2 ∈ M2 , e3 ∈ M2 } and {α2 : e1 ∈ M2 , e2 ∈ M2 , e3 ∈ M2 }. Case α1 happens with probability y1 /3 and the conditional is Pr[E |α1 ] = 0.537432. Case α2 happens with probability y2 /3 and conditional is Pr[E |α2 ] = 0.200568. Thus we have 1 Pr[E] = y1 /3 ∗ Pr[E |α1 ] + y2 /3 ∗ Pr[E |α2 ] ≥ (0.537432y1 + 0.200568y2 ) 3 • (3a). Observe that we have three cases: {α1 : e1 ∈ M2 , e2 ∈ M1 , e3 ∈ M2 }, {α2 : e1 ∈ M2 , e2 ∈ M2 , e3 ∈ M2 } and {α2 : e1 ∈ M2 , e2 ∈ M0 , e3 ∈ M2 }. Case α1 happens with probability y1 /3 and conditional is Pr[E |α1 ] = 0.13171. Case α2 happens with probability y2 /3 and conditional is Pr[E |α2 ] = 0.200568. Case α3 happens with probability (1 − y1 /3 − y2 /3) and conditional is Pr[E |α3 ] = 0.22933. Similarly, we have Pr[E] = y1 /3 ∗ Pr[E |α1 ] + y2 /3 ∗ Pr[E |α2 ] + (1 − y1 /3 − y2 /3) ∗ Pr[E |α3 ] 1 ≥ (0.13171y1 + 0.200568y2 + (3 − y1 − y2 )0.22933) 3 • (3b). Observe that we have six cases. – α1 : e1 ∈ M1 , e2 ∈ M1 , e3 ∈ M2 . Pr[α1 ] = y12 /9 and Pr[E |α1 ] = 0.4057. – α2 : e1 ∈ M1 , e2 ∈ M2 , e3 ∈ M2 . Pr[α2 ] = y1 y2 /9 and Pr[E |α2 ] = 0.5374. – α3 : e1 ∈ M1 , e2 ∈ M0 , e3 ∈ M2 . Pr[α3 ] = y1 /3(1 − y1 /3 − y2 /3) and Pr[E |α3 ] = 0.58083. – α4 : e1 ∈ M2 , e2 ∈ M1 , e3 ∈ M2 . Pr[α4 ] = y1 y2 /9, Pr[E |α4 ] = 0.1317. – α5 : e1 ∈ M2 , e2 ∈ M2 , e3 ∈ M2 . Pr[α5 ] = y22 /9, Pr[E |α5 ] = 0.2006. – α6 : e1 ∈ M2 , e2 ∈ M0 , e3 ∈ M2 . Pr[α6 ] = y2 /3(1 − y1 /3 − y2 /3)/3 and Pr[E |α6 ] = 0.22933. Therefore we have Pr[E] ≥ 1 0.135241y12 + 0.223033y1 y2 + 0.066856y22 3  +y1 (3 − y1 − y2 )0.193610 + y2 (3 − y1 − y2 )0.076443 30 • (4a). Observe that we have following six cases. – α1 : e1 ∈ M2 , e2 ∈ M1 , e3 ∈ M1 . Pr[α1 ] = y12 /9 and Pr[E |α1 ] = 0.08898. – α2 : e1 ∈ M2 , e2 ∈ M2 , e3 ∈ M2 . Pr[α2 ] = y22 /9 and Pr[E |α2 ] = 0.2006. – α3 : e1 ∈ M2 , e2 ∈ M0 , e3 ∈ M0 . Pr[α3 ] = (1 − y1 /3 − y1 /3)2 , and Pr[E |α3 ] = 0.2642. – α4 : e1 ∈ M2 while either e2 ∈ M1 , e3 ∈ M2 or e2 ∈ M2 , e3 ∈ M1 . Pr[α2 ] = 2y1 y2 /9 and Pr[E |α4 ] = 0.1317. – α5 : e1 ∈ M2 while either e2 ∈ M1 , e3 ∈ M0 or e2 ∈ M0 , e3 ∈ M1 . Pr[α5 ] = 2y1 /3(1 − y1 /3 − y2 /3) and Pr[E |α5 ] = 0.14849. – α6 : e1 ∈ M2 while either e2 ∈ M2 , e3 ∈ M0 or e2 ∈ M0 , e3 ∈ M2 . Pr[α5 ] = 2y2 /3(1 − y1 /3 − y2 /3) and Pr[E |α6 ] = 0.22933. Therefore we have Pr[E] ≥ 1 0.029661y12 + 2 ∗ 0.043903y1 y2 + 0.066856y22 + 2y1 (3 − y1 − y2 )0.0494997 3  +2y2 (3 − y1 − y2 )(0.076443) + (3 − y1 − y2 )2 0.0880803 • (4b). Observe that in this configuration, we have additional six cases to the ones discussed in (4a). Let αi be the cases defined in (4a) for each 1 ≤ i ≤ 6. Notice that each Pr[αi ] has a multiplicative factor of y2 /3. Now, consider the six new cases. – β1 : e1 ∈ M1 , e2 ∈ M1 , e3 ∈ M1 . Pr[α1 ] = y13 /27 and Pr[E |α1 ] = 0.3167. – β2 : e1 ∈ M1 , e2 ∈ M2 , e3 ∈ M2 . Pr[α2 ] = y1 y22 /27 and Pr[E |α2 ] = 0.5374. – β3 : e1 ∈ M1 , e2 ∈ M0 , e3 ∈ M0 . Pr[α3 ] = y1 /3 ∗ (1 − y1 /3 − y2 /3)2 and Pr[E |α3 ] = 0.632. – β4 : e1 ∈ M1 and either e2 ∈ M1 , e3 ∈ M2 or e2 ∈ M2 , e3 ∈ M1 . Pr[α2 ] = 2y12 y2 /27 and Pr[E |α4 ] = 0.4057. – β5 : e1 ∈ M1 and either e2 ∈ M1 , e3 ∈ M0 or e2 ∈ M0 , e3 ∈ M1 . Pr[α5 ] = 2y12 /9 ∗ (1 − y1 /3 − y2 /3) and Pr[E |α5 ] = 0.4323. – β6 : e1 ∈ M1 and either e2 ∈ M2 , e3 ∈ M0 or e2 ∈ M0 , e3 ∈ M2 . Pr[α5 ] = 2y1 y2 /9 ∗ (1 − y1 /3 − y2 /3) and Pr[E |α6 ] = 0.58083. 31 Hence, we have Pr[E] ≥ 1 0.632y1 − 0.133133y12 + 0.0093y13 + 0.264241y2 3 −0.11127y1 y2 + 0.01170y12 y2 − 0.0232746y22 + 0.00488y1 y22 + 0.00068y23  Setting y1 = 0.687, y2 = 1, we get that the competitive ratio for a small edge is 0.44550. The bottleneck cases are configurations (1a) and (1b). A.2 A.2.1 Supplemental materials in section 4 Proof of Lemma 7 (Vertex-weighted and Unweighted) When Hu = 1 and u is in the cycle C1 , [13] show that the competitive ratio of u is 1 − 2e−2 . Hence, for the remaining cases, we use the following Claims. Claim 9. If Hu = 1 and u is not in C1 , then we have R[RLA, 1] ≥ 0.735622. Claim 10. R[RLA, 2/3] ≥ 0.7870. Claim 11. R[RLA, 1/3] ≥ 0.8107. Recall that Bu is the event that among the n random lists, there exists a list starting with u and Gvu is the event that among the n lists, there exist successive lists such that (1) all start with some u′ which are different from u but are neighbors of v; and (2) they ensure u will be matched. Notice that Pu is the probability that u gets matched in RLA[H′ ]. For each u, we compute Pr[Bu ] and Pr[Gvu ] for all possibilities of v ∼ u and using Lemma 6 we get Pu . First, we discuss two different ways to calculate Pr[Gvu ]. For some cases, we use a direct calculation, while for the rest we use the Markov-chain approximation method. u 1−y y x u v ′ Figure 7: Case 1 in calculation of Pr[Gvu ] Two ways to compute the value Pr[Gvu ] 1. Case 1: Consider the case when v has two neighbors as shown in Figure 7. Assume v has two ′ ′ ′ neighbors u and u′ and after modifications, H(u ′ ,v) = y, H(u,v) = 1 − y and Hu′ = x. Thus, the second certificate event Gvu corresponds to the event (1) a list starting with u′ comes at some time 1 ≤ i < n; (2) the list Rv = (u′ , u) comes for a second time at some j with 32 1 u1 1/3 u2 2/3 u3 0.75 0.1 v 0.15 Figure 8: Case 2 in calculation of Pr[Gvu ] i < j ≤ n. Note that the arrival rate of a list starting with u′ is Hu′ ′ = x/n and the rate of list Rv = (u′ , u) is y/n. Therefore we have Pr[Gvu ] = n−1 X i=1 x/n(1 − x/n)(i−1) (1 − (1 − y/n)(n−i) x − e−y x + (−1 + e−x )y (if x 6= y) x−y ∼ 1 − e−x (1 + x) (if x = y)  ∼ (19) (20) (21) 2. Case 2: Consider the case when v has three neighbors. The value Pr[Gvu ] is approximated using the Markov Chain method, similar to [13]. Let us use the following example to illustrate the method. Consider the following case as shown in Figure 8 (v has three neighbors u, u1 and u2 with ′ Hu = 1, Hu1 = 1/3 and Hu2 = 2/3). Recall that after modifications, we have H(u =b= 1 ,v) ′ ′ 0.1, H(u2 ,v) = c = 0.15 and H(u,v) = d = 0.75. We simulate the process of u getting matched resulting from several successive random lists starting from either u1 or u2 by an n-step Markov Chain as follows. We have 5 states: s1 = (0, 0, 0), s2 = (0, 1, 0), s3 = (0, 0, 1), s4 = (0, 1, 1) and s5 = (1, ∗, ∗) and the three numbers in each triple correspond to u, u1 and u2 being matched(or not) respectively. State s5 corresponds to u being matched; the matched status of u1 and u2 is irrelevant. The chain initially starts in s1 and the probability of being in state s5 after n steps gives an approximation to Pr[Gvu ]. The one-step transition probability matrix M is shown as follows. c + 1/3 b , M1,3 = , M1,1 = 1 − M1,2 − M1,3 n n c + 1/3 bc bd = + , M2,5 = , n (c + d)n (c + d)n = 1 − M2,4 − M2,5 cb cd b , M3,5 = = + n (b + d)n (b + d)n = 1 − M3,4 − M3,5 b+c , M4,4 = 1 − M4,5 = n =1 M1,2 = M2,4 M2,3 M3,4 M3,3 M4,5 M5,5 Mi,j = 0 for all other i, j 33 2 Notice that M1,3 = c+1/3 and not 3n since after modifications, the arrival rate of a list starting n with u2 decreases correspondingly. Let us now prove the three Claims 9, 10 and 11. Here we give the explicit analysis for the case when Hu = 1. For the remaining cases, similar methods can be applied. Hence, we omit the analysis and only present the related computational results which leads to the conclusion. Proof of Claim 9 Notice that u is not in the cycle C1 and thus Lemma 6 can be used. Figure 9 describes all possible cases when a node u ∈ U has Hu = 1. (We ignore all those cases when Hu < 1, since they will not appear in the WS.) 1 u 1 0.9 u v 1/3 u1 u v 2/3 u1 0.1 1 0.85 1 − x1 1 v x1 0.15 1 u u1 1 − x2 x2 1 v u1 v1 (α1 ) 1 (α2 ) u 1 1 1 u1 u u 1 u1 1/3 u2 1 u 1/3 u1 2/3 u2 1 x2 u1 u 0.4 v 1 − x1 1 u1 1 − x2 v 2/3 u1 0.6 v1 0.45 0.45 (β2 ) v 0.1 0.65 0.15 1 u 1 u1 2/3 u2 0.4 0.2 0.2 (β3 ) 1 v u 1/3 u1 1/3 u2 (β6 ) (β5 ) 1 u (α4 ) v (β1 ) 1 1 x1 v u2 (α3 ) 0.8 0.1 0.1 (β7 ) (β4 ) 1 v u 2/3 u1 2/3 u2 0.5 0.25 v 0.25 (β8 ) v 0.2 (β9 ) Figure 9: Vertex-weighted Hu = 1 cases. The value assigned to each edge represents the value after the second modification. No value indicates no modification. Here, x1 = 0.2744 and x2 = 0.15877. Let v1 and v2 be the two neighbors of u with H(u,v1 ) = 2/3 and H(u,v2 ) = 1/3. In total, there are 4 × 10 combinations, where v1 is chosen from some αi , 1 ≤ i ≤ 4 and v2 is chosen from some βi , 1 ≤ i ≤ 9. For Hu = 1, we need to find the worst combination among these such that the value 34 Pu is minimized. We can find this WS using the Lemma 6. Q For each type of αi , βj , we compute the values it will contribute to the term (1 − Bu ) v∼u (1 − Pr[Gvu ]). For example, assume v1 is of type α1 , denoted by v1 (α1 ). It contributes e−0.9 to the term Q (1 − Bu ) and (1 − Pr[Gvu1 ]) to v∼u (1 − Pr[Gvu ]), thus the total value it contributes is γ(v1 , α1 ) = e−0.9 (1 − Pr[Gvu1 ]). Similarly, we can compute all γ(v1 , αi ) and γ(v2 , βj ). Let i∗ = arg maxi γ(v1 , αi ) and j ∗ = arg maxj γ(v2 , βj ). The WS is for the combination {v1 (αi∗ ), v2 (βj ∗ )} and the resulting value of Pu and R[RLA, 1] is as follows: Pu = 1 − γ(v1 , αi∗ )γ(v2 , βj ∗ ) R[RLA, 1] = Pu /Hu = Pu Here is a list of γ(v1 , αi ) and γ(v2 , βj ), for each 1 ≤ i ≤ 4 and 1 ≤ j ≤ 9. • α1 : We have Pr[Gvu ] = 1 − e−0.1 ∗ 1.1 and γ(v, α1 ) = e−0.1 ∗ 1.1 ∗ e−0.9 = 0.404667. • α2 : Pr[Gvu ] ≥ 1 − e−0.15 ∗ 1.15 and γ(v, α2 ) ≤ 0.423. Notice that after modifications, Hu′ 1 ≥ 0.15. Hence, we use this and Equation 19 to compute the lower bound of Pr[Gvu ]. • α3 : Pr[Gvu ] ≥ 0.0916792 and γ(v, α3 ) ≤ 0.439667. Notice that for any large edge e incident to a node u with Hu = 1 (before modification), we ′ ≥ 0.7256 and have after modification, He′ ≥ 1 − 0.2744 = 0.7256. Thus we have H(u 1 ,v1 ) v ′ Hu1 ≥ 1. From Equation 19, we get Pr[Gu ] ≥ 0.0916792. • α4 : Pr[Gvu ] ≥ 0.0307466 and γ(v, α4 ) ≤ 0.417923. Notice that for any small edge e incident to a node u with Hu = 1 (before modification), we have after modification, He′ ≥ 0.15877. Thus, we have Hu′ 1 ≥ 3 ∗ 0.15877. • β1 : Pr[Gvu ] = 0.1608 and γ(v, β1 ) = 0.601313. • β2 : Pr[Gvu ] ≥ 0.208812 and γ(v, β2 ) ≤ 0.601313. ′ After modifications, we have H(u ≥ 0.2744 and thus we get Hu′ 1 ≥ 1. 1 ,v1 ) • β3 : Pr[Gvu ] ≥ 0.251611 and γ(v, β2 ) ≤ 0.63852. ′ After modifications, we have H(u ≥ 0.2744 and thus we get Hu′ 1 ≥ 1 − 0.15877 + 0.2744. 1 ,v1 ) • β4 : Pr[Gvu ] = 0.121901 and γ(v, β4 ) = 0.588607. 35 • β5 : Pr[Gvu ] = 0.1346 and γ(v, β5 ) = 0.551803. • β6 : Pr[Gvu ] ≥ 0.1140 and γ(v, β6 ) ≤ 0.593904. • β7 : Pr[Gvu ] = 0.0084 and γ(v, β7 ) = 0.4455. • β8 : Pr[Gvu ] ≥ 0.0397 and γ(v, β8 ) ≤ 0.582451. • β9 : Pr[Gvu ] ≥ 0.0230 and γ(v, β9 ) ≤ 0.510039. Using the computed values above, let us compute the ratio of a node u with Hu = 1. • If u has three neighbors, then the WS configuration is when each of the three neighbors of u is of type β3 . This is because, the value of γ(v, β3 ) is the largest. The resultant ratio is 0.73967. • If u has two neighbors, then the WS configuration is when one of the neighbor is of type β1 (or β2 ) and the other is of type α3 . The resultant ratio is 0.735622. Proof of Claim 10 The proof is similar to that of Claim 9. The Figure 10 shows all possible configurations of a node u with Hu = 2/3. Note that the WS cannot have F (v) < 1 and hence we omit them here. For a neighbor v of u, if H(u,v) = 2/3, then v is in one of αi , 1 ≤ i ≤ 3; if H(u,v) = 1/3, then v is in one of βi , 1 ≤ i ≤ 8. We now list the values γ(v, αi ) and γ(v, βj ), for each 1 ≤ i ≤ 3 and 1 ≤ j ≤ 8. • α1 : We have Pr[Gvu ] = 1 − e−0.25 ∗ 1.25 and γ(v, α1 ) = e−0.25 ∗ 1.25 ∗ e−0.75 = 0.459849. • α2 : We have Pr[Gvu ] ≥ 0.0528016 and γ(v, α1 ) ≤ 0.470365. • α3 . We have Pr[Gvu ] ≥ 0.13398 and γ(v, α3 ) ≤ 0.475282. • β1 : We have Pr[Gvu ] = 1 − e−0.7 ∗ 1.7 and γ(v, β1 ) = 0.625395. • β2 : We have Pr[Gvu ] ≥ 0.226356 and γ(v, β2 ) ≤ 0.665882. • β3 : We have Pr[Gvu ] ≥ 0.1819 and γ(v, β3 ) ≤ 0.669804. • β4 : We have Pr[Gvu ] ≥ 0.1130 and γ(v, β4 ) ≤ 0.635563. 36 2/3 u 2/3 u 0.75 v 1/3 u1 (α1 ) 2/3 u 0.3 2/3 u 0.7 1 2/3 u 2/3 u v 1 u1 1/3 u2 (β5 ) 1 u1 1 u2 0.85 (β2 ) 2/3 u 1/3 u2 u1 0.2 0.65 0.15 0.4 (α3 ) v u1 (β1 ) 1/3 u1 1 0.15 v 2/3 u1 v (α2 ) 0.3 0.6 v 2/3 u1 0.25 2/3 u 0.7 0.2 0.4 2/3 u v 0.4 2/3 u1 2/3 u2 (β3 ) 2/3 u v 1 u1 2/3 u2 (β6 ) 0.25 0.5 0.25 v (β4 ) 2/3 u v 1/3 u1 v 2/3 u2 (β7 ) (β8 ) Figure 10: Vertex-weighted Hu = 2/3 cases. The value assigned to each edge represents the value after the second modification. No value indicates no modification. • β5 : We have Pr[Gvu ] ≥ 0.0587 and γ(v, β5 ) ≤ 0.674471. • β6 : We have Pr[Gvu ] ≥ 0.1688 and γ(v, β6 ) ≤ 0.680529. • β7 : We have Pr[Gvu ] ≥ 0.1318 and γ(v, β7 ) ≤ 0.676155. • β8 : We have Pr[Gvu ] ≥ 0.0587 and γ(v, β8 ) ≤ 0.674471. Hence, the WS structure is when u is such that Hu = 2/3 and has one neighbor of type α3 . The resultant ratio is 0.7870. Proof of Claim 11 The Figure 11 shows the possible configurations of a node u with Hu = 1/3. Again, we omit those cases where Hv < 1. We now list the values γ(v, αi ), for each 1 ≤ i ≤ 8. • α1 : We have Pr[Gvu ] = 1 − e−0.75 ∗ 1.75 and γ(v, α1 ) = 0.643789. • α2 : We have Pr[Gvu ] ≥ 0.282256 and γ(v, α2 ) ≤ 0.649443. 37 1/3 u 1/3 u 1/3 u 0.25 0.1 v 2/3 u1 v 0.75 1 u1 (α1 ) 1/3 u v 2/3 u2 u1 1 u2 0.9 (α2 ) 1/3 u 2/3 u1 1 1 u1 2/3 u2 (α5 ) 0.15 0.65 0.2 0.1 0.45 1/3 u v 0.45 1/3 u1 1/3 u2 (α3 ) 1/3 u v 1 u1 0.1 0.8 0.1 1/3 u2 (α6 ) (α7 ) v (α4 ) 1/3 u v 1/3 u1 v 2/3 u2 (α8 ) Figure 11: Vertex-weighted Hu = 1/3 cases. The value assigned to each edge represents the value after the second modification. No value indicates no modification. • α3 : We have Pr[Gvu ] ≥ 0.1935 and γ(v, α3 ) ≤ 0.729751. • α4 : We have Pr[Gvu ] ≥ 0.0587 and γ(v, α4 ) ≤ 0.674471. • α5 : γ(v, α5 ) ≤ 0.674471. • α6 : We have Pr[Gvu ] ≥ 0.1546 and γ(v, α6 ) ≤ 0.727643. • α7 : We have Pr[Gvu ] ≥ 0.1938 and γ(v, α7 ) ≤ 0.72948. • α8 : γ(v, α8 ) ≤ 0.674471. Hence, the WS for node u with Hu = 1/3 is when u has one neighbor of type α3 . The resultant ratio is 0.8107. 38 This figure "JailletFig7P26.jpg" is available in "jpg" format from: http://arxiv.org/ps/1606.06395v3
8cs.DS
On the tail behavior of a class of multivariate conditionally heteroskedastic processes Rasmus Søndergaard Pedersen∗ and Olivier Wintenberger† arXiv:1701.05091v3 [math.ST] 5 Dec 2017 October 20, 2017 Abstract Conditions for geometric ergodicity of multivariate autoregressive conditional heteroskedasticity (ARCH) processes, with the so-called BEKK (Baba, Engle, Kraft, and Kroner) parametrization, are considered. We show for a class of BEKK-ARCH processes that the invariant distribution is regularly varying. In order to account for the possibility of different tail indices of the marginals, we consider the notion of vector scaling regular variation (VSRV), closely related to non-standard regular variation. The characterization of the tail behavior of the processes is used for deriving the asymptotic properties of the sample covariance matrices. AMS 2010 subject classifications: 60G70, 60G10, 60H25, 39A50. Keywords and phrases: Stochastic recurrence equations, Markov processes, regular variation, multivariate ARCH, asymptotic properties, geometric ergodicity. 1 Introduction The aim of this paper is to investigate the tail behavior of a class of multivariate conditionally heteroskedastic processes. Specifically, we consider the BEKK-ARCH ∗ Department of Economics, University of Copenhagen. Øster Farimagsgade 5, DK-1353 Copenhagen K, Denmark. † Department of Mathematical Sciences, University of Copenhagen, Universitetsparken 5, DK-2100 Copenhagen Ø, Denmark & Sorbonne Universités, UPMC Univ. Paris 06, LSTA, Case 158 4 Place Jussieu, 75005 Paris, France. We are grateful for comments and suggestions from the editor-in-chief (Thomas Mikosch), an associate editor, and two referees, which have led to a much improved manuscript. Moreover, we thank Sebastian Mentemeier for valuable comments. Pedersen greatly acknowledges funding from the Carlsberg Foundation. Financial support by the ANR network AMERISKA ANR 14 CE20 0006 01 is gratefully acknowledged by Wintenberger. Correspondence to: Rasmus S. Pedersen, [email protected]. 1 (or BEKK(1,0,l)) process, introduced by Engle and Kroner (1995), satisfying 1/2 t∈N Xt = Ht Zt , Ht = C + l X | Ai Xt−1 Xt−1 A|i , (1.1) (1.2) i=1 with (Zt : t ∈ N) i.i.d., Zt ∼ N (0, Id ), C a d × d positive definite matrix, A1 , ..., Al ∈ M (d, R) (the set of d × d real matrices), and some initial value X0 . Due to the assumption that Zt is Gaussian, it holds that Xt can be written as the stochastic recurrence equation (SRE) Xt = M̃t Xt−1 + Qt , (1.3) with M̃t = l X mit Ai (1.4) i=1 and (mit : t ∈ N) is an i.i.d. process mutually independent of (mjt : t ∈ N) for i 6= j, with mit ∼ N (0, 1). Moreover (Qt : t ∈ N) is an i.i.d. process with Qt ∼ N (0, C) mutually independent of (mit : t ∈ N) for all i = 1, ..., l. To our knowledge, the representation in (1.3)-(1.4) of the BEKK-ARCH process is new. Moreover, the representation will be crucial for studying the stochastic properties of the process. Firstly, we find a new sufficient condition in terms of the matrices A1 , ..., Al in order for (Xt : t ≥ 0) to be geometrically ergodic. In particular, for the case l = 1, we derive a condition directly related to the eigenvalues of A1 , in line with the strict stationarity condition found by Nelson (1990) for the univariate ARCH(1) process. This condition is milder compared to the conditions found in the existing body of literature on BEKK-type processes. Secondly, the representation is used to characterize the tails of the stationary solution to (Xt : t ∈ N). Whereas the tail behavior of univariate GARCH processes is well-established, see e.g. Basrak et al. (2002b), few results on the tail behavior of multivariate GARCH processes exist. Some exceptions are the multivariate constant conditional correlation (CCC) GARCH processes, see e.g. Stărică (1999), Pedersen (2016), and Matsui and Mikosch (2016), and a class of factor GARCH processes, see Basrak and Segers (2009). This existing body of literature relies on rewriting the (transformed) process on companion form that obeys a non-negative multivariate SRE. The characterization of the tails of the processes then follows by an application of Kesten’s Theorem (Kesten (1973)) for non-negative SREs. Such approach is not feasible when analyz- 2 ing BEKK-ARCH processes, as these are stated in terms of an Rd -valued SRE in (1.3). For some special cases of the BEKK-ARCH process, we apply existing results for Rd -valued SREs in order to show that the stationary distribution for the BEKKARCH process is multivariate regularly varying. Specifically, when the matrix M̃t in (1.4) is invertible (almost surely) and has a law that is absolutely continuous with respect to the Lebesgue measure on M (d, R) (denoted ID BEKK-ARCH) we argue that the classical results of Kesten (1973, Theorem 6), see also Alsmeyer and Mentemeier (2012), apply. Moreover, when M̃t is the product of a positive scalar and a random orthogonal matrix (denoted Similarity BEKK-ARCH) we show that the results of Buraczewski et al. (2009) apply. Importantly, we do also argue that the results of Alsmeyer and Mentemeier (2012) rely on rather restrictive conditions that can be shown not to hold for certain types of BEKK-ARCH processes, in particular the much applied process where l = 1 and A1 is diagonal, denoted Diagonal BEKKARCH. Specifically, and as ruled out in Alsmeyer and Mentemeier (2012), we show that the Diagonal BEKK-ARCH process exhibits different marginal tail indices, i.e. P(±Xt,i > x)/ci x−αi → 1 as x → ∞ for some constant ci > 0, i = 1, ..., d (denoted Condition M). In order to analyze this class of BEKK-ARCH processes, where the tail indices are allowed to differ among the elements of Xt , we introduce a new notion of vector scaling regular variation (VSRV) distributions, based on element-wise scaling of Xt instead of scaling by an arbitrary norm of Xt . We emphasize that the notion of VSRV is similar to the notion of non-standard regular variation (see Resnick (2007, Chapter 6)) under the additional Condition M. In addition, in the spirit of Basrak and Segers (2009), we introduce the notion of VSRV processes with particular attention to Markov chains and characterize their extremal behavior. We argue that the stationary distribution of the Diagonal BEKK-ARCH process is expected to be VSRV, which is supported in a simulation study. Proving that the VSRV property applies requires that new multivariate renewal theory is developed, and we leave such task for future research. The rest of the paper is organized as follows. In Section 2, we state sufficient conditions for geometric ergodicity of the BEKK-ARCH process and introduce the notion of vector-scaling regular varying (VSRV) distributions. We show that the distribution of Xt satisfies this type of tail-behavior, under suitable conditions. In Section 3 we introduce the notion of VSRV processes and state that certain BEKKARCH processes satisfy this property. Moreover, we consider the extremal behavior of the process, in terms of the asymptotic behavior of maxima and extremal indices. Lastly, we consider the convergence of point processes based on VSRV processes. In Section 4, we consider the limiting distribution of the sample covariance matrix of 3 Xt , which relies on point process convergence. Section 5 contains some concluding remarks on future research directions. Notation: Let GL(d, R) denote the set of d × d invertible real matrices. With M (d, R) the set of d × d real matrices and A ∈ M (d, R), let ρ(A) denote the spectral radius of A. With ⊗ denoting the Kronecker product, for any real matrix A let A⊗p = A⊗A⊗· · ·⊗A (p factors). For two matrices, A and B, of the same dimension, A B denotes the elementwise product of A and B. Unless stated otherwise, k · k denotes an arbitrary matrix norm. Moreover, Sd−1 = {x ∈ Rd : kxk = 1}. For two matrices A and B of the same dimensions, A B means that Aij > Bij for some i, j. For two positive functions f and g, f (x) ∼ g(x), if limx→∞ f (x)/g(x) = 1. Let L(X) denote the distribution of X. By default, the mode of convergence for distributions is weak convergence. 2 2.1 Stationary solution of the BEKK-ARCH model Existence and geometric ergodicity We start out by stating the following theorem that provides a sufficient condition for geometric ergodicity of the BEKK-ARCH process. To our knowledge, this result together with Proposition 2.3 below are new. Theorem 2.1. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4), suppose that ( inf n∈N " 1 E log n n Y !#) M̃t < 0. (2.1) t=1 Then (Xt : t = 0, 1, ...) is geometrically ergodic, and for the associated stationary solution, E[kXt ks ] < ∞ for some s > 0. The proof of the theorem follows by (Alsmeyer, 2003, Theorems 2.1-2.2, Example 2.6.d, and Theorem 3.2) and is hence omitted. Remark 2.2. A sufficient condition for the existence of finite higher-order moments of Xt can be obtained from Theorem 5 of Feigin and Tweedie (1985). In particular, if ρ(E[M̃t⊗2n ]) < 1 for some n ∈ N, then, for the strictly stationary solution, P 2 E[kXt k2n ] < ∞. For example, ρ( li=1 A⊗2 i ) < 1 implies that E[kXt k ] < ∞. This result complements Theorem C.1 of Pedersen and Rahbek (2014) that contains conditions for finite higher-order moments for the case l = 1. For the case where M̃t contains only one term, i.e. l = 1, the condition in (2.1) simplifies and a condition for geometric ergodicity can be stated explicitly in terms of the eigenvalues of the matrix A1 : 4 Proposition 2.3. Let Xt satisfy (1.1)-(1.2) with l = 1 and let A := A1 . Then a necessary and sufficient condition for (2.1) is that 1 ρ(A) < exp [−ψ(1) + log(2)] = 1.88736..., 2   (2.2) where ψ(·) is the digamma function. Proof. The condition (2.1) holds if and only if there exists n ∈ N such that n Y " E log !# < 0. M̃t (2.3) t=1 Let mt := m1t . It holds that " E log n Y !# " = E log M̃t A n n Y !# mt t=1 t=1 = log (kAn k) − nE [− log(|mt |)]   1 n = log (kA k) − n [−ψ(1) + log(2)] , 2 and hence (2.3) is satisfied if   log kAn k1/n < 1 [−ψ(1) + log(2)] . 2 The result now follows by observing that kAn k1/n → ρ(A) as n → ∞. Remark 2.4. It holds that ρ(A⊗2 ) = (ρ(A))2 . Hence the condition in (2.2) is equivalent to 1 1 ρ(A ) < exp {−ψ(1) + log(2)} = exp −ψ 2 2  ⊗2   = 3.56..., which is similar to the strict stationary condition found for the ARCH coefficient of the univariate ARCH(1) process with Gaussian innovations; see Nelson (1990). Boussama et al. (2011) derive sufficient conditions for geometric ergodicity of the P P | GARCH-type BEKK process, where Ht = C + pi=1 Ai Xt−i Xt−i A|i + qj=1 Bj Ht−j Bj| , Ai , Bj ∈ M (d, R), i = 1, ..., p, j = 1, ..., q. Specifically, they show that a sufficient P Pq ⊗2 condition is ρ( pi=1 A⊗2 i + j=1 Bj ) < 1. Setting p = 1 and q = 0, this condition simplifies to ρ(A⊗2 1 ) < 1, which is stronger than the condition derived in (2.2). Below, we provide some examples of BEKK-ARCH processes that are geometrically ergodic and that will be studied in detail throughout this paper. 5 Example 2.5 (ID BEKK-ARCH). Following Alsmeyer and Mentemeier (2012), we consider BEKK processes with corresponding SRE’s satisfying certain irreducibility and density conditions (ID), that is conditions (A4)-(A5) in Section A.1 in the appendix. Specifically, we consider the bivariate BEKK-ARCH process in (1.1)-(1.2) with Ht = C + 4 X | A|i , Ai Xt−1 Xt−1 i=1 where   a1 0  A1 =  0 0   0 0  A2 =  , a2 0   0 a3  A3 =  , 0 0   0 0  A4 =  (2.4) 0 a4 and a1 , a2 , a3 , a4 6= 0. (2.5) Writing Xt as an SRE, we obtain Xt = M̃t Xt−1 + Qt , (2.6) with M̃t = 4 X Ai mit (2.7) i=1 where (m1t ), (m2t ), (m3t ), (m4t ) are mutually independent i.i.d. processes with mit ∼ N (0, 1). Assuming that a1 , a2 , a3 , a4 are such that the top Lyapunov exponent of (M̃t ) is strictly negative, we have that the process is geometrically ergodic. Notice that one could consider a more general d-dimensional process with the same structure as in (2.4)-(2.7), but with M̃t containing d2 terms such that M̃t has a Lebesgue density on M (d, R), as clarified in Example 2.10 below. Moreover, one could include additional terms to M̃t , say a term containing a full matrix A or an autoregressive term, as presented in Remark 2.8 below. We will focus on the simple bivariate process, but emphasize that our results apply to more general processes.  Example 2.6 (Similarity BEKK-ARCH). Consider the BEKK process in (1.1)(1.2) with l = 1 and A := A1 = aO, where a is a positive scalar and O is an orthogonal matrix. This implies that the SRE (1.3) has M̃t = amt O. By definition, 6 M̃t is a similarity with probability one, where we recall that a matrix is a similarity if it can be written as a product of a positive scalar and an orthogonal matrix. From Proposition 2.3, we have that if a < exp {(1/2) [−ψ(1) + log(2)]} = 1.88736..., then the process is geometrically ergodic. An important process satisfying the similarity | property is the well-known scalar BEKK-ARCH process, where Ht = C +aXt−1 Xt−1 , √ a > 0. Here A = aId , with Id the identity matrix.  Example 2.7 (Diagonal BEKK-ARCH). Consider the BEKK-ARCH process in (1.1)-(1.2) with l = 1 such that A := A1 is diagonal. We refer to this process as the Diagonal BEKK-ARCH process. Relying on Proposition 2.3, the process is geometrically ergodic, if each diagonal element of A is less than exp {(1/2) [−ψ(1) + log(2)]} = 1.88736... in modulus. As discussed in Bauwens et al. (2006), diagonal BEKK models are typically used in practice, e.g. within empirical finance, due to their relatively simple parametrization. As will be shown below, even though the parametrization is simple, the tail behavior is rather rich in the sense that each marginal of Xt has different tail indices, in general.  Remark 2.8. As an extension to (1.1)-(1.2), one may consider the autoregressive BEKK-ARCH (AR BEKK-ARCH) process 1/2 Xt = A0 Xt−1 + Ht Zt , Ht = C + l X t∈N | A|i , Ai Xt−1 Xt−1 i=1 with A0 ∈ M (R, d). This process has recently been studied and applied by Nielsen and Rahbek (2014) for modelling the term structure of interest rates. Notice that the process has the SRE representation Xt = M̃t Xt−1 + Qt , M̃t = A0 + l X mit Ai . i=1 Following the arguments used for proving Theorem 2.1, it holds that the AR BEKKARCH process is geometrically ergodic if condition (2.1) is satisfied. Interestingly, as verified by simulations in Nielsen and Rahbek (2014) the Lyapunov condition may hold even if the autoregressive polynomial has unit roots, i.e. if A0 = Id + Π, where Π ∈ M (R, d) has reduced rank. 7 2.2 Multivariate regularly varying distributions The stationary solution of the BEKK-ARCH process (see Theorem 2.1) can be written as Xt = ∞ Y i X M̃t−j+1 Qt−i , t ∈ Z. (2.8) i=0 j=1 Even if the random matrices M̃t are light-tailed under the Gaussian assumption, the Q maximum of the products ( Tt=1 M̃t )T ≥0 may exhibit heavy tails when T → ∞. More precisely, the tails of the stationary distribution are suspected to have an extremal behavior as a power law function: For any u ∈ Sd−1 , P(u| X0 > x) ∼ C(u)x−α(u) , x → ∞, (2.9) with α(u) > 0 and C(u0 ) > 0 for some u0 ∈ Sd−1 . The cases where α(u) = α and C(u) > 0 for all u ∈ Sd−1 are referred as Kesten’s cases, because of the seminal paper Kesten (1973), and are the subject of the monograph by Buraczewski et al. (2016). A class of multivariate distributions satisfying this property is the class of multivariate regularly varying distributions (de Haan and Resnick (1977)): Definition 2.9. Let R̄d0 := R̄d \{0}, R̄ := R∪{−∞, ∞}, and B̄0d be the Borel σ-field of R̄d0 . For an Rd -valued random variable X and some constant scalar x > 0, define µx (·) := P(x−1 X ∈ ·)/P(kXk > x). Then X and its distribution are multivariate regularly varying if there exists a non-null Radon measure µ on B̄0d which satisfies µx (·) → µ(·) vaguely, as x → ∞. (2.10) For any µ-continuity set C and t > 0, µ(tC) = t−α µ(C), and we refer to α as the index of regular variation. We refer to de Haan and Resnick (1977) for the notion of vague convergence and additional details. Below, we provide two examples of multivariate regularly varying BEKK processes. Example 2.10 (ID BEKK-ARCH, continued). Consider the ID BEKK-ARCH process (2.4)-(2.7) from Example 2.5. By verifying conditions (A1)-(A7) of Theorem 1.1 of Alsmeyer and Mentemeier (2012), stated in Section A.1 in the appendix, we establish that the process is multivariate regularly varying. Since (m1t , m2t , m3t , m4t ) and Qt are Gaussian, we have that (A1)-(A2) hold. 8 Moreover,   a1 m1t a3 m3t  M̃t =  a2 m2t a4 m4t (2.11) is invertible with probability one, which ensures that (A3) is satisfied. From (2.11) we also notice that the distribution of M̃t has a Lebesgue density on M (d, R) which is strictly positive in a neighborhood of I2 . This ensures that the irreducibility and density conditions (A4)-(A5) are satisfied. The fact that Qt ∼ N (0, C) and independent of M̃t implies that condition (A6) holds. Lastly, condition (A7) holds by the fact that (m1t , m2t , m3t , m4t ) and Qt are Gaussian. By Theorem 1.1 of Alsmeyer and Mentemeier (2012) we have established the following proposition: Proposition 2.11. Let Xt satisfy (2.4)-(2.7) such that the top Lyapunov exponent of (M̃t ) is strictly negative. Then for the stationary solution (Xt ), there exists α > 0 such that lim tα P(x| X0 > t) = K(x), t→∞ x ∈ S1 , (2.12) for some finite, positive, and continuous function K on S1 . The proposition implies that each marginal of the distribution of X0 is regularly varying of order α. By Theorem 1.1.(ii) of Basrak et al. (2002a), we conclude that X0 is multivariate regularly varying whenever α is a non-integer. Moreover, since X0 is symmetric, the multivariate regular variation does also hold if α is an odd integer, see Remark 4.4.17 in Buraczewski et al. (2016). The proposition does also apply if a1 = 0 or a4 = 0. This can be seen by Q observing that nk=1 M̃k has a strictly positive density on M (d, R) for n sufficiently large, which is sufficient for establishing conditions (A4)-(A5).  Example 2.12 (Similarity BEKK-ARCH, continued). The Similarity BEKKARCH, introduced in Example 2.6, fits into the setting of Buraczewski et al. (2009), see also Section 4.4.10 of Buraczewski et al. (2016). Specifically, using the representation M̃t = a|mt |sign(mt )O, we have that (i) E[log(|mt a|)] < 0 if a < exp {(1/2) [−ψ(1) + log(2)]}, (ii) P(M̃t x + Qt = x) < 1 for any x ∈ Rd , and (iii) log(|amt |) has a non-arithmetic distribution. Then, due to Theorem 1.6 of Buraczewski et al. (2009), we have the following proposition: 9 Proposition 2.13. Let Xt satisfy (1.1)-(1.2) with l = 1 such that A := A1 = aO, where a > 0 and O is an orthogonal matrix. If a < exp {(1/2) [−ψ(1) + log(2)]} = 1.88736..., then the process has a unique strictly stationary solution (Xt ) with Xt multivariate regularly varying with index α > 0 satisfying E[(|mt |a)α ] = 1.  In the following example, we clarify that the Diagonal BEKK-ARCH process, introduced in Example 2.7, does not satisfy the conditions of Theorem 1.1 of Alsmeyer and Mentemeier (2012). Moreover, we argue that the marginals may have different tail indices, which motivates the notion of vector scaling regular variation, introduced in the next section. Example 2.14 (Diagonal BEKK-ARCH, continued). Consider the diagonal BEKK-ARCH process in Example 2.7, i.e. (1.1)-(1.2) with l = 1 such that A := A1 is diagonal, mt := m1t , and Mt := M̃t = mt A. For this process, the distribution of Mt is too restricted to apply the results by Alsmeyer and Mentemeier (2012), as in Example 2.10. Specifically, the irreducibility condition (A4) in Appendix A.1 can be shown not to hold, as clarified next. It holds that ( P kx | n Y Mk k −1 x | k=1 n Y ! ) Mk ∈ U ( = P | k=1 n Y −1 | n −1 mk | kx A k k=1 ( = P sign n Y ! ) | n mk x A ∈ U k=1 n Y ! ) mk kx| An k−1 x| An ∈ U . k=1 Hence for any x ∈ Sd−1 we can always find a non-empty open U ⊂ Sd−1 such that ( max P sign n∈N n Y ! ) | n −1 | n mk kx A k x A ∈ U = 0. (2.13) k=1 As an example, for d = 2, choose x = (1, 0)| . Then kx| An k−1 x| An ∈ {(−1, 0)} ∪ {(1, 0)} for any n ∈ N. We conclude that condition (A4) does not hold for the diagonal BEKK-ARCH process. Note that, each element of Xt = (Xt,1 , ..., Xt,d )| of the diagonal BEKK-ARCH process can be written as an SRE, t ∈ Z, Xt,i = Aii mt Xt−1,i + Qt,i , i = 1, . . . , d. By Theorem 4.1 of Goldie (1991), the stationary solution of the marginal equation exists if and only if E[log(|Aii m0 |)] < 0. In that case there exists a unique αi > 0 such that E[|m0 |αi ] = |Aii |−αi and P(±X0,i > x) ∼ ci x−αi where ci = 10 E[|X1,i |αi − |Aii m1 X0,i |αi ] . 2αi E[|Aii m1 |αi log(|Aii m1 |)] Hence each marginal of X0 may in general have different tail indices. More precisely, the tail indices are different if the diagonal elements of A, i.e. the Aii s, are, and the heaviest marginal tail index αi0 corresponds to the largest diagonal coefficient Ai0 i0 . When i0 is unique, i.e. αi0 < αi for all i = 1, ..., d except i 6= i0 , the distribution X0 can be considered as multivariate regularly varying with index αi0 and with a limit measure µ with degenerate marginals i 6= i0 . 2.3 Vector scaling regularly varying distributions The previous Example 2.14 shows that the Diagonal BEKK-ARCH process fits into the case where α(u) in (2.9) is non-constant. Such cases have not attracted much attention in the existing body of literature. However, recent empirical studies, such as Matsui and Mikosch (2016), see also Damek et al. (2017), may suggest that it is more realistic to consider different marginal tail behaviors when modelling multidimensional financial observations. The idea is to use a vector scaling instead of the scaling P(kXk > x) in Definition 2.9 that reduced the regular variation properties of the vector X to the regular variation properties of the norm kXk only. More precisely, let (Xt ) be a stationary process in Rd and let x = (x1 , . . . , xd )| ∈ Rd . −1 | Denote also x−1 = (x−1 1 , . . . , xd ) . In our framework, we consider distributions satisfying the following condition: Condition M Each marginal of X0 is regularly varying of order αi > 0, i = 1, ..., d. The slowly varying functions `i (t) → ci > 0 as t → ∞, i = 1, ..., d. Indeed, the Diagonal BEKK-ARCH process introduced in Example 2.14 satisfies Condition M. Moreover, any regularly varying distribution satisfying the Kesten property (2.9) satisfies Condition M. In particular, the ID and Similarity BEKKARCH processes, introduced in Examples 2.5 and 2.6 respectively, satisfy Condition M. We introduce the notion of vector scaling regular variation as the nonstandard regular variation of the book of Resnick (2007) under Condition M, extended to negative components (Resnick, 2007, Sections 6.5.5-6.5.6): Definition 2.15. The distribution of the vector X0 is vector scaling regularly varying (VSRV) if and only if it satisfies Condition M and it is non-standard regularly varying, i.e. there exists a normalizing sequence x(t) and a Radon measure µ with non-null marginals such that tP(x(t)−1 X0 ∈ ·) → µ(·), 11 vaguely. (2.14) The usual way of analyzing non-standard regularly varying vectors is to consider a componentwise normalization that is standard regularly varying in the sense of Definition 2.9. Specifically, when X0 = (X0,1 , ..., X0,d )| satisfies Definition 2.15, −1 α1 αd | (c−1 1 (X0,1 /|X0,1 |)|X0,1 | , ..., cd (X0,d /|X0,d |)|X0,d | ) satisfies Definition 2.9 with index one. Throughout we find it helpful to focus on the non-normalized vector X0 in order to preserve the multiplicative structure of the tail chain introduced in Section 3.2 below, which is used for analyzing the extremal properties of VSRV processes. In the following proposition we state the VSRV vector X0 has a polar decomposition. In the case where Condition M is not satisfied, note that the polar decomposition holds on a transformation of the original process. Under Condition M, the natural radius notion is k · kα , where αi kxkα := max c−1 i |xi | . 1≤i≤d (2.15) Notice that the homogeneity of k · kα , due to Condition M, will be essential for the proof. Proposition 2.16. Suppose that the vector X0 satisfies Condition M. Then X0 is VSRV if and only if there exists a tail vector Y0 ∈ Rd with non-degenerate marginals such that L(((ci t)−1/αi )1≤i≤d X0 | kX0 kα > t) →t→∞ L(Y0 ), (2.16) where k · kα is defined in (2.15). Moreover, kY0 kα is standard Pareto distributed. Notice that a similar vector scaling argument has been introduced in Lindskog et al. (2014). Proof. Adapting Theorem 4 of de Haan and Resnick (1977), the definition of vector scaling regularly varying distribution of X0 in (2.14) implies (2.16). Conversely, under Condition M, we have that |X0,k |αk is regularly varying of order 1 for all 1 ≤ k ≤ d with slowly varying functions `i (t) ∼ ci . Moreover kX0 kα is regularly varying from the weak convergence in (2.16) applied on the Borel sets {kX0 kα > ty}, y ≥ 1. Thus, kX0 kα is regularly varying of order 1 with slowly varying function `(t). One can rewrite (2.16) as `(t)−1 tP(x(t)−1 X0 ∈ ·, kX0 kα > t) → P(Y0 ∈ ·). Using the slowly varying property of `, we obtain, for any  > 0, `(t)−1 tP(x(t)−1 X0 ∈ ·, kX0 kα > t) → −1 P(Y0 ∈ ·). 12 Then by marginal homogeneity of k · kα , `(t)−1 tP(x(t)−1 X0 ∈ ·, kx(t)−1 X0 kα > ) → −1 P(Y0 ∈ ·). Notice that `(t)t−1 > 0 is non-increasing as it is the tail of kX0 kα . So there exists a change of variable t = h(t0 ) so that `(t)−1 t = t0 and t0 P(x(h(t0 ))−1 X0 ∈ ·, kx(h(t0 ))−1 X0 kα > ) → −1 P(Y0 ∈ ·). We obtain the existence of µ for x0 = x ◦ h in (2.14) such that µ(·, kxkα > ) = P(·), which is enough to characterize µ entirely, choosing  > 0 arbitrarily small. The spectral properties of VSRV X0 can be expressed in terms of the tail vector Y0 . Notice that for any u ∈ {+1, 0, −1}d , there exists c+ (u) ≥ 0 satisfying  lim P max t→∞ 1≤i≤d αi c−1 i (ui X0,i )+  > t | kX0 kα > t = c+ (u). −1 | d Consider c−1 (u X0 )α+ , where c−1 = (c−1 1 , . . . , cd ) and for x ∈ R and α = (α1 , ..., αd )| , (x)α+ = ((x1 )α+1 , ..., (xd )α+d )| . If c+ (u) is non-null, by a continuous mapping argument, c−1 (u X0 )α+ satisfies L(t−1 c−1 (u X0 )α+ | k(u X0 )+ kα > t) →t→∞ L(c+ (u)−1 (u Y0 )α+ ), (2.17) and c−1 (u X0 )α+ is regularly varying of index 1. By homogeneity of the limiting measure in the multivariate regular variation (2.10), we may decompose the limit as a product P((k(u X0 )+ kα > ty, c−1 (u X0 )α+ /k(u P(k(u X0 )+ kα > t) X0 )+ kα ∈ ·) → y −α PΘu (·), for any y ≥ 1. Such limiting distribution is called a simple max-stable distribution, and PΘu , supported by the positive orthant, is called the spectral measure of c−1 (u X0 )α+ , see de Haan and Resnick (1977) for more details. By identification of the two expressions of the same limit, we obtain the following proposition. Proposition 2.17. With Y0 defined in Proposition 2.16, the distribution of (u Y0 )α+ /k(u Y0 )+ kα , if non-degenerate, is the spectral measure of c−1 (u X0 )α+ ∈ [0, ∞)d . Moreover, it is independent of k(u Y0 )+ kα , and c+ (u)−1 k(u Y0 )+ kα is standard Pareto distributed. Proof. That c+ (u)−1 k(u Y0 )+ kα is standard Pareto distributed follows from the convergence in (2.17) associated with the regularly varying property, ensuring the 13 homogeneity of the limiting measure. Then, using again the homogeneity in (2.17), it follows that (u Y0 )α+ /k(u Y0 )+ kα and c+ (u)−1 k(u Y0 )+ kα are independent. Example 2.18 (Diagonal BEKK-ARCH, continued). We have not been able to establish the existence of Y0 satisfying (2.16), except the case of the scalar BEKKARCH where the diagonal elements of A are identical. In this case the process is a special case of the Similarity BEKK-ARCH, see Example 2.6. Even in this case, the characterization of the spectral distribution is not an easy task because of the diagonality of A, ruling out Theorem 1.4 of Buraczewski et al. (2009). In Section A.2 in the appendix we have included some estimates of the spectral measure of X0 for the bivariate case. The plots suggest that the tails of the process are indeed dependent. We emphasize that new multivariate renewal theory should be developed in order to prove that the Diagonal-ARCH model is VSRV. We leave such task for future research. 3 Vector-scaling regularly varying time series and their extremal behavior The existence of the tail vector in Proposition 2.16 allows us to extend the asymptotic results of Perfekt (1997) to VSRV vectors taking possibly negative values. In order to do so, we use the notion of tail chain from Basrak and Segers (2009) adapted to VSRV stationary sequences with eventually different tail indices. 3.1 Vector scaling regularly varying time series We introduce a new notion of multivariate regularly varying time series based on VSRV of Xt . Definition 3.1. The stationary process (Xt ) is VSRV if and only if there exists a process (Yt )t≥0 , with non-degenerate marginals for Y0 , such that L(((ci t)−1/αi )1≤i≤d (X0 , X1 , . . . , Xk ) | kX0 kα > t) →t→∞ L(Y0 , . . . , Yk ), for all k ≥ 0. The sequence (Yt )t≥0 is called the tail process. Following Basrak and Segers (2009), we extend the notion of spectral measure to the one of spectral processes for any VSRV stationary process: 14 Definition 3.2. The VSRV stationary process (Xt ) admits the spectral process (Θt ) if and only if L(kX0 k−1 α (X0 , X1 , . . . , Xk ) | kX0 kα > t) →t→∞ L(Θ0 , . . . , Θk ), for all k ≥ 0. By arguments similar to the ones in the proof of Proposition 2.17, it follows that the VSRV properties also characterize the spectral process of (c−1 (u Xt )α+ )t≥0 , with X0 following the stationary distribution, which has the distribution of ((u Yt )α+ /k(u Y0 )+ kα )t≥0 . We have the following proposition. Proposition 3.3. For a VSRV stationary process (Xt ), where Y0 has non-degenerate marginals and kY0 kα is standard Pareto distributed, the spectral process of any nondegenerate (c−1 (u Xt )α+ )t≥0 is distributed as ((u Yt )α+ /k(u Y0 )+ kα )t≥0 and independent of k(u Y0 )+ kα . Moreover c+ (u)−1 k(u Y0 )+ kα is standard Pareto distributed. 3.2 The tail chain In the following, we will focus on the dynamics of the tail process (Yt )t≥1 in Definition 3.1, given the existence of Y0 . We will restrict ourselves to the case where (Xt ) is a Markov chain, which implies that (Yt ) is also a Markov chain called the tail chain; see Perfekt (1997). We have the following proposition. Proposition 3.4. Let (Xt ) satisfy (1.1)-(1.2) be a VSRV stationary process. With M̃t defined in (1.4), the tail process (Yt ) admits the multiplicative form Yt+1 = M̃t+1 Yt , t ≥ 0. (3.1) Proof. Following the approach of Janssen and Segers (2014), one first notices that the existence of the kernel of the tail chain does not depend on the marginal distribution. Thus the characterization of the kernel extends automatically from the usual multivariate regular variation setting to the vector scaling regular variation one. It is straightforward to check Condition 2.2 of Janssen and Segers (2014). We conclude that the tail chain has the multiplicative structure in (3.1). The tail chain for VSRV process satisfying (1.1)-(1.2) is the same no matter the values of the marginal tail indices; for the multivariate regularly varying case with common tail indices it coincides with the tail chain of Janssen and Segers (2014) 15 under Condition M. Notice that we can extend the tail chain Yt backward in time (t < 0) using Corollary 5.1 of Janssen and Segers (2014). 3.3 Asymptotic behavior of the maxima From the previous section, we have that the tail chain (Yt ) quantifies the extremal behavior of (Xt ) in (1.1)-(1.2). Let us consider the asymptotic behavior of the component-wise maxima max(X1 , . . . , Xn ) = (max(X1,k , . . . , Xn,k ))1≤k≤d . Let u = (1, . . . , 1) = 1 ∈ Rd and assume that c+ (1) = limt→∞ P(X0 x(t) | |X0 | x(t)) is positive. Recall that for (Xt ) i.i.d., the suitably scaled maxima converge to the Fréchet distribution; see de Haan and Resnick (1977), i.e. for any x = (x1 , . . . , xd )| ∈ Rd+ , defining un (x) such that nP(X0,i > un,i (x)) ∼ x−1 i , 1 ≤ i ≤ d, we have P(max(X1 , . . . , Xn ) ≤ un (x)) → exp(−A∗ (x)), if and only if (X0 )+ is vector scaling regularly varying. In such case, due to Condition M, we have the expression 1 (Y0,i )α+k . A (x) = c+ (1)E max k(Y0 )+ kα 1≤i≤d ci xi # " ∗ (3.2) Let us assume the following Condition, slightly stronger than (2.1): There exists p > 0 such that lim E[kM̃1 · · · M̃n kp ]1/n < 1. (3.3) n→∞ Theorem 3.5. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4), suppose that condition (3.3) holds. Suppose that the stationary distribution is VSRV. Assuming the existence of Y0 in Definition 3.1, we have that P(max(Xm , . . . , Xn ) ≤ un (x)) → exp(−A(x)), where A(x) admits the expression  c+ (1)E  max  1≤i≤d maxk≥0 Q 1≤j≤k M̃k−j Y0   αk i + k(Y0 )+ kα ci xi − max 1≤i≤d maxk≥1 Q 1≤j≤k M̃k−j Y0 k(Y0 )+ kα ci xi   αk  i +   (. 3.4) Proof. We verify the conditions of Theorem 4.5 of Perfekt (1997). Condition B2 of 16 Perfekt (1997) is satisfied under the more tractable Condition 2.2 of Janssen and Segers (2014). Indeed, the tail chain depends only on the Markov kernel and one can apply Lemma 2.1 of Janssen and Segers (2014), because it extends immediately to the vector scaling regularly varying setting. Condition D(un ) of Perfekt (1997) holds by geometric ergodicity of the Markov chain for a sequence un = C log n, with C > 0 sufficiently large. Lastly, the finite clustering condition, lim lim supn→∞ P[max(|Xm |, . . . , |XC log n |) m→∞ un (x) | |X0 | un (x)] = 0, (3.5) holds for any C > 0 using the same reasoning as in the proof of Theorem 4.6 of Mikosch and Wintenberger (2013) under the drift condition (DCp ) for some p < α = min{αi : 1 ≤ i ≤ d}. As (Xt ) is also standard α regularly varying, actually the drift condition holds thanks to Condition (3.3) on some sufficiently large iterations of the Markov kernel. Finally, as (3.5) is a special case of Condition D∞ (c log n) of Perfekt (1997), we obtain the desired result with the characterization given in Theorem 4.5 of Perfekt (1997) A(x) = Z (0,∞)d \(0,x) P (Tj ≤ x, k ≥ 1 | T0 = y) ν(dy), αi where (Tk )k≥0 is the tail chain of the standardized Markov chain (c−1 i (Xk,i )+ )1≤i≤d , k ≥ 0. As µ restricted to (0, ∞)d \ (0, 1)d is the distribution of Y0 , we assume that xi ≥ 1 for all 1 ≤ i ≤ d so that we identify ν as the distribution of αi (c−1 i (Y0,i )+ )1≤i≤d αi max c−1 i (Y0,i )+ /xi > 1. under the constraint 1≤i≤d Thus we have   αi −1 αi A(x) = P c−1 i (Yk,i )+ /xi ≤ 1, k ≥ 1, 1 ≤ i ≤ d, max ci (Y0,i )+ /xi > 1 . 1≤i≤d To obtain an expression that is valid for any xi > 0, we exploit the homogeneity property, and we obtain     αi αi A(x) = P max max (ci xi )−1 Yk,i > 1 − P max max (ci xi )−1 Yk,i >1 k≥0 1≤i≤d " −1 maxk≥0 max1≤i≤d (ci xi ) = c+ (1)E k(Y0 )+ kα k≥1 1≤i≤d maxk≥1 (Yk,i )α+i − max1≤i≤d (ci xi )−1 (Yk,i )α+i k(Y0 )+ kα because c+ (1)−1 k(Y0 )+ kα is standard Pareto distributed and independent of the spectral process (Yk )α+ /k(Y0 )+ kα . This expression is homogeneous and extends to any possible x by homogeneity. 17 # 3.4 Extremal indices As the random coefficients M̃t in (1.4) may be large, consecutive values of Xt can be large. In the univariate case, one says that the extremal values appear in clusters. An indicator of the average length of the cluster is the inverse of the extremal index, an indicator of extremal dependence; see Leadbetter et al. (1983). Thus, the natural extension of the extremal index is the function θ(x) = A(x)/A∗ (x), with A∗ (x) and A(x) defined in (3.2) and (3.4), respectively. Notice that there is no reason why θ should not depend on x. When xi ≥ c+ (1), for 1 ≤ i ≤ d, we have the more explicit expression in terms of the spectral process,   αi αi θ(x) = P Yk,i ≤ ci xi , k ≥ 1, 1 ≤ i ≤ d | Y0,i > ci xi , 1 ≤ i ≤ d . (3.6) However, the extremal index θi of the marginal index (Xt,i ) is still well-defined. It depends on the complete dependence structure of the multivariate Markov chain thanks to the following proposition: Proposition 3.6. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4) satisfying (3.3) and assuming the existence of Y0 in Definition 3.1, the extremal index, θ, defined in (3.6), is a positive continuous function bounded from above by 1 that can be extended to (0, ∞]d \ {∞, . . . , ∞}. The extremal indices of the marginals are θi = θ(∞, . . . , ∞, xi , ∞, . . . , ∞)  E k(Y0 )+ k−1 α  maxk≥0 Q M̃k−j Y0 1≤j≤k = h E   αi i + − maxk≥1 αi k(Y0 )+ k−1 α (Y0,i )+ Q 1≤j≤k M̃k−j Y0  αi  i + i . Proof. Except for the positivity of the extremal index, the result follows by Proposition 2.5 in Perfekt (1997). The positivity is ensured by applying Corollary 2 in Segers (2005). Example 3.7 (Diagonal BEKK-ARCH, continued). Suppose that X0 is VSRV as conjectured in Example 2.18. It follows from the tail chain approach of Janssen and Segers (2014) that the stationary Markov chain (Xt ) is regularly varying. Thanks αi to the diagonal structure of the matrices M̃k = Amk , one can factorize k(Y0 )+ k−1 α (Y0,i ) αi in the expression of θi provided in Proposition 3.6. Since k(Y0 )+ k−1 and mk α (Y0,i ) are independent for k ≥ 1, we recover a similar expression as in the remarks after 18 Theorem 2.1 in de Haan et al. (1989):   αi  θi = E max Akii k≥0 Y αi   mj  − max Akii k≥1 1≤j≤k + Y mj   . 1≤j≤k + We did not manage to provide a link between the θi and the extremal index θ(x) of the (multivariate) stationary solution (Xt ) of the Diagonal BEKK-ARCH. Due to the different normalising sequences in the asymptotic extremal result given in Theorem 3.5, the extremal index θ(x) depends on the constants ci , i = 1, ..., d. For x∗i = c+ (1), 1 ≤ i ≤ d, the expression (3.6) gets more simple because c+ (1)−1 k(Y0 )+ kα is standard Pareto distributed and supported on [1, ∞):  θ(x∗ ) = P Akii  mj Y0,i ≤ (ci c+ (1))1/αi , k ≥ 1, 1 ≤ i ≤ d . Y 1≤j≤k One can check that θ(x∗ ) ≥ θi0 where 1 ≤ i0 ≤ d satisfies Ai0 i0 ≥ Aii , 1 ≤ i ≤ d so that i0 is the marginal with smallest tail and extremal indices. Thus the inverse of the extremal index of the multidimensional Diagonal BEKK-ARCH is not larger than the largest average length of the marginals clusters. It can be interpreted as the fact that the largest clusters are concentrated along the i0 axis, following the interpretation of the multivariate extremal index given on p. 423 of Beirlant et al. (2006).  3.5 Convergence of point processes Let us consider the vector scaling point process on Rd Nn (·) = n X δ((ci n)−1/αi )1≤i≤d Xt (·), n ≥ 0. (3.7) t=1 We want to characterize the asymptotic distribution of the point process Nn when n → ∞. We refer to Resnick (2007) for details on the convergence in distribution for random measures. In order to characterize the limit, we adapt the approach of Davis and Hsing (1995) to the multivariate VSRV case similar to Davis and Mikosch (1998). The limit distribution will be a cluster point process admitting the expression N (·) = ∞ X ∞ X j=1 t=1 δ (ci Γj )−1/αi  1≤i≤d Qj,t (·), (3.8) where Γj , j = 1, 2, ..., are arrival times of a standard Poisson process, and (Qj,t )t∈Z , 19 j = 1, 2, ..., are mutually independent cluster processes. Following Basrak and Tafro (2016), we use the back and forth tail chain (Yt ) to describe the cluster process: Consider the process (Zt ), satisfying     L (Zt )t∈Z = L (Yt )t∈Z | sup kYt kα ≤ 1 , t≤−1 which is well defined when the anti-clustering condition (3.5) is satisfied. Then we have     j ≥ 1, (Z ) L (Qj,t )t∈Z = L L−1 t t∈Z , Z with LZ = supt∈Z kZt kα . Notice that the use of the pseudo-norm k · kα and the fact that kY0 kα is standard Pareto are crucial to mimic the arguments of Basrak and Tafro (2016). The limiting distribution of the point process Nn coincides with the one of N : Theorem 3.8. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4), suppose that (3.3) holds, and assume that Y0 in Definition 3.1 exists. With Nn defined in (3.7) and N defined in (3.8), d Nn → N, n → ∞. Proof. Let us denote sign the operator sign(x) = x/|x|, x ∈ R, applied coordinatewise to vectors in Rd . We apply Theorem 2.8 of Davis and Mikosch (1998) to the transformed process (c−1 sign(Xt ) |Xt |α )t∈Z which is standard regularly varying of order 1. In order to do so, one has to check that the anti-clustering condition (3.5) is satisfied and that the cluster index of its max-norm is positive. This follows from arguments developed in the proof of Theorem 3.5. The mixing condition of Davis and Mikosch (1998) is implied by the geometric ergodicity of P (Xt ). Thus, the limiting distribution of the point process nt=1 δn−1 c−1 sign(Xt ) |Xt |α P∞ P for some cluscoincides with the one of the cluster point process ∞ t=1 δΓ−1 j=1 j Q̃j,t ter process (Q̃j,t )t∈Z . A continuous mapping argument yields the convergence of Nn P P∞ to ∞ j=1 t=1 δ((ci Γj )−1/αi )1≤i≤d sign(Q̃j,t ) |Q̃j,t |α . The limiting cluster process coincide with Qj,t in distribution thanks to the definition of VSRV processes. 4 Sample covariances In this section, we derive the limiting distribution of the sample covariances for certain BEKK-ARCH processes. Consider the sample covariance matrix, Γn,X = n 1X Xt Xt| . n t=1 20 Let vech(·) denote the half-vectorization operator, i.e. for a d × d matrix A = [aij ], vech(A) = (a11 , a21 , ..., ad1 , a22 , ..., ad2 , a33 , ..., add )| (d(d + 1)/2 × 1). The derivation of the limiting distribution of the sample covariance matrix relies on using the multidimensional regularly varying properties of the stationary process (vech(Xt Xt| ) : t ∈ Z). Let an−1 denote the normalization matrix, −1/αi −1/αj cj . 1≤i,j≤d  an−1 = n−1/αi −1/αj ci  Using Theorem 3.8 and adapting the continuous mapping argument of Proposition 3.1 of Davis and Mikosch (1998) yield the following result. Proposition 4.1. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4) satisfying (3.3) and assuming the existence of Y0 in Definition 3.1, we have n X δvech(an−1 ) t=1 d vech(Xt Xt| ) → ∞ X ∞ X δvech(P` ) `=1 t=1 n → ∞, vech(Q`,t Q|`,t ) , where  −1/αi −1/αj −1/αi −1/αj . cj ci 1≤i,j≤d  P` = Γ` Let us define αi,j = αi αj /(αi + αj ) and assume that αi,j 6= 1 and αi,j 6= 2 for all 1 ≤ i ≤ j ≤ d. Note that αi,j is a candidate for the tail index of the cross product Xt,i Xt,j and that αi,i = αi /2, 1 ≤ i ≤ d. Actually it is the case under some extra assumptions ensuring that the product Y0,i Y0,j is non null, see Proposition 7.6 of Resnick (2007). In line with Theorem 3.5 of Davis and Mikosch (1998), we then get our main result on the asymptotic behavior of the empirical covariance matrix Theorem 4.2. Let Xt satisfy (1.1)-(1.2). With M̃t defined in (1.4), suppose that (3.3) holds, and assume that Y0 in Definition 3.1 exists. Moreover, for any (i, j) such that 1 < αi,j < 2, suppose that  lim lim sup Var n−1/αi,j ε→0 n→∞ n X t=1  Xt,i Xt,j 1|Xt,i Xt,j |≤n1/αi,j ε = 0. (4.1) Then   √ 1−1/αi,j n∧n (Γn,X − E[Γn,X ]1αi,j >1 )i,j d → S, n → ∞, 1≤j≤i≤d where Si,j is an αi,j ∧ 2-stable random variable for 1 ≤ i ≤ j ≤ d and non-degenerate for i = j. When Theorem 4.2 applies, as αi,j ≥ (αi ∧ αj )/2, the widest confidence interval 21 on the covariance estimates is supported by the i0 th marginal satisfying αi0 ≤ αi for all 1 ≤ i ≤ d. In order to apply Theorem 4.2, the main difficulty is to show that the condition (4.1) holds. However, notice that Theorem 4.2 applies simultaneously on the crossproducts with αi,j ∈ / [1, 2] with no extra assumption. Next, we apply Theorem 4.2 to the ongoing examples. Example 4.3 (Diagonal BEKK-ARCH, continued). Consider the diagonal BEKKARCH process and the cross products Xt,i Xt,j for some i ≤ j and any t ∈ Z. From Hölder’s inequality (which turns out to be an equality in our case), we have E[|Aii Ajj m20 |αi,j ] = E[|Aii m0 |αi |]αi,j /αi E[|Ajj m0 |αj ]αi,j /αj = 1. Thus, (Xt,i Xt,j ), which is a function of the Markov chain (Xt ), satisfies the drift condition (DCp ) of Mikosch and Wintenberger (2013) for all p < αi,j . Then, one can show that (4.1) is satisfied using the same reasoning as in the proof of Theorem 4.6 of Mikosch and Wintenberger (2013).  Example 4.4 (Similarity BEKK-ARCH, continued). If αi,j ∈ / [1, 2], the limiting distribution of the sample covariance matrix for the Similarity BEKK-ARCH follows directly from Theorem 4.2. If αi,j ∈ (1, 2) the additional condition (4.1) has to be checked. Relying on the same arguments as in Example 4.3, one would have to verify that the condition (DCp ) of Mikosch and Wintenberger (2013) holds for the Similarity BEKK-ARCH process, which appears a difficult task as it requires to find a suitable multivariate Lyapunov function. We leave such task for future investigation. Consider the special case of the scalar BEKK-ARCH process introduced in √ Example 2.6. Here A = aId , with Id the identity matrix, such that M̃t is diagonal. In the case αi,j ∈ (1, 2) for a least some pair (i, j), the limiting distribution of the sample covariance is derived along the lines of Example 4.3. Specifically, this relies on assuming that a < exp {(1/2) [−ψ(1) + log(2)]} such that a stationary solution exists, and noting that the index of regular variation for each marginal of Xt is given √ by α satisfying E[| amt |α ] = 1.  Example 4.5 (ID BEKK-ARCH, continued). Whenever αi,j ∈ / [1, 2], the limiting distribution of the sample covariance matrix for the ID BEKK-ARCH follows directly from Theorem 4.2. Similar to Example 4.4 we leave for future investigation to show whether condition (4.1) holds.  The previous examples are important in relation to variance targeting estimation of the BEKK-ARCH model, as considered in Pedersen and Rahbek (2014). For the 22 univariate GARCH process, Vaynman and Beare (2014) have shown that the limiting distribution of the (suitably scaled) variance targeting estimator follows a singular stable distribution when the tail index of the process lies in (2, 4). We expect a similar result to hold for the BEKK-ARCH process. 5 Concluding remarks We have found a mild sufficient condition for geometric ergodicity of a class of BEKK-ARCH processes. By exploiting the the processes can be written as a multivaraite stochastic recurrence equation (SRE), we have investigated the tail behavior of the invariant distribution for different BEKK-ARCH processes. Specifically, we have demonstrated that existing Kesten-type results apply in certain cases, implying that each marginal of the invariant distribution has the same tail index. Moreover, we have shown for certain empirically relevant processes, existing renewal theory is not applicable. In particular, we show that the Diagonal BEKK-ARCH processes may have component-wise different tail indices. In light of this property, we introduce the notion of vector scaling regular varying (VSRV) distributions and processes. We study the extremal behavior of such processes and provide results for convergence of point processes based on VSRV processes. It is conjectured, and supported by simulations, that the Diagonal BEKK-ARCH process is VSRV. However, it remains an open task to verify formally that the property holds. Such task will require the development of new multivariate renewal theory. Our results are expected to be important for future research related to the statistical analysis of the Diagonal BEKK-ARCH model. As recently shown by Avarucci et al. (2013), the (suitably scaled) maximum likelihood estimator for the general BEKK-ARCH model (with l = 1) does only have a Gaussian limiting distribution, if the second-order moments of Xt is finite. In order to obtain the limiting distribution in the presence of very heavy tails, i.e. when E[kXt k2 ] = ∞, we believe that non-standard arguments are needed, and in particular the knowledge of the tail-behavior is expected to be crucial for the analysis. We leave additional considerations in this direction to future research. References Alsmeyer, G. (2003): “On the Harris recurrence of iterated random Lipschitz functions and related convergence rate results,” Journal of Theoretical Probability, 16, 217–247. 23 Alsmeyer, G. and S. Mentemeier (2012): “Tail behaviour of stationary solutions of random difference equations: The case of regular matrices,” Journal of Difference Equations and Applications, 18, 1305–1332. Avarucci, M., E. Beutner, and P. Zaffaroni (2013): “On moment conditions for quasi-maximum likelihood estimation of multivariate ARCH models,” Econometric Theory, 29, 545–566. Basrak, B., R. A. Davis, and T. Mikosch (2002a): “A characterization of multivariate regular variation,” The Annals of Applied Probability, 12, 908–920. ——— (2002b): “Regular variation of GARCH processes,” Stochastic Processes and their Applications, 99, 95–115. Basrak, B. and J. Segers (2009): “Regularly varying multivariate time series,” Stochastic Processes and their Applications, 119, 1055–1080. Basrak, B. and A. Tafro (2016): “A complete convergence theorem for stationary regularly varying multivariate time series,” Extremes, 19, 549–560. Bauwens, L., S. Laurent, and J. V. K. Rombouts (2006): “Multivariate GARCH models: A survey,” Journal of Applied Econometrics, 21, 79–109. Beirlant, J., Y. Goegebeur, J. Segers, and J. L. Teugels (2006): Statistics of extremes: theory and applications, John Wiley & Sons. Boussama, F., F. Fuchs, and R. Stelzer (2011): “Stationarity and geometric ergodicity of BEKK multivariate GARCH models,” Stochastic Processes and their Applications, 121, 2331–2360. Buraczewski, D., E. Damek, Y. Guivarc’h, A. Hulanicki, and R. Urban (2009): “Tail-homogeneity of stationary measures for some multidimensional stochastic recursions,” Probability Theory and Related Fields, 145, 385–420. Buraczewski, D., E. Damek, and T. Mikosch (2016): Stochastic Models with Power-Law Tails: The Equation X = AX + B, Springer Series in Operations Research and Financial Engineering, Springer International Publishing. Damek, E., M. Matsui, and W. Świątkowski (2017): “Componentwise different tail solutions for bivariate stochastic recurrence equations,” https://arxiv.org/abs/1706.05800. 24 Davis, R. A. and T. Hsing (1995): “Point process and partial sum convergence for weakly dependent random variables with infinite variance,” The Annals of Probability, 879–917. Davis, R. A. and T. Mikosch (1998): “The sample autocorrelations of heavytailed processes with applications to ARCH,” The Annals of Statistics, 26, 2049– 2080. de Haan, L. and S. I. Resnick (1977): “Limit theory for multivariate sample extremes,” Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 40, 317–337. de Haan, L., S. I. Resnick, H. Rootzén, and C. G. de Vries (1989): “Extremal behaviour of solutions to a stochastic difference equation with applications to ARCH processes,” Stochastic Processes and their Applications, 32, 213–224. Einmahl, J. H., L. de Haan, and V. I. Piterbarg (2001): “Nonparametric estimation of the spectral measure of an extreme value distribution,” The Annals of Statistics, 29, 1401–1423. Engle, R. F. and K. F. Kroner (1995): “Multivariate simultaneous generalized ARCH,” Econometric Theory, 11, 122–150. Feigin, P. and R. Tweedie (1985): “Random coefficient autoregressive processes: a Markov chain analysis of stationarity and finiteness of moments,” Journal of Time Series Analysis, 6, 1–14. Goldie, C. M. (1991): “Implicit renewal theory and tails of solutions of random equations,” The Annals of Applied Probability, 1, 126–166. Janssen, A. and J. Segers (2014): “Markov tail chains,” Journal of Applied Probability, 51, 1133–1153. Kesten, H. (1973): “Random difference equations and renewal theory for products of random matrices,” Acta Mathematica, 131, 207–248. Kulik, R., P. Soulier, and O. Wintenberger (2015): “The tail empirical process of regularly varying functions of geometrically ergodic Markov chains,” https://arxiv.org/abs/1511.04903. Leadbetter, M., G. Lindgren, and H. Rootzén (1983): Extremes and related properties of random sequences and processes, Springer series in statistics, Springer-Verlag. 25 Lindskog, F., S. I. Resnick, and J. Roy (2014): “Regularly varying measures on metric spaces: Hidden regular variation and hidden jumps,” Probability Surveys, 11, 270–314. Matsui, M. and T. Mikosch (2016): “The extremogram and the crossextremogram for a bivariate GARCH(1,1) process,” Advances in Applied Probability, 48, 217–233. Mikosch, T. and O. Wintenberger (2013): “Precise large deviations for dependent regularly varying sequences,” Probability Theory and Related Fields, 156, 851–887. Nelson, D. B. (1990): “Stationarity and persistence in the GARCH(1,1) model,” Econometric Theory, 6, 318–334. Nielsen, H. B. and A. Rahbek (2014): “Unit root vector autoregression with volatility induced stationarity,” Journal of Empirical Finance, 29, 144–167. Pedersen, R. S. (2016): “Targeting estimation of CCC-GARCH models with infinite fourth moments,” Econometric Theory, 32, 498–531. Pedersen, R. S. and A. Rahbek (2014): “Multivariate variance targeting in the BEKK-GARCH model,” The Econometrics Journal, 17, 24–55. Perfekt, R. (1997): “Extreme value theory for a class of Markov chains with values in Rd ,” Advances in Applied Probability, 29, 138–164. Resnick, S. I. (2007): Heavy-tail phenomena: probabilistic and statistical modeling, Springer Science & Business Media. Segers, J. (2005): “Generalized Pickands estimators for the extreme value index,” Journal of Statistical Planning and Inference, 128, 381–396. Stărică, C. (1999): “Multivariate extremes for models with constant conditional correlations,” Journal of Empirical Finance, 6, 515–553. Vaynman, I. and B. K. Beare (2014): “Stable limit theory for the variance targeting estimator,” in Essays in Honor of Peter C. B. Phillips, ed. by Y. Chang, T. B. Fomby, and J. Y. Park, Emerald Group Publishing Limited, vol. 33 of Advances in Econometrics, chap. 24, 639–672. 26 A Appendix A.1 Theorem 1.1 of Alsmeyer and Mentemeier (2012) Consider the general SRE Yt = At Yt−1 + Bt (A.1) with (At , Bt ) a sequence of i.i.d. random variables with generic copy (A, B) such that A is a d × d real matrix and B takes values in Rd . Consider the following conditions of Alsmeyer and Mentemeier (2012): • (A1) E[log+ (kAk)] < ∞, where k · k denotes the operator norm. • (A2) E[log+ (kBk)] < ∞. • (A3) P[A ∈ GL(d, R)] = 1. • (A4) maxn∈N P {kx| ni=1 Ai k−1 (x| ni=1 Ai ) ∈ U } > 0, for any x ∈ Sd−1 and any non-empty open subset U of Sd−1 . Q Q • (A5) Let Vδ denote the open δ-ball in GL(d, R) and let LEB denote the Lebesgue measure on M (d, R). It holds that for any Borel set A ∈ M (d, R), Q 0 P( ni=1 Ai ∈ A) ≥ γ0 1Vc (Γ0 ) (A)LEB(A) for some Γ0 ∈ GL(d, R), n0 ∈ N, and c, γ0 > 0. • (A6) P(A0 v + B0 = v) < 1 for any v ∈ Rd . • (A7) There exists κ0 > 0 such that E[ infd−1 kx| A0 kκ0 ] ≥ 1, x∈S E[kA0 kκ0 log+ kA0 k] < ∞, and 0 < E[kB0 kκ0 ] < ∞. Theorem A.1 (Alsmeyer and Mentemeier (2012, Theorem 1.1)). Consider the SRE Q in (A.1)) suppose that β := limn→∞ n−1 log(k ni=1 Ai k) < 0 and that (A1)-(A7) hold, then there exists a unique κ ∈ (0, κ0 ] such that lim n−1 log(k n→∞ n Y Ai kκ ) = 0. i=1 Moreover, the SRE has a strictly stationary solution satisfying, lim tκ P(x| Y0 > t) = K(x) t→∞ for all x ∈ Sd−1 , where K is a finite positive and continuous function on Sd−1 . 27 A.2 Estimation of the spectral measure for the bivariate diagonal BEKK-ARCH process In this section we consider the estimation of the spectral measure of the diagonal BEKK-ARCH process presented in Example 2.14. Specifically, we consider a special case of the BEKK-ARCH process in (1.1)-(1.2), where d = 2: Xt = mt AXt−1 + Qt , with {Qt : t ∈ N} an i.i.d. process with Qt ∼ N (0, C) independent of {mt : t ∈ N}, and   A 0 11 . A= 0 A22 Following the approach for i.i.d. sequences of vectors given in Einmahl et al. (2001), we consider the following estimator of the spectral measure of Xt = (Xt,1 , Xt,2 )| : Φ̂(θ) = T 1X , 1 (2) k t=1 {Rt(1) ∨Rt(2) ≥T +1−k,arctan T +1−Rt(1) ≤θ} T +1−R θ ∈ [0, π/2], t (j) where Rt denotes the rank of Xt,j among X1,j , ..., XT,j , j = 1, 2, i.e. (j) Rt := T X 1{Xi,j ≥Xt,j } . i=1 Here k is a sequence satisfying k(T ) → ∞ and k(T ) = o(T ). Einmahl et al. (2001) showed that this estimator is consistent for i.i.d. series. We expect a similar result to hold for geometrically ergodic processes. The reason is that the asymptotic behavior of the empirical tail process used in Einmahl et al. (2001) has been extended to such cases in Kulik et al. (2015). We consider the estimation of the spectral measure for different values of C, A11 , and A22 . In particular, the matrix C is   1 c C = 10−5  , c 1 c ∈ {0, 0.5}, and the values A11 and A22 are determined according to choices of the tail indices of Xt,1 and Xt,2 , respectively. I.e. A11 and A22 satisfy E[|mt |αi ] = |Aii |−αi and are determined by analytical integration. Specifically, with φ(·) the pdf of the standard 28 normal distribution, Z ∞ αi = 0.5 ⇒ Aii = ( |m|0.5 φ(m)dm)−1/0.5 ≈ 1.479 −∞ αi = 2.0 ⇒ Aii = 1 αi = 3.0 ⇒ Aii = (8/π)−1/6 ≈ 0.8557 αi = 4.0 ⇒ Aii = 3−1/4 ≈ 0.7598 Figure A.1 contains plots of the estimates of the spectral measure. The estimates Φ̂(θ) are based on one realization of the process with T = 2,000 and a burn-in period of 10,000 observations. 1.5 k=100 k=300 k=500 k=200 k=400 1.5 α1 = 2, α2 = 2, c = 0.5 1.0 ^ Φ(θ) ^ Φ(θ) α1 = 2, α2 = 2, c = 0 0.5 0.0 1.0 0.5 0.1 0.2 0.3 0.4 0.5 0.0 0.1 0.2 (θ/π) 2.0 α1 = 3, α2 = 4, c = 0 1.5 ^ Φ(θ) ^ Φ(θ) 1.5 1.0 0.1 0.2 0.3 0.4 0.5 0.0 0.1 0.2 0.4 0.5 0.3 0.4 0.5 (θ/π) α1 = 4, α2 = 0.5, c = 0 1.5 ^ Φ(θ) ^ Φ(θ) 0.3 1.0 2.0 1.0 0.5 0.0 0.5 α1 = 3, α2 = 4, c = 0.5 (θ/π) 2.0 1.5 0.4 0.5 0.5 0.0 0.3 (θ/π) α1 = 4, α2 = 0.5, c = 0.5 1.0 0.5 0.1 0.2 0.3 0.4 0.5 (θ/π) 0.0 0.1 0.2 (θ/π) Figure A.1: Nonparametric estimates for k = 100, 200, 300, 400, 500 and for various choices of α1 , α2 , and c. 29
10math.ST
arXiv:1702.00686v1 [cs.SY] 1 Feb 2017 Co-simulation: State of the art Cláudio Gomes ([email protected]) Casper Thule ([email protected]) David Broman ([email protected]) Peter Gorm Larsen ([email protected]) Hans Vangheluwe ([email protected]) February 3, 2017 Contents 1 Introduction 1.1 Motivation . . . . . 1.2 Co-simulation . . . . 1.3 Need for the Survey 1.4 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3 4 6 6 2 Modeling, Simulation, and Co-simulation 2.1 Dynamical Systems – Models of Real Systems 2.2 Simulators – Computing the Behavior Trace . 2.3 Simulation Units - Mock-ups of Reality . . . 2.4 Compositional Co-simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7 8 10 10 3 Discrete Event Based Co-simulation 3.1 DE Simulation units . . . . . . . . . 3.2 DE Co-simulation Orchestration . . 3.3 Challenges . . . . . . . . . . . . . . . 3.3.1 Causality . . . . . . . . . . . 3.3.2 Determinism and Confluence 3.3.3 Dynamic Structure . . . . . . 3.3.4 Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 11 13 19 19 19 20 20 4 Continuous Time Based Co-simulation 4.1 CT Simulation Units . . . . . . . . . . . . . . . . . . . 4.2 CT Co-simulation Orchestration . . . . . . . . . . . . 4.3 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.1 Modular Composition – Algebraic Constraints 4.3.2 Algebraic loops . . . . . . . . . . . . . . . . . . 4.3.3 Consistent Initialization of Simulators . . . . . 4.3.4 Compositional Convergence – Error Control . . 4.3.5 Compositional Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 20 22 27 27 31 33 33 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3.6 4.3.7 Compositional Continuity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Real-time Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 40 5 Hybrid Co-simulation Approach 5.1 Hybrid Co-simulation Scenarios . . . . . . . . . . . . . . 5.2 Challenges . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Semantic Adaptation . . . . . . . . . . . . . . . . 5.2.2 Predictive Step Sizes . . . . . . . . . . . . . . . . 5.2.3 Event Location . . . . . . . . . . . . . . . . . . . 5.2.4 Discontinuity Identification . . . . . . . . . . . . 5.2.5 Discontinuity Handling . . . . . . . . . . . . . . 5.2.6 Algebraic Loops, Legitimacy, and Zeno Behavior 5.2.7 Stability . . . . . . . . . . . . . . . . . . . . . . . 5.2.8 Theory of DE Approximated States . . . . . . . 5.2.9 Standards for Hybrid Co-simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 41 43 43 43 43 44 44 44 45 45 45 6 Classification 6.1 Methodology . 6.2 Taxonomy . . . 6.3 State of the Art 6.4 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 46 46 47 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Concluding Remarks 48 A Historical Perspective of Co-simulation A.1 One Formalism and Dynamic Iteration . . . . . . . . A.2 Two Formalisms: Digital and Analog Co-simulation A.3 Multi-abstraction/Multi-Formalism Co-simulation . A.4 Black-box Co-simulation . . . . . . . . . . . . . . . . A.5 Real-time Co-simulation . . . . . . . . . . . . . . . . A.6 Many simulation units: Large Scale Co-simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . B State of the Art in Co-simulation Frameworks C Co-Simulation Scenario Categorization C.1 Non-Functional Requirements . . . . . . C.1.1 Fault Tolerance . . . . . . . . . . C.1.2 Configuration Reusability . . . . C.1.3 Performance . . . . . . . . . . . C.1.4 IP Protection . . . . . . . . . . . C.1.5 Parallelism . . . . . . . . . . . . C.1.6 Distribution . . . . . . . . . . . . C.1.7 Hierarchy . . . . . . . . . . . . . C.1.8 Scalability . . . . . . . . . . . . . C.1.9 Platform Independence . . . . . C.1.10 Extensibility . . . . . . . . . . . C.1.11 Accuracy . . . . . . . . . . . . . 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 77 78 78 79 79 79 79 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 123 123 123 123 124 125 126 126 127 127 127 127 C.1.12 Open source . . . . . . . . . . C.2 Simulator Requirements . . . . . . . C.2.1 Information Exposed . . . . . C.2.2 Causality . . . . . . . . . . . C.2.3 Time Constraints . . . . . . . C.2.4 Rollback Support . . . . . . . C.2.5 Availability . . . . . . . . . . C.3 Framework Requirements . . . . . . C.3.1 Standard . . . . . . . . . . . C.3.2 Coupling . . . . . . . . . . . C.3.3 Number of Simulation Units . C.3.4 Domain . . . . . . . . . . . . C.3.5 Dynamic structure . . . . . . C.3.6 Co-simulation Rate . . . . . . C.3.7 Communication Step Size . . C.3.8 Strong Coupling Support . . C.3.9 Results Visualization . . . . . C.3.10 Communication Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D List of Acronyms . . . . . . . . . . . . . . . . . . 128 128 129 132 134 136 138 140 140 140 142 144 146 146 148 150 152 154 157 Abstract It is essential to find new ways of enabling experts in different disciplines to collaborate more efficient in the development of ever more complex systems, under increasing market pressures. One possible solution for this challenge is to use a heterogeneous model-based approach where different teams can produce their conventional models and carry out their usual mono-disciplinary analysis, but in addition, the different models can be coupled for simulation (co-simulation), allowing the study of the global behavior of the system. Due to its potential, co-simulation is being studied in many different disciplines but with limited sharing of findings. Our aim with this work is to summarize, bridge, and enhance future research in this multidisciplinary area. We provide an overview of co-simulation approaches, research challenges, and research opportunities, together with a detailed taxonomy with different aspects of the state of the art of co-simulation and classification for the past five years. The main research needs identified are: finding generic approaches for modular, stable and accurate coupling of simulation units; and expressing the adaptations required to ensure that the coupling is correct. 1 1.1 Introduction Motivation Truly complex engineered systems that integrate physical, software and network aspects, are emerging [153, 185]. Due to external pressure, the development of these systems has to be concurrent and distributed, that is, divided between different teams and/or external suppliers, each in their own domain and each with their own tools. Each participant develops a partial solution to a constituent 3 system, that needs to be integrated with all the other partial solutions. The later in the process the integration is done, the less optimal it is [228]. Innovative and truly optimal multi-disciplinary solutions can only be achieved through a holistic development process [237] where the partial solutions developed independently are integrated sooner and more frequently. Furthermore, the traditional activities carried out at the partial solution level —such as requirements compliance check, or design space exploration— can be repeated at the global level, and salient properties spanning multiple constituent systems can be studied. Modeling and simulation can improve the development of the partial solutions (e.g., see Friedman and Ghidella [92]), but falls short in fostering this holistic development process [34]. To understand why, one has to observe that: a) models of each partial solution cannot be exchanged or integrated easily, because these are likely developed by different specialized tools; and b) externally supplied models have Intellectual Property (IP), hence cannot be cheaply disclosed to system integrators. 1.2 Co-simulation Co-simulation is proposed as a solution to overcome these important challenges. It consists of the theory and techniques to enable global simulation of a coupled system via the composition of simulators. Each simulator is a black box mock-up of a constituent system, developed and provided by the team that is responsible for that system. This allows each team/supplier to work on its part of the problem with its own tools without having the coupled system in mind, and eases the relationship between system integrators and suppliers: the latter provide virtual mock-ups of the solutions they are selling without revealing their IP; the former can perform early conformance checks and evaluate different designs from multiple competing suppliers. An alternative to co-simulation is co-modelling, were models are described in a unified language, and then simulated. There are advantages to this approach but each domain has its own particularities when it comes to simulation (e.g., see [63, 167, 246]) making it impractical to find a language and simulation algorithm that fits all. As part of the systematic review that led to the current document (see section 6.1 for details), we took note of the approaches to co-simulation and the publications in applications of co-simulation. The approaches to co-simulation shaped the taxonomy in section 6.2 and the applications of co-simulation shows that in the last five years, co-simulation has been applied in many different engineering domains, as fig. 1 shows. In concrete, the publications are: Automotive - [4, 26, 28, 29, 39, 44, 69, 74, 82, 132, 156, 168, 213, 237, 258, 264, 266] Electricity Production and Distribution - [3, 5, 33, 78, 95, 96, 111, 120, 139, 157–159, 163, 205, 224, 243, 248, 255, 267] HVAC - [73, 88, 114, 188, 192, 251] IC and SoC Design - [209] Maritime - [194, 195] Robotics - [143, 198, 199, 265] A closer look at the publications shows, however, that the average reported co-simulation scenario includes only two simulators, each a mock-up of a constituent system from a different domain. While this gives evidence that co-simulation enhances the development multi-domain systems, it is not yet up-to-par with the scale of Cyber-Physical Systems (CPSs). The unexplored potential is recognized in a number of completed and ongoing projects that address co-simulation (MOD- 4 ELISAR1 , DESTECS2 , INTO-CPS3 , ACOSAR4 , ACoRTA5 ), and is one of the reasons why the Functional Mock-up Interface (FMI) Standard was created. 12 11 10 9 Publications 8 Application Domain Automotive Electricity Production and Distribution HVAC IC and SoC Design Maritime Robotics 7 6 5 4 3 2 1 0 2011 2012 2013 2014 2015 2016 Year Figure 1: Research publications of co-simulation applications over the past five years. The FMI standard6 defines the interfaces that enable modelling and simulation tools to cooperate in a simulation, while keeping the IP in the models protected. As of December 2016, 15 tools implement the standard7 and many others are planning to support it. The standard was originally created for the coupling of continuous systems, but has been used (or abused) to simulate hybrid systems. Extensions have been proposed in the literature to facilitate and standardize this simulation (e.g., zero step size transitions [36, 232], or step size prediction [46]), and we complement those by adding to the understanding of the the challenges arising in hybrid system co-simulation. Co-simulation is not a new concept and there are many approaches in the state of the art, in particular, discrete event based approaches, that have been studied and may shed light on how hybrid system co-simulation can be performed. Contribution. We present a survey and a taxonomy, as an attempt to bridge, relate and classify the many co-simulation approaches in the state of the art. 1 https://itea3.org/project/modelisar.html 2 http://www.destecs.org/ 3 http://into-cps.au.dk/ 4 https://itea3.org/project/acosar.html 5 http://www.v2c2.at/research/ee-software/projects/acorta/ 6 https://www.fmi-standard.org 7 This number includes only the tools that have passed the crosscheck in https://www.fmi-standard.org/tools 5 1.3 Need for the Survey Despite the growing interest in the benefits and scientific challenges of co-simulation, to the best of our knowledge, no existing survey attempts to cover the heterogeneous communities in which it is being studied. The lack of such a survey means that the same techniques are being proposed independently with limited sharing of findings. To give an example, the use of dead-reckoning models is a well known technique in discrete event co-simulation [152], but only very recently it was used in a continuous time co-simulation approach [221]. Our hypothesis is that bridging these different co-simulation approaches means that solutions and techniques can be exchanged, and a deeper understanding of hybrid system co-simulation can be attained. Scientifically, co-simulation —multi-disciplinary by its very nature— mixes the following fields of research: 1. Numerical analysis – Accuracy and stability of the coupled system have to be studied [10, 51, 66, 105, 107, 109, 128, 197]. 2. Differential Algebraic System Simulation – The composition of co-simulation units is, in the most general sense, made through algebraic constraints [214, 219, 229]. 3. Hybrid Systems – co-simulation scenarios, in the most general sense, are hybrid systems [47, 154, 172–174, 184, 251, 263] 4. Optimization – the heterogeneous capabilities of co-simulation units pose interesting tradeoffs [46, 236]. 5. Hierarchy – Systems of systems are hierarchical and the corresponding co-simulation scenarios should be hierarchical as well [96]. Compositionality properties of co-simulations becomes an interesting research challenge. 6. Formal Verification – The co-simulation orchestration algorithm, also known as the master, can be certified to be correct under certain assumptions about the co-simulation scenarios [46, 89, 99, 100, 179]. 7. System Testing – Co-simulation can be used for exhaustively testing a set of black-box constituent systems, with a non-deterministic environment [150, 164]. 8. Dynamic Structure Systems – Subsystems can have different dependencies depending on whom, and which level of abstraction, they interact with [21–23, 234]. 9. Multi-paradigm Modeling – Subsystems can have have different models at different levels of abstraction [246]. The relationships between the multiple levels have to be known so that correct dynamic switching between levels abstraction can be made. 1.4 Outline To help structure the characteristics of the simulators and how they interact, we distinguish two main approaches for co-simulation: Discrete Event (DE), described in section 3, and Continuous Time (CT), described in section 4. Both of these can be, and are, used for the co-simulation of continuous, discrete, or hybrid coupled systems. We call Hybrid co-simulation, described in 6 section 5, a co-simulation approach that mixes the DE and CT approaches 8 . section 6 categorizes the features provided by co-simulation frameworks, and classifies the state of the art with that taxonomy. Finally, section 7 concludes this publication. The section below provides the terminology used in the rest of the survey. 2 2.1 Modeling, Simulation, and Co-simulation Dynamical Systems – Models of Real Systems In this section we present, in an informal manner, the concepts that will be used throughout the document. A dynamical system is a model of a real system (for instance a physical system or a computer system) characterized by a state and a notion of evolution rules. The state is a set of point values in a state space. The evolution rules describe how the state evolves over an independent variable, usually time. For example, a traffic light, the real system, can be modeled by a dynamical system that, at any time, can be in one of four possible states (red, yellow, green, or off). The evolution rules may dictate that it changes from red to green after some time (e.g., 60 seconds). Another example is a mass-spring-damper, modeled by a set of first order Ordinary Differential Equations (ODEs). The equations describe how the state —position and velocity of the mass— changes continuously over the simulated time. In contrast with the traffic light system, where the state cannot take an infinite number of different values over a finite duration of simulated time, the state of the mass-spring-damper can. The behavior trace is the set of trajectories followed by the state (and outputs) of a dynamical system. For example, a state trajectory x can be defined as a mapping between a time base T and the set of reals R, that is, x : T → R. fig. 2 shows a possible behavior trace for each of the example systems described before. In this example, the time base is R. Figure 2: Examples of behavior traces. We refer to the time variable t ∈ T by simulated time —or simply time, when no ambiguity exists— defined over a time base T (typical the real numbers R), as opposed to the wall-clock time τ ∈ WcT , which is the time that passes in the real world [94]. When computing the behavior trace of a dynamical system over an interval [0, t] of simulated time, a computer takes τ units of 8 Note that in this survey, we are focusing on timed formalisms (also called models of computation) and how they interact in a hybrid co-simulation environment. Other formalisms, with no or only logical notion of time (such as dataflow and synchronous reactive), are not discussed in this survey. For an overview of formalisms and models of computation, please see the book on Ptolemy II [200] and the following survey [45]. 7 wall-clock time that depend on t. τ can therefore be used to measure the run-time performance of simulators. fig. 3a highlights different kinds of simulation, based on the relationship between τ and t. In real-time simulation, the relationship between t and τ is t = ατ , for a given α > 0. In most cases α = 1 is required, but making sure this is obeyed by the simulation algorithm is one of the main challenges in real-time simulation, and by extension, of co-simulation. In as-fast-as-possible —or analytical — simulation, the relationship between τ and t is not restricted. Simulation tools that offer interactive visualization allow the user to pause the simulation and/or set the relationship between τ and t. Knowing when a dynamical system can be used to predict the behavior of a real system is crucial. The experimental frame describes, in an abstract way, a set of assumptions in which the behavior trace of the dynamical system can be compared with the one of the real system [24, 230, 245, 246, 262]. By real system we mean either an existing physical system, or a fictitious —to be engineered— one. Validity is then the difference between the behavior trace of the dynamical system and the behavior trace of the real system, measured under the assumptions specified by the experimental frame. This is what conveys predictive power to dynamical systems. For example, Hooke’s law, in the mass-spring-damper system, can only be used to predict the reaction force of the spring for small deformations. For the traffic light dynamical system, the experimental frame includes the assumption that the transition from the red light to the green light is instantaneous. It is a valid assumption, provided that the executing platform in which the controller software runs, has enough computing power [76, 181, 247]. A model is invalid when, within the experimental frame assumptions, its behavior trace is so different than the one of the real system, that it cannot be used to predict properties of the real system. In order to be practical, the behavior trace of a dynamical system has to highlight just the features of interest of the real system that are relevant for the tasks at hand [145]. In the traffic light model, the precise amount of wall-clock time a transition from red to green takes is unknown, but deemed small enough to be neglected. In the mass-spring-damper, Hooke’s law was chosen because the maximum displacement of the mass will not be large when the context in which the system will be used is taken into account. Finally, we consider only those dynamical systems for which it is possible to obtain its meaning, i.e. the behavior trace, even if only an approximation. 2.2 Simulators – Computing the Behavior Trace There are two generally accepted ways of obtaining the behavior trace of a dynamical system: Translational Translate the dynamical system into another model, which can be readily used to obtain the behavior trace. Obtaining the analytical solution of the mass-spring-damper equations is an example of this approach. For instance, if the traffic light model is expressed in the Statechart formalism, it can be translated into a DEVS model, as done in Borland [40], which can be used to obtain the behavior trace. Operational Use of a solver – an algorithm that takes the dynamical system as input, and outputs a behavior trace. For the mass-spring-damper example, a numerical solver can be used to obtain an approximation of the behavior trace. We focus on the latter. A simulator is an algorithm that takes a dynamical system and computes its behavior trace. Running in a digital computer, it is often the case that a simulator will only be able to approximate that trace. Two aspects contribute to the error in these approximations: inability to calculate a 8 1.0 ● ● ● ● Solution x1 approx. x1 analytical v1 approx. v1 analytical ● ● ● ● ● ● ● ● ● ● ● ● ● 0.5 ● ● ● ● ● ● ● ● ● 0.0 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −0.5 ● ● ● ● ● ● ● ● ● ● ● ● 0.0 (a) Classification of time constraints in simulation. Based on [177, 239]. ● 2.5 5.0 Time 7.5 10.0 (b) Approximate behavior trace of the mass-spring-damper system computed by a Forward Euler solver. Parameters are: m = 1, p = 1, s = 0, c1 = 1, d1 = 1, and Fe (t) = 0. x is the displacement and v is the velocity. The dotted lines are the approximated behaviour traces and the solid lines are the analytical behaviour traces. Figure 3 trajectory over a continuum, and the finite representation of infinitely small quantities. Simulators of discrete dynamical systems may also tolerate some inaccuracies in the behavior traces as well (e.g., if that brings a performance benefit). fig. 3b shows an example approximation of the behavior trace of the mass-spring-damper system, computed by the Forward Euler. The inaccuracies are clear when compared to the analytical trace. In order to define what an accurate simulator is, or even be able to talk about error, we need to postulate that every dynamical system has an analytical behavior trace. The error can then be defined as the absolute difference between the behavior trace computed by a simulator and the analytical trace. An accurate simulator is one that produces traces that are very close9 to the analytical behaviour. Even if it is not possible to obtain the analytical behavior of every dynamical system, there are theoretical results that allow simulators to control the error they make. These techniques are applied to co-simulation in section 4.3.4. For the mass-spring-damper, and linear ODEs in general, the analytical trace follows a known structure [48]. For the traffic light, and timed statemachine models in general, the analytical behavior trace can be obtained with a sequential solver, that respects the causality of events. In short, validity is a property of a dynamical system whereas accuracy is a property of a simulator [63]. It is perfectly possible to have an accurate behaviour trace of a model that is invalid, and vice versa [62]. For continuous time systems, the choice of an appropriate solver is important and should be made by domain experts [63, 167, 175]. 9 The meaning of “very close” depends on the numerical tolerance of the observer. 9 2.3 Simulation Units - Mock-ups of Reality In strict terms, a simulator is not readily executable: it needs a dynamical system and the input trajectories to that dynamical system, before being able to compute the behavior trace. We use the term simulation unit for the composition of a simulator with a dynamical system. A simulation unit is a replacement of the real system, ready to take inputs and produce a behavior trace. In the FMI standard, the analogous term is the Functional Mock-up Unit (FMU) for co-simulation. A simulation is the behavior trace obtained with a simulation unit. The correctness of a simulation unit is dictated by the correctness of the simulation, which depends on the accuracy of the simulator and the validity of the dynamical system. 2.4 Compositional Co-simulation As described in section 1, it useful to obtain correct simulations of complex, not yet existing, systems. Since the constituent systems are developed independently by specialized teams/suppliers, simulation units can be produced for these. The simulation units can be coupled via their inputs/outputs to produce a behavior trace of the coupled system. A co-simulation, a special kind of simulation, is the set of simulations computed by the coupled simulation units. The simulation units can be independent black boxes, possibly running in different computers. Hence, an orchestrator is necessary to couple them. The orchestrator controls how the simulated time progresses in each simulation unit and moves data from outputs to inputs according to a cosimulation scenario. A co-simulation scenario is the information necessary to ensure that a correct co-simulation can be obtained. It includes how the inputs of each simulation unit are computed from other outputs, their experimental frames, etc. In the FMI Standard, the orchestrator is called a master algorithm. Analogously to the simulator and simulation unit concepts, the composition of a specific orchestrator with a co-simulation scenario, yields a co-simulation unit, which is a special kind of simulation unit, and a substitute of the real coupled system. It follows that a co-simulation is the simulation trace computed by a co-simulation unit. This characterization enables hierarchical co-simulation scenarios, where co-simulation units are coupled. The main purpose of the orchestrator is to obtain a correct behavior trace of the coupled system, assuming that each simulation unit in itself is correctly defined. We make this assumption because: (1) the simulation units are often well known parts of the system, and (2) they are developed by experienced and specialized teams/suppliers. Co-simulation enables design decisions to be tried out in the model (what-if analysis), cheaply 10 , early in the process, and possibly automatically [87, 104]. In this survey, we focus on the coupling of black box simulation units, where limited knowledge of the models and simulators is available. However, as will become clear in the sections below, the black box restriction has to be relaxed so that certain properties related to correctness can be ensured. Understanding what kind of information should be revealed and how IP can still be protected is an active area of research in co-simulation. Most challenges in co-simulation are related to compositionality: if every simulation unit Si in a co-simulation scenario satisfies property P , then the co-simulation unit, with a suitable orchestrator, must also satisfy P . The correctness is a property that should be compositional in co-simulation. Other properties include validity, or accuracy. It is an open research question to ensure that a 10 Another aspect to consider is the balance between insights gained and resources spent [85]. 10 co-simulator is compositional for a given set of properties. The following three sections provide an overview of the information and techniques being used throughout the state of the art, divided into three main approaches: discrete event (section 3), continuous time (section 4), and hybrid (section 5) co-simulation. 3 Discrete Event Based Co-simulation The Discrete Event (DE) based co-simulation approach describes a family of orchestrators and characteristics of simulation units that are borrowed from the discrete event system simulation domain. We start with a description of DE systems, and then we extract the main concepts that characterize DE based co-simulation. The traffic light is a good example of a DE system. It can be one of the possible modes: red, yellow, green or off. The off mode is often used by the police, which in some countries is characterized by a blinking yellow. Initially, the traffic light can be red. Then, after 60 seconds, it changes to green. Alternatively, before those 60 seconds pass, some external entity (e.g., a police officer) may trigger a change from red to off. The output of this system can be an event signaling its change to a new color. This example captures some of the essential characteristics of a DE dynamical system: reactivity – instant reaction to external stimuli (turning off by an external entity); and transiency – a DE system can change its state multiple times in the same simulated time point, and receive simultaneous stimuli. In the traffic light, transiency would happen if the light changes always after 0s (instead of 60s), or if the police officer would turn off and on the traffic light in the same instant. These characteristics are embraced in DE based co-simulation, where the orchestrator acknowledges that simulation units can evolve the internal state and exchange values despite the fact that the simulated time is stopped. 3.1 DE Simulation units A DE simulation unit is a black box that exhibits the characteristics of a DE dynamical system, but the dynamical system it stands for does not need to be a DE one. Furthermore, it is typical to assume that DE simulation units communicate with the environment via time-stamped events, as opposed to signals. This means that the outputs of simulation units can be absent at times where no event is produced. We adapt the definition of DEVS11 in [242] (originally proposed in [259]) to formally define a 11 In the original DEVS definition, the initial state and the absent value in the output function are left implicit. Here we make them explicit, to be consistent with section 4. Note also that there are many other variants of discreteevent formalisms. For instance, DE in hardware description languages (VHDL and Verilog) and actor based systems (for instance the DE director in Ptolemy II [200]). 11 DE simulation unit Si , where i denotes the reference of the unit: Si = Xi , Ui , Yi , δiext , δiint , λi , ta i , qi (0) δiext : Qi × Ui → Xi δiint : Xi → Xi λi : Xi → Yi ∪ {φ} ta i : Xi → R+ 0 (1) ∪∞ qi (0) ∈ Qi Qi = {(x, e)|x ∈ Xi and 0 ≤ e ≤ ta i (x)} where: • Xi , Ui , and Yi are the set of possible discrete states, input events, and output events, respectively; • δiext (qi , ui ) = x0i is the external transition function that computes a new total state (x0i , 0) ∈ Qi based on the current total state qi and an input event ui ; • δiint (xi ) = x0i is the internal transition function that computes a new total state (x0i , 0) ∈ Qi when the current total state is (xi , ta i (xi )) ∈ Qi ; • e denotes the elapsed units of time since the last transition (internal or external); • λi (xi ) = yi ∈ Yi ∪ {φ} is the output event function, invoked right before an internal transition takes place and φ encodes an absent value; • ta i (xi ) ∈ R is the time advance function that indicates how much time passes until the next state change occurs, assuming that no external events arrive; • qi (0) is the initial state; The execution of a DEVS simulation unit is described informally as follows. Suppose that the simulation unit is at time ti ∈ R+ 0 and marks the current discrete state as xi for e ≥ 0 elapsed units of time. Since e ≤ ta i (xi ), the total state is (xi , e) ∈ Qi . Let tn = ti + ta i (xi ) − e. If no input event happens until tn, then at time tn an output event is computed as yi := λi (xi ) and the new discrete state xi is computed as xi := (δiint (xi ), 0). If, on the other hand, there is an event at time ts < tn, that is, ui is not absent at that time, then the solver changes to state xi := (δiext ((xi , e + ts − ti ), ui ), 0) instead. In the above description, if two events happen at the same time, both are processed before the simulated time progresses. Due to the transiency and reactivity properties, the state and output trajectories of a DE simulation unit can only be well identified if the time base, traditionally the positive real numbers, includes a way to order simultaneous events, and simultaneous state changes. An example of such a time base is the notion of superdense time [154, 162, 165], where each time point is a pair (t, n) ∈ T × N , with T typically being the positive real numbers and N , called the index, is the natural numbers. In this time base, a state trajectory is a function xi : T × N → Vxi , where Vxi is the set of values for the state, and an output/input trajectory is ui : T ×N → Vui ∪{φ}. Simultaneous states and events can be formally represented with incrementing indexes. See [47] for an introduction. Equations 2 and 3 show examples of simulation units. A DE simulation unit is passive: it expects some external coordinator to set the inputs and call the transition functions. This passivity enables an easier composition of simulation units in a cosimulation, by means of a coordination algorithm, as will be shown later in section 3.2. Algorithm 1 shows a trivial orchestrator which computes the behavior trace of a single DE simulation unit, as 12 specified in eq. (1), that has no inputs. Remarks: • tl holds the time of the last transition; • the initial elapsed time satisfies 0 ≤ e ≤ ta i (xi (0)); If Algorithm 1 is used to coordinate the execution of the traffic light simulation unit in eq. (2), then the resulting behavior trace is the piecewise constant traffic light state x1 (t), together with the output events. The latter is represented as a trajectory yi (t) that is mostly undefined (or absent), except for the single points where an output is produced, according to ta 1 . Algorithm 1: Single autonomous DE simulation unit orchestration. Based on [242] and originally proposed in [259]. Data: A simulation unit Si = Xi , ∅, Yi , δiext , δiint , λi , ta i , (xi (0), ei ) . ti := 0 ; xi := xi (0) ; // Initial discrete state tl := −ei ; // Account for initial elapsed time while true do ti := tl + ta i (xi ) ; // Compute time of the next transition yi := λi (xi ) ; // Output xi := δiint (xi ) ; // Take internal transition tl := ti ; end 3.2 DE Co-simulation Orchestration DEVS simulation units communicate with their environment exclusively through inputs and outputs. DE co-simulation scenarios are comprised of multiple DE units Si (eq. (1)) coupled through output to input connections, which map output events of one unit to external events in other unit. Consider the following DE simulation units of a traffic light and a police office, respectively: 13 D E S1 = X1 , U1 , Y1 , δ1ext , δ1int , λ1 , ta 1 , q1 (0) D E S2 = X2 , U2 , Y2 , δ2ext , δ2int , λ2 , ta 2 , q2 (0) X1 = {red , yellow , green, off } X2 = {working, idle} U1 = {toAuto, toOff } U2 = ∅ Y1 = X1 Y2 = {toWork , toIdle} ( idle if x2 = working int δ2 (x2 ) = working if x2 = idle ( toIdle if x2 = working λ2 (x2 ) = toWork if x2 = idle ( 200 if x2 = working ta 2 (x2 ) = 100 if x2 = idle ( δ1ext ((x1 , e), u1 ) =   green δ1int (x1 ) = yellow   red   green λ1 (x1 ) = yellow   red  60 if    50 if ta 1 (x1 ) =  10 if    ∞ if off red if u1 = toOff if u1 = toAuto and x1 = off if x1 = red if x1 = green if x1 = yellow if x1 = red if x1 = green if x1 = yellow x1 x1 x1 x1 (3) q2 (0) = (idle, 0) = red = green = yellow = off q1 (0) = (red , 0) (2) With the following remarks: • The current state of the model in the definition of δ1ext is q1 = (x1 , e) with e being the elapsed time since the last transition. • The output event function λ1 is executed immediately before the internal transition takes place. It must then publish the next state instead of the current. To model a scenario where the police officer interacts with a traffic light, the output events Y2 have to be mapped into the external events U1 of the traffic light simulation unit (eq. (2)). In this example, if U1 = {toAuto, toOff } are the external input events handled by the traffic light simulation unit, the mapping Z2,1 : Y2 → U1 is defined by: ( toAuto if y2 = toIdle Z2,1 (y2 ) = (4) toOff if y2 = toWork This way, if the police officer changes to working state at time tn, then the output signal y2 := toWork will be translated by Z2,1 into an input event u1 := toOff of the traffic light simulation unit. Based on the idea of abstract simulation units [262], we formalize and illustrate the idea of a DE co-simulation scenario with reference cs as follows: hUcs , Ycs , D, {Sd : d ∈ D} , {Id : d ∈ D ∪ {cs}} , {Zi,d : d ∈ D ∧ i ∈ Id } , Selecti where: 14 (5) • • • • • Ucs is the set of possible input events, external to the scenario; Ycs is the set of possible output events from the scenario to the environment; D is an ordered set of simulation unit references; For each d ∈ D, Sd denotes a DE unit, as defined in eq. (1); For each d ∈ D ∪ {cs}, Id ⊆ (D \ {d}) ∪ {cs} is the set of simulation units that can influence simulation unit Sd , possibly including the environment external to the scenario (cs), but excluding itself (d); Zi,d :Ui → Ud , if i = cs • For each i ∈ Id , Zi,d specifies the mapping of events: Zi,d :Yi → Yd , if d = cs Zi,d :Yi → Ud , if i 6= cs and d 6= cs • Select : 2D → D is used to deterministically select one simulation unit, among multiple simulation units ready to produce output events simultaneously, i.e., when at time t, the set of simulation units IMM (t) = {d|d ∈ D ∧ qd (t) = (xd , ta d (xd ))} (6) has more than one simulation unit reference. This function is restricted to select one from among the set IMM (t), i.e., Select(IMM (t)) ∈ IMM (t). The following co-simulation scenario cs couples the traffic light simulation unit to the police officer simulation unit: h∅, Ycs , {1, 2} , {S1 , S2 } , {I1 , I2 , Ics } , {Z2,1 , Z1,cs } , Selecti Ycs = Y1 I1 = {2} (7) I2 = ∅ Ics = {1} Z1,cs (y1 ) = y1 where: • S1 is the traffic light simulation unit (eq. (2)) and S2 the police officer simulation unit (eq. (3)); • Y1 is the output of S1 ; • Z2,1 is defined in eq. (4); and • The omitted Zi,d functions map anything to absent (φ). The Select function is particularly important to ensure that the co-simulation trace is unique. For example, consider the co-simulation scenario of eq. (7), and suppose that at time tn both simulation units are ready to output an event and perform an internal transition. Should the traffic light output the event and perform the internal transition first, or should it be the police office to do it first? In general, the order in which these output/transition actions are performed matters. The reason is that the way one simulation unit reacts to the other simulation unit’s output may be different, depending on the internal state of the former. In the example co-simulation scenario, the end result is always the same but this is not the general case. Algorithm 2 illustrates the orchestrator of an autonomous (without inputs) DE co-simulation scenario. It assumes that the co-simulation scenario does not expect external events, that is, all events that can affect the simulation units are produced by other simulation units in the same scenario. External output events are possible though. Remarks: • tcs holds the most recent time of the last transition in the scenario; • ed is the elapsed time of the current state qd = (xd , ed ) of simulation unit Sd ; 15 • • • • • tn is the time of the next transition in the scenario; i∗ denotes the chosen imminent simulation unit; Ics is the set of simulation units that can produce output events to the environment; ycs is the output event signal of the scenario to the environment; and {d|d ∈ D ∧ i∗ ∈ Id } holds the simulation units that Si∗ can influence. Algorithm 2: Autonomous DE co-simulation scenario orchestration. Based on [242]. Data: A co-simulation scenario cs = h∅, Ycs , D, {Sd } , {Id } , {Zi,d } , Selecti. tcs := 0 ; xi := xi (0) for all i ∈ D ; // Store initial discrete state for each unit while true do ta cs := mind∈D {ta d (xd ) − ed } ; // Time until the next internal transition tn := tcs + ta cs ; // Time of the next internal transition i∗ := Select(IMM (tn)) ; // Get next unit to execute yi∗ := λi∗ (xi∗ ) ; xi∗ := δiint // Store new discrete state ∗ (xi∗ ) ; ei∗ := 0 ; // Reset elapsed time for the executed unit if i∗ ∈ Ics then ycs := Zi∗ ,cs (yi∗ ) ; // Compute output of the scenario end for d ∈ {d|d ∈ D ∧ i∗ ∈ Id } do ud := Zi∗ ,d (yi∗ ) ; // Trigger internal units that are influenced by unit i∗ xd := δdext ((xd , ed + ta cs ), ud ) ; ed := 0 ; end for d ∈ {d|d ∈ D ∧ i∗ 6∈ Id } do ed := ed + ta cs ; // Update the elapsed time of the remaining units end tcs := tn ; // Advance time end fig. 4 shows the behavior trace of the co-simulation scenario in eq. (7). Algorithm 2 is similar to Algorithm 1: • The time advance of the scenario ta cs corresponds to the time advance of a single simulation unit. • The output produced by the state transition is analogous to the λ function of a single simulation unit. • The output and state transition of child Si∗ , together with the external transitions of the simulation units influenced by Si∗ , are analogous to the internal transition of a single simulation unit. It is natural then that a co-simulation scenario cs as specified in eq. (5), can be made to behave as a single DE simulation unit Scs . Intuitively, the state of Scs is the set product of the total states of each child DE unit; ta cs is the minimum time until one of the DE units executes an internal transition; the internal transition of Scs gets the output event of the imminent unit, executes the external transitions of all the affected units, updates the elapsed time of all unaffected units, and 16 computes the next state of the imminent unit; the external transition of Scs gets an event from the environment, executes the external transition of all the affected units, and updates the elapsed time of all the unaffected units [262]. Formally: ext int Scs = Xcs , Ucs , Ycs , δcs , δcs , λcs , ta cs , qcs (0) Xcs = ×d∈D Qd qcs (0) = (×d∈D qi (0), min ed ) d∈D ta cs ((. . . , (xd , ed ), . . .)) = min {ta d (xd ) − ed } d∈D ∗ i = Select(IMM (t)) ( Zi∗ ,cs (yi∗ (tn)) λcs (xcs ) = φ if i∗ ∈ Ics otherwise int δcs (xcs ) = (. . . , (x0d , e0d ), . . .), for all d ∈ D, where: (8) xcs = (. . . , (xd , ed ), . . .)  int ∗  (δd (xd ), 0) if i = d (x0d , e0d ) = (δdext ((xd , ed + ta cs (xcs )), Zi∗ ,d (λi∗ (xi∗ )), 0) if i∗ ∈ Id   (xd , ed + ta cs (xcs )) otherwise ext δcs ((xcs , ecs ) , ucs ) = (. . . , (x0d , e0d ), . . .), for all d ∈ D, where: xcs = (. . . , (xd , ed ), . . .) ( (δdext ((xd , ed + ecs ) , Zcs,d (ucs )), 0) if cs ∈ Id (x0d , e0d ) = (xd , ed + ecs ) otherwise Remarks: It is the Cartesian product of the total state of each child simulation unit that makes the discrete state of the co-simulation unit; The elapsed times of each child simulation unit are managed solely by the co-simulation unit, whenever there is a transition (internal or external); The external transition functions of each child are executed with the mapping of the events produced by the current state of the imminent child, and not the next one computed by (δdint (xd ), 0); An internal transition of a child simulation unit may cause an output event to the environment of the co-simulation unit, if the child is connected to the output of the co-simulation unit. The same internal transition causes not only a change in the child discrete state, but also, due to its output event, may cause external transitions in other child simulation units. This is not a recursive nor iterative process: at most one external transition will occur in all the affected child simulation units; if any of the affected simulation units becomes ready for an internal transition, it waits for the next internal transition invoked from the coordinator of the co-simulation unit; The resulting co-simulation unit Scs behaves exactly as a DE unit specified in eq. (1). It can thus be executed with Algorithm 1 (in case of no inputs), or composed with other units in hierarchical co-simulation scenarios. Hierarchical co-simulation scenarios can elegantly correspond to real hierarchical systems, a natural way to deal with their complexity [138]. In summary, DE based co-simulation exhibits the following characteristics: 17 Figure 4: Example co-simulation trace of the traffic light and police officer scenario. reactivity: A DE simulation unit (analogously, a DE co-simulation unit) has to process an event at the moment it occurs. transiency: In both Algorithm 2 and in a DE co-simulation unit, the time advance ta cs to the next imminent child internal transition can be zero for successive iterations, so an orchestrator has to be able to tolerate the fact that simulated time may not advance for several iterations. predictable step sizes: In a DE co-simulation scenario without inputs, the orchestrator, as shown in Algorithm 2, can always predict the next simulated time step. In a scenario with inputs, if the environment provides the time of the next event, then the next simulated time step can be predicted too. For this to be possible, black box DE simulation units have to be able to inform the orchestrator what their time advance is, not a trivial task for DE units that simulate continuous systems whose future behavior trace, especially reacting to future inputs, is not easily predicted without actually computing it. In the next sub-section, the main challenges in DE based co-simulation, and the requirements (or capabilities) their solutions impose in DE simulation units, are made explicit. 18 3.3 3.3.1 Challenges Causality For the sake of simplicity, Algorithm 2 is sequential. In a hierarchical co-simulation unit, the imminent simulation unit (closest to performing an internal transition) will be the one to execute, thus inducing that there is a global order in the events that are exchanged. This global order avoids causality violations but is too pessimistic. If an event y1 (t1 ) causes another event —by changing the internal state of some other simulation unit, which in turn changes its next output event— y2 (t2 ), then t1 ≤ t2 , which is ok. However, the converse is not true: t1 ≤ t2 does not necessarily imply that y1 (t1 ) has caused y2 (t2 ), which means that simulation unit S2 could execute before —in the wallclock time sense— y1 (t1 ) without violating causality, at least within a small window of simulated time. To see why, suppose that S1 and S2 do not influence each other in the scenario. Then y2 (t2 ) would happen anyway, regardless of y1 (t1 ) occurring or not. Moreover, the co-simulation scenario holds information —the dependencies {Id }— that can be used to determine who influences what [64, 147]. A parallel optimistic orchestrator that takes {Id } into account is, in general, faster in the wall clock time sense, than a pessimistic, sequential one. However, most of these, the Time-warp algorithm [123, 124] being a well known example, require rollback capabilities of simulation units. This is because simulation units proceed to advance their own time optimistically, assuming that any other simulation units will not affect them, until they are proven wrong by receiving an event which occurs before their own internal time. When that happens, the simulation unit has to rollback to a state prior to the time of timestamp of the event that just arrived. This may in turn cause a cascade of rollbacks in other affected simulation units. Moreover, in parallel optimistic DE co-simulation, any of the units in the scenario needs (theoretically) to support multiple rollbacks and have enough memory to do so for an arbitrary distant point in the past [94]. This point in the past is limited in Time-warp by the Global Virtual Time (GVT). The GVT represents the minimum internal time of all simulation units. By definition, no event that is yet to be produced (in wall-clock time) can have a timestamp smaller than the GVT. We make the distinction between multiple rollback, from single rollback capabilities. To support single rollback, a simulation unit needs to store only the last committed state, thereby saving memory. Causality is a compositionality property: if each child simulation unit does not violate causality, then any orchestrator has to ensure that the causality is not violated when these units are coupled. Optimistic orchestration algorithms do so by requiring rollback capabilities from child simulation units, whereas pessimistic algorithms do so at the cost of performance. 3.3.2 Determinism and Confluence Determinism is also a compositional property. The Select function, in the co-simulation scenario definition of eq. (5), is paramount to ensure the compositionality of deterministic behavior. This function is used to ensure that a unique behavior trace can be obtained when the co-simulation scenario is executed by Algorithm 2 or when it is turned into a co-simulation unit, as in eq. (8). The alternative to the Select function is to ensure that all possible interleavings of executions always lead to the same behavior trace – this is known as “confluence”. Intuitively, if a co-simulation unit is compositional with respect to confluence, then it is also compositional with respect to determinism. Proving confluence is hard in general black box DE co-simulation because it depends on how 19 the child simulation units react to external events: potentially valuable IP. Parallel-DEVS [67] is an approach, which leaves the confluence property to be satisfied by the modeler. 3.3.3 Dynamic Structure Until now, the dependencies {Id }, in eq. (5), have been assumed to be fixed over time. From a performance perspective, a static sequence of dependencies may be too conservative, especially if used to ensure causality in optimistic parallel co-simulation. To see why, consider that in a large scale simulation, there is a simulation unit S1 which may influence simulation unit S2 but only under a very specific set of conditions, which may not be verified until a large amount of simulated time has passed. A pessimistic co-simulation unit assumes that S1 may always affect S2 and hence, tries to ensure that the simulated time of S2 is always smaller than S1 , to minimize possible rollbacks. This incurs an unnecessary performance toll in the overall co-simulation because S1 does not affect S2 most of the time. This is where making I2 dynamic can improve the performance of the cosimulation since the co-simulation unit will know that most of the time, S1 does not affect S2 . Dynamic structure co-simulation allows for {Id } to change over time, depending on the behavior trace of the simulation units. It can be used to study self-organizing systems [21, 235]. 3.3.4 Distribution Co-simulation units whose child simulation units are geographically distributed are common [94]. Interesting solutions like computation allocation [180, 240], bridging the hierarchical encapsulation [241], and the use of dead-reckoning models [152], have been proposed to mitigate the additional communication cost. Moreover, security becomes important, and solutions such as [187] address it. 4 Continuous Time Based Co-simulation In the continuous time (CT) based co-simulation approach, the orchestrators’ and simulation units’ behavior and assumptions are borrowed from the continuous time system simulation domain. We describe these below. 4.1 CT Simulation Units A continuous time simulation unit is assumed to have a state that evolves continuously over time. It is easier to get the intuitive idea of this by considering a simulation unit of a continuous time dynamical system, such as a mass-spring-damper, depicted in the left hand side of fig. 5. The state is given by the displacement x1 and velocity v1 of the mass, and the evolution by: x˙1 = v1 m1 · v˙1 = −c1 · x1 − d1 · v1 + Fe x1 (0) = p1 (9) v1 (0) = s1 where ẋ denotes the time derivative of x; c1 is the spring stiffness constant and d1 the damping coefficient; m1 is the mass; p1 and s1 the initial position and velocity; and Fe denotes an external 20 input force acting on the mass over time. The solutions x1 (t) and v1 (t) that satisfy eq. (9) constitute the behavior trace of the dynamical system. fig. 3b shows an example of such trace. eq. (9) can be generalized to the state space form: ẋ = f (x, u) ; y = g(x, u) ; x(0) = x0 (10) where x is the state vector, u the input and y the output vectors, and x0 is the initial state. T A solution [x(t), y(t)] that obeys eq. (10) is the behavior trace of the system. If f is linear and time-invariant, an analytical form for x(t) can be obtained [17]. An analytical solution obtained by the application of mathematical identities is an example of a behavior trace obtained via the translational approach, described in section 2.2. Alternatively, the behavior trace can be computed. If f (x, u) is sufficiently differentiable, x can be approximated with a truncated Taylor series [63, 227]:  (11) x(t + h) = x(t) + f (x(t), u(t)) · h + O h2 where  O hn+1 = max i xn+1 (ζ(t∗ )) n+1 h h→0 (n + 1)!  lim  = const · hn+1 denotes the order of the truncated residual term; t∗ ∈ [t, t + h]; and h ≥ 0 is the micro-step size. eq. (11) is the basis of a family of numerical solvers that iteratively compute an approximated behavior trace x̃. For example, the Forward Euler method is given by: x̃(t + h) := x̃(t) + f (x̃(t), u(t)) · h (12) x̃(0) := x(0) A CT simulation unit is assumed to have a behavior that is similar to one of a numerical solver computing a set of differential equations. We reinforce that this does not restrict CT simulation units to being mockups of CT systems, even though it is easier to introduced them as such. In the FMI Standard, a simulation unit is analogous to a Functional Mock-up Unit (FMU) for cosimulation. For example, a simulation unit S1 of the mass-spring-damper, using the Forward Euler solver, can be written by embedding the solver (eq. (12)) into eq. (9): x̃1 (t + h1 ) := x̃1 (t) + v1 (t) · h1 1 ṽ1 (t + h1 ) := ṽ1 (t) + · (−c1 · x̃1 (t) − d1 · ṽ1 (t) + Fe (t)) · h1 m1 x̃1 (0) := p1 ṽ1 (0) := s1 T where h1 is the micro-step size, Fe (t) is the input, and [x(t + h), v(t + h)] is the output. 21 (13) 4.2 CT Co-simulation Orchestration Consider now a second system, depicted in the right hand side of fig. 5. It is governed by the differential equations: x˙2 = v2 m2 · v˙2 = −c2 · x2 − Fc Fc = cc · (x2 − xc ) + dc · (v2 − x˙c ) (14) x2 (0) = p2 v2 (0) = s2 where cc and dc denote the stiffness and damping coefficients of the spring and damper, respectively; xc denotes the displacement of the left end of the spring-damper. Combining with the Forward Euler solver, yields the following simulation unit: x̃2 (t + h2 ) := x̃2 (t) + ṽ2 (t) · h2 1 · (−c2 · x̃2 (t) − Fc (t)) · h2 ṽ2 (t + h2 ) := ṽ2 (t) + m2   Fc (t) = cc · (x̃2 (t) − xc (t)) + dc · ṽ2 (t) − xc˙(t) (15) x̃2 (0) := p2 ṽ2 (0) := s2 where h2 is the micro-step size, xc and x˙c are inputs, and Fc the output. Suppose S1 (eq. (13)) and S2 are coupled, setting xc = x1 , x˙c = v1 and Fe = Fc , so that the resulting co-simulation scenario represents the multi-body system depicted in fig. 5. Figure 5: A multi-body system comprised of two mass-spring-damper subsystems. In the co-modeling approach, the models in Equations 9 and 14 would be combined to get the 22 following coupled model: x˙1 = v1 m1 · v˙1 = −c1 · x1 − d1 · v1 + Fc x˙2 = v2 m2 · v˙2 = −c2 · x2 − Fc Fc = cc · (x2 − x1 ) + dc · (v2 − v1 ) (16) x1 (0) = p1 v1 (0) = s1 x2 (0) = p2 v2 (0) = s2 which can be written in the state space form (eq. (10)) as:    0 x˙1  v˙1  − c1m+cc 1  = x˙2   0 cc v˙2 m   2  p1 x1 (0)  v1 (0)  s1      x2 (0) = p2  v2 (0) s2 1 0 c − d1m+d 1 0 cc m1 dc m2 0 c − c2m+c 2   x1 dc    m1   v1  1  x2  dc v2 −m 2 0 (17) The behavior trace of eq. (17) can be obtained either analytically, or with Forward Euler solver (eq. (12)). In CT based co-simulation, to overcome the fact the each simulation unit’s micro-step sizes are independent, a communication step size H (also known as macro-step size or communication grid size) has to be defined. H marks the times at which the simulation units exchange values of inputs/outputs. Suppose a simulation unit Si is at time n · H, for some natural n, and it being asked by an orchestrator to execute until time (n + 1) · H. If Si only gets its inputs valued at n · H, then extrapolation must be used to associate a value with those inputs in any of the internal micro-steps of the simulation unit. In other words, when time n · H + m · hi , for m ≤ hHi and micro-step size hi , an extrapolation function φui (m · hi , ui (n · H), ui ((n − 1) · H), . . .), built from input values known at previous communication time points, is used to approximate the value of ui (n · H + m · hi ). Notice that m = hHi is allowed, even though, theoretically, the value of ui ((n + 1) · H) can be obtained from the environment. The reason for this becomes clear in section 4.3.2. Analogously, interpolation techniques have to be used when the orchestrator makes the input value available at time (n + 1) · H but the simulation unit is still at time n · H. For example, the input Fe of the simulation unit described in eq. (13) can be defined as: Fe (n · H + m · h1 ) := φFe (m · h1 , Fe (n · H), Fe ((n − 1) · H), . . .), for m ≤ 23 H h1 (18) Similarly, the inputs xc and x˙c of the simulation unit described in eq. (15) can be defined as xc (n · H + m · h2 ) := φxc (m · h2 , xc (n · H), xc ((n − 1) · H), . . .) x˙c (n · H + m · h2 ) := φx˙c (m · h2 , x˙c (n · H), x˙c ((n − 1) · H), . . .) H for m ≤ h2 (19) In the simplest case, the extrapolations can be constant. In the coupled mass-spring-dampers example: φFe (t, Fe (n · H))) = Fe (n · H)) φxc (t, xc (n · H)) = xc (n · H) (20) φx˙c (t, x˙c (n · H)) = x˙c (n · H) In the state of the art, input extrapolation approaches can be classified by increasing degree of complexity: Constant; Linear; Polynomial; Extrapolated-Interpolation [49, 50, 75]; Contextaware [134]; and Estimated Dead-Reckoning Model [43, 221]; These can, and often are, combined in practical use cases. See Andersson [8], Arnold [10], Busch [50], Schweizer et al. [219] for an overview of linear and higher order extrapolation techniques and how these affect the accuracy of the co-simulation trace. The orchestrator for this co-simulation scenario, at a time t = n · H, gets the outputs of both simulation units and computes their inputs. Then, each simulation unit is instructed to compute its behavior trace until the next communication step size, at t = (n + 1) · H, making use of the extrapolating functions to get the inputs at each of the micro steps (Equations 18 and 19). We are ready to formally define the behavior of a CT simulation unit Si : Si = hXi , Ui , Yi , δi , λi , xi (0), φUi i δi : R × Xi × Ui → Xi λi : R × Xi × Ui → Yi or R × Xi → Yi (21) xi (0) ∈ Xi φUi : R × Ui × . . . × Ui → Ui where: • Xi is the state set, typically Rn ; • Ui is the input set, typically Rm ; • Yi is the output set, typically Rp ; • δi (t, xi (t), ui (t)) = xi (t + H) or δi (t, xi (t), ui (t + H)) = xi (t + H) is the function that instructs the simulation unit to compute a behavior trace from t to t + H, making use of the input extrapolation (or interpolation) function φUi ; • λi (t, xi (t), ui (t)) = yi (t) or λi (t, xi (t)) = yi (t) is the output function; and • xi (0) is the initial state. 24 For instance, the simulation unit in eq. (13) can be described as follows:     p S1 = R2 , R, R2 , δ1 , λ1 , 1 , φFe s1     x̃ (t) x̃ (t + H) δ1 (t, 1 , Fe (t)) = 1 ṽ1 (t) ṽ1 (t + H)     x̃ (t) x̃ (t) λ1 (t, 1 )= 1 ṽ1 (t) ṽ1 (t) (22) T where [x̃1 (t + H), ṽ1 (t + H)] is obtained by the iterative application of the simulation unit in eq. (13) over a finite number of micro-steps, making use of the extrapolation of Fe (defined in eq. (18)):         x̃1 (t + H) x̃1 (t) x˙1 (t) x˙1 (t + h) = + ·h+ · h + ... ṽ1 (t + H) ṽ1 (t) v˙1 (t, φFe (t, Fe (t), . . .)) v˙1 (t + h, φFe (t + h, Fe (t), . . .)) A continuous time co-simulation scenario with reference cs includes at least the following information12 : hUcs , Ycs , D, {Si : i ∈ D} , L, φUcs i (23) L : (Πi∈D Yi ) × Ycs × (Πi∈D Ui ) × Ucs → Rm where D is an ordered set of simulation unit references, each Si is defined as in eq. (21), m ∈ N, Ucs is the space of inputs external to the scenario, Ycs is the space of outputs of the scenario, φUcs a set of input approximation functions, and L induces the simulation unit coupling constraints (e.g., if D = {1, . . . , n}, then the coupling is L(y1 , . . . , yn , ycs , u1 , . . . , un , ucs ) = 0̄). As an example, the co-simulation scenario representing the system of fig. 5 is: cs = h∅, ∅, {1, 2} , {S1 , S2 } , L, ∅i   x c − v1 L =  x˙c − x1  Fe − Fc (24) where: • S1 is the simulation unit for the constituent system on the left (eq. (22)), and S2 is the simulation unit for the remaining constituent system; • xc , x˙c are the inputs of S2 , and Fe is the input of S1 ; and • x1 , v1 are outputs of S1 and Fc is the output of S2 . Algorithm 3 summarizes in a generic way the tasks of the orchestrator for computing the cosimulation of a scenario cs with no external inputs. It represents the Jacobi communication approach: simulation units exchange values at time t and independently compute the trace until the next communication time t + H. The way the system in eq. (25) is solved depends on how the simulation units are coupled, that is, the definition of L. In the most trivial case, the system reduces to an assignment of an output yj (t) to each input ui (t), and so the orchestrator just gets the output of each simulation unit and copies it onto the input of some other simulation unit, in an appropriate order. Concrete examples of Algorithm 3 are described in [25, 52, 79, 93, 96, 105, 140, 253]. 12 Please note that this formalization is related to the formalization proposed by Broman et al. [46], with the main differences: i) it is not designed to formalize a subset of the FMI Standard, ii) it accommodates algebraic coupling conditions, and iii) it does not explicitly define port variables. 25 An alternative to the Jacobi communication approach is the Gauss-Seidel (a.k.a. sequential or zig-zag) approach, where an order of the simulation units’ δ function is forced to ensure that, at time t, they get inputs from a simulation unit that is already at time t + H. Gauss-Seidel approach allows for interpolations of inputs, which is more accurate, but hinders the parallelization potential. Examples are described in [10, 11, 25, 59, 236]. Algorithm 3: Generic Jacobi based orchestrator for autonomous CT co-simulation scenarios. Data: An autonomous scenario cs = h∅, Ycs , D = {1, . . . , n} , {Si } , L, ∅i and a communication step size H. Result: A co-simulation trace. t := 0 ; xi := xi (0) for i = 1, . . . , n ; while true do Solve the following system for the unknowns:  y1 = λ1 (t, x1 , u1 )    ... (25) y = λ (t, xn , un )  n n   L(y1 , . . . , yn , ycs , u1 , . . . , un ) = 0̄ xi := δi (t, xi , ui ), for i = 1, . . . , n ; // Instruct each simulation unit to advance to the next communication step t := t + H ; // Advance time end Similarly to DE based co-simulation, a CT co-simulation scenario, together with an orchestrator, should behave as a (co-)simulation unit of the form of eq. (21), and thus be coupled with other simulation units, forming hierarchical co-simulation scenarios: the state of the co-simulation unit is the set product of the states of the internal units; the inputs are given by Ucs and the outputs by Ycs ; the transition and output functions are implemented by the orchestrator; the communication step size H used by the orchestrator is analogous to a simulation unit’s micro-step sizes, and the input extrapolation function is φUi . Algorithm 3 makes it clear that the simulation units can be coupled with very limited information about their internal details. In concrete: • The output λi and state transition δi functions need to be executable but their internal details can remain hidden; • the inputs ui need to be accessible; • the state variables can be hidden. These are represented merely to illustrate that the internal state of the simulation unit changes when executing δi . However, the blind coupling can lead to compositionality problems, as will be discussed in the sections below. The common trait in addressing these is to require more from the individual simulation units: either more capabilities, or more information about the internal (hidden) dynamical system. 26 Figure 6: A multi-body system coupled by a mass-less link, based on the example provided in Schweizer and Lu [214]. 4.3 4.3.1 Challenges Modular Composition – Algebraic Constraints In the co-simulation scenario described in eq. (24), the coupling condition L translates into a set of assignments from outputs to inputs. This is because the inputs of the simulation unit of the system in the left hand side of fig. 5 and the outputs of the simulation unit of the system represented in the right hand side of the same picture can be connected directly, and vice versa. In practice, the simulation units’ models are not created with a specific coupling pattern in mind and L can be more complex. As an example, consider the system coupled by a massless rigid link, depicted in fig. 6. The first subsystem is the same as the one in the left hand side of fig. 5 and its simulation unit is in eq. (13). The second constituent system is governed by the following differential equations: x˙3 = v3 m3 · v˙2 = −c3 · x3 + Fc x3 (0) = p3 (26) v3 (0) = s3 And the following simulation unit: x̃3 (t + h3 ) = x̃3 (t) + v3 (t) · h3 1 ṽ3 (t + h3 ) = ṽ3 (t) + · (−c3 · x3 (t) + Fc (t)) · h3 m3 x̃3 (0) = p3 (27) ṽ3 (0) = s3 The input to the simulation unit S3 is the coupling force Fc , and the output is the state of the mass T [x̃3 , ṽ3 ] . The input to the simulation unit S1 is the external force Fe and the outputs are the state T T of the mass [x̃1 , ṽ1 ] . Recall eq. (13). There is clearly a mismatch. The outputs [x̃1 , ṽ1 ] of the first simulation unit cannot be coupled directly to the input Fc of the second simulation unit, and vice versa. However, the massless link restricts the states and inputs of the two units to be the same. Whatever the input forces may be, they are equal and opposite in sign. Hence, any orchestration 27 algorithm has to find inputs that ensure the coupling constraints are satisfied:   x̃1 (n · H) − x̃3 (n · H) L =  ṽ1 (n · H) − ṽ3 (n · H)  = 0̄ Fe (n · H) + Fc (n · H) (28) This problem has been addressed in Arnold [10], Arnold and Günther [11], Gu and Asada [105, 106, 107], Schweizer and Lu [214, 215, 216], Schweizer et al. [218, 219], Sicklinger et al. [220]. The approach taken in Gu and Asada [105] is worth mentioning because it defines a Boundary Condition Coordinator (BCC) which behaves as an extra simulation unit, whose inputs are the outputs of the original two simulation units, and whose outputs are Fe and Fc . They show that the initial co-simulation scenario with the non-trivial constraint can be translated into a co-simulation, with a trivial constraint, by adding an extra simulation unit. This is illustrated in fig. 7. Figure 7: Transforming a co-simulation scenario with a non-trivial constraint into a simpler scenario by adding an extra simulation unit that induces a trivial constraint. This promotes separation of concerns. Transforming the co-simulation scenario to make it simpler marks an important step in separating the concerns of the orchestrator [102]. In fact, the newly created simulation unit can be run with a smaller internal micro-step size, required to meet stability and accuracy criteria, as shown in Gu and Asada [105]. In many of the solutions proposed (e.g., [10, 11, 214, 219, 220]), information about the rate of change (or sensitivity) of outputs and states of each simulation unit, with respect to changes in its inputs is required to solve the non-trivial coupling condition. This information can be either provided directly as a Jacobian matrix of the system and output functions, or estimated by finite differences, provided that the simulation units can be rolled back to previous states. A frequent 28 characteristic of co-simulation: the availability of certain capabilities from simulation units can mitigate the lack of other capabilities. To show why the sensitivity information is useful, one of the tasks of the BCC is to ensure that x̃1 − x̃3 is as close to zero as possible, by finding appropriate inputs Fe and Fc . This is possible since x̃1 and x̃3 are functions of the inputs Fe and Fc , and −Fe = Fc . So the constraint can be written as g(Fe ) = x̃1 (Fe ) − x̃3 (−Fe ) = 0 (29) From one communication step to the next, g can be expanded with the Taylor series: g(Fe ((n + 1) · H)) = g(Fe (n · H) + ∆Fe ) ≈ g(Fe (n · H)) + ∂g(Fe (n · H)) · ∆Fe ∂Fe (30) From a known input Fe (n · H), Equations 29 and 30 can be combined to obtain the input Fe ((n + 1) · H) at the next communication step: ∂g(Fe (n · H)) · ∆Fe = 0 ↔ ∂Fe ∂g(Fe (n · H)) g(Fe (n · H)) = − · ∆Fe ↔ ∂Fe  −1 ∂g(Fe (n · H)) ∆Fe = − · g(Fe (n · H)) ↔ ∂Fe  −1 ∂g(Fe (n · H)) Fe ((n + 1) · H) = Fe (n · H) − · g(Fe (n · H)) ∂Fe g(Fe (n · H) + ∆Fe ) ≈ g(Fe (n · H)) + (31) with ∂g(Fe (n · H)) ∂ x̃1 (Fe (n · H)) ∂ x̃3 (−Fe (n · H)) = + ∂Fe ∂Fe ∂Fc (32) A simple orchestration algorithm will then perform the following steps, at each co-simulation step: 1. Let x̃1 (nH), x̃3 (nH) be the current position outputs of the two simulation units S1 and S3 ; 2. Perform a co-simulation step with a known Fe , obtaining x̃p1 (nH), x̃p3 (nH) as new outputs. 3. Rollback simulation units to state x̃1 (nH), x̃3 (nH); 4. Perform a co-simulation step with Fe + ∆Fe , obtaining x̃d1 (nH), x̃d3 (nH); e (n·H)) 5. Approximate ∂g(F∂F by finite differences and eq. (32); e 6. Obtain a corrected Fec by eq. (31); 7. Rollback simulation units to state x̃1 (nH), x̃3 (nH); 8. Perform the final co-simulation step with Fec ; 9. Commit states and advance time; As can be seen in fig. 8, this coupling cannot be carried out without errors: the constraint g(Fe ((n + 1) · H)) cannot be accurately forced to zero at first try. Furthermore, finding initial conditions and initial inputs that satisfy Equations 9, 26, and 28 is very important and usually requires a fixed point iteration. The above algorithm could be changed to perform an arbitrary 29 Coupling 20 10 0 −10 −20 Solution x1 x3 x_analytical Fe 1.0 Trajectory 0.5 0.0 −0.5 0.0 2.5 5.0 Time 7.5 10.0 Figure 8: Co-simulation of algebraically coupled masses. Parameters are: m2 = 2, m1 = c1 = c3 = d1 = cc = 1, H = 0.1, x1 (0) = 1.0, x3 (0) = 1.1, v1 (0) = v3 (0) = 0. Notice the small disturbance at the initial conditions. number of iterations, repeating steps 1–7 until g(Fe ((n + 1) · H)) is close enough to zero. This would increase the accuracy but also increase the amount of computation. These examples show that rollback capabilities are important. If a simulation unit is a black box, then the rollback capability has to be provided by the simulation unit itself and there is little that the orchestrator can do to make up for the lack of the feature. See Broman et al. [46] for an orchestrator that takes into account the existence of the rollback feature. If, on the other hand, the simulation unit provides access to its state, and allows the state to be set, as in Blockwitz et al. [35], then the orchestrator can implement the rollback by keeping track of the state of the simulation unit. Rollback also plays a key role when dealing with algebraic loops in the co-simulation scenario. Finally, to explain why this sub-section refers to modular composition of simulation units, the example in fig. 6 makes explicit one of the problems in co-simulation: the “rigid” and protected nature of simulation units can make their coupled simulation very difficult. To contrast, in a white box approach where the equations of both constituent systems are available, the whole system is simplified, with the two masses being lumped together, and their coupling forces canceling each other out. The simplified system is a lumped mass-spring-damper, which is easily solvable. Such an approach is common in a-causal modeling languages, such as Modelica [1]. To be concrete, the coupled system is obtained by combining Equations 9, 26, and 28, and simplifying to: x˙1 = v1 (m1 + m3 ) · v˙1 = −(c1 + c3 ) · x1 − d1 · v1 x1 (0) = p1 (33) v1 (0) = s1 fig. 9 compares the behavior trace produced by Algorithm 3 when applied to the co-simulation scenario described in eq. (24), with the analytical solution, obtained from the coupled model of eq. (17) (co-modelling). It is obvious that there is an error due to the extrapolation functions and the large communication step size H = 0.1. 30 1.0 0.5 Solution x1 cosim. x1 analytical x2 cosim. x2 analytical 0.0 −0.5 −1.0 0.0 2.5 5.0 Time 7.5 10.0 Figure 9: Comparison of co-simulation with co-modelling for the sample coupled system. Parameters are: m1 = m2 = c1 = c2 = d1 = cc = 1, H = 0.1. This is more modular because (if the equations are made available) the same constituent system can be coupled to other systems in many different contexts, without further changes. As this sub-section shows, in co-simulation it is possible to get around the modularity aspect, but at a cost. 4.3.2 Algebraic loops Algebraic loops occur whenever there is a variable that indirectly depends on itself. To see how algebraic loops arise in co-simulation scenarios, recall (see eq. (21)) that the state evolution and output of each simulation unit Si can be written as: xi (t + H) = δi (t, xi (t), ui (t)) yi (t + H) = λi (t, xi (t + H), ui (t + H)) (34) To simplify things, assume that the simulation units are coupled by a set of assignments from outputs to inputs, i.e., ui (t) := yj (t) (35) where ui is the input of simulation unit Si and yj the output of a simulation unit Sj , in the same co-simulation scenario. With these definitions, it is easy to see that, depending on the coupling assignments of the co-simulation scenario, the output of a simulation unit may depend on itself, that is, yi (t + H) = λi (t, xi (t + H), ui (t + H)) ui (t + H) = yj (t + H) yj (t + H) = λj (t, xj (t + H), uj (t + H)) uj (t + H) = yk (t + H) ... uz (t + H) = yi (t + H) 31 (36) We distinguish two kinds of algebraic loops in co-simulation [141]: the ones spanning just input variables, and the ones that include state variables as well. The first kind can be avoided by using the input extrapolations as parameters to the output functions. The second kind arises when implicit numerical solvers are used, or when the input approximating functions are interpolations instead of extrapolations. In the previous example, the first kind can be removed by replacing ui (t + H) in eq. (34) by the corresponding extrapolation φui (H, ui (n · H), ui ((n − 1) · H), . . .) which does not depend on ui ((n + 1) · H), thus breaking the algebraic loop. These methods just ignore the algebraic loop though, and as is shown in Arnold et al. [14], Kübler and Schiehlen [141] (and empirically in Bastian et al. [25]), neglecting an algebraic loop can lead to a prohibitively high error in the co-simulation. A better way is to use a fixed point iteration technique. For algebraic loops involving state variables, the same co-simulation step has to be repeated until convergence. If the algebraic loop does not involve any state variable, then the iteration is just on the output functions. To see how algebraic loops involving state variables arise, suppose that, in the example above, φui is constructed from ui ((n + 1) · H): ui (n · H + m · hi ) := φui (m · hi , ui ((n + 1) · H), ui (n · H), ui ((n − 1) · H), . . .) (37) If an order can be imposed in the evaluation of the simulation units that ensures ui ((n + 1) · H) can be computed from some λj (t, xj ((n + 1) · H), uj ((n + 1) · H)) that does not indirectly depend on ui ((n + 1) · H), then this approach —Gauss-Seidel— can improve the accuracy of the co-simulation, as shown in Arnold [10], Arnold and Günther [11], Arnold et al. [14], Busch [50], Kalmar-Nagy and Stanciulescu [128]. Obviously, the execution of simulation unit Si has to start after simulation unit Sj has finished and its output λj (t, xj ((n + 1) · H), uj ((n + 1) · H)) can be evaluated. If the input uj ((n + 1) depends indirectly on ui ((n + 1) · H), then an algebraic loop exists. The output function λj (t, xj ((n + 1) · H), uj ((n + 1) · H)) depends on the state of the simulation unit at xj ((n + 1) · H), which in turn can only be obtained by executing the simulation unit from time n · H to (n + 1) · H, using the extrapolation of the input uj , φuj (m · hi , uj ((n + 1) · H, . . .)); any improvement in the input uj ((n+1)·H, means that the whole co-simulation step has to be repeated, to get an improved xj ((n + 1) · H) and by consequence, an improved output λj (t, xj ((n + 1) · H), uj ((n + 1) · H)). A fixed point iteration technique that makes use of rollback to repeat the co-simulation step with corrected inputs is called dynamic iteration, waveform iteration, and strong or onion coupling [119, 231]. If the simulation units expose their outputs at every internal micro-step, then the waveform iteration can be improved [155]. Strong coupling approaches are typically the best in terms of accuracy, but worst in terms of performance. Approaches that do not perform any correction steps are the best in terms of performance, but worst in accuracy. A variant that attempts to obtain the middle-ground is the so-called semi-implicit method, where a fixed limited number of correction steps is performed. See Schweizer and Lu [214, 215, 216], Schweizer et al. [218, 219] for examples of this approach. In the current FMI Standard for co-simulation, it is not possible to perform a fixed point iteration on the output variables only, in the step mode. A work-around this is to rollback the simulation units and repeat the co-simulation step, effectively treating the algebraic loop as involving the state variables too. Until here, we have assumed full knowledge of the models being simulated in each simulation unit to explain how to identify, and deal with, algebraic loops. In practice, with general black-box simulation units, extra information is required to identify algebraic loops. According to Arnold et al. [13], Benveniste et al. [32], Broman et al. [46], a binary flag denoting whether an output 32 depends directly on an input is sufficient. A structural analysis, for example, with Tarjan’s strong component algorithm [225], can then be performed to identify the loops. 4.3.3 Consistent Initialization of Simulators The definition of a simulation unit in eq. (21) assumes that an initial condition is part of the simulation unit. However, as seen in the example of section 4.3.1, the initial states of the simulation units can be coupled by algebraic constraints, through the output functions, which implies that the initial states of the simulation units cannot be set independently of the co-simulation in which they are used. For example, the constraint in eq. (28) has to be satisfied for the initial states: {x̃1 (0), ṽ1 (0), x̃3 (0), ṽ3 (0)}. In general, for a co-simulation scenario as defined in eq. (23), there is an extra coupling function L0 that at the time t = 0, has to be satisfied. For example: L0 (x1 (0), . . . , xn (0), y1 (0), . . . , yn (0), ycs (0), u1 (0), . . . , un (0), ucs (0)) = 0̄ (38) where: • xi (0) denotes the initial state of simulation unit Si ; and • L0 : X1 × . . . × Xn × Y1 × . . . × Yn × U1 × . . . × Un → Rm represents the initial constraint, not necessarily equal to L in eq. (23). eq. (38) may have an infinite number of solutions – as in the case of the example provided in section 4.3.1 – or have algebraic loops. The initialization problem (or co-initialization) is identified in Blockwitz et al. [35] and addressed in Galtier et al. [96]. In the FMI Standard, there is a dedicated mode for the (possible fixed point iteration based) search of a consistent initial state in all simulation units. 4.3.4 Compositional Convergence – Error Control The accuracy of a co-simulation trace is the degree to which it conforms to the real trace as described in section 2.2. Obtaining the real trace can be a challenge. Error —the difference between the cosimulation trace and the real trace— is then a measure of accuracy. In the context of continuous co-simulation, the most accurate trace is the analytical solution to the coupled model that underlies the scenario. For example, the coupled model in eq. (17), corresponding to the multi-body system in fig. 5, is implicitly created from the co-simulation scenario described in eq. (24). Fortunately, the analytical solution can be obtained for this coupled model because it forms a linear time invariant system. In practice, the analytical solution for a coupled model cannot be found easily. Calculating the error precisely is impossible for most cases but getting an estimate in how the error grows is a well understood procedure in numerical analysis. In simulation, the factors that influence the error are [63]: model, solver, micro-step size, and, naturally, the size of the time interval to be simulated. In co-simulation, the extrapolation functions introduce error in the inputs of the simulation units, which is translated into error in the state/outputs of these, causing a feedback on the error that can increase over time. Intuitively, the larger the co-simulation step size H, the larger is the error made by the extrapolation functions. 33 For example, when the Forward Euler solver (eq. (12)) is used to compute the approximated behavior trace of the dynamical system in eq. (10), in a single micro step, it is making an error in the order of   x(t) + f (x(t)) · h + O h2 − (x(t) + f (x(t)) · h) = O h2 | {z } | {z } by Forward Euler by infinite Taylor series  Obviously, the order in the error made at one step O h2 , most commonly called the local error, depends on: • f having no unbounded derivatives – to see why, observe that if the derivative of f is infinite, then the residual term cannot be bounded by a constant multiplied by h2 . Fortunately, since most continuous time dynamic systems model some real system, this assumption is satisfied. • The solver used – other solvers, such as the midpoint method, are derived by truncating higher order terms of the Taylor series. For the midpoint method, the local truncation error  is O h3 ;  • Naturally, the larger the micro step size h is, the larger the local error O h2 is. The local error assumes that the solver only made one step, starting from an accurate point x(t). To compute the approximate behavior trace, the only accurate point the solver starts from is the initial value x(0). The rest of the trace is approximate and the error gets compounded over the multiple steps. For the Forward Euler method, if there is a limit to how f reacts to deviations on its parameter x̃(t) = x(t) + e(t) from the true parameter x(t), that is, if kf (x(t)) − f (x(t) + e(t))k ≤ const · e(t) and const < ∞, then the order of the total accumulation of error can be defined in terms of the micro-step size. This condition is called global Lipschitz continuity [80]. For the Forward Euler solver, the total (or global) error is O (h). For a solver to be useful, it must be convergent, that is, the computed trace must coincide with the accurate trace when h → 0 [252]. It means the error can be controlled by adjusting the micro step size h. The same concept of convergence applies to co-simulation but does, as the intuition suggests, decreasing the communication step size H lead to a more accurate co-simulation trace? This cannot be answered yet in general co-simulation because the behavior of the coupled model induced by the coupling of simulation units may not satisfy Lipschitz continuity. In the context of CT co-simulation, according to Arnold and Günther [11], Arnold et al. [14], Busch and Schweizer [52], Hafner et al. [114], Kübler and Schiehlen [141], if the simulation units are convergent and the coupled model induced by the scenario coupling conditions can be written in the state space form of eq. (10), then the co-simulation unit induced by any of the Jacobi, GaussSeidel, or Strong coupling methods, is convergent, with any polynomial extrapolation technique for the inputs. Presence of algebraic loops, complex coupling constraints (such as the one shown in section 4.3.1), are factors that may make it impossible to write the coupled model in state space form. See Arnold [10] for more examples. The local error vector, in a co-simulation, is defined as the deviation from the true trace after 34 one co-simulation step H, starting from an accurate point. x1 (t + H) − x̃1 (t + H) ··· xn (t + H) − x̃n (t + H) y1 (t + H) − ỹ1 (t + H) ··· yn (t + H) − ỹn (t + H) (39) where x̃i (t + H) = δi (t, xi (t), φui (t)), ỹi (t + H) = λi (t, x̃i (t + H), φui (t + H)), and xi (t + H) and yi (t + H) are the true state vectors and outputs, respectively, for simulation unit Si . For a convergent co-simulation unit, some of the techniques used traditionally in simulation to estimate the error, have been applied in co-simulation: Richardson extrapolation: This well-known technique is compatible with black-box simulation units as long as these provide rollback and state saving/restore capabilities [13, 15, 96]. The T essential idea is to get an estimate of the local error by comparing [x̃i (t + H), ỹi (t + H)] T with a less accurate point [x̄i (t + H), ȳi (t + H)] . The less accurate point can be computed by the same orchestrator but using a larger communication step size. We have seen that larger communication step sizes affect the accuracy so if the two points are not too far apart, it means the communication step H does not need to be changed. It is importance to notice T that the less accurate point [x̄i (t + H), ȳi (t + H)] has to be computed from the accurate T starting point [x̃i (t), ỹi (t)] . Multi-Order Input Extrapolation: The outputs of two different order input approximation methods are compared [52, 54]. Milne’s Device: Similar to the previous ones, but the extrapolation of the inputs is compared with its actual value, at the end of the co-simulation step. Iterative approaches such as the ones studied in Arnold [10], Arnold and Günther [11], Schweizer and Lu [214, 215, 216], Schweizer et al. [217, 218, 219] can readily benefit from this technique. Parallel Embedded Method: This technique runs a traditional adaptive step size numerical method in parallel with the co-simulation [119]. The purpose is to piggy back in the auxiliary method, the decisions on the step size. The derivatives being integrated in each simulation unit have to be either provided, or estimated. Conservation Laws: The local error is estimated based on the deviation from a known conservation law [207]. Extra domain knowledge about the coupling between simulation units is required. For example, if the couplings form power bonds [193], then energy should be conserved across a co-simulation step. In practice there is always an error due to the usual factors. The magnitude of the energy residual at a start and at end of a co-simulation step serves as an estimate of the local error. This technique has been implemented and studied in Sadjina et al. [207]. It has the advantage that it may not require rollback functionalities. Embedded Solver Method: If the individual simulation units support adaptive step size, then the decisions made internally can be made public to help the orchestrator decide on the communication step size. To the best of our knowledge, there is no orchestrator proposed that performs this, but the FMI Standard allows simulation units to reject too large communication step sizes [35, 46]. After the error is deemed too large by one of the above methods, the correction can be applied pessimistically (rollback and repeating the same step) or optimistically (adapt the next step). To 35 mitigate the overhead of a pessimistic approach, the corrections may be applied only to sensitive simulation units, as done in Verhoeven et al. [249]. Finally, the traditional simulation techniques can be applied to chose the right communication step size H: See Busch and Schweizer [52] for the PI-controller approach, and Gustafsson [112], Gustafsson et al. [113] for other techniques that can potentially be applied to co-simulation. 4.3.5 Compositional Stability In the previous section we have presented conditions in which an orchestration engine can reduce the communication step size to an arbitrarily small value in order to meet arbitrary accuracy. Theoretically, this is useful as it tells the orchestrator that by reducing the local error, it also reduces the global error. In practice, the communication step size cannot be reduced to an arbitrarily small value without facing performance and roundoff error problems. Performance because, for smaller communication step sizes, it takes more steps to compute a behavior trace over a given interval of time. Round-off accuracy because in a digital computer, real numbers can only be represented approximately. Computations involving very small real numbers incur a non-negligible round-off error. So that means that in practice convergence does not imply that arbitrary accuracy can be achieved. A better question is to analyze what happens to the global error, as the co-simulation trace is computed with a non-null communication step size H. Suppose that the analytical solution to the coupled model induced by the co-simulation scenario eventually goes to zero. This is the case for the coupled multi-body system of fig. 5, described in eq. (17), provided that at least one of the constants d1 or d2 is positive non-zero. Intuitively, this means that the system will lose energy over time, until it eventually comes to rest. Let x1 (t) denote the analytical solution of the position the mass m1 in the system, and let x˜1 (t) be the solution computed by a co-simulation unit. Then exi (t) = kx1 (t) − x˜1 (t)k denotes the global error at time t made by the co-simulation unit. If limt→∞ x1 (t) = 0, then limt→∞ exi (t) = x˜1 (t). If the co-simulation unit is convergent, then for an arbitrarily small H → 0, limt→∞ exi (t) → 0 will be arbitrarily small too. Since in practice we cannot take arbitrarily small H, we want to know whether there is some non-zero H such that limt→∞ x˜1 (t) = 0, thus driving exi (t) to zero as well. If that is the case, then it means that, assuming the system will eventually come to rest, the co-simulation unit will too. This property is called numerical stability. Contrarily to convergence, numerical stability is a property that depends on the characteristics of the system being co-simulated. Numerical stability is always studied assuming that the system being co-simulated is stable. It makes no sense to show that the co-simulation trace will grow unbounded provided that the system does too. It is a comparison of two infinities. One of the ways numerical stability in co-simulation can be studied is by calculating the spectral radius of the error in the co-simulation unit, written as an autonomous linear discrete system [49, 51]. To give an example, recall that the coupled model induced by the co-simulation scenario de- 36 scribed in eq. (24) can be written as:        0 1 0 x˙1 x1 = + 1 u1 d1 c1 − −m v˙1 v 1 m m1 1 | {z1 } | {z } B1 A1    1 0 x1 y1 = 0 1 v1 | {z } C1 (40)        0 0 0 1 x2 x˙2 + cc = dc dc u2 c −m − c2m+c v2 v˙2 m2 m2 2 2 {z } | | {z } A2 B2     x2   y2 = cc dc + −cc −dc u2 | {z } v2 {z } | C2 D2 with the coupling conditions u1 = y2 and u2 = y1 . In order to write the co-simulation model as an autonomous linear discrete system, we have to write what happens at a single co-simulation step t ∈ [nH, (n + 1)H] when executed by the orchestrator presented in Algorithm 3. Since the purpose is to analyze the stability of a co-simulation unit, and not the stability of each of the simulation units in the co-simulation, it is common to assume that the simulation units compute the analytical trace of the system. This enables the study of the stability properties of the co-simulation unit, starting from stable simulation units. From time t ∈ [nH, (n + 1)H], simulation unit S1 is computing the behavior trace of the following Initial Value Problem Ordinary Differential Equation (IVP-ODE):     x˙1 (t) x (t) = A1 1 + B1 u1 (nH) (41) v˙1 (t) v1 (t)  T with initial conditions x1 (nH) v1 (nH) given from the previous co-simulation step. The term u1 (nH) denotes the fact that we are assuming a constant extrapolation of the input in the interval t ∈ [nH, (n + 1)H].   x ((n + 1)H) eq. (41) is linear and time invariant, so the value of 1 can be given analytically v1 ((n + 1)H) [49] as: !     Z (n+1)H x1 ((n + 1)H) x (nH) 1 = eA1 H + eA1 ((n+1)H−τ ) dτ B1 u1 (nH) (42) v1 ((n + 1)H) v1 (nH) nH or, replacing the integration variable with s = τ − nH,     x1 ((n + 1)H) A1 H x1 (nH) =e + v1 ((n + 1)H) v1 (nH) Z e A1 (H−s) ds B1 u1 (nH) 0 | 37 ! H {z K1 } (43) P∞ 1 k where eX = k=0 k! X is the matrix exponential. Rewriting eq. (43) as a discrete time system gives us the computation performed by simulation unit S1 in a single co-simulation step, that is, the state transition function δ1 : " # " # (n+1) (n) x1 (n) A 1 H x1 (44) (n+1) = e (n) + K1 B1 u1 v1 v1 where z (n) = z(nH). At the end of the co-simulation step (t = (n + 1)H) the output of the first simulation unit, that is, its output function λ1 , is given by plugging in eq. (44) to the output y1 in eq. (40): " # (n) (n+1) (n) A1 H x1 y1 = C1 e (45) (n) + C1 K1 B1 u1 v1 Repeating the same procedure for the second simulation unit, yields the state transition δ2 and output functions λ2 : # # " " (n) (n+1) x2 (n) A 2 H x2 (n) + K2 B2 u2 (n+1) = e v2 v2 # " (46) (n) (n) (n+1) A2 H x2 y2 = C2 e (n) + (C2 K2 B2 + D2 ) u2 v2 RH with K2 = 0 eA2 (H−u) du. Since the coupling conditions are u1 = y2 and u2 = y1 , we can combine Equations 46, 45, and 41 into a single discrete time system: " (n) # " (n+1) # x1 x1  (n)   (n+1)   A H  v    v1 e 1 0̄ 0̄ K1 B1   1(n)   (n+1)     C1 eA1 H  y 0̄ 0̄ C1 K1 B1  "y1 #  " 1 #  (47) A2 H  (n+1)  =  0̄   x(n)  K 2 B2 e 0̄     x2 2  (n)   (n+1)  0̄ 0̄ C2 K2 B2 + D2 C2 eA2 H  |  v2 {z }  v2  (n) (n+1) A y2 y2 The above system is stable if the behavior traces remain bounded (e.g., by going to zero) as n → ∞. This can be checked by observing whether the spectral radius ρ(A) < 1. For parameters m1 = m2 = c1 = c2 = d1 = cc = dc = 1, d2 = 2, a communication step size of H = 0.001, ρ(A) = 0.9992, which means that the co-simulation unit is stable. If the damping constant were dk = 6.0E6, then the co-simulation unit would be unstable (ρ(A) ≈ 76.43). A stable co-simulation is shown in fig. 10. Different coupling methods, and different approximation functions yield different stability properties. See Busch [49, 50], Busch and Schweizer [51, 53] for the stability analysis of multiple coupling approaches and approximating functions. Stability of various co-simulation units has been also studied in Arnold [10], Gu and Asada [105], Kalmar-Nagy and Stanciulescu [128], Kübler and Schiehlen [142], Schweizer et al. [217]. The rules of thumb drawn from these papers can be summarized as: 38 1.0 0.5 Solution x1 v1 x2 v2 0.0 −0.5 −1.0 0.0 2.5 5.0 Time 7.5 10.0 Figure 10: Behavior trace of co-simulator described in eq. (47). Parameters are: m1 = m2 = c1 = c2 = d1 = cc = dc = 1, d2 = 2, H = 0.001. • Co-simulators that employ fixed point iteration techniques typically have better stability properties; • Gauss-Seidel coupling approach has slightly better stability properties when the order in which the simulation units compute is appropriate. For example, the simulation unit with the highest mass should be computed first [10]; The main problem is that in co-simulation applied to industrial problems, the solvers and models may be coupled in a black box to protect IP, so there is little knowledge about the kind of solver and model being used and its stability properties. The best is then to always use iterative techniques that have been shown to have better stability properties. However, these techniques require rollback functionalities which can be difficult to support for certain simulation units. Even if those functionalities are available, the cost of computing a co-simulation trace can be prohibitively high when compared with non-iterative approaches. This creates a paradox where industrial co-simulation units should make use of iterative techniques but the performance toll may be too high. 4.3.6 Compositional Continuity Let us for now assume that each CT simulation unit is a mock-up of a continuous system. A prerequisite is that the physical laws of continuity are obeyed. When using extrapolation in the inputs (e.g., constant extrapolation), these laws may not be obeyed, as discussed in Busch [50], Sadjina et al. [207]. Consider the point of view of a simulation unit Si in co-simulation. Throughout a co-simulation step t ∈ [nH, (n + 1)H] the input φui (t, ui (nH)) = ui (nH) is kept constant. At the next co-simulation step t ∈ [(n + 1)H, (n + 2)H], the input φui (t, ui ((n + 1)H)) = ui ((n + 1)H) may change radically if ui ((n + 1)H) is too far away from ui (nH). The discontinuities in the inputs may wreak havoc in the performance of the simulation unit Si , causing it to reduce inappropriately the micro step size, to reinitialize the solver [63], to discard useful information about the past (in multi-step solvers [8, 9]), and/or produce inaccurate values in its input extrapolation [191]. Furthermore, a discontinuity may be propagated to other simulation units, aggravating the problem. Most numerical methods assume that the input is a discretized version of a continuous trace. 39 That means that, when a discontinuity occurs, simulation unit Si cannot distinguish it from a very steep change in the continuous trace. The way traditional solvers deal with this behavior is to reduce the micro step size hi until the change is not so steep. This works with a continuous signal with a steep change, but does not work with a discontinuity: even if the micro-step size hi is reduced, the difference between limt→((n+1)H)− φui (t, ui (nH)) = ui (nH) and limt→((n+1)H)+ φui (t, ui ((n + 1)H)) = ui ((n + 1)H) is still the same, as it depends on the communication step size H and not on the micro step size hi . The solver will reduce the micro step size until a minimum is reached, at which point it gives up and finally advantages the micro step [63]. Most of the times this gives acceptable results but has a huge performance toll: when the solver is repeatedly retrying a small micro-step size, it does not advance the simulated time. This means that a huge computational effort goes to waste until the solver finally gives up [61]. We defer the discussion of the correct ways to deal with discontinuities to co-simulation scenario where discontinuities are welcome, section 5. In continuous co-simulation scenarios, discontinuities should not occur. A solution to avoid discontinuities in the input approximations is to use the extrapolated interpolation methods instead of constant extrapolation [49, 50, 75]. These methods ensure at least that limt→((n+1)H)− φui (t, ui (nH)) = limt→((n+1)H)+ φui (t, ui ((n + 1)H)). To give an example, we derive one possible linear extrapolated interpolation method for φui over the interval t ∈ [nH, (n + 1)H]. Since φui is linear, then φui (t, ui (nH), ui ((n − 1)H)) = b + a(t − nH), for some constants a, b. Let ūi (nH) = φui (nH, ui ((n − 1)H), ui ((n − 2)H)). To avoid discontinuities, we require that φui (nH, ui (nH), ui ((n − 1)H)) = ūi (nH). And we want that φui ((n + 1)H, ui (nH), ui ((n − 1)H)) = ui (nH). So putting these constraints together gives φui (t, ui (nH), ui ((n − 1)H)) = b + a(t − nH) ūi (nH) = φui (nH, ui ((n − 1)H), ui ((n − 2)H)) φui (nH, ui (nH), ui ((n − 1)H)) = ūi (nH) (48) φui ((n + 1)H, ui (nH), ui ((n − 1)H)) = ui (nH) Solving this system for φui (t, ui (nH), ui ((n − 1)H)) gives: φui (t, ui (nH), ui ((n − 1)H)) = ui ((n − 1)H) + 4.3.7 ui (nH) − ui ((n − 1)H) (t − nH) H (49) Real-time Constraints As introduced in section 2, the major challenge in real-time simulation is to ensure that a simulation unit is fast-enough to satisfy the timing constraint t = ατ . In real-time co-simulation, this challenge gets aggravated due to the presence of multiple simulation units, with different capabilities [222]. In order to enable real-time co-simulation, every simulation unit has to be fast enough. Furthermore, real-time co-simulation is often needed because one of the simulation unit is actually the original system, wrapped as a simulation unit. This means that measurements are performed to the state of the system, and this means noise in the signals. Therefore, the extrapolation functions used in the other simulation units have to be properly protected from the noise in the signal, using statistical techniques such as Kalman filtering [127]. Finally, the quality of the network is important, as the 40 real-time simulation units needs to receive their inputs in a timely manner. To mitigate this, the orchestration algorithm has to compensate for any delays in the receiving of data, and provide inputs to the real-time simulation unit [221]. 5 Hybrid Co-simulation Approach Sections 3 and 4 described the essential characteristics and assumptions of simulation units for each kind of co-simulation approach. When compared to a CT unit, whose state evolves continuously in time and whose output may have to obey to physical laws of continuity, a DE unit state can assume multiple values at the same time (transiency) and its output can dramatically change over a short period of time. For an orchestrator, a CT unit has some flexibility (safe for algebraic loops and ugly coupling conditions) in computing the co-simulation. In contrast, a DE simulation unit has to get inputs and produce outputs at the precise time some event occurs. And due to the potentially drastic change in the outputs, there is no Lipschitz continuous condition that allows predicting how a delay in the output of the DE unit can affect the overall co-simulation trace. For example, in the simulation unit of the mass-spring-damper system, eq. (22), with a constant extrapolation function, and running under the orchestrator in Algorithm 3, the change in the input can only affect the output after at least H units of time. For continuous time solvers in general, as can be seen for the explicit solver in eq. (12), a delayed response to the inputs is normal. These differences between CT and DE units are at the heart of many challenges in hybrid co-simulation scenarios, mixing the two. 5.1 Hybrid Co-simulation Scenarios We do not give a formal definition of a hybrid co-simulation scenarios because that is related to finding an appropriate standard for hybrid co-simulation, which is a non trivial challenge (see section 5.2.9) [47]. Instead, we define it broadly as mixing the characteristics and assumptions of both kinds of simulation units. These scenarios, together with an adequate orchestrator, can be used as mockups of hybrid systems [6, 57, 60, 162]. A thermostat regulating the temperature in a room is a classical example [161]. The continuous constituent system represents the temperature dynamics of the room, accounting for a source of heat (radiator). The discrete event part is a controller that turns on/off the radiator depending on the temperature. The continuous time simulation unit S1 simulates the following dynamics: ẋ = −α (x − 30q) x(0) = x0 (50) where x is the output temperature in the room, α > 0 denotes how fast the room can be heated (or cooled) down, and q ∈ {0, 1} is the control input that turns on/off the radiator. The discrete event simulation unit S2 simulates the statemachine shown in fig. 11, where one can think of the input event tooHot as happening when x(t) ≥ 21 and tooCold when x(t) ≤ 19. The output events off and on will assign the appropriate value to the input q of S1 . Therefore, the temperature x(t) is kept within a comfort region. Clearly, the two units cannot just be coupled together via input to output assignments. Any orchestrator for this co-simulation scenario has to reconcile the different assumptions about the inputs and output of each simulation unit. 41 Figure 11: Statemachine model of the controller constituent system. • The CT simulation unit expects a continuous input, whereas the output of the DE simulation unit is an event signal. • The output of the CT simulation unit is a continuous signal, whereas the DE simulation units expects an event signal as input. The coupling of continuous time and discrete event black box simulation units has been studied in the state of the art. In essence, two approaches are known, both based on creating a wrapper component around a simulation unit to adapt its behavior: Hybrid DE – wrap every CT unit as a DE simulation unit, and use a DE based orchestration; Hybrid CT – wrap every DE unit to become a CT unit and use a CT based orchestrator. According to the formalization that we have proposed for CT and DE simulation units, the Hybrid DE approach, applied to the thermostat example may involve: wrapping S1 as a DE simulation unit, S10 , with a time advance that matches the size of the co-simulation step; and keeping track of the output of S1 in order to produce an output event whenever it crosses the thresholds. Conversely, any output event from S2 has to be converted into a continuous signal for the input q(t) of S1 . Other examples of Hybrid DE are described in Awais et al. [19], Bolduc and Vangheluwe [37, 38], Camus et al. [55, 56], Fey et al. [84], Kofman and Junco [137], Kounev et al. [139], Kuhr et al. [146], Neema et al. [182], Nutaro [189], Quesnel et al. [202], Vangheluwe [244], Widl et al. [254], Yılmaz et al. [257], Zeigler [260]. The Hybrid CT, in our example, can be followed by wrapping the DE unit S2 as a CT unit that takes as input the temperature continuous signal, and internally reacts to an event caused by the crossing of the threshold. Conversely, the output event of S2 can be converted into a continuous signal q(t). Examples of the Hybrid CT include Denil et al. [70], Feldman et al. [83], Garro and Falcone [97], Lawrence et al. [150], Quaglia et al. [201], Tavella et al. [226], Tripakis [232]. Regardless of the approach taken, the properties of the constituent systems have to be retained: the fact that an otherwise discontinuous signal becomes continuous as a result of a linear or higher order extrapolation may not respect the properties of the coupled system. Knowledge of the domain and the simulation units is paramount. A third alternative, compared to only using Hybrid CT or Hybrid DE, is to have different mechanisms of orchestrating the simulation units depending on the semantic domain. For instance, in the actor modeling language Ptolemy II [200], an actor has many similarities to a simulation unit. Instead of using either Hybrid CT or Hybrid DE, a so called Director block is used for a particular set of connected actors. In this context, the notion of superdense time is fundamental, as also discussed in [47]. In the subsection below, different issues that arise in hybrid co-simulation will be described. These should be read in the light of hierarchical hybrid co-simulation scenarios, where composition42 ality is important. 5.2 5.2.1 Challenges Semantic Adaptation While a generic wrapper based on the underlying model of computation of the simulation unit can be used, as done in [68, 200], the realization of any of the approaches Hybrid DE or Hybrid CT depends on the concrete co-simulation scenario and the features of the simulation units [42, 178], as shown with the thermostat example. There is simply no best choice of wrappers for all scenarios. Even at the technical level, the manner in which the events or signals are sent to (or obtained from) the unit may need to be adapted [232]. To be concrete, the simulation unit S2 can assume that all events are communicated by encoding them in a single string signal, as opposed to having a different signal signal to denote different events. To account for this variability, the most common adaptations can be captured in a configuration language, as was done in Denil et al. [70], Meyers et al. [169], or in a specialization of a model of computation, as done in Kuhr et al. [146], Muller and Widl [176], Pedersen et al. [195]. These approaches require that a person with the domain knowledge describes how the simulation units can be adapted. Our choice of wrapper for the Hybrid DE approach is meant to highlight another problem with the adaptations of simulation units: the wrapper incorporates information that will ultimately have to be encoded in the software controller. As such, we argue that the need for sophisticated semantic adaptations should be smaller in later stages of the development of the components so that, for more refined models of the thermostat, the decision about when to turn off the radiator is not made by a wrapper of S1 . 5.2.2 Predictive Step Sizes In the Hybrid DE approach, the time advance has to be defined (recall eq. (1)). Setting it to whatever co-simulation step size H the orchestrator decides will work, but the adapted simulation unit may produce many absent output events. Better adaptations have been proposed. In the thermostat example, S10 can propose a time advance that coincides with the moment that x(t) will leave the comfort region, thereby always being simulated at the relevant times. Naturally, these approaches rely in information that may expose the IP of simulation units. Others try to adaptively guess the right time advance by monitoring other conditions of interest, set over the own dynamics of the adapted simulation unit, the most common approach being the quantization of the output space [38, 136, 137, 190, 261]. The capability to predict the time advance is also useful to enhance the performance/accuracy of CT based co-simulation, as shown in Broman et al. [46]. 5.2.3 Event Location Locating the exact time at which a continuous signal crosses a threshold is a well known problem [39, 41, 263] and intimately related to guessing the right time advance for predicting the step size [56, 96]. To address this, solutions typically require derivative information of the signal that causes the event, and/or the capability to perform rollbacks. In the thermostat example, a co-simulation that shows the output q of the controller changing from 0 to 1 at time te while the temperature of 43 the room x actually crossed the confort zone at te − k, for k > 0, may not be accurate if k is too large. Note that k is a consequence of the decisions made in the orchestrator. 5.2.4 Discontinuity Identification Until here, we have based our discussion in the knowledge of what kind of simulation units comprise a co-simulation. In a general hierarchical co-simulation, a simulation unit’s output may be an event signal coming from a wrapper of a CT unit, or vice-versa. In any case, at runtime, a signal is often represented as a set of time-stamped points. Observing this sequence of points alone does not make it possible to discern a steep change in a continuous signal, from a true discontinuity, that occurs in an event signal [47, 154, 172, 263]. Extra information is currently used: a) a formalization of time which include the notion of absent signal, as proposed in Broman et al. [47], Lee and Zheng [154], Tavella et al. [226]; or b) an extra signal can be used to discern when a discontinuity occurs, as done in the FMI for Model Exchange [35], even facilitating the location of the exact time of the discontinuity; or c) symbolic information (e.g., Dirac impulses [72]) that characterize a discontinuity can be included, as done in Nilsson [186] 5.2.5 Discontinuity Handling Once a discontinuity is located, how it is handled depends on the nature of the simulation units and their capabilities. If the simulation unit is a mock-up of a continuous system then, traditionally, discontinuities in the inputs should be handled by reinitializing the simulation unit [63]. This step can incur a too high performance cost, especially with multi-step numerical methods, and Andersson [8], Andersson et al. [9] proposes an improvement for these solvers. Furthermore, a discontinuity can cause other discontinuities, producing a cascade of re-initializations. During this process, which may not finish, care must be taken to ensure that physically meaningful properties such as energy distribution, are respected [174]. 5.2.6 Algebraic Loops, Legitimacy, and Zeno Behavior Algebraic loops are non-causal dependencies between simulation units that can be detected using feedthrough information, as explained in section 4.3.2. In CT based co-simulation, the solution to algebraic loops can be attained by a fixed point iteration technique, as covered in section 4.3.2. There is the possibility that the solution to an algebraic loop will fail to converge. The result is that, if left unchecked, the orchestrator would move an infinite number of input and output values between simulation units, at the same point in time. In DE based co-simulation a related property is legitimacy [262], which is the undesirable version of the transiency property, explained in section 3. A illegitimate co-simulation scenario will cause the co-simulation orchestrator to move an infinite number of events with the same timestamp between units, never advancing time. Distance matrices, used to optimize parallel optimistic approaches, as explained in Fujimoto [94] and used in Ghosh et al. [101], can be leveraged to detect statically the presence of some classes of illegitimacy. A similar behavior, but more difficult to detect is Zeno behavior. It occurs when there is an increasingly small interval of time between two consecutive events, up to the point that the the sum of all these intervals is finite [238]. However, while illegitimate behaviors are not desired in pure DE co-simulation, at least in the theoretical sense, Zenoness is a desired feature in some hybrid co-simulation scenarios. We say in the theoretical sense because, for the purposes of co-simulation, 44 scenarios with Zenoness still have to be recognized and appropriate measures, such as regularization [125], have to be taken. 5.2.7 Stability If a hybrid co-simulation represents a hybrid or switched system [126, 238], then it is possible that a particular sequence of events cases the the system to become unstable, even if all the individual continuous modes of operation are stable. New analyses are required to identify whether the CT units can yield unstable trajectories as a result of the events of wrapped DE simulation units, while keeping the IP hidden. 5.2.8 Theory of DE Approximated States In a pure DE based co-simulation, if round-off errors are neglected, the computed trajectories are essentially exact. To the best of our knowledge, only Zeigler et al. [262] addresses theoretically how the error in a discrete event system can be propagated. In CT based co-simulation however, error is an accepted and well studied and techniques exist to control it. In Hybrid co-simulation, there is a need for analysis techniques that provide bounds on the error propagation in the DE simulation units, when these are coupled to sources of error. In addition, based on these analyzes, it should be possible for a DE simulation unit to recognize that its error has exceeded a given tolerance, and measures should be taken to reduce that error. Having these techniques in place allows a hybrid co-simulation orchestrator to take appropriate measures (e.g., adapt the communication step size, etc. . . ) the keep the error bounded in every simulation unit. 5.2.9 Standards for Hybrid Co-simulation While for CT co-simulation there is the Functional Mock-up Interface (FMI) standard [35], and for DE co-simulation there is the High Level Architecture (HLA) [2] standard, as of the time of writing, both standards have limitations for hybrid co-simulation. Bogomolov et al. [36], Garro and Falcone [97], Tavella et al. [226] use/propose extensions to the FMI standard and Awais et al. [18] proposes techniques to perform CT simulation conforming to HLA. Recognizing that hybrid co-simulation is far from well studied, Broman et al. [47] proposes a set of idealized test cases that any hybrid co-simulation unit, and underlying standard, should pass. In particular, it is important to have correct handling and representation of time, to achieve a sound approach for simultaneity. Finally, even with a standardized interface, simulation units are not all equal: a fact that makes coding an orchestration algorithm a real challenge. A possible approach to deal with this heterogeneity, proposed in Gomes [102], is to assume that all units implement the same set of features, code the orchestration algorithm for those features, and delegate to wrappers the responsibility of leveraging extra features (or mitigating the lack of). In the section below, these features are classified. 6 Classification Having described the multiple facets of co-simulation, this section summarizes our classification and methodology. 45 Non-Functional Requirements Platform Independence Configuration Reusability Scalability Performance Co-Simulation Extensibility IP Protection Accuracy Hierarchy Non-Functional Requirements Simulator Requirements Framework Requirements Fault Tolerance Optional Open-source Legend Feature Mandatory Figure 12: Top-level. 6.1 Distribution Feature Optional Parallelism Figure 13: Non-Functional Requirements. Methodology To find an initial set of papers related to co-simulation, we used Google Scholar with the keywords “co-simulation”, “cosimulation”, “coupled simulation”, and collected the first 10 pages of papers. Every paper was then filtered by the abstract, read in detail, and its references collected. To guide our reading to the most influential papers, we gave higher priority to most cited (from the papers that we have collected). We read approximately 30 papers to create the initial version of the taxonomy. Then, as we read new papers, we constantly revised the taxonomy and classified them. After a while, new references did not cause revisions to the taxonomy, which prompted us to classify the collected papers in a more systematic fashion: all the papers that we collected from 2011 (inclusive) up to, and including, 2016 were classified. Two main reasons justify the last 5 years interval: limited time; and most of the papers refer to, and are based on, prior work. As a consequence, the classification would be very similar for many of the related references prior to 2011. From the papers classified, those that report case studies where noted to create fig. 1. 6.2 Taxonomy The taxonomy is represented as a feature model [129] structured in three main categories, shown in fig. 12: Non-Functional Requirements (NFRs): Groups concerns (e.g., performance, accuracy, and IP Protection) that the reference addresses. Simulation unit Requirements (SRs): Features required/assumed from the simulation units by the orchestrator described in the paper. Examples: Information exposed, causality, local/remote availability, or rollback support. Framework Requirements (FRs): Features provided by the orchestrator. Examples: dynamic structure, adaptive communication step size, or strong coupling support. Each main group is detailed in Figures 13, 14, and 15. Abstract features denote concepts that can be easily detailed down but we chose not to, for the sake of brevity. Mandatory features are required for the activity of co-simulation while optional are not. 46 6.3 State of the Art To give an example on how the taxonomy is used, consider the work in Van Acker et al. [236], where an FMI based multi-rate orchestration algorithm is generated from a description of the co-simulation scenario. In the paper, the description language introduced can be reused in a tool-agnostic manner. The orchestration code generator analyzes the co-simulation scenario, and: a) identifies algebraic loops using I/O feedthrough information; b) separates the fast moving simulation units from the slow moving ones, using the preferred step size information, and provides interpolation to the fast ones (multi-rate); and c) finds the largest communication step size that divides all step sizes suggested by simulation units and uses it throughout the whole co-simulation. We argue that the generated orchestrator is fast because all the decisions are made at code generation stage. The algebraic loops are solved via successive substitution of inputs, storing and restoring the state of the simulation units. Based on these facts, Van Acker et al. [236] can be classified as follows: Non-Functional requirements: Performance, IP protection, and Configuration reusability; Simulation unit requirements: Causal simulation units, Locally available simulation units, Preferred step size information about the solver, Feedthrough I/O causality information, State values, No time constraints, and No rollback support; Framework requirements: Continuous time domain, Multi-rate simulation, Fixed communication step size, Input/Output coupling, Fully implicit strong coupling support, Postmortem visualization of results, Postmortem visualization of results, FMI as the underlying standard, Gauss-seidel communication approach, and Support for three or more simulation units. With similar reasoning, the FMI standard for co-simulation, version 2.0, can be classified according to the assumptions it makes about the participating simulation units. These are highlighted in fig. 14. The remaining state of the art is classified in Figures 16 – 19. The raw data is available online13 . 6.4 Discussion Observing fig. 16, Accuracy is the most observed NFR, with 31 reports, followed by IP protection and Performance. The least observed NFRs are Fault tolerance, Hierarchy and Extensibility. Fault tolerance is especially important for long running co-simulations. One of the industrial partners of the INTO-CPS project has running co-simulations that takes a minimum of two weeks to complete. We argue that Extensibility (the ability to easily accomodate new features) should be given more importance: if an heterogeneous set of simulation units participate in the same co-simulation scenario, the combination of capabilities provided (see fig. 14) can be huge. Thus, the orchestrator can either assume a common homogeneous set of capabilities, which is the most common approach, or can leverage the capabilities provided by each one. The later approach can lead to an extremely complex orchestration algorithm. In any case, extensibility is key to address new semantic adaptations (recall section 5.2.1). As fig. 18 suggests, we could not find approaches that make use of the nominal values of state and output variables, even though these are capabilities supported in the FMI Standard (see fig. 14), and are useful to detect co-simulations that are not valid. A-causal approaches are important for modularity, as explained in section 4.3.1, but these are scarce too. 13 http://msdl.cs.mcgill.ca/people/claudio/pub/Gomes2016bClassificationRawData/raw_data.zip 47 As for the framework requirements, in fig. 19, the least observed features are dynamic structure co-simulation, interactive visualization, multi-rate, algebraic coupling, and partial/full strong coupling support. This can be explained by the fact that these features depend upon the capabilities of the simulation units, which may not be mature. Figures 16 – 19 do not tell the full story because they isolate each feature. Feature interaction is a common phenomenon, and among many possible interactions, we highlight the accuracy concern, domain of the co-simulation, number of simulation units supported, and IP protection. As can be seen from fig. 21, there is only one approach [146] that is both CT and DE based, up to any number of simulation units. Note that this does not mean that the work addresses all challenges that were identified in section 5. Accommodating the different CT and DE domains means that the approach assumes that the simulation units can behave both as a CT and as a DE unit. The concern with IP protection is evident in fig. 16 but the number of DE and CT based approaches that provide some support for it is small, as shown in fig. 20. Similarly, as fig. 22 suggests, accuracy does not show up a lot in the DE and CT approaches, for more than two simulation units. Accuracy is particularly important in interactions between DE and CT simulation units. In general, from the observed classification, there is a lack of research into approaches that are both DE and CT based, and that leverage the extra the features from the simulation units. 7 Concluding Remarks As this work shows, there are many interesting challenges to be explored in co-simulation, which will play a key role in enabling the virtual development of complex heterogeneous systems in the decades to come. The early success can be attributed to a large number of reported applications. However, from the application references covered (see fig. 1), the large majority represent ad-hoc couplings between two simulators of two different domains (e.g., a network simulator with a power grid one, or a HVAC simulator with a building envelop one). This, however, excludes the (potentially many) unreported applications of co-simulation. As systems become complex, the demand for cosimulation scenarios that are large, hierarchical, heterogeneous, accurate, IP protected, and so on, will increase. This survey presents an attempt at covering the main challenges in co-simulation. To tackle such a broad topic, we have covered the two main domains —continuous time and discrete event based co-simulation— separately and then surveyed the challenges that arise when the two domains are combined. A taxonomy is proposed and a classification of the works related to co-simulation in the last five years is carried out using that taxonomy. From the challenges, we highlight semantic adaptation, modular coupling, stability and accuracy, and finding a standard for hybrid co-simulation as being particular important. For early system analysis, the adaptations required to combine simulators from different formalisms, even conforming to the same standard, are very difficult to generalize to any co-simulation scenario. A possible work around this is to allow the system integrator to describe these, as proposed in [70]. One of the main conclusions of the classification is that there is lack of research into modular, stable and accurate coupling of simulators in dynamic structure scenarios. This is where a-causal approaches for co-simulation can play a key role. The use of bi-directional effort/flow ports can be a solution inspired by Bond-graphs [193], and there is some work in [207] already in this direction. Finally, this document is an attempt to summarize, bridge, and enhance the future research in co-simulation, wherever it may lead us to. 48 Acknowledgment The authors wish to thank Yentl Van Tendeloo, for the in depth review of DE based co-simulation, Kenneth Guldbrandt Lausdahl for providing valuable input and discussions throughout the making of this survey, and TWT GmbH for the valuable input on everyday challenges faced by a cosimulation master. This research was partially supported by Flanders Make vzw, the strategic research centre for the manufacturing industry, and a PhD fellowship grant from the Agency for Innovation by Science and Technology in Flanders (IWT). In addition, the work presented here is partially supported by the INTO-CPS project funded by the European Commission’s Horizon 2020 programme under grant agreement number 664047. This project is financially supported by the Swedish Foundation for Strategic Research. 49 Simulator Requirements Causality Causal Rollback Support A-causal None Availability Local None Scaled RT Static Model Dynamic Solver Micro-step Outputs Deadreckoning Model Detailed Model Nominal Values Discontinuity Indicator Preferred Outputs State Order of Step-size Accuracy State Frequency Multiple Remote Information Exposed Outputs Single Time Constraints Next Values WCET I/O Signal Kind Serialization Input Extrapolation I/O Causality State Derivative Time Outputs Jacobian State Outputs Propagation Feedthrough Delay Dependency Kind State Non-Linear Linear Abstract Feature Feature FMI CS 2.0 Mandatory Exclusive Or Optional Or Figure 14: Simulation Unit Requirements and features provided in the FMI Standard for cosimulation, version 2.0. 50 Framework Requirements Dynamic Structure No. Simulators Domain CT 2 DE Comm. Approach Co-simulation Rate Jacobi Feature Single 3+ Multiple Comm. Step Size Fixed Mandatory Exclusive Or Optional Or Standard HLA FDMU FMI Results Visualization Adaptive Coupling I/O Assignment Gauss-seidel Live Algebraic Constraints Postmortem Interactive Strong Coupling Support None Semi-Implicit Fully Implicit Category Figure 15: Framework Requirements. Platform Independence Performance IP Protection Hierarchy Fault Tolerance Open−source Parallelism Distribution Accuracy Extensibility Config. Reusability ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 2000 2005 Year ● ● ● ● ● ● 2010 ● ● ● ● ● ● ● ● ● ● ● ● Total 11 25 ● 25 Reports 3 8 1 6 6 4 ● 21 2 ● 24 ● 31 4 7 ● ● ● 2015 Figure 16: Classification with respect to non-functional requirements. 51 A−Causal Causal Category Locally Available ● Remotely Available No Time Constraints ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Fixed Real−Time Constraints ● ●●● ● ●● ●● ● ●●● ● ● ● ● ● ● ●● ● ●● ● ● ● Dynamic Real−Time Constraints ● ● ● No Rollback Single Rollback ● ● ● ●●● ● ●● ● ● ● Reports 12 9 6 3 ● ● ● ● ● ● ● Multi Rollback 2000 2005 2010 Year 2015 Category Figure 17: Classification with respect to simulation unit requirements: execution capabilities. State Nominal Values Output Nominal Values Input Extrapolation Model Kind of Signal Frequency of Outputs Preferred Step Size Next Step Size I/O Feedthrough Worst Case Exec. Time State Values Serialized State Micro−step Outputs State Jacobian Output Jacobian State Derivatives Output Derivatives ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Reports 4 3 2 1 ● ● ● 2000 ● 2005 Year ● ● 2010 2015 Figure 18: Classification with respect to simulation unit requirements: information exposed. 52 Category Dynamic DE Domain CT Domain Single Rate Multi−Rate Fixed Comm. Step Adaptive Comm. Step I/O Coupling Alg. Constraints Coupling No Strong Coupling Partial Strong Coupling Full Strong Coupling Post Mortem Visualization Live Visualization Interactive Visualization FMI Based HLA Based FDMU Based Jacobi Communication Gauss−Seidel Communication Two Simulators More than Three Simulators ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●●●●● ● ● ● ● ● ● ●●● ● ●● ● ● ● ● ● ● ● ● ● ● ● Reports 12 ● 9 ● ● 6 ●●● ●●● 3 ● ● ● ● ●●● ●●● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 2000 ● ● ● ● ● 2005 Year ● ● ● ● ●● ●●● ● ●●● ● ● ● ● ●● ● ● ● 2010 ● ● 2015 CT ● ● ● DE DE+CT Domain Reports 40 30 20 10 3+ 2 ● ● CT ● ● ● ● DE DE+CT Domain Reports 30 20 10 No. Simulators ● ● 3+ ● ● ● 2 ● ● ● 3+ ● ● ● ● ● 2 ● CT No Accuracy No ● No. Simulators Yes Accuracy IP Protection Figure 19: Classification with respect to framework requirements. Reports 20 15 10 5 DE DE+CT Domain Figure 20: Formalisms vs IP Figure 21: Formalisms vs Sim- Figure 22: Accuracy vs ForProtection. ulation units. malisms vs Simulation units. 53 References [1] Modelica - A Unified Object-Oriented Language for Physical Systems Modeling, 2007. URL https://www.modelica.org/documents/ModelicaSpec30.pdf. [2] IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA) - Federate Interface Specification, 2010. URL https://standards.ieee.org/findstds/standard/ 1516-2010.html. [3] An-jelo Gian C. Abad, Lady Mari Faeda G. Guerrero, Jasper Kendall M. Ignacio, Dianne C Magtibay, Mark Angelo C Purio, and Evelyn Q Raguindin. A simulation of a power surge monitoring and suppression system using LabVIEW and multisim co-simulation tool. In 2015 International Conference on Humanoid, Nanotechnology, Information Technology,Communication and Control, Environment and Management (HNICEM), pages 1–3. IEEE, dec 2015. ISBN 978-1-5090-0360-0. doi: 10.1109/HNICEM.2015.7393204. [4] Andreas Abel, Torsten Blochwitz, Alexander Eichberger, Peter Hamann, and Udo Rein. Functional mock-up interface in mechatronic gearshift simulation for commercial vehicles. In 9th International Modelica Conference. Munich, 2012. [5] Ahmad T. Al-Hammouri. A comprehensive co-simulation platform for cyber-physical systems. Computer Communications, 36(1):8–19, dec 2012. doi: 10.1016/j.comcom.2012.01.003. [6] R. Alur, C. Courcoubetis, N. Halbwachs, T. A. Henzinger, P. H. Ho, X. Nicollin, A. Olivero, J. Sifakis, and S. Yovine. The algorithmic analysis of hybrid systems. Theoretical Computer Science, 138(1):3–34, feb 1995. ISSN 03043975. doi: 10.1016/0304-3975(94)00202-T. [7] Andrés A. Alvarez Cabrera, Krijn Woestenenk, and Tetsuo Tomiyama. An architecture model to support cooperative design for mechatronic products: A control design case. Mechatronics, 21(3):534–547, apr 2011. ISSN 09574158. doi: 10.1016/j.mechatronics.2011.01.009. [8] Christian Andersson. Methods and Tools for Co-Simulation of Dynamic Systems with the Functional Mock-up Interface. PhD thesis, Lund University, 2016. [9] Christian Andersson, Claus Führer, and Johan Åkesson. Efficient Predictor for Co-Simulation with Multistep Sub-System Solvers. Technical Report in Mathematical Sciences, 2016(1), 2016. ISSN 1403-9338. URL http://lup.lub.lu.se/record/ dbaf9c49-b118-4ff9-af2e-e1e3102e5c22. [10] Martin Arnold. Stability of Sequential Modular Time Integration Methods for Coupled Multibody System Models. Journal of Computational and Nonlinear Dynamics, 5(3):031003, may 2010. ISSN 15551423. doi: 10.1115/1.4001389. [11] Martin Arnold and Michael Günther. Preconditioned Dynamic Iteration for Coupled Differential-Algebraic Systems. BIT Numerical Mathematics, 41(1):1–25, 2001. doi: 10.1023/ A:1021909032551. [12] Martin Arnold, Antonio Carrarini, Andreas Heckmann, and Gerhard Hippmann. Simulation techniques for multidisciplinary problems in vehicle system dynamics. In Vehicle System Dynamics Supplement 40, volume 40, pages 17–36, Vienna, Austria, 2003. 54 [13] Martin Arnold, Christoph Clauss, and Tom Schierz. Error Analysis and Error Estimates for Co-Simulation in FMI for Model Exchange and Co-Simulation V2.0. Archive of Mechanical Engineering, LX(1):75, jan 2013. ISSN 0004-0738. doi: 10.2478/meceng-2013-0005. [14] Martin Arnold, Christoph Clauß, and Tom Schierz. Error Analysis and Error Estimates for Co-simulation in FMI for Model Exchange and Co-Simulation v2.0. In Sebastian Schöps, Andreas Bartel, Michael Günther, W E Jan ter Maten, and C Peter Müller, editors, Progress in Differential-Algebraic Equations, pages 107–125. Springer Berlin Heidelberg, Berlin, Heidelberg, 2014. ISBN 978-3-662-44926-4. doi: 10.1007/978-3-662-44926-4 6. [15] Martin Arnold, Stefan Hante, and Markus A Köbis. Error analysis for co-simulation with force-displacement coupling. PAMM, 14(1):43–44, dec 2014. ISSN 16177061. doi: 10.1002/ pamm.201410014. [16] Memduha Aslan, Umut Durak, and Koray Taylan. MOKA: An Object-Oriented Framework for FMI Co-Simulation. 2015. [17] Karl Johan Aström and Richard M Murray. Feedback systems: an introduction for scientists and engineers. Princeton university press, 2010. ISBN 1400828732. [18] Muhammad Usman Awais, Wolfgang Mueller, Atiyah Elsheikh, Peter Palensky, and Edmund Widl. Using the HLA for Distributed Continuous Simulations. In 2013 8th EUROSIM Congress on Modelling and Simulation, pages 544–549, Washington, DC, USA, sep 2013. IEEE. ISBN 978-0-7695-5073-2. doi: 10.1109/EUROSIM.2013.96. [19] Muhammad Usman Awais, Peter Palensky, Atiyah Elsheikh, Edmund Widl, and Stifter Matthias. The high level architecture RTI as a master to the functional mock-up interface components. In 2013 International Conference on Computing, Networking and Communications (ICNC), pages 315–320, San Diego, USA, jan 2013. IEEE. ISBN 978-1-4673-5288-8. doi: 10.1109/ICCNC.2013.6504102. [20] Muhammad Usman Awais, Peter Palensky, Wolfgang Mueller, Edmund Widl, and Atiyah Elsheikh. Distributed hybrid simulation using the HLA and the Functional Mock-up Interface. In IECON 2013 - 39th Annual Conference of the IEEE Industrial Electronics Society, pages 7564–7569, Vienna, Austria, nov 2013. IEEE. ISBN 978-1-4799-0224-8. doi: 10.1109/IECON. 2013.6700393. [21] Fernando J. Barros. Modeling formalisms for dynamic structure systems. ACM Transactions on Modeling and Computer Simulation, 7(4):501–515, oct 1997. ISSN 10493301. doi: 10. 1145/268403.268423. [22] Fernando J Barros. Dynamic structure multiparadigm modeling and simulation. ACM Transactions on Modeling and Computer Simulation, 13(3):259–275, jul 2003. ISSN 10493301. doi: 10.1145/937332.937335. [23] Fernando J. Barros. Semantics of dynamic structure event-based systems. In Proceedings of the second international conference on Distributed event-based systems - DEBS ’08, DEBS ’08, page 245, New York, USA, 2008. ACM Press. ISBN 9781605580906. doi: 10.1145/1385989. 1386020. 55 [24] Paul I. Barton and C. C. Pantelides. Modeling of combined discrete/continuous processes. AIChE Journal, 40(6):966–979, jun 1994. ISSN 0001-1541. doi: 10.1002/aic.690400608. [25] Jens Bastian, Christoph Clauß, Susann Wolf, and Peter Schneider. Master for Co-Simulation Using FMI. In 8th International Modelica Conference, pages 115–120, Dresden, Germany, jun 2011. Fraunhofer Institute for Integrated Circuits IIS. doi: 10.3384/ecp11063115. [26] Lionel Belmon, Yujung Geng, and Huaqiang He. Virtual Integration for hybrid powertrain development, using FMI and Modelica models. 10th International Modelica Conference, 2014. [27] Giovanni Beltrame, Donatella Sciuto, and Cristina Silvano. Multi-Accuracy Power and Performance Transaction-Level Modeling. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 26(10):1830–1842, oct 2007. ISSN 0278-0070. doi: 10.1109/TCAD.2007.895790. [28] Abir Ben Khaled, Mongi Ben Gaid, Nicolas Pernet, and Daniel Simon. Fast multi-core cosimulation of Cyber-Physical Systems: Application to internal combustion engines. Simulation Modelling Practice and Theory, 47:79–91, sep 2014. ISSN 1569190X. doi: 10.1016/j.simpat. 2014.05.002. [29] M. Benedikt, D. Watzenig, J. Zehetner, and A. Hofer. Macro-step-size selection and monitoring of the coupoling error for weak coupled subsystems in the frequency-domain. V International Conference on Computational Methods for Coupled Problems in Science and Engineering, pages 1–12, 2013. [30] Martin Benedikt and Anton Hofer. Guidelines for the Application of a Coupling Method for Non-iterative Co-simulation. In 2013 8th EUROSIM Congress on Modelling and Simulation, pages 244–249. IEEE, sep 2013. ISBN 978-0-7695-5073-2. doi: 10.1109/EUROSIM.2013.52. [31] Martin Benedikt and Franz Rudolf Holzinger. Automated configuration for non-iterative co-simulation. In 17th International Conference on Thermal, Mechanical and Multi-Physics Simulation and Experiments in Microelectronics and Microsystems (EuroSimE), pages 1–7, Montpellier, apr 2016. IEEE. ISBN 978-1-5090-2106-2. doi: 10.1109/EuroSimE.2016.7463355. [32] Albert Benveniste, Benoı̂t Caillaud, and Paul Le Guernic. Compositionality in Dataflow Synchronous Languages: Specification and Distributed Code Generation. Information and Computation, 163(1):125–171, nov 2000. ISSN 08905401. doi: 10.1006/inco.2000.9999. [33] D. Bian, M. Kuzlu, M. Pipattanasomporn, S. Rahman, and Y. Wu. Real-time co-simulation platform using OPAL-RT and OPNET for analyzing smart grid performance. In 2015 IEEE Power & Energy Society General Meeting, pages 1–5. IEEE, jul 2015. ISBN 978-1-4673-8040-9. doi: 10.1109/PESGM.2015.7286238. [34] Torsten Blochwitz, Martin Otter, Martin Arnold, C. Bausch, Christoph Clauss, Hilding Elmqvist, Andreas Junghanns, Jakob Mauss, M. Monteiro, T. Neidhold, Dietmar Neumerkel, Hans Olsson, J.-V. Peetz, and S. Wolf. The Functional Mockup Interface for Tool independent Exchange of Simulation Models. In 8th International Modelica Conference, pages 105–114, Dresden, Germany, jun 2011. Linköping University Electronic Press; Linköpings universitet. doi: 10.3384/ecp11063105. 56 [35] Torsten Blockwitz, Martin Otter, Johan Akesson, Martin Arnold, Christoph Clauss, Hilding Elmqvist, Markus Friedrich, Andreas Junghanns, Jakob Mauss, Dietmar Neumerkel, Hans Olsson, and Antoine Viel. Functional Mockup Interface 2.0: The Standard for Tool independent Exchange of Simulation Models. In 9th International MODELICA Conference, pages 173–184, Munich, Germany, nov 2012. Linköping University Electronic Press; Linköpings universitet. doi: 10.3384/ecp12076173. [36] Sergiy Bogomolov, Marius Greitschus, Peter G. Jensen, Kim G. Larsen, Marius Mikucionis, Thomas Strump, and Stavros Tripakis. Co-Simulation of Hybrid Systems with SpaceEx and Uppaal. In 11th International Modelica Conference (MODELICA), pages 159–169, Paris, France, sep 2015. Linköping University Electronic Press. doi: 10.3384/ecp15118159. [37] Jean-Sébastien Bolduc and Hans Vangheluwe. Expressing ODE models as DEVS: Quantization approaches. In Proceedings of the AIS’2002 Conference (AI, Simulation and Planning in High Autonomy Systems), April 2002, Lisboa, Portugal/F. Barros and N. Giambiasi (eds.), pages 163–169, 2002. [38] Jean-Sébastien Bolduc and Hans Vangheluwe. Mapping odes to devs: Adaptive quantization. In Summer Computer Simulation Conference, pages 401–407. Society for Computer Simulation International; 1998, 2003. ISBN 0094-7474. [39] Massimo Bombino and Patrizia Scandurra. A model-driven co-simulation environment for heterogeneous systems. International Journal on Software Tools for Technology Transfer, 15 (4):363–374, aug 2013. ISSN 1433-2779. doi: 10.1007/s10009-012-0230-5. [40] Spencer Borland. Transforming statechart models to DEVS. PhD thesis, 2003. [41] F. Bouchhima, M. Briere, G Nicolescu, M Abid, and E. Aboulhamid. A SystemC/Simulink Co-Simulation Framework for Continuous/Discrete-Events Simulation. In 2006 IEEE International Behavioral Modeling and Simulation Workshop, pages 1–6. IEEE, sep 2006. ISBN 0-7803-9742-8. doi: 10.1109/BMAS.2006.283461. [42] Frédéric Boulanger, Cécile Hardebolle, Christophe Jacquet, and Dominique Marcadet. Semantic Adaptation for Models of Computation. In Application of Concurrency to System Design (ACSD), 2011 11th International Conference on, pages 153–162, 2011. ISBN 1550-4808 VO -. doi: 10.1109/ACSD.2011.17. [43] Jonathan Brembeck, Andreas Pfeiffer, Michael Fleps-Dezasse, Martin Otter, Karl Wernersson, and Hilding Elmqvist. Nonlinear State Estimation with an Extended FMI 2.0 Co-Simulation Interface. In Proceedings of the 10th International Modelica Conference. Lund, Sweden, pages 53–62, 2014. [44] T. Brezina, Z. Hadas, and J. Vetiska. Using of Co-simulation ADAMS-SIMULINK for development of mechatronic systems. In 14th International Conference Mechatronika, pages 59–64. IEEE, jun 2011. ISBN 978-80-8075-477-8. doi: 10.1109/MECHATRON.2011.5961080. [45] David Broman, Edward A. Lee, Stavros Tripakis, and Martin Törngren. Viewpoints, Formalisms, Languages, and Tools for Cyber-Physical Systems. In Proceedings of the 6th International Workshop on Multi-Paradigm Modeling, pages 49–54. ACM, 2012. 57 [46] David Broman, Christopher Brooks, Lev Greenberg, Edward A. Lee, Michael Masin, Stavros Tripakis, and Michael Wetter. Determinate composition of FMUs for co-simulation. In Eleventh ACM International Conference on Embedded Software, Montreal, Quebec, Canada, 2013. IEEE Press Piscataway, NJ, USA. ISBN 978-1-4799-1443-2. [47] David Broman, Lev Greenberg, Edward A Lee, Michael Masin, Stavros Tripakis, and Michael Wetter. Requirements for Hybrid Cosimulation Standards. In Proceedings of the 18th International Conference on Hybrid Systems: Computation and Control, HSCC ’15, pages 179–188, New York, NY, USA, 2015. ACM. ISBN 978-1-4503-3433-4. doi: 10.1145/2728606.2728629. [48] Richard L. Burden and John Douglas Faires. Numerical Analysis. Cengage Learning, 9 edition, 2010. ISBN 0538733519. [49] Martin Busch. On the efficient coupling of simulation codes. kassel university press GmbH, 2012. ISBN 3862192962. [50] Martin Busch. Continuous approximation techniques for co-simulation methods: Analysis of numerical stability and local error. ZAMM - Journal of Applied Mathematics and Mechanics / Zeitschrift für Angewandte Mathematik und Mechanik, 96(9):1061–1081, sep 2016. ISSN 00442267. doi: 10.1002/zamm.201500196. [51] Martin Busch and Bernhard Schweizer. Numerical stability and accuracy of different cosimulation techniques: analytical investigations based on a 2-DOF test model. In 1st Joint International Conference on Multibody System Dynamics, pages 25–27, 2010. [52] Martin Busch and Bernhard Schweizer. An explicit approach for controlling the macro-step size of co-simulation methods. Proceedings of The 7th European Nonlinear Dynamics, ENOC, pages 24–29, 2011. [53] Martin Busch and Bernhard Schweizer. Stability of Co-Simulation Methods Using Hermite and Lagrange Approximation Techniques. In ECCOMAS Thematic Conference on Multibody Dynamics, pages 1–10, Brussels, Belgium, jul 2011. [54] Martin Busch and Bernhard Schweizer. Coupled simulation of multibody and finite element systems: an efficient and robust semi-implicit coupling approach. Archive of Applied Mechanics, 82(6):723–741, jun 2012. ISSN 0939-1533. doi: 10.1007/s00419-011-0586-0. [55] Benjamin Camus, Christine Bourjot, and Vincent Chevrier. Combining DEVS with multiagent concepts to design and simulate multi-models of complex systems (WIP). In Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, pages 85–90. Society for Computer Simulation International, 2015. ISBN 978-1-5108-0105-9. [56] Benjamin Camus, Virginie Galtier, Mathieu Caujolle, Vincent Chevrier, Julien Vaubourg, Laurent Ciarletta, and Christine Bourjot. Hybrid Co-simulation of FMUs using DEV&DESS in MECSYCO. In Proceedings of the Symposium on Theory of Modeling & Simulation DEVS Integrative M&S Symposium (TMS/DEVS 16), Pasadena, CA, United States, jan 2016. Université de Lorraine, CNRS, Inria, LORIA, UMR 7503 ; CentraleSupélec UMI GTCNRS 2958 Université Paris-Saclay ; EDF - R&D MIRE/R44. 58 [57] Luca P. Carloni, Roberto Passerone, Alessandro Pinto, and Alberto L. Angiovanni-Vincentelli. Languages and Tools for Hybrid Systems Design. Foundations and Trends R in Electronic Design Automation, 1(1/2):1–193, 2006. ISSN 1551-3939. doi: 10.1561/1000000001. [58] Christopher D. Carothers, Kalyan S. Perumalla, and Richard M. Fujimoto. Efficient optimistic parallel simulations using reverse computation. ACM Transactions on Modeling and Computer Simulation, 9(3):224–253, jul 1999. ISSN 10493301. doi: 10.1145/347823.347828. [59] Volker Carstens, Ralf Kemme, and Stefan Schmitt. Coupled simulation of flow-structure interaction in turbomachinery. Aerospace Science and Technology, 7(4):298–306, jun 2003. ISSN 12709638. doi: 10.1016/S1270-9638(03)00016-6. [60] François Edouard Cellier. Combined Continuous/Discrete System Simulation Languages: Usefulness, Experiences and Future Development. SIGSIM Simul. Dig., 9(1):18–21, 1977. ISSN 0163-6103. doi: 10.1145/1102505.1102514. [61] François Edouard Cellier. Combined Continuous Discrete Simulation by use of Digital Computers: Techniques and Tools. PhD thesis, 1979. [62] François Edouard Cellier. Continuous system modeling. Springer Science & Business Media, 1991. [63] François Edouard Cellier and Ernesto Kofman. Continuous System Simulation. Springer Science & Business Media, 2006. ISBN 9780387261027. [64] K.M. Chandy and J Misra. Distributed Simulation: A Case Study in Design and Verification of Distributed Programs. IEEE Transactions on Software Engineering, SE-5(5):440–452, sep 1979. ISSN 0098-5589. doi: 10.1109/TSE.1979.230182. [65] W-T. Chang, A. Kalavade, and E. A. Lee. Effective Heterogenous Design and Co-Simulation. In Giovanni De Micheli and Mariagiovanna Sami, editors, Hardware/Software Co-Design, pages 187–212. Springer Netherlands, Dordrecht, 1996. ISBN 978-94-009-0187-2. doi: 10. 1007/978-94-009-0187-2 8. [66] Yung-Wei Chen, Chein-Shan Liu, and Jiang-Ren Chang. A chaos detectable and time step-size adaptive numerical scheme for nonlinear dynamical systems. Journal of Sound and Vibration, 299(4-5):977–989, feb 2007. ISSN 0022460X. doi: 10.1016/j.jsv.2006.08.028. [67] Alex Chung Hen Chow and Bernard P. Zeigler. Parallel DEVS: A Parallel, Hierarchical, Modular, Modeling Formalism. In Proceedings of the 26th Conference on Winter Simulation, WSC ’94, pages 716–722, San Diego, CA, USA, 1994. Society for Computer Simulation International. ISBN 0-7803-2109-X. [68] Fabio Cremona, Marten Lohstroh, Stavros Tripakis, Christopher Brooks, and Edward A Lee. FIDE: an FMI integrated development environment. In Proceedings of the 31st Annual ACM Symposium on Applied Computing - SAC ’16, SAC ’16, pages 1759–1766, New York, New York, USA, 2016. ACM Press. ISBN 9781450337397. doi: 10.1145/2851613.2851677. [69] Makarand Datar, Ilinca Stanciulescu, and Dan Negrut. A co-simulation environment for high-fidelity virtual prototyping of vehicle systems. International Journal of Vehicle Systems Modelling and Testing, 7(1):54, jan 2012. ISSN 1745-6436. doi: 10.1504/IJVSMT.2012.045308. 59 [70] Joachim Denil, Bart Meyers, Paul De Meulenaere, and Hans Vangheluwe. Explicit Semantic Adaptation of Hybrid Formalisms for FMI Co-Simulation. In Society for Computer Simulation International, editor, Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, pages 99–106, Alexandria, Virginia, 2015. [71] Stefan Dietz, Gerhard HIPPMANN, and Gunter SCHUPP. Interaction of vehicles and flexible tracks by co-simulation of multibody vehicle systems and finite element track models. Vehicle system dynamics, 37:372–384, 2002. ISSN 0042-3114. [72] Paul Adrien Maurice Dirac. The principles of quantum mechanics. Number 27. Oxford university press, 1981. ISBN 0198520115. [73] W. Stuart Dols, Steven J. Emmerich, and Brian J. Polidoro. Coupling the multizone airflow and contaminant transport software CONTAM with EnergyPlus using co-simulation. Building Simulation, 9(4):469–479, aug 2016. ISSN 1996-3599. doi: 10.1007/s12273-016-0279-2. [74] Edo Drenth, Mikael Törmänen, Krister Johansson, Bengt-Arne Andersson, Daniel Andersson, Ivar Torstensson, and Johan Åkesson. Consistent Simulation Environment with FMI based Tool Chain. In Proceedings of 10th International Modelica Conference, Lund, Sweden, 2014. [75] Sven Dronka and Jochen Rauh. Co-simulation-interface for user-force-elements. In Proceedings of SIMPACK user meeting, 2006. [76] John C. Eidson, Edward A. Lee, Slobodan Matic, Sanjit A. Seshia, and Jia Zou. Distributed Real-Time Software for Cyber-Physical Systems. Proceedings of the IEEE, 100(1):45–59, jan 2012. ISSN 0018-9219. doi: 10.1109/JPROC.2011.2161237. [77] H. El Tahawy, D. Rodriguez, S. Garcia-Sabiro, and J.-J. Mayol. VHD/sub e/LDO: A new mixed mode simulation. In Proceedings of EURO-DAC 93 and EURO-VHDL 93- European Design Automation Conference, pages 546–551. IEEE Comput. Soc. Press, 1993. ISBN 08186-4350-1. doi: 10.1109/EURDAC.1993.410690. [78] Atiyah Elsheikh, Muhammed Usman Awais, Edmund Widl, and Peter Palensky. Modelicaenabled rapid prototyping of cyber-physical energy systems via the functional mockup interface. In 2013 Workshop on Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), pages 1–6. IEEE, may 2013. ISBN 978-1-4799-1307-7. doi: 10.1109/MSCPES. 2013.6623315. [79] Olaf Enge-Rosenblatt, Christoph Clauß, André Schneider, Peter Schneider, and Olaf Enge. Functional Digital Mock-up and the Functional Mock-up Interface–Two Complementary Approaches for a Comprehensive Investigation of Heterogeneous Systems. In Proc. of the 8th Int. Modelica Conference, 2011. [80] Kenneth Eriksson, Donald Estep, and Claes Johnson. Applied Mathematics: Body and Soul. Springer Berlin Heidelberg, Berlin, Heidelberg, 2004. ISBN 978-3-642-05659-8. doi: 10.1007/ 978-3-662-05796-4. [81] Emeka Eyisi, Jia Bai, Derek Riley, Jiannian Weng, Wei Yan, Yuan Xue, Xenofon Koutsoukos, and Janos Sztipanovits. NCSWT: An integrated modeling and simulation tool for networked control systems. Simulation Modelling Practice and Theory, 27:90–111, sep 2012. ISSN 1569190X. doi: 10.1016/j.simpat.2012.05.004. 60 [82] Cyril Faure, Mongi Ben Gaid, Nicolas Pernet, Morgan Fremovici, Gregory Font, and Gilles Corde. Methods for real-time simulation of Cyber-Physical Systems: application to automotive domain. In 2011 7th International Wireless Communications and Mobile Computing Conference, pages 1105–1110. IEEE, jul 2011. ISBN 978-1-4244-9539-9. doi: 10.1109/IWCMC.2011.5982695. [83] Yishai A. Feldman, Lev Greenberg, and Eldad Palachi. Simulating Rhapsody SysML Blocks in Hybrid Models with FMI. In Proceedings of the 10th International Modelica Conference, pages 43–52. Linköping University Electronic Press, mar 2014. doi: 10.3384/ecp1409643. [84] P. Fey, H.W. Carter, and P.A. Wilsey. Parallel synchronization of continuous time discrete event simulators. In Proceedings of the 1997 International Conference on Parallel Processing (Cat. No.97TB100162), pages 227–231. IEEE Comput. Soc, 1997. ISBN 0-8186-8108-X. doi: 10.1109/ICPP.1997.622649. [85] J. S. Fitzgerald and P. G. Larsen. Balancing Insight and Effort: the Industrial Uptake of Formal Methods. In Cliff B. Jones, Zhiming Liu, and Jim Woodcock, editors, Formal Methods and Hybrid Real-Time Systems, Essays in Honour of Dines Bjørner and Chaochen Zhou on the Occasion of Their 70th Birthdays, pages 237–254, Volume 4700, September 2007. Springer, Lecture Notes in Computer Science. ISBN 978-3-540-75220-2. [86] John Fitzgerald, Peter Gorm Larsen, Ken Pierce, Marcel Verhoef, and Sune Wolff. Collaborative Modelling and Co-simulation in the Development of Dependable Embedded Systems. pages 12–26. Springer Berlin Heidelberg, Berlin, Heidelberg, 2010. ISBN 978-3-642-16265-7. doi: 10.1007/978-3-642-16265-7 2. [87] John Fitzgerald, Peter Gorm Larsen, and Marcel Verhoef. Collaborative Design for Embedded Systems. Springer Berlin Heidelberg, Berlin, Heidelberg, 2014. ISBN 978-3-642-54117-9. doi: 10.1007/978-3-642-54118-6. [88] John Fitzgerald, Carl Gamble, Richard Payne, Peter Gorm Larsen, Stylianos Basagiannis, and Alie El-Din Mady. Collaborative Model-based Systems Engineering for Cyber-Physical Systems – a Case Study in Building Automation. In INCOSE 2016, Edinburgh, Scotland, jul 2016. [89] John S. Fitzgerald, Peter Gorm Larsen, Ken G. Pierce, and Marcel Henri Gerard Verhoef. A formal approach to collaborative modelling and co-simulation for embedded systems. Mathematical Structures in Computer Science, 23(04):726–750, aug 2013. ISSN 0960-1295. doi: 10.1017/S0960129512000242. [90] Alain Fourmigue, Bruno Girodias, Gabriela Nicolescu, and E.-M. Aboulhamid. Co-simulation based platform for wireless protocols design explorations. In 2009 Design, Automation & Test in Europe Conference & Exhibition, pages 874–877. IEEE, apr 2009. ISBN 978-1-4244-3781-8. doi: 10.1109/DATE.2009.5090785. [91] P. Frey, R. Radhakrishnan, H. W. Carter, and P. A. Wilsey. Optimistic synchronization of mixed-mode simulators. In 1998 First Merged International on Parallel Processing Symposium and Symposium on Parallel and Distributed Processing, pages 694–699, 1998. ISBN 1063-7133 VO -. doi: 10.1109/IPPS.1998.670002. 61 [92] Jonathan Friedman and Jason Ghidella. Using model-based design for automotive systems engineering-requirements analysis of the power window example. Technical report, 2006. [93] Markus Friedrich. Parallel Co-Simulation for Mechatronic Systems. PhD thesis, 2011. [94] Richard M. Fujimoto. Parallel and distributed simulation systems, volume 300. Wiley New York, New York, USA, 1 edition, 2000. ISBN 0-7803-7307-3. doi: 10.1109/WSC.2001.977259. [95] Jason C. Fuller, Selim Ciraci, Jeffrey A. Daily, Andrew R. Fisher, and M. Hauer. Communication simulations for power system applications. In 2013 Workshop on Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), pages 1–6. IEEE, may 2013. ISBN 978-1-4799-1307-7. doi: 10.1109/MSCPES.2013.6623314. [96] Virginie Galtier, Gilles Plessis, and Les Renardi. FMI-Based Distributed Multi-Simulation with DACCOSIM. In Spring Simulation Multi-Conference, pages 804–811. Society for Computer Simulation International, 2015. [97] Alfredo Garro and Alberto Falcone. On the integration of HLA and FMI for supporting interoperability and reusability in distributed simulation. In Spring Simulation Multi-Conference, pages 774–781. Society for Computer Simulation International, 2015. [98] C. W. Gear and D. R. Wells. Multirate linear multistep methods. BIT, 24(4):484–502, dec 1984. ISSN 0006-3835. doi: 10.1007/BF01934907. [99] L. Gheorghe, F. Bouchhima, G. Nicolescu, and H. Boucheneb. Formal Definitions of Simulation Interfaces in a Continuous/Discrete Co-Simulation Tool. In Rapid System Prototyping, 2006. Seventeenth IEEE International Workshop on, pages 186–192, 2006. ISBN 1074-6005 VO -. doi: 10.1109/RSP.2006.18. [100] L. Gheorghe, F. Bouchhima, G. Nicolescu, and H. Boucheneb. A Formalization of Global Simulation Models for Continuous/Discrete Systems. In Proceedings of the 2007 Summer Computer Simulation Conference, SCSC ’07, pages 559–566, San Diego, CA, USA, 2007. Society for Computer Simulation International. ISBN 1-56555-316-0. [101] A. Ghosh, M. Bershteyn, R. Casley, C. Chien, A. Jain, M. Lipsie, D. Tarrodaychik, and O. Yamamoto. A hardware-software co-simulator for embedded system design and debugging. In Design Automation Conference, pages 155–164, 1995. doi: 10.1109/ASPDAC.1995.486217. [102] Cláudio Gomes. Foundations for Continuous Time Hierarchical Co-simulation. In ACM Student Research Competition (ACM/IEEE 19th International Conference on Model Driven Engineering Languages and Systems), page to appear, Saint Malo, Brittany, France, 2016. [103] Francisco González, Miguel Ángel Naya, Alberto Luaces, and Manuel González. On the effect of multirate co-simulation techniques in the efficiency and accuracy of multibody system dynamics. Multibody System Dynamics, 25(4):461–483, apr 2011. ISSN 1384-5640. doi: 10.1007/s11044-010-9234-7. [104] Matthias Gries. Methods for evaluating and covering the design space during early design development. Integration, the VLSI Journal, 38(2):131–183, dec 2004. ISSN 01679260. doi: 10.1016/j.vlsi.2004.06.001. 62 [105] Bei Gu and H H Asada. Co-simulation of algebraically coupled dynamic subsystems. In American Control Conference, 2001. Proceedings of the 2001, volume 3, pages 2273–2278 vol.3, 2001. ISBN 0743-1619 VO - 3. doi: 10.1109/ACC.2001.946089. [106] Bei Gu and H. Harry Asada. Co-simulation of algebraically coupled dynamic subsystems. PhD thesis, 2001. [107] Bei Gu and H. Harry Asada. Co-Simulation of Algebraically Coupled Dynamic Subsystems Without Disclosure of Proprietary Subsystem Models. Journal of Dynamic Systems, Measurement, and Control, 126(1):1, apr 2004. ISSN 00220434. doi: 10.1115/1.1648307. [108] Felix Günther, Georg Mallebrein, and Heinz Ulbrich. A Modular Technique for Automotive System Simulation. In Proc. 9th International Modelica Conference, Munich, Germany, 2012. [109] M. Günther, A. Kværnø, and P. Rentrop. Multirate Partitioned Runge-Kutta Methods. Bit, 41(3):504–514, 2001. ISSN 00063835. doi: 10.1023/A:1021967112503. [110] R. K. Gupta, C. N. Coelho Jr., and G. De Micheli. Synthesis and Simulation of Digital Systems Containing Interacting Hardware and Software Components. In Proceedings of the 29th ACM/IEEE Design Automation Conference, DAC ’92, pages 225–230, Los Alamitos, CA, USA, 1992. IEEE Computer Society Press. ISBN 0-89791-516-X. [111] Dinesh Rangana Gurusinghe, Saranga Menike, A I Konara, Athula D Rajapakse, Pradeepa Yahampath, U D Annakkage, Brian A Archer, and Tony Weekes. Co-simulation of Power System and Synchrophasor Communication Network on a Single Simulation Platform. Technology and Economics of Smart Grids and Sustainable Energy, 1(1):6, dec 2016. ISSN 2199-4706. doi: 10.1007/s40866-015-0003-9. URL http://dx.doi.org/10.1007/s40866-015-0003-9http: //link.springer.com/10.1007/s40866-015-0003-9. [112] Kjell Gustafsson. Control of error and convergence in ODE solvers. PhD thesis, 1992. [113] Kjell Gustafsson, Michael Lundh, and Gustaf Söderlind. API stepsize control for the numerical solution of ordinary differential equations. BIT, 28(2):270–287, jun 1988. ISSN 0006-3835. doi: 10.1007/BF01934091. [114] Irene Hafner, Bernhard Heinzl, and Matthias Roessler. An Investigation on Loose Coupling Co-Simulation with the BCVTB. SNE Simulation Notes Europe, 23(1), 2013. ISSN 2305-9974. doi: 10.11128/sne.23.tn.10173. [115] Walid Hassairi, Moncef Bousselmi, Mohamed Abid, and Carlos Valderrama. Matlab/SystemC for the New Co-Simulation Environment by JPEG Algorithm. MATLAB–A Fundamental Tool for Scientific Computing and Engineering Applications, 2:120–138, 2012. [116] D. R. Hickey, P. A. Wilsey, R. J. Hoekstra, E. R. Keiter, S. A. Hutchinson, and T. V. Russo. Mixed-signal simulation with the Simbus backplane. In 39th Annual Simulation Symposium, 2006, Huntsville, AL, 2006. doi: 10.1109/ANSS.2006.25. [117] Ken Hines and Gaetano Borriello. Selective focus as a means of improving geographically distributed embedded system co-simulation. In 8th IEEE International Workshop on Rapid System Prototyping, 1997, pages 58–62, 1997. doi: 10.1109/IWRSP.1997.618825. 63 [118] Ken Hines and Gaetano Borriello. Dynamic Communication Models in Embedded System Cosimulation. In Proceedings of the 34th Annual Design Automation Conference, DAC ’97, pages 395–400, New York, NY, USA, 1997. ACM. ISBN 0-89791-920-3. doi: 10.1145/266021.266178. [119] Matthias Hoepfer. Towards a Comprehensive Framework for Co- Simulation of Dynamic Models With an Emphasis on Time Stepping. PhD thesis, 2011. [120] Hua Lin, Santhoshkumar Sambamoorthy, Sandeep Shukla, James Thorp, and Lamine Mili. Power system and communication network co-simulation for smart grid applications. In ISGT 2011, pages 1–6. IEEE, jan 2011. ISBN 978-1-61284-218-9. doi: 10.1109/ISGT.2011.5759166. [121] Z. Jackiewicz and M. Kwapisz. Convergence of Waveform Relaxation Methods for DifferentialAlgebraic Systems. SIAM Journal on Numerical Analysis, 33(6):2303–2317, dec 1996. ISSN 0036-1429. doi: 10.1137/S0036142992233098. [122] Kenneth R Jackson. A survey of parallel numerical methods for initial value problems for ordinary differential equations. IEEE Transactions on Magnetics, 27(5):3792–3797, 1991. ISSN 0018-9464. [123] David Jefferson and Henry A. Sowizral. Fast concurrent simulation using the time warp mechanism. Technical report, Rand Corporation, 1982. [124] David R. Jefferson. Virtual time. ACM Transactions on Programming Languages and Systems, 7(3):404–425, jul 1985. ISSN 01640925. doi: 10.1145/3916.3988. [125] Karl Henrik Johansson, Magnus Egerstedt, John Lygeros, and Shankar Sastry. On the regularization of Zeno hybrid automata. Systems & Control Letters, 38(3):141–150, oct 1999. ISSN 01676911. doi: 10.1016/S0167-6911(99)00059-6. [126] Raphaël Jungers. The joint spectral radius: theory and applications, volume 385. Springer Science & Business Media, 2009. ISBN 3540959793. [127] Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. Journal of basic Engineering, 82(1):35–45, 1960. ISSN 0021-9223. [128] Tamas Kalmar-Nagy and Ilinca Stanciulescu. Can complex systems really be simulated? Applied Mathematics and Computation, 227:199–211, jan 2014. ISSN 00963003. doi: 10. 1016/j.amc.2013.11.037. [129] K. C. Kang, S. Cohen, J. Hess, W. Novak, and A. Peterson. Feature-Oriented Domain Analysis. Feasibility study,. Technical report, Carnegie Mellon University, 1990. [130] M. Karner, M. Krammer, S. Krug, E. Armengaud, C. Steger, and R. Weiss. Heterogeneous co-simulation platform for the efficient analysis of FlexRay-based automotive distributed embedded systems. In 8th IEEE International Workshop on Factory Communication Systems (WFCS), pages 231–240, 2010. doi: 10.1109/WFCS.2010.5548627. [131] Michael Karner, Eric Armengaud, Christian Steger, and Reinhold Weiss. Holistic Simulation of FlexRay Networks by Using Run-time Model Switching. In Proceedings of the Conference on Design, Automation and Test in Europe, DATE ’10, pages 544–549, 3001 Leuven, Belgium, Belgium, 2010. European Design and Automation Association. ISBN 978-3-9810801-6-2. 64 [132] Michael Karner, Martin Krammer, Markus Schratter, Peter Wimmer, Daniel Watzenig, and ChristianMichael Gruber. A Comprehensive Approach for Modeling, Simulation and Virtual Validation of Integrated Safety Systems. In Jan Fischer-Wolfarth and Gereon Meyer, editors, Advanced Microsystems for Automotive Applications 2013 SE - 10, Lecture Notes in Mobility, pages 101–110. Springer International Publishing, 2013. ISBN 978-3-319-00475-4. doi: 10. 1007/978-3-319-00476-1 10. [133] Abir Ben Khaled, Mongi Ben Gaid, Daniel Simon, and Gregory Font. Multicore simulation of powertrains using weakly synchronized model partitioning. In IFAC Proceedings Volumes, volume 45, pages 448–455, Rueil-Malmaison, France, oct 2012. doi: 10.3182/ 20121023-3-FR-4025.00018. [134] Abir Ben Khaled, Laurent Duval, Mohamed El Mongi Ben Gaı̈d, and Daniel Simon. Contextbased polynomial extrapolation and slackened synchronization for fast multi-core simulation using FMI. In 10th International Modelica Conference 2014, pages 225–234. Link{ö}ping University Electronic Press, 2014. [135] James Ellis Kleckner. Advanced mixed-mode simulation techniques. PhD thesis, 1984. [136] Ernesto Kofman. A Second-Order Approximation for DEVS Simulation of Continuous Systems. SIMULATION, 78(2):76–89, feb 2002. ISSN 0037-5497. doi: 10.1177/ 0037549702078002206. [137] Ernesto Kofman and Sergio Junco. Quantized-state systems: a DEVS Approach for continuous system simulation. Transactions of The Society for Modeling and Simulation International, 18(3):123–132, 2001. ISSN 0740-6797. [138] Alexander Kossiakoff, William N. Sweet, Samuel J. Seymour, and Steven M. Biemer. Structure of Complex Systems, pages 41–67. John Wiley & Sons, Inc., 2011. ISBN 9781118001028. doi: 10.1002/9781118001028.ch3. URL http://dx.doi.org/10.1002/9781118001028.ch3. [139] Velin Kounev, David Tipper, Martin Levesque, Brandon M. Grainger, Thomas Mcdermott, and Gregory F. Reed. A microgrid co-simulation framework. In 2015 Workshop on Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), pages 1–6. IEEE, apr 2015. ISBN 978-1-4799-7357-6. doi: 10.1109/MSCPES.2015.7115398. [140] Martin Krammer, Johannes Fritz, and Michael Karner. Model-Based Configuration of Automotive Co-Simulation Scenarios. In Spring Simulation Multi-Conference, pages 246–253. Society for Computer Simulation International, 2015. [141] R. Kübler and W. Schiehlen. Two Methods of Simulator Coupling. Mathematical and Computer Modelling of Dynamical Systems, 6(2):93–113, jun 2000. ISSN 1387-3954. doi: 10.1076/1387-3954(200006)6:2;1-M;FT093. [142] R. Kübler and W. Schiehlen. Modular Simulation in Multibody System Dynamics. Multibody System Dynamics, 4(2-3):107–127, 2000. ISSN 1384-5640. doi: 10.1023/A:1009810318420. [143] Michal Kudelski, Luca M. Gambardella, and Gianni A. Di Caro. RoboNetSim: An integrated framework for multi-robot and network simulation. Robotics and Autonomous Systems, 61 (5):483–496, may 2013. ISSN 09218890. doi: 10.1016/j.robot.2013.01.003. 65 [144] Frederick Kuhl, Richard Weatherly, and Judith Dahmann. Creating computer simulation systems: an introduction to the high level architecture. Prentice Hall PTR, 1999. ISBN 0130225118. [145] Thomas Kühne. What is a Model? In Jean Bezivin and Reiko Heckel, editors, Language Engineering for Model-Driven Software Development, volume 04101. Internationales Begegnungsund Forschungszentrum für Informatik (IBFI), 2005. [146] T. Kuhr, T. Forster, T. Braun, and R. Gotzhein. FERAL - Framework for simulator coupling on requirements and architecture level. In Eleventh IEEE/ACM International Conference on Formal Methods and Models for Codesign (MEMOCODE), pages 11–22, 2013. [147] Leslie Lamport. Time, clocks, and the ordering of events in a distributed system. Communications of the ACM, 21(7):558–565, jul 1978. ISSN 00010782. doi: 10.1145/359545.359563. [148] Peter Gorm Larsen, Casper Thule, Kenneth Lausdahl, Victor Bardur, Carl Gamble, Etienne Brosse, Andrey Sadovykh, Alessandra Bagnato, and Luis Diogo Couto. Integrated Tool Chain for Model-Based Design of Cyber-Physical Systems. In Peter Gorm Larsen, Nico Plat, and Nick Battle, editors, The 14th Overture Workshop: Towards Analytical Tool Chains, pages 63–78, Cyprus, November 2016. Aarhus University, Department of Engineering. ECE-TR-28. [149] Kenneth Lausdahl, Peter Gorm Larsen, Sune Wolf, Victor Bandur, Anders Terkelsen, Miran Hasanagić, Casper Thule Hansen, Ken Pierce, Oliver Kotte, Adrian Pop, Etienne Brosse, Jörg Brauer, and Oliver Möller. Design of the INTO-CPS Platform. Technical report, INTO-CPS Deliverable, D4.1d, December 2015. [150] David P. Y. Lawrence, Cláudio Gomes, Joachim Denil, Hans Vangheluwe, and Didier Buchs. Coupling Petri nets with Deterministic Formalisms Using Co-simulation. In Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, pages 6:1—-6:8, Pasadena, CA, USA, 2016. [151] P. Le Marrec, C. A. Valderrama, F. Hessel, A. A. Jerraya, M. Attia, and O. Cayrol. Hardware, software and mechanical cosimulation for automotive applications. In 9th International Workshop on Rapid System Prototyping, pages 202–206, 1998. doi: 10.1109/IWRSP.1998.676692. [152] Bu-Sung Lee, Wentong Cai, Stephen J. Turner, and L. Chen. Adaptive dead reckoning algorithms for distributed interactive simulation. International Journal of Simulation, 1(1-2): 21–34, 2000. [153] Edward A. Lee. Cyber Physical Systems: Design Challenges. In 11th IEEE International Symposium on Object Oriented Real-Time Distributed Computing (ISORC), pages 363–369, 2008. doi: 10.1109/ISORC.2008.25. [154] Edward A. Lee and Haiyang Zheng. Operational semantics of hybrid systems. In Manfred Morari and Lothar Thiele, editors, Hybrid Systems: Computation and Control, volume 3414 of Lecture Notes in Computer Science, pages 25–53. Springer Berlin Heidelberg, 2005. ISBN 978-3-540-25108-8. doi: 10.1007/978-3-540-31954-2 2. [155] E. Lelarasmee, Albert E. Ruehli, and A. L. Sangiovanni-Vincentelli. The Waveform Relaxation Method for Time-Domain Analysis of Large Scale Integrated Circuits. In IEEE Transactions 66 on Computer-Aided Design of Integrated Circuits and Systems, volume 1, pages 131–145, 1982. ISBN 0278-00701. doi: 10.1109/TCAD.1982.1270004. [156] Shengqin Li and Le He. Co-simulation Study of Vehicle ESP System Based on ADAMS and MATLAB. Journal of Software, 6(5), 2011. [157] W. Li, A. Monti, M. Luo, and R. A. Dougal. VPNET: A co-simulation framework for analyzing communication channel effects on power systems. In 2011 IEEE Electric Ship Technologies Symposium, pages 143–149. IEEE, apr 2011. ISBN 978-1-4244-9272-5. doi: 10.1109/ESTS. 2011.5770857. [158] Weilin Li, Min Luo, Lin Zhu, Antonello Monti, and Ferdinanda Ponci. A co-simulation method as an enabler for jointly analysis and design of MAS-based electrical power protection and communication. SIMULATION, mar 2013. [159] Weilin Li, Xiaobin Zhang, and Huimin Li. Co-simulation platforms for co-design of networked control systems: An overview. Control Engineering Practice, 23:44–56, feb 2014. ISSN 09670661. doi: 10.1016/j.conengprac.2013.10.010. [160] F. Liu, J. Cai, Y. Zhu, H. M. Tsai, and A. S. F. Wong. Calculation of Wing Flutter by a Coupled Fluid-Structure Method. Journal of Aircraft, 38(2):334–342, mar 2001. ISSN 0021-8669. doi: 10.2514/2.2766. [161] John Lygeros. Lecture notes on hybrid systems, 2004. [162] Oded Maler, Zohar Manna, and Amir Pnueli. From timed to hybrid systems. Real-Time: Theory in Practice, 600:447–484, 1992. doi: ˜10.1007/BFb0032003. [163] M. Manbachi, A. Sadu, H. Farhangi, A. Monti, A. Palizban, F. Ponci, and S. Arzanpour. Impact of EV penetration on Volt–VAR Optimization of distribution networks using real-time co-simulation monitoring platform. Applied Energy, 169:28–39, may 2016. ISSN 03062619. doi: 10.1016/j.apenergy.2016.01.084. [164] Toni Mancini, Federico Mari, Annalisa Massini, Igor Melatti, Fabio Merli, and Enrico Tronci. System Level Formal Verification via Model Checking Driven Simulation. In Natasha Sharygina and Helmut Veith, editors, Computer Aided Verification SE - 21, volume 8044 of Lecture Notes in Computer Science, pages 296–312. Springer Berlin Heidelberg, 2013. ISBN 978-3642-39798-1. doi: 10.1007/978-3-642-39799-8 21. [165] Zohar Manna and Amir Pnueli. Verifying hybrid systems. In RobertL. Grossman, Anil Nerode, AndersP. Ravn, and Hans Rischel, editors, Hybrid Systems SE - 2, volume 736 of Lecture Notes in Computer Science, pages 4–35. Springer Berlin Heidelberg, 1993. ISBN 978-3-540-57318-0. doi: 10.1007/3-540-57318-6 22. URL http://dx.doi.org/10.1007/3-540-57318-6{_}22. [166] J. A. Martinez, T. P. Kurzweg, S. P. Levitan, P. J. Marchand, and D. M. Chiarulli. MixedTechnology System-Level Simulation. Analog Integrated Circuits and Signal Processing, 29 (1-2):127–149, 2001. ISSN 0925-1030. doi: 10.1023/A:1011294616831. [167] William J. McCalla. Fundamentals of computer-aided circuit simulation, volume 37. Springer Science & Business Media, 1987. ISBN 1461320119. 67 [168] M Mews, J Svacina, and S Weissleder. From AUTOSAR Models to Co-simulation for MiLTesting in the Automotive Domain. In Software Testing, Verification and Validation (ICST), 2012 IEEE Fifth International Conference on, pages 519–528, 2012. ISBN VO -. doi: 10. 1109/ICST.2012.137. [169] Bart Meyers, Joachim Denil, Frédéric Boulanger, Cécile Hardebolle, Christophe Jacquet, and Hans Vangheluwe. A DSL for Explicit Semantic Adaptation. In Edward Jones Tamás Mészáros Christophe Jacquet Daniel Balasubramanian, editor, MPM 2013, number 1112 in CEUR Workshop Proceedings, pages 47–56, Miami, United States, sep 2013. [170] U. Miekkala and O. Nevanlinna. Convergence of Dynamic Iteration Methods for Initial Value Problems. SIAM Journal on Scientific and Statistical Computing, 8(4):459–482, jul 1987. ISSN 0196-5204. doi: 10.1137/0908046. [171] Debasis Mitra. Asynchronous Relaxations for the Numerical Solution of Differential Equations by Parallel Processors. SIAM Journal on Scientific and Statistical Computing, 8(1):s43–s58, jan 1987. ISSN 0196-5204. doi: 10.1137/0908012. [172] Pieter J. Mosterman. An Overview of Hybrid Simulation Phenomena and Their Support by Simulation Packages. In FritsW. Vaandrager and JanH. van Schuppen, editors, Hybrid Systems: Computation and Control SE - 17, volume 1569 of Lecture Notes in Computer Science, pages 165–177. Springer Berlin Heidelberg, 1999. ISBN 978-3-540-65734-7. doi: 10.1007/3-540-48983-5 17. [173] Pieter J. Mosterman. HYBRSIM—a modelling and simulation environment for hybrid bond graphs. Proceedings of the Institution of Mechanical Engineers, Part I: Journal of Systems and Control Engineering, 216(1), 2002. doi: 10.1243/0959651021541417. [174] Pieter J. Mosterman and Gautam Biswas. A theory of discontinuities in physical system models. Journal of the Franklin Institute, 335(3):401–439, apr 1998. ISSN 00160032. doi: 10.1016/S0016-0032(96)00126-3. [175] Pieter J. Mosterman, Justyna Zander, Gregoire Hamon, and Ben Denckla. A computational model of time for stiff hybrid systems applied to control synthesis. Control Engineering Practice, 20(1):2–13, 2012. ISSN 09670661. doi: 10.1016/j.conengprac.2011.04.013. [176] W Muller and E Widl. Using FMI components in discrete event systems. In Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), 2015 Workshop on, pages 1–6, 2015. ISBN VO -. doi: 10.1109/MSCPES.2015.7115397. [177] Sadaf Mustafiz and Hans Vangheluwe. Explicit Modelling of Statechart Simulation Environments. In Proceedings of the 2013 Summer Computer Simulation Conference, SCSC ’13, pages 21:1—-21:8, Vista, CA, 2013. Society for Modeling & Simulation International. ISBN 978-1-62748-276-9. [178] Sadaf Mustafiz, Bruno Barroca, Cláudio Gomes, and Hans Vangheluwe. Towards Modular Language Design Using Language Fragments: The Hybrid Systems Case Study. In 13th International Conference on Information Technology - New Generations (ITNG), pages 785– 797. 2016. doi: 10.1007/978-3-319-32467-8 68. 68 [179] Sadaf Mustafiz, Cláudio Gomes, Bruno Barroca, and Hans Vangheluwe. Modular Design of Hybrid Languages by Explicit Modeling of Semantic Adaptation. In Proceedings of the Symposium on Theory of Modeling & Simulation: DEVS Integrative M&S Symposium, DEVS ’16, pages 29:1—-29:8, San Diego, CA, USA, 2016. [180] Alexandre Muzy, Luc Touraille, Hans Vangheluwe, Olivier Michel, Mamadou Kaba Traoré, and David R. C. Hill. Activity Regions for the Specification of Discrete Event Systems. In Proceedings of the 2010 Spring Simulation Multiconference, SpringSim ’10, pages 136:1—136:7, San Diego, CA, USA, 2010. Society for Computer Simulation International. ISBN 978-1-4503-0069-8. doi: 10.1145/1878537.1878679. [181] Andreas Naderlinger. Multiple Real-time Semantics on Top of Synchronous Block Diagrams. In Proceedings of the Symposium on Theory of Modeling & Simulation - DEVS Integrative M&S Symposium, DEVS 13, pages 6:1—-6:7, San Diego, CA, USA, 2013. Society for Computer Simulation International. ISBN 978-1-62748-032-1. [182] Himanshu Neema, Jesse Gohl, Zsolt Lattmann, Janos Sztipanovits, Gabor Karsai, Sandeep Neema, Ted Bapty, John Batteh, Hubertus Tummescheit, and Chandrasekar Sureshkumar. Model-based integration platform for FMI co-simulation and heterogeneous simulations of cyber-physical systems. In 10th International Modelica Conference, pages 10–12, 2014. [183] Arthur Richard Newton and Alberto L. Sangiovanni-Vincentelli. Relaxation-Based Electrical Simulation. SIAM Journal on Scientific and Statistical Computing, 4(3):485–524, sep 1983. ISSN 0196-5204. doi: 10.1137/0904036. [184] Y. Ni and J. F. Broenink. Hybrid systems modelling and simulation in DESTECS: a cosimulation approach. In M Klumpp, editor, 26th European Simulation and Modelling Conference, ESM 2012, Essen, Germany, pages 32–36, Ghent, Belgium, 2012. EUROSIS-ETI. [185] Claus Ballegaard Nielsen, Peter Gorm Larsen, John Fitzgerald, Jim Woodcock, and Jan Peleska. Systems of Systems Engineering: Basic Concepts, Model-Based Techniques, and Research Directions. ACM Comput. Surv., 48(2):18:1—-18:41, sep 2015. ISSN 0360-0300. doi: 10.1145/2794381. [186] Henrik Nilsson. Functional automatic differentiation with dirac impulses. ACM SIGPLAN Notices, 38(9):153–164, sep 2003. ISSN 03621340. doi: 10.1145/944746.944720. [187] Kristoffer Norling, David Broman, Peter Fritzson, Alexander Siemers, and Dag Fritzson. Secure distributed co-simulation over wide area networks. In Proceedings of the 48th Conference on Simulation and Modelling (SIMS 2007), pages 14–23. Citeseer, 2007. [188] Thierry Nouidui, Michael Wetter, and Wangda Zuo. Functional mock-up unit for cosimulation import in EnergyPlus. Journal of Building Performance Simulation, 7(3):192–202, may 2014. ISSN 1940-1493. doi: 10.1080/19401493.2013.808265. [189] James Nutaro. Designing power system simulators for the smart grid: Combining controls, communications, and electro-mechanical dynamics. In 2011 IEEE Power and Energy Society General Meeting, pages 1–5. IEEE, jul 2011. ISBN 978-1-4577-1000-1. doi: 10.1109/PES. 2011.6039456. 69 [190] James J. Nutaro. A method for bounding error in multi-rate and federated simulations. Proceeding of the 2016 Winter Simulation Conference, page to be accepted, 2016. [191] Seaseung Oh and Suyong Chae. A Co-Simulation Framework for Power System Analysis. Energies, 9(3):131, 2016. [192] Xiufeng Pang, Michael Wetter, Prajesh Bhattacharya, and Philip Haves. A framework for simulation-based real-time whole building performance assessment. Building and Environment, 54:100–108, aug 2012. ISSN 03601323. doi: 10.1016/j.buildenv.2012.02.003. [193] Henry M. Paynter. Analysis and design of engineering systems. MIT press, 1961. [194] Nicolai Pedersen, Jan Madsen, and Morten Vejlgaard-Laursen. Co-Simulation of Distributed Engine Control System and Network Model using FMI & SCNSL. IFAC-PapersOnLine, 48 (16):261–266, 2015. ISSN 24058963. doi: 10.1016/j.ifacol.2015.10.290. [195] Nicolai Pedersen, Tom Bojsen, Jan Madsen, and Morten Vejlgaard-Laursen. FMI for CoSimulation of Embedded Control Software. In The First Japanese Modelica Conferences, May 23-24, Tokyo, Japan, number 124, pages 70–77. Linköping University Electronic Press, may 2016. ISBN 1650-3740. doi: 10.3384/ecp1612470. [196] Nikos C. Petrellis, Alexis N. Birbas, Michael K. Birbas, Evangelinos P. Mariatos, and George D. Papadopoulos. Simulating Hardware, Software and Electromechanical Parts Using Communicating Simulators. Design Automation for Embedded Systems, 3(2/3):187–198, 1998. ISSN 09295585. doi: 10.1023/A:1008846508549. [197] Ralf Uwe Pfau. A priori step size adaptation for the simulation of non-smooth systems. Communications in Numerical Methods in Engineering, 23(2):85–96, jun 2006. ISSN 10698299. doi: 10.1002/cnm.884. [198] K. Pierce, C. Gamble, Y. Ni, and J. F. Broenink. Collaborative Modelling and Co-simulation with DESTECS: A Pilot Study. In IEEE 21st International Workshop on Enabling Technologies: Infrastructure for Collaborative Enterprises (WETICE), pages 280–285, 2012. ISBN 1524-4547 VO -. doi: 10.1109/WETICE.2012.69. [199] Uwe Pohlmann, Wilhelm Schäfer, Hendrik Reddehase, Jens Röckemann, and Robert Wagner. Generating functional mockup units from software specifications. In Proceedings of the 9th International MODELICA Conference, September 3-5, 2012, Munich, Germany, number 078, pages 765–774, 2012. [200] Claudius Ptolemaeus. System Design, Modeling, and Simulation: Using Ptolemy II. Berkeley: Ptolemy.org, 2014. ISBN 1304421066. [201] Davide Quaglia, Riccardo Muradore, Roberto Bragantini, and Paolo Fiorini. A SystemC/Matlab co-simulation tool for networked control systems. Simulation Modelling Practice and Theory, 23:71–86, apr 2012. ISSN 1569-190X. doi: 10.1016/j.simpat.2012.01.003. [202] Gauthier Quesnel, Raphaël Duboz, David Versmisse, and E Ramat. DEVS coupling of spatial and ordinary differential equations: VLE framework. OICIMS, 5:281–294, 2005. 70 [203] M. Radetzki and R. S. Khaligh. Accuracy-adaptive Simulation of Transaction Level Models. In Proceedings of the Conference on Design, Automation and Test in Europe, DATE ’08, pages 788–791, New York, NY, USA, 2008. ACM. ISBN 978-3-9810801-3-1. doi: 10.1145/1403375. 1403566. [204] Derek Riley, Emeka Eyisi, Jia Bai, Xenofon Koutsoukos, Yuan Xue, and Janos Sztipanovits. Networked Control System Wind Tunnel (NCSWT): An Evaluation Tool for Networked Multiagent Systems. In Proceedings of the 4th International ICST Conference on Simulation Tools and Techniques, SIMUTools ’11, pages 9–18, ICST, Brussels, Belgium, Belgium, 2011. ICST (Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering). ISBN 978-1-936968-00-8. [205] Robin Roche, Sudarshan Natarajan, Ayan Bhattacharyya, and Siddharth Suryanarayanan. A Framework for Co-simulation of AI Tools with Power Systems Analysis Software. In 23rd International Workshop on Database and Expert Systems Applications, pages 350–354. IEEE, sep 2012. ISBN 978-1-4673-2621-6. doi: 10.1109/DEXA.2012.9. [206] J. A. Rowson. Hardware/Software Co-Simulation. In 31st Conference on Design Automation, pages 439–440, 1994. ISBN 0738-100X VO -. doi: 10.1109/DAC.1994.204143. [207] Severin Sadjina, Lars T. Kyllingstad, Eilif Pedersen, and Stian Skjong. Energy Conservation and Power Bonds in Co-Simulations: Non-Iterative Adaptive Step Size Control and Error Estimation. arXiv preprint arXiv:1602.06434, 2016. [208] Salah Eddine Saidi, Nicolas Pernet, Yves Sorel, and Abir Ben Khaled. Acceleration of FMU Co-Simulation On Multi-core Architectures. In The First Japanese Modelica Conferences, May 23-24, Tokyo, Japan, number 124, pages 106–112. Linköping University Electronic Press, may 2016. ISBN 1650-3740. doi: 10.3384/ecp16124106. [209] Resve A Saleh, Shyh-Jye Jou, and A Richard Newton. Mixed-mode simulation and analog multilevel simulation, volume 279. Springer Science & Business Media, 2013. ISBN 1475758545. [210] Tom Schierz and Martin Arnold. Stabilized overlapping modular time integration of coupled differential-algebraic equations. Applied Numerical Mathematics, 62(10):1491–1502, oct 2012. ISSN 01689274. doi: 10.1016/j.apnum.2012.06.020. [211] Tom Schierz, Martin Arnold, and Christoph Clauss. Co-simulation with communication step size control in an FMI compatible master algorithm. In 9th Int. Modelica Conf., Munich, Germany, pages 205–214, nov 2012. doi: 10.3384/ecp12076205. [212] Robert Schmoll and Bernhard Schweizer. Convergence Study of Explicit Co-Simulation Approaches with Respect to Subsystem Solver Settings. PAMM, 12(1):81–82, dec 2012. ISSN 1617-7061. doi: 10.1002/pamm.201210032. [213] Stefan-Alexander Schneider, Johannes Frimberger, and Michael Folie. Significant Reduction of Validation Efforts for Dynamic Light Functions with FMI for Multi-Domain Integration and Test Platforms. In 10th International Modelica Conference, 2014. [214] B. Schweizer and D. Lu. Predictor/corrector co-simulation approaches for solver coupling with algebraic constraints. ZAMM - Journal of Applied Mathematics and Mechanics / Zeitschrift 71 für Angewandte Mathematik und Mechanik, 95(9):911–938, sep 2015. ISSN 00442267. doi: 10.1002/zamm.201300191. [215] Bernhard Schweizer and Daixing Lu. Semi-implicit co-simulation approach for solver coupling. Archive of Applied Mechanics, 84(12):1739–1769, dec 2014. ISSN 0939-1533. doi: 10.1007/ s00419-014-0883-5. [216] Bernhard Schweizer and Daixing Lu. Stabilized index-2 co-simulation approach for solver coupling with algebraic constraints. Multibody System Dynamics, 34(2):129–161, jun 2015. ISSN 1384-5640. doi: 10.1007/s11044-014-9422-y. [217] Bernhard Schweizer, Pu Li, and Daixing Lu. Explicit and Implicit Cosimulation Methods: Stability and Convergence Analysis for Different Solver Coupling Approaches. Journal of Computational and Nonlinear Dynamics, 10(5):051007, sep 2015. ISSN 1555-1415. doi: 10. 1115/1.4028503. [218] Bernhard Schweizer, Pu Li, Daixing Lu, and Tobias Meyer. Stabilized implicit co-simulation methods: solver coupling based on constitutive laws. Archive of Applied Mechanics, 85(11): 1559–1594, nov 2015. ISSN 0939-1533. doi: 10.1007/s00419-015-0999-2. [219] Bernhard Schweizer, Daixing Lu, and Pu Li. Co-simulation method for solver coupling with algebraic constraints incorporating relaxation techniques. Multibody System Dynamics, 36(1): 1–36, jan 2016. ISSN 1384-5640. doi: 10.1007/s11044-015-9464-9. [220] S. Sicklinger, V. Belsky, B. Engelmann, H. Elmqvist, H. Olsson, R. Wüchner, and K. U. Bletzinger. Interface Jacobian-based Co-Simulation. International Journal for Numerical Methods in Engineering, 98(6):418–444, may 2014. ISSN 1097-0207. doi: 10.1002/nme.4637. [221] G. Stettinger, M. Horn, M. Benedikt, and J. Zehetner. Model-based coupling approach for non-iterative real-time co-simulation. In 2014 European Control Conference (ECC), pages 2084–2089, 2014. doi: 10.1109/ECC.2014.6862242. [222] Georg Stettinger, Josef Zehetner, Martin Benedikt, and Norbert Thek. Extending CoSimulation to the Real-Time Domain. apr 2013. doi: 10.4271/2013-01-0421. [223] H T Su, H. T. Su, K W Chan, K. W. Chan, L A Snider, and L. A. Snider. Parallel interaction protocol for electromagnetic and electromechanical hybrid simulation, 2005. [224] Yongqi Sun, Stephanie Vogel, and Haiko Steuer. Combining Advantages of Specialized Simulation Tools and Modelica Models using Functional Mock-up Interface (FMI). In Proceedings of the 8th International Modelica Conference, 2011. [225] Robert Tarjan. Depth-first search and linear graph algorithms. 12th Annual Symposium on Switching and Automata Theory (swat 1971), 1(2), jun 1971. ISSN 0272-4847. doi: 10.1109/ SWAT.1971.10. [226] Jean-Philippe Tavella, Mathieu Caujolle, Charles Tan, Gilles Plessis, Mathieu Schumann, Stéphane Vialle, Cherifa Dad, Arnaud Cuccuru, and Sébastien Revol. Toward an Hybrid Co-simulation with the FMI-CS Standard, apr 2016. URL https://hal-centralesupelec. archives-ouvertes.fr/hal-01301183. 72 [227] Brook Taylor. Methodus Incrementorum Directa et Inversa. London, 1715. [228] T Tomiyama, V. D’Amelio, J Urbanic, and W ElMaraghy. Complexity of Multi-Disciplinary Design. CIRP Annals - Manufacturing Technology, 56(1):185–188, 2007. ISSN 00078506. doi: 10.1016/j.cirp.2007.05.044. [229] Pawel Tomulik and Janusz Fra̧czek. Simulation of multibody systems with the use of coupling techniques: a case study. Multibody System Dynamics, 25(2):145–165, feb 2011. ISSN 13845640. doi: 10.1007/s11044-010-9206-y. [230] Mamadou K Traoré and Alexandre Muzy. Capturing the dual relationship between simulation models and their context. Simulation Modelling Practice and Theory, 14(2):126–142, feb 2006. ISSN 1569190X. doi: 10.1016/j.simpat.2005.03.002. [231] Marija Trcka, Michael Wetter, and Jan Hensen. Comparison of co-simulation approaches for building and HVAC/R system simulation. In Proceedings of the International IBPSA Conference, Beijing, China, 2007. [232] Stavros Tripakis. Bridging the semantic gap between heterogeneous modeling formalisms and FMI. In 2015 International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation (SAMOS), pages 60–69. IEEE, jul 2015. ISBN 978-1-4673-7311-1. doi: 10.1109/SAMOS.2015.7363660. URL http://ieeexplore.ieee.org/lpdocs/epic03/ wrapper.htm?arnumber=7363660. [233] F. Tseng and G. Hulbert. Network-distributed multibody dynamics simulation—gluing algorithm. Advances in Computational Multibody Dynamics, pages 521–540, 1999. [234] A. M. Uhrmacher. Dynamic Structures in Modeling and Simulation: A Reflective Approach. ACM Trans. Model. Comput. Simul., 11(2):206–232, apr 2001. ISSN 1049-3301. doi: 10.1145/ 384169.384173. [235] Adelinde M. Uhrmacher. Variable structure models: autonomy and control answers from two different modeling approaches. In 4th Annual Conference on AI, Simulation and Planning in High Autonomy Systems, pages 133–139. IEEE Comput. Soc. Press, 1993. ISBN 0-8186-40200. doi: 10.1109/AIHAS.1993.410588. [236] Bert Van Acker, Joachim Denil, Paul De Meulenaere, Hans Vangheluwe, Bert Vanacker, and Paul Demeulenaere. Generation of an Optimised Master Algorithm for FMI Co-simulation. In Proceedings of the Symposium on Theory of Modeling & Simulation-DEVS Integrative, pages 946–953. Society for Computer Simulation International, 2015. [237] Herman Van der Auweraer, Jan Anthonis, Stijn De Bruyne, and Jan Leuridan. Virtual engineering at work: the challenges for designing mechatronic products. Engineering with Computers, 29(3):389–408, 2013. ISSN 0177-0667. doi: 10.1007/s00366-012-0286-6. [238] Arjan J. Van Der Schaft and Johannes Maria Schumacher. An introduction to hybrid dynamical systems, volume 251. Springer London, 2000. [239] Simon Van Mierlo. Explicitly Modelling Model Debugging Environments. In ACM Student Research Competition at MODELS 2015, pages 24–29. CEUR, 2015. 73 [240] Yentl Van Tendeloo and Hans Vangheluwe. Activity in PythonPDEVS. In Proceedings of ACTIMS 2014, 2014. [241] Yentl Van Tendeloo and Hans Vangheluwe. PythonPDEVS: a distributed Parallel DEVS simulator. In Proceedings of the 2015 Spring Simulation Multiconference, SpringSim ’15, pages 844–851. Society for Computer Simulation International, 2015. [242] Yentl Van Tendeloo and Hans Vangheluwe. An Introduction to Classic DEVS. Technical report, 2017. URL https://arxiv.org/pdf/1701.07697v1.pdf. [243] Luigi Vanfretti, Tetiana Bogodorova, and Maxime Baudette. Power system model identification exploiting the Modelica language and FMI technologies. In 2014 IEEE International Conference on Intelligent Energy and Power Systems (IEPS), pages 127–132. IEEE, jun 2014. ISBN 978-1-4799-2266-6. doi: 10.1109/IEPS.2014.6874164. [244] Hans Vangheluwe. DEVS as a common denominator for multi-formalism hybrid systems modelling. In CACSD. Conference Proceedings. IEEE International Symposium on ComputerAided Control System Design (Cat. No.00TH8537), pages 129–134. IEEE, 2000. ISBN 0-78036566-6. doi: 10.1109/CACSD.2000.900199. [245] Hans Vangheluwe. Foundations of Modelling and Simulation of Complex Systems. EASST, 10, 2008. doi: 10.14279/tuj.eceasst.10.162.148. [246] Hans Vangheluwe, Juan De Lara, and Pieter J. Mosterman. An introduction to multiparadigm modelling and simulation. In Proceedings of AIS2002 (AI, Simulation & Planning), pages 9–20. SCS, 2002. [247] Ken Vanherpen, Joachim Denil, Hans Vangheluwe, and Paul De Meulenaere. Model Transformations for Round-trip Engineering in Control Deployment Co-Design. In Theory of Modeling and Simulation - DEVS, TMS/DEVS ’15, part of the Spring Simulation Multi-Conference, pages 820–827, Alexandria, Virginia, USA, apr 2015. Society for Computer Simulation International. [248] Julien Vaubourg, Yannick Presse, Benjamin Camus, Christine Bourjot, Laurent Ciarletta, Vincent Chevrier, Jean-Philippe Tavella, and Hugo Morais. Multi-agent Multi-Model Simulation of Smart Grids in the MS4SG Project. pages 240–251. Springer International Publishing, Cham, 2015. ISBN 978-3-319-18944-4. doi: 10.1007/978-3-319-18944-4 20. [249] A Verhoeven, B Tasic, T G J Beelen, E J W ter Maten, and R M M Mattheij. BDF compoundfast multirate transient analysis with adaptive stepsize control. J. Numer. Anal. Ind. Appl. Math, 3(3-4):275–297, 2008. [250] Antoine Viel. Implementing stabilized co-simulation of strongly coupled systems using the Functional Mock-up Interface 2.0. 10th International Modelica Conference, 2014. [251] B. Wang and J. S. Baras. HybridSim: A Modeling and Co-simulation Toolchain for Cyberphysical Systems. In Distributed Simulation and Real Time Applications (DS-RT), 2013 IEEE/ACM 17th International Symposium on, pages 33–40, 2013. ISBN 1550-6525. doi: 10.1109/DS-RT.2013.12. 74 [252] G. Wanner and E. Hairer. Solving ordinary differential equations I, volume 1. Springer-Verlag, Berlin, 1991. [253] Michael Wetter. Co-simulation of building energy and control systems with the Building Controls Virtual Test Bed. Journal of Building Performance Simulation, 4(3):185–203, nov 2010. ISSN 1940-1493. doi: 10.1080/19401493.2010.518631. [254] E. Widl, W. Muller, A. Elsheikh, M. Hortenhuber, and P. Palensky. The FMI++ library: A high-level utility package for FMI for model exchange. In Modeling and Simulation of Cyber-Physical Energy Systems (MSCPES), 2013 Workshop on, pages 1–6, 2013. doi: 10. 1109/MSCPES.2013.6623316. [255] Xiaorong Xie, Chuanyu Zhang, Huakun Liu, Chao Liu, Dongxiang Jiang, and Baorong Zhou. Continuous-Mass-Model-Based Mechanical and Electrical Co-Simulation of SSR and Its Application to a Practical Shaft Failure Event. IEEE Transactions on Power Systems, 31(6): 5172–5180, nov 2016. ISSN 0885-8950. doi: 10.1109/TPWRS.2016.2537001. [256] Masahiro Yamaura, Nikos Arechiga, Shinichi Shiraishi, Scott Eisele, Joseph Hite2 Sandeep Neema2 Jason Scott, and Theodore Bapty. ADAS Virtual Prototyping using Modelica and Unity Co-simulation via OpenMETA. 2016. [257] Faruk Yılmaz, Umut Durak, Koray Taylan, and Halit Oğuztüzün. Adapting Functional Mockup Units for HLA-compliant Distributed Simulation. In 10th International Modelica Conference, 2014. [258] Josef Zehetner, Di Wenpu Lu, and Daniel Watzenig. Design of modern vehicle electrical systems based on co-simulation and a model library. ATZelektronik worldwide, 8(4):20–24, 2013. doi: 10.1365/s38314-013-0182-x. [259] Bernard P. Zeigler. Theory of modelling and simulation. New York, Wiley, 1976. ISBN 0471981524. [260] Bernard P. Zeigler. Embedding dev&dess in devs. In Proc. DEVS Integrative M&S Symp, volume 7, 2006. [261] Bernard P. Zeigler and J. S. Lee. Theory of quantized systems: formal basis for DEVS/HLA distributed simulation environment. volume 3369, pages 49–58, aug 1998. doi: 10.1117/12. 319354. [262] Bernard P. Zeigler, Herbert Praehofer, and Tag Gon Kim. Theory of modeling and simulation: integrating discrete event and continuous complex dynamic systems. Academic press, 2 edition, 2000. [263] Fu Zhang, Murali Yeddanapudi, and Pieter Mosterman. Zero-crossing location and detection algorithms for hybrid system simulation. In IFAC World Congress, pages 7967–7972, 2008. [264] Saipeng Zhang, Jun Liu, and Wei Su. A Co-simulation Platform of Integrated Starter/Generator System Based on ANSYS, pages 35–43. Springer Berlin Heidelberg, Berlin, Heidelberg, 2016. ISBN 978-3-662-49367-0. doi: 10.1007/978-3-662-49367-0 5. 75 [265] X. Zhang and J. F. Broenink. A structuring mechanism for embedded control systems using co-modelling and co-simulation. In Proceedings of the 2nd International Conference on Simulation and Modeling Methodologies, Technologies and Applications, SIMULTECH 2012, Rome, Italy, pages 131–136, Portugal, 2012. SciTePress. [266] Zhenkai Zhang, Emeka Eyisi, Xenofon Koutsoukos, Joseph Porter, Gabor Karsai, and Janos Sztipanovits. A co-simulation framework for design of time-triggered automotive cyber physical systems. Simulation Modelling Practice and Theory, 43:16–33, 2014. ISSN 1569190X. doi: 10.1016/j.simpat.2014.01.001. [267] Chenguang Zhao, Hongman Yan, Dong Liu, Hong Zhu, Yun Wang, and Yunhui Chen. Cosimulation research and application for Active Distribution Network based on Ptolemy II and Simulink. In 2014 China International Conference on Electricity Distribution (CICED), pages 1230–1235. IEEE, sep 2014. ISBN 978-1-4799-4126-1. doi: 10.1109/CICED.2014.6991903. [268] Vojin Živojnovic and Heinrich Meyr. Compiled HW/SW Co-simulation. In Proceedings of the 33rd Annual Design Automation Conference, DAC ’96, pages 690–695, New York, NY, USA, 1996. ACM. ISBN 0-89791-779-0. doi: 10.1145/240518.240649. [269] M. Zwolinski, C. Garagate, Z. Mrcarica, T. J. Kazmierski, and A. D. Brown. Anatomy of a simulation backplane. IEE Proceedings - Computers and Digital Techniques, 142(6):377– 385(8), nov 1995. ISSN 1350-2387. 76 Table 1: Historical Perspective of Co-simulation. Time Concept Description <80s Single Formalism The equations describing dynamic behavior are integrated together. 80s Dynamic Iteration Large circuits are decomposed into coupled constituent systems and dynamic iteration techniques are used [98, 155, 167, 170, 171, 183]. 90s Multi-Formalism Software and Hardware are developed and simulated concurrently [65, 110, 206, 268] at multiple levels of abstraction [77, 117, 118]. Orchestration methods are explored in Carothers et al. [58], Fey et al. [84], Frey et al. [91], Tseng and Hulbert [233]. Late 90s and Early 2000s Standard Interfaces Recognized as key for co-simulation [116, 144, 196, 223, 269] 2010s IP Protection, X-in-the-loop, and Scale Important to enhance industrial applicability of cosimulation [7, 18–20, 74, 96, 237]. A Historical Perspective of Co-simulation This section provides an historical perspective that relates the major concepts in co-simulation to the time at which they are recognized in the studied state of the art, summarized in table 1. A.1 One Formalism and Dynamic Iteration Traditionally, the equations describing the dynamical behavior of large circuits were integrated together. These systems are sparsely coupled, reflecting the connections of the corresponding circuits, and many techniques were developed that take advantage of this structure [167]. The crucial idea that improved the simulation speed in up to two orders of magnitude is to decompose the large system into a set of coupled constituent systems and integrate them independently. The decomposition of the circuit implies the definition of inputs and outputs for each of the resulting constituent systems. The coupling is then the assignment of outputs to inputs. For a subsystem Si , we call the subsystems, whose outputs are assigned to any of the inputs of Si , for neighbor subsystems. The essence of the dynamic iteration approach is to integrate each subsystem independently, for a period of time Tn → Tn+1 , using the extrapolated outputs of the neighbor subsystems as inputs [155, 170, 171, 183]. Naturally, the fact that outputs are extrapolated introduces inaccuracy in the solution of the 77 subsystem, so the integration can be repeated for the same period of time, with corrected outputs, until some form of convergence criteria is met [121]. The extrapolated outputs of a subsystem Sj can be corrected by collecting the outputs during the integration of Sj . It is easy to see that this approach only requires communication between constituent systems at times Tn and Tn+1 and that the integration of each subsystem can be done independently and in parallel [122], using any numerical method with any step size control policy. The signals exchanged are functions in the interval [Tn , Tn+1 ]. The advantages of independent step size control policy become evident when one observes that many circuits have components that change at different rates. If the whole system were to be simulated, the simulation unit would have to use the smallest time step that ensures sufficient accuracy for the fastest changing component, which would be a huge waste of computational effort for the slow components. This is the similarity to multi-rate numerical methods [98]. To the best of our knowledge, dynamic iteration techniques and multi-rate numerical are the first to resemble co-simulation. The coordination software that implements these techniques expect any number of subsystems but assumes that the subsystems are all specific in the same formalism: differential equations. A.2 Two Formalisms: Digital and Analog Co-simulation Co-simulation, in its modern definition, was applied to enable the virtual development of coupled software and hardware systems [65, 110, 206, 268]. In this application domain, co-simulation decreases the need to build prototype board circuits to validate the composition of the software and the hardware part. It enables software and hardware to be developed and validated concurrently. To the best of our knowledge, this was one of the first uses of co-simulation in the modern sense. The co-simulation frameworks developed in this application domain typically assumed two simulation units and two formalisms. The hardware/software systems quickly became more complex and a new idea was introduced: use multiple models at different levels of abstraction of each subsystem. Simulations could be made arbitrarily faster in some intervals by solving the more abstract models, and arbitrarily accurate in other intervals, by solving the more detailed ones [77, 135, 166, 209]. In the particular case of analog-digital co-simulation, each level of abstraction was solved by a different tool: a continuous time tool and a discrete event tool. The separation into continuous time and discrete event made the abstract synchronization problem and synchronization methods between simulation units in these two domains were developed [58, 84, 91, 233]. We could call these some of the first master algorithms. A.3 Multi-abstraction/Multi-Formalism Co-simulation The heterogeneity aspect of co-simulation comes into play at this time: multiple formalisms can be used to describe the same subsystem at multiple levels of abstraction: state machines can describe a rough approximation of the modes, while differential equations can describe the detailed dynamics of the electronic circuit. Depending on the purpose of the co-simulation, a subsystem and its neighbors can be solved in detail, whereas subsystems that are “farther away” can be simulated with higher levels of abstraction [117, 118]. For the domain of Hw/sw co-simulation, RTL and TLM classify the multiple abstraction levels of models [27, 203] and switching between these multiple levels of abstraction have been studied in [131]. 78 As the number and heterogeneity of simulation tools to be coupled increases, the need to provide a common interface to couple any number of tools is recognized in Hickey et al. [116], Kuhl et al. [144], Petrellis et al. [196], Zwolinski et al. [269] and later in Blochwitz et al. [34]. In parallel with the previous advancements, co-simulation has also been in use for heterogeneous physical systems, such as automotive [105, 142, 151, 213], railway [12, 71] and HVAC [107, 231], to name just a few. The common motivation is the fact that co-simulation enables specialized simulation units to cooperatively simulated the system, with huge savings in time and cost, when compared to a monolithic modeling approach. A.4 Black-box Co-simulation Later, distributed and concurrent development processes, enabled by co-simulation, are studied and IP protection is identified as a desired characteristic [7, 237] to enable suppliers and integrators to exchange co-simulation units without having to disclose sensitive information and avoiding vendor lock-in contracts. A.5 Real-time Co-simulation Furthermore, co-simulation is used at every stage of the development process, from early system validation, to X-in-the-Loop co-simulation, bringing hard real-time constraints to the set of challenges [74]. A.6 Many simulation units: Large Scale Co-simulation More recently, with the acknowledgment that there is a need to be able to simulate even larger systems of systems, scale and distribution become inherent challenges in co-simulation [18–20, 96]. B State of the Art in Co-simulation Frameworks This section provides the detailed classification of each reference. Ref 1. Pedersen2015: Co-Simulation of Distributed Engine Control System and Network Model using FMI & SCNSL [194]. Summary. This work describes a co-simulation master in the context of the maritime industry. sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr : results visualization :post mortem fr : alg loop : explicit fr : sim step size : fixed fr :sim rate: single fr :domain:ct fr :coupling model:io assignments fr :standard:fmi fr :communication model:jacobi 79 fr :num sim:three more Ref 2. Lin2011: Power system and communication network co-simulation for smart grid applications [120]. Summary. This work describes a co-simulation between power system and network simulator. sr : info : predict step sizes sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr : results visualization :post mortem fr : alg loop : explicit fr :sim rate: single fr :coupling model:io assignments fr :num sim:two fr :domain:de fr : sim step size : variable fr :communication model:gauss seidel Ref 3. Hoepfer2011: Towards a Comprehensive Framework for Co- Simulation of Dynamic Models With an Emphasis on Time Stepping [119]. Summary. This work describes a co-simulation approach that finds an appropriate co-simulation step size. nfr :performance nfr :accuracy nfr : ip protection sr : availability : local sr : info : derivatives :out sr : info : derivatives : state sr : info : statevars sr : causality : causal sr : rollback :none sr : rel time : analytic fr :num sim:three more fr :domain:ct fr :sim rate: single fr : sim step size : variable fr :communication model:jacobi fr :communication model:gauss seidel fr : alg loop : explicit fr : results visualization :post mortem 80 Ref 4. Faure2011: Methods for real-time simulation of Cyber-Physical Systems: application to automotive domain [82]. Summary. This work addresses co-simulation with real-time simulators. nfr :performance nfr : parallelism sr : availability : local sr : rel time : fixed real scaled time simulation sr : info :wcet sr : rollback :none fr : results visualization :post mortem fr :num sim:three more fr :coupling model:io assignments fr :domain:ct fr :communication model:jacobi fr : alg loop : explicit fr :sim rate: single fr : sim step size : fixed Ref 5. Tomulik2011: Simulation of multibody systems with the use of coupling techniques: a case study [229]. Summary. This work discusses a co-simulation method for couplings with algebraic constraints. One of the results is that this kind of coupling should be done with many derivatives of the coupling variables. nfr :accuracy sr : rollback : single sr : availability : local sr : rel time : analytic sr : causality : causal sr : info : derivatives :out sr : info :jacobian:out fr : results visualization :post mortem fr :communication model:jacobi fr : alg loop : implicit fr :coupling model:algebraic constraints fr :domain:ct fr :num sim:three more fr :sim rate: single fr : sim step size : fixed Ref 6. Sun2011: Combining Advantages of Specialized Simulation Tools and Modelica Models using Functional Mock-up Interface (FMI) [224]. 81 Summary. This work describes the application of co-simulation to the power production domain. nfr : ip protection nfr :performance sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr : results visualization :post mortem fr :sim rate: single fr :coupling model:io assignments fr :standard:fmi fr :domain:ct fr :communication model:gauss seidel fr :num sim:two fr : alg loop : explicit fr : sim step size : variable Ref 7. Bastian2011a: Master for Co-Simulation Using FMI [25]. Summary. This work describes a co-simulation approach. nfr : ip protection nfr :platform independence nfr : parallelism sr : causality : causal sr : rollback :none sr : info : stateserial sr : info :jacobian:out sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr : sim step size : fixed fr :sim rate: single fr : alg loop : implicit fr :domain:ct fr :num sim:three more fr :standard:fmi fr :communication model:jacobi fr :communication model:gauss seidel Ref 8. Friedrich2011: Parallel Co-Simulation for Mechatronic Systems [93]. Summary. This work describes a co-simulation framework based on the Jacobi iteration scheme. nfr : parallelism nfr :performance nfr : distribution 82 nfr : ip protection sr : availability :remote sr : causality : causal sr : rel time : analytic sr : rollback :none fr : results visualization :post mortem fr : alg loop : explicit fr :domain:ct fr :coupling model:io assignments fr :coupling model:algebraic constraints fr :num sim:three more fr :communication model:jacobi fr :sim rate: single fr : sim step size : fixed Ref 9. Gonzalez2011: On the effect of multirate co-simulation techniques in the efficiency and accuracy of multibody system dynamics [103]. Summary. This work deals with multi-rate co-simulation. Essentially, one of the simulators (the fast one) drives the simulation, while the slow one provides extrapolated inputs, to avoid excessive computation. nfr :accuracy nfr :performance sr : causality : causal sr : rollback :none sr : availability : local sr : rel time : analytic fr : results visualization :post mortem fr : alg loop : explicit fr :communication model:gauss seidel fr :coupling model:io assignments fr :num sim:two fr :domain:ct fr :sim rate:multi fr : sim step size : fixed Ref 10. Nutaro2011: Designing power system simulators for the smart grid: Combining controls, communications, and electro-mechanical dynamics [189]. Summary. This work describes a tool that is formed by the coupling of a DEVS simulator with some other modules that wrap CT as DEVS simulators. nfr : distribution nfr :accuracy sr : causality : causal sr : rollback : single 83 sr : rel time : analytic sr : availability : local fr : alg loop : explicit fr :domain:de fr :communication model:gauss seidel fr :num sim:two fr :sim rate: single fr : sim step size : variable fr :coupling model:io assignments fr : results visualization :post mortem Ref 11. Busch2012: Asynchronous method for the coupled simulation of mechatronic systems [54]. Summary. This work describes co-simulation approaches between two simulation tools. The main contribution is a semi-implicit method that applies a correction based on the jacobian of the subsystem’s coupling variables. nfr :accuracy nfr : distribution sr : causality : causal sr : rollback : single sr : availability :remote sr : info :jacobian:out sr : rel time : analytic fr :sim rate: single fr : sim step size : fixed fr : results visualization :post mortem fr :communication model:gauss seidel fr : alg loop : semi implicit fr : alg loop : explicit fr : alg loop : implicit fr :coupling model:io assignments fr :domain:ct fr :num sim:two Ref 12. Pohlmann2012: Generating functional mockup units from software specifications [199]. Summary. This work describes an application of co-simulation to robotics. Ref 13. Schmoll2012: Convergence Study of Explicit Co-Simulation Approaches with Respect to Subsystem Solver Settings [212]. Summary. This paper describes global error analysis for co-simulation, that takes into account sub-system solvers (instead of analytical solvers, as more commonly done). nfr :accuracy sr : rollback :none sr : info : full model 84 sr : causality : causal sr : rel time : analytic sr : availability : local fr : alg loop : explicit fr :domain:ct fr :num sim:two fr :coupling model:io assignments fr :communication model:jacobi fr :sim rate: single fr : sim step size : fixed fr : results visualization :post mortem Ref 14. Ni2012: Hybrid systems modelling and simulation in DESTECS: a co-simulation approach [184]. Summary. This work present a coupling of the tools Crescendo and 20-sim. sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :communication model:gauss seidel fr : results visualization :post mortem fr :coupling model:io assignments fr : alg loop : explicit fr :domain:ct fr :sim rate: single fr : sim step size : fixed fr :num sim:two Ref 15. Hassairi2012: Matlab/SystemC for the New Co-Simulation Environment by JPEG Algorithm [115]. Summary. This work introduces guidelines for the implementation of co-simulation between Matlab and SystemC. The case study is the JPEG Algorithm. sr : info : full model sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :coupling model:io assignments fr : sim step size : fixed fr :sim rate: single fr : alg loop : explicit fr :communication model:gauss seidel fr : results visualization : live 85 fr :num sim:two Ref 16. Schierz2012: Stabilized overlapping modular time integration of coupled differentialalgebraic equations [210]. Summary. This work discusses co-simulation techniques for simulators coupled via algebraic constraints. nfr :accuracy sr : availability : local sr : rel time : analytic sr : causality : causal sr : rollback :none sr : info : full model sr : info :jacobian:out fr : results visualization :post mortem fr :sim rate: single fr :num sim:three more fr : alg loop : explicit fr : sim step size : fixed fr :domain:ct fr :coupling model:algebraic constraints fr :communication model:gauss seidel fr :communication model:jacobi Ref 17. Gunther2012: A Modular Technique for Automotive System Simulation [108]. Summary. This work describes the MDPCosim framework. nfr :performance The decomposition of the system for co-simulation is done for performance reasons. nfr : parallelism nfr :accuracy sr : availability : local IPC communication is used. sr : causality : causal sr : info : derivatives :out sr : rollback :none sr : info : predict step sizes fr : results visualization :post mortem fr : alg loop : explicit fr :coupling model:io assignments fr :domain:ct fr :communication model:jacobi fr : sim step size : variable The step size control approach is based on looking at the derivatives. fr :sim rate: single 86 fr :num sim:three more Ref 18. Quaglia2012: A SystemC/Matlab co-simulation tool for networked control systems [201]. Summary. Work describing another tool coupling. nfr : distribution sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote fr : results visualization :post mortem fr : alg loop : explicit fr :coupling model:io assignments fr :domain:ct fr :num sim:two fr :sim rate: single fr : sim step size : fixed fr :communication model:gauss seidel Ref 19. Al-Hammouri2012: A comprehensive co-simulation platform for cyber-physical systems [5]. Summary. The work describes the integration of two tools: Modelica, and NS-2. sr : causality : causal sr : rel time : analytic sr : availability : local Communication is done over named pipes. sr : rollback :none fr : results visualization :post mortem fr :num sim:two fr :coupling model:io assignments fr : alg loop : explicit fr :domain:ct fr :communication model:gauss seidel fr :domain:de fr :sim rate: single fr : sim step size : variable Ref 20. Eyisi2012: NCSWT: An integrated modeling and simulation tool for networked control systems [81]. Summary. This work describes the coupling of two tools: Matlab and NS-2. The coupling is done through HLA standard. The preliminary version of the tool is described in [204]. nfr :platform independence nfr :performance 87 nfr : distribution sr : info : predict step sizes sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote fr : alg loop : explicit fr :num sim:two fr :coupling model:io assignments fr :domain:de fr :standard:hla fr :communication model:gauss seidel fr :sim rate: single fr : sim step size : variable fr : results visualization : live Ref 21. Riley2011: Networked Control System Wind Tunnel (NCSWT): An Evaluation Tool for Networked Multi-agent Systems [204]. Summary. This work describes the coupling of two tools: Matlab and NS-2. The coupling is done through HLA standard. nfr :platform independence nfr :performance nfr : distribution sr : info : predict step sizes sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote fr : alg loop : explicit fr :num sim:two fr :coupling model:io assignments fr :domain:de fr :standard:hla fr :communication model:gauss seidel fr :sim rate: single fr : sim step size : variable fr : results visualization : live Ref 22. Roche2012: A Framework for Co-simulation of AI Tools with Power Systems Analysis Software [205]. Summary. This work describes a co-simulation between two tools in the power grid domain with matlab running the co-simulation. nfr : distribution 88 nfr :open source sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote fr :coupling model:io assignments fr :domain:ct fr :communication model:gauss seidel fr : alg loop : explicit fr : results visualization :post mortem fr :num sim:two fr :sim rate: single fr : sim step size : fixed Ref 23. Fitzgerald2010: Collaborative Modelling and Co-simulation in the Development of Dependable Embedded Systems [86]. Summary. This work describes the coupling between two tools: Overture and 20-sim. nfr :accuracy nfr : distribution nfr :platform independence sr : availability :remote sr : causality : causal sr : rel time : analytic fr : sim step size : variable fr :sim rate: single fr :domain:de fr :domain:ct fr :num sim:two fr :coupling model:io assignments fr : alg loop : explicit fr : results visualization : live fr :communication model:gauss seidel Ref 24. Fitzgerald2013: A formal approach to collaborative modelling and co-simulation for embedded systems [89]. Summary. This work describes the coupling between two tools: Overture and 20-sim; already described in [86]. nfr :accuracy nfr : distribution nfr :platform independence sr : availability :remote sr : causality : causal sr : rel time : analytic 89 fr : sim step size : variable fr :sim rate: single fr :domain:de fr :domain:ct fr :num sim:two fr :coupling model:io assignments fr : alg loop : explicit fr : results visualization : live fr :communication model:gauss seidel Ref 25. Kudelski2013: RoboNetSim: An integrated framework for multi-robot and network simulation [143]. Summary. This work describes the integration of three simulators (ARGoS, NS-2 and NS-3) that can be used in co-simulation scenarios with two simulators. nfr : distribution nfr :platform independence sr : rollback :none sr : causality : causal sr : rel time : analytic sr : availability :remote fr : results visualization :post mortem fr : alg loop : explicit fr :communication model:jacobi fr :domain:de fr :num sim:two fr :sim rate: single fr : sim step size : fixed fr :coupling model:io assignments Ref 26. Broman2013: Determinate Composition of FMUs for Co-simulation [46]. Summary. This work describes a master algorithm that ensures a determinate execution. nfr : ip protection sr : availability : local sr : rollback :none sr : rel time : analytic sr : causality : causal sr : info : causality :feedthrough sr : info : predict step sizes sr : info : stateserial fr :coupling model:io assignments fr :standard:fmi fr : sim step size : variable fr :domain:ct 90 fr :communication model:jacobi fr :num sim:three more fr :sim rate: single fr : alg loop : explicit fr : results visualization :post mortem Ref 27. Benedikt2013: Guidelines for the Application of a Coupling Method for Non-iterative Co-simulation [30]. Summary. This work describes a co-simulation approach where energy information about the signals is used, and those errors are compensated in a corrector step. nfr :accuracy nfr :performance sr : rollback :none sr : rel time : analytic sr : causality : causal sr : info :record outputs sr : availability : local fr : results visualization :post mortem fr : alg loop : explicit fr :num sim:two fr :coupling model:io assignments fr :communication model:gauss seidel fr :domain:ct fr :sim rate: single fr : sim step size : fixed Ref 28. Benedikt2013b: Macro-step-size selection and monitoring of the coupoling error for weak coupled subsystems in the frequency-domain [29]. Summary. The work describes a method for finding appropriate communication step sizes in cosimulations between LTI systems. Essentially, it provides rules of thumb to chose a communication step size based on the maximum instantaneous frequency of components. nfr :accuracy sr : availability : local sr : rollback :none sr : rel time : analytic sr : causality : causal sr : info :frequency outputs fr : results visualization :post mortem fr :sim rate: single fr :coupling model:io assignments fr : alg loop : explicit fr :communication model:gauss seidel fr :domain:ct 91 fr : sim step size : fixed fr :num sim:two Ref 29. Fuller2013: Communication simulations for power system applications [95]. Summary. This work describes a co-simulation between two co-simulation tools (ns-3 and GridLABD) for smart grid development. nfr : scalability nfr : faulttolerance nfr : ip protection nfr : distribution The tools keeps track of messages in transit. sr : causality : causal sr : rel time : analytic sr : availability :remote sr : rollback :none fr :coupling model:io assignments fr : alg loop : explicit fr :domain:de fr :num sim:two fr :sim rate: single fr : sim step size : variable fr : results visualization :post mortem fr :communication model:gauss seidel Ref 30. Bombino2013: A model-driven co-simulation environment for heterogeneous systems [39]. Summary. This work describes the coupling between two simulation tools. nfr : distribution sr : rollback :none sr : causality : causal sr : rollback : single sr : rel time : dy real scaled time simulation sr : availability :remote fr : alg loop : explicit fr :coupling model:io assignments fr :communication model:gauss seidel fr :domain:ct fr :num sim:two fr : results visualization : interactive live fr :sim rate: single fr : sim step size : fixed Ref 31. Wang2013: HybridSim: A Modeling and Co-simulation Toolchain for Cyber-physical Systems [251]. 92 Summary. The approach described in this reference allows to arrange and process co-simulation units, Modelica models and TinyOS applications. SysML is used to configure the co-simulation master. The coordination of simulators is done through the FMI standard. nfr : ip protection nfr : config reusability sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :coupling model:io assignments fr : alg loop : explicit fr :communication model:gauss seidel fr :num sim:two fr :domain:ct fr :standard:fmi fr :sim rate: single fr : sim step size : variable fr : results visualization :post mortem Ref 32. Hafner2013: An Investigation on Loose Coupling Co-Simulation with the BCVTB [114]. Summary. This work discusses the consistency and stability of the Jacobi and Gauss-Seidel cosimulation methods. Later, it presents a case study in HVAC systems. nfr :accuracy sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :coupling model:io assignments fr : results visualization :post mortem fr :communication model:jacobi fr :communication model:gauss seidel fr : alg loop : explicit fr :domain:ct fr :num sim:three more fr :sim rate: single fr : sim step size : fixed Ref 33. Zhao2014: Co-simulation research and application for Active Distribution Network based on Ptolemy II and Simulink [267]. Summary. This work describes the co-simulation between Ptolemy II and Simulink. nfr : distribution sr : causality : causal sr : rel time : analytic 93 sr : rollback :none sr : availability :remote fr :coupling model:io assignments fr :domain:ct fr :communication model:gauss seidel fr :num sim:two fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit fr : results visualization :post mortem Ref 34. Li2011c: VPNET: A co-simulation framework for analyzing communication channel effects on power systems [157]. Summary. This work describes the coupling of two simulation tools (VTB and OPNET) to achieve co-simulation. sr : availability : local sr : rollback :none sr : causality : causal sr : rel time : analytic fr : results visualization :post mortem fr : alg loop : explicit fr :coupling model:io assignments fr :communication model:gauss seidel fr :domain:ct The coordination is a sample discrete time system. fr :num sim:two fr :sim rate: single fr : sim step size : fixed Ref 35. Awais2013b: Distributed hybrid simulation using the HLA and the Functional Mock-up Interface [20]. Summary. The main difference between this work and [18] is that this proposes a variable step size wrapper around CT components. The approach taken to do this is quantization. nfr : distribution nfr : parallelism sr : rollback :none sr : causality : causal sr : rel time : analytic sr : availability :remote sr : availability : local fr : alg loop : explicit fr :communication model:gauss seidel fr :communication model:jacobi 94 fr :standard:fmi fr :standard:hla fr :num sim:three more fr :sim rate:multi fr : sim step size : variable fr :coupling model:io assignments fr :domain:de fr : results visualization :post mortem Ref 36. Awais2013a: Using the HLA for Distributed Continuous Simulations [18]. Summary. This work addresses the need to adapt CT simulators as DE simulators, in order to be used in a hybrid co-simulation scenario that is fundamentally DE oriented. nfr : distribution nfr : parallelism sr : rollback :none sr : causality : causal sr : rel time : analytic sr : availability :remote sr : availability : local fr : alg loop : explicit fr :communication model:gauss seidel fr :communication model:jacobi fr :standard:fmi fr :standard:hla fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr :coupling model:io assignments fr :domain:de fr : results visualization :post mortem Ref 37. Kuhr2013: FERAL - Framework for simulator coupling on requirements and architecture level [146]. Summary. They describe a framework that borrows many concepts from Ptolemy, but that is fundamentally event based co-simulation. It allows for the specialization of basic directors for the semantic adaptation of simulation units. nfr : ip protection nfr : extensibility sr : info : signal sr : causality : causal sr : rollback :none sr : availability : local sr : rel time : analytic 95 fr :sim rate:multi fr :communication model:gauss seidel fr :standard:fmi fr :domain:de fr :domain:ct fr :num sim:three more fr : sim step size : variable Ref 38. Viel2014: Implementing stabilized co-simulation of strongly coupled systems using the Functional Mock-up Interface 2.0. [250]. Summary. This work describes the implementation of the method described in [10] in the context of the FMI standard. nfr :accuracy nfr : ip protection sr : info :jacobian:out sr : info :input extrapolation sr : info :record outputs sr : info : stateserial sr : causality : causal sr : rel time : analytic sr : availability : local sr : rollback :none fr :domain:ct fr :num sim:three more fr :sim rate: single fr : sim step size : fixed fr : alg loop : implicit fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:gauss seidel fr :standard:fmi Ref 39. Sicklinger2014: Interface Jacobian-based Co-Simulation [220]. Summary. Describes a co-simulation method that makes use of the Jacobian information for fixed point computations. nfr :performance nfr :accuracy sr : availability : local sr : rel time : analytic sr : rollback : single sr : info :jacobian:out sr : causality : causal fr : results visualization :post mortem 96 fr :communication model:gauss seidel fr :communication model:jacobi fr :coupling model:algebraic constraints fr :domain:ct fr : alg loop : implicit fr :num sim:three more fr :sim rate: single fr : sim step size : fixed Ref 40. Zhang2014: A co-simulation framework for design of time-triggered automotive cyber physical systems [266]. Summary. The work describes a co-simulation that integrates SystemC and CarSim. sr : availability : local sr : rollback :none sr : causality : causal sr : info : full model sr : rel time : analytic fr :coupling model:io assignments fr :domain:de fr :domain:ct fr : alg loop : explicit fr : results visualization :post mortem fr : sim step size : fixed fr :sim rate: single fr :num sim:two Ref 41. Kounev2015: A microgrid co-simulation framework [139]. Summary. Describes the coupling of two simulators written in MATLAB and OMNeT++. nfr :performance sr : availability : local sr : rel time : analytic sr : rollback :none The DEV’s orchestration is conservative. sr : causality : causal sr : info : predict step sizes fr :coupling model:io assignments fr : results visualization :post mortem fr :communication model:gauss seidel fr :domain:de fr :num sim:two fr :sim rate: single fr : sim step size : variable fr : alg loop : explicit 97 Ref 42. Bogomolov2015: Co-Simulation of Hybrid Systems with SpaceEx and Uppaal [36]. Summary. The orchestration algorithm is the one described in [46]. The work exploits the standard by allowing zero step transitions. sr : info : causality :feedthrough sr : rollback :none sr : info : stateserial sr : causality : causal sr : rel time : analytic sr : availability : local fr :coupling model:io assignments fr :standard:fmi fr :num sim:two fr :communication model:jacobi fr : alg loop : explicit fr :sim rate: single fr : sim step size : variable This is due to the rejection of steps, not due to accuracy. fr :domain:ct fr :domain:de They abuse the FMI standard to be able to support state transitions. fr : results visualization :post mortem Ref 43. Bian2015: Real-time co-simulation platform using OPAL-RT and OPNET for analyzing smart grid performance [33]. Summary. Not many details are provided about the co-simulation orchestration. However, due to the fact that it is real-time, we can infer certain features. nfr :performance sr : rollback :none sr : causality : causal sr : rel time : fixed real scaled time simulation sr : availability :remote Communication is done through UDP. fr : sim step size : fixed fr :sim rate: single Two simulators do not give more than this. fr :domain:ct fr :coupling model:io assignments fr :num sim:two fr : alg loop : explicit fr : results visualization :post mortem Ref 44. Dols2016: Coupling the multizone airflow and contaminant transport software CONTAM with EnergyPlus using co-simulation [73]. 98 Summary. The work described the coupling of the CONTAM and EnergyPlus tools to achieve HVAC simulation. The coupling is done through FMI. The coupling is done through the compiled binaries. The case study highlights the problems with an explicit method for co-simulation, even if the Gauss-seidel. Instabilities occur. nfr : ip protection sr : rollback :none sr : rel time : analytic sr : causality : causal sr : availability :remote fr : results visualization :post mortem fr :domain:ct fr :num sim:two fr :standard:fmi fr : alg loop : explicit fr :coupling model:io assignments fr :communication model:gauss seidel fr : sim step size : fixed It uses a 5-minute synchronization step. fr :sim rate: single Ref 45. BenKhaled2012: Multicore simulation of powertrains using weakly synchronized model partitioning [133]. Summary. According to [28], this work explores variable step solvers. nfr : parallelism nfr :performance sr : info : causality :feedthrough sr : info : full model sr : rel time : fixed real scaled time simulation sr : rollback :none sr : availability : local fr :standard:fmi fr :coupling model:io assignments fr :num sim:three more fr :domain:ct fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit fr : results visualization :post mortem fr :communication model:jacobi fr :communication model:gauss seidel Ref 46. BenKhaled2014: Fast multi-core co-simulation of Cyber-Physical Systems: Application to internal combustion engines [28]. 99 Summary. This paper focus on the parallelization of co-simulation. The approach is to start with a single model and partition it into multiple models, which are then executed in separate FMUs in parallel. The partitioning is important for accuracy reasons (e.g., break the algebraic loops at less sensitive variables). nfr : parallelism nfr :accuracy nfr :performance nfr : scalability sr : info : full model sr : info :wcet sr : info : causality :feedthrough sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :communication model:gauss seidel fr : sim step size : fixed fr :sim rate: single fr :standard:fmi fr :domain:ct fr :num sim:three more fr : alg loop : explicit It breaks the loops by establishing an order and delaying one of the variables in the loop. Ref 47. Saidi2016: Acceleration of FMU Co-Simulation On Multi-core Architectures [208]. Summary. The paper addresses the problem of performance in FMI co-simulation. The solution proposed is to go parallel. The parallelization approach is the same as the one presented in [133]. Since FMI does not enforce thread safety across multiple instances of the same FMU, the work presented ensures that these do not execute concurrently by using mutexes or changing the scheduling policy. nfr : parallelism nfr :performance nfr : ip protection nfr : scalability sr : info :wcet sr : info : causality :feedthrough sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :communication model:jacobi fr :standard:fmi fr :domain:ct fr :num sim:three more fr : alg loop : explicit 100 Ref 48. Yamaura2016: ADAS Virtual Prototyping using Modelica and Unity Co-simulation via OpenMETA [256]. Summary. The co-simulation framework includes 4 tools. The communication between the tools is realized using OpenMeta. The work uses Unity for the modelling and simulation of the environment, allowing for live interaction. Communication is over UDP but there is no report on extra caution due to network delays and failures. nfr : parallelism sr : info : full model sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote fr :num sim:three more fr :domain:ct fr : results visualization : live fr : results visualization : interactive live fr :coupling model:io assignments fr :sim rate: single fr : alg loop : explicit Ref 49. Camus2015: Combining DEVS with multi-agent concepts to design and simulate multimodels of complex systems (WIP) [55]. Summary. This work is the preliminary description of [56]. nfr : parallelism nfr : distribution nfr : ip protection nfr :accuracy sr : rollback :none sr : info : stateserial sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:de fr : alg loop : explicit fr :num sim:three more fr :sim rate:multi fr : sim step size : variable fr :standard:fmi fr :coupling model:io assignments fr :communication model:gauss seidel fr : results visualization :post mortem 101 Ref 50. Camus2016: Hybrid Co-simulation of FMUs using DEV & DESS in MECSYCO [56]. Summary. It proposes to use a FMU wrapper around DEV and DESS models, meaning that the co-simulation proceeds using a DE approach. It handles black box FMUs and the algorithm used to drive the co-simulation is the conservative parallel DEVS simulator. It requires that the FMU is able to perform rollback (through the use of state set and get). nfr : parallelism nfr : distribution nfr : ip protection nfr :accuracy sr : rollback :none sr : info : stateserial sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:de fr : alg loop : explicit fr :num sim:three more fr :sim rate:multi fr : sim step size : variable fr :standard:fmi fr :coupling model:io assignments fr :communication model:gauss seidel fr : results visualization :post mortem Ref 51. Pedersen2016: FMI for Co-Simulation of Embedded Control Software [195]. Summary. The paper describes the adaptation of an embedded system to comply with FMI and thus interface with other FMUs. To validate the implementation, they run a co-simulation. nfr : distribution nfr : parallelism sr : rel time : fixed real scaled time simulation fr :domain:ct fr :num sim:two fr :sim rate: single fr : sim step size : fixed fr :communication model:gauss seidel fr :standard:fmi fr :coupling model:io assignments fr : alg loop : explicit fr : results visualization : live Ref 52. Oh2016: A Co-Simulation Framework for Power System Analysis [191]. 102 Summary. The paper proposes a co-simulation framework that takes into account network delays and compensates for that. It proposes to use cubic spline extrapolation to compensate for the delay but recognizes that if there are faults in the line (resulting in voltage drops), the derivatives used in the extrapolation assume gigantic proportions, thus wreaking havoc in the simulation. To address that, the framework employes an algorithm to detect discontinuities. The detection is simple: they check the derivative of the signal to see whether it exceeds a pre-determined empirically threshold. Basically, it looks for and Dirac delta. Figure 7 shows the effect of not handling a discontinuity. nfr : distribution nfr :accuracy nfr : parallelism fr :num sim:two fr :sim rate: single fr : sim step size : fixed fr :communication model:gauss seidel Due to the parallel interface protocol that they use. fr :coupling model:io assignments fr :domain:ct fr : alg loop : explicit sr : availability :remote sr : causality : causal sr : rel time : analytic sr : rollback :none Ref 53. Xie2016: Continuous-Mass-Model-Based Mechanical and Electrical Co-Simulation of SSR and Its Application to a Practical Shaft Failure Event [255]. Summary. Between two simulators. As it is explained in the paper, prior to co-simulation, the most common approach would be to run two simulations: one complete for one sub-system, and then another for the second sub-system, using the first as inputs. This is an open loop approach, whose results can be misleading due to ignoring the feedback loops. Each simulator advances in parallel and their communication is made with a barrier. nfr : parallelism fr :communication model:jacobi fr :num sim:two fr :domain:ct fr : sim step size : fixed fr : results visualization :post mortem fr :sim rate: single sr : availability : local sr : causality : causal sr : rel time : analytic sr : rollback :none fr : alg loop : explicit fr :coupling model:io assignments 103 Ref 54. Manbachi2016: Impact of EV penetration on Volt–VAR Optimization of distribution networks using real-time co-simulation monitoring platform [163]. Summary. It describes an application of co-simulation in the distribution of energy in smart grids, supported by a real-time co-simulation framework. The simulators involved are the RTDS, which simulates the distribution network model, and the VVO Engine, coded in MATLAB. sr : rel time : fixed real scaled time simulation fr :num sim:two sr : causality : causal sr : rollback :none sr : availability : local fr :coupling model:io assignments fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit fr :communication model:jacobi Ref 55. Schierz2012a: Co-simulation with communication step size control [211]. Summary. Describes a master algorithm. Does not allow for interpolation of inputs. Needs rollback. It touches upon accuracy, as it suggests an adaptive step size control mechanism. It does not address algebraic loops. It assumes that there is no feedthrough information. nfr :performance nfr :accuracy sr : info : derivatives :out sr : info : stateserial sr : causality : causal sr : rel time : analytic sr : rollback : single sr : availability : local fr :standard:fmi fr :coupling model:io assignments fr :num sim:three more fr :domain:ct fr :sim rate: single fr : sim step size : variable fr : alg loop : explicit fr : results visualization :post mortem fr :communication model:jacobi Ref 56. Fourmigue2009: Co-simulation based platform for wireless protocols design explorations [90]. 104 Summary. Application of co-simulation to wireless network development. One of the simulators is the actual Linux operating system, and the other is represents a wireless network protocol simulator. sr : causality : causal sr : rel time : analytic sr : availability : local fr :coupling model:io assignments fr :num sim:two fr :domain:de fr :communication model:jacobi Ref 57. Liu2001: Calculation of Wing Flutter by a Coupled Fluid-Structure Method [160]. Summary. A fully implicit method, dealing with parallelism. nfr : parallelism nfr :performance sr : causality : causal sr : rel time : analytic sr : rollback : single sr : availability :remote fr :coupling model:io assignments fr :num sim:two fr :domain:ct fr : alg loop : implicit fr : results visualization :post mortem Ref 58. Carstens2003: Coupled simulation of flow-structure interaction in turbomachinery [59]. Summary. Relates to the application of a co-simulation algorithm to the simulation of the deformation in the blades of a transonic compressor rotor under airflow. One of the simulators calculates deformation of the blades, while the other calculates the flow dynamics around the blades. The communication of orchestration algorithm in use is shifted by half a step. nfr :performance They highlight the need for it, because the computation of a rotor is just too expensive. sr : info : derivatives :out sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability :remote It seems that they perform the computation in separate computers. fr :coupling model:io assignments fr :num sim:two fr :domain:ct fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit 105 fr : results visualization :post mortem fr :communication model:gauss seidel Although it is a gauss seidel shifted in time. Ref 59. Stettinger2014: Model-based coupling approach for non-iterative real-time co-simulation [221]. Summary. Proposes to address the challenges in real-time co-simulation by using a model based coupling approach. The master has to keep track of two values for each packet of data: receiving time delay tr – the time it takes for a packet to reach the master from the simulator –, and sending time delay ts – the time it takes for a packet to leave the master and reach the simulator. When a sample is delayed, the master acts as a replacement for it. Basically, it is a dead reckoning model. nfr :performance nfr : parallelism nfr :accuracy sr : causality : causal fr :domain:ct fr :num sim:two sr : availability : local fr :coupling model:io assignments sr : rollback :none sr : rel time : fixed real scaled time simulation fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit fr : results visualization :post mortem fr :communication model:jacobi fr :communication model:gauss seidel Ref 60. Benedikt2016: Automated configuration for non-iterative co-simulation [31]. Summary. Describes how a co-simulation master can configure some parameters throughout the co-simulation execution. This is the idea behind adaptive master algorithms. nfr : ip protection nfr :accuracy sr : info : causality :feedthrough sr : causality : causal sr : availability : local sr : rollback :none sr : rel time : analytic fr :domain:ct fr :num sim:three more fr :coupling model:io assignments fr :sim rate: single fr : sim step size : variable fr : alg loop : explicit fr : results visualization :post mortem 106 Ref 61. Busch2011: An explicit approach for controlling the macro-step size of co-simulation methods [52]. Summary. Presents an approach to estimate the local truncation error caused by the extrapolations of inputs in a co-simulation. The sub-systems are assumed to make no error. It does not require rollback or re-initialization. Categories: nfr :accuracy Because they study the global error and control the local error. nfr : ip protection nfr :performance They control the step size, which increases performance. And they study how to get an optimal step size. sr : info : causality :feedthrough sr : rollback :none sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate:multi fr : sim step size : variable fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi In theory, they seem to support any communication model. In the paper they studied assuming the Jacobi. Ref 62. Quesnel2005: DEVS coupling of spatial and ordinary differential equations: VLE framework [202]. Summary. Proposes a way to wrap a continuous time ODE simulator as a DEVS model. It requires that the state variables, and derivatives are available. Categories: nfr :hierarchy nfr :open source sr : info : derivatives :out sr : info : statevars sr : info : predict step sizes sr : causality : causal fr :domain:de fr :num sim:three more sr : rel time : analytic fr :sim rate:multi Any discrete event framework is by definition multi-rate. 107 fr : sim step size : variable Any discrete event framework is by definition in this category. fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:gauss seidel A discrete event framework is in this category as there is no extrapolation of inputs. Also, Gauss seidel does not violate the causality of inputs and outputs, because it sorts according to these dependencies. Events are processed to retain their causality. Ref 63. Arnold2014a: Error analysis for co-simulation with force-displacement coupling [15]. Summary. Describes an FMI based master called SNiMoWrapper. Categories: nfr :accuracy Because they study the global error and control the local error. nfr : ip protection sr : info : causality :feedthrough sr : rollback :none sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr : alg loop : explicit fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi fr :standard:fmi Ref 64. Arnold2014: Error Analysis and Error Estimates for Co-simulation in FMI for Model Exchange and Co-Simulation v2.0 [14]. Summary. Studies the error control method known as Richard’s extrapolation. Categories: nfr :accuracy Because they study the global error and control the local error. nfr : ip protection sr : info : causality :feedthrough sr : info : statevars sr : rollback : single sr : causality : causal 108 fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate:multi fr : sim step size : variable fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi fr :communication model:gauss seidel fr :standard:fmi Ref 65. Arnold2001: Preconditioned Dynamic Iteration for Coupled Differential-Algebraic Systems [11]. Summary. Studies the convergence of the Gauss-Seidel dynamic iteration method and proposes a way to ensure it. The way to do it though, requires information from the model. Categories: nfr :accuracy Because they study the global error. sr : info :jacobian:out sr : info :record outputs sr : info : full model sr : rollback : single sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr : alg loop : implicit fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:gauss seidel Ref 66. Schweizer2014: Semi-implicit co-simulation approach for solver coupling [215]. Summary. Proposes a predictor corrector master that evaluates the macro step twice and uses a perturbation on the inputs to get an estimate of the required partial derivatives. This approach is then generalized to multiple kinds of joints in the mechanical domain. A double pendulum, double mass-spring-damper and a slider crank mechanism are used as numerical examples. Categories: sr : rollback : single 109 sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:two fr :sim rate:multi fr : sim step size : fixed fr : alg loop : semi implicit fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 67. Schweizer2015d: Stabilized implicit co-simulation methods: solver coupling based on constitutive laws [218]. Summary. It presents an implicit and semi-explicit methods for the co-simulation of scenarios coupled via applied forces. The difference between this paper and the previous ones by the same author seems to be in the fact that the coupling constraints are integrated and differentiated, to enrich the information being used to ensure that the original coupling constraints are met. Categories: sr : rollback : single sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr : alg loop : semi implicit fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 68. Sadjina2016: Energy Conservation and Power Bonds in Co-Simulations: Non-Iterative Adaptive Step Size Control and Error Estimation [207]. Summary. Proposes a master for co-simulation that requires the identification of power bonds between sub-systems. It assumes that the scenario is energy conserving and thus calculate the energy residual as an error to be minimized. The step size is adapted via a PI-Controller. When the step size is reduced, it is only on the next co-simulation step, so the method is explicit. nfr : ip protection nfr :accuracy Due to step size control. sr : rollback :none sr : causality : causal 110 sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:three more fr :sim rate:multi fr : sim step size : variable fr : alg loop : explicit fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi Ref 69. Busch2016: Continuous approximation techniques for co-simulation methods: Analysis of numerical stability and local error [50]. Summary. Analyses the stability and local error of multiple co-simulation approaches with multiple extrapolation approaches for the inputs. It considers Gauss-Seidel and Jacobi. It also talks about a method called the extrapolated interpolation method, which ensure no discontinuities at the inputs of the subsystems. sr : rollback :none The method is explicit. sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate: single fr : sim step size : fixed fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi fr :communication model:gauss seidel Ref 70. Arnold2010: Stability of Sequential Modular Time Integration Methods for Coupled Multibody System Models [10]. Summary. Studies stability of a gauss Seidel co-simulation method proposed in previous work: [11]. Based on that analysis, it proposes an implicit stabilization technique that uses Gauss-Seidel iteration. The resulting method is implicit but the equations that are being solved are linear. Categories: nfr :accuracy Because they study the global error. sr : info :jacobian:out sr : info :record outputs sr : info : full model 111 sr : rollback : single sr : causality : causal sr : rel time : analytic sr : availability : local fr :domain:ct fr :num sim:three more fr :sim rate: single fr : sim step size : fixed fr : alg loop : implicit fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:gauss seidel Ref 71. Gu2001: Co-simulation of algebraically coupled dynamic subsystems [105]. Summary. Describes a technique to deal with algebraically coupled sub-systems using a control theoretic approach. The highlights of this method are: it supports scenarios of arbitrary index; the boundary condition coordinator is seen as a co-simulation unit (this is an elegant approach) and the method is explicit. The beauty of making the BCC as a co-simulation unit, is that it can, just like any other sub-system be run at a different rate and in the paper they show that by running it at a higher rate, the stability of the co-simulation increases. sr : rollback :none sr : causality : causal fr :domain:ct fr :num sim:two sr : rel time : analytic fr :sim rate:multi fr : sim step size : fixed fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 72. Gu2004: Co-Simulation of Algebraically Coupled Dynamic Subsystems Without Disclosure of Proprietary Subsystem Models [107]. Summary. Describes a technique to solve causal conflicts using a Boundary Condition Coordinator (BCC). Causal conflicts arise naturally from the coupling of different sub-systems and they are a relevant challenge that needs to be overcome in order to perform correct co-simulation. While in [105], the BCC requires the knowledge of the state variables of the simulations, in [107], some modifications are made to ensure that this information is not required. nfr : ip protection nfr : distribution sr : rollback :none 112 sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate:multi fr : sim step size : fixed fr : alg loop : explicit sr : availability : local fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 73. Schweizer2016: Co-simulation method for solver coupling with algebraic constraints incorporating relaxation techniques [219]. Summary. A master algorithm capable of dealing with algebraic constraints is described. It requires the derivatives of the coupled variables to be available. It executes each communication step twice, being a semi-implicit method. It uses a predict step and a corrector step. The final corrected coupling variables are obtained by polynomial extrapolation and relaxation (to avoid instabilities). Categories: sr : rollback : single sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate:multi sr : info :jacobian:out fr : sim step size : fixed fr : alg loop : semi implicit sr : availability : local fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 74. Schweizer2015: Predictor/corrector co-simulation approaches for solver coupling with algebraic constraints [214]. Summary. Proposes a predictor corrector master that evaluates the macro step twice and uses a perturbation on the inputs to get an estimate of the required partial derivatives. Categories: sr : rollback : single sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic 113 fr :sim rate:multi fr : sim step size : fixed fr : alg loop : semi implicit sr : info :jacobian:out sr : availability : local fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 75. Schweizer2015a: Stabilized index-2 co-simulation approach for solver coupling with algebraic constraints [216]. Summary. A master algorithm capable of dealing with algebraic constraints is described. It requires the derivatives of the coupled variables to be available. It executes each communication step twice, being a semi-implicit method. It uses a predict step and a corrector step. The predictor step allows the method to estimate the sensitivity of the state variables with respect to the applied forces/torques. Categories: sr : rollback : single sr : causality : causal fr :domain:ct fr :num sim:three more sr : rel time : analytic fr :sim rate:multi sr : info :jacobian:out fr : sim step size : fixed fr : alg loop : semi implicit sr : availability : local fr : results visualization :post mortem fr :coupling model:algebraic constraints fr :communication model:jacobi Ref 76. Andersson2016: Methods and Tools for Co-Simulation of Dynamic Systems with the Functional Mock-up Interface [8]. Summary. This is a Phd Thesis. A linear extrapolation based master is proposed that is convergent and does not require fixed point iterations. Then, a modification to multi-step methods is proposed to increase their performance when executing in a co-simulation environment. This modification avoids the need to restart when dealing with discontinuities. Categories: nfr : ip protection nfr :platform independence nfr :open source sr : rollback :none sr : causality : causal 114 fr :domain:ct fr :num sim:three more sr : rel time : analytic fr : sim step size : fixed sr : availability : local fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi fr :standard:fmi Ref 77. Krammer2015: Model-Based Configuration of Automotive Co-Simulation Scenarios [140]. Summary. The language is further developed in [140] with the addition of three novel diagrams to represent different aspects of the co-simulation configuration: • Architectural – coupling of executable units; • Tools – assignment of tools to models; • Connections – connections (it was not clear what does this diagram do); In addition, they define a couple of well formedness properties that can be checked more easily with the model-based approach. They give a brief summary of the tool ICOS. Categories: nfr : config reusability nfr : parallelism nfr :hierarchy nfr : extensibility fr :domain:ct fr :num sim:three more sr : rel time : analytic sr : availability : local fr :coupling model:io assignments fr : results visualization :post mortem sr : info : full model Ref 78. Galtier2015: FMI-Based Distributed Multi-Simulation with DACCOSIM [96]. Summary. DACCOSIM is able to perform Distributed simulations and multi-core simulations. The term “computation node” is used for a collection of FMU wrappers (which include an FMU) and a local master / global master. The FMU wrappers, and thereby not the masters, are responsible for passing outputs to connected inputs. This is to avoid bottlenecks. A component node contains a master and some FMUs, which are wrapped in so-called “FMU-wrappers”. The masters take responsibility of coordinated step sizes in case an FMU needs to roll back. nfr :performance Because of the possibility of splitting the simulation over a cluster / multi-core and the focus on performance in the article. Additionally because of their use of variable step size nfr : config reusability 115 It is possible to create multiple co-simulation configuration files in the simulation configuration GUI. These can be stored and therefore reused. nfr : ip protection Some level of IP protection because of FMI.. nfr : parallelism Because of the possibility of splitting the simulation over a cluster nfr : distribution Because a co-simulation can be executed on a cluster of computers sr : availability :remote sr : availability : local nfr :hierarchy DACCOSIM is weak hierarchical because it has the notion of local and global masters. nfr : scalability The framework is considered to be scalable because of the multi-core and distributed architecture. nfr :platform independence There are two versions of the DACCOSIM library. A cross-platform version relying on JAVA and a Windows version using C++ and QTronic SDK. nfr :accuracy The article provides an example where the result of the co-simulation using DACCOSIM is compared to the simulation using Dymola and the results are very close to each other. Accuracy is ensured by each FMU examining its outputs and estimating how far they are from the exact value. nfr :open source The framework is distributed under an open source license from January 2016. sr : info : stateserial The framework can perform a single rollback using the state variable serialization. sr : causality : causal Because the framework is based on FMI for co-simulation it is considered to be causal. fr :domain:ct The framework supports multiple formalisms because it is based on FMI for co-simulation. fr :num sim:three more The frameworks is capable of supporting many FMUs and thereby many simulation units. DACCOSIM offers its own algorithm depending on global/local masters. fr :coupling model:io assignments sr : rel time : analytic There is no mentioning of any other time models than this in the article. fr :sim rate: single The simulation rate is the same for all FMUs. fr : sim step size : variable The framework uses Coordinated Variable Step fr : alg loop : explicit The framework uses Euler’s method and Richardson’s method. Whether this is default, parameterizable or fully customizable is unknown based on this article. fr :communication model:jacobi See Co-initialization bullet 2 in the article. fr :standard:fmi 116 It is based on the FMI standard. fr : results visualization :post mortem Ref 79. Fey1997: Parallel synchronization of continuous time discrete event simulators [84]. Summary. Presents two synchronization approaches, detailed in three different synchronization protocols, to coordinate simulation scenarios that include one discrete event simulator and one continuous time simulator. The discrete event simulator can implement any parallel simulation approach that we know, such as Time-Warp. This means that, even internally, the DE simulator can be forced to rollback due to straggler messages. The focus is on parallel approaches. Categories: nfr :performance nfr : ip protection nfr : parallelism nfr :accuracy fr :domain:de fr :domain:ct fr :num sim:two fr :sim rate:multi fr : sim step size : fixed fr : results visualization :post mortem sr : rel time : analytic sr : availability : local sr : rollback : single fr :coupling model:io assignments sr : info : full model Ref 80. Acker2015: Generation of an Optimised Master Algorithm for FMI Co-simulation [236]. Summary. Essentially, this paper shows how a compiled approach increases the performance of the co-simulation. It also shows that, because there are so many decisions to be made when designing the master, a compiled approach allows for a more elegant, and specifically tailored master, to be generated. nfr :performance nfr : ip protection nfr : config reusability nfr :open source sr : rel time : analytic sr : availability : local sr : info : causality :feedthrough sr : info : statevars sr : rollback :none sr : causality : causal sr : info : preferred step sizes fr :domain:ct 117 fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr : results visualization :post mortem fr :standard:fmi fr :communication model:gauss seidel fr : alg loop : implicit fr :coupling model:io assignments Ref 81. Enge-Rosenblatt2011: Functional Digital Mock-up and the Functional Mock-up Interface - Two Complementary Approaches for a Comprehensive Investigation of Heterogeneous Systems [79]. Summary. The paper describes and compares two approaches to performing co-simulation of heterogeneous systems, namely the Functional Digital Mock-up (FDMU) and the Functional Mock-up Interface (FMI). Besides describing these approaches it also introduces the “FDMU framework”, a framework that implements the Functional Digital Mock-up approach. Furthermore, proposals are presented for combining FDMU and FMI approaches. The FDMU approach is a tool-independent and web service-based framework build on the Web Service standards. It is capable of coupling different simulation tools and provide visualization based on CAD models. FDMU consists of three main concepts: functional building blocks (FBB), wrappers, FDMU master, and FDMU Console. The functional building block can wrap geometric information (CAD Models), behavioral models, and a simulator tool. It is the responsibility of the wrappers to establish a connection between the different simulation tools and the FDMU Master Simulator. Finally, the FDMU master ensures correct communication between the simulators. The FDMU Console is the user’s front-end. nfr :performance Communication overhead of a web service-based approach. nfr : ip protection Because of the the web service-based approach IP protection should be possible. nfr : parallelism Because of the web service-based approach it is parallel by nature. It uses thread-safe queues and deadlock-free transmission of data. nfr : distribution Because of the web service-based approach it is easy distributable. nfr : scalability The distributed systems paradigm ensures scalability. nfr :platform independence web service-based approach. nfr : extensibility A new wrapper can be implemented. sr : causality : causal Every input of an FBB must have an appropriate output belonging to another FBB. fr :domain:ct fr :coupling model:io assignments 118 fr :num sim:three more fr :sim rate:multi sr : availability :remote fr : results visualization : live The framework provides an interactive 3D visualization based on CAD. fr :standard:fdmu Ref 82. Karner2010a: Heterogeneous co-simulation platform for the efficient analysis of FlexRaybased automotive distributed embedded systems [130]. Summary. Motivation: FlexRay is a wired network for automotive high-speed control applications and no solutions exist that simulates all parts of the network. What: a co-simulation platform called TEODACS FlexRayExprt.Sim. The simulation approach used in the platform covers mechanics and all parts of the network from physical layer to application layer, which is not done by other solutions. The framework CISC SyAD is used to perform the microelectronics co-simulation, CarMaker/AVL InMotion for the mechanics, and they are bridged by TEODACS FlexRayEprt.Sim. The platform uses a very interesting approach to faster cosimulations, namely the use of model switching, where a less detailed model replaces a more detailed model in parts of the simulation. The paper provides an overview of existing approaches such as transaction based modeling, HDLs such as SystemC and Verilog, and cable harness and topology modeling along with why these contain shortcomings to this domain. Furthermore, the paper provides some details of the implementation of the models used in the co-simulation and showcases how the platform can analyse a system with specific examples. nfr :accuracy Because of model switching. nfr :performance Because of model switching. fr :dynamic structure Because the structure of the co-simulation is changed via model switching. fr :domain:ct Because SyAD supprots multiple formalisms and CarMaker / AVL InMotion. fr :domain:de fr :coupling model:io assignments fr :num sim:three more Multiple FlexRay nodes can be added. sr : rel time : analytic From model switching and similar it is clear that analytic simulation is used. fr : results visualization :post mortem Ref 83. Aslan2015: MOKA: An Object-Oriented Framework for FMI Co-Simulation [16]. Summary. The paper describes MOKA, which is a framework for performing co-simulations and creating FMUs using FMI 2.0 for co-simulation. The framework turns the creation of FMUs into an object-oriented process by using C++. An FMU is created by inheriting one of the classes and 119 implementing virtual functions thereby avoiding writing boilerplate code. The implementation of FMUs is realised by the concepts of FMUBlock, which is to be inherited, FMUPort, and FMUStateVariables. FMUBlock is to be extended by a concrete FMU slave and implements common computation phase functions for slaves. It contains FMUPort for data exchange and FMUStateVariables for state tracking during the simulation. The FMUPort classes provides the data exchange interface of a slave. It abstracts the value references by automatically assigning a value reference to the variable. The BaseStateVariable class also functions as base that is to be extended. It provides virtual functions for state variable services. The StateVariable inherits from BaseStateVariable and represents state variables for the slave. The framework also provides a template for the FMU Master so the master code changes minimally for different scenarios. The article exemplifies an application of the MOKA framework where two FMUs are used: The bouncing ball and integer counter example from the QTronic SDK, where the bouncing ball has been re-developed with MOKA. In future work it is stated that development of a DSL in a current study, so that different scenarios can be executed without altering the master code. nfr : ip protection nfr : config reusability sr : causality : causal sr : rel time : analytic sr : rollback :none sr : availability : local fr :coupling model:io assignments fr :num sim:three more fr :standard:fmi fr :domain:ct fr : alg loop : explicit fr :sim rate: single fr :communication model:gauss seidel fr : results visualization :post mortem Ref 84. Wetter2010: Co-simulation of building energy and control systems with the Building Controls Virtual Test Bed [253]. Summary. Describes a co-simulation framework called Building Controls Virtual Test Bed (BCVTB) that can be used for real-time simulation and co-simulation. It is a modular extensible open-source platform to interface different simulation programs with each other. The intention is to give users the option to use the best tools suited to model various aspects of building energy and control systems, or use programs where they have expertise. The middleware to couple any number of simulation programs also provides libraries such that it can be extended. Furthermore, the paper describes how they gathered capabilities the framework should support. The framework is based on Ptolemy II, which is extended by some java packages. The simulator package adds functionality that allows an actor to perform system calls to start any executable on Windows, OSX or Linux. It simply starts a simulation program, sends input tokens to the simulation program, receives new values and sends them to its output port. Algorithms are also provided on how simulators are coupled. These are also exemplified with specific simulators. It is also described how to connect 120 client programs. The article describes how the interfaces are created for simulink, matlab, modelica, and system cals. Furthermore, a specific example is presented. nfr : config reusability nfr : distribution nfr :platform independence nfr : extensibility nfr :open source sr : causality : causal sr : rel time : analytic sr : rel time : fixed real scaled time simulation fr :domain:ct In the paper, their explanation is focused on the CT domain. fr :num sim:three more fr :sim rate: single fr : sim step size : fixed fr : results visualization :post mortem fr :coupling model:io assignments fr :communication model:jacobi Ref 85. Neema2014: Model-based integration platform for FMI co-simulation and heterogeneous simulations of cyber-physical systems [182]. Summary. The article concerns integrating FMI as an HLA federate and extending the Command and Control Wind Tunnel (C2WT) metamodel to include FMI-specifics. This enables the C2WT tool to use FMUs as part of a simulation. The C2WT tool is describes as a multi-model integration platform that allows users to model and synthesize complex, heterogeneous, command and control simulations. The tool therefore has support for multiple simulation engines and an introduction to the tool is given in the paper. Furthermore, a case study on Vehicle Thermal Management using FMUs are presented and The focompared to a simulation in a different environment. The work is sponsored by the US DoD. nfr :platform independence nfr : distribution nfr : config reusability fr :domain:de fr :num sim:three more fr :sim rate:multi fr : sim step size : fixed fr : sim step size : variable sr : rel time : fixed real scaled time simulation sr : rel time : analytic fr : results visualization : live fr :standard:hla fr :standard:fmi fr :communication model:jacobi 121 Ref 86. Larsen16c: Integrated Tool Chain for Model-Based Design of Cyber-Physical Systems [148]. Summary. This article presents an overview of the INTO-CPS project and thereby a Co-Simulation tool. The projects concerns production of a well-founded tool chain for model-based design of CPSs, and therefore consists of a semantic foundation and several baseline tools such as Modelio, Overture, 20-sim, OpenModelica and RT-Tester. Furthermore, an application called the INTO-CPS application is the entry point for configuring co-simulations and uses the co-simulation orchestration engine (COE) to perform the actual simulations. This COE is based on the FMI standard. The entire tool chain and the semantic foundation are presented in this paper. This is related to [148]. nfr : config reusability nfr : ip protection sr : info :nominal values:output sr : info :nominal values:state sr : info : derivatives :out sr : info : derivatives : state sr : info :jacobian:out sr : info :jacobian: state sr : info : preferred step sizes sr : info : causality :feedthrough sr : causality : causal sr : availability : local sr : info : statevars sr : info :record outputs sr : rel time : analytic sr : info : stateserial fr :standard:fmi sr : info : signal fr :num sim:three more fr :domain:de fr :domain:ct fr :sim rate: single fr : results visualization :post mortem fr : results visualization : live Ref 87. INTOCPSD41d: Design of the INTO-CPS Platform [149]. Summary. This is an EU deliverable related to the INTO-CPS project. It contains the technical documentation of the INTO-CPS platform at the end of 2015 (the first year of the project). Part of this project is the Co-simulation Orchestration Engine (COE). This is related to [148]. sr : info : predict step sizes Supports the FMI suggested extension fmi2getMaxStepSize nfr :performance The COE supports variable step size, which can increase performance. sr : rollback : single Supports rollback to last successful state. 122 nfr :performance The COE supports variable step size, which can increase performance. nfr :accuracy Contains various constraints such as zero-crossing, bounded difference and sampling rate. Furthermore, support for allowed min and max values. C Co-Simulation Scenario Categorization This section describes each category and lists the references that belong to that category, classified in the previous section. C.1 C.1.1 Non-Functional Requirements Fault Tolerance A co-simulation platform is fault tolerant if, for example, when one simulation unit fails, other can take its place. This is particularly important for long running simulations. To be fault tolerant, certain features need to available: periodically store the state of simulation units; record all inputs to each simulation unit. If a simulation unit fails and the state is periodically stored, then the simulation can be paused while the state is restored in a new instance of the simulation unit. The history of input values passed to each simulation unit can be used to bring the simulation unit to the current state. References in this category: Fuller2013 C.1.2 Configuration Reusability This category refers to the fact that frameworks can provide a way to configure co-simulation scenarios that can be reused. This means that the configuration is considered external to the execution of the co-simulation. External in this context means that the configuration can reused without altering the binaries for the co-simulation application. If a tool/frame does not provide a way to reuse configurations for co-simulation, then it is a time-consuming, error-prone and non-trivial process to set up co-simulations [140]. References in this category: Wang2013 Krammer2015 Galtier2015 Acker2015 Aslan2015 Wetter2010 Neema2014 C.1.3 Performance Performance is a relative measure: a co-simulation platform is performant when it is able to simulate a great deal in a short amount of time while needing little resources. This can be achieved by using 123 variable step integration methods and signal extrapolation techniques. Parallelism also plays a role but mostly on the time aspect of performance. References in this category: Hoepfer2011 Faure2011 Sun2011 Friedrich2011 Gonzalez2011 Gunther2012 Eyisi2012 Riley2011 Benedikt2013 Sicklinger2014 Kounev2015 Bian2015 BenKhaled2012 BenKhaled2014 Saidi2016 Schierz2012a Liu2001 Carstens2003 Stettinger2014 Busch2011 Galtier2015 Fey1997 Acker2015 Enge−Rosenblatt2011 Karner2010a C.1.4 IP Protection IP Protection deals with not requiring the models participating in the co-simulation to provide detailed structure, variables, etc. . . There are multiple levels of protection ranging from fully protected to not protected at all. A good IP protection enables component suppliers to provide the system integrators with detailed simulations of their components avoiding expensive lock-in contracts. There are multiple techniques can be be employed to ensure some degree of protection. For instance, making the models (and corresponding simulation units) available as a web service is a possible solution. Another example is any framework that implements the FMI Standard [34, 35], which allows models and simulation units to be exported as a single functional unit, in binary format, that can be imported into a co-simulation. References in this category: Hoepfer2011 Sun2011 Bastian2011a Friedrich2011 Broman2013 124 Fuller2013 Wang2013 Kuhr2013 Viel2014 Dols2016 Saidi2016 Camus2015 Camus2016 Benedikt2016 Busch2011 Arnold2014a Arnold2014 Sadjina2016 Gu2004 Andersson2016 Galtier2015 Fey1997 Acker2015 Enge−Rosenblatt2011 Aslan2015 C.1.5 Parallelism A co-simulation framework is parallel when it makes use of multiple processes/threads to perform the co-simulation. This is typically in the same computer or same local network. Techniques such as signal extrapolation help improve the speed-up gained from parallelism. Furthermore waveform relaxation techniques and the Jacobi iterations promote parallelism [167]. References in this category: Faure2011 Bastian2011a Friedrich2011 Gunther2012 Awais2013b Awais2013a BenKhaled2012 BenKhaled2014 Saidi2016 Yamaura2016 Camus2015 Camus2016 Pedersen2016 Oh2016 Xie2016 Liu2001 Stettinger2014 Krammer2015 125 Galtier2015 Fey1997 Enge−Rosenblatt2011 C.1.6 Distribution A co-simulation framework is parallel and distributed when it allows each simulation unit to be remote, across a wide area network. This is very important since suppliers can, instead of transferring the simulation units in executable form across computers, can make them available over the web. This offers much more control over how the simulation units are used. The same techniques used in parallelism can be used to promote distribution, but fault tolerance is also important. References in this category: Friedrich2011 Nutaro2011 Busch2012 Quaglia2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Fuller2013 Bombino2013 Zhao2014 Awais2013b Awais2013a Camus2015 Camus2016 Pedersen2016 Oh2016 Gu2004 Galtier2015 Enge−Rosenblatt2011 Wetter2010 Neema2014 C.1.7 Hierarchy A hierarchical co-simulation framework is able to abstract a co-simulation scenario as a black box simulation unit. This is very intuitive and promotes abstraction of complex systems. References in this category: Quesnel2005 Krammer2015 Galtier2015 126 C.1.8 Scalability A co-simulation framework is scalable when it supports a large number of simulation units. It is intimately related to performance and paralelism. References in this category: Fuller2013 BenKhaled2014 Saidi2016 Galtier2015 Enge−Rosenblatt2011 C.1.9 Platform Independence A co-simulation framework is platform independent when it works on multiple computing platforms. For this to be achieved, a platform independent language, such as Java, can be used to coordinate the simulation. References in this category: Bastian2011a Eyisi2012 Riley2011 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Andersson2016 Galtier2015 Enge−Rosenblatt2011 Wetter2010 Neema2014 C.1.10 Extensibility A co-simulation framework is extensible when it can be easily extended to support new kinds of simulation units, with new kinds of capabilities. A higher level, domain specific, language can be used to specify the behaviour in a platform agnostic way. Code is then generated from this description. The hypothesis is that the high level description can be more easily extended to describe new behaviour and that the code generation process can be adapted accordingly. References in this category: Kuhr2013 Krammer2015 Enge−Rosenblatt2011 Wetter2010 C.1.11 Accuracy A co-simulation is accurate when the error between the trace produced and the correct trace is minimal. This can be achieved by error control mechanisms. References in this category: 127 Hoepfer2011 Tomulik2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Schierz2012 Gunther2012 Fitzgerald2010 Fitzgerald2013 Benedikt2013 Benedikt2013b Hafner2013 Viel2014 Sicklinger2014 BenKhaled2014 Camus2015 Camus2016 Oh2016 Schierz2012a Stettinger2014 Benedikt2016 Busch2011 Arnold2014a Arnold2014 Arnold2001 Sadjina2016 Arnold2010 Galtier2015 Fey1997 Karner2010a C.1.12 Open source We consider open source the frameworks that make available the source code under certain licenses that are not paid for in any way. References in this category: Roche2012 Quesnel2005 Andersson2016 Galtier2015 Acker2015 Wetter2010 C.2 Simulator Requirements This sub section covers the taxonomy that focuses on individual simulators’ capabilities. 128 C.2.1 Information Exposed Frequency of State The instantaneous frequency of the state of the sub-system can be used to adjust the communication step size. Frequency of Outputs The instantaneous frequency of the output of the sub-system can be used to adjust the communication step size, as is done in [29]. References in this category: Benedikt2013b Detailed Model Simulators that make the equations of the dynamic system available fall into this category. References in this category: Schmoll2012 Hassairi2012 Schierz2012 Zhang2014 BenKhaled2012 BenKhaled2014 Yamaura2016 Arnold2001 Arnold2010 Krammer2015 Fey1997 Nominal Values of Outputs This information indicates the order of magnitude of output signals. Nominal Values of State This information indicates the order of magnitude of state signals. I/O Signal Kind The kind of output signal helps the master algorithm understand what assumptions are in a signal. References in this category: Kuhr2013 Time Derivative Output References in this category: Hoepfer2011 Tomulik2011 Gunther2012 Schierz2012a Carstens2003 Quesnel2005 129 State References in this category: Hoepfer2011 Jacobian Output References in this category: Tomulik2011 Bastian2011a Busch2012 Schierz2012 Viel2014 Sicklinger2014 Arnold2001 Arnold2010 Schweizer2016 Schweizer2015 Schweizer2015a State Discontinuity Indicator A discontinuity indicator is a signal that indicates the presence of a discontinuity in the output of the simulation unit. Deadreckoning model A deadreckoning model is a function that can be used by other simulation units to extrapolate the behavior of this simulation unit. Preferred Step Size References in this category: Acker2015 Next Step Size The next step size indicates the next communication time that is appropriate for the current simulator. References in this category: Lin2011 Gunther2012 Eyisi2012 Riley2011 Broman2013 Kounev2015 Quesnel2005 Order of Accuracy The order of accuracy can be used to determine the appropriate input extrapolation functions to be used in a co-simulation scenario. 130 I/O Causality Feedthrough References in this category: Broman2013 Bogomolov2015 BenKhaled2012 BenKhaled2014 Saidi2016 Benedikt2016 Busch2011 Arnold2014a Arnold2014 Acker2015 Propagation Delay The propagation delay indicates how many micro-steps have to be performed before a change in the input affects an output. In Simulink, this is the number of delay blocks in chain from an input to an output. Input Extrapolation This information denotes the kind of input extrapolation being performed by the simulation unit. References in this category: Viel2014 State Variables References in this category: Hoepfer2011 Quesnel2005 Arnold2014 Acker2015 Serialized State References in this category: Bastian2011a Broman2013 Viel2014 Bogomolov2015 Camus2015 Camus2016 Schierz2012a Galtier2015 Micro-Step Outputs This information denotes the output of the simulation unit, evaluated at each of the micro-steps. References in this category: Benedikt2013 Viel2014 Arnold2001 Arnold2010 131 WCET This denotes the worst case excution time. References in this category: Faure2011 BenKhaled2014 Saidi2016 C.2.2 Causality Causal References in this category: Pedersen2015 Lin2011 Hoepfer2011 Tomulik2011 Sun2011 Bastian2011a Friedrich2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Kuhr2013 Viel2014 Sicklinger2014 132 Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2014 Saidi2016 Yamaura2016 Camus2015 Camus2016 Oh2016 Xie2016 Manbachi2016 Schierz2012a Fourmigue2009 Liu2001 Carstens2003 Stettinger2014 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Galtier2015 Acker2015 Enge−Rosenblatt2011 Aslan2015 Wetter2010 A-Causal 133 C.2.3 Time Constraints Analytic Simulation References in this category: Pedersen2015 Lin2011 Hoepfer2011 Tomulik2011 Sun2011 Friedrich2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Kuhr2013 Viel2014 Sicklinger2014 Zhang2014 Kounev2015 Bogomolov2015 Dols2016 BenKhaled2014 Saidi2016 Yamaura2016 Camus2015 Camus2016 Oh2016 134 Xie2016 Schierz2012a Fourmigue2009 Liu2001 Carstens2003 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Krammer2015 Galtier2015 Fey1997 Acker2015 Karner2010a Aslan2015 Wetter2010 Neema2014 Scaled Real Time Simulation Fixed A simulator is fixed scaled real time when it simulated time progresses according to a fixed linear relationship with the real time. References in this category: Faure2011 Bian2015 BenKhaled2012 Pedersen2016 Manbachi2016 Stettinger2014 Wetter2010 Neema2014 Dynamic 135 A simulator is dynamic scaled real time when the relation between the simulated time and the real time can be changed throughout the simulation. References in this category: Bombino2013 C.2.4 Rollback Support None References in this category: Pedersen2015 Lin2011 Hoepfer2011 Faure2011 Sun2011 Bastian2011a Friedrich2011 Gonzalez2011 Schmoll2012 Ni2012 Schierz2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Kuhr2013 Viel2014 Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 BenKhaled2014 136 Saidi2016 Yamaura2016 Camus2015 Camus2016 Oh2016 Xie2016 Manbachi2016 Carstens2003 Stettinger2014 Benedikt2016 Busch2011 Arnold2014a Sadjina2016 Busch2016 Gu2001 Gu2004 Andersson2016 Acker2015 Aslan2015 Single Single rollback means that the simulation unit is capable of saving a certain state in the past (simulated time) and revert to that state. Once reverted, the simulation unit cannot revert further in the past. References in this category: Tomulik2011 Nutaro2011 Busch2012 Bombino2013 Sicklinger2014 Schierz2012a Liu2001 Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Arnold2010 Schweizer2016 Schweizer2015 Schweizer2015a Fey1997 Multiple Multiple rollback means that the simulation unit is capable of saving a certain state in the past (simulated time) and revert to that state. Once reverted, the simulation unit revert further into the past as many times as necessary. 137 C.2.5 Availability Remote References in this category: Friedrich2011 Busch2012 Quaglia2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Fuller2013 Bombino2013 Zhao2014 Awais2013b Awais2013a Bian2015 Dols2016 Yamaura2016 Oh2016 Liu2001 Carstens2003 Galtier2015 Enge−Rosenblatt2011 Local References in this category: Pedersen2015 Lin2011 Hoepfer2011 Faure2011 Tomulik2011 Sun2011 Bastian2011a Gonzalez2011 Nutaro2011 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Gunther2012 Al−Hammouri2012 Broman2013 Benedikt2013 Benedikt2013b Wang2013 138 Hafner2013 Li2011c Awais2013b Awais2013a Kuhr2013 Viel2014 Sicklinger2014 Zhang2014 Kounev2015 Bogomolov2015 BenKhaled2012 BenKhaled2014 Saidi2016 Camus2015 Camus2016 Xie2016 Manbachi2016 Schierz2012a Fourmigue2009 Stettinger2014 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Krammer2015 Galtier2015 Fey1997 Acker2015 Aslan2015 139 C.3 C.3.1 Framework Requirements Standard High Level Architecture References in this category: Eyisi2012 Riley2011 Awais2013b Awais2013a Neema2014 Functional Mock-up Interface Pedersen2015 Sun2011 Bastian2011a Broman2013 Wang2013 Awais2013b Awais2013a Kuhr2013 Viel2014 Bogomolov2015 Dols2016 BenKhaled2012 BenKhaled2014 Saidi2016 Camus2015 Camus2016 Pedersen2016 Schierz2012a Arnold2014a Arnold2014 Andersson2016 Galtier2015 Acker2015 Aslan2015 Neema2014 References in this category: Functional Digital Mock-up References in this category: Enge−Rosenblatt2011 C.3.2 Coupling Input/Output Assignments References in this category: Pedersen2015 Lin2011 Faure2011 140 Sun2011 Bastian2011a Friedrich2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 Yamaura2016 Camus2015 Camus2016 Pedersen2016 Oh2016 Xie2016 Manbachi2016 Schierz2012a Fourmigue2009 Liu2001 Carstens2003 141 Stettinger2014 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Sadjina2016 Busch2016 Andersson2016 Krammer2015 Galtier2015 Fey1997 Acker2015 Enge−Rosenblatt2011 Karner2010a Aslan2015 Wetter2010 Algebraic Constraints References in this category: Tomulik2011 Friedrich2011 Schierz2012 Viel2014 Sicklinger2014 Arnold2001 Schweizer2014 Schweizer2015d Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a C.3.3 Number of Simulation Units Two References in this category: Lin2011 Sun2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Quaglia2012 142 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Zhao2014 Li2011c Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 Pedersen2016 Oh2016 Xie2016 Manbachi2016 Fourmigue2009 Liu2001 Carstens2003 Stettinger2014 Schweizer2014 Gu2001 Fey1997 Three or More Pedersen2015 Hoepfer2011 Faure2011 Tomulik2011 Bastian2011a Friedrich2011 Schierz2012 Gunther2012 Broman2013 Hafner2013 Awais2013b Awais2013a Kuhr2013 Viel2014 References in this category: 143 Sicklinger2014 BenKhaled2012 BenKhaled2014 Saidi2016 Yamaura2016 Camus2015 Camus2016 Schierz2012a Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Krammer2015 Galtier2015 Acker2015 Enge−Rosenblatt2011 Karner2010a Aslan2015 Wetter2010 Neema2014 C.3.4 Domain CT References in this category: Pedersen2015 Hoepfer2011 Faure2011 Tomulik2011 Sun2011 Bastian2011a Friedrich2011 Gonzalez2011 Busch2012 Schmoll2012 Ni2012 144 Hassairi2012 Schierz2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Roche2012 Fitzgerald2010 Fitzgerald2013 Broman2013 Benedikt2013 Benedikt2013b Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Kuhr2013 Viel2014 Sicklinger2014 Zhang2014 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 BenKhaled2014 Saidi2016 Yamaura2016 Pedersen2016 Oh2016 Xie2016 Schierz2012a Liu2001 Carstens2003 Stettinger2014 Benedikt2016 Busch2011 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2001 Gu2004 145 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Krammer2015 Galtier2015 Fey1997 Acker2015 Enge−Rosenblatt2011 Karner2010a Aslan2015 Wetter2010 DE References in this category: Lin2011 Nutaro2011 Al−Hammouri2012 Eyisi2012 Riley2011 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Fuller2013 Awais2013b Awais2013a Kuhr2013 Zhang2014 Kounev2015 Bogomolov2015 Camus2015 Camus2016 Fourmigue2009 Quesnel2005 Fey1997 Karner2010a Neema2014 C.3.5 Dynamic structure References in this category: Karner2010a C.3.6 Co-simulation Rate Single References in this category: Pedersen2015 Lin2011 146 Hoepfer2011 Faure2011 Tomulik2011 Sun2011 Bastian2011a Friedrich2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Viel2014 Sicklinger2014 Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 BenKhaled2014 Yamaura2016 Pedersen2016 Oh2016 Xie2016 Manbachi2016 Schierz2012a Carstens2003 147 Stettinger2014 Benedikt2016 Busch2016 Arnold2010 Galtier2015 Aslan2015 Wetter2010 Multi Multi-rate co-simulation denotes that the framework distinguishes between slow and fast sub-systems and dimensions the communication step size accordingly, providing for interpolation/extrapolation of the slow systems. References in this category: Gonzalez2011 Awais2013b Awais2013a Kuhr2013 Camus2015 Camus2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Fey1997 Acker2015 Enge−Rosenblatt2011 Neema2014 C.3.7 Communication Step Size Fixed References in this category: Pedersen2015 Faure2011 Tomulik2011 Bastian2011a Friedrich2011 Gonzalez2011 Busch2012 148 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Quaglia2012 Roche2012 Kudelski2013 Benedikt2013 Benedikt2013b Bombino2013 Hafner2013 Zhao2014 Li2011c Awais2013a Viel2014 Sicklinger2014 Zhang2014 Bian2015 Dols2016 BenKhaled2012 BenKhaled2014 Pedersen2016 Oh2016 Xie2016 Manbachi2016 Carstens2003 Stettinger2014 Arnold2014a Arnold2001 Schweizer2014 Schweizer2015d Busch2016 Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Fey1997 Acker2015 Wetter2010 Neema2014 149 Variable References in this category: Lin2011 Hoepfer2011 Sun2011 Nutaro2011 Gunther2012 Al−Hammouri2012 Eyisi2012 Riley2011 Fitzgerald2010 Fitzgerald2013 Broman2013 Fuller2013 Wang2013 Awais2013b Kuhr2013 Kounev2015 Bogomolov2015 Camus2015 Camus2016 Schierz2012a Benedikt2016 Busch2011 Quesnel2005 Arnold2014 Sadjina2016 Galtier2015 Neema2014 C.3.8 Strong Coupling Support None – Explicit Method References in this category: Pedersen2015 Lin2011 Hoepfer2011 Faure2011 Sun2011 Friedrich2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Hassairi2012 Schierz2012 Gunther2012 150 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Kudelski2013 Broman2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 BenKhaled2014 Saidi2016 Yamaura2016 Camus2015 Camus2016 Pedersen2016 Oh2016 Xie2016 Manbachi2016 Schierz2012a Carstens2003 Stettinger2014 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Sadjina2016 Busch2016 Gu2001 Gu2004 151 Galtier2015 Aslan2015 Partial – Semi-Implicit Method References in this category: Busch2012 Schweizer2014 Schweizer2015d Schweizer2016 Schweizer2015 Schweizer2015a Full – Implicit Method References in this category: Tomulik2011 Bastian2011a Busch2012 Viel2014 Sicklinger2014 Liu2001 Arnold2001 Arnold2010 Acker2015 C.3.9 Results Visualization Postmortem The results are available after the simulation. References in this category: Pedersen2015 Lin2011 Hoepfer2011 Faure2011 Tomulik2011 Sun2011 Bastian2011a Friedrich2011 Gonzalez2011 Nutaro2011 Busch2012 Schmoll2012 Ni2012 Schierz2012 Gunther2012 Quaglia2012 Al−Hammouri2012 Roche2012 Kudelski2013 Broman2013 Benedikt2013 152 Benedikt2013b Fuller2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Viel2014 Sicklinger2014 Zhang2014 Kounev2015 Bogomolov2015 Bian2015 Dols2016 BenKhaled2012 Camus2015 Camus2016 Xie2016 Schierz2012a Liu2001 Carstens2003 Stettinger2014 Benedikt2016 Busch2011 Quesnel2005 Arnold2014a Arnold2014 Arnold2001 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Arnold2010 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Krammer2015 Galtier2015 Fey1997 Acker2015 Karner2010a Aslan2015 153 Wetter2010 Live References in this category: Hassairi2012 Eyisi2012 Riley2011 Fitzgerald2010 Fitzgerald2013 Yamaura2016 Pedersen2016 Enge−Rosenblatt2011 Neema2014 Interactive References in this category: Bombino2013 Yamaura2016 C.3.10 Communication Approach Jacobi References in this category: Pedersen2015 Hoepfer2011 Faure2011 Tomulik2011 Bastian2011a Friedrich2011 Schmoll2012 Schierz2012 Gunther2012 Kudelski2013 Broman2013 Hafner2013 Awais2013b Awais2013a Sicklinger2014 Bogomolov2015 BenKhaled2012 Saidi2016 Xie2016 Manbachi2016 Schierz2012a Fourmigue2009 Stettinger2014 Busch2011 Arnold2014a Arnold2014 154 Schweizer2014 Schweizer2015d Sadjina2016 Busch2016 Gu2001 Gu2004 Schweizer2016 Schweizer2015 Schweizer2015a Andersson2016 Galtier2015 Wetter2010 Neema2014 Gauss-Seidel References in this category: Lin2011 Hoepfer2011 Sun2011 Bastian2011a Gonzalez2011 Nutaro2011 Busch2012 Ni2012 Hassairi2012 Schierz2012 Quaglia2012 Al−Hammouri2012 Eyisi2012 Riley2011 Roche2012 Fitzgerald2010 Fitzgerald2013 Benedikt2013 Benedikt2013b Fuller2013 Bombino2013 Wang2013 Hafner2013 Zhao2014 Li2011c Awais2013b Awais2013a Kuhr2013 Viel2014 Sicklinger2014 Kounev2015 155 Dols2016 BenKhaled2012 BenKhaled2014 Camus2015 Camus2016 Pedersen2016 Oh2016 Carstens2003 Stettinger2014 Quesnel2005 Arnold2014 Arnold2001 Busch2016 Arnold2010 Acker2015 Aslan2015 156 D List of Acronyms CPS CT DE DEVS DTSS FMI FR GVT IP IVP NFR ODE SR Cyber-Physical System Continuous Time Discrete Event Discrete Event System Specification Discrete Time System Specification Functional Mock-up Interface Framework Requirement Global Virtual Time Intellectual Property Initial Value Problem Non-Functional Requirement Ordinary Differential Equation Simulator Requirement 157
3cs.SY
arXiv:cs/0401016v3 [cs.LO] 14 Mar 2006 Generalized Strong Preservation by Abstract Interpretation F RANCESCO R ANZATO F RANCESCO TAPPARO Dipartimento di Matematica Pura ed Applicata, Università di Padova Via Belzoni 7, 35131 Padova, Italy [email protected] [email protected] Abstract Standard abstract model checking relies on abstract Kripke structures which approximate concrete models by gluing together indistinguishable states, namely by a partition of the concrete state space. Strong preservation for a specification language L encodes the equivalence of concrete and abstract model checking of formulas in L . We show how abstract interpretation can be used to design abstract models that are more general than abstract Kripke structures. Accordingly, strong preservation is generalized to abstract interpretation-based models and precisely related to the concept of completeness in abstract interpretation. The problem of minimally refining an abstract model in order to make it strongly preserving for some language L can be formulated as a minimal domain refinement in abstract interpretation in order to get completeness w.r.t. the logical/temporal operators of L . It turns out that this refined strongly preserving abstract model always exists and can be characterized as a greatest fixed point. As a consequence, some well-known behavioural equivalences, like bisimulation, simulation and stuttering, and their corresponding partition refinement algorithms can be elegantly characterized in abstract interpretation as completeness properties and refinements. Keywords: Abstract interpretation, abstract model checking, strong preservation, completeness, refinement, behavioural equivalence. 1 Introduction The design of an abstract model checking framework always includes a preservation result, roughly stating that for any formula ϕ specified in some temporal language L , if ϕ holds on an abstract model then ϕ also holds on the concrete model. On the other hand, strong preservation means that a formula of L holds on an abstract model if and only if it holds on the concrete model. Strong preservation is highly desirable since it allows to draw consequences from negative answers on the abstract side [10]. Generalized Strong Preservation. The relationship between abstract interpretation and abstract model checking has been the subject of a number of works (see e.g. [9, 11, 16, 17, 19, 20, 28, 39, 40, 41, 43, 47]). This paper follows the standard abstract interpretation approach [13, 14] where abstract domains are specified by Galois connections, namely pairs of abstraction and concretization maps α/γ. We deal with generic (temporal) languages L of state formulae that are inductively generated by some given sets of atomic propositions and operators. The interpretation p of atomic propositions p ∈ AP as subsets of States and of operators f ∈ Op as mappings f on ℘(States) is determined by a suitable semantic structure S, e.g. a Kripke structure, so that the concrete semantics JϕKS ∈ ℘(States) of a formula ϕ ∈ L is the set of states making ϕ true w.r.t. S. Abstract semantics can be systematically defined by standard abstract interpretation. The powerset ℘(States) plays the role of concrete semantic domain so that abstract domains range in AbsDom(℘(States)). Any abstract domain A ∈ AbsDom(℘(States)) induces an abstract semantic structure S A where atoms p are abstracted to α(p) and operators f are interpreted as best correct approximations on A, that is α◦ f ◦ γ. Thus, A determines an abstract semantics JϕKA S ∈ A that evaluates formulae ϕ ∈ L in the abstract domain A. It turns out that this approach generalizes standard abstract model checking [9, 10]. Given a Kripke 1 structure K = (States, →) (for simplicity we omit here a labeling function for atomic propositions), a standard abstract model is specified as an abstract Kripke structure A = (AStates, →♯ ) where the set AStates of abstract states is defined by a surjective map h : States → AStates. Thus, AStates determines a partition of States and vice versa. It turns out that state partitions are particular abstract domains. In fact, the lattice of partitions of States is an abstract interpretation of the lattice of abstract domains AbsDom(℘(States)) so that the abstract state space AStates corresponds to a particular abstract domain ad(AStates) ∈ AbsDom(℘(States)). Abstract domains that can be derived from a state partition are called partitioning. The interpretation of the language L w.r.t. the abstract Kripke structure A determines an abstract semantic function JϕKA ∈ AStates. The abstract Kripke structure A strongly preserves L when for any ϕ ∈ L and s ∈ States, it turns out that h(s) ∈ JϕKA ⇔ s ∈ JϕKK . Strong preservation can then be generalized from standard abstract models to abstract interpretationbased models. Given a generalized abstract model A ∈ AbsDom(℘(States)), the induced abstract semanA tics J·KA S is strongly preserving for L when for any ϕ ∈ L and S ∈ ℘(States), α(S) ≤A JϕKS ⇔ S ⊆ ♯ JϕKS . It turns out that this is an abstract domain property, because any abstract semantics J·K : L → A that evaluates formulae in the abstract domain A is strongly preserving for L if and only if J·KA S is. Standard strong preservation becomes a particular instance, namely an abstract Kripke structure strongly preserves L if and only if the corresponding partitioning abstract model strongly preserves L . On the other hand, generalized strong preservation may work where standard strong preservation may fail, namely it may happen that although a strongly preserving abstract semantics on a partitioning abstract model ad(AStates) exists this cannot be derived from a strongly preserving abstract Kripke structure on AStates. Generalized Strong Preservation and Complete Abstract Interpretations. Given a language L and a Kripke structure K = (States, →), a well-known key problem is to compute the smallest abstract state space AStates L , when this exists, such that one can define an abstract Kripke structure AL = (AStates L , →♯ ) that strongly preserves L . This problem admits solution for a number of well-known temporal languages like CTL (or, equivalently, the µ-calculus), ACTL and CTL-X (i.e. CTL without the next-time operator X). A number of algorithms for solving this problem exist, like those by Paige and Tarjan [42] for CTL, by Henzinger et al. [35], Bustan and Grumberg [5] and Tan and Cleaveland [48] for ACTL, and Groote and Vaandrager [32] for CTL-X. These are coarsest partition refinement algorithms: given a language L and a partition P of States, which is determined by a state labeling, these algorithms can be viewed as computing the coarsest partition PL that refines P and strongly preserves L . It is worth remarking that most of these algorithms have been designed for computing well-known behavioural equivalences used in process algebra like bisimulation (for CTL), simulation (for ACTL) and divergence-blind stuttering (for CTL-X) equivalence. Our abstract interpretation-based framework allows to give a generalized view of the above partition refinement algorithms. We show that the most abstract domain ADL ∈ AbsDom(℘(States)) that strongly preserves a given language L always exists. It turns out that ADL is a partitioning abstract domain if and only if L includes full propositional logic, that is when L is closed under logical conjunction and negation. Otherwise, a proper loss of information occurs when abstracting ADL to the corresponding partition PL . Moreover, for some languages L , it may happen that one cannot define an abstract Kripke structure on the abstract state space PL that strongly preserves L whereas the most abstract strongly preserving semantics in AbsDom(℘(States)) instead exists. The concept of complete abstract interpretation is well known [14, 31]. This encodes an ideal situation where the abstract semantics coincides with the abstraction of the concrete semantics. We establish a precise correspondence between generalized strong preservation of abstract models and completeness in abstract interpretation. Our results are based on the notion of forward complete abstract domain. An abstract domain A is forward complete for a concrete semantic function f when for any a ∈ A, f (γ(a)) = γ(α(f (γ(a)))), namely when no loss of precision occurs by approximating in A a computation f (γ(a)). This notion of forward completeness is dual and orthogonal to the standard definition of completeness in abstract interpretation. Giacobazzi et al. [31] showed how complete abstract domains can be systematically and constructively derived from noncomplete abstract domains by minimal refinements. This can be done for forward completeness as well. Given any domain A, the most abstract domain that refines A and is forward complete for f does exist and can be characterized as a greatest fixpoint. Such a domain is called the forward complete shell of A for f . It turns out that strong preservation is related to forward completeness as follows. As described above, the most abstract domain ADL that strongly preserves 2 L always exists. It turns out that ADL coincides with the forward complete shell for the operators of L of a basic abstract domain determined by the state labeling. This characterization provides an elegant generalization of partition refinement algorithms used in standard abstract model checking. As a consequence of these results, we derive a novel characterization of the corresponding behavioural equivalences in terms of forward completeness of abstract domains. For example, it turns out that a partition P is a bisimulation on some Kripke structure K if and only if the corresponding partitioning abstract domain ad(P ) is forward complete for the standard predecessor transformer pre→ in K. 2 Basic Notions 2.1 Notation and Preliminaries Let X be any set. Fun(X) denotes the set of functions f : X n → X, for some n ≥ 0, called arity of f . Following a standard convention, when n = 0, f is meant to be a specific object of X. The arity of f is also denoted by ♯(f ) ≥ 0. id denotes the identity map. If F ⊆ Fun(X) and Y ⊆ X then def F (Y ) = {f (~y) | f ∈ F, ~ y ∈ Y ♯(f ) }, namely F (Y ) is the set of images of Y for each function in F . If f : X → Y then the image of f is also denoted by img(f ) = {f (x) ∈ Y | x ∈ X}. If f : X → Y and g : Y → Z then g ◦ f : X → Z denotes the composition of f and g, i.e. g ◦ f = λx.g(f (x)). The complement operator for the universe set X is ∁ : ℘(X) → ℘(X), where ∁(S) = X r S. When writing a set S of subsets of a given set, like a partition, we often write S in a compact form like {1, 12, 13} or {[1], [12], [13]} that stand for {{1}, {1, 2}, {1, 3}}. Ord denotes the proper class of ordinals and ω ∈ Ord denotes the first infinite ordinal. Let hP, ≤i be a poset. Posets are often denoted also by P≤ . We use the symbol ⊑ to denote pointwise ordering between functions: If X is any set and f, g : X → P then f ⊑ g if for all x ∈ X, f (x) ≤ g(x). A mapping f : P → Q on posets is continuous when f preserves least upper bounds (lub’s) of countable chains in P , while, dually, it is co-continuous when f preserves greatest lower bounds (glb’s) of countable chains in P . A complete lattice C≤ is also denoted by hC, ≤, ∨, ∧, ⊤, ⊥i where ∨, ∧, ⊤ and ⊥ denote, respectively, lub, glb, greatest element and least element in C. A mapping f : C → D between complete lattices is additive (co-additive) when for any Y ⊆ C, f (∨C Y ) = ∨D f (Y ) (f (∧C Y ) = ∧D f (Y )). We denote by lfp(f ) and gfp(f ), respectively, the least and greatest fixpoint, when they exist, of an operator f on a poset. The well-known Knaster-Tarski’s theorem states that any monotone operator f : C → C on a complete lattice C admits a least fixpoint and the following characterization holds: lfp(f ) = ∧{x ∈ C | f (x) ≤ x} = ∨α∈Ord f α,↑ (⊥) where the upper iteration sequence {f α,↑ (x)}α∈Ord of f in x ∈ C is defined by transfinite induction on α as usual: – α = 0: f 0,↑ (x) = x; – successor ordinal α = β + 1: f β+1,↑ (x) = f (f β,↑ (x)); – limit ordinal α: f α,↑ (x) = ∨β<α f β,↑ (x). It is well known that if f is continuous then lfp(f ) = ∨α∈ω f α,↑ (⊥). Dually, f also admits a greatest fixpoint and the following characterization holds: gfp(f ) = ∨{x ∈ C | x ≤ f (x)} = ∧α∈Ord f α,↓ (⊤), where the lower iteration sequence {f α,↓ (x)}α∈Ord of f in x ∈ C is defined as the upper iteration sequence but for the case of limit ordinals: f α,↓ (x) = ∧β<α f β,↓ (x). Let Σ be any set. PreOrd(Σ) denotes the set of preorder relations on Σ, that is R ⊆ Σ × Σ is a preorder on Σ if R is reflexive and transitive. Part(Σ) denotes the set of partitions of Σ. Sets in a partition P are called blocks of P . If ≡ ⊆ Σ × Σ is an equivalence relation then we denote by P≡ ∈ Part(Σ) the corresponding partition of Σ. Vice versa, if P ∈ Part(Σ) then ≡P ⊆ Σ × Σ denotes the corresponding 3 equivalence relation on Σ. Part(Σ) is endowed with the following standard partial order 4: P1 4 P2 , i.e. P2 is coarser than P1 (or P1 refines P2 ) iff ∀B ∈ P1 .∃B ′ ∈ P2 .B ⊆ B ′ . It is well known that hPart(Σ), 4i is a complete lattice. A transition system T = (Σ, ) consists of a (possibly infinite) set Σ of states and a transition relation  ⊆ Σ × Σ. As usual [10], we assume that the relation  is total, i.e., for any s ∈ Σ there exists some t ∈ Σ such that st, so that any maximal path in T is necessarily infinite. T is finitely branching when for any s ∈ Σ, {t ∈ Σ | st} is a finite set. The pre/post transformers on ℘(Σ) are defined as usual: def – pre = λY.{a ∈ Σ | ∃b ∈ Y. ab}; def – pre f  = ∁ ◦ pre ◦∁ = λY.{a ∈ Σ | ∀b ∈ Σ.(ab ⇒ b ∈ Y )}; def – post = λY.{b ∈ Σ | ∃a ∈ Y. ab}; g  def – post = ∁ ◦ post ◦∁ = λY.{b ∈ Σ | ∀a ∈ Σ.(ab ⇒ a ∈ Y )}. g  are co-additive. Let us observe that pre and post are additive operators on ℘(Σ)⊆ while pre f  and post ∃∃ ∀∃ If R ⊆ Σ1 × Σ2 is any relation then the relations R , R ⊆ ℘(Σ1 ) × ℘(Σ2 ) are defined as follows: – (S1 , S2 ) ∈ R∃∃ iff ∃s1 ∈ S1 .∃s2 ∈ S2 . (s1 , s2 ) ∈ R; – (S1 , S2 ) ∈ R∀∃ iff ∀s1 ∈ S1 .∃s2 ∈ S2 . (s1 , s2 ) ∈ R. 2.2 Abstract Interpretation and Completeness 2.2.1 Abstract Domains In standard Cousot and Cousot’s abstract interpretation, abstract domains can be equivalently specified either by Galois connections, i.e. adjunctions, or by upper closure operators (uco’s) [13, 14]. Let us recall these standard notions. Galois Connections and Insertions. If A and C are posets and α : C → A and γ : A → C are monotone functions such that ∀c ∈ C. c ≤C γ(α(c)) and α(γ(a)) ≤A a then the quadruple (α, C, A, γ) is called a Galois connection (GC for short) between C and A. If in addition α ◦ γ = λx.x then (α, C, A, γ) is a Galois insertion (GI for short) of A in C. In a GI, γ is 1-1 and α is onto. Let us also recall that the notion of GC is equivalent to that of adjunction: if α : C → A and γ : A → C then (α, C, A, γ) is a GC iff ∀c ∈ C.∀a ∈ A. α(c) ≤A a ⇔ c ≤C γ(a). The map α (γ) is called the left- (right-) adjoint to γ (α). It turns out that one adjoint map α/γ uniquely determines the other adjoint map γ/α as follows. On the one hand, a map α : C → A admits a necessarily unique right-adjoint map γ : A → C iff α preserves def arbitrary lub’s; in this case, we have that γ = λa. ∨C {c ∈ C | α(c) ≤A a}. On the other hand, a map γ : A → C admits a necessarily unique left-adjoint map α : C → A iff γ preserves arbitrary glb’s; in def this case, α = λc. ∧A {a ∈ A | c ≤C γ(a)}. In particular, we have that in any GC (α, C, A, γ) between complete lattices it turns out that α is additive and γ is co-additive. Also, if (α, C, A, γ) is a GI and C is a complete lattice then A is a complete lattice as well and hA, ≤A i is order-isomorphic to himg(γ), ≤C i. We assume the standard abstract interpretation framework, where concrete and abstract domains, C and A, are complete lattices related by abstraction and concretization maps α and γ forming a GC (α, C, A, γ). A is called an abstraction of C and C a concretization of A. The ordering relations on concrete and abstract domains describe the relative precision of domain values: x ≤ y means that y is an approximation of x or, equivalently, x is more precise than y. Galois connections allow to relate the concrete and abstract notions of relative precision: an abstract value a ∈ A approximates a concrete value c ∈ C when α(c) ≤A a, or, equivalently (by adjunction), c ≤C γ(a). As a key consequence of requiring a Galois connection, it turns out that α(c) is the best possible approximation in A of c, that is α(c) = ∧{a ∈ A | c ≤C γ(a)} holds. If (α, C, A, γ) is a GI then each value of the abstract domain A is useful in representing C, because all the values in A represent distinct members of C, being γ 1-1. Any GC can be lifted to a GI by identifying in an equivalence class those values of the abstract domain with the same concretization. Abs(C) denotes the set of abstract domains of C and we write A ∈ Abs(C) to mean that the abstract domain A is related to 4 C through a GI (α, C, A, γ). An abstract domain A is disjunctive when the corresponding concretization map γ is additive. Closure Operators. An (upper) closure operator, or simply a closure, on a poset P≤ is an operator µ : P → P that is monotone, idempotent and extensive, i.e., ∀x ∈ P. x ≤ µ(x). Dually, lower closure operators are monotone, idempotent, and restrictive, i.e., ∀x ∈ P. µ(x) ≤ x. uco(P ) denotes the set of closure operators on P . Let hC, ≤, ∨, ∧, ⊤, ⊥i be a complete lattice. A closure µ ∈ uco(C) is uniquely determined by its image img(µ), which coincides with its set of fixpoints, as follows: µ = λy. ∧ {x ∈ img(µ) | y ≤ x}. Also, X ⊆ C is the image of some closure operator µX on C iff X is a Moore-family of def C, i.e., X = M(X) = {∧S | S ⊆ X} — where ∧∅ = ⊤ ∈ M(X). In other terms, X is a Moore-family of C when X is meet-closed. In this case, µX = λy. ∧ {x ∈ X | y ≤ x} is the corresponding closure operator on C. For any X ⊆ C, M(X) is called the Moore-closure of X in C, i.e., M(X) is the least (w.r.t. set inclusion) subset of C which contains X and is a Moore-family of C. Moreover, it turns out that for any µ ∈ uco(C) and any Moore-family X ⊆ C, µimg(µ) = µ and img(µX ) = X. Thus, closure operators on C are in bijection with Moore-families of C. This allows us to consider a closure operator µ ∈ uco(C) both as a function µ : C → C and as a Moore-family img(µ) ⊆ C. This is particularly useful and does not give rise to ambiguity since one can distinguish the use of a closure µ as function or set according to the context. It turns out that hµ, ≤i is a complete meet subsemilattice of C, i.e. ∧ is its glb, but, in general, it is not a complete sublattice of C, since the lub in µ — defined by λY ⊆ µ. µ(∨Y ) — might be different from that in C. In fact, it turns out that µ is a complete sublattice of C (namely, img(µ) is also join-closed) iff µ is additive. If C is a complete lattice then uco(C) endowed with the pointwise ordering ⊑ is a complete lattice denoted by huco(C), ⊑, ⊔, ⊓, λx.⊤, λx.xi, where for every µ, η ∈ uco(C), {µi }i∈I ⊆ uco(C) and x ∈ C: – µ ⊑ η iff ∀y ∈ C. µ(y) ≤ η(y) iff img(η) ⊆ img(µ); – (⊓i∈I µi )(x) = ∧i∈I µi (x); – x ∈ ⊔i∈I µi ⇔ ∀i ∈ I. x ∈ µi ; – λx.⊤ is the greatest element, whereas λx.x is the least element. Thus, the glb in uco(C) is defined pointwise, while the lub of a set of closures {µi }i∈I ⊆ uco(C) is the closure whose image is given by the set-intersection ∩i∈I µi . The Lattice of Abstract Domains. It is well known since [14] that abstract domains can be equivalently specified either as Galois insertions or as closures. These two approaches are completely equivalent. On the one hand, if µ ∈ uco(C) and A is a complete lattice which is isomorphic to img(µ), where ι : img(µ) → A and ι−1 : A → img(µ) provide the isomorphism, then (ι ◦ µ, C, A, ι−1 ) is a GI. On the other hand, if def (α, C, A, γ) is a GI then µA = γ ◦ α ∈ uco(C) is the closure associated with A such that himg(µA ), ≤C i is a complete lattice which is isomorphic to hA, ≤A i. Furthermore, these two constructions are inverse of each other. Let us also remark that an abstract domain A is disjunctive iff µA is additive. Given an abstract domain A specified by a GI (α, C, A, γ), its associated closure γ ◦ α on C can be thought of as the “logical meaning” of A in C, since this is shared by any other abstract representation for the objects of A. Thus, the closure operator approach is particularly convenient when reasoning about properties of abstract domains independently from the representation of their objects. Abstract domains specified by GIs can be pre-ordered w.r.t. precision as follows: if A1 , A2 ∈ Abs(C) then A1 is more precise (or concrete) than A2 (or A2 is an abstraction of A1 ), denoted by A1  A2 , when µA1 ⊑ µA2 . The pointwise ordering ⊑ between uco’s corresponds therefore to the standard ordering used to compare abstract domains with respect to their precision. Also, A1 and A2 are equivalent, denoted by A1 ≃ A2 , when their associated closures coincide, i.e. µA1 = µA2 . Hence, the quotient Abs(C)/≃ gives rise to a poset that, by a slight abuse of notation, is simply denoted by hAbs(C), ⊑i. Thus, when we write A ∈ Abs(C) we mean that A is any representative of an equivalence class in Abs(C)/≃ and is specified by 5 a Galois insertition (α, C, A, γ). It turns out that hAbs(C), ⊑i is a complete lattice, called the lattice of abstract interpretations of C [13, 14], because it is isomorphic to the complete lattice huco(C), ⊑i. Lub’s and glb’s in Abs(C) have therefore the following reading as operators on domains. Let {Ai }i∈I ⊆ Abs(C): (i) ⊔i∈I Ai is the most concrete among the domains which are abstractions of all the Ai ’s; (ii) ⊓i∈I Ai is the most abstract among the domains which are more concrete than every Ai — this latter domain is also known as reduced product of all the Ai ’s. 2.2.2 Completeness Let C be a concrete domain, f : C → C be a concrete semantic function1 and let f ♯ : A → A be a corresponding abstract function on an abstract domain A ∈ Abs(C) specified by a GI (α, C, A, γ). Then, hA, f ♯ i is a sound abstract interpretation when α ◦ f ⊑ f ♯ ◦ α holds. The abstract function f ♯ is called a correct approximation on A of f . This means that a concrete computation f (c) can be correctly approximated in A by f ♯ (α(c)), namely α(f (c)) ≤A f ♯ (α(c)). An abstract function f1♯ : A → A is more precise than f2♯ : A → A when f1♯ ⊑ f2♯ . Since α ◦ f ⊑ f ♯ ◦ α holds iff α ◦ f ◦ γ ⊑ f ♯ holds, the abstract def function f A = α ◦ f ◦ γ : A → A is called the best correct approximation of f in A. Completeness in abstract interpretation corresponds to requiring that, in addition to soundness, no loss of precision occurs when f (c) is approximated in A by f ♯ (α(c)). Thus, completeness of f ♯ for f is encoded by the equation α ◦ f = f ♯ ◦ α. This is also called backward completeness because a dual form of forward completeness may be considered. As a very simple example, let us consider the abstract domain Sign representing the sign of an integer variable, namely Sign = {⊥, Z<0 , 0, Z>0 , ⊤} ∈ Abs(℘(Z)⊆ ). Let us def consider the binary concrete operation of integer addition on sets of integers, that is X + Y = {x + y | x ∈ 2 2 def X, y ∈ Y }, and the square operator on sets of integers, that is X = {x | x ∈ X}. It turns out that the best correct approximation +Sign of integer addition in Sign is sound but not complete — because α({−1} + {1}) = 0 <Sign ⊤ = α({−1})+Sign α({1}) — while it is easy to check that the best correct approximation of the square operation in Sign is instead complete. A dual form of completeness may be considered. The soundness condition α ◦ f ⊑ f ♯ ◦ α can be equivalently formulated as f ◦ γ ⊑ γ ◦ f ♯ . Forward completeness for f ♯ corresponds to requiring that the equation f ◦ γ = γ ◦ f ♯ holds, and therefore means that no loss of precision occurs when a concrete computation f (γ(a)), for some abstract value a ∈ A, is approximated in A by f ♯ (a). Let us notice that backward and forward completeness are orthogonal concepts. In fact: (1) as observed above, we have that +Sign is not backward complete while it is forward complete because for any a1 , a2 ∈ Sign, γ(a1 ) + γ(a2 ) = γ(a1 +Sign a2 ); (2) the best correct approximation (·)2Sign of the square operator on Sign is not forward complete because γ(Z>0 )2 ( γ(Z>0 ) = γ((Z>0 )2Sign ) while, as observed above, it is instead backward complete. Giacobazzi et al. [31] observed that completeness uniquely depends upon the abstraction map, i.e. upon the abstract domain: this means that if f ♯ is backward complete for f then the best correct approximation f A of f in A is backward complete as well, and, in this case, f ♯ indeed coincides with f A . Hence, for any abstract domain A, one can define a backward complete abstract operation f ♯ on A if and only if f A is backward complete. Thus, an abstract domain A ∈ Abs(C) is defined to be backward complete for f iff the equation α ◦ f = f A ◦ α holds. This simple observation makes backward completeness an abstract domain property, namely an intrinsic characteristic of the abstract domain. Let us observe that α ◦ f = f A ◦ α holds iff γ ◦ α ◦ f = γ ◦ f A ◦ α = γ ◦ α ◦ f ◦ γ ◦ α holds, so that A is backward complete for f when µA ◦ f = µA ◦ f ◦ µA . Thus, a closure µ ∈ uco(C), that defines some abstract domain, is backward complete for f when µ ◦ f = µ ◦ f ◦ µ holds. Analogous observations apply to forward completeness, which is also an abstract domain property: A ∈ Abs(C) is forward complete for f (or forward f -complete) when f ◦ µA = µA ◦ f ◦ µA , while a closure µ ∈ uco(C) is forward complete for f when f ◦ µ = µ ◦ f ◦ µ holds. Let us also recall that, by a well-known result (see, e.g., [14, Theorem 7.1.0.4], [1, Fact 2.3] and [21, Lemma 4.3]), backward complete abstract domains are “fixpoint complete” as well. This means that if A ∈ Abs(C) is backward complete for a concrete monotone function f : C → C then α(lfp(f )) = lfp(f A ). Moreover, if α and f are both co-continuous then this also holds for greatest fixpoints, namely 1 For simplicity of notation we consider here unary functions since the extension to generic n-ary functions is straightforward. 6 α(gfp(f )) = gfp(f A ). As far as forward completeness is concerned, the following result holds. Lemma 2.1. If A ∈ Abs(C) is forward complete for a monotone f then α(gfp(f )) = gfp(f A ). Moreover, if γ and f are both continuous and γ(⊥A ) = ⊥C then α(lfp(f )) = lfp(f A ). Proof. Let us show that α(gfp(f )) = gfp(f A ). On the one hand, since gfp(f ) ≤ γ(α(gfp(f ))), we have that gfp(f ) = f (gfp(f )) ≤ f (γ(α(gfp(f )))), therefore, by using forward completeness, gfp(f ) ≤ γ(f A (α(gfp(f )))). Thus, α(gfp(f )) ≤ f A (α(gfp(f ))), from which follows that α(gfp(f )) ≤ gfp(f A ). On the other hand, by using forward completeness, f (γ(gfp(f A ))) = γ(f A (gfp(f A ))) = γ(gfp(f A )), so that γ(gfp(f A )) ≤ gfp(f ), and therefore, by applying α, we obtain that gfp(f A ) = α(γ(gfp(f A ))) ≤ α(gfp(f )). Assume now that γ and f are both continuous and γ(⊥A ) = ⊥C . Let us show by induction on k that for any k ∈ N, γ((f A )k,↑ (⊥A )) = f k,↑ (⊥C ). (k = 0): By hypothesis, γ((f A )0,↑ (⊥A )) = γ(⊥A ) = ⊥C = f 0,↑ (⊥C ). (k + 1): γ((f A )k+1,↑ (⊥A )) = γ(f A ((f A )k,↑ (⊥A ))) = A k,↑ f (γ((f ) f (f (⊥A ))) = k,↑ [by forward completeness] [by inductive hypothesis] (⊥C )) = f k+1,↑ (⊥C )). Thus, by applying α, we obtain that for any k ∈ N, (f A )k,↑ (⊥A ) = α(f k,↑ (⊥C )). (†) Since γ and f are continuous and α is always additive, we have that f A = α ◦ f ◦ γ is continuous because it is a composition of continuous functions. Hence: lfp(f A ) = ∨k∈N (f A )k,↑ (⊥A ) = [by Knaster-Tarski’s theorem] [by (†)] ∨k∈N α(f k,↑ (⊥C )) = [as α is additive] α(∨k∈N f k,↑ (⊥C )) = [by Knaster-Tarski’s theorem] α(lfp(f )) and this concludes the proof. It is worth noting that concretization maps of abstract domains which satisfies the ascending chain conditions (i.e., every ascending chain is eventually stationary) are always trivially continuous. 2.2.3 Shells Refinements of abstract domains have been studied from the beginning of abstract interpretation [13, 14] and led to the notion of shell of an abstract domain [26, 29, 31]. Given a generic poset P≤ of semantic objects — where x ≤ y intuitively means that x is a “refinement” of y — and a property P ⊆ P of these objects, the generic notion of shell goes as follows: the P-shell of an object x ∈ P is defined to be an object sx ∈ P such that: (i) sx satisties the property P, (ii) sx is a refinement of x, and (iii) sx is the greatest among the objects satisfying (i) and (ii). 7 Note that if a P-shell exists then it is unique. Moreover, if the P-shell exists for any object in P then it turns out that the operator mapping x ∈ P to its P-shell is a lower closure operator on P, being monotone, idempotent and reductive: this operator will be called the P-shell refinement. We will be particularly interested in shells of abstract domains and partitions, namely shells in the complete lattices of abstract domains and partitions. Given a state space Σ and a partition property P ⊆ Part(Σ), the P-shell of P ∈ Part(Σ) is the coarsest refinement of P satisfying P, when this exists. Also, given a concrete domain C and a domain property P ⊆ Abs(C), the P-shell of A ∈ Abs(C), when this exists, is the most abstract domain that satisfies P and refines A. Giacobazzi et al. [31] gave a constructive characterization of backward complete abstract domains, under the assumption of dealing with continuous concrete functions. As a consequence, they showed that backward complete shells always exist when the concrete functions are continuous. In Section 6 we will follow this same idea for forward completeness and this will provide the link between strongly preserving abstract models and complete abstract interpretations. 2.3 Abstract Model Checking and Strong Preservation Standard temporal languages like CTL, CTL∗ , ACTL, the µ-calculus, LTL, etc., are interpreted on models specified as Kripke structures. Given a set AP of atomic propositions (of some language), a Kripke structure K = (Σ, , ℓ) over AP consists of a transition system (Σ, ) together with a state labeling funcdef tion ℓ : Σ → ℘(AP ). We use the following notation: for any s ∈ Σ, [s]ℓ = {s′ ∈ Σ | ℓ(s) = ℓ(s′ )}, def while Pℓ = {[s]ℓ | s ∈ Σ} ∈ Part(Σ) denotes the state partition that is induced by ℓ. The notation s|=K ϕ means that a state s ∈ Σ satisfies in K a state formula ϕ of some language L , where the specific definition of the satisfaction relation |=K depends on the language L (interpretations of standard logical/temporal operators can be found in [10]). Standard abstract model checking [9, 10] relies on abstract Kripke structures that are defined over partitions of the concrete state space Σ. A set A of abstract states is related to Σ by a surjective abstraction h : Σ → A that maps concrete states into abstract states and thus gives rise to a state partition def Ph = {h−1 (a) | a ∈ A} ∈ Part(Σ). Thus, in standard abstract model checking, formulae are interpreted on an abstract Kripke structure A = (A, ♯ , ℓ♯ ) whose states are an abstract representation in A of some block of the partition Ph . Given a specification language L of state formulae, a weak preservation result for L guarantees that if a formula in L holds on an abstract Ktipke structure A then it also holds on the corresponding concrete structure K: for any ϕ ∈ L , a ∈ A and s ∈ Σ such that h(s) = a, if a|=A ϕ then s|=K ϕ. Moreover, strong preservation (s.p. for short) for L encodes the equivalence of abstract and concrete validity for formulae in L : for any ϕ ∈ L , a ∈ A and s ∈ Σ such that h(s) = a, a|=A ϕ if and only if s|=K ϕ. The definition of weakly/strongly preserving abstract Kripke structures depends on the language L . Let us recall some well-known examples [9, 10, 33]. Let K = (Σ, , ℓ) be a concrete Kripke structure h : Σ → A be a surjection. (i) Consider the language ACTL∗ . If Ph  Pℓ then the abstract Kripke structure A = (A, ∃∃ h , ℓh ) weakly preserves ACTL∗ , where ℓh (a) = ∪{ℓ(s) | s ∈ Σ, h(s) = a} and ∃∃ ⊆ A × A is defined h ′ ′ ′ ′ ′ ′ as: h(s1 ) ∃∃ h h(s2 ) ⇔ ∃s1 , s2 . h(s1 ) = h(s1 ) & h(s2 ) = h(s2 ) & s1 s2 . (ii) Let Psim ∈ Part(Σ) be the partition induced by simulation equivalence on K. If Ph = Psim (this also holds when Ph  Psim ) then the abstract Kripke structure A = (A, ∀∃ h , ℓh ) strongly preserves ′ ′ ′ ′ ′ ′ ACTL∗ , where h(s1 ) ∀∃ h(s ) ⇔ ∀s . h(s ) = h(s ). ∃s . h(s ) = h(s 2 1 2 ) & s1 s2 . 1 1 2 2 h (iii) Let Pbis ∈ Part(Σ) be the partition induced by bisimulation equivalence on K. If Ph = Pbis (this also holds when Ph  Pbis ) then the abstract Kripke structure A = (A, ∃∃ h , ℓh ) strongly preserves ∗ CTL . Following Dams [19, Section 6.1] and Henzinger et al. [36, Section 2.2], the notion of strong preservation can be also given w.r.t. a mere state partition rather than w.r.t. an abstract Kripke structure. Let J·KK : L → ℘(Σ) be the semantic function of state formulae in L w.r.t. a Kripke structure K = (Σ, , ℓ), def i.e., JϕKK = {s ∈ Σ | s|=K ϕ}. Then, the semantic interpretation of L on K induces the following logical 8 w GFED @ABC R stop stop ONML / HIJK RY GFED / @ABC G go go GFED / @ABC Y Figure 1: A U.K. traffic light. equivalence ≡K L ⊆ Σ × Σ: ′ ′ s ≡K L s iff ∀ϕ ∈ L . s ∈ JϕKK ⇔ s ∈ JϕKK . Let PL ∈ Part(Σ) be the partition induced by ≡K L (the index K denoting the Kripke structure is omitted). Then, a partition P ∈ Part(Σ) is strongly preserving2 for L (when interpreted on K) if P 4 PL . Thus, PL is the coarsest partition that is strongly preserving for L . For a number of well known temporal languages, like ACTL∗ , CTL∗ (see, respectively, the above points (ii) and (iii)), CTL∗ -X and the fragments of the µ-calculus described by Henzinger et al. [36], it turns out that if P is strongly preserving for L then the abstract Kripke structure (P, ∃∃ , ℓL ) is strongly preserving for L , where, for any B ∈ P , ℓL (B) = ∪s∈B ℓ(s). In particular, (PL , ∃∃ , ℓL ) is strongly preserving for L and, additionally, PL is the smallest possible abstract state space, namely if A = (A, ♯ , ℓ♯ ) is an abstract Kripke structure that strongly preserves L then |PL | ≤ |A|. However, given a language L and a Kripke structure K where formulae of L are interpreted, the following example shows that it is not always possible to define an abstract Kripke structure A on the partition PL such that A strongly preserves L . Example 2.2. Consider the following simple language L : L ∋ ϕ ::= stop | go | AXXϕ and the Kripke structure K depicted in Figure 1, where superscripts determine the labeling function. K models a four-state traffic light controller (like in the U.K. and in Germany): Red → RedYellow → Green → Yellow. According to the standard semantics of AXX, we have that s|=K AXXϕ iff for any path s0 s1 s2 . . . starting from s0 = s, it happens that s2 |=K ϕ. It turns out that JAXXstopKK = {G, Y } and JAXXgoKK = {R, RY }. Thus, we have that PL = {{R, RY }, {G, Y }}. However, let us show that there exists no abstract transition relation ♯ ⊆ PL × PL such that the abstract Kripke structure A = (PL , ♯ , ℓL ) strongly preserves L . Assume by contradiction that such an abstract Kripke structure A exists. Let B1 = {R, RY } ∈ PL and B2 = {G, Y } ∈ PL . Since R|=K AXXgo and G|=K AXXstop, by strong preservation, it must be that B1 |=A AXXgo and B2 |=A AXXstop. Hence, necessarily, B1 ♯ B2 A and B2 ♯ B1 . This leads to the contradiction B1 6|= AXXgo. In fact, if ♯ = {(B1 , B2 ), (B2 , B1 )} then A we would have that B1 6|= AXXgo. On the other hand, if, instead, B1 ♯ B1 (the case B2 ♯ B2 is analogous), then we would still have that B1 6|=A AXXgo. Even more, along the same lines it is not hard to show that no proper abstract Kripke structure that strongly preserves L can be defined, because even if either B1 or B2 is split we still cannot define an abstract transition relation that is strongly preserving for L . 3 Partitions as Abstract Domains Let Σ be any (possibly infinite) set of states. Following [15, Section 5], a partition P ∈ Part(Σ) can be viewed as an abstraction of ℘(Σ)⊆ as follows: any S ⊆ Σ is over approximated by the unique minimal cover of S in P , namely by the union of all the blocks B ∈ P such that B ∩ S 6= ∅. A graphical example is depicted on the left-hand side of Figure 2. This abstraction is formalized by a GI (αP , ℘(Σ)⊆ , ℘(P )⊆ , γP ) where: def def αP (S) = {B ∈ P | B ∩ S 6= ∅} γP (B) = ∪B∈B B. Hence, any partition P ∈ Part(Σ) induces an abstract domain adp (P ) ∈ Abs(℘(Σ)), and an abstract domain A ∈ Abs(℘(Σ)) is called partitioning when A is equivalent to adp (P ) for some partition P . Observe that the closure adp (P ) = γP ◦ αP associated to a partitioning abstract domain is defined as 2 Dams [19] uses the term “fine” instead of “strongly preserving”. 9 Figure 2: Partitions as abstract domains: over-approximation on the left and under-approximation on the right. adp (P ) = λS. ∪ {B ∈ P | B ∩ S 6= ∅}. Accordingly, a closure µ ∈ uco(℘(Σ)) that coincides with γP ◦ αP , for some partition P , is called partitioning. We denote by Abspar (℘(Σ)) and ucopar (℘(Σ)) the sets of, respectively, partitioning abstract domains and closures on ℘(Σ). As noted in [16], a surjective abstraction h : Σ → A used in standard abstract model checking that maps concrete states into abstract states (cf. Section 2.3) gives rise to a partitioning Galois insertion (αh , ℘(Σ)⊆ , ℘(A)⊆ , γh ) where def def αh = λS ⊆ Σ.{h(s) ∈ A | s ∈ S} and γh = λX ⊆ A.{s ∈ Σ | h(s) ∈ X}. Partitions can be also viewed as dual abstractions when a set S is under approximated by the union of all the blocks B ∈ P such that B ⊆ S. A graphical example of this under approximation is depicted on the right-hand side of Figure 2. This dual abstraction is formalized by the GI (e αP , ℘(Σ)⊇ , ℘(P )⊇ , e γP ) where the ordering on the concrete domain ℘(Σ) is given by the subset relation and def α eP (S) = {B ∈ P | B ⊆ S} def γ eP (B) = ∪B∈B B. In the following, we will be interested in viewing partitions as over approximations, that is partitions as abstract domains of ℘(Σ)⊆ . Thus, partitions can be viewed as representations of abstract domains. On the other hand, it turns out that abstract domains can be abstracted to partitions. An abstract domain A ∈ Abs(℘(Σ)⊆ ) induces a state equivalence ≡A on Σ by identifying those states that cannot be distinguished by A: s ≡A s′ iff α({s}) = α({s′ }). def For any s ∈ Σ, [s]A = {s′ ∈ Σ | α({s}) = α({s′ })} is a block of the state partition par(A) induced by A: def par(A) = {[s]A | s ∈ Σ}. Thus, par : Abs(℘(Σ)) → Part(Σ) is a mapping from abstract domains to partitions. Example 3.1. Let Σ = {1, 2, 3, 4} and let us specify abstract domains as uco’s on ℘(Σ). The uco’s µ1 = {∅, 12, 3, 4, 1234}, µ2 = {∅, 12, 3, 4, 34, 1234}, µ3 = {∅, 12, 3, 4, 34, 123, 124, 1234}, µ4 = {12, 123, 124, 1234} and µ5 = {∅, 12, 123, 124, 1234} all induce the same partition P = par(µi ) = {12, 3, 4} ∈ Part(Σ). For example, µ5 ({1}) = µ5 ({2}) = {1, 2}, µ5 ({3}) = {1, 2, 3} and µ5 ({4}) = {1, 2, 3, 4} so that par(µ5 ) = P . Observe that µ3 is the only partitioning abstract domain because adp (P ) = µ3 . Abstract domains of ℘(Σ) carry additional information other than the underlying state partition and this additional information allows us to distinguish them. It turns out that this can be precisely stated by abstract interpretation since the above mappings par and adp allows us to show that the whole lattice of partitions of Σ can be viewed as a (“higher-order”) abstraction of the lattice of abstract domains of ℘(Σ). Theorem 3.2. (par, Abs(℘(Σ))⊒ , Part(Σ) , adp ) is a Galois insertion. Proof. Let A ∈ Abs(℘(Σ)) and P ∈ Part(Σ) and let µA ∈ uco(℘(Σ)) be the closure associated with the abstract domain A. Let us prove that P  par(A) ⇔ adp (P ) ⊑ µA . 10 (⇒) For S ∈ ℘(Σ) we have to prove that adp (P )(S) ⊆ µA (S). Consider s ∈ adp (P )(S). Hence, there exists some B ∈ P such that s ∈ B and B ∩ S 6= ∅. Let q ∈ B ∩ S. Since P  par(A), there exists some block [r]A ∈ par(A) such that B ⊆ [r]A . Thus, for any x, y ∈ B, α({x}) = α({r}) = α({y}), in particular, α({s}) = α({q}). Consequently, since q ∈ S and therefore µA ({q}) ⊆ µA (S), we have that µA ({s}) = µA ({q}) ⊆ µA (S), so that s ∈ µA (S). (⇐) Consider a block B ∈ P and some s ∈ B. We show that B ⊆ [s]A , namely if s′ , s′′ ∈ B then α({s′ }) = α({s′′ }). Since adp (P ) ⊑ µA , if s′ , s′′ ∈ B then adp (P )({s′ }) = B ⊆ µA ({s′ }) so that s′′ ∈ µA ({s′ }) and therefore µA ({s′′ }) ⊆ µA ({s′ }). Likewise, µA ({s′ }) ⊆ µA ({s′′ }) so that µA ({s′ }) = µA ({s′′ }) and in turn α({s′ }) = α({s′′ }). Finally, observe that adp is 1-1 so that the above adjunction is indeed a Galois insertion. Let us observe that, as recalled in Section 2.2, the adjoint maps par and adp give rise to an order isomorphism between the lattices hPart(Σ), i and hAbspar (℘(Σ)), ⊑i. Corollary 3.3. Let A ∈ Abs(℘(Σ)). The following statements are equivalent: (1) A is partitioning. (2) γ is additive and {γ(α({s}))}s∈Σ is a partition of Σ. In this case, par(A) = {γ(α({s}))}s∈Σ . (3) A is forward complete for the complement operator ∁. Proof. Let A ∈ Abs(℘(Σ)) and let µA = γ ◦ α ∈ uco(℘(Σ)) be the corresponding uco. (1) ⇒ (2) By Theorem 3.2, A ∈ Abspar (℘(Σ)) iff adp (par(A)) = A. Thus, if adp (par(A)) = A then µA = γ ◦ α is obviously additive. Moreover, s ≡A s′ iff α({s}) = α({s′ }) iff γ(α({s})) = γ(α({s′ })), so that, for any s ∈ Σ, [s]A = γ(α({s})) and therefore par(A) = {γ(α({s}))}s∈Σ . (2) ⇒ (1) Since {γ(α({s}))}s∈Σ = P ∈ Part(Σ) we have that for any s ∈ Σ, [s]A = γ(α({s})): in fact, if s′ ∈ γ(α({s})) then α({s′ }) ≤ α({s}), hence γ(α({s′ })) ⊆ γ(α({s})) and therefore γ(α({s′ })) = γ(α({s})). Thus, par(A) = P . Moreover, since γ is additive, for any S ⊆ Σ, ∪s∈S γ(α({s})) = γ(∨s∈S α({s})) = γ(α(S)) ∈ µA . Hence, since adp (P ) = {∪s∈S γ(α({s})) | S ⊆ Σ} we have that adp (par(A)) = A. (1) ⇒ (3) Assume that A ∈ Abspar (℘(Σ)). It is enough to prove that for any s ∈ Σ, ∁(µA ({s})) ∈ µA : in fact, by (1) ⇒ (2), γ is additive and therefore µA is additive (because it is a composition of additive maps) and therefore if S ∈ µA then S = ∪s∈S µA ({s}) so that ∁(S) = ∩s∈S ∁(µA ({s})). Let us observe the following fact (∗): for any s, s′ ∈ Σ, s 6∈ µA ({s′ }) ⇔ µA ({s}) ∩ µA ({s′ }) = ∅; this is a consequence of the fact that, by (1) ⇒ (2), {µA ({s})}s∈Σ is a partition. For any s ∈ Σ, we have that ∁(µA ({s})) ∈ µA because: µA (∁(µA ({s}))) = µA ({s′ ∈ Σ | s′ 6∈ µA ({s})} = ∪{µA ({s′ }) | s′ 6∈ µA ({s})} [by additivity of µA ] [by the above fact (∗)] = ∪{µA ({s′ }) | µA ({s′ }) ∩ µA ({s}) = ∅} = ∪{µA ({s′ }) | µA ({s′ }) ⊆ ∁(µA ({s}))} ⊆ ∁(µA ({s})) (3) ⇒ (1) Assume that µA is forward complete for ∁, i.e. µA is closed under complements. By (2) ⇒ (1), it is enough to prove that γ is additive and that {µA ({s})}s∈Σ ∈ Part(Σ). (i) γ is additive. Observe that γ is additive iff µA is additive iff µA is closed under arbitrary unions. If {Si }i∈I ⊆ µA then ∪i Si = ∁(∩i ∁(Si )) ∈ µA , because, µA is closed under complements (and arbitrary intersections). (ii) {µA ({s})}s∈Σ ∈ Part(Σ). Clearly, we have that ∪s∈Σ µA ({s}) = Σ. Consider now s, r ∈ Σ such that µA ({s}) ∩ µA ({r}) 6= ∅. Let us show that µA ({s}) = µA ({r}). In order to show this, let us prove that s ∈ µA ({r}). Notice that µA ({s})rµA ({r}) = µA ({s})∩∁(µA ({r})) ∈ µA , because µA is closed under complements. If s 6∈ µA ({r}) then we would have that s ∈ µA ({s}) r µA ({r}) ∈ µA , and this would imply µA ({s}) ⊆ µA ({s}) r µA ({r}) ⊆ µA ({s}), namely µA ({s}) = µA ({s}) r µA ({r}). Thus, we would obtain the contradiction µA ({s}) ∩ µA ({r}) = ∅. Hence, we have that s ∈ µA ({r}) and therefore µA ({s}) ⊆ µA ({r}). By swapping the roles of s and r, we also obtain that µA ({r}) ⊆ µA ({s}), so that µA ({s}) = µA ({r}). 11 def Let us remark that P = adp ◦ par is a lower closure operator on hAbs(℘(Σ)), ⊑i and that for any A ∈ Abs(℘(Σ)), A is partitioning iff P(A) = A. Hence, P is exactly the partitioning-shell refinement, namely P(A) is the most abstract refinement of A that is partitioning. 4 Abstract Semantics of Languages 4.1 Concrete Semantics We consider temporal specification languages L whose state formulae ϕ are inductively defined by: L ∋ ϕ ::= p | f (ϕ1 , ..., ϕn ) where p ranges over a (typically finite) set of atomic propositions AP, while f ranges over a finite set Op of operators. AP and Op are also denoted, respectively, by AP L and Op L . Each operator f ∈ Op has an arity3 ♯(f ) > 0. Formulae in L are interpreted on a semantic structure S = (Σ, I) where Σ is any (possibly infinite) set of states and I is an interpretation function I : AP ∪ Op → Fun(℘(Σ)) that maps p ∈ AP to I(p) ∈ ℘(Σ) and f ∈ Op to I(f ) : ℘(Σ)♯(f ) → ℘(Σ). I(p) and I(f ) are also denoted by, respectively, p and f . def def Moreover, AP = {p ∈ ℘(Σ) | p ∈ AP } and Op = {f : ℘(Σ)♯(f ) → ℘(Σ) | f ∈ Op}. Note that the def interpretation I induces a state labeling ℓI : Σ → ℘(AP) by ℓI (s) = {p ∈ AP | s ∈ I(p)}. The concrete state semantic function J·KS : L → ℘(Σ) evaluates a formula ϕ ∈ L to the set of states making ϕ true w.r.t. the semantic structure S: JpKS = p and Jf (ϕ1 , ..., ϕn )KS = f (Jϕ1 KS , ..., Jϕn KS ). Semantic structures generalize the role of Kripke structures. In fact, in standard model checking a semantic structure is usually defined through a Kripke structure K so that the interpretation of logical/temporal operators is defined in terms of standard logical operators and paths in K. In the following, we freely use standard logical and temporal operators together with their corresponding usual interpretations: for example, I(∧) = ∩, I(∨) = ∪, I(¬) = ∁, I(EX) = preR , I(AX) = pre f R , etc. As an example, consider the standard semantics of CTL: CTL ∋ ϕ ::= p | ϕ1 ∧ ϕ2 | ¬ϕ | AXϕ | EXϕ | AU(ϕ1 , ϕ2 ) | EU(ϕ1 , ϕ2 ) | AR(ϕ1 , ϕ2 ) | ER(ϕ1 , ϕ2 ) with respect to a Kripke structure K = (Σ, R, ℓ). Hence, K determines a corresponding interpretation I for atoms in AP and operators of Op CTL , namely I(AX) = pre f R , I(EX) = preR , etc., and this defines the concrete semantic function J·KK : CTL → ℘(Σ). If g is any operator with arity ♯(g) = n > 0 whose interpretation is given by g : ℘(Σ)n → ℘(Σ) and S = (Σ, I) is a semantic structure then we say that a language L is closed under g for S when for any ϕ1 , ..., ϕn ∈ L there exists some ψ ∈ L such that g(Jϕ1 KS , ..., Jϕn KS ) = JψKS . For instance, if Op L includes EX and negation with their standard interpretations, i.e. I(EX) = preR and I(¬) = ∁, then L is closed under AX with its standard interpretation pre f R because pre f R = ∁ ◦ preR ◦∁. This notion can be extended in a straightforward way to infinitary operators: for instance, T L is closed under infinite logical conjunction for S iff for any Φ ⊆ L , there exists some ψ ∈ L such that ϕ∈Φ JϕKS = JψKS . In particular, let us remark that if L is closed under infinite logical conjunction then it must exist some ψ ∈ L such that ∩∅ = Σ = JψKS , namely L is able to express the tautology true. Let us remark that if the state space Σ is finite and L is closed under logical conjunction then we always mean that there exists some ψ ∈ L such that ∩∅ = Σ = JψKS . Finally, note that L is closed under negation and infinite logical conjunction if and only if L includes propositional logic. 3 It would be possible to consider generic operators whose arity is any possibly infinite ordinal, thus allowing, for example, infinite conjunctions or disjunctions. 12 p ?>=< 89:; 1 p >=< / ?89:; 2  p,q ?>=< 89:; 3 >=< / ?89:; 4 j r ⊤ @@ ~~~ @ a5 A a4 A A A }}} A }}} A a3 a2 a1 OO OOO oo O oooo * ?>=< 89:; 5 q ⊥ Figure 3: A Kripke structre on the left and an abstract domain on the right. 4.2 Abstract Semantics In the following, we apply the standard abstract interpretation approach for defining abstract semantics [13, 14]. Let L be a language and S = (Σ, I) be a semantic structure for L . An abstract semantic structure S ♯ = (A, I ♯ ) is given by an abstract domain A ∈ Abs(℘(Σ)⊆ ) and by an abstract interpretation function I ♯ : AP ∪ Op → Fun(A). An abstract semantic structure S ♯ therefore induces an abstract semantic function J·KS ♯ : L → A that evaluates formulae in L to abstract values in A. The abstract interpretation I ♯ is a correct over-approximation (respectively, under-approximation) of I on A when for any p ∈ AP , γ(I ♯ (p)) ⊇ I(p) (respectively, γ(I ♯ (p)) ⊆ I(p)) and for any f ∈ Op, γ ◦ I ♯ (f ) ⊒ I(f ) ◦ γ (respectively, γ ◦ I ♯ (f ) ⊑ I(f ) ◦ γ). If I ♯ is a correct over-approximation (respectively, underapproximation) of I and the semantic operations in Op are monotone then the abstract semantics is an over-approximation (respectively, under-approximation) of the concrete semantics, namely for any ϕ ∈ L , γ(JϕKS ♯ ) ⊇ JϕKS (respectively, γ(JϕKS ♯ ) ⊆ JϕKS ). In particular, the abstract domain A always induces an abstract semantic structure S A = (A, I A ) where I A is the best correct approximation of I on A, i.e. I A interprets atoms p and operators f as best correct approximations on A of, respectively, p and f : for any p ∈ AP and f ∈ Op, I A (p) = α(p) and I A (f ) = f A . def def Thus, the abstract domain A systematically induces an abstract semantic function J·KS A : L → A, also denoted by J·KA S , which is therefore defined by: A A A A JpKA S = α(p) and Jf (ϕ1 , ..., ϕn )KS = f (Jϕ1 KS , ..., Jϕn KS ). As usual in abstract interpretation, observe that the concrete semantics is a particular abstract semantics, namely it is the abstract semantics induced by the “identical abstraction” (id, ℘(Σ), ℘(Σ), id). Example 4.1. Let L ∋ ϕ ::= p | q | r | ϕ1 ∧ ϕ2 | EXϕ. Let us consider the Kripke structure K = (Σ, , ℓ) and the lattice A both depicted in Figure 3. Let S be the semantic structure induced by the Kripke structure K so that EX = pre . Let us consider the formulae EXr and EX(p ∧ q), whose concrete semantics are as follows: JEXrKS = {3, 5} and JEX(p ∧ q)KS = {1, 2}. A is an abstract domain of ℘(Σ) where the Galois insertion (α, ℘(Σ), A, γ) is determined by the following concretization map: γ(⊥) = ∅; γ(a1 ) = {1, 2}; γ(a2 ) = {3}; γ(a3 ) = {3, 4}; γ(a4 ) = {1, 2, 3}; γ(a5 ) = {3, 4, 5}; γ(⊤) = {1, 2, 3, 4, 5}. Note that, by Corollary 3.3, A is not partitioning because γ is not additive: γ(a2 ) ∪ γ(a3 ) = {3, 4} ( {3, 4, 5} = γ(a2 ∨ a3 ). It turns out that: JEXrKA S = α(pre (γ(JrKA S )) = α(pre (γ(α(r)))) = α(pre (γ(a3 ))) = α(pre ({3, 4})) = α({1, 2, 3, 5}) = ⊤; JEX(p ∧ q)KA S A = α(pre (γ(JpKA S ∧ JqKS ))) = α(pre (γ(α(p) ∧ α(q)))) = α(pre (γ(a4 ∧ a5 ))) = α(pre (γ(a2 ))) = α(pre (3)) = α({1, 2}) = a1 . Observe that the abstract semantics JEXrKA S is a proper over-approximation of JEXrKS because JEXrKS ( ). On the other hand, the concrete semantics JEX(p ∧ q)KS is precisely represented in A because γ(JEXrKA S ) = JEX(p ∧ q)K . γ(JEX(p ∧ q)KA S S 13 5 Generalized Strong Preservation We showed in Section 3 how a state partition P can be viewed as a partitioning abstract domain adp (P ) specified by the GI (αP , ℘(Σ)⊆ , ℘(P )⊆ , γP ). Thus, given a language L and a corresponding semantic structure S = (Σ, I), it turns out that any partition P ∈ Part(Σ) systematically induces a corresponddef adp (P ) : L → adp (P ) that evaluates a formula in L to a (possibly ing abstract semantics J·KP S = J·KS empty) union of blocks of P . Strong preservation for a partition P can be characterized in terms of the corresponding abstract domain adp (P ) as follows. Lemma 5.1. P ∈ Part(Σ) is s.p. for L iff ∀ϕ ∈ L and S ⊆ Σ, αP (S) ⊆ JϕKP S ⇔ S ⊆ JϕKS . Proof. (⇒): Let us first observe that for any ϕ ∈ L , γP (αP (JϕKS )) = JϕKS : in fact, for any s ∈ JϕKS , αP ({s}) is the block of P containing s; since P  PL , we have that αP ({s}) ⊆ JϕKS , and from this αP (JϕKS ) ⊆ JϕKS and in turn γP (αP (JϕKS )) = JϕKS . Let us now prove by structural induction on ϕ ∈ L that JϕKS = γP (JϕKP S ): – ϕ ≡ p ∈ AP L : by using the above observation, JpKS = γP (αP (JpKS )) = γP (JpKP S ). – ϕ ≡ f (ϕ1 , . . . , ϕn ): Jf (ϕ1 , . . . , ϕn )KS = [by the above observation] γP (αP (Jf (ϕ1 , . . . , ϕn )KS )) = [by definition] γP (αP (f (Jϕ1 KS , . . . , Jϕn KS ))) = [by inductive hypothesis] P γP (αP (f (γP (Jϕ1 KP S ), . . . , γP (Jϕn KS )))) = [by definition] γP (Jf (ϕ1 , . . . , ϕn )KP S ). P Now, consider any ϕ ∈ L . If S ⊆ JϕKS then αP (S) ⊆ αP (JϕKS ) = αP (γP (JϕKP S )) = JϕKS . Conversely, P if αP (S) ⊆ JϕKP then S ⊆ γ (JϕK ) = JϕK . P S S S (⇐): Consider a block B ∈ P and s, s′ ∈ B so that αP ({s}) = B = αP ({s′ }). By hypothesis, for ′ P ′ any ϕ ∈ L , we have that s ∈ JϕKS iff αP ({s}) ⊆ JϕKP S iff αP ({s }) ⊆ JϕKS iff s ∈ JϕKS . Thus, ′ s ≡L s . This states that a partition P ∈ Part(Σ) is s.p. for L if and only if to check whether some set S of states satisfies some formula ϕ ∈ L , i.e. S ⊆ JϕKS , is equivalent to check whether the abstract state P αP (S) is more precise than the abstract semantics JϕKP S , that is S is over-approximated by JϕKS . The key observation here is that in our abstract interpretation-based framework partitions are particular abstract domains. This allows us to generalize the notion of strong preservation from partitions to generic abstract semantic functions as follows. Definition 5.2. Let L be a language, S = (Σ, I) be a semantic structure for L and S ♯ = (A, I ♯ ) be a corresponding abstract semantic structure. The abstract semantics J·KS ♯ is strongly preserving for L (w.r.t. S) if for any ϕ ∈ L and S ⊆ Σ, α(S) ≤A JϕKS ♯ ⇔ S ⊆ JϕKS . Definition 5.2 generalizes standard strong preservation from partitions, as characterized by Lemma 5.1, both to an arbitrary abstract domain A ∈ Abs(℘(Σ)) and to a corresponding abstract interpretation function I ♯ . Likewise, standard weak preservation can be generalized as follows. Let K = (Σ, R, ℓ) be a concrete Kripke structure that induces the concrete semantics JϕKK = {s ∈ Σ | s|=K ϕ}. Let h : Σ → A be a surjective abstraction and let (αh , ℘(Σ), ℘(A), γh ) be the corresponding partitioning abstract domain. Let A = (A, R♯ , ℓ♯ ) be an abstract Kripke structure on A that gives rise to the abstract semantics JϕKA = {a ∈ A | a|=A ϕ}. Then, A weakly preserves L when ∀φ ∈ L .∀S ⊆ Σ. αh (S) ⊆ JϕKA ⇒ S ⊆ JϕKK . Hence, weak preservation can be generalized to generic abstract domains and abstract semantics accordingly to Definition 5.2. 14 p ?>=< 89:; 1 p >=< / ?89:; 2 p >=< / ?89:; 3 p ONML HIJK [12] h p HIJK / ONML [3] r Figure 4: A Kripke structure K on the left and an abstract Kripke structure A on the right. 5.1 Strong Preservation is an Abstract Domain Property Definition 5.2 is a direct and natural generalization of the standard notion of strong preservation in abstract model checking. It can be equivalently stated as follows. Lemma 5.3. J·KS ♯ is s.p. for L iff for any ϕ ∈ L , JϕKS = γ(JϕKS ♯ ). Proof. (⇒) On the one hand, γ(JϕKS ♯ ) ⊆ JϕKS iff α(γ(JϕKS ♯ )) ≤ JϕKS ♯ iff JϕKS ♯ ≤ JϕKS ♯ , which is trivially true. On the other hand, JϕKS ⊆ γ(JϕKS ♯ ) iff α(JϕKS ) ≤ JϕKS ♯ iff JϕKS ⊆ JϕKS , that is trivially true. (⇐) We have that S ⊆ JϕKS iff S ⊆ γ(JϕKS ♯ ) iff α(S) ≤ JϕKS ♯ . In particular, it is worth noting that if J·KS ♯ is s.p. for L then J·KS ♯ = α ◦ J·KS holds. Lemma 5.4. Let A ∈ Abs(℘(Σ)). (1) Let S1♯ = (A, I1♯ ) and S2♯ = (A, I2♯ ) be abstract semantic structures on A. If J·KS ♯ and J·KS ♯ are both 1 2 s.p. for L then J·KS ♯ = J·KS ♯ . 1 2 (2) Let S ♯ = (A, I ♯ ) be an abstract semantic structure on A. If J·KS ♯ is s.p. for L then J·KA S is s.p. for L . Proof. (1) By Lemma 5.3, for any ϕ ∈ L , γ(JϕKS ♯ ) = JϕKS = γ(JϕKS ♯ ), so that, by applying α, 1 2 JϕKS ♯ = α(γ(JϕKS ♯ )) = α(JϕKS ) = α(γ(JϕKS ♯ )) = JϕKS ♯ . 1 1 2 2 (2) Let us first observe that for any ϕ ∈ L , γ(α(JϕKS )) = JϕKS . In fact, γ(α(JϕKS )) ⊆ JϕKS ⇔ α(γ(α(JϕKS ))) ≤ JϕKS ♯ ⇔ α(JϕKS ) ≤ JϕKS ♯ ⇔ JϕKS ⊆ JϕKS . As a consequence of this fact, by structural induction on ϕ ∈ L , analogously to the proof of Lemma 5.1, it is easy to prove that γ(JϕKA S) = JϕKS . Thus, by Lemma 5.3, J·KA is s.p. for L . S Thus, it turns out that strong preservation is an abstract domain property. This means that given any abstract domain A ∈ Abs(℘(Σ)), it is possible to define an abstract semantic structure S ♯ = (A, I ♯ ) on A such that the corresponding abstract semantics J·KS ♯ is s.p. for L if and only if the induced abstract semantics J·KA S : L → A is s.p. for L . In particular, this also holds for the standard approach: if A = (A, R♯ , ℓ♯ ) is an abstract Kripke structure for L , where h : Σ → A is the corresponding surjection, then the standard abstract semantics J·KA strongly preserves L if and only if the abstract semantics induced by the partitioning abstract domain (αh , ℘(Σ), ℘(A), γh ) strongly preserves L , and in this case this abstract semantics coincides with the standard abstract semantics J·KA . Strong preservation is an abstract domain property and therefore can be defined without loss of generality as follows. Definition 5.5. An abstract domain A ∈ Abs(℘(Σ)) is strongly preserving for L (w.r.t. a semantic structure S) when J·KA S is s.p. for L (w.r.t. S). We denote by SPL ⊆ Abs(℘(Σ)) the set of abstract domains that are s.p. for L . Example 5.6. Let us consider Example 4.1. It turns out that the abstract domain A is not s.p. for L because, by Lemma 5.3, JEXrKS = {3, 5} ( {1, 2, 3, 4, 5} = γ(⊤) = γ(JEXrKA S ). Example 5.7. Let us consider the simple language L ∋ ϕ ::= p | EXϕ and the Kripke structure K depicted in Figure 4. The Kripke structure K induces the semantic structure S = ({1, 2, 3}, I) such that I(p) = {1, 2, 3} and I(EX) = pre . Hence, we have that JpKS = {1, 2, 3}, JEXpKS = {1, 2, 3} and, for k > 1, JEXk pKS = {1, 2, 3}. Let us consider the partitioning abstract domain A induced by the partition P = {[12], [3]} and related to ℘(Σ) by α and γ. Let us consider two different abstract semantic structures on A. 15 – The abstract semantic structure S A = (A, I A ) is induced as best correct approximation of I by A. – The abstract semantic structure S A = (A, I A ) is instead induced by the abstract Kripke structure A = (A, ♯ , ℓ♯ ) in Figure 4. Hence, I A (p) = {[12], [3]} and I A (EX) = pre♯ . S A is different from S A because I A (EX) 6= I A (EX). In fact, I A (EX)({[12]}) = α(pre (γ({[12]}))) = α(pre ({1, 2})) = α({1}) = {[12]}, while I A (EX)({[12]}) = pre♯ ({[12]}) = ∅. Let us show that both the abstract semantics J·KA S and J·KS ♯ are s.p. for L . A – We have that JpKA S = {[12], [3]}, JEXpKS = α(pre ({1, 2, 3})) = α({1, 2, 3}) = {[12], [3]} and, k A for k > 1, JEX pKS = {[12], [3]}. Thus, for any ϕ ∈ L, JϕKS = γ(JϕKA S ). – We have that JpKS A = {[12], [3]}, JEXpKS A = pre♯ ({[12], [3]}) = {[12], [3]} and, for k > 1, JEXk pKS A = {[12], [3]}. Thus, for any ϕ ∈ L, JϕKS = γ(JϕKS A ). Consequently, by Lemma 5.3, both abstract semantics are s.p. for L . 5.2 The Most Abstract Strongly Preserving Domain As recalled in Section 2.3, a language L and a semantic structure S for L induce a corresponding logical partition PL ∈ Part(Σ). By Lemma 5.1, it turns out that PL is the coarsest strongly preserving partitioning abstract domain for L . This can be generalized to arbitrary abstract domains as follows. Let us define ADL by: def ADL = M({JϕKS | ϕ ∈ L }). Hence, ADL is the closure under arbitrary intersections of the set of concrete semantics of formulae in L . Observe that ADL ∈ Abs(℘(Σ)) because it is a Moore-family of ℘(Σ). Theorem 5.8. For any A ∈ Abs(℘(Σ)), A ∈ SPL iff A ⊑ ADL . Proof. Let µ = γ ◦ α ∈ uco(℘(Σ)) and let µL ∈ uco(℘(Σ)) be the uco associated to ADL , that is µL (S) = ∩{JϕKS | ϕ ∈ L , S ⊆ JϕKS }. Recall that A ⊑ ADL iff for any ϕ ∈ L , JϕKS ∈ µ. (⇒) For any ϕ ∈ L , we have that γ(α(JϕKS )) = JϕKS because, by Lemma 5.3, γ(α(JϕKS )) = A γ(α(γ(JϕKA S ))) = γ(JϕKS ) = JϕKS . (⇐) By hypothesis, γ(α(JϕKS )) = JϕKS for any ϕ. Let us show by structural induction on ϕ ∈ L that JϕKS = γ(JϕKA S ). – ϕ ≡ p ∈ AP L : by using the hypothesis, JpKS = γP (αP (JpKS )) = γP (JpKA S ). – ϕ ≡ f (ϕ1 , . . . , ϕn ): Jf (ϕ1 , . . . , ϕn )KS = [by hypothesis] γ(α(Jf (ϕ1 , . . . , ϕn )KS )) = [by definition] γ(α(f (Jϕ1 KS , . . . , Jϕn KS ))) = [by inductive hypothesis] A γ(α(f (γ(Jϕ1 KA S ), . . . , γ(Jϕn KS )))) = [by definition] γ(Jf (ϕ1 , . . . , ϕn )KA S ). Thus, by Lemma 5.3, A ∈ SPL . Thus, ADL is the most abstract domain that is s.p. for L w.r.t. S. As a consequence, it turns out that A is s.p. for L if and only if A represents with no loss of precision the concrete semantics of any formula in L , that is ∀ϕ ∈ L . γ(α(JϕKS )) = JϕKS . Lemma 5.4 states that if a s.p. abstract semantics on a given abstract domain exists then this is unique. Nevertheless, Example 5.7 shows that this unique s.p. abstract semantics may be induced from different abstract semantic structures, i.e. different abstract interpretation functions. However, when L is closed under conjunction, it turns out that on the most abstract s.p. domain ADL , the abstract interpretation function is unique and is given by the best correct approximation I ADL . 16 Theorem 5.9. Let L be closed under infinite logical conjunction and let S ♯ = (ADL , I ♯ ) be an abstract semantic structure on ADL . If J·KS ♯ is s.p. for L then I ♯ = I ADL . Proof. Since L is closed under arbritrary logical conjunctions we have that ADL = {JϕKS | ϕ ∈ L }. L Thus, for any a ∈ ADL , there exists some ϕ ∈ L such that a = JϕKS ♯ = JϕKAD . In fact, if a ∈ ADL S then a = JϕKS , for some ϕ ∈ L , so that, by Lemmata 5.3 and 5.4, a = JϕKS = γ(JϕKS ♯ ) = JϕKS ♯ = L JϕKAD . S L Let p ∈ AP. Then, by Lemma 5.4, JpKS ♯ = JpKAD so that I ♯ (p) = I ADL (p). S Let f ∈ Op. Then, I ♯ (f )(a1 , ..., an ) = ♯ I (f )(Jϕ1 KS ♯ , ..., Jϕn KS ♯ ) = Jf (ϕ1 , ..., ϕn )KS ♯ = L Jf (ϕ1 , ..., ϕn )KAD = S L L I ADL (f )(Jϕ1 KAD , ..., Jϕn KAD )= S S ADL I (f )(a1 , ..., an ). [by the observation above] [by definition] [by Lemma 5.4] [by definition] [by the observation above] Thus, I ♯ = I ADL . Hence, in the most abstract s.p. domain ADL there is a unique choice for interpreting atoms and operations of L . In our generalized framework, strong preservation for partitions becomes a particular instance through the Galois insertion par/adp . Moreover, when L is closed under infinite conjunction, it turns out that the most abstract s.p. domain ADL is partitioning if and only if L is also closed under negation. Proposition 5.10. (1) PL = par(ADL ) and adp (PL ) = P(ADL ). (2) P is strongly preserving for L iff P 4 par(ADL ) iff adp (P ) ⊑ ADL . (3) Let L be closed under conjunction. Then, ADL is partitioning iff L is closed under logical negation. Proof. (1) Let µL ∈ uco(℘(Σ)) be the uco associated to ADL . We have that par(ADL ) = {[s]ADL | s ∈ Σ}, where [s]ADL = {s′ ∈ Σ | µL ({s′ }) = µL ({s})}. We also have that s ≡L s′ iff ∀ϕ ∈ L .s ∈ JϕKS ⇔ s′ ∈ JϕKS iff µL ({s}) = µL ({s′ }), so that PL = par(ADL ). Moreover, adp (PL ) = adp (par(ADL )) = P(ADL ). (2) P is s.p. for L iff P 4 PL iff, by Point (1), P 4 par(AL ) iff, by Theorem 3.2, adp (P ) ⊑ ADL . (3) Since L is closed under infinite logical conjunction, ADL = {JϕKS | ϕ ∈ L }. Thus, L is closed under logical negation iff ADL is closed under complementation ∁ and this exactly means that ADL is forward complete for the complement ∁. By Corollary 3.3, this latter fact happens iff ADL is partitioning. In particular, when L is closed under conjunction but not under negation, it turns out that adp (PL ) ⊏ ADL , i.e. a proper loss of information occurs when the domain ADL is abstracted to the partition par(ADL ) = PL . On the other hand, when L is closed under conjunction and negation, we have that adp (PL ) = ADL and therefore, by Theorem 5.9, the abstract interpretation function on the partitioning abstract domain adp (PL ) is uniquely determined. Example 5.11. Let us consider the traffic light controller K in Example 2.2. As already observed, formulae of L have the following semantics in K: JstopKK = {R, RY }; JgoKK = {G, Y }; JAXXstopKK = {G, Y }; JAXXgoKK = {R, RY } so that ADL = M({JϕKK | ϕ ∈ L }) = {∅, {R, RY }, {G, Y }, {R, RY, G, Y }} and PL = par(ADL ) = {{R, RY }, {G, Y }}. We denote by µL the uco associated to ADL . As shown in Example 2.2, it turns out that no abstract Kripke structure that properly abstracts K and strongly 17 p ?>=< 89:; 1 p >=< / ?89:; 2  p ?>=< 89:; 3 >=< / ?89:; 4 j p GFED @ABC [12] p  p GFED @ABC [3] * ?>=< 89:; 5 q p GFED / @ABC [4] k + @ABC GFED [5] q Figure 5: Concrete (on the left) and abstract (on the right) Kripke structures. preserves L can be defined. In our approach, the abstract domain ADL induces a corresponding strongly L preserving abstract semantics J·KAD : L → ADL , where the best correct approximation of the operator K AXX : ℘(Σ) → ℘(Σ) on ADL is: µL ◦ AXX = {∅ 7→ ∅, {R, RY } 7→ {G, Y }, {G, Y } 7→ {R, RY }, {R, RY, G, Y } 7→ {R, RY, G, Y }}. Example 5.12. Consider the language CTL and the Kripke structure K = (Σ, R, ℓ) depicted in Figure 5, where the interpretation of temporal operators of CTL on K is standard. It is well known that the coarsest s.p. partition PCTL can be obtained by refining the initial partition P = {1234, 5} induced by the labeling ℓ through the Paige-Tarjan [42] algorithm, since PCTL coincides with bisimulation equivalence on K. It is easy to check that PCTL = {12, 3, 4, 5}. This partition determines (see point (2) in Section 2.3) the s.p. abstract Kripke structure depicted in Figure 5. Since CTL is closed under conjunction and negation, by Proposition 5.10 (1) and (3), it turns out that the most abstract s.p. domain ACTL is partitioning and coincides with the following partitioning closure: adp (PCTL ) = {∅, 12, 3, 4, 5, 34, 35, 45, 122, 124, 125, 345, 1234, 1235, 1245, 12345}. Let us now consider the following language L ∋ ϕ ::= p | q | ϕ1 ∧ ϕ2 | EF[0,2] ϕ, where EF[0,2] is a time bounded reachability operator that is useful for quantitative temporal analysis [24], e.g., of discrete real-time systems [10, Chapter 16]. The standard interpretation of EF[0,2] is as follows: s|=K EF[0,2] ϕ iff there exists a path s0 s1 s2 s3 . . . in K starting from s = s0 and some n ∈ [0, 2] such that sn |=K ϕ. Let us characterize the semantics of formulae in L : JpKK = {1, 2, 3, 4}; JqKK = {5}; JEF[0,2] pKK = {1, 2, 3, 4, 5}; JEF[0,2] qKK = {3, 4, 5}; JEF[0,2] (EF[0,2] q)KK = {1, 2, 3, 4, 5}; Jp ∧ EF[0,2] qKK = {3, 4}; JEF[0,2] (p ∧ EF[0,2] q)KK = {1, 2, 3, 4, 5}. Thus, ADL = M({JϕKK | ϕ ∈ L }) = {∅, 5, 34, 345, 1234, 12345}. On the other hand, by Proposition 5.10 (1), PL = par(ADL ) = {12, 34, 5}. In this case, it turns out that adp (PL ) ⊏ ADL . Moreover, analogously to Example 2.2, let us show that there exists no abstract transition relation ♯ ⊆ PL ×PL that determines an abstract Kripke structure A = (PL , ♯ , ℓL ) which strongly preserves L . Let B = {1, 2}, B ′ = {3, 4} and B ′′ = {5} be the blocks in PL . Assume by contradiction that such an abstract Kripke structure A exists. (i) On the concrete model K we have that 3|=K EF[0,2] q. Thus, by strong preservation, it must be that B ′ |=A EF[0,2] q. On the other hand, if B ′ ♯ B and B♯ B ′′ then B|=A EF[0,2] q and therefore, by weak preservation, we would have that 1|=K EF[0,2] q, which is a contradiction. Thus, necessarily, B ′ ♯ B ′′ . (ii) Let us observe that 1|=K EF[0,2] EF[0,2] q. Hence, by strong preservation, B|=A EF[0,2] EF[0,2] q. If B♯ B ′′ then, as in point (i), we would still have that 1|=K EF[0,2] q, i.e. a contradiction. Hence, necessarily, B♯ B ′ . 18 (iii) From B♯ B ′ and B ′ ♯ B ′′ , we would obtain that B|=A EF[0,2] q that, as observed in point (ii), is a contradiction. Thus, this shows that it is not possible to define an abstract Kripke structure on the abstract state space PL L that strongly preserves L . The abstract domain ADL induces a corresponding abstract semantics J·KAD K that instead strongly preserves L . In this case, the best correct approximation of the operator EF[0,2] on ADL is: µL ◦ EF[0,2] = {∅ 7→ ∅, 5 7→ 345, 34 7→ 12345, 345 7→ 12345, 1234 7→ 12345, 12345 7→ 12345}. 6 Strong Preservation and Completeness In this section we establish a precise correspondence between generalized strong preservation of abstract models and completeness of abstract interpretations, so that the problem of minimally refining an abstract model in order to get strong preservation can be formulated as a complete domain refinement in abstract interpretation. 6.1 Forward Complete Shells Let us consider forward completeness of abstract domains A ∈ Abs(C) for generic n-ary concrete operations f : C n → C, with n ≥ 0. Hence, A is forward complete for f , or simply f -complete, when f ◦ hµA , ..., µA i = µA ◦ f ◦ hµA , ..., µA i, that is, for any ~x ∈ C n , f (µA (x1 ), ..., µA (xn )) = µA (f (µA (x1 ), ..., µA (xn ))). Equivalently, A is f -complete when for any ~a ∈ An , f (γ(a1 ), ..., γ(an )) = γ(α(f (γ(a1 ), ..., γ(an )))). For a set of operations F ⊆ Fun(C), A is F -complete when A is f -complete for each f ∈ F . Observe that F -completeness for an abstract domain A means that the associated closure µA is closed under the image of functions in F , namely F (µA ) ⊆ µA . Also note that when k : C 0 → C, i.e. k ∈ C is a constant, A is k-complete iff k is precisely represented in A, i.e. γ(α(k)) = k. Let us also note that an abstract domain A ∈ Abs(C) is always forward meet-complete because any uco is Moore-closed. Let us first note that forward F -complete shells always exist. Let SF : Abs(C) → Abs(C) be defined def as SF (A) = ⊔ {X ∈ Abs(C) | X ⊑ A, X is F -complete}. Lemma 6.1. SF (A) is the F -complete shell of A. Proof. Let η = ⊔{ρ ∈ uco(C) | ρ ⊑ µA , ρ is F -complete} = ∩{ρ ∈ uco(C) | ρ ⊑ µA , ρ is F -complete}. Let f ∈ F , with ♯(f ) = n > 0 (if ♯(f ) = 0 then, trivially, f ∈ η) and ~c ∈ η n . Consider any ρ ∈ uco(C) that is F -complete and such that ρ ⊑ µ. Since η ⊆ ρ, we have that ~c ∈ ρn and therefore f (~c) ∈ ρ because ρ is F -complete. Thus, f (~c) ∈ η, i.e., η is F -complete. A forward complete shell SF (A) is a more concrete abstraction than A. How to characterize SF (A)? It is here useful to view abstract domains as closure operators on the concrete domain, i.e. as subsets of C. Hence, A is viewed as the subset img(µA ) = γ(A) of the concrete domain C so that SF (A) can be characterized as the least Moore-closed subset of C that contains img(µA ) and is forward F complete. We need to characterize the least amount of concrete information that must be added to γ(A) in order to get forward completeness. It turns out that forward complete shells admit a constructive fixpoint def characterization. Let F uco : uco(C) → uco(C) be defined as follows: F uco (ρ) = M(F (ρ)), namely uco F (ρ) is the most abstract domain that contains the image of F on ρ. Observe that the operator λρ.µA ⊓ F uco (ρ) : uco(C) → uco(C) is monotone. Lemma 6.2. SF (A) = gfp(λρ.µA ⊓ F uco (ρ)). Proof. Observe that a uco ρ is F -complete iff F (ρ) ⊆ ρ iff M(F (ρ)) = F uco (ρ) ⊆ ρ iff ρ ⊑ F uco (ρ). Thus, we have that SF (A) = ⊔{ρ ∈ uco(C) | ρ ⊑ µA , ρ is F -complete} = ⊔{ρ ∈ uco(C) | ρ ⊑ µA , ρ ⊑ F uco (ρ)} = ⊔{ρ ∈ uco(C) | ρ ⊑ µA ⊓ F uco (ρ)} = gfp(λρ.µA ⊓ F uco (ρ)). 19 Thus, it turns out that the lower iteration sequence of λρ.µA ⊓F uco (ρ) in uco(C) converges to the complete shell SF (µA ). Example 6.3. Let us consider the square operator on sets of integers sq : ℘(Z) → ℘(Z), i.e. sq(X) = X 2 = {x2 | x ∈ X}, and the abstract domain Sign = {∅, Z<0 , {0}, Z>0 , Z}. As observed in Section 2.2.2, Sign is not forward complete for the square operator. Let us apply Lemma 6.2 in order to compute the forward complete shell Ssq (Sign). Observe that ∅2 = ∅ ∈ Sign; {0}2 = {0} ∈ Sign; Z2<0 = Z2>0 = Z2 6∈ Sign. Thus, the first step of iteration refines Sign to Sign ∪ {Z2 } (notice that this is an abstract domain because 2 it is Moore-closed). Then, (Z2 )2 = Z2 6∈ Sign ∪ {Z2 }, so that on the second step of iteration we obtain 2 k Sign ∪ {Z2 , Z2 }. In general, for n ≥ 1, the n-th step of iteration provides Sign ∪ {Z2 | k ∈ [1, n]}, so n that the complete shell Ssq (Sign) coincides with the least fixpoint Sign ∪ {Z2 | n ≥ 1}. Finally, the following easy observation will be useful later on. Lemma 6.4. Let F, G ⊆ Fun(C). Then, SF = SG if and only if for any A ∈ Abs(C), A is F -complete ⇔ A is G-complete. Proof. (⇒) If A is F -complete then A = SF (A) = SG (A) and therefore A is G-complete as well. (⇐) This follows from SF (A) = ⊔{X ∈ Abs(C) | X ⊑ A, X is F -complete} = ⊔{X ∈ Abs(C) | X ⊑ A, X is G-complete} = SG (A). 6.2 Strong Preservation and Complete Shells Let L be a language with atoms in AP L and operators in Op L and let S = (Σ, I) be a semantic structure for L so that AP L and OpL denote, respectively, the corresponding sets of semantic interpretations of atoms and operators. It turns out that forward completeness for AP L and OpL implies strong preservation for L . Lemma 6.5. If A ∈ Abs(℘(Σ)) is forward complete for AP L and OpL then A is s.p. for L . Proof. By Theorem 5.8, we show that A ⊑ ADL . Let us show by induction that for any ϕ ∈ L , JϕKS = γ(α(JϕKS )). – ϕ ≡ p ∈ AP L : since A is forward complete for p, JpKS = p = γ(α(p)) = γ(α(JpKS )). – ϕ ≡ f (ϕ1 , . . . , ϕn ) with f ∈ Op L : Jf (ϕ1 , ..., ϕn )KS = [by definition] f (Jϕ1 KS , ..., Jϕn KS ) = [by inductive hypothesis] f (γ(α(Jϕ1 KS )), ..., γ(α(Jϕn KS ))) = [since A is forward complete for f ] γ(α(f (γ(α(Jϕ1 KS )), ..., γ(α(Jϕn KS ))))) = [by inductive hypothesis and by definition] γ(α(Jf (ϕ1 , ..., ϕn )KS )). On the other hand, the converse is not true, that is strong preservation does not imply forward completeness, as shown by the following example. Example 6.6. Let us consider again Example 5.7 where we showed that the partitioning abstract domain A = ℘(P )⊆ is s.p. for L . However, A is not forward complete for OpL = {pre }. In fact: γ(α(pre (γ(α({3}))))) = γ(α(pre ({3}))) = γ(α({2, 3})) = {1, 2, 3} while pre (γ(α({3}))) = pre ({3}) = {2, 3}. Instead, it turns out that most abstract s.p. domains can be characterized as forward complete shells. 20 6.2.1 Complete Shells as Strongly Preserving Abstract Domains Partition refinement algorithms for computing behavioural equivalences like bisimulation [42], simulation equivalence [5, 35, 48] and (divergence blind) stuttering equivalence [32] are used in standard abstract model checking to compute the coarsest strongly preserving partition of temporal languages like CTL∗ or the µ-calculus for the case of bisimulation equivalence, ACTL∗ for simulation equivalence and CTL∗ -X for stuttering equivalence. Given a language L and a concrete state space Σ, these partition refinement algorithms work by iteratively refining an initial partition P within the lattice of partitions Part(Σ) until the fixpoint PL is reached. The input partition P determines the set AP P of atoms and their interpretation IP as foldef def lows: AP P = {pB | B ∈ P } and IP (pB ) = B. More in general, any X ⊆ ℘(Σ) determines a set {pX }X∈X of atoms with interpretation IX (pX ) = X. In particular, this can be done for an abstract domain A ∈ Abs(℘(Σ)) by considering its concretization γ(A) ⊆ Σ, namely A is viewed as a set of atoms with interpretation IA (a) = γ(a). Thus, an abstract domain A ∈ Abs(℘(Σ)) together with a set of functions F ⊆ Fun(℘(Σ)) determine a language LA,F , with atoms in A, operations in F and endowed with a semantic structure SA,F = (Σ, IA ∪ IF ) such that for any a ∈ A, IA (a) = γ(a) and for any f ∈ F , IF (f ) = f . Therefore, the most abstract s.p. domain ADLA,F generalizes in our framework the output of a partition refinement algorithm for some language. Accordingly, we aim at characterizing ADLA,F as the output of a refinement process of the initial domain A within the lattice Abs(℘(Σ)) of abstract domains. The following result shows that forward completeness for the operations in F is the right notion of refinement to be used for the case of abstract domains. Theorem 6.7. Let A ∈ Abs(℘(Σ)), F ⊆ Fun(℘(Σ)) and assume that LA,F is closed under infinite logical conjunction. Then, ADLA,F = SF (A). Proof. Since LA,F is closed under conjunction we have that ADLA,F = {JϕKSA,F | ϕ ∈ LA,F }. Let us first prove that {JϕKSA,F | ϕ ∈ LA,F } ⊆ SF (A) by structural induction on ϕ ∈ LA,F : – ϕ ≡ a ∈ A: JaKSA,F = IA (a) = γ(a) ∈ γ(A) ⊆ SF (A). – ϕ ≡ f (ϕ1 , ..., ϕn ) with f ∈ F : Jf (ϕ1 , ..., ϕn )KSA,F = f (Jϕ1 KSA,F , ..., Jϕn KSA,F ), where, by inductive hypothesis, Jϕi KSA,F ∈ SF (A). Therefore, since SF (A) is forward f -complete, we have that f (Jϕ1 KSA,F , ..., Jϕn KSA,F ) ∈ SF (A). Let us now prove the opposite inclusion. Let us first observe that ADLA,F is forward F -complete. For simplicity of notation, consider f ∈ F with ♯(f ) = 1. If JϕKSA,F ∈ ADLA,F , where ϕ ∈ LA,F , then, f (ϕ) ∈ LA,F and f (JϕKSA,F ) = Jf (ϕ)KSA,F ∈ ADLA,F . By Lemma 6.2, we know that SA (A) = ⊓α∈Ord (λρ.µA ⊓ M(F (ρ)))α,↓ (⊤uco(℘(Σ)) ), so that it is sufficient to prove by transfinite induction on α ∈ Ord that (λρ.µA ⊓ M(F (ρ)))α,↓ (⊤uco(℘(Σ)) ) ⊆ ADLA,F . – α = 0: (λρ.µA ⊓ M(F (ρ)))0,↓ (⊤uco(℘(Σ)) ) = ⊤uco(℘(Σ)) = {Σ} ∈ γ(A) ⊆ ADLA,F . – α + 1: By inductive hypothesis, (λρ.µA ⊓ M(F (ρ)))α,↓ (⊤uco(℘(Σ)) ) ⊆ ADLA,F . Moreover, ADLA,F is Moore-closed and forward F -complete (hence closed under F ). Thus, M(F ((λρ.µA ⊓ M(F (ρ)))α,↓ (⊤uco(℘(Σ)) ))) ⊆ ADLA,F , namely (λρ.µA ⊓M(F (ρ)))α+1,↓ (⊤uco(℘(Σ)) ) ⊆ ADLA,F . – limit ordinal α: This follows from (λρ.µA ⊓ M(F (ρ)))α,↓ (⊤uco(℘(Σ)) ) = ⊓β<α (λρ.µA ⊓ M(F (ρ)))β,↓ (⊤uco(℘(Σ)) ) because, by inductive hypothesis, (λρ.µA ⊓ M(F (ρ)))β,↓ (⊤uco(℘(Σ)) ) ⊆ ADLA,F , for any β < α. 21 6.2.2 Strongly Preserving Abstract Domains as Complete Shells Let us consider a language L , with atoms in AP L and operators in Op L , and a semantic structure S = (Σ, I). As an immediate consequence of Theorem 6.7, the most abstract s.p. domain ADL for L w.r.t. S can be characterized as the forward AP L ∪ OpL -complete shell of the most abstract domain {Σ}. Corollary 6.8. Let L be closed under infinite logical conjunction. Then, ADL = SAP L ∪OpL ({Σ}). Let us also observe that ADL can be equivalently characterized as the forward OpL -complete shell of an initial abstract domain M(AP L ) induced by atoms: ADL = SOpL (M(AP L )). 6.2.3 Strongly Preserving Partitions Theorem 6.7 and Corollary 6.8 provide an elegant generalization of partition refinement algorithms for strong preservation from an abstract interpretation perspective. Given a language L with operators in Op L and a corresponding semantic structure S = (Σ, I), as recalled in Section 6.2.1, an input partition P ∈ Part(Σ) for a partition refinement algorithm determines the set AP L = {pB | B ∈ P } of atoms of L and their interpretation I(pB ) = B. Thus, M(AP L ) = M(P ) = P ∪ {∅, Σ}. It turns out that the coarsest s.p. partition PL for L can be characterized in our abstract domain-based approach as follows. Corollary 6.9. Let L be closed under infinite logical conjunction. (1) PL = par(SOpL (M(P ))). (2) Let L be closed under logical negation. Then, adp (PL ) = SOpL (M(P )). Proof. (1) By Corollary 6.8, ADL = SOpL (M(P )) and by Proposition 5.10 (1), PL = par(ADL ) = par(SOpL (M(P ))). (2) By Proposition 5.10 (1) and (3), Corollary 6.8 and point (1), adp (PL ) = adp (par(ADL )) = ADL = SOpL (M(P )). It is worth remarking that when L is not closed under negation, by Proposition 5.10 (3) and Corollary 6.9 (2), it turns out that adp (PL ) ⊏ SOpL (M(P )). This means that when L is not closed under negation the output partition PL of any partition refinement algorithm for achieving strong preservation for L is not optimal within the lattice of abstract domains. Example 6.10. Let us consider the language L and the concrete Kripke structure K in Example 5.12. The labeling determines the initial partition P = {p = 1234, q = 5} ∈ Part(Σ), so that M(P ) = {∅, 1234, 5, 12345} ∈ Abs(℘(Σ)). Here, Op L = {∧, EF[0,2] }. Abstract domains are Moore-closed so that SOpL = SEF[0,2] . Let us compute SEF[0,2] (M(P )). A0 = M(P ) = {∅, 1234, 5, 12345} A1 = A0 ⊓ M(EF[0,2] (A0 )) = M(A0 ∪ EF[0,2] (A0 )) = M({∅, 1234, 5, 12345} ∪ {EF[0,2] ({5}) = 345}) = {∅, 5, 34, 1234, 12345} A2 = A1 (fixpoint) As already observed in Example 5.12, PL = {12, 34, 5} is such that adp (PL ) ⊏ µL and it is not possible to define a strongly preserving abstract Kripke structure on the abstract space PL . 7 An Application to some Behavioural Equivalences It is well known that some temporal languages like CTL, ACTL and CTL-X induce state logical equivalences that coincide with standard behavioural equivalences like bisimulation equivalence for CTL, (divergence blind) stuttering equivalence for CTL-X and simulation equivalence for ACTL. We derive here a novel characterization of these behavioural equivalences in terms of forward completeness of abstract interpretations. 22 7.1 Bisimulation Equivalence Let K = (Σ, , ℓ) be a Kripke structure over some set AP of atomic propositions. A relation R ⊆ Σ × Σ is a bisimulation on K if for any s, s′ ∈ Σ such that sRs′ : (1) ℓ(s) = ℓ(s′ ); (2) For any t ∈ Σ such that st, there exists t′ ∈ Σ such that s′ t′ and tRt′ ; (3) s′ Rs, i.e. R is symmetric. Since the empty relation is a bisimulation and bisimulations are closed under union, it turns out that the largest (as a set) bisimulation relation exists. This largest bisimulation is an equivalence relation called bisimulation equivalence and is denoted by ∼bis while Pbis ∈ Part(Σ) denotes the corresponding partition. Thus, a partition P ∈ Part(Σ) is a bisimulation on K when P  Pbis . It is well known [4] that when K is finitely branching, bisimulation equivalence coincides with the state equivalence induced by CTL, i.e., Pbis = PCTL (the same holds for CTL∗ and the µ-calculus, see e.g. [19, Lemma 6.2.0.5]). Moreover, it is known (see e.g. [49, Section 12]) that it is enough to consider finitary Hennessy-Milner logic [34], i.e. a language L1 including propositional logic and the existential next operator in order to have that PL1 = Pbis : L1 ∋ ϕ ::= p | ϕ1 ∧ ϕ2 | ¬ϕ | EXϕ where, as usual, the interpretation EX of EX in K is pre . A number of algorithms for computing bisimulation equivalence exists [3, 23, 38, 42]. The Paige-Tarjan algorithm [42] runs in O(|| log(|Σ|))time and is the most time-efficient algorithm that computes bisimulation equivalence. We recalled above that PL1 = PCTL . In our framework, this can be obtained as a consequence of the fact that the most abstract s.p. domains for CTL and L1 coincide. Lemma 7.1. Let K be finitely branching. Then, ADCTL = ADL1 = adp (Pbis ). Proof. Let OpCTL = {∩, ∁, AX, EX, AU, EU, AR, ER} be the set of standard interpretations of the operators of CTL on K, so that AX = pre f  and EX = pre . We show that µ ∈ uco(℘(Σ)) is forward complete for OpCTL iff µ is forward complete for {∁, pre }. Assume that µ is forward complete for {∁, pre }. Let us first prove that µ is forward complete for pre f  = AX: µ ◦ pre f ◦µ = µ ◦ ∁ ◦ pre ◦∁ ◦ µ = [by definition of pre f ] [as µ is complete for ∁] µ ◦ ∁ ◦ pre ◦µ ◦ ∁ ◦ µ = µ ◦ ∁ ◦ µ ◦ pre ◦µ ◦ ∁ ◦ µ = [as µ is complete for pre ] [as µ is complete for ∁] ∁ ◦ µ ◦ pre ◦µ ◦ ∁ ◦ µ = ∁ ◦ pre ◦µ ◦ ∁ ◦ µ = [as µ is complete for pre ] [as µ is complete for ∁] ∁ ◦ pre ◦∁ ◦ µ = pre f ◦µ [by definition of pre f ] The following fixpoint characterizations are well known [10]: – AU(S1 , S2 ) = lfp(λZ.S2 ∪ (S1 ∩ pre f  (Z))); – EU(S1 , S2 ) = lfp(λZ.S2 ∪ (S1 ∩ pre (Z))); – AR(S1 , S2 ) = gfp(λZ.S2 ∩ (S1 ∪ pre f  (Z))); – ER(S1 , S2 ) = gfp(λZ.S2 ∩ (S1 ∪ pre (Z))). 23 Let us show that µ is forward complete for AU. The proofs for the remaining operators in OpCTL are analogous. We need to show that µ(lfp(λZ.µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (Z)))) = lfp(λZ.µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (Z))). Let us show that µ is forward complete for the function λZ.µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (Z)): µ(µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (µ(Z)))) = µ(µ(S2 ) ∪ (µ(S1 ) ∩ µ(pre f  (µ(Z))))) = µ(µ(S2 ) ∪ µ(µ(S1 ) ∩ µ(pre f  (µ(Z))))) = µ(S2 ) ∪ µ(µ(S1 ) ∩ µ(pre f  (µ(Z)))) = µ(S2 ) ∪ (µ(S1 ) ∩ µ(pre f  (µ(Z)))) = µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (µ(Z))). [as µ is complete for pre f ] [as µ is complete for ∩] [as µ is complete for ∪] [as µ is complete for ∩] [as µ is complete for pre f ] Observe that since µ is additive (and therefore continuous) we have that µ(∅) = ∅. Moreover, let us show that from the hypothesis that K is finitely branching it follows that pre f  is continuous. First, notice that pre f  is continuous iff pre is co-continuous. Hence, let us check that pre is co-continuous. Let {Xi }i∈N be a decreasing chain of subsets of Σ and let x ∈ ∩i∈N pre (Xi ). Since K is finitely branching, post ({x}) is finite so that there exists some k ∈ N such that for any j > 0, post ({x}) ∩ Xk = post ({x}) ∩ Xk+j . Hence, there exists some z ∈ ∩i∈N Xi ∩ post ({x}), so that x ∈ pre (∩i∈N Xi ). Therefore, since pre f  is continuous we also have that λZ.µ(S2 ) ∪ (µ(S1 ) ∩ pre f  (Z)) is continuous. We can therefore apply Lemma 2.1 so that µ(lfp(λZ.µ(S2 )∪(µ(S1 )∩ pre f  (Z)))) = lfp(λZ.µ(S2 )∪(µ(S1 )∩ pre f  (Z))). Thus, by Lemma 6.4, S{∁,pre } = SOpCTL , so that, by Corollary 6.8, ADL1 = ADCTL . Finally, since K is finitely branching and L1 is closed under conjunction and negation, adp (PL1 ) = adp (Pbis ) = adp (PL1 ) = ADL1 . As a consequence of this and of the results in Section 6 (in particular of Corollary 6.9), any partition refinement algorithm Algbis for computing bisimulation equivalence on a finitely branching Kripke structure, like those in [3, 23, 38, 42], can be characterized as a complete shell refinement as follows: Algbis (P ) = par(S{∁,pre } (M(P ))). Thus, Algbis is viewed as an algorithm for computing a particular abstraction, that is par, of a particular complete shell, that is S{∁,pre } . In particular, this holds for the Paige-Tarjan algorithm [42] and leads to design a generalized Paige-Tarjan-like procedure for computing most abstract strongly preserving domains [45]. Finally, our abstract intepretation-based approach allows us to give the following nice characterization of bisimulation for a partition P in terms of forward completeness for the corresponding partitioning abstract domain adp (P ). Theorem 7.2. Let P ∈ Part(Σ). Then, P is a bisimulation on K iff adp (P ) is forward complete for {p | p ∈ AP } ∪ {pre }. Proof. We view adp (P ) as a uco so that adp (P ) = {∪i Bi ∈ ℘(Σ) | {Bi } ⊆ P }. Let us first observe that P  Pℓ iff adp (P ) is forward complete for {p ⊆ Σ | p ∈ AP }. On the one hand, since p = {s ∈ Σ | p ∈ ℓ(s)}, if s ∈ p and s ∈ B, for some B ∈ P , then B ⊆ [s]ℓ ⊆ p. Hence, p is a union of some blocks of P and therefore p ∈ adp (P ). On the other hand, if adp (P ) contains {p ⊆ Σ | p ∈ AP } then, for any p ∈ AP , p is a union of some blocks in P . Thus, for any B ∈ P , either B ⊆ p or B ∩ p = ∅. Consequently, if s ∈ B then B ⊆ [s]ℓ ∈ Pℓ . Let us now note that adp (P ) is forward complete for pre iff for any block B ∈ P , pre (B) is a (possibly empty) union of blocks of P : this holds because pre is additive, and therefore if {Bi } ⊆ P then pre (∪i Bi ) = ∪i pre (Bi ). The fact that, for some B ∈ P , pre (B) = ∪i Bi , for some blocks {Bi } ⊆ P , implies that if s ∈ pre (B), i.e., st for some t ∈ B, then s ∈ Bj , for some j, and if s′ ∈ Bj then s′ ∈ pre (B), i.e., s′ t′ for some t′ ∈ B, namely condition (2) of bisimulation for P holds. On the other hand, if condition (2) of bisimulation for P holds then if s, s′ ∈ B ′ and s ∈ pre (B), for some B, B ′ ∈ P , then s′ t′ for some t ∈ B, i.e., s′ ∈ pre (B), and therefore pre (B) is a union of blocks of P . This closes the proof. 24 7.1.1 On the Smallest Abstract Transition Relation As recalled in Section 2.3, the abstract Kripke structure A = (Pbis , ∃∃ , ℓ∃ ) strongly preserves CTL, where B1 ∃∃ B2 iff there exist s1 ∈ B1 and s2 ∈ B2 such that s1 s2 , and ℓ∃ (B) = ∪s∈B ℓ(s). As a simple and elegant consequence of our approach, it is easy to show that ∃∃ is the unique (and therefore the smallest) abstract transition relation on Pbis that induces strong preservation for CTL. Let K = (Σ, , ℓ) be finitely branching so that, by Lemma 7.1, ADL1 = adp (Pbis ) = ℘(Pbis ). Recall that the concrete interpretation I induced by K is such that I(EX) = pre . By Theorem 5.9, the unique interpretation of atoms and operations in L1 on the abstract domain ℘(Pbis ) that gives rise to a s.p. abstract semantics is the best correct approximation I ℘(Pbis ) . Hence, if A = (Pbis , ♯ , ℓ♯ ) is strongly preserving for CTL then the interpretation pre♯ of EX induced by A must coincide with I ℘(Pbis ) (EX). Consequently, pre♯ = α ◦ pre ◦γ so that for any B1 , B2 ∈ Pbis , we have that B1 ♯ B2 iff B1 ∈ α(pre (γ({B2 }))). Therefore, we conclude by observing that B1 ∈ α(pre (γ({B2 }))) iff B1 ∃∃ B2 . We believe that a similar reasoning could be also useful for other languages L in order to prove that the smallest abstract transition relation on PL that induces strong preservation exists. For example, this has been proved for the case of ACTL by Bustan and Grumberg [5]. 7.2 Stuttering Equivalence Lamport’s criticism [37] of the next-time operator X in CTL/CTL∗ is well known. This motivated the study of temporal logics CTL-X/CTL∗ -X obtained from CTL/CTL∗ by removing the next-time operator and this led to study notions of behavioural stuttering-based equivalences [4, 22, 32]. We are interested here in divergence blind stuttering (dbs for short) equivalence. Let K = (Σ, , ℓ) be a Kripke structure over a set AP of atoms. A relation R ⊆ Σ × Σ is a divergence blind stuttering relation on K if for any s, s′ ∈ Σ such that sRs′ : (1) ℓ(s) = ℓ(s′ ); (2) If st then there exist t0 , ..., tk ∈ Σ, with k ≥ 0, such that: (i) t0 = s′ ; (ii) for all i ∈ [0, k − 1], ti ti+i and sRti ; (iii) tRtk ; (3) s′ Rs, i.e. R is symmetric. Observe that condition (2) allows the case k = 0 and this simply boils down to requiring that tRs′ . Since the empty relation is a dbs relation and dbs relations are closed under union, it turns out that the largest dbs relation relation exists. It turns out that this largest dbs relation is an equivalence relation called dbs equivalence and is denoted by ∼dbs while Pdbs ∈ Part(Σ) denotes the corresponding partition. In particular, a partition P ∈ Part(Σ) is a dbs relation on K when when P  Pdbs . De Nicola and Vaandrager [22, Theorem 3.2.5] showed that for finite Kripke structures and for an interpretation of universal/existential path quantifiers over all the, possibly finite, prefixes, dbs equivalence coincides with the state equivalence induced from the language CTL-X (this also holds for CTL∗ -X), that is Pdbs = PCTL-X . This is not true with the standard interpretation of path quantifiers over infinite paths, since this requires a divergence sensitive notion of stuttering (see the details in [22]). Groote and Vaandrager [32] presented a partition refinement algorithm that computes the partition Pdbs in O(|Σ|||)time. We provide a characterization of divergence blind stuttering equivalence as the state equivalence induced by the following language L2 that includes propositional logic and the existential until operator EU, where the interpretation of the existential path quantifier is standard, i.e. over infinite paths: L2 ∋ ϕ ::= p | ϕ1 ∧ ϕ2 | ¬ϕ | EU(ϕ1 , ϕ2 ) Since the transition relation  is assumed to be total, let us recall that the standard semantics EU : ℘(Σ)2 → ℘(Σ) of the existential until operator is as follows: EU (S1 , S2 ) = S2 ∪ {s ∈ S1 | ∃s0 , ..., sn ∈ Σ, with n ≥ 0, such that (i) s0 = s, (ii) ∀i ∈ [0, n − 1]. si ∈ S1 and si si+1 , (iii) sn ∈ S2 }. 25 The following result characterizes a dbs partition P in terms of forward completeness for the corresponding partitioning abstract domain adp (P ). Theorem 7.3. Let P ∈ Part(Σ). Then, P ∈ Part(Σ) is a dbs partition on K iff adp (P ) is forward complete for {p | p ∈ AP } ∪ {EU }. Proof. As already shown in the proof of Theorem 7.2, it turns out that P  Pℓ iff adp (P ) is forward complete for {p ⊆ Σ | p ∈ AP }. Thus, it remains to show P ∈ Part(Σ) satisfies condition (2) of the definition of dbs relation iff adp (P ) is forward complete for EU . Let us first observe that P ∈ Part(Σ) satisfies this condition (2) iff for any B1 , B2 ∈ P , EU (B1 , B2 ) = B1 ∪ B2 . (⇒) If B1 = B2 then EU (B1 , B1 ) = B1 . Otherwise, assume that B1 6= B2 . If B2 ( EU (B1 , B2 ) ⊆ B1 ∪ B2 then there exists s ∈ EU (B1 , B2 ) such that s ∈ B1 . Thus, if s′ ∈ B1 then, by condition (2), s′ ∈ EU (B1 , B2 ). This implies that EU (B1 , B2 ) = B1 ∪ B2 . (⇐) Let B ∈ P , s, s′ ∈ B and st. If t ∈ B then condition (2) is satisfied. Otherwise, t ∈ B ′ , for some B ′ ∈ P , with B 6= B ′ . Thus, s ∈ EU (B, B ′ ) and therefore EU (B, B ′ ) = B ∪ B ′ . This means that condition (2) is satisfied for P . To complete the proof it is now sufficient to show that if, for any B1 , B2 ∈ P , EU (B1 , B2 ) = B1 ∪ B2 then adp (P ) is forward complete for EU , i.e., for any {Bi }i∈I , {Bj }j∈J ⊆ P , EU (∪i Bi , ∪j Bj ) = ∪k Bk , for some {Bk }k∈K ⊆ P . The function EU is additive in its second argument, thus we only need to show that, for any B ∈ P , EU (∪i Bi , B) = ∪k Bk , namely if s ∈ EU (∪i Bi , B) and s ∈ B ′ , for some B ′ ∈ P , then B ′ ⊆ EU (∪i Bi , B). If s ∈ EU (∪i Bi , B) and s ∈ B ′ , for some B ′ ∈ {Bi }i , then there exist n ≥ 0 and s0 , ..., sn ∈ Σ such that s0 = s, ∀j ∈ [0, n − 1].sj ∈ ∪i Bi and sj sj+1 , and sn ∈ B. Let us prove by induction on n ∈ N that if s′ ∈ B ′ then s′ ∈ EU (∪i Bi , B). (n = 0): In this case s ∈ ∪i Bi and s ∈ B = B ′ . Hence, for some k, s ∈ Bk = B = B ′ and therefore s ∈ EU (B, B). By hypothesis, EU (B, B) = B. Moreover, EU is monotone on its first component and therefore B ′ = B = EU (B, B) ⊆ EU (∪i Bi , B). (n+1): Suppose that there exist s0 , ..., sn+1 ∈ Σ such that s0 = s, ∀j ∈ [0, n].sj ∈ ∪i Bi and sj sj+1 , and sn+1 ∈ B. Let sn ∈ Bk , for some Bk ∈ {Bi }i∈I . Then, s ∈ EU (∪i Bi , Bk ) and s = s0 s1 ...sn . Since this finite path has length n, by inductive hypothesis, s′ ∈ EU (∪i Bi , Bk ). Hence, there exist r0 , ..., rm ∈ Σ, with m ≥ 0, such that s′ = r0 , ∀j ∈ [0, m − 1].rj ∈ ∪i Bi and rj rj+1 , and rm ∈ Bk . Moreover, since sn sn+1 , we have that sn ∈ EU (Bk , B). By hypothesis, EU (Bk , B) = Bk ∪ B, and therefore rm ∈ EU (Bk , B). Thus, there exist q0 , ..., ql ∈ Σ, with l ≥ 0, such that rm = q0 , ∀j ∈ [0, l − 1].qj ∈ Bk and qj qj+1 , and ql ∈ B. We have thus found the following finite path: s′ = r0 r1 ...rm = q0 q1 ...ql , where all the states in the sequence but the last one ql belong to ∪i Bi , while ql ∈ B. This means that s′ ∈ EU (∪i Bi , B). As a consequence, we obtain a characterization of dbs equivalence as the state equivalence induced by the standard interpretation of the language L2 . Corollary 7.4. Let Σ be finite. Then, Pdbs = PL2 . Proof. By definition, Pdbs = gPart(Σ) {P ∈ Part(Σ) | P is a dbs relation on K}. By Theorem 7.3, Pdbs = gPart(Σ) {P ∈ Part(Σ) | adp (P ) is complete for {p | p ∈ AP } ∪ {EU }}. By Theorem 3.2, adp is co-additive on Part(Σ) , that is adp preserves lub’s in Part(Σ) . Hence, adp (Pdbs ) = ⊔Abs(℘(Σ)) {adp (P ) ∈ Abs(℘(Σ)) | P ∈ Part(Σ), adp (P ) is complete for {p | p ∈ AP} ∪ {EU }}. By Theorem 3.2, Abspar (℘(Σ)) = {adp (P ) | P ∈ Part(Σ)} so that adp (Pdbs ) = ⊔Abs(℘(Σ)) {A ∈ Abspar (℘(Σ)) | A is complete for {p | p ∈ AP} ∪ {EU }}. By Corollary 3.3, A ∈ Abspar (℘(Σ)) iff A is forward complete for ∁, so that adp (Pdbs ) = ⊔Abs(℘(Σ)) {A ∈ Abs(℘(Σ)) | A is complete for {p | p ∈ AP} ∪ {∁, EU }}. Then, we note that A is forward complete for {p | p ∈ AP } iff A ⊑ M({p | p ∈ AP }). Hence, adp (Pdbs ) = ⊔Abs(℘(Σ)) {A ∈ Abs(℘(Σ)) | A ⊑ M({p | p ∈ AP}), A is complete for {∁, EU }} = S{∁,EU } (M({p | p ∈ AP})). Finally, since Σ is finite and therefore closure under infinite conjunction boils down to closure under finite conjunction, by Corollary 6.8, S{∁,EU } (M({p | p ∈ AP })) = ADL2 . Thus, by Proposition 5.10 (1), adp (Pdbs ) = ADL2 , so that Pdbs = par(adp (Pdbs )) = par(ADL2 ) = PL2 . 26 As a consequence of Corollary 6.9, the Groote-Vaandrager algorithm [32] GV for computing dsb equivalence on a finite Kripke structure can be characterized as a complete shell refinement as follows: GV(P ) = par(S{∁,EU } (M(P ))). 7.3 Simulation Preorder and Equivalence Simulations are possibly nonsymmetric bisimulations, that is R ⊆ Σ × Σ is a simulation on a Kripke structure K = (Σ, , ℓ) if for any s, s′ ∈ Σ such that sRs′ : (1) ℓ(s′ ) ⊆ ℓ(s); (2) For any t ∈ Σ such that st, there exists t′ ∈ Σ such that s′ t′ and tRt′ . The empty relation is a simulation and simulation relations are closed under union, so that the largest simulation relation exists. It turns out that the largest simulation is a preorder relation called similarity preorder and denoted by Rsim ∈ PreOrd(Σ). Therefore, a preorder relation R ∈ PreOrd(Σ) is a simulation on K when R ⊆ Rsim . Simulation equivalence ∼simeq ⊆ Σ × Σ is the symmetric closure of Rsim : s ∼simeq s′ iff there exist two simulation relations R1 and R2 such that sR1 s′ and s′ R2 s. Psimeq ∈ Part(Σ) denotes the partition corresponding to ∼simeq . A number of algorithms for computing simulation equivalence have been proposed [2, 5, 12, 27, 35] and some of them like [2, 35] first compute the similarity preorder and then from it they obtain simulation equivalence. The problem of computing simulation equivalence is important in model checking because, as recalled in Section 2.3, simulation equivalence strongly preserves ACTL so that Psimeq = PACTL (see [33, Section 4]). Recall that ACTL is obtained by restricting CTL, as defined in Section 4.1, to universal quantifiers and by allowing negation on atomic propositions only: ACTL ∋ ϕ ::= p | ¬p | ϕ1 ∧ ϕ2 | ϕ1 ∨ ϕ2 | AXϕ | AU(ϕ1 , ϕ2 ) | AR(ϕ1 , ϕ2 ) It turns out that the most abstract s.p. domain for ACTL can be obtained as the most abstract s.p. domain for the following sublanguage L3 : L3 ∋ ϕ ::= p | ¬p | ϕ1 ∧ ϕ2 | ϕ1 ∨ ϕ2 | AXϕ Lemma 7.5. Let K be finitely branching. Then, ADACTL = ADL3 . Proof. Let OpACTL = {∩, ∪, AX, AU, AR} be the set of standard interpretations of the operators of ACTL on K, so that AX = pre f  . Analogously to the proof of Lemma 7.1, as a consequence of the least/greatest fixpoint characterizations of AU and AR, it turns out that for any A ∈ Abs(℘(Σ)), A is forward complete for OpACTL iff A is forward complete for {∪, pre f  }. Thus, by Lemma 6.4, = AD . , so that, by Corollary 6.8, AD S{∪,pre = S ACTL L Op f } 3 ACTL Thus, by Proposition 5.10 (1), PACTL = par(ADACTL ) = par(ADL3 ) = PL3 , so that Psimeq = PL3 . As a further consequence, by Corollary 6.9, any algorithm Algsimeq that computes simulation equivalence can be viewed as a partitioning abstraction of the {∪, pre f  }-complete shell refinement: Algsimeq (P ) = par(S{∪,pre } (M(P ))). An instantiation of the generalized Paige-Tarjan-like procedure in [45] for the complete shell S{∪,pre } allows to design a new efficient abstract intepretation-based algorithm for computing simulation equivalence [46] whose space and time complexity is comparable with that of state-of-the-art algorithms like [5, 27]. 27 7.3.1 Preorders as Abstract Domains Simulations give rise to preorders rather than equivalences like in the case of bisimulations and dbs relations. Thus, in order to characterize simulation for preorders as forward completeness for abstract domains we need to view preorders as abstract domains. This can be obtained by generalizing the abstraction in Section 3 from partitions to preorders. def Let R ∈ PreOrd(Σ) and for any x ∈ Σ let us define Rpre = {preR ({x}) ⊆ Σ | x ∈ Σ}. The preorder R gives rise to an abstract domain ℘(Rpre )⊆ which is related to ℘(Σ)⊆ through the following abstraction and concretization maps: def αR (S) = {preR ({x}) ⊆ Σ | x ∈ S} def γR (X ) = ∪X∈X X. It is easy to check that from the hypothesis that R is a preorder it follows that (αR , ℘(Σ)⊆ , ℘(Rpre )⊆ , γR ) is indeed a GI. Hence, any R ∈ PreOrd(Σ) induces an abstract domain denoted by add (R) ∈ Abs(℘(Σ)). Also, note that γR ◦ αR = preR , namely preR is the closure associated to add (R). The notation add comes from the fact that an abstract domain A is equivalent to some add (R) if and only if A is disjunctive. Lemma 7.6. {add (R) ∈ Abs(℘(Σ)) | R ∈ PreOrd(Σ)} = {A ∈ Abs(℘(Σ)) | A is disjunctive}. Proof. Observe that γR is trivially additive, so that any add (R) is disjunctive. On the other hand, let A ∈ Abs(℘(Σ)) be disjunctive and consider the relation RA = {(x, y) | α({x}) ≤A α({y})} which is trivially a preorder. Thus, add (RA ) is disjunctive so that in order to conclude that add (RA ) is equivalent to A it is enough to observe that for any y ∈ Σ, preRA ({y}) = γ(α({y})): this is true because γ(α({y})) = {x ∈ Σ | α({x}) ≤A α({y})} = preRA ({y}). Let us observe that add indeed generalizes adp from partitions to preorders because for any P ∈ Part(Σ), adp (P ) = add (R): this is a simple consequence of the fact that for a partition P viewed as an equivalence relation and for x ∈ Σ, Px is exactly a block of P so that αP (S) = {preP ({x}) | x ∈ S}. On the other hand, an abstract domain A ∈ Abs(℘(Σ)) induces a preorder relation preord(A) ∈ PreOrd(Σ) as follows: (x, y) ∈ preord(A) iff α({x}) ≤A α({y}). It turns out that the maps add and preord allows to view the lattice of preorder relations as an abstraction of the lattice of abstract domains. Theorem 7.7. (preord, Abs(℘(Σ))⊒ , PreOrd(Σ)⊇ , add ). Proof. Let A ∈ Abs(℘(Σ)) and R ∈ PreOrd(Σ). Let us prove that R ⊆ preord(A) ⇔ add (R) ⊑ γ ◦ α. (⇒) Let S ⊆ Σ and let us show that add (R)(S) = preR (S) ⊆ γ(α(S)). If x ∈ preR (S) then xRy for some y ∈ S, so that (x, y) ∈ preord(A), i.e. α({x}) ≤A α({y}). Thus, by applying γ, x ∈ γ(α({x})) ⊆ γ(α({y})) ⊆ γ(α(S)). (⇐) Let (x, y) ∈ R and let us show that α({x}) ≤ α({y}). Note that x ∈ preR ({y}) = add (R)({y}) ⊆ γ(α({y})), so that α({x}) ≤A α({y}), namely (x, y) ∈ preord(A). def Let us remark that D = add ◦ preord is a lower closure operator on hAbs(℘(Σ)), ⊑i and that, by Lemma 7.6, for any A ∈ Abs(℘(Σ)), A is disjunctive iff D(A) = A. Hence, D coincides with the disjunctive-shell refinement, also known as disjunctive completion [14], namely D(A) is the most abstract disjunctive refinement of A. We can now provide a characterization of simulation preorders in terms of forward completeness. Theorem 7.8. Let R ∈ PreOrd(Σ). Then, R is a simulation on K iff add (R) is forward complete for {p | p ∈ AP } ∪ {pre f  }. Proof. Recall that preR is the closure associated to add (R). We first observe that (sRs′ ⇒ ℓ(s′ ) ⊆ ℓ(s)) iff preR is forward complete for AP. On the one hand, if p ∈ AP and s ∈ preR (p) then sRs′ for some s′ ∈ p, so that, from ℓ(s′ ) ⊆ ℓ(s), we obtain s ∈ p, and therefore preR (p) = p. On the other hand, if sRs′ and s′ ∈ p, for some p ∈ AP , then s′ ∈ p = preR (p) so that preR ({s′ }) ⊆ preR (preR (p)) = preR (p) = p and therefore from s ∈ preR ({s′ }) we obtain s ∈ p. 28 Thus, it remains to show that R satisfies condition (2) of the definition of simulation iff preR is forward complete for pre . (⇒) We prove that for any S, preR (pre f  (preR (S))) ⊆ pre f  (preR (S)). Let x ∈ preR (pre f  (preR (S))) so that there exists some y ∈ pre f  (preR (S)) such that xRy. If xx′ , for some x′ , then, by simulation, there exists some y ′ such that yy ′ and x′ Ry ′ . Hence, y ′ ∈ preR (S) and this together with x′ Ry ′ , as R is transitive, gives x′ ∈ preR (S). Therefore, x ∈ pre f  (preR (S)). (⇐) Observe that in order to show that R is a simulation it is enough to show that if xRy then x ∈ pre f  (preR (post ({y}))). The following implications hold, where post ({y}) ⊆ preR (post ({y})) holds because preR is a uco: post ({y}) ⊆ preR (post ({y})) ⇒ pre f  (post ({y})) ⊆ pre f  (preR (post ({y}))) ⇒ {y} ⊆ pre f  (preR (post ({y}))) ⇒ preR ({y}) ⊆ preR (pre f  (preR (post ({y})))) ⇒ preR ({y}) ⊆ pre f  (preR (post ({y}))) ⇒ x ∈ pre f  (preR (post ({y}))) [as pre f  is monotone] [as y ∈ pre f  (post ({y}))] [as preR is monotone] [as preR is forward complete for pre f ] [as x ∈ preR ({y})] and this closes the proof. 8 Related work Loiseaux et al. [39] generalized the standard approach to abstract model checking to more general abstract models where an abstraction relation σ ⊆ States × A is used instead of a surjective function h : States → A. However, the results of strong preservation given there (cf. [39, Theorems 3 and 4]) require the hypothesis that the relation σ is difunctional, i.e. σ = σσ −1 σ. In this case the abstraction relation σ can indeed be derived from a function, so that the class of strongly preserving abstract models in Loiseaux et al.’s framework is not really larger than the class of standard partition-based abstract models (see the detailed discussion by Dams et al. [20, Section 8.1]). Giacobazzi and Quintarelli [28] first noted that strong preservation is related to completeness in abstract interpretation by studying the relationship between complete abstract interpretations and Clarke et al.’s [6, 7, 8] spurious counterexamples. Given a formula ϕ of ACTL, a model checker running on a standard abstract Kripke structure defined over a state partition P may provide a spurious counterexample π ♯ for ϕ, namely a path of abstract states, namely blocks of P , which does not correspond to a real concrete counterexample. In this case, by exploiting the spurious counterexample π ♯ , the partition P is refined to P ′ by splitting a single block of P . As a result, this refined partition P ′ does not admit the spurious counterexample π ♯ for ϕ so that P ′ is given as a new refined abstract model for ϕ to the model checker. Giacobazzi and Quintarelli [28] cast spurious counterexamples for a partition P as a lack of (standard) completeness in the abstract interpretation sense for the corresponding partitioning abstract domain adp (P ). Then, by applying the results in [31] they put forward a method for systematically refining abstract domains in order to eliminate spurious counterexamples. The relationship between completeness and spurious counterexamples was further studied in [18], where it is also shown that a block splitting operation in Paige and Tarjan [42] partition refinement algorithm can be characterized in terms of complete abstract interpretations. More in general, the idea of systematically enhancing the precision of abstract interpretations by refining the underlying abstract domains dates back to the early works by Cousot and Cousot [14], and evolved to the systematic design of abstract interpretations by abstract domain refinements [26, 29, 31]. 9 Conclusion This work shows how the abstract interpretation technique allows to generalize the notion of strong preservation from standard abstract models specified as abstract Kripke structures to generic domains in abstract interpretation. For any inductively defined language L , it turns out that strong preservation of L in a standard abstract model checking framework based on partitions of the space state Σ becomes a particular 29 instance of the property of forward completeness of abstract domains w.r.t. the semantic operators of the language L . In particular, a generalized abstract model can always be refined through a fixpoint iteration to the most abstract domain that strongly preserves L . This generalizes in our framework the idea of partition refinement algorithms that reduce the state space Σ in order to obtain a minimal abstract Kripke structure that is strongly preserving for some temporal language. This work deals with generic temporal languages consisting of state formulae only. As future work, it would be interesting to study whether the ideas of our abstract interpretation-based approach can be applied to linear languages like LTL consisting of formulae that are interpreted as sets of paths of a Kripke structure. The idea here is to investigate whether standard strong preservation of LTL can be generalized to abstract interpretations of the powerset of traces and to the corresponding completeness properties. Fairness can be also an interesting topic of investigation, namely to study whether our abstract interpretation-based framework allows to handle fair semantics and fairness constraints [10]. Finally, let us mention that the results presented in this paper led to design a generalized Paige-Tarjan refinement algorithm based on abstract interpretation for computing most abstract strongly preserving domains [45]. As shown in Section 6, a most abstract strongly preserving domain can be characterized as a greatest fixpoint computation in Abs(℘(Σ)). It is shown in [45] that the Paige-Tarjan algorithm [42] can be viewed exactly as a corresponding abstract greatest fixpoint computation in Part(Σ). This leads to an abstract interpretation-based Paige-Tarjan-like refinement algorithm that is parameteric on any abstract interpretation of the lattice Abs(℘(Σ)) of abstract domains of ℘(Σ) and on any generic inductive language L. Acknowledgements. We wish to thank Mila Dalla Preda and Roberto Giacobazzi who contributed to the early stage of this work. This paper is an extended and revised version of [44]. This work was partially supported by the FIRB Project “Abstract interpretation and model checking for the verification of embedded systems” and by the COFIN2004 Project “AIDA: Abstract Interpretation Design and Applications”. References [1] K.R. Apt and G.D. Plotkin. Countable nondeterminism and random assignment. J. ACM, 33(4):724–767, 1986. [2] B. Bloom and R. Paige. Transformational design and implementation of a new efficient solution to the ready simulation problem. Sci. Comp. Program., 24(3):189–220, 1995. [3] A. Bouajjani, J.-C. Fernandez and N. Halbwachs. Minimal model generation. In Proc. of the 2nd Internat. Conf. on Computer Aided Verification (CAV’90), LNCS 531, pp. 197–203, Springer, 1990. [4] M.C. Browne, E.M. Clarke and O. Grumberg. Characterizing finite Kripke structures in propositional temporal logic. Theoret. Comp. Sci., 59:115–131, 1988. [5] D. Bustan and O. Grumberg. Simulation-based minimization. ACM Trans. Comput. Log., 4(2):181–204, 2003. [6] E.M. Clarke, O. Grumberg, S. Jha, Y. Lu and H. Veith. Counterexample-guided abstraction refinement. In Proc. of the 12th Internat. Conf. on Computer Aided Verification (CAV’00), LNCS 1855, pp. 154–169, Springer, 2000. [7] E.M. Clarke, O. Grumberg, S. Jha, Y. Lu and H. Veith. Counterexample-guided abstraction refinement for symbolic model checking. J. ACM, 50(5):752–794, 2003. [8] E.M. Clarke, S. Jha, Y. Lu and H. Veith. Tree-like counterexamples in model checking. In Proc. of the 17th IEEE Symp. on Logic in Computer Science (LICS’02), pp. 19–29, IEEE Press, 2002. [9] E.M. Clarke, O. Grumberg and D. Long. Model checking and abstraction. ACM Trans. Program. Lang. Syst., 16(5):1512–1542, 1994. [10] E.M. Clarke, O. Grumberg and D.A. Peled. Model checking. The MIT Press, 1999. [11] R. Cleaveland, S.P. Iyer, D. Yankelevich. Optimality in abstractions of model checking. In Proc. 2nd Intern. Static Analysis Symposium (SAS’95), LNCS 983, pp. 51–63, Springer, 1995. [12] R. Cleaveland, J. Parrow and B. Steffen. The Concurrency Workbench: a semantics based tool for the verification of concurrent systems. ACM Trans. Program. Lang. Syst., 15(1):36–72, 1993. [13] P. Cousot and R. Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. 4th ACM POPL, pp. 238–252, 1977. 30 [14] P. Cousot and R. Cousot. Systematic design of program analysis frameworks. In Proc. 6th ACM POPL, pp. 269– 282, 1979. [15] P. Cousot and R. Cousot. Higher-order abstract interpretation (and application to comportment analysis generalizing strictness, termination, projection and PER analysis of functional languages). In Proc. IEEE Int. Conf. on Computer Languages (ICCL’94), pp. 95–112, 1994. [16] P. Cousot and R. Cousot. Refining model checking by abstract interpretation. Automated Software Engineering Journal, 6(1):69–95, 1999. [17] P. Cousot and R. Cousot. Temporal abstract interpretation. In Proc. 27th ACM POPL, pp. 12–25, 2000. [18] M. Dalla Preda. Completeness and stability in abstract model checking. Laurea Thesis (in Italian), Univ. of Verona, Italy, 2003. [19] D. Dams. Abstract interpretation and partition refinement for model checking. Ph.D. Thesis, Eindhoven University of Technology, The Netherlands, 1996. [20] D. Dams, O. Grumberg and R. Gerth. Abstract interpretation of reactive systems. ACM Trans. Program. Lang. Syst., 16(5):1512–1542, 1997. [21] J.W. De Bakker, J.-J.C. Meyer and J.I. Zucker. On infinite computations in denotational semantics. Theoret. Comp. Sci., 26(1-2):53–82, 1983. [22] R. De Nicola and F. Vaandrager. Three logics for branching bisimulation. J. ACM, 42(2):458–487, 1995 [23] A. Dovier, C. Piazza and A. Policriti. An efficient algorithm for computing bisimulation equivalence. Theoret. Comp. Sci., 311(1-3):221–256, 2004. [24] E.A. Emerson, A.K. Mok, A.P. Sistla and J. Srinivasen. Quantitative temporal reasoning. In Proc. of the 2nd Internat. Conf. on Computer Aided Verification (CAV’90), LNCS 531, pp. 136–145, Springer, 1990. [25] E.A. Emerson and E.M. Clarke. Characterizing correctness properties of parallel programs using fixpoints. In Proc. ICALP’80, LNCS 85, pp. 169–181, Springer, 1980. [26] G. Filé, R. Giacobazzi and F. Ranzato. A unifying view of abstract domain design. ACM Comput. Surv., 28(2):333–336, 1996. [27] R. Gentilini, C. Piazza and A. Policriti. From bisimulation to simulation: coarsest partition problems. J. Automated Reasoning, 31(1):73-103, 2003. [28] R. Giacobazzi and E. Quintarelli. Incompleteness, counterexamples and refinements in abstract model checking. In Proc. 8th Intern. Static Analysis Symposium (SAS’01), LNCS 2126, pp. 356–373, Springer, 2001. [29] R. Giacobazzi and F. Ranzato. Refining and compressing abstract domains. In Proc. 24th ICALP, LNCS 1256, pp. 771–781, Springer, 1997. [30] R. Giacobazzi and F. Ranzato. Optimal domains for disjunctive abstract interpretation. Sci. Comp. Program., 32:177–210, 1998. [31] R. Giacobazzi, F. Ranzato and F. Scozzari. Making abstract interpretations complete. J. ACM, 47(2):361–416, 2000. [32] J.F. Groote and F. Vaandrager. An efficient algorithm for branching bisimulation and stuttering equivalence. In Proc. ICALP’90, LNCS 443, pp. 626-638, Springer, 1990. [33] O. Grumberg and D.E. Long. Model checking and modular verification. ACM Trans. Program. Lang. Syst., 16(3):843–871, 1994. [34] M. Hennessy and R. Milner. Algebraic laws for nondeterminism and concurrency. J. ACM, 32(1):137–161, 1985. [35] M.R. Henzinger, T.A. Henzinger and P.W. Kopke. Computing simulations on finite and infinite graphs. In Proc. 36th FOCS, pp. 453–462, IEEE Press, 1995. [36] T.A. Henzinger, R. Maujumdar and J.-F. Raskin. A classification of symbolic transition systems. ACM Trans. Comput. Log., 6(1), 2005. [37] L. Lamport. What good is temporal logic? In Information Processing ’83, pp. 657–668, IFIP North-Holland, 1983. [38] D. Lee and M. Yannakakis. Online minimization of transition systems. In Proc. 24th ACM STOC, pp. 264–274, 1992. [39] C. Loiseaux, S. Graf, J. Sifakis, A. Bouajjani and S. Bensalem. Property preserving abstractions for the verification of concurrent systems. Formal Methods in System Design, 6:1–36, 1995. 31 [40] D. Massé. Semantics for abstract interpretation-based static analyzes of temporal properties. In Proc. 9th Intern. Static Analysis Symposium (SAS’02), LNCS 2477, pp. 428–443, Springer, 2002. [41] D. Massé. Abstract domains for property checking driven analysis of temporal properties. In Proc. 10th Intern. Conf. on Algebraic Methodology and Software Technology (AMAST’04), LNCS 3116, pp. 349–363, Springer, 2004. [42] R. Paige and R.E. Tarjan. Three partition refinement algorithms. SIAM J. Comput., 16(6):973–989, 1987 [43] F. Ranzato and F. Tapparo. Making abstract model checking strongly preserving. In Proc. 9th Intern. Static Analysis Symposium (SAS’02), LNCS 2477, pp. 411–427, Springer, 2002. [44] F. Ranzato and F. Tapparo. Strong preservation as completeness in abstract interpretation. In Proc. 13th European Symposium on Programming (ESOP’04), LNCS. 2986, pp. 18–32, Springer, 2004. [45] F. Ranzato and F. Tapparo. An abstract interpretation-based refinement algorithm for strong preservation. In Proc. 11th Intern. Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’05), LNCS 3440, pp. 140–156, Springer, 2005. [46] F. Ranzato and F. Tapparo. An efficient algorithm for computing simulation equivalence based on abstract interpretation. In preparation, 2006. [47] D.A. Schmidt. Closed and logical relations for over- and under-approximation of powersets. In Proc. 11th Intern. Static Analysis Symposium (SAS’04), LNCS 3148, pp. 22–37, Springer, 2004. [48] L. Tan and R. Cleaveland. Simulation revisited. In In Proc. 7th Intern. Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS’01), LNCS 2031, pp. 480-495, Springer, 2001. [49] R.J. van Glabbeek. The linear time - branching time spectrum. In Handbook of Process Algebra, pp. 3–99, Elsevier, 2001. 32
6cs.PL
arXiv:cs/0104003v1 [cs.LO] 2 Apr 2001 Under consideration for publication in Theory and Practice of Logic Programming 1 Chain Programs for Writing Deterministic Metainterpreters DAVID A. ROSENBLUETH Instituto de Investigaciones en Matemáticas Aplicadas y en Sistemas Universidad Nacional Autónoma de México Apdo. 20-726, 01000 México D.F. Abstract Many metainterpreters found in the logic programming literature are nondeterministic in the sense that the selection of program clauses is not determined. Examples are the familiar “demo” and “vanilla” metainterpreters. For some applications this nondeterminism is convenient. In some cases, however, a deterministic metainterpreter, having an explicit selection of clauses, is needed. Such cases include (1) conversion of or parallelism into and parallelism for “committed-choice” processors, (2) logic-based, imperative-language implementation of search strategies, and (3) simulation of bounded-resource reasoning. Deterministic metainterpreters are difficult to write because the programmer must be concerned about the set of unifiers of the children of a node in the derivation tree. We argue that it is both possible and advantageous to write these metainterpreters by reasoning in terms of object programs converted into a syntactically restricted form that we call “chain” form, where we can forget about unification, except for unit clauses. We give two transformations converting logic programs into chain form, one for “moded” programs (implicit in two existing exhaustive-traversal methods for committed-choice execution), and one for arbitrary definite programs. As illustrations of our approach we show examples of the three applications mentioned above. 1 Introduction Perhaps the most common use of metalogic is the definition and implementation of metainterpreters (Safra and Shapiro 1986, Abramson and Rogers 1988, Kowalski 1990, Apt and Turini 1995). Many applications of metainterpreters are based on concise definitions, like that of the “vanilla” metainterpreter, which can be easily elaborated as required. Other applications, however, have been neglected, possibly because of employing convoluted definitions. Examples are deterministic metainterpreters exhaustively traversing search spaces. Our purpose will be to present a technique simplifying the design of deterministic metainterpreters. This technique converts the object program into a form severely restricted in its syntax, thereby facilitating reasoning about its search space. Early works exploiting metainterpreters to great advantage are for example Bowen and Kowalski’s amalgamation of language and metalanguage (Bowen and Kowalski 1982), Sergot’s “query-the-user” facility (Sergot 1982), and Shapiro’s “algorithmic debugger” (Shapiro 1982). These metainterpreters, just as the familiar vanilla and 2 David A. Rosenblueth demo metainterpreters, have nondeterministic definitions. Consider for example the following demo predicate (Kowalski 1990, Kowalski 1995): demo(T , P ) ← axiom(T , P ← Q ), demo(T , Q ) demo(T , P ∧ Q ) ← demo(T , P ), demo(T , Q ) demo(T , true) ← This definition is nondeterministic because it is not determined, in the first clause of the definition, what axiom in the theory T , having conclusion P , might be needed to demonstrate P (Kowalski 1995, p. 229). For some applications this nondeterminism is convenient. For others, however, a deterministic metainterpreter, having an explicit selection of axioms, is desired. A problem amenable to deterministic metainterpretation is that of exhaustively traversing, using a committed-choice processor, the search space generated by a logic program and a goal (Ueda 1987, Tamaki 1987). Another problem is that of describing search strategies with logic programs equivalent to flowcharts, like the programs of (Clark and van Emden 1981). Yet another application is Kowalski’s approach for reconciling reactive and rational agents with bounded-resource metainterpreters (Kowalski 1995). It is of course possible to write deterministic metainterpreters for logic programs. Clark and Gregory were perhaps among the first to publish (Clark and Gregory 1985) one such metainterpreter. We show a slightly modified version of their metainterpreter in Fig. 1. The intended meanings of some of the predicates in this metainterpreter are as follows. Assume that the set of answer substitutions to the goal having A as its only subgoal is {θ1 , . . . , θn }. Then the predicate single call set(A, Aθs) is intended to hold when Aθs is a list of the form [Aθ1 , . . . , Aθn ]. The predicate set(A, Bs, Aθs) is a generalisation of single call set. In this case the goal Bs, which may have more than one subgoal, is of the form B1 ∧ . . . ∧ Bm ∧ true, and Aθs is of the form [Aθ1 , . . . , Aθn ], where {θ1 , . . . , θn } is the set of answer substitutions for Bs. (Bs terminates by true to simplify the code.) The predicate all set(ABs, Aθs), in turn, can be viewed as a generalisation of set, where ABs is a list of clauses [A1 ← Bs1 , . . . , Am ← Bsm ] and Aθs is of the form [A1 θ1,1 , . . . , A1 θ1,n1 , . . . , Am θm,1 , . . . , Am θm,nm ], where {θi,1 , . . . , θi,ni } is the set of answer substitutions for Bsi . We refer the reader to (Clark and Gregory 1985) for a thorough discussion of this metainterpreter. As exhibited in Fig. 1, the programmer must be concerned about the set of unifiers of the children of a node in the derivation tree (cf. the term instances predicate). The reason for this concern, as we will see, is that variables in a logic program can appear anywhere in a clause. This is an additional difficulty, absent in usual nondeterministic metainterpreters. The study of deterministic metainterpreters can be viewed as an attempt to narrow the “gap” between the “don’t-know” form of logic programming, needed for user-level applications, and the “don’t-care” form, useful for controlling the execution of logic programs. Kowalski’s observation (Kowalski 1993) that the FGCS project had experienced such a gap suggests looking at the work done in connection with this project. Chain Programs for Writing Deterministic Metainterpreters 3 Example of object-program representation: definition(ap( , , ), [ap([ ], L, L) ← true, ap([A|L′ ], M , [A|N ]) ← (ap(L′ , M , N ) ∧ true) ] )← Example of goal: ← single call set(ap(X , Y , [a, b]), Aθs) Metainterpreter: single call set(A, Aθs) ← definition(A, ABs), all matches(A, ABs, ABθs ′ ), all set(ABθs ′ , Aθs) all set([ ], [ ]) ← all set([A ← Bs|ABs], Aθs) ← set(A, Bs, Aθs 1 ), all set(ABs, Aθs 2 ), append(Aθs 1 , Aθs 2 , Aθs) set(A, true, [A]) ← set(A, B ∧ Bs, Aθs) ← single call set(B , Bθs), term instances(B , Bθs, A ← Bs, ABθs), all set(ABθs, Aθs) all matches(A, [ ], [ ]) ← all matches(A, [Aθ ← Bθs|ABs], [Aθ ← Bθs|ABθs ′ ]) ← copy(A, Aθ′ ), unify(Aθ, Aθ′ ), !, all matches(A, ABs, ABθs ′ ) all matches(A, [A′ ← Bs|ABs], ABs ′ ) ← all matches(A, ABs, ABs ′ ) term instances(B , [ ], C , [ ]) ← term instances(B , [Bθ|Bθs], C , [Cθ|Cθs]) ← copy(f (B , C ), f (Bθ ′ , Cθ)), unify(Bθ, Bθ ′ ), term instances(B , Bθs, C , Cθs) Figure 1. A deterministic, exhaustive-traversal metainterpreter for arbitrary definite programs. For readability, we use a string Xθ as the name of a variable taking as value an instance of the value of X . Similarly, Xθs is the name of a variable taking as value a list of instances of the value of X . First Ueda (Ueda 1987), and then Tamaki (Tamaki 1987), published methods converting a nondeterministic logic program into a deterministic version. The motivation for developing such methods was that of allowing the execution of or-parallel programs by committed-choice processors (which are and parallel). Understanding how these methods work might lead to key ideas for obtaining other deterministicevaluation methods. However, the considerable intricacy of these methods is an obstacle for giving a clear and concise explanation of their central mechanisms. 4 David A. Rosenblueth Trying to elucidate the principles on which these methods are based, we found an important common characteristic. Both tend to hide, as it were, certain occurrences of variables, in a list behaving like a stack. In particular, such occurrences are those of variables that (1) receive a substitution before a subgoal A is selected and (2) occur in a subgoal selected after A has succeeded. Variables having such occurrences are called “pass-on” variables in (Tamaki 1987). Hence, if we consider programs lacking pass-on variables, a fortiori, these transformations get simplified. A kind of program lacking pass-on variables is that of “chain” programs, having clauses of the form: p(X0 , Xn ) ← q1 (X0 , X1 ), q2 (X1 , X2 ), . . . , qn (Xn−1 , Xn ) (as well as other clauses; we formally define chain programs in Sect. 2). Apparently, concentrating on chain programs should simplify the task of devising deterministictraversal methods in general, and defining deterministic metainterpreters in particular. We confirm this possibility by deriving in Sect. 2 a deterministic metainterpreter by reasoning in terms of relational union and composition. This metainterpreter is more useful once we provide ways of transforming logic programs that do not have chain form into such a form. The methods of (Ueda 1987) and (Tamaki 1987) can handle “moded” programs, that do not necessarily have chain form. In these programs, each argument place of each predicate is used either as input (instantiated) or as output (uninstantiated). By comparing the original methods with their versions simplified to chain programs, we have uncovered a transformation converting moded programs into chain form. In Sect. 3 we give such a transformation, which is in fact implicit in (Ueda 1987) and (Tamaki 1987). As in the methods of Ueda and Tamaki, we hide pass-on variables in a list behaving like a stack. (We have previously used this transformation for adapting parsers for context-free languages obtaining inference systems for moded logic programs (Rosenblueth 1996, Rosenblueth and Peralta 1998).) Next, in Sect. 4 we give another transformation, converting arbitrary definite programs into chain form, inspired by the previous one. Once we have this more general transformation, we can easily extend, in Sect. 5, the existing methods for deterministic, exhaustive traversal (Ueda 1987, Tamaki 1987) to handle arbitrary definite programs. Section 6 shows how to write deterministic metainterpreters for other applications. First we exhibit a metainterpreter having the same behaviour as that of Prolog systems. Next we give a bounded-resource metainterpreter. We will assume some familiarity with logic program transformation through the unfold/fold rules (Pettorossi and Proietti 1994). Code appearing throughout the sequel, as well as further examples of programs converted into chain form, may be found at: http://leibniz.iimas.unam.mx/~drosenbl/detmeta. 5 Chain Programs for Writing Deterministic Metainterpreters 2 A Deterministic, Exhaustive-Traversal Metainterpreter for Chain Programs In this section, we will write a deterministic, exhaustive-traversal metainterpreter for chain programs by reasoning in terms of relational union and composition. A chain program can be viewed as defining a system of equations of relational expressions. Such systems of relational equations have been studied for example in (Engelfriet 1974, de Bakker and Meertens 1975, Blikle 1977). Our translation of chain programs into relational equations enables us to regard logical inference from such programs as the evaluation of relational expressions built from union and composition. Our chain programs are similar to, but different from, certain programs occurring in the deductive-database literature under the same name; a difference is that we allow function symbols other than constants. For clarity, we will discuss now this metainterpreter assuming that only ground terms are constructed. However, in Sect. 4 we will observe that with the addition of variable renaming and full unification (as opposed to matching, i.e. one-way unification), this metainterpreter is also valid for constructing terms with variables. 2.1 Chain programs as systems of relational equations We define a chain program as a logic program consisting only of clauses of the form: p(X0 , Xn ) ← q1 (X0 , X1 ), q2 (X1 , X2 ), . . . , qn (Xn−1 , Xn ) n > 0 ′ or p(t , t ) ← (1) (2) where the Xi ’s are distinct variables, and t and t ′ are any term. The first argument place of a predicate will be called its input, and the second argument place its output. It will be useful to single out a kind of chain program where all answers for such a program and a goal with a leftmost ground input are ground, assuming a leftmost computation rule. If var(t ′ ) ⊆ var(t ) in every clause of the form (2), then the program is called a G-chain program. Here, and throughout the sequel, we use var(t ) to denote the set of variables in expression t . Clearly, the clause (1) denotes the inclusion: P ⊇ (Q1 ; Q2 ; . . . ; Qn ) (3) where P , Qi name the relations denoted by p, qi , respectively, and “;” denotes relational composition.1 Let us define ·· Pj = Q1 ; Q2 ; . . . ; Qn if the j -th clause defining the predicate with symbol p has the form (1). If, on the other hand, the j -th clause defining the predicate with symbol p has the form (2), then ·· Pj = {(x, x′ ) : p(x, x′ ) ← is a ground instance of p(t , t ′ ) ←} 1 ·· The composition of relations P and Q is defined as: P ; Q = {(x , z ) : ∃y[(x , y) ∈ P & (y, z ) ∈ Q]}. 6 David A. Rosenblueth Hence, a chain program denotes a system of relational expressions having an inclusion of the form P ⊇ (P1 ∪ P2 ∪ . . . ∪ Pm ) for each largest set of clauses defining a predicate with symbol p. Just as sometimes the meaning of a logic program is defined as its least Herbrand model, here we are interested in the least solution of this system. It can be shown that such a solution is equal to the unique solution of the system obtained by replacing the inclusions by equalities. For notational convenience, we will extend relational composition to the case where the first argument is a set. Let S ⊆ D and R ⊆ D × D . ·· S ; R = {z : ∃y[y ∈ S & (y, z ) ∈ R]} i.e. S ; R denotes the image of S under R. Also, we will sometimes omit the curly braces in singletons. By I we will denote the identity relation and by ∅ the empty relation as well as the empty set. Given an object chain program, we will use X as a metavariable taking as value a ground term, Xs a set of ground terms, Q a relation denoted by an (objectlevel) predicate, Qs compositions Q1 ; . . . ; Qn of relations denoted by predicates, Pj a relation denoted by a single clause, and Pjs unions P1 ∪ . . . ∪ Pm of relations denoted each by a single clause. Computing all answers for a chain program and a goal ← q(x, Z ), where x is a ground term, translates to evaluating the expression x ; Q , where Q names the relation denoted by q. During this evaluation, we will have to evaluate relational expressions of the form: Xs ; Qs (4) which represent and branches of the SLD tree. 2.2 A metainterpreter as a relational-expression evaluator Let us now establish an object-program representation. For simplicity, we use the ambivalent syntax of (Jiang 1994). If the j -th clause defining a predicate with symbol p is of the form (1) we will have the following clause at the metalevel: nonunit(pj , (q1 ; q2 ; . . . ; qn ; I)) ← where “;” can be interpreted as a right-associative infix list constructor and I as a constant. If the j -th clause defining a predicate with symbol p is of the form (2) we will have: is unit(pj ) ← and ′ unit(pj , t , t ) ← (The is unit predicate is clearly unnecessary, as could be defined using the unit predicate, but we will use it for readability.) Chain Programs for Writing Deterministic Metainterpreters 7 Also, for each largest set of clauses defining a predicate with symbol p we will have: defn(p, (p1 ∪ p2 ∪ . . . ∪ pm ∪ ∅)) ← where ∪ can be interpreted as a right-associative infix list constructor denoting set union and ∅ as a constant. In general, we could have two main evaluation strategies for (4): “termwise” (i.e. decomposing Xs) and “relationwise” (i.e. decomposing Qs). Here we will concentrate on a termwise definition (but see (Rosenblueth 1998) for an application of a metainterpreter using a relationwise definition). Consider (4). The predicate a(Xs, Qs, Zs) is intended to hold if Zs is Xs;Qs. Then the next two clauses, which constitute a termwise definition of this predicate, follow from the distributivity of composition over union: a(∅, Qs, ∅) ← a({X } ∪ Xs, Qs, YsZs) ← a ′ (X , Qs, Ys), a(Xs \ {X }, Qs, Zs), union(Ys, Zs, YsZs) where a ′ (X , Qs, Ys) is meant to hold when Ys is X ; Qs and union(Ys, Zs, YsZs) is meant to hold when YsZs is Ys ∪ Zs. We can decompose Qs in the definition of a ′ , which follows from the definition of composition: a ′ (X , I , {X }) ← a ′ (X , (Q ; Qs), Zs) ← b ′ (X , Q , Ys), a(Ys, Qs, Zs) where b ′ (X , Q , Ys) represents the composition Ys of a single term X with a single relation Q . The following clause translates such a composition into the composition of X with a union Pjs of relations: b ′ (X , Q , Ys) ← defn(Q , Pjs), c ′ (X , Pjs, Ys) where c ′ (X , Pjs, Ys) is intended to hold if Ys is X ; Pjs. Now we inductively define c ′ by decomposing Pjs. This definition of c ′ , as that of a, follows from the distributivity of composition over union: c ′ (X , ∅, ∅) ← c ′ (X , {Pj} ∪ Pjs, YsZs) ← d ′ (X , Pj, Ys), c ′ (X , Pjs \ {Pj}, Zs), union(Ys, Zs, YsZs) where the predicate d ′ (X , Pj, Ys) is assumed to hold when Ys is X ; Pj, and the predicate union(Ys, Zs, YsZs) is assumed to hold when YsZs is Ys ∪ Zs. Next we write a definition of d ′ (X , Pj, Ys). This definition uses an auxiliary predicate e ′ (X , Pj, Ys) in case Pj represents a unit clause. If, on the other hand, Pj represents a nonunit clause, then the d ′ predicate uses the (object-level) definition 8 David A. Rosenblueth of Pj to translate X ; Pj into X ; Qs, so that the previously defined predicate a ′ (X , Qs, Zs) can be used. d ′ (X , Pj, Ys) ← is unit(Pj), e ′ (X , Pj, Ys) d ′ (X , Pj, Zs) ← nonunit(Pj, Qs), a ′ (X , Qs, Zs) It only remains to define e ′ (X , Pj, Ys), intended to hold if Ys is X ; Pj and Pj represents a unit clause. e ′ (X , Pj, {Y }) ← unit(Pj, X , Y ) ′ e (X , Pj, ∅) ← not(unit(Pj, X , )) (5) (6) The clause (5) covers the case where X matches the input of the unit clause named Pj, whereas the clause (6) covers the case where X does not match the input of the unit clause named Pj. Finally, we give the complete metainterpreter in a more standard Prolog notation. In addition, we have approximated set union with list concatenation. (A more efficiently executable metainterpreter would use difference lists, but for clarity we prefer ordinary lists.) We will call this the abcde metainterpreter. a([ ], Qs, [ ]) ← a([X |Xs], Qs, YsZs) ← a ′ (X , Qs, Ys), a(Xs, Qs, Zs), append(Ys, Zs, YsZs) (7) a ′ (X , [ ], [X ]) ← a ′ (X , [Q |Qs], Zs) ← b ′ (X , Q , Ys), a(Ys, Qs, Zs) (8) b ′ (X , Q , Ys) ← defn(Q , Pjs), c ′ (X , Pjs, Ys) c ′ (X , [ ], [ ]) ← c ′ (X , [Pj|Pjs], YsZs) ← d ′ (X , Pj, Ys), c ′ (X , Pjs, Zs), append(Ys, Zs, YsZs) (9) d ′ (X , Pj, Ys) ← is unit(Pj), e ′ (X , Pj, Ys) d ′ (X , Pj, Zs) ← nonunit(Pj, Qs), a ′ (X , Qs, Zs) (10) e ′ (X , Pj, [Y ]) ← unit(Pj, X , Y ) e ′ (X , Pj, [ ]) ← not(unit(Pj, X , )) 3 Conversion of Moded Programs into Chain Form Having written a deterministic metainterpreter for chain programs, our aim now is to develop a transformation converting “moded” programs (Apt 1997) into chain Chain Programs for Writing Deterministic Metainterpreters 9 form. We will derive such a transformation with unfold/fold rules (Pettorossi and Proietti 1994). This transformation is in fact implicit in two existing methods for deterministic, exhaustive traversal: the continuation-based (Ueda 1987) and the stream-based (Tamaki 1987) methods. We have previously used such a transformation for adapting parsers for context-free grammars obtaining inference systems for moded logic programs (Rosenblueth 1996, Rosenblueth and Peralta 1998). A clause ′ p(t0 , tn′ ) ← q1 (t0′ , t1 ), q2 (t1′ , t2 ), . . . , qn (tn−1 , tn ) n≥0 (11) is called moded if: 1. var(ti′ ) ⊆ var(t0 ) ∪ · · · ∪ var(ti ), for i = 0, . . . , n; and 2. var(ti ) ∩ var(tj ) = ∅, for i, j = 0, . . . , n and i 6= j . A program is called moded if it consists only of moded clauses. Condition 1 causes every input to be ground if the input of the initial goal is also ground and we use a leftmost computation rule. When a subgoal succeeds, condition 2 causes the constructed term to have an effect only on the input of other subgoals, thus avoiding speculative bindings. In (Rosenblueth 1996, Rosenblueth and Peralta 1998) we had a third condition (that each variable occurring in ti′ occurs only once in ti′ , for i = 0, . . . , n, if n > 0) meant only for simplifying the transformation. However, as we observe below, it is possible to eliminate such a condition without excessively elaborating the transformation. We will use the standard equality theory. Given a program P , this theory consists of the following axioms: X =X ← X =Y ←Y =X X = Z ← X = Y, Y = Z {f (X1 , . . . , Xnf ) = f (Y1 , . . . , Ynf ) ← X1 = Y1 , . . . , Xnf = Ynf : f is a function symbol occurring in P } {p(X1 , . . . , Xnp ) ← X1 = Y1 , . . . , Xnp = Ynp , p(Y1 , . . . , Ynp ) : p is a predicate symbol occurring in P } which are called, reflexivity, symmetry, transitivity, function substitutivity, and predicate substitutivity, respectively. One way of obtaining a chain clause from a moded clause would be to resolve first the moded clause with predicate substitutivity so as to replace each argument of a subgoal by a variable and then to fold the resulting clause using some new predicates so as to remove the introduced equations. We will see, however, that such a folding operation may not always be sound (Gardner and Shepherdson 1992, Tamaki and Sato 1984). Consider the following append program used for splitting lists. s(hLi, h[ ], Li) ← (12) 10 David A. Rosenblueth s (h[A|N ]i, h[A|L], M i) ← s (hN i , hL, M i) |{z} |{z} | {z } |{z} | {z } | {z } q1 t ′ p t0 t1 t′ 1 (13) 0 We employ angled brackets h i instead of ordinary brackets [ ] for grouping input and output arguments. We do this for clarity. By predicate substitutivity and symmetry, it is possible to derive from (13): s(X , Y ) ← X = h[A|N ]i , Y = h[A|L], M i, X ′ = hN i , Y ′ = hL, M i, s(X ′ , Y ′ ) (14) Next, we could fold (14) using the following definitions: naive h0 (X , X ′ ) ↔ ∃A ∃N (X = h[A|N ]i & X ′ = hN i) naive h1 (Y ′ , Y ) ↔ ∃A ∃L ∃M (Y ′ = hL, M i & Y = h[A|L], M i) In the case of naive h0 , this folding operation would replace the subgoals enclosed in rectangles by the definiendum naive h0 (X , X ′ ). However, as observed in (Tamaki and Sato 1984), in general it is incorrect to fold a clause such as (14) using a definition such as that of naive h0 , where a variable like A: (a) appears in atoms replaced by the definiendum (i.e. X = h[A|N ]i), (b) appears in atoms not replaced by the definiendum (i.e. Y = h[A|L], M i), and (c) does not unify with any variable appearing in the definiendum. To see this incorrectness, fold and subsequently unfold (14) with naive h0 , and a generalisation of (14) is obtained. Note that unlike A in (13), N (which does not cause the incorrectness of Tamaki and Sato) occurs only in t0 and t0′ . This suggests that a minimal strengthening of the syntactic conditions defining moded clauses so as to avoid the situation above would be requiring that all variables of ti′ occur in ti (for i = 0, . . . , n). Hence, we define a clause in prechain form as: ′ p̂(s0 , sn′ ) ← q̂1 (s0′ , s1 ), q̂2 (s1′ , s2 ), . . . , q̂n (sn−1 , sn ) n≥0 where: 1. var(si′ ) ⊆ var(si ) for i = 0, . . . , n; and 2. var(si ) ∩ var(sj ) = ∅, for i, j = 0, . . . , n and i 6= j . From a clause in prechain form it is possible to arrive at chain form by first applying predicate substitutivity and then folding with the completed definitions of predicates of the form: hi (si , si′ ) ← Such foldings satisfy also Gardner and Shepherdson’s stronger condition (Gardner and Shepherdson 1992) for folding. We face now the problem of converting a moded clause into prechain form. Recall first the pass-on variables of the deterministic, exhaustive-traversal methods (Ueda 1987, Tamaki 1987), i.e. variables that receive a substitution before a subgoal B is selected and occur in a subgoal selected after B has succeeded. Observe next that Chain Programs for Writing Deterministic Metainterpreters 11 prechain form clauses lack pass-on variables. Finally, note that the fact that these methods use a stack to hide pass-on variables, suggests that we also use a stack to achieve prechain form. Since both chain form and prechain form lack pass-on variables, we could have chosen prechain form for the object programs of our deterministic metainterpreter. The resulting metainterpreter, however, would not have been as concise. In converting a moded clause into prechain form, we will often apply the following sequence of unfolding steps, which we group in a lemma. Lemma 1 (Equation introduction) Let C be a definite clause having an occurrence of a variable X . Then the clause obtained by replacing that occurrence of X by X ′ and adding the equation X = X ′ is logically implied by C and the standard equality theory for C . Proof First, we resolve C with predicate substitutivity as follows. If the occurrence of X is in the head of C , then we select the subgoal of predicate substitutivity which is not an equation. Next, we apply symmetry to all equations of the resolvent. The resulting clause has the form: p(Y1 , . . . , Yd ) ← t1 = Y1 , . . . , td = Yd , A1 , . . . , An If, on the other hand, the occurrence of X is in a subgoal Ai of C , then we select such a subgoal. The resulting clause has the form: A0 ← A1 , . . . , Ai−1 , t1 = Y1 , . . . , td = Yd , p(Y1 , . . . , Yd ), Ai+1 , . . . , An In either case, the occurrence of X is in some equation tj = Yj . Next, we apply function substitutivity to tj = Yj as many times as it is necessary to make such an occurrence appear at the top level of an equation X = X ′ . Finally, we apply reflexivity to all equations except X = X ′ , thus disposing of all unwanted equations. The resulting clause has the claimed form. Hence the lemma holds. Often, we will use equation introduction followed by symmetry, to which we will also refer as equation introduction. Example 1 Let us convert (13) first into prechain form and then into chain form. To achieve prechain form, we will use an auxiliary stack, which we introduce in the following predicate: ŝ(hSt, X i, hSt, Y , Z i) ← s(hX i, hY , Z i) We first apply equation introduction to the definition of ŝ: ŝ(hSt, X i, hSt′ , Y , Z i) ← St = St′ , s(hX i, hY , Z i) (15) Next, we apply equation introduction to (13). s(h[A|N ]i, h[A′ |L], M i) ← A = A′ , s(hN i, hL, M i) (16) 12 David A. Rosenblueth Subsequently, we resolve (15) and (16) unifying the two underlined atoms. ŝ(hSt, [A|N ]i, hSt′ , [A′ |L], M i) ← St = St′ , A = A′ , s(hN i, hL, M i) Next, we fold using function substitutivity. ŝ(hSt, [A|N ]i, hSt′ , [A′ |L], M i) ← [A|St] = [A′ |St′ ] , s(hN i, hL, M i) Finally, we fold using (15) and systematically rename variables. ŝ(hSt0 , [A0 |N0 ]i, hSt1 , [A1 |L1 ], M1 i) ← ŝ(h[A0 |St0 ], N0 i, h[A1 |St1 ], L1 , M1 i) Once we have prechain form, we can apply predicate substitutivity and symmetry, and then fold w.r.t. the completed definitions of: h0 (hSt0 , [A0 |N0 ]i, h[A0 |St0 ], N0 i) ← h1 (h[A1 |St1 ], L1 , M1 i, hSt1 , [A1 |L1 ], M1 i) ← arriving at: ŝ(X0 , X3 ) ← h0 (X0 , X1 ), ŝ(X1 , X2 ), h1 (X2 , X3 ) (17) End of example In (Rosenblueth 1996, Rosenblueth and Peralta 1998) we required that each variable occurring in ti′ occurs only once in ti′ . Note that if there is more than one occurrence of a variable in t1′ , like in: r (h[A|N ]i, h[A|L], M , A i) ← s(hN i, hL, M i) thus violating such a condition, we would have an extra equation after applying equation introduction twice: r (h[A|N ]i, h[A′ |L], M , A′′ i) ← A = A′ , A = A′′ , s(hN i, hL, M i) Note that we do not wish to eliminate A = A′′ with reflexivity, since we would obtain a clause with a variable occurring both in the input and the output of the head, preventing us from folding the h’s. However, equations such as this one can be eliminated by factoring all equations with the same left-hand side. Hence we have withdrawn such a condition. This derivation suggests a proof of a theorem relating a moded clause with its chain form. Theorem 1 Let C be a moded clause: ′ , tn ) p(t0 , tn′ ) ← q1 (t0′ , t1 ), q2 (t1′ , t2 ), . . . , qn (tn−1 n≥0 and let   Πj = var(t0 ) ∪ · · · ∪ var(tj −1 ) ∩ var(tj′ ) ∪ · · · ∪ var(tn′ ) j = 0, . . . , n + 1 13 Chain Programs for Writing Deterministic Metainterpreters Then the clause Ĉ : p̂(U0 , Un′ ) ← h0 (U0 , U0′ ), q̂1 (U0′ , U1 ), h1 (U1 , U1′ ), q̂2 (U1′ , U2 ), . . . , ′ q̂n (Un−1 , Un ), hn (Un , Un′ ) is logically implied by C , the standard equality theory for C , the “iff” version of the function substitutivity axiom for the list-constructor function symbol: [X |Y ] = [X ′ |Y ′ ] ↔ X = X ′ & Y = Y ′ and the completed definitions of: p̂(hSt|X i, hSt|Y i) ← p(X , Y ) q̂j (hSt|X i, hSt|Y i) ← qj (X , Y ) j = 1, . . . , n hj (hΣj |tj i, hΣj +1 |tj′ i) j = 0, . . . , n ← where Σj is any list of the form [X1,j , . . . , Xdj ,j |St], such that {X1,j , . . . , Xdj ,j } = Πj , if Πj 6= ∅, and Σj is St if Πj = ∅, for j = 0, . . . , n + 1, and the hj ’s are predicate symbols not occurring in C . Proof First, we apply equation introduction to the definitions of p̂ and the q̂i ’s. p̂(hSt|X i, hSt′ |Y i) ← St = St′ , p(X , Y ) ′ (18) ′ q̂j (hSt|X i, hSt |Y i) ← St = St , qj (X , Y ) j = 1, . . . , n (19) Let σi , i = 0, . . . , n, be renaming substitutions (Lloyd 1987, p. 22) for C such that: [  ·· σi = {X /Z : X ∈ var(C ) & Z 6∈ var(C ) ∪ rhs(σj ) } j 6=i where rhs(σj ) = {Z1 , . . . , Zk } if σj = {X1 /Z1 , . . . , Xk /Zk }. Since the variables in rhs(σi ) do not occur in C or in any other σj (i 6= j ), the application of σi to a variable X renames X uniquely. Hence, we can think of such an application as the addition of the subscript i to X . Next, we apply equation introduction to C and rename variables, obtaining: ′ p(t0 σ0 , tn′ σn ) ← E , q1 (t0′ σ0 , t1 σ1 ), q2 (t1′ σ1 , t2 σ2 ), . . . , qn (tn−1 σn−1 , tn σn ) where  E = {X σi = X σk : X ∈ var(ti ) ∩ var(tk′ ) & i < k } Subsequently, we resolve with (18) and rename St and St′ . p̂(hSt0 |t0 σ0 i, hStn |tn′ σn i) ← St0 = Stn , E , ′ q1 (t0′ σ0 , t1 σ1 ), q2 (t1′ σ1 , t2 σ2 ), . . . , qn (tn−1 σn−1 , tn σn ) ·· S Let Π = j Πj and X ∈ Π (i.e. X occurs in some (and only one) ti and some tk′ , for i < k ). We now define φ(X ) = i, where X ∈ var(ti ) γ(X ) = max{k : X ∈ var(tk′ )} 14 David A. Rosenblueth and apply transitivity and factoring, replacing the equations by (up to variable renaming): [ {St0 = St1 , St1 = St2 , . . . , Stn−1 = Stn } ∪ EX X ∈Π where EX = {X σφ(X ) = X σφ(X )+1 , X σφ(X )+1 = X σφ(X )+2 , . . . , X σγ(X )−1 = X σγ(X ) } Note that for all j and all X :  X ∈ var(ti ) ∩ var(tk′ ) for some i ≤ j − 1 and some k ≥ j iff (X σj −1 = X σj ) ∈ EX Equivalently, for all j and all X : [  var(ti ) ∩ var(tk′ ) iff (X σj −1 = X σj ) ∈ EX X ∈ i≤(j −1), k ≥j Hence, Πj = {X : (X σj −1 = X σj ) ∈ EX } for j = 0, . . . , n + 1, so that we have exactly all equations for constructing the Σj ’s. Next, we repetitively fold using function substitutivity, and arrive at: p̂(hSt0 |t0 θ0 i, hStn |tn′ θn i) ← Σ1 θ0 = Σ1 θ1 , Σ2 θ1 = Σ2 θ2 , . . . , Σn θn−1 = Σn θn , ′ q1 (t0′ θ0 , t1 θ1 ), q2 (t1′ θ1 , t2 θ2 ), . . . , qn (tn−1 θn−1 , tn θn ) Prechain form is now obtained by folding with (19): p̂(hSt0 |t0 θ0 i, hStn |tn′ θn i) ← q̂1 (hΣ1 θ0 |t0′ θ0 i, hΣ1 θ1 |t1 θ1 i), q̂2 (hΣ2 θ1 |t1′ θ1 i, hΣ2 θ2 |t2 θ2 i), . . . , ′ q̂n (hΣn θn−1 |tn−1 θn−1 i, hΣn θn |tn θn i) Finally, we apply predicate substitutivity and symmetry, and then fold with the completed definitions of the hi predicates. The resulting clause has the desired form; hence we conclude that the theorem holds. Example 2 Let us apply Theorem 1 to the clause (13), of Example 1. s (h[A|N ]i, h[A|L], M i) ← s (hN i , hL, M i) |{z} | {z } | {z } |{z} |{z} | {z } p q1 t ′ t0 t1 t′ 1 Π0 Π1 Π2 0 = = =  ∅ ∩ var(t0′ ) ∪ var(t1′ ) ′ var(t0 ) ∩ var(t  1) var(t0 ) ∪ var(t1 ) ∩ ∅ = = = ∅ {A} ∅ So, Σ0 = St, Σ1 = [A|St], and Σ2 = St. The resulting clause in chain form is (17). The definitions of the hi ’s are as before, up to variable renaming. End of example Chain Programs for Writing Deterministic Metainterpreters 15 Let P be a moded program. We define P̂ as the program resulting from applying Theorem 1 to every clause in P in such a way that the hi predicate symbols of a clause do not occur in any other clause of P̂. Theorem 1 associates a chain program P̂ with a moded program P in such a way that P̂ is a logical consequence of a conservative extension of P . The implication in the other direction also holds. That P is logically implied by a conservative extension of P̂ can be seen by first resolving each clause in P̂ having a head with predicate symbol p̂ with the only-if part of the definition of p̂ and unfolding the definitions of the hi ’s and the q̂i ’s. Finally, note that the chain program P̂ of a moded program P is a G-chain program (i.e. a program such that in every unit clause p(t , t ′ ) ←, var(t ′ ) ⊆ var(t ), so that all answers for a subgoal with a ground input are ground using a leftmost computation rule (cf. Sect. 2)). Example 3 As an example explicitly linking this transformation with the abcde metainterpreter, we give the object-program representation of the chain form of the clauses (12) and (13). defn(ŝ, [ŝ1 , ŝ2 ]) ← defn(h0 , [h0′ ]) ← defn(h1 , [h1′ ]) ← nonunit(ŝ2 , [h0 , ŝ, h1 ]) ← unit(ŝ1 , hSt, Li, hSt, [ ], Li) ← unit(h0′ , hSt, [A|N ]i, h[A|St], N i) ← unit(h1′ , h[A|St], L, M i, hSt, [A|L], M i) ← is unit(ŝ1 ) ← is unit(h0′ ) ← is unit(h1′ ) ← End of example 4 Conversion of Definite Programs into Chain Form In this section, we will first give a transformation inspired by the previous one, converting an arbitrary definite program into chain form. Next, we will explain how to couple the abcde metainterpreter to this “unmoded” transformation. 4.1 Transformation Roughly, the moded transformation takes a clause with predicates having one input argument place and one output argument place, disposes of the pass-on variables (the Πj ’s) by adding a stack, and replaces both arguments of each subgoal by variables. Hence, the first apparent obstacle we find in trying to convert an arbitrary, unmoded clause into chain form, is that arguments of predicates in such a clause do 16 David A. Rosenblueth not have predetermined input/output roles. The fact that any argument of a predicate may play the role of either input or output suggests treating all arguments uniformly. One way of doing so and yet have binary predicates could be to replicate the arguments of each predicate so as to have two copies of each set of arguments: one copy behaving as a single input (possibly having variables when the subgoal is selected), and the other copy behaving as a single output. Naturally, we now have to give up the groundness property of runtime terms, which translates to having to use full unification instead of matching. Thus, we can associate with each predicate p(X1 , . . . , Xn ), another predicate, defined as: p̂(hX1 , . . . , Xn i, hX1 , . . . , Xn i) ← p(X1 , . . . , Xn ), which denotes a subset of the identity relation of the Herbrand universe. But we also have to add the stack, so that we have: p̂(hSt, X1 , . . . , Xn i, hSt, X1 , . . . , Xn i) ← p(X1 , . . . , Xn ). Another decision we have to make is which variables to push onto the stack. In fact, we could push all variables of the clause, but we will be more economical by pushing only the variables not occurring in all atoms of the clause. Example 4 Consider the usual append program: a([ ], L, L) ← (20) a([A|L], M , [A|N ]) ← a(L, M , N ) (21) First we write the if-part of the definition of â: â(hSt, X , Y , Z i, hSt, X , Y , Z i) ← a(X , Y , Z ) (22) We now apply equation introduction to (22), getting: â(hSt, X , Y , Z i, hSt′ , X ′ , Y ′ , Z ′ i) ← St = St′ , X = X ′ , Y = Y ′ , Z = Z ′ , a(X ′ , Y ′ , Z ′ ) (23) which we will need for a later folding application. Next, we obtain an instance of (22), to which we apply equation introduction: â(hSt, [A|L], M , [A|N ]i, hSt′ , [A′ |L′ ], M ′ , [A′ |N ′ ]i) ← St = St′ , A = A′ , L = L′ , M = M ′ , N = N ′ , a([A′ |L′ ], M ′ , [A′ |N ′ ]) Now we resolve (21) with (24) unifying the two underlined atoms, and get: â(hSt, [A|L], M , [A|N ]i, hSt′ , [A′ |L′ ], M ′ , [A′ |N ′ ]i) ← St = St′ , A = A′ , L = L′ , M = M ′ , N = N ′ , a(L′ , M ′ , N ′ ) Subsequently, we fold using function substitutivity. â(hSt, [A|L], M , [A|N ]i, hSt′ , [A′ |L′ ], M ′ , [A′ |N ′ ]i) ← [A|St] = [A′ |St′ ] , L = L′ , M = M ′ , N = N ′ , a(L′ , M ′ , N ′ ) (24) Chain Programs for Writing Deterministic Metainterpreters 17 Finally, we fold using (23) and systematically rename variables. â(hSt0 , [A0 |L0 ], M0 , [A0 |N0 ]i, hSt1 , [A1 |L1 ], M1 , [A1 |N1 ]i) ← â(h[A0 |St0 ], L0 , M0 , N0 i, h[A1 |St1 ], L1 , M1 , N1 i) We can now apply predicate substitutivity and symmetry, and then fold w.r.t. the completed definitions of the predicates manipulating the stack, as in the moded transformation, thus arriving at chain form. End of example An arbitrary definite program can be converted into chain form with the following theorem. Theorem 2 Let C be a definite clause: p(t̃0 ) ← q1 (t̃1 ), q2 (t̃2 ), . . . , qn (t̃n ) n ≥0 and let:   Π = var(t̃0 ) ∪ · · · ∪ var(t̃n ) \ var(t̃0 ) ∩ · · · ∩ var(t̃n ) Then the clause C ′ : p̂(U0 , Un′ ) ← h0 (U0 , U0′ ), q̂1 (U0′ , U1 ), h1 (U1 , U1′ ), q̂2 (U1′ , U2 ), . . . , ′ q̂n (Un−1 , Un ), hn (Un , Un′ ) is logically implied by C , the standard equality theory for C , the “iff” version of the function substitutivity axiom for the list-constructor function symbol: [X |Y ] = [X ′ |Y ′ ] ↔ X = X ′ & Y = Y ′ and the completed definitions of: p̂(hSt, X1,0 , . . . , Xr0 ,0 i, hSt, X1,0 , . . . , Xr0 ,0 i) ← p(X1,0 , . . . , Xr0 ,0 ) q̂i (hSt, X1,i , . . . , Xri ,i i, hSt, X1,i , . . . , Xri ,i i) ← qi (X1,i , . . . , Xri ,i ) h0 (hSt|t̃0 i, hΣ|t̃1 i) ← hi (hΣ|t̃i i, hΣ|t̃i+1 i) ← hn (hΣ|t̃n i, hSt|t̃0 i) ← i = 1, . . . , n (i = 0) i = 1, . . . , n − 1 (i = n) where Σ is any list of the form [X1 , . . . , Xd |St], such that {X1 , . . . , Xd } = Π, if Π 6= ∅, and Σ is St if Π = ∅. Proof First, we use equation introduction on the definitions of the q̂i ’s. ′ q̂i (hSt, X1,i , . . . , Xri ,i i, hSt′ , X1,i , . . . , Xr′i ,i i) ← St = St′ , ′ X1,i = X1,i , . . . , Xri ,i = Xr′i ,i , ′ qi (X1,i , . . . , Xr′i ,i ) i = 1, . . . , n (25) 18 David A. Rosenblueth Next, we apply equation introduction to C in such a way that no two t̃i ’s have variables in common, except for t̃0 and t̃n . We obtain: p(t̃0 σn ) ← E , q1 (t̃1 σ1 ), q2 (t̃2 σ2 ), . . . , qn (t̃n σn ) (26) where the σj ’s are as in Theorem 1 and  E = {X σj = X σk : X ∈ var(t̃j ) ∩ var(t̃k ) & 0 < j < k < n}   ∪ {X σj = X σn : X ∈ var(t̃j ) ∩ var(t̃0 ) ∪ var(t̃n ) & 0 < j < n} Now, we apply θ to the if-part of the definition of p̂, where θ is the mgu of p(X1,0 , . . . , Xr0 ,0 ) and p(t̃0 ) and use equation introduction in the resulting instance, getting (up to variable renaming): p̂(hSt0 |t̃0 σ0 i, hStn |t̃0 σn i) ← St0 = Stn , F , p(t̃0 σn ) (27) where F = {X σ0 = X σn : X ∈ var(t̃0 )} Subsequently, we resolve (26) with (27): p̂(hSt0 |t̃0 σ0 i, hStn |t̃0 σn i) ← St0 = Stn , F , E , q1 (t̃1 σ1 ), q2 (t̃2 σ2 ), . . . , qn (t̃n σn ) Before folding, we add the following equations, recalling that subgoal addition preserves soundness:  {X σ0 = X σn : X ∈ Π \ var(t̃0 ) } (Such equations, after applying transitivity, will enable us to have the same Σ in each subgoal of the resulting clause in prechain form.) Now we add the equations: {X σi−1 = X σi : X ∈ var(t̃i )} 0<i ≤n (Such equations will enable us to fold w.r.t. (25).) We now apply transitivity and factoring in such a way that the equations are replaced by (up to variable renaming): [ [ {St0 = St1 , St1 = St2 , . . . , Stn−1 = Stn } ∪ Gi ∪ Hi 0<i≤n 0<i≤n where Gi = {X σi−1 = X σi : X ∈ Π} Hi = {X σi−1 = X σi : X ∈ var(t̃i )} Next, we repetitively fold using function substitutivity and arrive at: p̂(hSt0 |t̃0 σ0 i, hStn |t̃0 σn i) ← Σσ0 = Σσ1 , Σσ1 = Σσ2 , . . . , Σσn−1 = Σσn , t̃1 σ0 ∼ = t̃n σn , = t̃2 σ2 , . . . , t̃n σn−1 ∼ = t̃1 σ1 , t̃2 σ1 ∼ q1 (t̃1 σ1 ), q2 (t̃2 σ2 ), . . . , qn (t̃n σn ) 19 Chain Programs for Writing Deterministic Metainterpreters where r̃ ∼ = s̃ = {r i = s i : r i is the i th term of r̃ and s i is the i th term of s̃} Prechain form is now obtained by folding with (25): p̂(hSt0 |t̃0 σ0 i, hStn |t̃0 σn i) ← q̂1 (hΣσ0 |t̃1 σ0 i, hΣσ1 |t̃1 σ1 i), q̂2 (hΣσ1 |t̃2 σ1 i, hΣσ2 |t̃2 σ2 i), . . . , q̂n (hΣσn−1 |t̃n σn−1 i, hΣσn |t̃n σn i) Finally, we apply predicate substitutivity and symmetry, and then fold with the completed definitions of the hi predicates. The resulting clause has the desired form; hence we conclude that the theorem holds. As in the moded transformation, that P is logically implied by a conservative extension of P̂ can be seen by unfolding the definitions of the hi ’s and the q̂i ’s. 4.2 A deterministic metainterpreter for arbitrary chain programs In Sect. 2 we wrote a deterministic metainterpreter assuming that the leftmost input in every goal of the LD tree (Apt 1997) (i.e. an SLD tree with a leftmost computation rule) was ground. We will now modify such a metainterpreter so that it is also correct for LD trees that do not necessarily have this groundness property. It is possible to handle terms with variables by generalising matching to full unification. A well-known metainterpreter explicitly using unification is Bowen and Kowalski’s demo metainterpreter (Bowen and Kowalski 1982). In our case, unification for clauses of the form (1) reduces to argument passing so that we need only incorporate it to the clauses of the form (2). Consider for instance our previous definition of e ′ , which included the clause: e ′ (X , Pj, [Y ]) ← unit(Pj, X , Y ) Following the demo metainterpreter, we would replace this clause by: e ′ (X , Pj, [Y ]) ← unit(Pj, X ′ , Y ′ ), rename(f (X ′ , Y ′ ), X , f (X ′′ , Y ′′ )), match(X , X ′′ , Sub), apply(Y ′′ , Sub, Y ) (28) where 1. rename(Z , X , Z ′ ) holds when Z ′ is the result of renaming the variables in Z so that they are distinct from the variables in X , 2. match(X , X ′′ , Sub) holds when Sub is the mgu of X and X ′′ , and 3. apply(Y ′′ , Sub, Y ) holds when Y is the result of applying Sub to Y ′′ . Prolog provides a way to approximate this effect through the extralogical copy “predicate”: e ′ (X , Pj, [Y ]) ← copy(X , Xθ), unit(Pj, Xθ, Y ) (29) 20 David A. Rosenblueth Note that our addition of unification to the abcde metainterpreter occurs at a single point, unlike the unifiers of the metainterpreter in Fig. 1, which are pervasive (cf. the variables with a θ in their name). 5 Extending Existing Committed-Choice Traversal Methods to Arbitrary Definite Programs This section deals first with a reconstruction and then with an extension of the existing stream-based (Tamaki 1987) and continuation-based (Ueda 1987) deterministic, exhaustive-traversal methods. An objective of these methods is that of executing or-parallel programs in committed-choice processors (which are and parallel). The existing versions of such methods are restricted to moded programs. Hence, our reconstruction uses our transformation of moded programs into G-chain form. The extension modifies such methods so as to make them applicable to arbitrary definite programs essentially by replacing the moded transformation of Sect. 3 by the definite transformation of Sect. 4. We fall short of proposing practical methods because we do not eliminate the layer of interpretation. One way of eliminating such a layer would be to feed the metainterpreter and the object program to a general-purpose partial evaluator such as Mixtus (Sahlin 1993). However, the resulting residual program may be enormous. Another possibility would be to compile away the layer of interpretation “by hand,” but we have not done so in the present work. 5.1 Reconstruction The derivations of both methods start from the abcde metainterpreter. For brevity, we will omit detailed derivations, and will only indicate how such derivations could be obtained. Also, instead of using difference lists as the original methods do, we will employ ordinary lists for clarity. 5.1.1 A chain-program reconstruction of the stream-based method As observed by Tamaki, programs originally having some degree of and parallelism may lose such a parallelism if we only capture their or parallelism. He thus treats clauses with and parallelism in a special way. For simplicity we will not be concerned with such a special treatment here, and will concentrate on the main component of this method, that converts or parallelism into and parallelism. We can obtain programs produced by the stream-based method if we unfold (7) using (8): a([X |Xs], [Q |Qs], YsZs) ← b ′ (X , Q , Ys), a(Ys, Qs, Ys′ ), a(Xs, [Q |Qs], Zs), append(Ys′ , Zs, YsZs) (30) Let us consider first how a chain program is transformed by the stream-based method. Perhaps the most interesting clause in the program produced by this Chain Programs for Writing Deterministic Metainterpreters 21 method is a clause associated with each subgoal qi+1 (Xi , Xi+1 ), which is of the form: ki ([X |Xs], YsZs) ← all qi+1 (X , Ys), ki+1 (Ys, Ys′ ), ki (Xs, Zs), append(Ys′ , Zs, YsZs) (31) where all qi+1 (x, ys) is intended to hold when ys is the set of answers to ← qi+1 (x, Y ). Observe first that all qi+1 (x, ys) has the same intended meaning as b ′ (x, qi+1 , ys). Next, it is easy to obtain (31) from (30) by identifying the ki predicate with the a predicate. The rest of the clauses resulting from transforming a chain program are readily obtainable from the abcde metainterpreter. Consider now an arbitrary moded program. The clause corresponding to (31) in this case is: ki (πi , [ti |Xs], YsZs) ← all qi+1 (ti′ , Ys), ki+1 (πi+1 , Ys, Ys′ ), ki (πi , Xs, Zs), append(Ys′ , Zs, YsZs) (32) where πj is any term such that var(πj ) = Πj , and Πj is as defined in Theorem 1. Recall now (30) and an object clause transformed by our moded transformation. A subgoal with an hi predicate symbol, when partially evaluated with the abcde metainterpreter, results in a subgoal of the form b ′ (X , hi , Ys), which can be easily unfolded away producing the following clause, similar to (32): a([hΣi |ti i|Xs], [Q |Qs], YsZs) ← b ′ (hΣi+1 |ti′ i, Q , Ys), a(Ys, Qs, Ys′ ), a(Xs, [Q |Qs], Zs), append(Ys′ , Zs, YsZs) (33) A difference between (32) and (33) is that the stream-based method uses a parameter πi in the ki predicates for recording the values of the Πi variables, whereas (33) keeps the Πi variables as part of each term hΣi |ti i. Even with this difference, the stream-based compiled program and the abcde metainterpreter follow the same search strategy. By using a separate parameter πi , however, the stream-based method is more economical because of exploiting the fact that only the hi predicates may modify the stack: all other predicates hold for relations with an output stack equal to the input stack. (To see this, observe the stack in the definitions of p̂, q̂i in Theorem 1.) Hence, we can compute all answers to a goal ← b ′ (hΣi+1 |ti′ i, Q , Ys), by first computing all answers to ← b ′ (ti′ , Q , Ws) and then affixing Σi+1 in front of each such answer, if Q is not an hi predicate: hSt|t i ; Q = St ⋄ (t ; Q ) (34) where X ⋄ Xs is the list obtained by concatenating all lists having X affixed in front of every list in Xs: X ⋄ [] = [] X ⋄ [Y |Ys] = [[X |Y ]|X ⋄ Ys] Let us first rewrite the stream-based clause (32) as: astream (Σi , [ti |Xs], [Q |Qs], YsZs) ← b ′ (ti′ , Q , Ys), astream (Σi+1 , Ys, Qs, Ys′ ), astream (Σi , Xs, [Q |Qs], Zs), append(Ys′ , Zs, YsZs) (35) 22 David A. Rosenblueth where the predicate astream (St , Xs, Qs, YsZs) is intended to hold iff (St ⋄ Xs) ; Qs = St ⋄ YsZs Hence, (35) asserts that:   Σi ⋄ [ti |Xs] ; (Q ; Qs) ⊇ Σi+1 ⋄ (ti′ ; Q ) ; Qs ++ Σi ⋄ Xs ; (Q ; Qs) (36) Here, and throughout this section, ⋄ binds stronger than “;”, and ++ denotes list concatenation. Let us now consider the abcde metainterpreter. For clarity, we rename variables in (33): a([hΣi |ti i|StXs], [Q |Qs], StYsZs) ← b ′ (hΣi+1 |ti′ i, Q , StYs), a(StYs, Qs, StYs′ ), a(StXs, [Q |Qs], StZs), append(StYs′ , StZs, StYsZs) (37) where a(StXs, Qs, StYsZs) holds when StXs ; Qs = StYsZs and the same stack Σi occurs in front of every element of StXs and StYsZs. Hence, (37) asserts that:   [hΣi |ti i|Σi ⋄ Xs] ; (Q ; Qs) ⊇ (hΣi+1 |ti′ i ; Q ) ; Qs ++ Σi ⋄ Xs ; (Q ; Qs) (38) By the definition of ⋄ and (34), we obtain (36) from (38). (Specifically, by the recursive equation in the definition of ⋄ we obtain the left-hand side and by (34) we obtain the right-hand side.) 5.1.2 A chain-program reconstruction of the continuation-based method Let us now turn our attention to the continuation-based method. Starting also from the abcde metainterpreter, we use the completed definitions of: c ′ a(X , Pjs, Qs, M ) ← c ′ (X , Pjs, L), a(L, Qs, M ) ′ ′ d a(X , Pj, Qs, M ) ← d (X , Pj, L), a(L, Qs, M ) (39) (40) where Qs acts like a list of “continuations,” and the underlined subgoals indicate a forthcoming unfolding application. First we unfold (39) using (9): c ′ a(X , [Pj|Pjs], Qs, M ) ← d ′ (X , Pj, L1 ), c ′ (X , Pjs, L2 ), append(L1 , L2 , L), a(L, Qs, M ) (41) Using now the identity  (X ; P1 ) ∪ . . . ∪ (X ; Pm ) ; Qs = (X ; P1 ; Qs) ∪ . . . ∪ (X ; Pm ; Qs) which follows from the right distributivity of composition over union, we rewrite (41) as: c ′ a(X , [Pj|Pjs], Qs, M ) ← d ′ (X , Pj, L1 ), a(L1 , Qs, M1 ) , c ′ (X , Pjs, L2 ), a(L2 , Qs, M2 ) , append(M1 , M2 , M ) (42) 23 Chain Programs for Writing Deterministic Metainterpreters where each rectangle indicates a forthcoming folding application. We can now fold (42) using the definitions of the d ′ a and c ′ a predicates: c ′ a(X , [Pj|Pjs], Qs, M ) ← d ′ a(X , Pj, Qs, M1 ), c ′ a(X , Pjs, Qs, M2 ), append(M1 , M2 , M ) (43) arriving at a clause of the continuation-based metainterpreter. Another interesting clause is obtained by unfolding (40) using (10): d ′ a(X , Pj, Qs′ , M ) ← nonunit(Pj, Qs), a ′ (X , Qs, L), a(L, Qs′ , M ) which we rewrite as: d ′ a(X , Pj, Qs′ , M ) ← nonunit(Pj, Qs), append(Qs, Qs′ , QsQs′ ), a ′ (X , QsQs′ , M ) This step can be justified using the associativity of composition: (X ; Qs) ; Qs′ = X ; (Qs ; Qs′ ) Figure 2 shows the resulting metainterpreter, where we have applied an unfolding step using the definition of e ′ . a ′ (X , [ ], [X ]) ← a ′ (X , [Q|Qs], Zs) ← defn(Q, Pjs), c ′ a(X , Pjs, Qs, Zs) c ′ a(X , [ ], Qs, [ ]) ← c ′ a(X , [Pj|Pjs], Qs, YsZs) ← d ′ a(X , Pj, Qs, Ys), c ′ a(X , Pjs, Qs, Zs), append(Ys, Zs, YsZs) d ′ a(X , Pj, Qs, Zs) ← is unit(Pj), unit(Pj, X , Y ), a ′ (Y , Qs, Zs) d ′ a(X , Pj, Qs, [ ]) ← is unit(Pj), not(unit(Pj, X , Y )) d ′ a(X , Pj, Qs′ , Zs) ← nonunit(Pj, Qs), append(Qs, Qs′ , QsQs′ ), a ′ (X , QsQs′ , Zs) Figure 2. A continuation-based, deterministic, exhaustive-traversal metainterpreter. 5.2 Unmoded versions of the stream-based and the continuation-based methods Having reconstructed the stream- and continuation-based methods through chain programs, we can now replace the moded transformation by the definite transformation. However, as in Sect. 4, we must also rename variables when using the unit predicate with either (28) or (29). 24 David A. Rosenblueth 6 Other Applications 6.1 Prolog as the continuation-based metainterpreter together with the definite transformation So far we have designed metainterpreters for performing traversals in committedchoice processors. Observe that just as committed-choice processors have deterministic bindings, so do standard (deterministic) imperative languages. This suggests the possibility of using our metainterpreters for describing search strategies in one such imperative language. In particular, we will see how to obtain an imperative implementation of Prolog’s search strategy by slightly modifying the continuationbased metainterpreter of Sect. 5 (Fig. 2). A difference between our previous metainterpreters and the standard implementations of Prolog is that whereas we perform exhaustive traversals, Prolog systems may or may not do so. However, we can easily modify the continuation-based metainterpreter so as to ask the user whether or not more answers are requested. Also, note that Prolog systems do not usually remember the answers to a query, allowing us to eliminate the answer list. a ′ (X , [ ], halt) ← write(X ), write(’ more? ’), read(n) a ′ (X , [ ], cont) ← a ′ (X , [Q |Qs], HaltCont) ← defn(Q , Pjs), c ′ a(X , Pjs, Qs, HaltCont) c ′ a(X , [ ], Qs, cont) ← c ′ a(X , [Pj|Pjs], Qs, HaltCont′ ) ← d ′ a(X , Pj, Qs, HaltCont), halt cont(X , Pjs, Qs, HaltCont, HaltCont′ ) d ′ a(X , Pj, Qs, HaltCont) ← is unit(Pj), unit(Pj, X , Y ), a ′ (Y , Qs, HaltCont) d ′ a(X , Pj, Qs, cont) ← is unit(Pj), not(unit(Pj, X , Y )) d ′ a(X , Pj, Qs′ , HaltCont) ← nonunit(Pj, Qs), append(Qs, Qs′ , QsQs′ ), a ′ (X , QsQs′ , HaltCont) halt cont(X , Pjs, Qs, halt, halt) ← halt cont(X , Pjs, Qs, cont, HaltCont) ← c ′ a(X , Pjs, Qs, HaltCont) This metainterpreter is meant for constructing ground terms. To obtain a true (pure) Prolog system, handling terms with variables, we would have to include variable renaming and unification in a manner similar to that of either (28) or (29). Deterministic metainterpreters for arbitrary definite programs can be written directly, without using our transformations, into chain form. (An example is the metainterpreter in Fig. 1.) The programmer, however, has to be aware of the set of unifiers of the children of a node in the derivation tree. By contrast, in our approach the programmer can write a metainterpreter without considering such Chain Programs for Writing Deterministic Metainterpreters 25 unifiers, except when using the unit predicate, in which case the object clause has no body, simplifying the treatment of unifiers. 6.2 A bounded-resource metainterpreter As a final application, we exhibit a bounded-resource metainterpreter. As usual, we will give a metainterpreter for chain programs. Our transformations of moded and definite programs into chain form make this metainterpreter applicable to programs that do not necessarily have chain form. The next variant of the abcde metainterpreter constructs at most one proof, and has an extra argument to indicate the amount of resources needed to construct such a proof. a ′ (X , [ ], ans(X ), 0) ← a ′ (X , [Q |Qs], Z , R + 1) ← defn(Q , Pjs), c ′ a(X , Pjs, Qs, Z , R) c ′ a(X , [ ], Qs, no ans, 0) ← c ′ a(X , [Pj|Pjs], Qs, Z , R + S ) ← d ′ a(X , Pj, Qs, Y , R), halt cont(X , Pjs, Qs, Y , Z , S ) d ′ a(X , Pj, Qs, Z , R) ← is unit(Pj), unit(Pj, X , Y ), a ′ (Y , Qs, Z , R) d ′ a(X , Pj, Qs, no ans, 0) ← is unit(Pj), not(unit(Pj, X , Y )) d ′ a(X , Pj, Qs′ , Z , R) ← nonunit(Pj, Qs), append(Qs, Qs′ , QsQs′ ), a ′ (X , QsQs′ , Z , R) halt cont(X , Pjs, Qs, ans(Y ), ans(Y ), 0) ← halt cont(X , Pjs, Qs, no ans, Z , S ) ← c ′ a(X , Pjs, Qs, Z , S ) This style of writing bounded-resource metainterpreters may be viewed as an alternative to that appearing in (Kowalski 1995, Kowalski and Sadri 1996). 7 Concluding Remarks 7.1 Contributions Some applications of metainterpreters have been neglected, perhaps because of being based on convoluted definitions. By comparison with the demo predicate, deterministic metainterpreters, for example, result especially elaborate, since the programmer must consider the set of unifiers of the children of a node in the derivation tree. Thus, metainterpreters for (1) converting or parallelism into and parallelism (Ueda 1987, Tamaki 1987), (2) describing search-strategies in logic-based, 26 David A. Rosenblueth state-oriented languages (Clark and van Emden 1981), and (3) simulating boundedresource reasoning (Kowalski 1995, Kowalski and Sadri 1996), have not received due attention. Compilation methods converting or parallelism into and parallelism have been developed first by Ueda (Ueda 1987) and then by Tamaki (Tamaki 1987). By studying these methods, we have identified chain programs as important for exhibiting the essence of such techniques. If we use chain programs as a stepping stone, then the methods of (Ueda 1987, Tamaki 1987) can be viewed as comprising two parts: a. conversion of a moded program into chain form, and b. application of partial deduction to a deterministic metainterpreter for chain programs. Our contribution to part (a) consisted first in having extracted from (Ueda 1987, Tamaki 1987) the implicit transformation that converts a moded program into an equivalent chain form. Next, by using a generalisation of this transformation, we have given another, “unmoded” transformation, that converts arbitrary definite programs into chain form. To part (b) we contributed by showing how to write deterministic metainterpreters for chain programs. One such metainterpreter served us first to reconstruct and then to extend to arbitrary (unmoded) definite programs the existing methods of (Ueda 1987, Tamaki 1987). Finally, we observed that deterministic metainterpreters have applications other than exhaustive traversals. We gave a metainterpreter that follows Prolog’s search strategy and another one that counts the number of steps in the search for a refutation (as opposed to the number of steps in the refutation). Our methodology for designing deterministic-traversal methods is then as follows: 1. Write a deterministic metainterpreter for chain programs ignoring unification. 2. Incorporate to the metainterpreter one of the transformations converting either moded or unmoded programs into chain form. 3. In case the unmoded transformation was selected, add renaming and unification to the metaclauses dealing with the object unit clauses. We observed that even after adding unification, we need only be concerned about substitutions at a single point of the chain-program metainterpreter, whereas in a metainterpreter written directly the unifiers are pervasive (cf. Fig. 1). 7.2 Performance study We have made a study illustrating how the performance of some programs is degraded as a result of transforming such programs into chain form. For this study, we used SICStus Prolog version 3.7.1, which we ran under RedHat Linux version 6.0. In this table and the next, the columns labeled A show the data for the source program and the columns labeled B show the data for the corresponding transformed program. First we exhibit the number of clauses and the program size (measured in bytes for compiled code). Chain Programs for Writing Deterministic Metainterpreters program num. clauses A B split (moded append) append (for splitting) quicksort, ord. lists quicksort, diff. lists 2 2 7 5 4 4 22 17 27 program size A B 445 440 1,405 1,066 1,051 1,168 5,833 5,871 Now we give the relative execution times (according to SICStus’ profile_data/4) and the memory requirements for the local and global stacks (according to SICStus’ statistics/0) for splitting a 100-element list into all its prefixes and suffixes and sorting the reverse of a sorted 100-element list with quicksort programs. program split (moded append) append (for splitting) quicksort, ord. lists quicksort, diff. lists execution time A B global+local stacks A B 26 26 2,360 2,007 32,760 32,760 147,720 81,900 571 636 7,539 5,788 32,760 32,760 1,310,400 1,179,360 7.3 Related work Our work stemmed from the continuation-based and the stream-based exhaustivetraversal methods. There are, however, various other publications studying deterministic traversals of search spaces within logic programming (Hirakawa, Chikayama and Furukawa 1984, Bansal and Sterling 1987, Codish and Shapiro 1987, Lichtenstein, Codish and Shapiro 1987, Shapiro 1987, Sato and Tamaki 1989b, Mariën and Demoen 1993). Of these contributions, (Mariën and Demoen 1993) has perhaps the closest motivation to ours: The authors sketch a reconstruction of the continuationbased method and give a metainterpreter of their exhaustive-search method (based on recomputation). Similarly, there are a number of transformations converting logic programs into a syntactically restricted form (Sato and Tamaki 1989a, Tarau and Boyer 1990, Tarau 1991). The one in (Sato and Tamaki 1989a) has in common with our work a connection with the continuation-based exhaustive-traversal method. These transformations differ from ours, however, in producing programs in which every clause is binary (i.e. has only one atom in the body). 7.4 Future work We have argued that writing deterministic metainterpreters is advantageous with our approach because this task amounts to that of describing an evaluation strategy 28 David A. Rosenblueth for relational expressions of the form: P = P1 ∪ P2 ∪ . . . ∪ Pm where each Pi is defined as: Pi = Q1 ; Q2 ; . . . ; Qn Evaluation strategies for expressions have a close connection with the implementation of functional programming languages (Peyton Jones 1987) and rewrite systems (Dershowitz and Jouannaud 1990). Investigating how different evaluation strategies for these relational expressions lead to different search strategies for spaces determined by chain programs would be one way of extending our contributions. During the presentation of our results, we came across the need for eliminating the layer of interpretation. Our work would have a greater practical impact if it were combined with an algorithmic elimination of such a layer, without producing an excessively large residual program. Chain programs have also proved to be useful in devising (Rosenblueth 1996, Rosenblueth and Peralta 1998) inference systems derived from context-free parsers, because we need only consider unification in the treatment of unit clauses and hence we need only modify the treatment of terminals. Studying other applications of chain programs where it might be helpful to relegate the role played by unifiers would be another avenue of research. Acknowledgments This work owes much to Carlos Velarde. He contributed with motivating discussions, he carefully read previous versions of this paper, and he spotted errors in the theorem proofs. We also thank the referees, whose comments substantially improved the presentation of these results. We gratefully acknowledge the facilities provided by IIMAS, UNAM. References Abramson, H. and Rogers, M. (eds) (1988). Meta-Programming in Logic Programming, MIT Press. Apt, K. and Turini, F. (eds) (1995). Meta-Logics and Logic Programming, MIT Press. Apt, K. R. (1997). From Logic Programming to Prolog, Prentice Hall. Bansal, A. K. and Sterling, L. (1987). Compiling generate-and-test programs to committedchoice AND-parallelism, Technical Report CES-87-13, Case Western Reserve University, Cleveland, Ohio, U.S.A. Blikle, A. (1977). A comparative review of some program verification methods, in J. Gruska (ed.), Mathematical Foundations of Computer Science 1977, Springer-Verlag, pp. 17–33. Lecture Notes in Computer Science No. 53. Bowen, K. A. and Kowalski, R. A. (1982). Amalgamating language and metalanguage in logic programming, in K. Clark and S.-A. Tärnlund (eds), Logic Programming, Academic Press, pp. 153–172. Chain Programs for Writing Deterministic Metainterpreters 29 Clark, K. and Gregory, S. (1985). Notes on the implementation of Parlog, The Journal of Logic Programming 1: 17–42. Clark, K. L. and van Emden, M. (1981). Consequence verification of flowcharts, IEEE Transactions on Software Engineering SE-7(1): 52–60. Codish, M. and Shapiro, E. (1987). Compiling or-parallelism into and-parallelism, in E. Shapiro (ed.), Concurrent Prolog. Collected Papers, Vol. 2, MIT Press, pp. 351– 382. de Bakker, J. and Meertens, L. (1975). On the completeness of the inductive assertion method, Journal of Computer and System Sciences 11: 323–357. Dershowitz, N. and Jouannaud, J.-P. (1990). Rewrite systems, in J. van Leeuwen (ed.), Handbook of Theoretical Computer Science, Vol. B, Elsevier Science Publishers B.V., pp. 243–320. Engelfriet, J. (1974). Simple Program Schemes and Formal Languages, Springer-Verlag. Lecture Notes in Computer Science No. 20. Gardner, P. and Shepherdson, J. (1992). Unfold/fold transformations of logic programs, in J.-L. Lassez and G. Plotkin (eds), Computational Logic. Essays in Honor of Alan Robinson, The MIT Press, pp. 565–583. Hirakawa, H., Chikayama, T. and Furukawa, K. (1984). Eager and lazy enumerations in Concurrent Prolog, in S.-Å. Tärnlund (ed.), Proc. Second International Logic Programming Conference, Uppsala, Sweden, pp. 89–100. Jiang, Y. (1994). Ambivalent logic as the semantic basis of metalogic programming: I, in P. V. Hentenryck (ed.), Proc. Eleventh International Conference on Logic Programming, pp. 387–401. Kowalski, R. A. (1990). Problems and promises of computational logic, in J. Lloyd (ed.), Computational Logic. Symposium Proceedings, Springer-Verlag, pp. 1–36. Kowalski, R. A. (1993). A springboard for information processing in the 21st century, ICOT Journal 38: 17–41. Pannel Discussion at the Fifth Generation Computer Systems Conference 1992. Kowalski, R. A. (1995). Using meta-logic to reconcile reactive with rational agents, in K. Apt and F. Turini (eds), Meta-Logics and Logic Programming, MIT Press, pp. 227– 242. Kowalski, R. and Sadri, F. (1996). Towards a unified agent architecture that combines rationality with reactivity, in D. Pedreschi and C. Zaniolo (eds), Proc. International Workshop on Logic in Databases, Springer-Verlag, San Miniato, Italy, pp. 137–149. Lecture Notes in Computer Science No. 1154. Lichtenstein, Y., Codish, M. and Shapiro, E. (1987). Representation and enumeration of Flat Concurrent Prolog computations, in E. Shapiro (ed.), Concurrent Prolog. Collected Papers, Vol. 2, MIT Press, pp. 197–210. Lloyd, J. (1987). Foundations of Logic Programming, 2nd edn, Springer-Verlag. Mariën, A. and Demoen, B. (1993). Findall without findall/3, in D. S. Warren (ed.), Proc. Tenth International Conference on Logic Programming, MIT Press, pp. 408–423. Pettorossi, A. and Proietti, M. (1994). Transformation of logic programs: Foundations and techniques, The Journal of Logic Programming 19, 20: 261–320. Peyton Jones, S. L. (1987). The Implementation of Functional Languages, Prentice Hall. Rosenblueth, D. A. (1996). Chart parsers as inference systems for fixed-mode logic programs, New Generation Computing 14(4): 429–458. Rosenblueth, D. A. (1998). An exhaustive-search method using layered streams obtained through a meta-interpreter for chain programs, Extended Abstracts of LOPSTR’98, Eighth International Workshop on Logic-based Program Synthesis and Transforma- 30 David A. Rosenblueth tion, 15–19 June 1998, Manchester, UK. Technical Report Series, Department of Computer Science, University of Manchester, ISSN 1361-6161. Report number UMCS-98-61. http://www.cs.man.ac.uk/cstechrep/titles98.html. A summary appeared in: Lecture Notes in Computer Science No. 1559, pp 322–324, Springer-Verlag, 1999. Rosenblueth, D. A. and Peralta, J. C. (1998). SLR inference: An inference system for fixed-mode logic programs, based on SLR parsing, The Journal of Logic Programming 34(3): 227–260. Safra, S. and Shapiro, E. (1986). Meta interpreters for real, in H. Kugler (ed.), Information Processing 86 IFIP, Elsevier Science Publishers B.V., North-Holland, pp. 532–557. Sahlin, D. (1993). Mixtus: An automatic partial evaluator for full Prolog, New Generation Computing 12: 7–51. Sato, T. and Tamaki, H. (1989a). Existential continuation, New Generation Computing 6(4): 421–438. Sato, T. and Tamaki, H. (1989b). First order compiler: A deterministic logic program synthesis algorithm, Symbolic Computation 8: 605–627. Sergot, M. (1982). A query-the-user facility for logic programming, in P. Degano and E. Sandewall (eds), Proc. European Conference on Integrated Interactive Computing Systems, North Holland, pp. 27–44. Shapiro, E. (1987). Or-parallel Prolog in Flat Concurrent Prolog, in E. Shapiro (ed.), Concurrent Prolog. Collected Papers, Vol. 2, MIT Press, pp. 415–441. Shapiro, E. Y. (1982). Algorithmic Program Debugging, MIT Press. Tamaki, H. (1987). Stream-based compilation of ground I/O Prolog into committed-choice languages, Proc. Fourth International Conference on Logic Programming, Melbourne, Australia, pp. 376–393. Tamaki, H. and Sato, T. (1984). Unfold/fold transformation of logic programs, Proc. Second International Logic Programming Conference, pp. 127–138. Tarau, P. (1991). Program transformations and WAM-support for the compilation of definite metaprograms, in A. Voronkov (ed.), Proc. Russian Conference on Logic Programming, Springer-Verlag, pp. 462–473. Lecture Notes in Artificial Intelligence No. 592. Tarau, P. and Boyer, M. (1990). Elementary logic programs, in P. Deransart and J. Maluszyński (eds), Proc. Programming Language Implementation and Logic Programming, Springer-Verlag, Linköping, Sweden, pp. 159–173. Lecture Notes in Computer Science No. 456. Ueda, K. (1987). Making exhaustive search programs deterministic, New Generation Computing 5: 29–44.
6cs.PL
MAP moving horizon state estimation with binary measurements arXiv:1804.02167v1 [cs.SY] 6 Apr 2018 Giorgio Battistelli, Luigi Chisci, Nicola Forti, Stefano Gherardini Abstract— The paper addresses state estimation for discretetime systems with binary (threshold) measurements by following a Maximum A posteriori Probability (MAP) approach and exploiting a Moving Horizon (MH) approximation of the MAP cost-function. It is shown that, for a linear system and noise distributions with log-concave probability density function, the proposed MH-MAP state estimator involves the solution, at each sampling interval, of a convex optimization problem. Application of the MH-MAP estimator to dynamic estimation of a diffusion field given pointwise-in-time-and-space binary measurements of the field is also illustrated and, finally, simulation results relative to this application are shown to demonstrate the effectiveness of the proposed approach. I. I NTRODUCTION Binary sensors, whose output just indicates whether the noisy measurement of the sensed variable (analog measurement) exceeds or not a given threshold, are frequently employed in monitoring and control applications [1]-[14]. The idea is that by a multitude of low-cost and low-resolution sensing devices it is possible to achieve the same estimation accuracy that a few (possibly a single one) expensive highresolution sensors could provide, with significant practical benefits in terms of ease of sensor deployment and minimization of communication requirements. The fact that a binary (threshold) measurement just conveys a minimal amount (i.e. a single bit) of information, while implying communication bandwidth savings and consequently greater energy efficiency, makes of paramount importance to fully exploit the little available information by means of smart estimation algorithms. In this respect, some work has recently addressed system identification [1]-[2], parameter [3][6] or state estimation [7]-[14] with binary measurements by following either a deterministic [1]-[2], [7]-[9] or a probabilistic [3]-[6], [10]-[14] approach. In a deterministic context, the available information is essentially concentrated at the sampling instants in which some binary measurement signal has switched value [7], [8]. As shown in [8], some additional information can be exploited in the other (non switching) sampling instants by penalizing values of the estimated quantity such that the corresponding predicted measurement is on the opposite side, with respect to a binary sensor reading, far away from the threshold. Nevertheless, it is clear that there is no or very little information available for estimation purposes whenever no or very few binary sensor switchings occur. Hence, a The authors are with Dipartimento di Ingegneria dell’Informazione (DINFO), Università degli Studi di Firenze, via di Santa Marta 3, {giorgio.battistelli,luigi.chisci,nicola.forti,stefano.gherardini}@unifi.it. S. Gherardini is also with Dipartimento di Fisica e Astronomia, Università degli Studi di Firenze, via G. Sansone 1, and Istituto Nazionale di Fisica Nucleare (INFN), Sezione di Firenze. possible way to achieve high estimation accuracy is to have many binary sensors measuring the same variable with different thresholds as this would clearly increase the number of switchings, actually emulating, when the number of sensors tends to infinity, the availability of a single continuous-valued (analog) measurement. Conversely, following a probabilistic approach, binary sensor readings could be exploited to infer information about the probability distribution of the variable of interest. To clarify this point, let us assume that a very large number of binary sensors of the same type (i.e. measuring the same variable with the same threshold) be available and the distribution of their measurement noise (e.g. Gaussian with zero mean and given standard deviation) be known. Then, thanks to the numerosity of measurements, the relative frequency of 1 (or 0) values occurring in the sensor readings could be considered as a reasonable estimate of the probability that the sensed variable is above (or below) the threshold and this, in turn, exploiting the knowledge of the measurement noise distribution allows to extract information about the location of the value of the sensed variable with respect to the threshold. If, for example, it is found that the binary measurement is equal to 1 for 70% of the sensors and Gaussian measurement noise is hypothesized, it turns out that the expected measurement of the sensed variable is above the threshold of an amount equal to 0.525 times the standard deviation of the measurement noise. Notice that if the sensors are noiseless, they all provide either 0 or 1 output and, paradoxically, in this case minimal information, i.e. that the sensed variable takes values in a semi-infinite interval (either below or above the threshold), is extracted from the set of binary measurements. The above arguments suggest that, adopting a probabilistic approach to estimation using binary measurements, the presence of measurement noise can be a helpful source of information. In other words, it can be said that noise-aided procedures can be devised for estimation with binary measurements by exploiting the fact that the measurement noise randomly shifts the analog measurement thus making possible to infer statistical information on the sensed variable. Relying on the above stated noise-aided paradigm, this paper presents a novel approach to recursive estimation of the state of a discrete-time dynamical system given binary measurements. The proposed approach is based on a movinghorizon (MH) approximation of the Maximum A-posteriori Probability (MAP) estimation and extends previous work [3]-[4] concerning parameter estimation to recursive state estimation. A further contribution of the paper is to show that for a linear system the optimization problem arising from the MH-MAP formulation turns out to be convex and, hence, practically feasible for real-time implementation. The rest of the paper is organized as follows. Section II introduces the MAP problem formulation of state estimation with binary measurements. Section III presents a MH approximation of MAP estimation, referred to as MHMAP algorithm, and analyzes the properties of the resulting optimization problem. Section IV discusses a possible application of the proposed approach to the dynamic estimation of a diffusion field from binary pointwise-in-space-and-time field measurements. Section V presents simulation results relative to the dynamic field estimation case-study. Finally, section VI concludes the paper with perspectives for future work. II. M AXIMUM A POSTERIORI STATE ESTIMATION WITH BINARY SENSORS The following notation will be used throughout the paper: col(·) denotes the matrix obtained by stacking its arguments one on top of the other; diag(m1 , . . . , mq ) denotes the diagonal matrix with diagonal entries m1 , . . . , mq ; 0n , 1n indicate the n−dimensional vectors, respectively, with all zero and unit entries. Let us consider the problem of recursively estimating the state of the discrete-time nonlinear dynamical system xt+1 zti = f (xt , ut ) + wt = hi (xt ) + vti , i = 1, . . . , l (1) (2) from a set of measurements provided by binary sensors  1, if zti ≥ τ i yti = gi (zti ) = (3) 0, if zti < τ i where xt ∈ Rn is the state to be estimated, ut ∈ Rm is a known input, and τ i is the threshold of the i−th binary l sensor. For the sake of simplicity, we define zt = col zti i=1 ∈ l Rl and yt = col yti i=1 ∈ Rl . The vector wt ∈ Rn is an additive disturbance affecting the system dynamics which accounts for uncertainties in the mathematical model, while l vt = col vti i=1 ∈ Rl is the measurement noise vector. Let N (µ, Σ) denote as usual the normal distribution with mean µ and variance Σ. The statistical behaviour of the system is characterized by x0 ∼ N (x0 , P−1 ), wt ∼ N (0, Q−1 ), vt ∼ N (0, R) (4) where: R = diag(r1 , . . . , r p ); E[w j w0k ] = 0 and E[v j v0k ] = 0 if j 6= k; E[w j v0k ] = 0, E[w j x00 ] = 0, E[v j x00 ] = 0 for any j, k. Notice from (2)-(3) that sensor i produces a binary measurements yti ∈ {0, 1} depending on whether the noisy system output zti is below or above the threshold τ i . According to the available probabilistic description (4), the problem of estimating the state of system (1) under the binary measurement model (2)-(3) is formulated hereafter in a Bayesian framework by resorting to a maximum a posteriori probability (MAP) criterion. In the remainder of this section, as a preliminary step, the full-information MAP state estimation problem is formulated. To this end, notice that each binary measurement yti provides intrinsically relevant information on the state xt which can be taken into account by means of the a posteriori probabilities p(yti |xt ). In particular, the binary measurement yti is a Bernoulli random variable such that, for any binary sensor i and any time instant t, the a posteriori probability p(yti |xt ) is given by i i p(yti |xt ) = p(yti = 1|xt )yt p(yti = 0|xt )1−yt (5) p(yti = 1|xt ) = F i (τ i − hi (xt )) (6) where and p(yti = 0|xt ) = 1 − p(yti = 1|xt ) , Φi (τ i − hi (xt )). The function F i (τ i − hi (xt )) is the complementary cumulative distribution function (CDF) of the random variable τ i − hi (xt ). Since vti ∼ N (0, ri ), the conditional probability p(yti = 1|xt ) = F i (τ i − hi (xt )) can be written in terms of the Qfunction as follows  i  Z ∞ 2 τ − hi (xt ) 1 −ui i i i 2r √ √ du = Q . e F (τ −h (xt )) = 2πri τ i −hi (xt ) ri (7) Let us now denote by Yt = col(y0 , . . . , yt ) the vector of all binary measurements collected up to time t and by Xt , col(x0 , . . . , xt ) the vector of the state trajectory. Further, let us denote by X̂t|t , col(x̂0|t , . . . , x̂t|t ) the estimates of Xt to be made at any stage t. Then, at each time instant t, given the a posteriori probability p(XN |YN ), the estimate of the state trajectory can be obtained by solving the following MAP estimation problem: X̂t|t = arg max p(Xt |Yt ) = arg min − ln p(Xt |Yt ). (8) Xt Xt From the Bayes rule p(Xt |Yt ) ∝ p(Yt |Xt ) p(Xt ), (9) where t−1 p(Xt ) = ∏ p(xt−k |xt−k−1 , . . . , x0 ) p(x0 ) k=0 t−1 (10) = ∏ p(xt−k |xt−k−1 ) p(x0 ). k=0 Notice that in the latter equation we have considered the Markov property for the dynamical system state. As x0 and wt are normally distributed vectors, we have 1 2 p(x0 ) ∝ e− 2 kx0 −x0 kP (11) − 12 kxk+1 − f (xk ,uk )k2Q p(xk |xk−1 ) ∝ e . (12) Moreover, the likelihood function p(Yt |Xt ) of the binary measurement vector Yt can be written as t t p(Yt |Xt ) = ∏ p(yk |xk ) = ∏ k=0 t =∏ l ∏ p(yik |xk ) k=0 i=1 l i ∏ F i (τ i − hi (xk ))yk i Φi (τ i − hi (xk ))1−yk k=0 i=1 (13) where in the latter equality we have exploited the statistical independence of the binary sensors. Accordingly, the loglikelihood is t l ln p(Yt |Xt ) = ∑ ∑  i yk ln F i (τ i − hi (xk )) (14) k=0 i=1 +(1 − yik ) ln Φi (τ i − hi (xk ))  , and the cost function − ln p(Xt |Yt ) = − ln p(Yt |Xt ) − ln p(Xt ) to be minimized in the MAP estimation problem (8) turns out to be, up to additive constant terms, t Jt (Xt ) = kx0 − x0 k2P + ∑ kxk+1 − f (xk , uk )k2Q + k=0 t −∑ l   ∑ yik ln F i (τ i − hi (xk )) + (1 − yik ) ln Φi (τ i − hi (xk )) . k=0 i=1 (15) Unfortunately, a closed-form expression for the global minimum of (15) does not exist and, hence, the optimal MAP estimate X̂t|t has to be determined by resorting to some numerical optimization routine. With this respect, the main drawback is that the number of optimization variables grows linearly with time, since the vector Xt has size (t + 1) n. As a consequence, as t grows the solution of the full information MAP state estimation problem (8) becomes eventually unfeasible, and some approximation has to be introduced. III. M OVING - HORIZON APPROXIMATION In this section, an approximate solution to the MAP state estimation problem is proposed by resorting to the MHE approach [15]-[21]. Accordingly, by defining a sliding window Wt = {t − N,t − N + 1, . . . ,t}, the goal is to find an estimate of the partial state trajectory Xt−N:t , col(xt−N , . . . , xt ) by using the information available in Wt . Then, in place of the full information cost Jt (Xt ), at each time instant t the minimization of the following moving-horizon cost is addressed: t JtMH (Xt−N:t ) = Γt−N (xt−N ) + ∑ kxk+1 − f (xk , uk )k2Q + k=t−N t − ∑ the present work, consists of assigning to the arrival cost a fixed structure penalizing the distance of the state xt−N at the beginning of the sliding window from some prediction x̄t−N computed at the previous time instant, thus making the estimation scheme recursive. A natural choice is then a quadratic arrival cost of the form l   ∑ yik ln F i (τ i − hi (xk )) + (1 − yik ) ln Φi (τ i − hi (xk )) k=t−N i=1 (16) where the non-negative initial penalty function Γt−N (xt−N ), known in the MHE literature as arrival cost [16], [19], is introduced so as to summarize the past data y0 , . . . , yt−N−1 not explicitly accounted for in the objective function. As a matter of fact, the form of the arrival cost plays an important role in the behavior and performance of the overall estimation scheme. While in principle Γt−N (xt−N ) could be chosen so that minimization of (16) yields the same estimate that would be obtained by minimizing (15), an algebraic expression for such a true arrival cost seldom exists, even when the sensors provide continuous (non-binary) measurements [16]. Hence, some approximation must be used. With this respect, a common choice [18], [19], also followed in Γt−N (xt−N ) = kxt−N − x̄t−N k2Ψ , (17) which, from the Bayesian point of view, corresponds to approximating the PDF of the state xt−N conditioned to all the measurements collected up to time t − 1 with a Gaussian having mean x̄t−N and covariance Ψ−1 . As for the choice of the weight matrix Ψ, in the case of continuous measurements it has been shown that stability of the estimation error dynamics can be ensured provided that Ψ is not too large (so as to avoid an overconfidence on the available estimates) [18], [19]. Recently [8], similar results have been proven to hold also in the case of binary sensors in a deterministic context. In practice, Ψ can be seen as a design parameter which has to be tuned by pursuing a suitable tradeoff between such stability considerations and the necessity of not neglecting the already available information (since in the limit for Ψ going to zero the approach becomes a finite memory one). Summing up, at any stage t = N, N + 1, . . ., the following problem has to be solved. Problem Et : Given the prediction x̄t−N , sequence {ut−N , . . . , ut−1 }, the measurement i {yt−N , . . . , yti , i = 1, . . . , l}, find the optimal x̂t−N|t , . . . , x̂t|t that minimize the cost function arrival cost (17). the input sequences estimates (16) with Concerning the propagation of the estimation procedure from Problem Et−1 to Problem Et , the prediction x̄t−N is set equal to the value of the estimate of xt−N made at time instant t − 1, i.e., x̄t−N = x̂t−N|t−1 . Clearly, the recursion is initialized with the a priori expected value x̄0 of the initial state vector. In general, solving Problem Et entails the solution of a non-trivial optimization problem. However, when both equations (1) and (2) are linear, the resulting optimization problem turns out to be convex so that standard optimization routines can be used in order to find the global minimum. To see this, let us consider the following assumption. A1 The functions f (·) and hi (·), i = 1, . . . , l, are linear, i.e., f (xt , ut ) = Axt + But and hi (xt ) = Ci xt , i = 1, . . . , l, where A, B, Ci are constant matrices of suitable dimensions. Proposition 1: If assumption A1 holds, the CDF Φi (τ i − and its complementary function F i (τ i −Ci xt ) are logconcave. Hence, the cost function (16) with arrival cost (17) is convex.  Ci xt ) Remark 1: Under assumption A1, the convexity of the cost function (16) is guaranteed also in the more general case in which the statistical behaviour of the random variables x0 , wt , vt is described by logarithmically concave distribution functions. Indeed, if a PDF is log-concave, also its cumulative distribution function is log-concave; hence the contribution related to the binary measurements in (16) turns out to be convex. In the next section we will focus on the case of a discretetime linear system, in particular considering a diffusion process governed by a partial differential equation (PDE) and spatially discretized by means of the finite element method (FEM). IV. DYNAMIC FIELD ESTIMATION In this section, we consider the problem of reconstructing a two-dimensional diffusion field, sampled with a network of binary sensors arbitrarily deployed over the spatial domain of interest Ω. The diffusion process is governed by the following parabolic PDE: ∂c − λ ∇2 c = 0 in Ω ∂t (18) which models various physical phenomena such as the spread of a pollutant in a fluid. In this case, c(ξ , η,t) represents the space-time dependent substance concentration, λ denotes the constant diffusivity of the medium, and ∇2 = ∂ 2 /∂ ξ 2 + ∂ 2 /∂ η 2 is the Laplace operator, (ξ , η) ∈ Ω being the 2D spatial variables. Furthermore, let us assume mixed boundary conditions, i.e. a non-homogeneous Dirichlet condition c=ψ on ∂ ΩD , Accordingly, the unknown function c(ξ η,t) is approximated as c(ξ , η,t) ≈ where υ is the outward pointing unit normal vector of ∂ ΩN . The objective is to estimate the values of the dynamic field of interest c(ξ , η,t), given the binary measurements (3). The PDE system (18)-(20) is simulated with a mesh of finite elements over Ω via the Finite Element (FE) approximation described in [22]-[23]. Specifically, the domain Ω is subdivided into a suitable set of non overlapping regions, or elements, and a suitable set of basis functions φ j (ξ , η), j = 1, . . . , nφ is defined on such elements. The choices of the basis functions φ j and of the elements are key points of the FE method. In the specific case under investigation, the elements are triangle in 2D and define a FE mesh with vertices (ξ j , η j ) ∈ Ω, j = 1, . . . , nφ . Then each basis function φ j is a piece-wise affine function which vanishes outside the FEs around (ξ j , η j ) and such that φ j (ξ j , η j ) = δi j , δi j denoting the Kronecker delta. In order to account for the mixed boundary conditions, the basis functions are supposed to be ordered so that the first n correspond to vertices of the mesh which lie either in the interior of Ω or on ∂ ΩN , while the last nφ − n correspond to the vertices lying on ∂ ΩD . ∑ φ j (ξ , η) c j (t) + ∑ φ j (ξ , η) ψ j (t) (21) j=n+1 j=1 where c j (t) is the unknown expansion coefficient of the function c(ξ η,t) relative to time t and basis function φ j (ξ , η), and ψ j is the known expansion coefficient of the function ψ(ξ η) relative to to the basis function φ j (ξ , η). Notice that the second summation in (21) is needed so as to impose the non-homogeneous Dirichlet condition (19) on the boundary ∂ ΩD . The PDE (18) can be recast into the following integral form: Z Z ∂c ϕ dξ dη − λ ∇2 c ϕ dξ dη = 0 (22) Ω Ω ∂t where ϕ(ξ , φ ) is a generic space-dependent weight function. By applying Green’s identity, one obtains: Z Z Z ∂c ∂c ϕ dξ dη +λ ∇T c ∇ϕ dξ dη −λ ϕ dξ dη = 0 . Ω ∂t Ω ∂Ω ∂ υ (23) By choosing the test function ϕ equal to the selected basis functions and exploiting the approximation (21), the Galerkin weighted residual method is applied and the following equation is obtained n n Z ∑ i=1 Ω φi φ j dξ dη ċi (t) + λ ∑ +λ Z ∇T φi ∇φ j dξ dη ci (t) i=1 Ω nφ (19) which specifies a constant-in-time value of concentration on the boundary ∂ ΩD , and a homogeneous Neumann condition on ∂ ΩN = ∂ Ω \ ∂ ΩD , assumed impermeable to the contaminant, so that ∂ c/∂ υ = 0 on ∂ ΩN , (20) nφ n ∑ Z ∇T φi ∇φ j dξ dη ψi (t) = 0 (24) i=n+1 Ω for j = 1, . . . , n. Notice that in the latter equation the boundary integral of equation (23) is omitted since it is equal to 0 thanks to the homogeneous Neumann condition (20) on ∂ ΩN and to the fact that, by construction, the basis functions φ j , j = 1, . . . , n vanish on ∂ ΩD . The interested reader is referred to [24] for further details on the FEM theory, and in particular on how to convert the case of inhomogeneous boundary conditions to the homogeneous one. By defining the state vector x = col(c1 , . . . , cn ) and the vector of boundary conditions γ = col(ψn+1 , . . . , ψnφ ), equation (24) can be written in the more compact form M ẋ(t) + Sx(t) + SD γ = 0 where S is the so-called stiffness matrix representing diffusion, M is the mass matrix, and SD captures the physical interconnections among the vertices affected by boundary condition (19) and the remaining nodes of the mesh. By applying for example the implicit Euler method, the latter equation can be discretized in time, thus obtaining the the linear discrete-time model xt+1 = A xt + B u + wt where  −1 A = I + δt M −1 S  −1 −1 B = I + δt M −1 S M δt u = −SD γ (25) δt is the time integration interval, and wt is the process disturbance taking into account also the space-time discretization errors. Notice that the linear system (25) has dimension n equal to the number of vertices of the mesh not lying on ∂ ΩD . The linear system (25) is assumed to be monitored by a network of l threshold sensors. Each sensor, before binary quantization is applied, directly measure the pointwise-in-time-andspace concentration of the contaminant in a point of the spatial domain Ω. By exploiting (21), such a concentration can be written as a linear combination of the concentrations on the grid points, so that the resulting output function takes the form zti = Ci xt + vti , i = 1, . . . , l (26) 3 2.5 η 2 1.5 1 0.5 0 0 1 2 3 ξ and assumption A1 is fulfilled. Fig. 2. Mesh used by the MAP-MHE estimator (152 elements, 97 nodes). V. N UMERICAL RESULTS RMSE in concentration (g/m2) 6 In this section, we present the simulation results of the proposed approach applied to the problem of state estimation of spatially distributed processes, discussed in the previous section. We consider the simulated system (25)-(26) with 1695 triangular elements, 915 vertices, λ = 0.01 [m2 /s], fixed integration step length δt = 1 [s], γ = 30 [g/m2 ], and initial condition of the field vector x0 = 0n [g/m2 ]. The field of interest is defined over a bounded 2D spatial domain Ω which covers an area of 7.44 [m2 ] (see Fig. 1), with boundary condition (19) on the bottom edge and no-flux condition (20) on the remaining portions of ∂ Ω. Compared to the 5 4 3 2 1 0 0 200 400 600 800 1000 1200 Time (s) Fig. 3. RMSE in concentration of the MAP-MHE state estimator as a function of time, for a random network of 5 threshold sensors. Fig. 1. Concentration field at time t = 100 [s] monitored by a random network of 20 binary sensors (red ◦). ground truth simulator, the proposed MH-MAP estimator implements a coarser mesh (see Fig. 2) of 97 nodes (n = 89, d = 8), and runs at a slower sample rate (0.1 [Hz]), so that model uncertainty is taken into account. The initial condition of the estimated dynamic field is set to x0 = 5 1n [g/m2 ], the moving window has size N = 5, and the weight matrices in (4) are chosen as Ψ = 103 In and Q = 102 In . The true concentrations from (25) are first corrupted with a Gaussian noise with variance ri , then binary observations are obtained by applying a different threshold τ i for each sensor i of the network. Note that, in order to receive informative binary measurements, τ i , i = 1, ..., l are generated as uniformly distributed random numbers in the interval (0.05, 29.95), being (0, 30) the range of nominal concentration values throughout each experiment. The duration of each simulation experiment is fixed to 1200 [s] (120 samples). Fig. 3 shows the performance of the novel MH-MAP state estimator implemented in MATLAB, in terms of Root Mean Square Error (RMSE) of the estimated concentration field, i.e.: !1 2 α ket, j k2 RMSE(t) = ∑ , (27) α j=1 where ket, j k is the norm of the estimation error at time t in the j−th simulation run, averaged over 304 sampling points (evenly spread within Ω) and α = 100 independent Monte Carlo realizations. The estimation error is computed at time t on the basis of the estimate x̂t−N|t . It can be observed that the proposed estimator successfully estimates the dynamic field, even when observed by a network of l = 5 randomly deployed binary sensors, with ri = 0.25 [g/m2 ] ∀i = 1, ..., l. The effect of measurement noise on the mean value of the RMSE can be seen in Fig. 4, in which it becomes apparent 0.78 A PPENDIX RMSE in concentration 0.77 0.76 0.75 0.74 0.73 0.72 0.71 0.7 10-4 10-3 10-2 10-1 100 ri Fig. 4. RMSE in concentration as a function of the measurement noise variance, for a fixed constellation of 20 binary sensors. It is shown here that operating in a noisy environment turns out to be beneficial, for certain values of ri , to the state estimation problem. f (b(x)) ∂ b(x) where a(x) and b(x) are arbitrary functions ∂x of x, the first and the second derivatives of the function F i (τ i −Ci xt ) with respect to xt are, respectively, equal to 0.72 RMSE in concentration Proof of Proposition 1: Under assumption A1, the cost function (16) is convex if and only if F i (τ i − Ci xt ) and Φi (τ i − Ci xt ) are log-concave functions, ∀i = 1, . . . , p. A function f : Rn → R is log-concave if f (x) > 0 for all x in its domain and ln f (x) is concave [25], namely   2   1 ∂ f (x) 0 ∂ f (x) ∂ f (x) 2 f (x) − < 0. ∇ ln f (x) = 2 f (x) ∂ x2 ∂x ∂x (28) Let us now consider the CDF Φi (τ i − Ci xt ) and its complementary function F i (τ i −Ci xt ), that are positive functions for all dti , τ i −Ci xt , i = 1, . .. , l. From thefundamental theoR a(x) rem of calculus, namely ∂∂x b(x) f (x)dx = f (a(x)) ∂ a(x) ∂x − 0.715 Ci − (τ i −Cii xt )2 ∂ F i (τ i −Ci xt ) 2r e =√ ∂ xt 2πri 0.71 (29) 0.705 and 0.7 0.695 5 (τ i −Ci xt )2 ∂ 2 F i (τ i −Ci xt ) (Ci )0Ci i − i 2ri √ (τ −C x )e . = t ∂ xt2 ri 2πri 10 20 30 (30) 50 Number of sensors Fig. 5. RMSE of the concentration estimates as a function of the number of sensors deployed over the monitoring area. how for certain values of ri , including an observation noise with higher variance, can actually improve the quality of the overall estimates. The results in Fig. 4 numerically demonstrates the validity of the above stated noise-aided paradigm in the recursive state estimation with binary measurements and, thus, represents an interesting contribution of this work. Finally, Fig. 5 shows the evolution of the RMSE as a function of the number of binary observations available at the fusion center. If τ i − Ci xt ≤ 0, then State estimation with binary sensors has been formulated as a Moving Horizon (MH) Maximum A posteriori Probability (MAP) optimization problem and it has been shown how such a problem turns out to be convex in the linear system case. Simulation results relative to a dynamic field estimation case-study have exhibited the conjectured noise-aided feature of the proposed estimator in that the estimation accuracy improves, starting from a null measurement noise, until the variance of the latter achieves an optimal value beyond which estimation performance deteriorates. Future work on the topic will concern stability properties of the MH-MAP state estimator and its application to target tracking with binary proximity sensors. ≤ 0. Hence ∂ 2Fi i F ≤ ∂ x2 i F is log- 0 and, from (28), it follows that the Q-function concave. Conversely, if τ i −Ci xt > 0, the log-concavity of F i depends on the sign of the term  i 0  i  ∂ 2Fi i ∂F ∂F F − = 2 ∂x ∂x ∂x     Z ∞ i −Ci x )2 2 (τ (τ i −Ci xt )2 t −ui − (Ci )0Ci − τ i −Ci xt i i 2r 2r 2r e e du − e . 2πri ri τ i −Ci xt From the convexity properties of the function f (x) = x2 /2, it can be easily verified for any variable s, k that s2 /2 ≥ 2 2 −k2 /2+sk, and hence e−s /2 ≤ e−sk+k /2 [25]. Then, if k > 0, it holds that Z ∞ VI. C ONCLUSIONS AND FUTURE WORK ∂ 2 F i (τ i −Ci xt ) ∂ xt2 2 e − s2 ds ≤ Z ∞ 2 e −sk+ k2 k k k2 e− 2 ds = . k Since τ i −Ci xt > 0, with a simple change of variable, it can be stated that Z ∞  2 (τ i −Ci xt )2 τ i −Ci xt −ui − 2r du 2ri e ≤ e , (31) ri τ i −Ci xt proving, as a consequence, the log-concavity of the Qfunction F i (τ i −Ci xt ). By using the complement rule, the cumulative distribution function can be written as Φi (τ i − Ci xt ) = 2 i i ix ) 2 i i ix ) t t 1 − F i (τ i − Ci xt ) ≥ 0 and ∂ Φ (τ∂ x−C = − ∂ F (τ∂ x−C . If 2 2 2 i t t τ i −Ci xt > 0, then ∂∂ xΦ2 Φi < 0 such that Φi is log-concave. In the remaining case, i.e. τ i − Ci xt ≤ 0, noting that i i 2 2 τ −C (xt ) ∞ 1 1 −u −u Φi = √ e 2ri du = √ e 2ri du, 2πri −∞ 2πri −(τ i −Ci xt ) it can be observed that the sign of the term  i 0  i  (τ i −Ci xt )2 (Ci )0Ci − ∂Φ ∂ 2 Φi i ∂Φ 2ri Φ − = e i 2 ∂x ∂x 2πr ∂x  Z ∞   2 (τ i −Ci xt )2 −ui − −(τ i −Ci xt ) i 2r × e 2r du − e ri Z Z −(τ i −Ci xt ) is negative, thus proving the log-concavity of the CDF Φi (τ i −Ci xt ) and the convexity of the whole cost function.  R EFERENCES [1] L.Y. Wang, J.F. Zhang, and G.G. Yin, “System identification using binary sensors”, IEEE Transactions on Automatic Control, vol. 48, no. 11, pp. 1892–1907, 2003. [2] L.Y. Wang, G.G. Yin, and J.F. Zhang, “Joint identification of plant rational models and noise distribution functions using binary-valued observations”, Automatica, vol. 42, no. 4, pp. 543-547, 2006. [3] B. Ristic, A. Gunatilaka and R. Gailis, “Achievable accuracy in Gaussian plume parameter estimation using a network of binary sensors”, Information Fusion, vol. 25, pp. 42-48, 2015. [4] S. Vijayakumaran, Y. Levinbook and T.F. Wong, “Maximum likelihood localization of a diffusive point source using binary observations”, IEEE Transactions on Signal Processing, vol. 55, no. 2, pp. 665–676, 2007. [5] A. Ribeiro and G. B. Giannakis, “Bandwidth-constrained distributed estimation for wireless sensor networks - part I: Gaussian case”, IEEE Transactions on Signal Processing, vol. 54, no. 3, pp. 1131–1143, 2006. [6] A. Ribeiro and G. B. Giannakis, “Bandwidth-constrained distributed estimation for wireless sensor networks - part II: unknown probability density function”, IEEE Transactions on Signal Processing, vol. 54, no. 7, pp. 2784–2796, 2006. [7] L.Y. Wang, C. Li, G.G. Yin, L. Guo, and C.-Z. Xu, “State observability and observers of linear-time-invariant systems under irregular sampling and sensor limitations”, IEEE Transactions on Automatic Control, vol. 56, no. 11, pp. 2639–2654, 2011. [8] G. Battistelli, L. Chisci and S. Gherardini, “Moving horizon state estimation for discrete-time linear systems with binary sensors”, accepted at the 54th IEEE Conference on Decision and Control, Osaka, Japan, 2015. [9] Er-wei Bai, H. E. Baidoo-Williams, R. Mudumbai and S. Dasgupta “Robust tracking of piecewise linear trajectories with binary sensor networks”, Automatica, vol. 61, pp. 134-145, 2015. [10] J. Aslam, Z. Butler, F. Constantin, V. Crespi, G. Cybenko, and D. Rus, “Tracking a moving object with a binary sensor network”, Proc. 1st ACM Conf. on Embedded Networked Sensor Systems, pp. 150–161, Los Angeles, USA, 2003. [11] P.M. Djuric, M. Vemula and M.F. Bugallo, “Signal processing by particle filtering for binary sensor networks”, Proc. Digital Signal Processing Workshop, pp. 263–267, 2004. [12] P.M. Djuric, M. Vemula and M.F. Bugallo, “Target tracking by particle filtering in binary sensor networks”, IEEE Transactions on Signal Processing, vol. 56, no. 6, pp. 2229–2238, 2008. [13] J. Teng, H. Snoussi and C. Richard, “Decentralized variational filtering for simultaneous sensor localization and target tracking in binary sensor networks”, IEEE Transactions on Mobile Computing, vol. 9, no. 10, pp. 1465–1477, 2010. [14] A. Capponi, I. Fatkullin and Ling Shi, “Stochastic filtering for diffusion processes with level crossings”, IEEE Transactions on Automatic Control, vol. 56, no. 9, pp. 2201-2206, 2011. [15] G. Ferrari-Trecate, D. Mignone and M. Morari, “Moving horizon estimation for hybrid systems”, IEEE Transactions on Automatic Control, vol. 47, no. 10, pp. 1663–1676, 2002. [16] C.V. Rao, J.B. Rawlings, and D.Q. Mayne, “Constrained state estimation for nonlinear discrete-time systems: stability and moving horizon approximations”, IEEE Transactions on Automatic Control, vol. 48, no. 2, pp. 246-258, 2003. [17] A. Alessandri, M. Baglietto, and G. Battistelli, “Receding horizon estimation for discrete-time linear systems”, IEEE Transactions on Automatic Control, vol. 48, no. 3, pp. 473–478, 2003. [18] A. Alessandri, M. Baglietto, and G. Battistelli, “Moving horizon state estimation for nonlinear discrete-time systems: new stability results and approximation schemes”, Automatica, vol. 44, no. 7, pp. 1753– 1765, 2008. [19] A. Alessandri, M. Baglietto, G. Battistelli, and V. Zavala, “Advances in moving horizon estimation for nonlinear systems,” Proc. 49th IEEE Conference on Decision and Control (CDC), pp. 5681-5688, 2010. [20] A. Liu, L. Yu, W.-A. Zhang and M.Z.Q. Chen, “Moving horizon estimation for networked systems with quantized measurements and packet dropouts”, IEEE Transactions on Circuits and Systems I: Regular Papers, vol. 60, no. 7, pp. 1823–1834, 2013. [21] R. A. Delgado and G. C. Goodwin, “A combined MAP and Bayesian scheme for finite data and/or moving horizon estimation”, Automatica, vol. 50, no. 4, pp. 1116-1121, 2014. [22] G. Battistelli, L. Chisci, N. Forti, G. Pelosi, and S. Selleri, “Point source estimation via finite element multiple-model Kalman filtering”, accepted at 54th IEEE Conference on Decision and Control, Osaka, Japan, 2015. [23] G. Battistelli, L. Chisci, N. Forti, G. Pelosi, and S. Selleri, “Distributed finite element Kalman filter”, 14th IEEE European Control Conference, Linz, Austria, 2015. [24] S.C. Brenner and L.R. Scott, The mathematical theory of finite element methods, Springer–Verlag, New York, NY, 1996. [25] S. Boyd and L. Vandenderghe, Convex Optimization, Cambridge University Press, Cambridge, UK, 2004.
3cs.SY
Toward a Robust Sparse Data Representation for Wireless Sensor Networks Mohammad Abu Alsheikh∗† , Shaowei Lin† , Hwee-Pink Tan‡ , and Dusit Niyato∗ ∗ School of Computer Engineering, Nanyang Technological University, Singapore 639798 and Sense-abilities Programme, Institute for Infocomm Research, Singapore 138632 ‡ School of Information Systems, Singapore Management University, Singapore 188065 arXiv:1508.00230v1 [cs.NI] 2 Aug 2015 † Sense Abstract—Compressive sensing has been successfully used for optimized operations in wireless sensor networks. However, raw data collected by sensors may be neither originally sparse nor easily transformed into a sparse data representation. This paper addresses the problem of transforming source data collected by sensor nodes into a sparse representation with a few nonzero elements. Our contributions that address three major issues include: 1) an effective method that extracts population sparsity of the data, 2) a sparsity ratio guarantee scheme, and 3) a customized learning algorithm of the sparsifying dictionary. We introduce an unsupervised neural network to extract an intrinsic sparse coding of the data. The sparse codes are generated at the activation of the hidden layer using a sparsity nomination constraint and a shrinking mechanism. Our analysis using real data samples shows that the proposed method outperforms conventional sparsity-inducing methods. Abstract—Sparse coding, compressive sensing, sparse autoencoders, wireless sensor networks. I. I NTRODUCTION A sparsely-activated data (a few nonzero elements in a sample vector) may naturally exist for compressive sensing (CS) applications in wireless sensor networks (WSNs) such as the path reconstruction problem [1], indoor localization [2], and sparse event detection [3]. On the other hand, a sparse data representation cannot be easily induced in many other real-world contexts (e.g., in meteorological applications and environmental data gathering). In particular, noise patterns are usually presented in collected data from WSNs which greatly affect the performance of conventional sparsity-inducing (transformation) algorithms such as the Haar wavelet and discrete cosine transforms [4]. This motivates the quest for noise-robust and effective sparsity-inducing methods for WSNs. One of the breakthroughs in recent deep learning paradigms for finding high level data abstractions is achieved by introducing sparsity constraints on data representations, e.g., the Kullback–Leibler divergence [5], rectifier function [6], and topographic coding [7]. These methods are introduced for extracting intrinsic features from the data in a similar way that the human brain does while encoding sensory organ data, e.g., the low percentage of spikes in a visual cortex [8]. In particular, sparse deep learning methods generate sparse representations across training data for each single unit (i.e., lifetime sparsity), and they neither guarantee sparsity for each input signal nor assert on the number of nonzero values in the sparse codes. However, a practical CS implementation in WSNs requires a sparse representation for each input signal (i.e., population sparsity) with a sparsity ratio guarantee. Specifically, the CS solution to the underdetermined system (more number of unknowns than the number of equations) is dependent on the sparsity ratio of the signal, and the sparsity-inducing mechanism must assert an upper limit for the sparsity ratio. This sparsity bounding is necessary in WSNs as it enables using only one flat acquisition matrix for data encoding in the node. Therefore, it reduces the CS overhead in terms of memory for storing many measurement matrices in transmitting node and data control exchange as there is no need to send out rate control messages. The main contributions of this paper can be summarized into three folds as follows. 1) This paper introduces an effective, population sparsityinducing algorithm with sparsity ratio guarantee. The algorithm is based on a customized unsupervised neural network model of three layers (also called an autoencoder network) that generates the required, sparse coding at the second (hidden) layer. In the proposed shrinking sparse autoencoder (SSAE), the sparsity is achieved by introducing a regularization term to the cost function of the basic autoencoder. 2) We customize the learning algorithm to meet WSN characteristics. For example, the activations of the hidden layer during parameter learning stage are rounded to only three places to consider limited computational precision of the node. The rounding considers the low precision computations of sensor nodes, and it reduces the compressed data size and data transmission load. 3) We present a customized learning method that optimizes the SSAE cost function. Basically, the back propagated error is only used to update the nonzero and active neurons with dominant output values for each input pattern. Moreover, a shrinking mechanism that guarantees the sparsity bound is also used during the learning of the SSAE’s parameters. Therefore, an SSAE asserts on the number of nonzero elements generated at any time instant. The literature is rich with sparsity-based methods that are designed for optimized WSN operations [1]–[4], [9]–[14]. Nonetheless, much less attention is given to the sparsityinducing stage, and using straightforward methods to extract Short distance connection Region of interest (RoI) A backhaul connection Base station (BS) Sensor nodes (motes) Gateway (energy constrained) Fig. 1: Compressive sensing (CS) based data aggregation model: The RoI is assumed to be relatively far from the BS. Therefore, a gateway is designed to transmit compressed data over a costly long distance wireless connection. sparsity basis is common in previous studies such as using principal component analysis (PCA) [10], discrete cosine transform (DCT) [4], [11], [12], discrete Fourier transform (DFT) [9], discrete wavelet transforms [4], [13], and difference matrices [4], [15]. However, the sparse coding discipline has evolved considerable advances that significantly enhance the sparsity-inducing and hence overall WSN operations. Therefore, this paper is intended to introduce a robust and more effective sparsity-inducing method. The proposed method consists of three steps: (i) data collection, (ii) offline training and modeling, and (iii) online sparse code generation. An example of the online sparse code generation for a CS application is shown in Figure 2 which will be described in details later. The rest of the paper is organized as follows. In Section II, the problem formulation is presented. Section III describes the proposed algorithm and the SSAE structure. Then, Section IV discusses important practical issues of training and fitting the proposed model. In Section V, numerical results using realworld data set are presented. Finally, Section VI summarizes this paper. II. P ROBLEM F ORMULATION Consider a dense wireless sensor network consisting of N nodes, as in Figure 1, that collects data about a region of interest (RoI). Each sensor i (where i = 1, . . . , N ) collects a real-valued sample xi (e.g., temperature measurements) at a predefined sampling period and transmits packets at a configured transmission power that is not sufficient to reach the base station (BS) due to long distance propagation. Therefore, a gateway (GW) is used to collect a data vector x ∈ RN from all sensor nodes and relay it to the BS for further analysis and processing. Thereafter, a historical data matrix X ∈ RT ×N is formulated at the BS containing the collected data vectors as its rows, where T is the number of collected vectors. Here, the sensors’ oscillators are assumed to be synchronized to the GW’s clock. After collecting sufficient historical samples (details of data collection are elucidated in Section IV-A), and as the GW is energy and bandwidth constrained, the GW employs CS to spatially compress the data into a smaller data size. The radio transceiver is the most energy consuming unit in an ordinary sensor node [16]. Thereby, the energy consumption becomes more critical in the GW unit as it transmits huge data over the backhaul connection, while sensor nodes are assumed to transmit for short distances. It is important to note that our algorithm can be also temporally applied at each individual sensor node. However, data delivery latency is provoked as temporal samples must be collected at the node before being transmitted as one compressed chunk. Next, we give an overview of the CS framework and its implementation at the GW device, and the data reconstruction at the BS unit. A. Compressive Sensing (CS) CS is a signal processing method for effective data recovery from a few data samples than the Nyquist rate [17]. Assuming a sparse signal s ∈ RL that has only K nonzero elements; therefore, s is called a K-sparse signal, and the sparsity ratio η is equal to K L . Moreover, suppose a measurement (or sensing) matrix Φ ∈ RM ×L that obeys the restricted isometry property (RIP) [18]. Here, M is assumed to be much smaller than L; therefore, Φ is a flat matrix with more columns than rows. The sensing system under consideration that is executed by the GW to compress data can be expressed as y = Φs (1) M where y ∈ R is the resulted measurement vector. Φ can be sampled from different distributions to meet the RIP such as the Gaussian distribution [19]. Moreover, for high probability recovery, M must also meet the following constraint [20]:   L (2) M ≥ ρK log2 K where ρ is a constant, and M  N . At the BS unit, the reconstruction of s from y can be achieved by minimizing the following relaxed problem [21]: s∗ = arg min ky−Φsk2 ≤ ksk1 (3) where  is a small constant. The optimization problem (3) can be solved using a regularized least square method called least absolute shrinking and selection operator (LASSO) [22]. B. Sparsity-inducing Clearly, the whole CS framework is based on the sparsity assumption. Natural signal such as sound and images can be transformed into a sparse form by projecting them into a suitable basis [17]. However, this is not the case when dealing with WSN data. More precisely, sensor nodes produce noisy readings of the form x = x∗ + z (4) where x∗ ∈ RN is the noiseless data vector of the physical phenomenon, and z ∈ RN is the added noise vector. Noise values are assumed to be independent Gaussian variables with  zero mean and variance σz2 such that z ∼ N 0, σz2 IN . Therefore, even through the neighbor sensors are spatially correlated and hence compressible, the noise existence hampers the accurate approximation of source signal x using linear projection methods. In particular, smooth signal are representable using linear combinations of Fourier bases, and Source signal (xÎÂ128 ) Reconstructed signal(xˆ ÎÂ128) hidden layer Input layer h1 s1 d2 Sparsity-recovery method h3 d3 Sparse signal (sÎÂ128 ) h4 d4 5 non - zero values Compressive sensing decoding Compressive sensing encoding Transmitted signal (yÎÂ35) . . . . . . dˆ 2 dˆ 3 dˆ 4 . A neuron (a computational unit) . . dN hL Base station (BS) s2 Shrinking mechanism h2 Sparsity-inducing method Output layer dˆ1 d1 sL dˆ N Fig. 3: Illustration of the SSAE structure. Gateway Fig. 2: Example of data compression, transmission, and recovery operations using CS and sparsity-inducing models. smooth piecewise signals are linearly representable in wavelet bases [11]. Nonetheless, the smoothness condition is not guaranteed in sensor data as data samples are usually affected by noise patterns, and commercial sensors sense phenomenon with finite precision and are not noise robust. For example, a few noise readings can destroy the sparsity pattern of a DCT transformed data [12]. The main aim of any robust sparsity-inducing mechanism is to transform the source signal x ∈ RN into the sparse signal s ∈ RL . An upper bound guarantee on the sparsity ratio of the generated signal s is a “must-have” feature in most sparsitybased applications such as in CS. In particular, this guarantee enables designing low memory and low communication overhead applications for WSNs as a single sensing matrix Φ is used by the GW unit to compress data. Then, the BS does not require any information from the GW to recover the reconstruction signal x other than the measurement vector y, where x is a reconstruction of the noiseless data vector x∗ . An example of the system online operational procedure is shown in Figure 2 which includes the sparsity-inducing and CS components. The next section presents the proposed sparsityinducing mechanism. III. S HRINKING S PARSE AUTOENCODER (SSAE) In this section, we introduce an autoencoder’s variant which we call shrinking sparse autoencoder (SSAE) as shown in Figure 3. The SSAE network is specially designed to transform sensory data from its original domain into a sparse domain. The SSAE structure consists of three neural (or computational unit) layers. Firstly, an input layer that is connected to the input signal d ∈ RN , where N is the number of sensor nodes in the network. Briefly, d is a sphered version of the raw sensor data x, where {di ∈ R| − 1 < di < 1} as described in Section IV-B. Secondly, a hidden layer is used to generate an intrinsic code h ∈ RL at its activation. Thirdly, an output layer that includes the same number of neurons as the input layer and generates a recovery of the input data d̂ ∈ RN . The layers are connected to each other using the following formulations:   h = f W(1) d + b(1) (5)   d̂ = f W(2) s + b(2) (6) where W(1) is the weight matrix connecting the input and hidden layers, W(2) is the weight matrix connecting the hidden and output layers, and b(1) and b(2) are the biases of the input and hidden layers, respectively. Additionally, s is the sparse data representation that is obtained by applying the shrinking operation as described in Section III-A. For simplicity, we define θ to contain all the SSAE’s parameters . such that θ = W(1) , W(2) , b(1) , b(2) . Moreover, f (·) is the non-linear hyperbolic tangent function. The SSAE’s cost function Γ (·) includes two terms as follows: ! T 2 1 X 1 b (u) (u) Γ (θ; D) = d −d + T u=1 2 !  T  2  γ X (u) log 1+ h (7) T u=1 10 where D ∈ RT ×N is the training matrix of historical data  T such that each input vector d(u) u=1 is stored in a row of this matrix, and h(u) is the hidden layer activation of d(u) . Moreover, T is the training set size configured at the offline training algorithm (the details are given in Section III-B). As with any other autoencoder, the first term is the average sum of the difference between input vectors and their reconstructions at the output layer. This term is used to encourage the neural network to reconstruct its input data at the output layer. The second term is used to encourage sparsity at the generated coding in the hidden layer. The sparsity penalty γ is a hyper- parameter to manage the weights of each term in the optimization problem. In other words, using a big value for γ results in highly sparse representation, but with poor reconstruction capability. Then, the well-known delta rule can be used to update the SSAE’s weights and biases as follows [23]: (q) Wij (q) bi . (q) = Wij − α ∂ Γ (θ; D) , (q) ∂Wij ∂ . (q) = bi − α (q) Γ (θ; D) ∂bi (8) (9) where α is the learning rate, and q ∈ {1, 2} is the layer number within the SSAE network. These update rules are executed at each iteration of a gradient descent method. The partial derivative is given by ∂ Γ (θ; D) = (q) ∂Wij T   1 X ∂ (u) Γ θ; d T u=1 ∂W (q) ij Algorithm 1 Pseudo-code for the shrinking operation of hidden layer’s neurons. 1: Input h ∈ RL : hidden layer activation before shrinking 2: Input K: maximum nonzero activations 3: s = h . copy operation 4: for i = 0 to L − K do 5: p=0 6: for j = 0 to (L − 1) do 7: if |sp | > |sj | and |sj | > 0 then 8: p=j 9: end if 10: end for 11: sp = 0 . zero-out smallest value 12: end for 13: Output s ∈ RL (10)  where Γ θ; d(u) is the cost function defined for a single sample d(u) ∈ D. This means that the overall partial derivative of (7) is found by averaging the partial derivatives of all input samples. The second term of (7) only affects the partial derivative of the hidden layer (q = 2) which is computed as follows:   T  2  γ X ∂ (u) γ log 1 + h = 10 T u=1 ∂W (2) ij ! T   X 2h(u) γ 0 (2) (u) (2) 2 f W d + b loge (10) × T u=1 1 + h(u) (11) 2 where f 0 (·) = 1 − (f (·)) is the element-wise derivative of f (·). Thereby, the SSAE is designed to generate many zeros at the hidden layer. One can think of a neuron as being active when its output is not equal to zero, and an inactive neuron does not participate in forwarding the input data to the output (because it does not generates signals). To this end, two important issues of the second term of (7) must be noted as follows: • The second term minimizes the hidden layer activation, but it still does not ensure exactly zero activations. • It does not guarantee sparsity ratio at the generated codes. Accordingly, a shrinking mechanism must be applied at the hidden layer activation and before propagating them to the output layer to reconstruct the input. In particular, one can think of the second term as only being used as a mechanism of nominating the most promising neurons to be deactivated by the shrinking mechanism as described in the next section. A. Shrinking (Pruning) Scheme Even though the cost function of the SSAE is designed to generate a sparse data coding at the hidden layer, it does still neither guarantee a coding with population sparsity (sparsity at each input vector) nor assert on the maximum nonzeros for each input. Equally important, it will most likely generate values close to, but not absolutely zero. Therefore, we propose a simple shrinking mechanism that can complete the design cycle. For each input vector, the proposed shrinking mechanism “zero out” the least dominant neurons from the hidden layer, and therefore switching them to the deactivation mode. The least dominant neurons are the ones with the least effect on the data reconstruction at the output layer, and hence the minimum activation values that result from the sparsity restrictions. Therefore, only K active neurons at the hidden layer forward propagate the input through the SSAE network, and the remaining L − K neurons are switched off. An optimized implementation of the shrinking scheme is given by the pseudo-code in Algorithm 1, where |·| is the absolute value function. B. Offline Training The SSAE’s parameter adjustment is done during an offline training stage. As a resource demanding process, the training must be performed at the BS unit, and then the SSAE’s parameters (θ) are disseminated for online data compression at GW. The learning stage and SSAE’s parameters are tuned using a resourceful BS with relatively high precision operations. However, GW is usually constrained in terms of computational resources and computational precision (i.e., the machine epsilon value). Therefore, rounding the activation at the hidden layer is needed during the learning stage to match the GW’s low precision. Moreover, with rounding, less data is transmitted from GW to BS. To learn the SSAE’s parameters (θ), we minimize (7) by using a non-linear quasi-Newton method called the limited-memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS) method [24]. However, firstly the collected historical data X ∈ RT ×N must be randomly shuffled. This is because sensors’ readings are highly correlated over time, and a nonshuffled data causes the SSAE to dominantly learn the training data’ patterns in training data only. Therefore, the shuffling step ensures that the training and testing data sets contain all possible data patterns. Moreover, the cross validation technique [25] is an effective method for testing the model Algorithm 2 The offline training algorithm. 1: Input X ∈ RT ×N : historical sensor data 2: Input K: maximum nonzero activations 3: Input γ: sparsity hyper-parameter 4: Input ϕ: number of folds for cross validation 5: Randomly shuffle X 6: Divide X into ϕ folds X1 , . . . , Xϕ 7: for all Xi , i = 1, . . . , ϕ do 8: for all x ∈ (X \ Xi ) do . held out Xi for testing 9: Sphere input x to get d using (12) 10: Append d to D 11: end for 12: repeat 13: for all d ∈ D do 14: Forwardly propagate d to compute h using (5) 15: Shrink h to get s as in Algorithm 1 16: Compute d̂ using (6) 17: end for 18: Compute the cost value using (7) 19: Compute the gradient vector as in (10) 20: Update θ using the L-BFGS method 21: until learning converges 22: Compute accuracy using Xi 23: end for 24: Compute average accuracy of the ϕ folds  .  25: Output θ = W(1) , W(2) , b(1) , b(2) to the input layer. In other words, this ensures that any neuron in the hidden layer will be active for some input patterns, and hence no “always-off” neuron exists. This increases the model performance of generalizing to non local data, and hence it performs well on extremely non linear data, as all neurons participating increases the possible code formulations (i.e., the number of distinct combinations is increased when having more active neurons). Figure 4b shows hidden layer activations over time. Here, two main desirable properties can be observed 1) Population sparsity is achieved, and the maximum number of active neurons at any time instant is guaranteed by the SSAE network. This upper bound of nonzeros in a generated sparse code considers the tradeoff between the recovery error and compression ratio of the data aggregation model. Therefore, only a single sensing matrix is needed when using CS to create a measurement vector at the GW node. 2) All neurons are participating in the sparse code generation, and without any “always-off” neuron. Moreover, the activation values of the active neurons are not concentrated around very small values near zero. This feature cannot be achieved in conventional average activity ratio sparse autoencoders, such as the Kullback–Leibler divergence, as they are designed for lifetime sparsity only. IV. D ISCUSSION AND P RACTICAL C ONSIDERATIONS generalization capabilities, while benefiting from all available samples for training. Cross validation divides the training data into ϕ groups (e.g., 10 groups) then at each time, one group is held out for testing while using the remaining for model fitting. Then, the model performance is found by averaging errors of all cross validation’s groups. The offline learning is described in Algorithm 2. The learning algorithm is computationally intensive for sensor nodes and must be performed at the BS. Moreover, if the statistical parameters of the underlying phenomenon change, offline training must be re-executed and an updated  (1) the  W , b(1) should be disseminated to the nodes. C. Computational Complexity The online encoding and decoding of sparse codes are lightweight. In particular, the GW (or a sensor  node) can generate sparse codes by only using W(1) , b(1) as in (5) and Algorithm 1 with O(L × N ) of overall time complexity. The  data recovery is performed at the BS by using W(2) , b(2) as in (6) with a similar time complexity of O(L × N ). D. Sparse Codes For the verification and analysis in the following sections, a meteorological data set from the Sensorscope project [26] is used. The data set contains surface temperature samples of 23 sensors. The learning curve of the SSAE is shown in Figure 4a. An important indication of successful SSAE training is ensuring that hidden neurons are not connected with zero weights In this section, some practical issues of the SSAE training and fitting are discussed. A. Data Collection A crucial aspect of machine leaning-based approaches, such as the SSAE network, is the training data requirement. A system designer may have access to a large historical data set that is collected in the past. This historical data can be used to train the SSAE’s model. However, this is not the case for new WSN’s deployments, and the lack of sensor data hinders the accurate fitting of the SSAE’s parameters (i.e., θ). Clearly, the SSAE’s model needs to globally generalize to unseen data samples. In any machine learning method, having more training data can improve generalization performance, but having more data is not the only solution [27]. In WSNs, the following issues must be considered when using an SSAE as a sparsity inducing method. 1) It is assumed that sensor nodes are densely deployed and hence spatially correlated with each other (e.g., as in Figure 5 for the Sensorscope project’s data). SSAE learns these spatial correlation and redundant patterns in the nodes’ collected data. Therefore, if the underlying phenomenon becomes different in the way that it changes the nodes’ spatial correlation, then new data collection and offline model fitting must be performed. 2) The amount of data required to fit the SSAE’s model depends on the underlying sensed phenomenon, and for (a) (a) (b) Fig. 6: Data sphering and its effects on data by showing histograms and basic statistical values. (a) Raw data in the range of [−16.15, 47.91]. (b) Sphered data that is scaled to a new range of (−1, 1) with a Gaussian-like distribution. stage. Data sphering is simply achieved by applying the following operation on each sensors’ raw input vector x ∈ RN max (min ((x − x) , 3σ) , −3σ) (12) 3σ where σ is the standard deviation of the historical training PN matrix X, x = N1 i=1 xi is the arithmetic mean of each input vector, and again d ∈ RN is the SSAE’s input vector which is the resulting data vector after sphering. Unlike the standard element-wise standardization, this subtracts the arithmetic mean of each input vector and not the whole training matrix’s mean value. The effect of data sphering on training data is shown in Figure 6. Clearly, the data is transformed into a smoother Gaussian-like curve with zero mean (other statistical parameters are also shown). Equally important, the resulting scale of sphered data is in the (−1, 1) interval, which makes it suitable for the operation of the hyperbolic tangent function. In particular, the hyperbolic tangent function generates an output in the range of (−1, 1) and without data pre-processing to this range, the SSAE cannot produce outputs similar to input data. The reverse operation of data sphering is required at BS to reconstruct the original raw sensors’ vector x̂ ∈ RN from the SSAE’s output values d̂ ∈ RN . The reverse operation is given as x̂ = desphere(d̂, x, σ) = 3σ d̂ + x. (13) d = sphere(x, σ) = (b) Fig. 4: An SSAE which is designed to produce a maximum of 5 nonzero values at each time instant (η = 0.2) for 23 sensors (i.e., x ∈ R23 ). (a) A learning curve that shows the convergence of the offline learning algorithm, and (b) activation values of the hidden layer’s neurons. Fig. 5: Surface temperature readings of 4 neighbor sensors from the Sensorscope deployment over 1 day (1 sample every 2 minutes). This shows the spatial correlation among sensors’ measurements, and hence data compressibility. Here, σ is constant for all recovered vectors, and therefore can be stored at the BS. However, x must be sent from the GW to the BS along with the compressed data. Therefore, the transmitted data size when using CS is M + 1. V. N UMERICAL R ESULTS In this section, we evaluate the performance of the SSAEbased sparsity inducing method. A. SSAE Tunning more complex correlation patterns among sensors, more data samples are needed. B. Data Sphering Before using historical sensor data to train the SSAE, a pre-processing operation is required, namely the data sphering One of the main difficulties of applying neural networkbased methods is the numerical tuning of the network hyperparameters. Hyper-parameter setting of autoencoder’s variants can be facilitated by searching over a scale of values in the logdomain (e.g., values such as 10−1 , 10−2 , 10−3 , . . .), and then the value that minimizes the cross validation error is selected 1.3 1.2 RMSE 1.1 1.0 0.9 0.8 ° =0:05 ° =0:1 ° =0:2 ° =0:5 Sparsity penalty ° =1:0 Fig. 7: Sparsity parameter setting for η = 0.217. Bars represent root mean square error (RMSE) values over 10 runs. The maximum performance achieved at γ = 0.2. 2.5 SSAE-CS PCA-CS DCT-CS DFT-CS DL-CS 2.0 RMSE 1.5 1.0 0.5 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Sparsity ratio Fig. 8: Root mean square error (RMSE) versus sparsity ratio  η= K . L comparison as they are widely used in the CS literature [4], [9]–[12]. Two important observations can be made. 1) Most sparsity inducing algorithms will achieve a relatively similar recovery error at high values of η. However, these high sparsity ratio values (e.g., η > 0.7) are not typical in practical applications as the reduction in data size is not noticeable. Therefore, these values cannot be used for CS’s applications as the measurement vector size will be similar to the source signal size (i.e., N ≈ M ). On the other hand, SSAE significantly outperforms conventional methods for practical low sparsity ratios and when the nonzero values in the generated sparse codes are required to be minimized. 2) Conventional DL methods (e.g., [29], [30]) use the `1 minimization to model the raw data as linear combinations of sparse bases. In this paper, we used the scikitlearn library [31] for testing the dictionary learning method in which the coordinate descent method is used to find the LASSO problem solution. Similar to our algorithm, the scikit-learn’s implementation enables setting the required sparsity ratio by defining the number of nonzero coefficients in the sparse code, while we set the remaining parameters to their default values. We normalize the data to a zero mean and a unit variance before learning the dictionary model. In addition to the slightly better performance, we also noticed that the learning time of the SSAE method is also shorter than the DL method. This is significant for large-scale WSNs. C. Noisy Data accordingly [28]. Figure 7 shows the setting of the sparsity hyper-parameter γ for sparsity ratio η = 0.39. The sparsity term in (7) can be interpreted as sparsity nomination term, that is fed to the shrinking mechanism to generate sparse codes. Therefore, trying different values of γ is useful to achieve maximum signal reconstruction performance. For SSAE in the next experiments, the following function is used for the sparsity penalty γ settings γ (η) = 0.26 − 0.26η, (14) which is found by manually fitting the hyper-parameter γ for two values of η, as described above, and then finding the line connecting these two manually fitted points. B. Comparing to Benchmarks Using a difference matrix that captures the difference between adjacent and correlated values as a sparse basis was used in [4], [15]. Similar to [4], we noted the difference matrix’s poor performance in sparsifying the data, and hence it is not included in our comparison analysis. Figure 8 shows a comparison between the SSAE recovery performance and other conventional methods including principal component analysis (PCA), discrete Fourier transform (DFT), discrete cosine transform (DCT), and dictionary learning (DL). These conventional methods are chosen for Sensors may report imprecise measurements due to external noise sources, inaccurate sensor calibration, unstable power supply, and imperfect node design [32]. In this section, we assume that noise values are independent Gaussian variables  with zero mean and variance σz2 such that z ∼ N 0, σz2 IN , where z ∈ RN is an added noise vector. We noticed that the SSAE method does not only allows the compression of the sensors’ data, but it also helps in estimating the noiseless data vector of the physical phenomenon x∗ ∈ RN . An overcomplete sparse representation is achieved when the number of hidden layer’s neurons (sparse code’s size) is greater than the input layer’s neurons (i.e., L > N ). However, the measurement vector’s size M of CS is proportional to the sparse code’s size as in (3). Therefore, the number of nonzero items must be minimized, and less nonzero coefficients are defined in the overcomplete sparse code. On the other hand, using more neurons in the hidden layers can result in the overfitting problem [33]. Overfitting degrades the neural network’s reconstruction performance and increases the learning .  time of the parameters θ = W(1) , W(2) , b(1) , b(2) . Table I summarizes the experiments of using overcomplete sparse representation. The results also include the case of adding external noise z ∼ N (0, IN ) to sensors’ measurements. This shows that the overcomplete case is useful in unreliable network to reduce the noise effects while producing sparse codes. However, in noise-free networks, using overcomplete codes can degrade the TABLE I: System performance with different numbers of hidden neurons. L K γ M RMSE (no external noise) 23 5 0.2 12 0.987 25 5 0.25 12 0.930 (best) 30 4 0.5 12 32 4 0.6 12 0.982 (overfitting) 1.027 (overfitting) RMSE (noise σz2 = 1) 1.522 (unreliable) 1.512 (unreliable) 1.259 (best) 1.338 sparsity-inducing algorithm performance due to the overfitting problem. VI. S UMMARY In this paper, we have introduced a sparsity-inducing algorithm for data aggregation of non-sparse signal in wireless sensor networks. The proposed method consists of three steps: data collection, offline training and modeling, and online sparse code generation. The modeling scheme is based on a neural network with three layers, where the sparse codes are exposed at the hidden layer’s neurons. A cost function is introduced as a sparsity nomination scheme. Then, a shrinking mechanism is used to switch off the least dominant neurons in the hidden layer, while asserting on the number of generated nonzero values in the sparse code. The resulting scheme can be used in many applications such as in compressive sensingbased data aggregation schemes. For future research, we will analytically study the energy consumption and computational burdens of the proposed scheme. R EFERENCES [1] Z. Liu, Z. Li, M. Li, W. Xing, and D. Lu, “Path reconstruction in dynamic wireless sensor networks using compressive sensing,” in Proc. 15th ACM Int. Symp. on Mobile Ad Hoc Networking and Computing. ACM, 2014, pp. 297–306. [2] S.-Y. Fu, X.-K. Kuai, R. Zheng, G.-S. Yang, and Z.-G. Hou, “Compressive sensing approach based mapping and localization for mobile robot in an indoor wireless sensor network,” in Proc. Int. Conf. Networking, Sensing and Control. IEEE, 2010, pp. 122–127. [3] J. Meng, H. Li, and Z. Han, “Sparse event detection in wireless sensor networks using compressive sensing,” in Proc. 43rd Annu. Conf. Inform. Sciences and Syst. IEEE, 2009, pp. 181–185. [4] G. Quer, R. Masiero, D. Munaretto, M. Rossi, J. Widmer, and M. Zorzi, “On the interplay between routing and signal representation for compressive sensing in wireless sensor networks,” in Proc. Inform. Theory and Applicat. Workshop. IEEE, 2009, pp. 206–215. [5] H. Lee, C. Ekanadham, and A. Y. Ng, “Sparse deep belief net model for visual area V2,” in Proc. 21st Conf. Advances in Neural Inform. Process. Syst., 2008, pp. 873–880. [6] X. Glorot, A. Bordes, and Y. Bengio, “Deep sparse rectifier networks,” in Proc. 14th Int. Conf. Artificial Intell. and Stat., vol. 15, 2011, pp. 315–323. [7] Y. LeCun, “Learning invariant feature hierarchies,” in Proc. 12th European Conf. Comput. Vision. Springer, 2012, pp. 496–505. [8] P. Lennie, “The cost of cortical computation,” Current Biology, vol. 13, no. 6, pp. 493–497, 2003. [9] F. Fazel, M. Fazel, and M. Stojanovic, “Random access compressed sensing over fading and noisy communication channels,” IEEE Trans. Wireless Commun., vol. 12, no. 5, pp. 2114–2125, 2013. [10] R. Masiero, G. Quer, D. Munaretto, M. Rossi, J. Widmer, and M. Zorzi, “Data acquisition through joint compressive sensing and principal component analysis,” in Proc. Global Telecommun. Conf. IEEE, 2009, pp. 1–6. [11] W. Bajwa, J. Haupt, A. Sayeed, and R. Nowak, “Compressive wireless sensing,” in Proc. 5th Int. Conf. Inform. Process. in Sensor Networks. ACM, 2006, pp. 134–142. [12] C. Luo, F. Wu, J. Sun, and C. W. Chen, “Compressive data gathering for large-scale wireless sensor networks,” in Proc. 15th Annu. Int. Conf. Mobile Computing and Networking. ACM, 2009, pp. 145–156. [13] A. Griffin and P. Tsakalides, “Compressed sensing of audio signals using multiple sensors,” in Proc. 16th European Signal Process. Conf., 2008, pp. 1–5. [14] P. Misra, W. Hu, M. Yang, and S. Jha, “Efficient cross-correlation via sparse representation in sensor networks,” in Proc. 11th Int. Conf. on Inf. Processing in Sensor Networks. ACM, 2012, pp. 13–24. [15] X. Wu and M. Liu, “In-situ soil moisture sensing: Measurement scheduling and estimation using compressive sensing,” in Proc. 11th Int. Conf. Inform. Process. in Sensor Networks. ACM, 2012, pp. 1–12. [16] G. J. Pottie and W. J. Kaiser, “Wireless integrated network sensors,” Commun. of the ACM, vol. 43, no. 5, pp. 51–58, 2000. [17] S. Qaisar, R. M. Bilal, W. Iqbal, M. Naureen, and S. Lee, “Compressive sensing: From theory to applications, a survey,” J. of Commun. Networks, vol. 15, no. 5, pp. 443–456, 2013. [18] E. J. Candes, “The restricted isometry property and its implications for compressed sensing,” Comptes Rendus Mathematique, vol. 346, no. 9, pp. 589–592, 2008. [19] Z. Chen and J. J. Dongarra, “Condition numbers of gaussian random matrices,” SIAM J. on Matrix Analysis and Applicat., vol. 27, no. 3, pp. 603–620, 2005. [20] E. J. Candès, J. Romberg, and T. Tao, “Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information,” IEEE Trans. Inf. Theory, vol. 52, no. 2, pp. 489–509, 2006. [21] E. J. Candes, J. K. Romberg, and T. Tao, “Stable signal recovery from incomplete and inaccurate measurements,” Commun. on Pure and Applied Mathematics, vol. 59, no. 8, pp. 1207–1223, 2006. [22] R. Tibshirani, “Regression shrinkage and selection via the lasso,” J. of the Royal Statistical Soc., pp. 267–288, 1996. [23] D. E. Rumelhart, G. E. Hinton, and R. J. Williams, “Learning representations by back-propagating errors,” Cognitive modeling, 1988. [24] R. H. Byrd, P. Lu, J. Nocedal, and C. Zhu, “A limited memory algorithm for bound constrained optimization,” SIAM J. on Scientific Computing, vol. 16, no. 5, pp. 1190–1208, 1995. [25] R. Kohavi et al., “A study of cross-validation and bootstrap for accuracy estimation and model selection,” in Proc. Int. Joint Conf. Artificial Intell., vol. 14, no. 2, 1995, pp. 1137–1145. [26] “Sensorscope: Sensor networks for environmental monitoring,” 2007. [Online]. Available: http://lcav.epfl.ch/op/edit/sensorscope-en [27] P. Domingos, “A few useful things to know about machine learning,” Commun. of the ACM, vol. 55, no. 10, pp. 78–87, 2012. [28] Y. Bengio, “Practical recommendations for gradient-based training of deep architectures,” in Neural Networks: Tricks of the Trade. Springer, 2012, pp. 437–478. [29] H. Lee, A. Battle, R. Raina, and A. Y. Ng, “Efficient sparse coding algorithms,” in Proc. 19th Advances in Neural Inform. Process. Syst., 2006, pp. 801–808. [30] J. Mairal, F. Bach, J. Ponce, and G. Sapiro, “Online dictionary learning for sparse coding,” in Proc. 26th Annu. Int. Conf. Machine Learning. ACM, 2009, pp. 689–696. [31] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg et al., “Scikit-learn: Machine learning in python,” The J. of Machine Learning Research, vol. 12, pp. 2825–2830, 2011. [32] K. Ni, N. Ramanathan, M. N. H. Chehade, L. Balzano, S. Nair, S. Zahedi, E. Kohler, G. Pottie, M. Hansen, and M. Srivastava, “Sensor network data fault types,” ACM Trans. Sensor Networks, vol. 5, no. 3, p. 25, 2009. [33] Y. Liu, J. A. Starzyk, and Z. Zhu, “Optimized approximation algorithm in neural networks without overfitting,” IEEE Trans. Neural Netw., vol. 19, no. 6, pp. 983–995, 2008.
9cs.NE
Deep Residual Learning and PDEs on Manifold arXiv:1708.05115v3 [cs.IT] 25 Jan 2018 Zhen Li ∗ Zuoqiang Shi† Abstract In this paper, we formulate the deep residual network (ResNet) as a control problem of transport equation. In ResNet, the transport equation is solved along the characteristics. Based on this observation, deep neural network is closely related to the control problem of PDEs on manifold. We propose several models based on transport equation, Hamilton-Jacobi equation and Fokker-Planck equation. The discretization of these PDEs on point cloud is also discussed. keywords: Deep residual network; control problem; manifold learning; point cloud; transport equation; Hamilton-Jacobi equation 1 Deep Residual Network Deep convolution neural networks have achieved great successes in image classification. Recently, an approach of deep residual learning is proposed to tackle the degradation in the classical deep neural network [7, 8]. The deep residual network can be realized by adding shortcut connections in the classical CNN. A building block is shown in Fig. 1. Formally, a building block is defined as: y = F (x, {Wi }) + x. Here x and y are the input and output vectors of the layers. The function F (x, {Wi }) represents the residual mapping to be learned. In Fig. 1, F = W2 · σ(W1 · σ(x)) in which σ = ReLU ◦ BN denotes composition of ReLU and Batch-Normalization. ∗ Department of Mathematics, Hong Kong University of Science & Technology, Hong Kong. Email: [email protected]. † Yau Mathematical Sciences Center, Tsinghua University, Beijing, China, 100084. Email: [email protected]. 1 xl BN ReLU Conv. BN ReLU Conv. + xl+1 Figure 1: Building block of residual learning [8]. 2 Transport Equation and ResNet Consider the the terminal value problem of linear transport equation in Rd :   ∂u − v(x, t) · ∇u = 0, x ∈ Rd , t ≥ 0, ∂t  u(x, 1) = f (x), x ∈ Rd . (1) where v(x, t) is a given velocity field, f is the composition of the output function and the fully connected layer. If we use the softmax activation function, f (x) = softmax(WF C · x), (2) where WF C is the weight in the fully connected layer, softmax function is given by exp(xi ) . softmax(x)i = P j exp(xj ) which models posterior probability of the instance belonging to each class. It is well-known that the solution at t = 0 can be approximately solved along the characteristics: dx(t; x) = v (x(t; x), t) , x(0; x) = x. (3) dt We know that along the characteristics, u is a constant: u(x, 0) = u (x(1; x), T ) = f (x(1; x)). Let {tk }L k=0 with t0 = 0 and tL = 1 be a partition of [0, 1]. The characteristic of the transport equation (3) can be solved by using simple forward Euler discretization from x0 (x) = x: Xk+1 (x) = Xk (x) + ∆tv(Xk (x), tk ), (4) 2 where ∆t is the time step. If we choose the velocity field such that   ∆t v(x, t) = W (2) (t) · σ W (1) (t) · σ(x) , (5) where W (1) (t) and W (2) (t) corresponds to the ’weight’ layers in the residual block, σ = ReLU ◦ BN, one step in the forward Euler discretization (4) actually recovers one layer in the deep ResNets, Fig. 1. Then the numerical solution of the transport equation (1) at t = 0 is given by u(x, 0) = f (XL (x)) (6) This is exactly the output we get from the ResNets. If x is a point from the training set, we already have a labeled value g(x) on it. Then we want to match the output value given in (6) and g(x) to train the parameters in the velocity filed (5) and the terminal value. Based on above analysis, we see that the training process of ResNet can be formulated as an control problem of a transport equation in Rd .  ∂u  d    ∂t (x, t) − v(x, t) · ∇u(x, t) = 0, x ∈ R , t ≥ 0, (7) u(x, 1) = f (x), x ∈ Rd ,     u(xi , 0) = g(xi ), xi ∈ T. where T denotes the training set. g(xi ) is the labeled value at sample xi . Function u may be scalar or vector value in different applications. So far, we just formulate ResNet as a control problem of transport equation. This model will inspire us to get new models by replacing different component in the control problem. 3 Modified PDE model From the PDE point of view, ResNet consists of five components: • PDE: transport equation; • Numerical method: characteristic+forward Euler;  • Velocity filed model: v(x, t) = W (2) (t) · σ W (1) (t) · σ(x) ; • Terminal value: f (x) = softmax(WF C · x); • Initial value: label on the training set g(xi ), xi ∈ T . In five components listed above, the last one, ”initial value”, is given by the data and we have no other choice. All other four components, we can consider to replace them by other options. Recently, there are many works in replacing forward Euler by other ODE solver. Forward Euler is the simplest ODE solver. By replacing it to other solver, we 3 may get different network. In some sense, in DenseNet [9], forward Euler is replaced by some multi-step scheme. There are many numerical schemes to solve the ODE (3). Some numerical scheme may be too complicated to be used in DNN. Constructing good ODE solver in DNN is an interesting problem worth to exploit in our future work. 3.1 Terminal Value From the control problem point of view, the softmax output function is not a good choice for terminal vaule, since they are pre-determined, may be far from the real value. Semisupevised learning (SSL) seems provides a good way to get terminal value instead of the pre-determined softmax function as shown in Fig. 2(b). DNN DNN DNN X(x; Θ) X(x; Θ) X(x; Θ) Softmax SSL WNLL Output Output Output (a) (b) (c) Figure 2: (a): standard DNN; (b): DNN with semi-supervised learning; (c): DNN with last layer replaced by WNLL. Recently, we try to use weighted nonlocal Laplacian [11] to replace softmax and the results is pretty encouraging [12]. 3.2 Velocity Field Model In transport equation, we need to model a high dimensional velocity filed. In general, it is very difficult to compute a high dimensional vector field. In the application associated to images, the successes of CNN and ResNet have proved that the velocity filed model based on convolutional operators, (8), is effective and powerful.   v(x, t) = W (2) (t) · σ W (1) (t) · σ(x) . (8) However, this is not the only way to model the velocity field. Moreover, for the applications in which convolutional operator makes no sense, we have to propose alternative velocity model. Here, we propose a model based on Hamilton-Jacobi equation to reduce the degree of freedom in the velocity field. Notice that even though the velocity v(x, t) is a high dimensional vector field, in the tranport equation, only the component along ∇u is useful. Based on this observation, one 4 idea is only model the component along ∇u by introducing v̄(x, t) = v(x, t) · n(x, t) and ∇M u n(x, t) = |∇ . Then the transport equation in (7) becomes a Hamilton-Jacobi equation. M u| We get a control problem of Hamilton-Jacobi equation.  ∂u  d    ∂t − v̄(x, t) · |∇u| = 0, x ∈ R , t ≥ 0, (9) u(x, 0) = f (x), x ∈ M,     u(xi , 1) = g(xi ), xi ∈ T. In (7), the velocity field, v(x, t), is a d-dimensional vector field. Meanwhile, in the Hamilton-Jacobi model, we only need to model a scalar function v̄(x, t). The number of parameters can be reduced tremendously. To model a scalar function is much easier than model a high dimensional vector field. There are already many ways to approximate v̄(x, t). 1. The simplest way is to model v̄(x, t) as a linear function with respect to x, i.e. v̄(x, t) = w(t) · x + b(t), w(t) ∈ Rd , b(t) ∈ R. (10) Although v̄(x, t) is a linear function to x, the whole model (9) is not a linear model since Hamilton-Jacobi equation is a nonlinear equation. 2. Neural network is consider to be an effective way to approximate scalar function in high dimensioanl space. One option is a simple MLP with one hidden layer as shown in Fig. 3. Weight Weight x ∈ Rd d×m ReLU m×1 v̄(x) ∈ R Figure 3: MLP model with one hidden layer for v̄(x, t) in (9). There are many other neural networks in the literature to approximate scalar function in high dimensioanl space. 3. Radial basis function is another way to approximate v̄(x, t). Radial functions centered at each sample point are used as basis function to approximate v̄(x, t), i.e. ! X |x − xj |2 v̄(x, t) = cj (t)R (11) σj2 xj ∈P where cj (t), j = 1, · · · , |P | are coefficients of the basis function. One often used basis function is Gaussian function, R(r) = exp(−r). Another difficulty in solving model (9) is efficient numerical solver of Hamilton-Jacobi equation in high dimensional space. Hamilton-Jacobi equation is a nonlinear equation which is more difficult to solve than linear transport equation in (7). Recently, fast solver of Hamilton-Jacobi equation in high dimensional space attracts lots of attentions and many efficient methods have been developed [1, 2, 3, 4, 5, 6]. 5 3.3 PDEs on point cloud Another thing we can consider to change is the characteristic method in solving the transport equation. There are many other numerical method for transport equation based on Eulerian grid. However, in these methods, we need to discretize the whole space Rd by Eulerian grid, which is impossible when d is high. So in high dimensional space Rd , characteristic method seems to be the only practical numerical method to solve the transport equation. On the other hand, we only need to solve the transport equation in the dataset instead of the whole Rd space. Usually, we can assume that the data set sample a low dimensional manifold M ⊂ Rd , then the PDE can be confined on this manifold. The manifold is sampled by the point cloud consists of the data set including the training set and the test set. Then the numerical methods in point cloud can be used to solve the PDE. Transport equation In the manifold, the transport equation model (7) can be rewritten as follows:  ∂u  d    ∂t − v(x, t) · ∇M u = 0, x ∈ M ⊂ R , t ≥ 0, (12) u(x, 0) = f (x), x ∈ M,     u(xi , 1) = g(xi ), xi ∈ T. ∇M denotes the gradient on manifold M. Let X : V ⊂ Rm → M ⊂ Rd be a local parametrization of M and θ ∈ V . For any differentiable function u : M → R, let U (θ) = f (X(θ)), define Dk u(X(θ)) = m X g ij (θ) i,j=1 (g ij )i,j=1,··· ,m where is defined by = G−1 ∂U ∂Xk (θ) (θ), ∂θi ∂θj k = 1, · · · , d. (13) and G(θ) = (gij )i,j=1,··· ,m is the first fundamental form which gij (θ) = d X ∂Xk k=1 ∂θi (θ) ∂Xk (θ), ∂θj i, j = 1, · · · , m. (14) ∇M is defined as ∇M u = (D1 u, D2 u, · · · , Dd u). (15) In (12), the manifold M is sampled by the data set P and P is a collection of unstructured high dimensional points. Unlike the classical numerical methods which solve PDE on regular grids (or meshes), in this case, we need to discretize PDE on unstructured high dimensional point cloud P . To handle this kind of problems, recently, point integral method (PIM) was developed to solve PDE on point cloud. In PIM, gradient on point cloud is approximate by an integral formula [10]. Z 1 (u(x) − u(y)) (xk − y k )Rδ (x, y)dy. (16) Dk u(x) = wδ (x) M 6 where wδ (x) = R M Rδ (x, y)dy,  Rδ (x, y) = R kx − yk2 δ2  . (17) The kernel function R(r) : R+ → R+ is assumed to be a C 2 function with compact support. Corresponding discretization is Dk u(x) = 1 X (u(x) − u(y)) (xk − y k )Rδ (x, y)V (y). w̄δ (x) (18) y∈P P w̄δ (x) = y∈P Rδ (x, y)V (y) and V (y) is the volume weight of y depends on the distribution of the point cloud in the manifold. Hamilton-Jacobi equation We can also confine the Hamilton-Jacobi equation in (9) in the manifold.  ∂u  d    ∂t − v̄(x, t) · |∇M u| = 0, x ∈ M ⊂ R , t ≥ 0, (19) u(x, 0) = f (x), x ∈ M,     u(xi , 1) = g(xi ), xi ∈ T. On the point cloud, one possible choice to discretize |∇M u| is |∇M u(x)| = Z M 2 1/2 w(x, y)(u(x) − u(y)) dy . (20) v̄(x, t) can be modeled in the way discussed in the previous section. PDEs with dissipation We can also consider to add dissipation to stabilize the PDEs.  ∂u   − v̄(x, t) · |∇M u| = ∆M u, x ∈ M ⊂ Rd , t ≥ 0,    ∂t     u(x, 0) = f (x), x ∈ M,   (21) u(xi , t) = g(xi ), xi ∈ S,     u(xi , 1) = g(xi ), xi ∈ T \S,      ∂u   (x, t) = 0, x ∈ ∂M. ∂n In the model with dissipation, we need to add constraints, u(xi , t) = g(xi ), xi ∈ S ⊂ T in a subset S of the training set T . Otherwise, the solution will be too smooth to fit the data due to the viscosity. The choice of S is an issue. The simplest way is to choose S at random. In some sense, the viscous term maintains the regularity of the solution and the convection term is used to fit the data. On the point cloud, the Laplace-Beltrami operator along with the constraints u(xi , t) = g(xi ), xi ∈ S ⊂ T can be discretized by the weighted nonlocal Laplacian [11]. 7 4 Discussion In this paper, we establish the connection between the deep residual network (ResNet) and the transport equation. ResNet can be formulated as solving a control problem of transport equation along the characteristics. Based on this observation, we propose several PDE models on the manifold sampled by the data set. We consider the control problem of transport equation, Hamilton-Jacobi equation and viscous Hamilton-Jacobi equation. This is a very preliminary discussion on the relation between deep learning and PDEs. There are many important issues remaining unresolved including the model of the velocity field, numerical solver of the control problem and so on. This is just the first step in exploring the relation between deep learning and control problems of PDEs. References [1] Y. T. Chow, J. Darbon, S. Osher, and W. Yin. Algorithm for overcoming the curse of dimensionality for certain non-convex hamilton-jacobi equations, projections and differential games. UCLA CAM-Report 16-27, 2016. [2] Y. T. Chow, J. Darbon, S. Osher, and W. Yin. Algorithm for overcoming the curse of dimensionality for time-dependent non-convex hamilton-jacobi equations arising from optimal control and differential games problems. UCLA CAM-Report 16-62, 2016. [3] Y. T. Chow, J. Darbon, S. Osher, and W. Yin. Algorithm for overcoming the curse of dimensionality for state-dependent hamilton-jacobi equations. UCLA CAM-Report 17-16, 2017. [4] J. Darbon and S. Osher. Algorithms for overcoming the curse of dimensionality for certain hamilton-jacobi equations arising in control theory and elsewhere. UCLA CAMReport 15-50, 2015. [5] J. Darbon and S. Osher. Splitting enables overcoming the curse of dimensionality. UCLA CAM-Report 15-69, 2015. [6] J. Han, A. Jentzen, and W. E. Overcoming the curse of dimensionality: Solving highdimensional partial differential equations using deep learning. ArXiv:1707.02568, July 2017. [7] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016. [8] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. arXiv:1603.05027, 2016. 8 [9] G. Huang, Z. Liu, L. V. Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2261–2269, 2017. [10] Z. Li, Z. Shi, and J. Sun. Point integral method for elliptic equations with variable coefficients on point cloud. mathscidoc:1708.25001, 2017. [11] Z. Shi, S. Osher, and W. Zhu. Weighted nonlocal laplacian on interpolation from sparse data. Journal of Scientific Computing, 73:1164–1177, 2017. [12] B. Wang, X. Luo, Z. Li, W. Zhu, Z. Shi, and S. Osher. Deep neural networks with data dependent implicit activation function. in preparation, 2018. 9
7cs.IT
1 Domain-Specific Face Synthesis for Video Face Recognition from a Single Sample Per Person arXiv:1801.01974v1 [cs.CV] 6 Jan 2018 Fania Mokhayeri, Student Member, IEEE, Eric Granger, Member, IEEE, and Guillaume-Alexandre Bilodeau, Member, IEEE Abstract—In video surveillance, face recognition (FR) systems are employed to detect individuals of interest appearing over a distributed network of cameras. The performance of still-tovideo FR systems can decline significantly because faces captured in the unconstrained operational domain (OD) over multiple video cameras have a different underlying data distribution compared to faces captured under controlled conditions in the enrollment domain (ED) with a still camera. This is particularly true when individuals are enrolled to the system using a single reference still. To improve the robustness of these systems, it is possible to augment the reference set by generating synthetic faces based on the original still. However, without knowledge of the OD, many synthetic images must be generated to account for all possible capture conditions. FR systems may therefore require complex implementations and yield lower accuracy when training on many less relevant images. This paper introduces an algorithm for domain-specific face synthesis (DSFS) that exploits the representative intra-class variation information available from the OD. Prior to operation (during camera calibration), a compact set of faces from unknown persons appearing in the OD is selected through affinity propagation clustering in the captured condition space (defined by pose and illumination estimation). The domain-specific variations of these face images are then projected onto the reference still of each individual by integrating an image-based face relighting technique inside the 3D morphable model framework. A compact set of synthetic faces is generated that resemble individuals of interest under capture conditions relevant to the OD. In a particular implementation based on sparse representation classification, the synthetic faces generated with the DSFS are employed to form a cross-domain dictionary that accounts for structured sparsity where the dictionary blocks combine the original and synthetic faces of each individual. Experimental results obtained with videos from the Chokepoint and COX-S2V datasets reveal that augmenting the reference gallery set of still-to-video FR systems using the proposed DSFS approach can provide a significantly higher level of accuracy compared to state-of-the-art approaches, with only a moderate increase in its computational complexity. Index Terms—Face Recognition, Single Sample Per Person, Face Synthesis, 3D Face Reconstruction, Illumination Transferring, Sparse Representation-Based Classification, Video Surveillance. I. I NTRODUCTION Still-to-video (S2V) face recognition (FR) is an important function in several video surveillance applications, particularly for watch-list screening. Given one or more reference still images of a target individual of interest, S2V FR systems Fania Mokhayeri and Eric Granger are with the Laboratory for Imagery, Vision and Artificial Intelligence (LIVIA), École de technologie supérieure, Université du Québec, Montréal, Canada, (e-mail: [email protected], [email protected]). Guillaume-Alexandre Bilodeau is with the Image and Video Processing Laboratory (LITIV), Ṕolytechnique Montréal, Montréal, Canada, (e-mail: [email protected]). seeks to accurately detect their presence in videos captured over multiple distributed surveillance cameras [1]. Despite the recent progress in computer vision and machine learning, designing a robust system for S2V FR remains a challenging problem in real-world surveillance applications. One key issue is the visual domain shift between faces from the enrollment domain (ED), where reference still images are typically captured under controlled conditions, and those from the operational domain (OD), where video frames are captured under uncontrolled conditions with variations in pose, illumination, blurriness, etc. The appearance of faces captured in videos corresponds to multiple non-stationary data distributions that can differ considerably from faces captured during enrollment [2]. Another key issue is the limited number of reference stills that are available per target individual to design facial models. Although still faces from the cohort or other non-target persons, and trajectories of video frames from unknown individuals are typically available. In many surveillance applications (e.g., watch-list screening), only a single reference still per person is available for design, which corresponds to the so-called Single Sample Per Person (SSPP) problem. The performance of S2V FR systems can decline significantly due to the limited information available to represent the intra-class variations seen in video frames. Many discriminant subspaces and manifold learning algorithms cannot be directly employed with a SSPP problem. It is also difficult to apply representation-based FR methods such as sparse representation-based classification (SRC) [3], [4]. Different techniques for SSPP problems have been proposed to improve the robustness of FR systems, such as using multiple face representations [2], face frontalization [5], generating synthetic faces from the original reference stills [6], [7], and incorporating generic auxiliary set1 [8], [9]. This paper will focus on methods to augmenting the reference gallery set either through synthetic set generated based on the original reference still, or through intra-class variation information transferred from a generic set. A challenge with strategies for augmenting the reference gallery set is selecting a sufficient number of synthetic or generic faces to cover intraclass variations in the OD. Many synthetic faces or generic auxiliary faces may be generated or collected, respectively, to account for all possible capture conditions. In this case, FR systems would therefore require complex implementations and 1 A generic set is defined as an auxiliary set that contains multiple video frames per person from other unknown individuals. It provides an abundance of information on intra-class variations of the capture conditions in an OD. 2 1 ... 3 2 m ... Characterizing Capture Condition Unlabeled ROIs from Video Trajectories (Operation Domain) Pose and Illumination Representative 1 2 3 4 2 3 ... q 1 + ... ... 2 + ... 3 + ... 4 + ... ... n q ... ... + Reference Faces ... ... n ... Labeled Reference Still ROIs (Enrollment Domain) ... Generating Synthetic Faces based on OD knowledge ... ... ... ... 1 Extended Reference Set 1 2 3 4 Synthetic Faces Faces Synthetic Figure 1: Overview of the proposed DSFS algorithm to augment the reference gallery set. We assume that the gallery set initially contains only one reference still ROI per individual of interest. may yield lower accuracy when training on many facial images that provide less relevant information for FR in the OD. In this paper, a new approach is proposed that exploits the discriminant information of the generic set for the face synthesis process. The new algorithm called domain-specific face synthesis (DSFS) maps representative variation information from the generic set in the OD to the original facial regions of interest (ROIs) isolated in reference stills. In this way, a compact set of synthetic faces is generated that represent still reference ROIs and probe video ROIs under a common capture condition. As depicted in Fig. 1, the DSFS technique involves two main steps: (1) characterizing capture condition information from the OD, (2) generating synthetic face ROIs based on the information obtained in the first step. Prior to operation (during some camera calibration process), a generic set of facial ROIs is collected from video captured in the OD. A compact and representative subset of ROIs is selected by clustering this generic set in a capture condition space defined by pose, illumination, blur and contrast estimation measures. The 3D model of each reference still ROI is reconstructed via a 3D morphable model and rendered based on pose representatives. Finally, the illumination-dependent layers of the lighting representatives are extracted and projected on the rendered reference ROIs with the same pose. In this manner, domain-specific variations are effectively transferred onto the reference still ROIs. In a particular implementation for S2V FR, the original and synthetic ROIs are employed to design a structural dictionary with powerful variation representation ability for SRC. The dictionary blocks represent intra-class variations computed from either the reference faces themselves or the synthetic faces [10]. The cooperation of SRC with the proposed DSFS improves the robustness of SRC for video-based FR in a SSPP scenario to domain variations. In order to validate the performance of the proposed DSFS algorithm for S2V FR with a SSPP, this SRC implementation is evaluated and compared on two public face databases. The main advantage of the proposed approach is the ability to provide a compact set that can accurately represent the original reference face with relevant of intra-class variations in pose, illumination, motion blur, etc., corresponding to capture condition in the OD. For instance, in the context of SRC implementations, this set can prevent over-fitting and refines more informative classes during the sparse coding process, and accordingly does not require a traditional dictionary learning process. The rest of the paper is organized as follows. Section II provides an overview of related works for FR with a SSPP. Section III describes the proposed face synthesizing algorithm. Section IV presents a particular implementation of the DSFS for S2V FR system. In Section V, the experimental methodology (dataset, protocol, and performance metrics) for validation of FR systems is described and the experimental results is presented. Finally, Section VII concludes the paper and discusses some future research directions. II. R ELATED W ORK – S2V FACE R ECOGNITION FROM A S INGLE S TILL Several techniques have been proposed in the literature to improve the robustness of S2V FR systems designed using a SSPP. They can be categorized into techniques for (1) multiple face representation, (2) generic learning, and (3) generation of synthetic faces. An overview of the techniques is presented as bellow. A. Multiple Face Representation One effective approach to address the SSPP problem in FR is to extract discriminant features from face images. Bashbaghi et al. [2], [11] proposed a robust S2V FR system based on diverse face representations. They applied multiple appearanceinvariant feature extraction techniques to patches isolated in the reference still images in order to produce multiple face representations and generate a pool of diverse exemplarSVMs. This pool provides robustness to common nuisance factors encountered in surveillance applications. Jiwen et al. [12] proposed a discriminative multi-manifold analysis method by learning discriminative features from image patches. In this technique, the patches of each individual are considered to 3 form a manifold for each sample per person and a projection matrix is learned by maximizing the manifold margin of different persons. In [13] a face image is processed by several posespecific deep convolutional neural network (CNN) models to generate multiple pose-specific features. The multiple face representation techniques are, however, able to compensate only the small variations and consequently are not effective to tackle with variations in practical applications (e.g., extreme illumination, pose and expression variations). B. Generic Learning An early finding to compensate visual domain shift in FR systems is to employ a generic set to enrich the diversity of the reference gallery set that is the so-called generic learning concept [14]. Generic learning has been widely discussed by many researchers [12], [15], [16]. Su et al. proposed an adaptive generic learning method for FR which utilized external data to estimate the within-class scatter matrix for each individual and applies this information to the reference set [14]. In recent years, integration of sparse representationbased classification (SRC) with generic learning for FR has attracted significant attention. Deng et al. [8] added generic leaning into the SRC framework and proposed the extended SRC (ESRC), which provide additional information from other face datasets to construct an intra-class variation dictionary to represent the changes between the training and probe images. With further research, Deng et al. [9] proposed a generic learning method which projects the generic samples data to null space in order to reduce the negative influence of the naïve variation information. Yang et al. [17] introduced a sparse variation dictionary learning (SVDL) technique by taking the relationship between the reference set and the external generic set into account and obtained a projection by learning from both generic and reference set. In [18], the intra-class variation information from the OD is integrated with the reference set through domain adaptation to enhance the facial models. Authors in [19] proposed a robust auxiliary dictionary learning (RADL) technique that extracts representative information from generic dataset via dictionary learning without assuming prior knowledge of occlusion in probe images. Zhu et al. proposed a local generic representation-based framework (LGR) for FR with SSPP [20]. It builds a gallery dictionary by extracting the neighboring patches from the gallery dataset, while an intra-class variation dictionary is constructed by using an external generic training dataset to predict the intra-class variations. Authors in [21] proposed a robust S2V FR using a multi-classifier system in which each classifier is trained by a reference face still versus many lower-quality faces of non-target individuals captured in videos. In this system, the auxiliary set collected from videos of unknown people in the OD are employed to select discriminant feature sets and ensemble fusion functions. In [22], a supervised autoencoder network is proposed for S2V FR system to generate canonical face representations from unknown video ROIs that are robust to appearance variations commonly found in the operational video scene. Despite the significant improvements reported with generic learning, several critical issues remain to be addressed. The generic intra-class variation may not be similar to that of gallery individuals, so the extraction of discriminative information from the generic set may not be guaranteed. Moreover, the large number of images collected from external data may contain redundant information which could lead to complex implementations and degrade the capability in covering intra-class variations. C. Synthetic Face Generation Augmenting the reference gallery set synthetically is another strategy to compensate the appearance variations in FR with SSPP. Shao et al. in [23] presented a SRC-based FR algorithm that extends the dictionary using a set of synthetic faces generated by calculating the image difference of a pair of faces. Authors in [24] augmented the reference gallery set by generating a set of synthetic face images under cameraspecific lighting conditions to design a robust S2V FR system under surveillance conditions. Blanz and Vetter [25] proposed 3D Morphable Model (3DMM) to reconstruct a 3D face from a single 2D face image and accordingly synthesize new face images. Authors in [26] employed a CNN to regress 3DMM shape and texture parameters directly from an input image without an optimization process which renders the face and compares it to the image. Zhang et al. proposed a 3D Spherical Harmonic Basis Morphable Model (SHBMM) that is an integration of spherical harmonics into the 3DMM framework [27]. Richardson et al. presented a face reconstruction technique from a single image by introducing an end-to-end CNN framework which derives the shape in a coarse-to-fine fashion [28]. In [29] a model-based deep convolutional autoencoder for 3D face reconstructing from a single is proposed, where a convolutional encoder network is combined with an expertdesigned generative model that serves as a decoder. Apart from 3D reconstruction techniques, some 2D-based techniques generate synthetic images under various illumination conditions by transferring the illumination of target images to the reference face images. Authors in [30] proposed an imagebased framework to relight the face through adaptive layer decomposition. Although synthetic images can improve the robustness of FR systems designed with a SSPP, they may not be covering the range intra-class variations in practical scenarios because of redundancy in the learned discriminative subspace, since they are highly correlated with the original face images. Many synthetic images should be generated to account for all possible capture conditions in ODs. Without the selection of representative face images from both the reference gallery and external data, generating the synthetic faces may require complex implementations and yield lower accuracy when training on many less relevant images. To overcome the challenges discussed above, this paper presents a framework that exploits both face synthesis and generic learning. The technique proposed in Section III generates a compact set of synthetic facial images per individual of interest that corresponds to relevant OD capture conditions, by mapping the intra-class variations from a representative set of video ROIs selected from the OD into the original reference still ROIs. 4 III. D OMAIN -S PECIFIC FACE S YNTHESIS This paper focuses on augmenting reference face set to cover the intra-class variations of individual appearing in ODs with a compact set of synthetic ROIs. A new Domain-Specific Face Synthesis (DSFS) technique is proposed that employs knowledge of the OD to generate a compact set of synthetic ROIs for the design of FR systems. Prior to operation, e.g., during a camera calibration process, DSFS selects video ROIs with representative pose angles and illumination conditions from facial trajectories of unknown persons captured in the OD. These video ROIs are selected via clustering facial trajectories in the captured condition space defined by pose and illumination conditions. Next, the DSFS exploits a 3D shape reconstruction method and an image-based illumination transferring technique to generate synthetic ROIs under representative pose angles and illumination conditions from the reference still ROIs. To do so, the 3D models of the reference still ROIs are reconstructed and rendered w.r.t. the representative pose angles. The illumination-dependent layers of the representative illumination conditions are then extracted and projected onto rendered images with the same view by applying a morphing between the layers. In other words, illumination-dependent layers of video ROIs from the OD are replaced with that of the still reference ROI from the ED. Fig. 2 shows the pipeline of the DSFS technique. A. Characterizing the Capture Conditions An important concern for the reference set augmentation is the selection of representative pose angles and illumination conditions to represent relevant capture conditions in the OD. As mentioned, adding a large number of potentially redundant images to the reference set can significantly increase the time and memory complexity, and may degrade the recognition performance due to over-fitting. With the DSFS technique, the representative pose angles and illumination conditions to cover relevant intra-class variations is approximated by characterizing the capture conditions from a large generic set of video ROIs. This set is formed with multiple ROIs isolated in several facial trajectories  of unknown persons captured in the OD. Let define R = ri ∈ Rd×d |i = 1, . . . , n  as the set of ROIs of still reference individuals, and G = gi ∈ Rd×d |i = 1, . . . , m as the video ROIs in the generic set, where n denotes the number of individuals in the reference gallery set, and m total number of ROIs in the generic set, respectively. In the proposed technique (see Fig. 3), an estimation of luminance, contrast and pose are measured for each video ROIs in the generic set gi . Next, a two-step clustering process is applied on video ROIs in the measurement space defined by pose, luminance and contrast. The first step is applied on all ROIs in the 3D metric space defined by pose (tilt, yaw and roll), while the second step is applied on ROIs of each pose cluster in the 2D space defined by luminance and contrast metrics. The prototype of each cluster is considered as an exemplar. The generic variational information obtained during this step is then transferred to the reference still ROIs during the face synthesizing step (see Section III B). Although many algorithms are also suitable to implement DSFS, the following subsections describe DSFS with specific algorithms. 1) Estimation of Head Pose: The estimate of head pose for the ith video ROI (gi ) in the generic set is defined as pi = (θipitch , θiyaw , θroll )i . Euler angles θipitch , θiyaw , and θiroll are used to represent pitch, yaw and roll rotation around X axis, Y axis, and Z axis of the global coordinate system, respectively. In order to estimate the head pose, the discriminative response map fitting method [31] is employed. It is the current state-of-the-art method in terms of fitting accuracy and efficiency suitable for handling occlusions and changing illumination conditions. 2) Luminance-Contrast Distortion: Luminance and contrast distortion measures estimate the distortion between a video ROI and the corresponding reference still ROI. Components of the structural similarity index measure presented [32] are employed to measure the proximity of the average luminance and contrast locally by utilizing sliding window. The global luminance distortion in image quality (GLQ) factor between ri and gj is calculated by sliding a window of B×B pixels from the top-left corner to the bottomright corner of the image, for a total of M sliding steps: li,j = M 1 X 2.µk (ri ).µk (gj ) + Cl , 2 2 M µ (r ) + µk (gj ) + Cl k=1 k i (1) where k is the sliding step and µk denotes mean values of the k th image window. Cl is a constant value defined as Cl = (Kl L)2 where L is the dynamic range of the pixel values and Kl  1. Similarly, the contrast distortion between ri and gi is estimated using global contrast distortion in image quality (GCQ) factor defined as: ci,j = M 1 X 2.σk (ri ).σk (gj ) + Cc , 2 2 M σ (r ) + σk (gj ) + Cc k=1 k i (2) where σk denotes the standard deviation of the k th image window. Cc is a constant value defined as Cc = (Kc L)2 where L is the dynamic range of the pixel values and Kc  1. 3) Representative Selection: Affinity propagation (AP) [33] is applied to cluster video ROIs from the generic set defined in the normalized space defined by pj = (θipitch , θiyaw , θiroll ) and ui = (li , ci ) measures. This clustering algorithm aims to maximize the net similarity (average distortion between ROIs and pose angles), and produce a set exemplars. Two types of messages: responsibility and availability are exchanged between data points until a highquality set of exemplars and corresponding clusters emerges. AP is a suitable clustering technique for DSFS because: (1) it can automatically determine the number of clusters based on the data distribution, and (2) it produced exemplars that correspond to actual ROIs. Indeed, cluster centroids produced by many prototype-based clustering methods are not necessarily actual ROIs with a real-world interpretation. Given that clustering samples simultaneously in terms of both pj and ui may favor certain common pose angles, a two-step clustering algorithm is proposed to preserves diversity in pose angles and illumination effects. In the first step, clustering is 5 Reference ROI Generic Set ri gi Shading-Albedo Decomposition Characterization of Capture Conditions Iuij Mi pi Shading-Albedo Decomposition Rendering Lij ri Si Texture Mapping onto 3D Face Shape Vi Morphing Synthetic face images under representative pose angles Illumination-dependant layers of Lighting representative samples ai 3D Shape Recovery Statistical Deformable Model Trained from the 3D Shape Vectors Synthetic Face Images under Representative Pose & Illumination Domain-specific Synthetic Set Figure 2: Block diagram of the DSFS technique applied to a reference still ROI. gi Estimation of Pose Angles Roll Yaw pi AP Clustering Pitch Generic Set Estimation of Luminance Distortion Pose Clusters li gi AP Clustering inside pose clusters Estimation of Contrast Distortion ci Pose and Lighting Exemplars Figure 3: Pipeline for characterizing capture conditions of video ROIs in the operational domain. performed on the pose angle vector, and then the population of each pose cluster is clustered according to GLQ and GCQ metrics to find the representative luminance and contrast samples. Representative luminance and contrast samples – called lighting exemplar – are found along with representative pose angles – called "pose exemplar" (Fig. 4). P4 Pj ×× ××× × × × ×××××××××××××××××××× ×××××××× ×××××××××××× ×××××××××× × P3 ×××××××××××××× ××××××××××× ××××××× ×××××××××××××××××××× ××××××× × ×××××××××××××× ××××××P×1×××××× ×××××× × × × × × P2 Pitch × ×××××××××××××××××××××× ××××× ×××× × Yaw × Illumination Roll UjNj Uj2 ++ +++ ++++++++ ++ + + ++ +++++++ +++ +++ +++++ + ++ U 3+ + Uj1 ++ j + ++++ +++ ++++ + ++ ++ ++ +++++ +++ ++++++ +++ Contrast Figure 4: An illustration of the AP clustering process. The clustering algorithm inputs a set of pose similarities sp (i, k) = − k pi − pk k2 indicating how well the sample pk with index k is similar to the sample pi from the generic set. The pose responsibility rp (i, k) is defined as the accumulated evidence for how well-suited sample pk is to serve as the exemplar for sample pi , taking into account other potential exemplars for the sample pi . Evidence about whether each pose candidate exemplar would be a good exemplar is obtained from the application of the pose availability ap (i, k). The availability reflects the accumulated evidence for how appropriate it would be for sample pi to choose sample pk as its exemplar, taking into account the support from other samples that sample pk should be an exemplar. The availabilities are initialized to zero, and the pose responsibilities are then computed iteratively using the rule of Eq.3. The availabilities are updated in each iteration using Eq.4. rp (i, k) = sp (i, k) − max {ap (i, k 0 ) + sp (i, k 0 )} , 0 0 k |k 6=k (3) n o X ap (i, k) = min 0, rp (k, k) + max{0, rp (i0 , k)} . (4) i0 |i0 6∈{i,k} For pi , the value of pk that maximizes ap (i, k) + rp (i, k) either identifies sample pi as an exemplar if k = i, or identifies the sample that is the exemplar for sample pi . The message-passing procedure is terminated after a fixed number of iterations when the local cost functions remain constant for some number of iterations. At the end of pose clustering, K pose clusters P = {P1 , P2 , . . . , Pj , . . . , PK } are determined, where pi = [θipitch , θiyaw , θiroll ]. The second clustering is then applied for each pose cluster in the li,j and ci,j measure space to find lighting exemplars. The first step computes illumination-contrast similarities su (i, k) = − k (ui − uk ) k2 . The corresponding responsibility and availability are obtained according to: ru (i, k) = su (i, k) − max {au (i, k 0 ) + su (i, k 0 )} , 0 0 k |k 6=k (5) n o X au (i, k) = min 0, ru (k, k) + max{0, ru (i0 , k)} . (6) i0 |i0 6∈{i,k} The estimated rcl (i, k) and acl (i, k) are combined to mon- 6 itor the exemplar decisions and the algorithm is terminated when these decisions do not change for several iterations. At the end of the illumination-contrast clustering for each pose cluster Pj , a number of Nj lighting clusters Pj = {Uj1 , Uj2 , . . . , UjNj } are obtained. The central representative samples of illumination-contrast clusters in j th pose cluster are considered as the pose and lighting exemplars for j th pose as uij = (lji , cij ), 1 ≤ i ≤ Nj where l and c are illumination and contrast of center of ith illumination-contrast cluster Uji in the j th pose cluster Pj . Larger clusters represent a greater number of generic samples, they should have more influence for the classification. Therefore, a weight is assigned to each exemplar uij to indicate its importance, approximated based on its cluster size, Wij = nij /n, where nij is the number of samples in the cluster Uij and n is the total number of generic samples. This selection strengthens those classes that are more representative in reconstructing a probe sample. the shape vector (S) is defined as Eq.8 [25]. A principal components analysis is performed to estimate the statistics of the 3D shape of the faces. S = S̄ + mX S −1 S = [X1 , Y1 , Z1 , X2 , . . . , Xns , Yns , Zns ]T . ri (x, y) = Bi (x, y).Ti (x, y) = Li (x, y).Mi (x, y).Ti (x, y) , (7) where B(x, y) = L(x, y).M(x, y) is a base layer, and L(x, y), M(x, y) and T(x, y) are shading, material, and texture components at a pixel (x,y), respectively. 2) 3D Face Reconstruction: 3D face model of reference ROIs, ri , are reconstructed using the 3D Morphable Model (3DMM) technique [25][35]. In this study, a customized version of the 3DMM is employed in which the texture fitting of the original 3DMM is replaced with image mapping. By replacing the texture fitting in the original 3DMM with 2D image mapping, an efficient method is implemented for 3D face reconstruction from one frontal face image. Basically, the shape model is defined as a convex combination of shape vectors of a set of examples in which (9) Here, for each reference ROI, ri , we reconstruct the 3D shape. B. Face Synthesis 1) Intrinsic Image Decomposition: Each still reference image, ri , is decomposed and its materialdependent layer (albedo), Mi , is extracted based on the a texture-aware image model defined in [34]. This image decomposition method explicitly models a separate texture layer in addition to the shading layer and material layer in order to avoid ambiguity caused by textures, and employ simple constraints on shading and materials layers effectively. This model is presented as follows: (8) where, the 3D shape is represented by the probability distribution of faces around the averages of shape S̄ are calculated and the basis vectors S̃j , 1 ≤ j ≤ ms in Eq.8 where ms is the number of the basis vectors. Each vector S stores the reconstructed 3D shape in terms of x, y, z-coordinates of all vertices {1, . . . , ns } of a highresolution 3D mesh as Si = S̄ + For generating synthetic ROIs based on the representative pose and lighting conditions, 3D models of reference ROIs are reconstructed and their material-dependent layers are extracted. In the rendering process, the extracted material layers are employed as a texture of the 3D model. This model is rendered w.r.t. the pose exemplars. Following this, the illumination-dependent layers of the lighting exemplars are extracted. Finally, the lighting layers are projected on the rendered images with the same view by applying a morphing between the layers. The following subsections describe the steps proposed for the face synthesizing with DSFS. αk .S̃k , k=1 mX S −1 αji .S̃j , (10) j=1 where αji ∈ [0, 1], 1 ≤ j ≤ ms are the shape parameters and Si is the reconstructed shape of the ith reference still ROI ri . The optimization algorithm presented in [25] is employed to find optimal αji , 1 ≤ j ≤ ms , for each reference still ROI ri . In the next step, the extracted material layers, Mi , are projected to the 3D geometry of the reference gallery set. Given the 3D facial shape and texture, novel poses can be rendered under various forms of the pose by adjusting the parameters of a camera model. In the rendering procedure, the 3D face is projected onto the image plane with Weak Perspective Projection which is a linear approximation of the full perspective projection. mX S −1 Vij = f ∗ Λ ∗ Rij ∗ (S̄ + αji ) + ti2d , (11) j=1 ij where V is the 2D positions of model vertexes of the j th reconstructed pose of ri , f is the scale  factor, Λ is the 1 0 0 orthographic projection matrix 0 1 0 , Rij is the rotation matrix constructed from rotation angles pitch, yaw, roll and t2d is the translation vector [36]. Since the 2D image is directly mapped to the 3D model, no corresponding color information is available for some vertices because they are occluded in the frontal face image. Consequently, it is possible that there are still some blank areas on the generated texture map. In order to correct these blank space areas, a bilinear interpolation algorithm is utilized to fill in areas of unknown texture using the known colors in the vicinity [37]. 3) Illumination Transferring: d×d For each pose exemplar, pj , a set of samples {Ijk |1 ≤ u ∈R k ≤ Nj } corresponding to the ujk , for k = 1, 2, ..., Nj , are selected as lighting exemplars. The illumination-dependent layer of each Ijk u are extracted using the same process described in section III-B1. Then, guided filter with the guidance of the input illumination layer is applied to preserve the 7 structure of the input face. For each pose exemplar pj , Nj the illumination layers, Ljk , for k = 1, 2, ..., Nj , are then projected to the rendered reference, Vij . This is performed by morphing between their filtered version according to the following steps: i) detect the landmark points of Ljk and Vij using active shape model to locate corresponding feature points. The landmark points of Ljk and Vij are denoted as ljk and vij , respectively; ii) define a triangular mesh over ljk and vij via the Delauij nay triangulation technique and obtain djk l and dv ; jk ij iii) coordinate transformations between dl and dv with affine projections on points; iv) warp each triangle separately from the source to destination using mesh warping technique which moves triangular patches to the newly established location to align two ROIs; v) cross-dissolve the triangulated layers considering warped pixel locations. IV. D OMAIN - INVARIANT S TILL - TO -V IDEO FACE R ECOGNITION WITH DSFS Several studies have revealed the limit robustness of S2V FR system where the number of training images per class is limited and the underlying distribution between the still reference and probe video ROIs differ. In this section, a particular S2V FR implementation is considered (see Fig. 5) to assess the impact of using DSFS to generate synthetic ROIs to address these limitations. Design/Enrollment Phase Compact set of synthetic ROIs gi DSFS Reference Still ROIs Synthetic Set Reference Set ri Generic Set Reference Still ROIs Video ROIs Synthetic ROIs ri ai Face Detection Design a Cross-Domain Dictionary Video Frames Dc Operational Phase PK In this way, a number q = j=1 Nj of synthetic ROIs are generated for each reference still ROI ri . Therefore, the total number of synthetic ROIs are qtotal = nq. The synthetic set of ROIs for the ith reference still ROI are presented 2 by Ai = [ai1 , ai2 , . . . , aiq ] ∈ IRd ×q where aij is the j th concatenated synthetic ROI for the ith reference still ROI. The overall process of DSFS face generation technique is formalized in Algorithm 1. Probe Video Frame y Face Detection Probe Video ROI Structured-SRC Sparse Coefficients Compute the Reconstruction Error Output Identity Stream of frames captured by video cameras Cross-Domain Dictionary Probe ROI × Sparse coefficients associated with reference+synthetic ROIs Figure 5: Block diagram of the proposed domain-invariant SRCAlgorithm 1: The DSFS Algorithm d×d |i = 1, . . . , n , and generic set Input: Reference  set R = ri ∈ R G = gi ∈ Rd×d |i = 1, . . . , m . Estimate pose angles. Calculate luminance and contrast distortion measures. // Eq.1, Eq.2 AP clustering on pose space to obtain P = {P1 , P2 , . . . , PK }. // SectionIII-A3 for j = 1 to K do AP clustering on Illumination and contrast space for the Pj to obtain {uji |1 ≤ i ≤ Nj }. // SectionIII-A3 end for i = 1 to n do Extract material-dependent layer of ri (Mi ). // SectionIII-B1 Recover 3D face model of ri using 3DMM (Si ). // SectionIII-B2 Map the texture of Mi to Si . for j = 1 to K do Render under pj pose to obtain Vij . for each uji , i = 1 to Nj do Extract illumination-dependent layers (Ljk ). // SectionIII-B1 Apply guided filter on Ljk . Morphing between the filtered Ljk and Vij to obtain Ai . // SectionIII-B3 end end end Output: all sets of synthetic face ROIs under representative pose and illumination conditions. 2 Ai = [ai1 , ai2 , . . . , aiq ] ∈ IRd ×q , i = 1, 2, . . . , n . based S2V FR system.  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 An augmented dictionary is constructed by employing the synthetic ROIs generated via DSFS technique, and classification is performed via a structured SRC approach. Since the synthetic ROIs for each individual (including the synthetic poses, illuminations, and etc.) form a block in this dictionary, the SRC is considered as a structured sparse recovery problem. The main steps of the proposed domain-invariant S2V FR with dictionary augmentation are summarized as follows: • Step 1: Generation of Synthetic Facial ROIs In the first step, q synthetic ROIs Ai = [ai1 , . . . , aiq ] ∈ 2 Rd ×q are generated for each ri of the reference gallery set using DSFS technique, where q is the number of synthetic ROIs for each class. • Step 2: Augmentation of Dictionary The synthetic ROIs generated through the DSFS technique are added to the reference dictionary to design a cross-domain dictionary. let DR = [Ir 1 , Ir 2 , . . . , Ir n ] ∈ 2 Rd ×n be the reference gallery dictionary, where Ir i is the concatenated result of ri . The cross-domain dictionary 2 DC = [Ir 1 , A1 , . . . , Ir n , An ] ∈ Rd ×n(q+1) integrates the original and synthetic ROIs in a linear model where Aj is the j th set of synthetic ROIs added to the j th class. Since q synthetic ROIs are added to each class, the total 8 The class label of the probe ROIs y is then determined based on the block sparse reconstruction error as follows: number of synthetic ROIs in the cross-domain dictionary are nc = n(q + 1). The presented dictionary design in this work enables SRC to perform recognition with only one reference still ROI and makes it robust to the visual domain shift. • label(y) = arg min k y − D[i]x[i] k2 . i In order to solve the SRC problem of equation 15, the classical alternating direction method (ADM) is considered [38]. ADM is an efficient first-order algorithm with global convergence. Step 3: Classification Given a probe video ROI y, general SRC represents y as a sparse linear combination of the codebook DC , and derives the sparse coefficients of y by solving the `0 minimization problem as follows: min kxk0 A`0 : s.t. y = DC x . In order to apply ADM to the A`2 /`1 problem, we first define an auxiliary variable and transform it into an equivalent problem: (12) Since the generated synthetic ROIs for each individual form a block of the dictionary, a better classification can arise from a representation of the probe ROI produced from the minimum number of blocks from the dictionary instead of looking for the representation of a probe ROI in the dictionary of all the training data using the so-called structured SRC which its goal is to find a representation of a probe ROI that uses the minimum number of blocks from the dictionary. For a dictionary  DC = DC [1], DC [2], . . . , DC [n] with blocks DC [i], i = 1, . . . , n, the block sparsity is formulated in terms of mixed `2 /`0 norm as n X I(k x[i] k2 > 0) s.t. y = DC x , A`2 /`0 : min x min k z k2,1 = x  zgi 0 0 0 .. . vi := Wi x[i] + 0 ··· wi(q+1) for i = 1, . . . , m , 1 (λ1 )gi , β (21) (22) Finally, the multipliers λ1 and λ2 are updated in the standard way: ( λ1 ← λ1 − γ1 β1 (z − x) (23) λ2 ← λ2 − γ2 β2 (DC x − y) ! √ 5+1 , the sequence For β1 , β2 > 0 and γ1 , γ2 ∈ 0, 2  (k) (k) (x , z ) generated by ADM algorithm from any initial point (x(0) , z(0) ) converges to (x∗ , z∗ ), where (x∗ , z∗ ) is a solution of Eq. 19.       1 vi = max k vi k2 − , 0 , β1 k vi k2 where (15) ··· ··· .. . β1 β1 k z − x k22 − λT2 (DC x − y) + k DC x − y k22 . 2 2 Minimizing (Eq. 19) with respect to z is obtained by the one-dimensional shrinkage formula as follows: where 0 wi2 .. . y = DC x . (β1 I+β2 DTC DC )x = β1 z−λ1 +β2 DTC y+DTC λ2 . (20) Finally, the weighted matrix obtained in III-A3 which shows cluster weights is multiplied to the `1 -minimization term. n X A`2 /`1 : min kWi x[i] k2 s.t. y = DC x .  wi1  0  Wi =  .  .. s.t. z = x, (19) where λ1 ∈ Rn , λ2 ∈ Rm are multipliers and β1 , β2 > 0 are penalty parameters. Then we apply the ADM approach to minimize the augmented Lagrangian problem with respect to x and z alternately. The x-subproblem, namely minimizing (Eq. 19) with respect to x, is given by the following linear system: i=1 i=1 k zgi k2 i=1 minx k z k2,1 − λT1 (z − x) + (13) where I(.) is the indicator function, and x[i] is the ith block in the sparse coefficient vector x corresponding to the dictionary block DC [i]. Since each dictionary block corresponds to a specific class, i represents the class index ranging from 1 to n as well. This optimization problem seeks the minimum number of non-zero coefficient blocks that reconstruct the probe ROI. Note that the optimization program A`2 /`0 is NP-hard since it requires searching over all possible few blocks of x and checking whether they span the given y. A relaxation of this problem is obtained by replacing the `0 with the `1 norm and solving the Eq.14. n X A`2 /`1 : min k x[i] k2 s.t. y = DC x . (14) x m X (18) Note that problem (Eq. 18) has two blocks of variables (x and z) and its objective function is separable in the form of f (x) + g(z) since it only involves z, thus ADM is applicable. The augmented Lagrangian problem is of the form i=1 x (17) (16) • Step 4: Validation In practical FR systems, it is important to detect and then 9 reject outlier invalid probe ROIs. We use the sparsity concentration index (SCI) criteria defined in [3]: . k. maxi k δi (x) k1 / k x k1 −1 SCI(x) = k−1 ∈ (0, 1) . (24) where k is the total number of classes in the probe set and x ∈ Rn is a coefficient vector. A probe ROI is accepted as valid if SCI ≥ τ and otherwise rejected as invalid, where τ ∈ (0, 1) is a threshold. The S2V face recognition process through dictionary augmentation is formalized in Algorithm 2. Algorithm 2: A SRC-based still-to-video FR system 1 2 Input: Reference  face models of n classes enlisted in the gallery R = ri ∈ Rd×d |i = 1, . . . , n , generic set G = gi ∈ Rd×d |i = 1, . . . , m , threshold τ , and a probe ROI y. Generate nq synthetic ROIs for each class using the DSFS method. Build the cross domain dictionary DC by adding synthetic ROIs to the reference gallery set. Solve the A`2 /`1 problem using ADM technique. // Eq. 15 3 4 5 if SCI ≥ τ then Find the class label y. // Eq. 17 6 7 else 8 Reject as invalid. Output: Class label of y. V. E XPERIMENTAL M ETHODOLOGY A. Databases In order to validate the proposed DSFS for S2V FR under real-world surveillance conditions, extensive experiments were conducted on two publicly available datasets – COX-S2V [39] and Chokepoint [40]. These datasets were selected because they are the most representative for watch-list screening applications. They contain a high-quality reference image per subject captured under controlled condition (with a still camera), and lower-quality surveillance videos for each subject captured under uncontrolled conditions (with surveillance cameras). Videos are captured over a distributed network of cameras that covers a range of variations (e.g., pose, illumination, scale). COX-S2V dataset [39] contains 1000 individuals, with 1 high-quality still image and 4 low-resolution video sequences per individual simulating video surveillance scenario. In each video, an individual walk through a designed S-shape route with changes in illumination, expression, scale, pose, and blur.The Chokepoint dataset [40] consists of 25 individuals walking trough portal 1, and 29 individuals (23 male and 6 female) walking trough portal 2. The recording of portal 1 and portal 2 are one month apart. A camera rig with 3 cameras is placed just above a door and is used for simultaneously recording the entry of a person during four sessions. In total, the dataset consists of 54 video sequences and 64, 204 face images. The appearance of the face captured have variations in terms of illumination conditions, pose, and misalignment. B. Experimental protocol With the Chokepoint database, 5 individuals are randomly chosen as watch-list individuals that each individual includes a high-quality frontal captured image. Prior to each experiment, the video data is split into 3 parts. ROIs are extracted from the video sequences of 10 other individuals selected at random as a generic set to represent capture conditions. ROIs of the video sequences of the remaining individuals along with video sequences of the 5 already selected watch-list individuals are employed for testing. In order to obtain representative results, this process is repeated 5 times with a different random selection of watch-list and generic set individuals, and the average accuracy is reported with mean and standard deviation over all the runs. With COX-S2V, 30 individuals are randomly considered as watch-list individuals including a high-quality captured image per each individual. Their corresponding lowquality video sequences along with ROIs of the video sequences of 100 other individuals are employed for testing. The ROIs extracted from the video sequences of 100 other individuals are selected at random as a generic set to represent capture conditions. This process is replicated 5 times with different stills and videos of watch-list individuals, and the average accuracy is reported with mean and standard deviation over all the runs. During the enrollment, a generic set of faces is captured from video trajectories across all ODs (i.e., global modeling), and their ROIs are extracted using the Viola-Jones face detection algorithm [41]. Face detection is also applied to still images prior to face synthesis. AP clustering is applied to the generic set, where q representative video ROIs are selected under various pose, illumination and contrast conditions, and a weight is assigned to each exemplar according to the cluster size. Then, q synthetic face images are generated for each individual based on the information obtained from these selected exemplars. Recall that AP clustering seeks exemplars (samples that are representative of clusters), and automatically determines k and q, the number of clusters, for each independent replication. The domain-invariant dictionary is then designed using the reference still and synthetic ROIs. During the operational phase, recognition is performed by coding the probe image over the domain-invariant dictionary regarding the weights obtained in the enrollment domain. Throughout the experiments, the sparsity parameter Λ is fixed to 0.005. For reference, the S2V FR system based on individual-specific SVMs is also evaluated. During the enrollment, a non-linear SVM classifier with RBF kernel is trained for each individual using target ROIs (reference still of the individual plus the related synthetically face images) versus non-target ROIs (reference still of cohort persons plus their synthetic face images). C. Performance Measures To assess the ability of face synthesizing techniques to address shifts in domain, a domain shift quantification (DSQ) measure is employed. With this measure, the similarity between a dictionary designed using synthetic ROIs (DA ) is compared with a dictionary formed with images collected from the OD (DR ) by measuring the mean pixel error between the dictionaries. Given two dictionaries DA and DR with the same number of images, the DSQ measure is defined 10 VI. R ESULTS AND D ISCUSSION This section first presents some examples of synthetic faces generated using the DSFS technique, and compares them with synthetic faces generated using state-of-the-art face synthesizing methods: 3DMM [25], 3DMM-CNN [26], and SHBMM [27]. Then, the performance of S2V FR systems based on individual-specific SVMs and on SRC is presented when using these synthetic facial ROIs for system design. FR performance is assessed when increasing the number of synthetic ROIs per each individual according to pose angles and lighting effects. To characterize the impact on performance, these systems are tested with a growing number of synthetic ROIs and generic training set, and compared with several relevant state-of-the-art S2V FR systems: ESRC [8], RADL [19], SVDL [17]), LGR [20], and Flow-based face frontalization [5]. The final experiment compares the performance of a system designed with synthetic ROIs obtained with DSFS, to a system designed with a growing number of randomly-selected synthetic ROIs. A. Face Synthesis This subsection presents examples of pose and lighting exemplars obtained by clustering of facial trajectories in the captured condition space. Figs. 6a and 6b show an example of pose clusters obtained with Chokepoint video trajectories of 10 individuals, and with COX-S2V video trajectories of 100 individuals. In this experiment, k = 9 and k = 7 pose clusters (exemplars) are typically determined with the Chokepoint and COX-S2V videos, respectively. The second level of clustering is then applied in the illumination and contrast measure space on each pose clusters. Figs. 6c and 6d show the exemplars selected based on both pose and lighting with the proposed representative selection of DSFS (see section III-A). Overall, q = 22 and q = 18 exemplars were typically selected based on both pose and lighting clusters determined in Chokepoint and COX-S2V videos, respectively. Figs. 7a to 7d show examples of synthetic ROIs generated under different pose, illumination and contrast conditions (b) (a) Pose Cluster 3 Pose Cluster 7 1 0.7 0.9 0.6 0.8 0.7 Illumination 0.5 Illumination as Qdsq = kDTR DA kF where a higher value indicates less domain shift [42]. The accuracy of the S2V FR system is assessed per individual of interest at the transaction level, using the receiver operating characteristic (ROC) space, where the true positive rates (TPRs) are plotted as a function of false positive rates (FPRs) over all threshold values. TPR is the proportion of target ROIs that correctly classified as individuals of interest over the total number of target ROIs in the sequence, while FPR is the proportion of non-target ROIs incorrectly classified as individuals of interest over the total number of non-target ROIs. The area under ROC curve is a global scalar measure of accuracy that can be interpreted as the probability of correct classification over the range of TPR and FPR. Accordingly, accuracy of FR systems is estimated using the partial area under ROC curve pAUC(20%) (using the AUC at 0 <FPR≤ 20%). Since the number of target and non-target data are imbalanced, the area under precision-recall curves (AUPR) is also used to estimate the performance of FR systems. 0.4 0.3 0.6 0.5 0.4 0.3 0.2 0.2 0.1 0.4 0.5 0.6 0.7 Contrast (c) 0.8 0.9 1 0.1 0 0.2 0.4 0.6 0.8 1 Contrast (d) Figure 6: Examples of representative selection results using AP clustering technique in terms of (a,b) pose angles, and (c,d) luminance and contrast with Chokepoint dataset on video sequences of 10 individuals and COX-S2V dataset on video sequences of 100 individuals, respectively, where the center of clusters show exemplars. using the DSFS face synthesizing technique on the Chokepoint and COX-S2V datasets, respectively, where Basel Face Model (BFM) are used as generative 3D shape model [35]. In Appendix A, Fig.12 compares the quality of synthetic face generated via DSFS, 3DMM [25], and 3DMM-CNN [26] techniques.. The synthetic ROIs generated using the DSFS are also evaluated quantitatively. Table I shows the DSQ values of the DSFS and other state-of-the-art face synthesizing methods including 3DMM [25] 3DMM-CNN [26], and SHBMM [27] on Chokepoint and COX-S2V datasets. Higher DSQ values indicate a smaller domain shift, and potentially higher recognition rate between the corresponding two domains. The results are provided under the two following scenarios. 1) Frontal View: In the first experiment, 5 individuals in ED are randomly selected. A set of synthetic face are generated with a frontal view under various lighting effects from the still ROI of each individual to design DA . The corresponding video ROIs in the OD under the frontal view are then collected to form DR . Finally, the DSQ is measured for the DA and Dr dictionaries. 2) Profile View: In the second experiment, 5 individuals in ED are again randomly selected. Their synthetic ROIs are generated with profile view and different illumination conditions to form DA . The corresponding video ROIs in OD under profile view are collected to construct DR . Finally, the DSQ is estimated for the dictionaries. As shown in Table I, DSQ values of DSFS method are higher followed most closely by SHBMM in both scenarios. Accordingly, the cross-domain dictionary designed by the synthetic ROIs generated via the DSFS method is most suitable to reduce visual domain shifts and potentially achieve a higher level of accuracy. These results are in line with the recognition performance results. 11 (c) (b) (a) (d) Figure 7: Examples of synthetic ROIs generated under different capture conditions using the DSFS technique with Chokepoint (a,b) and COX-S2V (c,d) datasets. Table I: Average DSQ value for frontal and profile views on Chokepoint and COX-S2V datasets. 0.7 0.54 SVM SRC 0.52 0.65 0.5 DSFQ COX-S2V database Frontal ViewProfile View Frontal ViewProfile View 0.55 0.5 8.27 7.38 8.24 7.63 0.45 3DMM-CNN[26] 7.61 7.03 7.57 7.29 0.4 9.16 7.26 9.34 7.71 Proposed DSFS 9.53 8.17 9.58 8.39 0.46 0.44 0.42 0.4 3DMM[25] SHBMM[27] 0.48 AUPR Chokepoint database pAUC Technique 0.6 0.38 0.36 Baseline p 1 p2 p3 p4 p5 p6 p7 p8 Baseline p p9 Number of Synthetic Pose ROIs per each Individual 1 p2 p3 p4 p5 p6 p7 p8 p9 Number of Synthetic Pose ROIs per each Individual (a) (b) 0.7 0.58 0.56 0.65 0.54 B. Face Recognition 0.52 AUPR pAUC In this subsection, the performance achieved using the S2V FR system based on SRC and DSFS (see Section IV) is assessed experimentally. For reference, the S2V FR system based on individual-specific SVMs is also evaluated. 1) Pose Variations: The S2V FR system is evaluated versus the number of synthetic ROIs that incorporate growing facial pose. Figs. 8a and 8d show the average AUC and AUPR obtained by increasing the number of synthetic ROIs generated using DSFS from k representative pose angles (pi , i = 1 . . . k) and with fixed lighting condition. Results indicate that by adding extra synthetic ROIs generated under representative pose angles allows to outperform baseline systems designed with a original reference still ROI alone. AUC and AUPR accuracy increases by about 10%, typically with only k = 9 and k = 7 synthetic pose ROIs for Chokepoint and COX-S2V datasets, respectively. 2) Mixed Pose and Illumination Variations: The performance of S2V FR systems is assessed versus the number of synthetic ROIs generated under both pose and lighting effects. Figs. 9a and 9d show average AUC and AUPR obtained by increasing the number of synthetic ROIs used to design SRC and SVM classifiers on the Chokepoint and COX-S2V databases, where Ai is a set of synthetic ROIs generated using DSFS technique under various pose and illumination conditions. Adding synthetic ROIs generated under various pose, illumination and contrast conditions allows to significantly outperform the baseline system designed with the original reference still ROI alone. AUC and AUPR accuracy increases by about 40%, typically with only q = 24 and q = 18 synthetic ROIs for Chokepoint and COX-S2V datasets, 0.6 0.55 0.5 0.5 0.48 0.46 0.44 0.45 0.42 0.4 0.4 Baseline p 1 p2 p3 p4 p5 p6 p7 Number of Pose Samples per each Individual (c) Baseline p 1 p2 p3 p4 p5 p6 p7 Number of Pose Samples per each Individual (d) Figure 8: Average AUC and AUPR versus the number of synthetic ROIs generated with DSFS according to various pose and fixed illumination. The S2V FR system employs either SVM and SRC classifiers on Chokepoint (a,b) and COX-S2V (c,d) databases. respectively. As shown in Figs. 9a and 9d, accuracy for DSFS+SRC trends to stabilize to its maximum value when the size of the generic set is greater than q in DSFS. To view performance stabilizing with more than q synthetic ROIs, additional samples were selected randomly among AP clusters. Note that the Chokepoint dataset contains faces captured for a range illumination conditions with various densities. Hence, some exemplars may represent many video ROIs. Our method assigns higher weights to such distributions, and may yield a higher level of performance. The results obtained with DSFS are also compared to S2V FR systems that exploit stateof-the-art face synthesis techniques including 3DMM [25] (with randomly selected images), and SHBMM [27] (with 9 spherical harmonic basis images). As shown in Fig. 9, DSFS always outperforms these other techniques. 3) Impact of Representative Selection: Without prior knowledge of the OD, synthetic faces are generated according to a uniform distribution. Adding a large number of synthetic ROIs to the dictionary as needed to cover all possible cases can 12 1 0.7 0.6 0.7 0.5 0.6 0.4 0.5 0.4 0.3 Baseline 5 10 15 20 25 Baseline 5 10 15 20 1 25 Number of Synthetic Pose and Illumination ROIs per each Individual Number of Synthetic Pose and Illumination ROIs per each Individual 0.9 (a) (b) 0.8 0.6 0.75 0.5 Baseline 0.4 0.7 0.4 Baseline 0.3 0.3 0.2 AUPR 0.8 pAUC 0.5 0.6 0.8 0.9 0.7 0.7 pAUC 1 0.8 3DMM(with all possible cond.)+SRC DSFS(with all capture cond.)+SRC DSFS(with rep. capture cond.)+SRC AUPR pAUC 0.8 conditions. The third dictionary employs 180 synthetic pose ROIs generated under different pose and illumination by 3DMM. The results in Fig. 10 suggest that augmenting the dictionary using representative synthetic ROIs with the DSFS technique yields a higher level of accuracy, particularly under both pose and illumination conditions. 0.8 3DMM+SVM 3DMM-CNN+SVM SHBMM+SVM DSFS+SVM 3DMM+SRC 3DMM-CNN+SRC SHBMM+SRC DSFS+SRC AUPR 0.9 0.7 0.65 0.2 0.6 0.1 0.6 0.1 0 0 Synthetic Pose ROIs 0.55 Synthetic Pose ROIs (a) 0.5 0.5 Synthetic Pose and Illuination ROIs Synthetic Pose and Illuination ROIs (b) 0.45 0.8 1 0.4 0.4 Baseline 5 10 15 20 Baseline 5 10 15 0.9 20 Number of Synthetic Pose and Illumination ROIs per each Individual Number of Synthetic Pose and Illumination ROIs per each Individual 0.8 (c) (d) 0.7 0.7 0.6 ROIs generated with DSFS, 3DMM, and SHBMM according to pose and lighting effects where S2V FR system employs either SVM and SRC classifiers on Chokepoint (a,b) and COX-S2V (c,d) databases. AUPR pAUC Figure 9: Average AUC and AUPR versus the number of synthetic 0.5 0.6 Baseline 0.5 0.4 0.3 0.3 0.2 0.2 0.1 0.1 0 0 Synthetic Pose ROIs Synthetic Pose and Illuination ROIs (c) significantly increase the time and memory complexity of a FR systems and, more importantly, may cause over-fitting. The proposed DSFS technique extracts representative information from the OD to produce a compact set of synthetic ROIs that are robust to intra-class variations in the OD. In order to evaluate the impact of generating synthetic ROIs based on representative information (i.e., pose and lighting cluster instances), three dictionaries are designed for SRC: (1) a dictionary designed with representative synthetic ROIs (DSFS technique); (2) a dictionary designed with the synthetic ROIs under all capture conditions (DSFS without AP clustering); and (3) a dictionary designed under all possible conditions. Figs. 10a and 10d compares the AUC and AUPR of the SRC-based S2V FR system according to different number of synthetic ROIs in terms of pose and illumination conditions. The first scenario evaluates the impact of representative selection in terms of pose with three dictionaries are designed for SRC. The first dictionary typically employs k = 9 and k = 7 representative synthetic pose ROIs generated with the DSFS technique for Chokepoint and COX-S2V datasets, respectively. The second dictionary employs 100 synthetic pose ROIs generated by DSFS technique under all OD capture conditions. The third dictionary employs 180 synthetic pose ROIs generated by 3DMM in a set of rotation angles ranging from to −60 to +60. The second scenario evaluates the impact of representative selection in terms of both pose and illumination conditions with three dictionaries are designed for SRC. The first dictionary typically employs k = 9 and k = 7 representative synthetic ROIs generated under different pose and illumination with the DSFS technique for Chokepoint and COX-S2V datasets, respectively. The second dictionary employs 100 synthetic pose ROIs generated under different pose and illumination by DSFS technique under all OD capture Baseline 0.4 Synthetic Pose ROIs Synthetic Pose and Illuination ROIs (d) Figure 10: Average AUC and AUPR of a S2VFR system designed with representative synthetic ROIs vs a system designed with randomly generated synthetic ROIs on Chokepoint (a,b) and COX-S2V (c,d) datasets. C. Comparison with Reference Techniques With the above experimental setting, we compare the recognition rate of the DSFS technique with the recent face synthesizing methods (3DMM[25], SHBMM[27]) in a S2V FR framework. We also present the impact of using face synthesizing along with KSVD dictionary learning [43]. Following this, the recognition rate of the DSFS technique with existing generic learning techniques (ESRC[8], RADL[19], SVDL[17], LGR[20]) is compared that regularization parameter Λ is set to 0.005. Note that the performance of the face synthesizing techniques is evaluated w/o dictionary learning. We also compared the DSFS results with the results obtained by Flow-based face frontalization method [5]. The quality of frontalization via the flow-based face frontalization technique is shown in Fig. 13 (Appendix B). Table II lists and compares the recognition performance where the results (recognition rate) are illustrated by the mean and standard deviation of 5 runs. Next, we compare the computational complexity in terms of average running time for each individual as well as number of inner products needed per each iteration. Figs. 11a and 11b shows the computational complexity in terms of number of inner products with a growing number of synthetic ROIs. Table. III compares the complexity of the proposed DSFS-SRC algorithm with RADL[19], LGR[20], and flowbased frontalization techniques on Chokepoint and COX-S2V datasets per each iteration. The experiments are conducted in MATLAB R2016b (64bit) Linux version on a PC workstation with an INTEL CPU (3.41-GHz) and 16GB RAM. 13 Table II: Comparative transaction level analysis of the proposed FR approach and related state-of-the art FR methods with Chokepoint and COX-S2V databases. Category pAUC AUPR pAUC AUPR Baseline SRC 0.524±0.041 0.415±0.035 0.563±0.034 0.457±0.036 ESRC[8] SRC SRC-KSVD 0.802±0.028 0.813±0.027 0.651±0.032 0.672±0.020 0.835±0.031 0.842±0.017 0.695±0.032 0.715±0.020 RADL[19] SRC 0.852±0.035 0.724±0.031 0.892±0.025 0.753±0.027 LGR[20] SRC 0.849±0.031 0.717±0.024 0.881±0.028 0.744±0.025 SVDL[17] SRC 0.825±0.022 0.703±0.031 0.843±0.025 0.724±0.031 3DMM[25] SRC SRC-KSVD 0.681±0.037 0.732±0.035 0.523±0.037 0.605±0.032 0.706±0.031 0.757±0.032 0.562±0.032 0.641±0.028 3DMM-CNN[26] SRC SRC-KSVD 0.652±0.028 0.714±0.027 0.516±0.026 0.585±0.025 0.702±0.027 0.721±0.027 0.552±0.025 0.603±0.025 SHBMM[27] SRC SRC-KSVD 0.725±0.034 0.786±0.028 0.593±0.040 0.672±0.022 0.739±0.035 0.791±0.030 0.607±0.041 0.681±0.028 Face Frontalization Flow-based[5] SRC 0.824±0.023 0.711±0.024 0.852±0.028 0.719±0.027 Face Synthesizing + Generic Learning Proposed DSFS SRC 0.903±0.032 0.752±0.037 0.925±0.26 0.774±0.31 Face Synthesizing # 108 18 LGR RADL DSFS+SRC 4.5 cost than other state-of-the-art methods. The main reason is that the dictionary designed by DSFS technique is able to represent real-world capture conditions and does not require a traditional dictionary learning process. # 108 16 4 Number of Inner Products Number of Inner Products COX-S2V database Classifier Generic Learning 5 Chokepoint database Technique 3.5 3 2.5 2 1.5 1 14 12 10 8 6 VII. C ONCLUSIONS 4 2 0.5 0 0 10 50 100 150 200 Number of Synthetic ROIs in the Gallery Dictionary 10 200 400 600 800 1000 Number of Synthetic ROIs in the Gallery Dictionary (a) (b) Figure 11: Time complexity versus the number of synthetic ROIs on Chokepoint (a) and COX-S2V (b) data. Table III: Average computational complexity and time of the DSFS and state-of-the-art techniques on Chokepoint and COXS2V datasets. Technique Chokepoint database COX-S2V database No.inner productsRun time(s)No.inner productsRun time(s) RADL[19] 52,650,000 3.12 350,500,000 6.17 LGR[20] 273,100,000 7.13 1,147,200,000 11.35 Face Frontalization+SRC[5] 40,510,000 3.14 245,320,000 4.08 Proposed DSFS+SRC 32,450,000 1.55 190,250,000 2.61 The results show our proposed method that is a joint use of generic learning and face synthesizing achieves superior recognition results compared to the other methods under the same configuration which verifies that our face synthesizing technique better preserves identity information. Although RADL, LGR and the flow-base face frontalization techniques can achieve comparable accuracy to our approach, they are computationally expensive. It can be concluded that augmenting the SRC with synthetic ROIs generated by DSFS technique has a good recognition rate with less computational This paper proposes a domain-specific face synthesizing (DSFS) technique to improve the performance of still-tovideo FR systems when surveillance videos are captured under various uncontrolled controlled conditions, and individuals are recognized based on a single facial image. The proposed approach takes advantage of operational domain information from the generic set that can effectively represent probe ROIs. A compact set of synthetic faces is generated that resemble individuals of interest under capture conditions relevant to the operational domain. For proof-of-concept validation, augmented dictionary with a block structure is designed based on DSFS, and face classification is performed within a SRC framework. Our experiments on the Chokepoint and COX-S2V datasets show that augmenting the reference discretionary of still-to-video FR systems using the proposed DSFS approach can provide a significantly higher level of accuracy compared to state-of-the-art approaches, with only a moderate increase in its computational complexity. Result indicated that face synthesis alone cannot effectively resolve the challenges of the SSPP and visual domain shift problems. With DSFS, generic learning and face synthesis operate complementarity. The proposed DSFS technique could be improved to generate synthetic faces with expression variations for a robust FR. In addition, to improve performance, the representative synthetic ROIs generated using DSFS could be applied to generate local camera-specific ROIs. DSFS is general in that synthetic ROIs could be applied to train or fine-tune a multitude of face recognition systems like deep CNNs, with information that robust models to specific operational domains. 14 R EFERENCES [1] M. A. A. Dewan, E. Granger, G.-L. Marcialis, R. Sabourin, F. Roli, Adaptive appearance model tracking for still-to-video face recognition, Pattern Recognition 49 (2016) 129–151. [2] S. Bashbaghi, E. Granger, R. Sabourin, G.-A. Bilodeau, Dynamic ensembles of exemplar-svms for still-to-video face recognition, Pattern Recognition 69 (2017) 61–81. [3] J. Wright, A. Y. Yang, A. Ganesh, S. S. Sastry, Y. Ma, Robust face recognition via sparse representation, IEEE Transactions on Pattern Analysis and Machine Intelligence 31 (2) (2009) 210–227. [4] A. Wanger, J. Wright, A. Ganesh, Z. Zhou, Y. Ma, Towards a practical face recognition system: robust registration and illumination by sparse representation, IIEEE Transactions on Pattern Analysis and Machine Intelligence 34 (2) (2009) 597–604. [5] T. Hassner, S. Harel, E. Paz, R. Enbar, Effective face frontalization in unconstrained images, in: CVPR, 2015, pp. 4295–4304. [6] Y. Liu, I. J. Wassell, A new face recognition algorithm based on dictionary learning for a single training sample per person, in: BMVC, 2015. [7] I. Masi, A. T. Tran, T. Hassner, J. T. Leksut, G. Medioni, Do we really need to collect millions of faces for effective face recognition?, in: ECCV, 2016. [8] W. Deng, J. Hu, J. Guo, Extended SRC: Undersampled face recognition via intraclass variant dictionary, IEEE Transactions on Pattern Analysis and Machine Intelligence 34 (9). [9] W. Deng, J. Hu, X. Zhou, J. Guo, Equidistant prototypes embedding for single sample based face recognition with generic learning and incremental learning, Pattern Recognition 47 (12) (2014) 3738–3749. [10] E. Elhamifar, R. Vidal, Robust classification using structured sparse representation, in: CVPR, 2011, pp. 1873–1879. [11] S. Bashbaghi, E. Granger, R. Sabourin, G.-A. Bilodeau, Robust watchlist screening using dynamic ensembles of svms based on multiple face representations, Machine Vision and Applications 28. [12] J. Lu, Y.-P. Tan, G. Wang, Discriminative multimanifold analysis for face recognition from a single training sample per person, IEEE Transactions on Pattern Analysis and Machine Intelligence 35 (1) (2013) 39–51. [13] W. AbdAlmageed, Y. Wu, S. Rawls, S. Harel, T. Hassner, I. Masi, J. Choi, J. Lekust, J. Kim, P. Natarajan, et al., Face recognition using deep multi-pose representations, in: WACV, 2016, pp. 1–9. [14] Y. Su, S. Shan, X. Chen, W. Gao, Adaptive generic learning for face recognition from a single sample per person, in: CVPR, 2010, pp. 2699– 2706. [15] Y. Gao, J. Ma, A. L. Yuille, Semi-supervised sparse representation based classification for face recognition with insufficient labeled samples, IEEE Transactions on Image Processing 26 (5) (2017) 2545–2560. [16] Z.-M. Li, Z.-H. Huang, K. Shang, A customized sparse representation model with mixed norm for undersampled face recognition, IEEE Transactions on Information Forensics and Security 11 (10) (2016) 2203–2214. [17] M. Yang, L. Van Gool, L. Zhang, Sparse variation dictionary learning for face recognition with a single training sample per person, in: ICCV, 2013, pp. 689–696. [18] F. Nourbakhsh, E. Granger, G. Fumera, An extended sparse classification framework for domain adaptation in video surveillance, in: ACCV, 2016, pp. 360–376. [19] C.-P. Wei, Y.-C. F. Wang, Undersampled face recognition via robust auxiliary dictionary learning, IEEE Transactions on Image Processing 24 (6) (2015) 1722–1734. [20] P. Zhu, M. Yang, L. Zhang, I.-Y. Lee, Local generic representation for face recognition with single sample per person, in: ACCV, 2014, pp. 34–50. [21] S. Bashbaghi, E. Granger, R. Sabourin, G.-A. Bilodeau, Ensembles of exemplar-svms for video face recognition from a single sample per person, in: AVSS, 2015, pp. 1–6. [22] M. Parchami, S. Bashbaghi, E. Granger, S. Sayed, Using deep autoencoders to learn robust domain-invariant representations for still-to-video face recognition, in: AVSS, 2017, pp. 1–6. [23] C. Shao, X. Song, Z.-H. Feng, X.-J. Wu, Y. Zheng, Dynamic dictionary optimization for sparse-representation-based face classification using local difference images, Information Sciences 393 (2017) 1–14. [24] F. Mokhayeri, E. Granger, G.-A. Bilodeau, Synthetic face generation under various operational conditions in video surveillance, in: ICIP, 2015, pp. 4052–4056. [25] V. Blanz, T. Vetter, Face recognition based on fitting a 3D morphable model, IEEE Transactions on Pattern Analysis and Machine Intelligence 25 (9) (2003) 1063–1074. [26] A. T. Tran, T. Hassner, I. Masi, G. Medioni, Regressing robust and discriminative 3D morphable models with a very deep neural network, in: CVPR, 2017, pp. 1493–1502. [27] L. Zhang, D. Samaras, Face recognition from a single training image under arbitrary unknown lighting using spherical harmonics, IEEE Transactions on Pattern Analysis and Machine Intelligence 28 (3) (2006) 351–363. [28] E. Richardson, M. Sela, R. Or-El, R. Kimmel, Learning detailed face reconstruction from a single image, in: CVPR, 2017, pp. 5553–5562. [29] A. Tewari, M. Zollhöfer, H. Kim, P. Garrido, F. Bernard, P. Pérez, C. Theobalt, Mofa: Model-based deep convolutional face autoencoder for unsupervised monocular reconstruction, arXiv preprint arXiv:1703.10580. [30] X. Chen, H. Wu, X. Jin, Q. Zhao, Face illumination manipulation using a single reference image by adaptive layer decomposition, IEEE Transactions on Image Processing 22 (11) (2013) 4249–4259. [31] A. Asthana, S. Zafeiriou, S. Cheng, M. Pantic, Robust discriminative response map fitting with constrained local models, in: CVPR, 2013, pp. 3444–3451. [32] Z. Wang, A. C. Bovik, H. R. Sheikh, E. P. Simoncelli, Image quality assessment: from error visibility to structural similarity, IEEE Transactions on Image Processing 13 (4) (2004) 600–612. [33] B. J. Frey, D. Dueck, Clustering by passing messages between data points, science 315 (5814) (2007) 972–976. [34] J. Jeon, S. Cho, X. Tong, S. Lee, Intrinsic image decomposition using structure-texture separation and surface normals, in: ECCV, 2014, pp. 218–233. [35] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, T. Vetter, A 3D face model for pose and illumination invariant face recognition, in: AVSS, 2009, pp. 296–301. [36] X. Zhu, Z. Lei, X. Liu, H. Shi, S. Z. Li, Face alignment across large poses: A 3D solution, in: CVPR, 2016, pp. 146–155. [37] D. Jiang, Y. Hu, S. Yan, L. Zhang, H. Zhang, W. Gao, Efficient 3d reconstruction for face recognition, Pattern Recognition 38 (6) (2005) 787–798. [38] W. Deng, W. Yin, Y. Zhang, Group sparse optimization by alternating direction method, in: SPIE, Vol. 8858, 2013, p. 88580R. [39] Z. Huang, S. Shan, R. Wang, H. Zhang, S. Lao, A. Kuerban, X. Chen, A benchmark and comparative study of video-based face recognition on cox face database, IEEE Transactions on Image Processing 24 (12) (2015) 5967–5981. [40] Y. Wong, S. Chen, S. Mau, C. Sanderson, B. C. Lovell, Patch-based probabilistic image quality assessment for face selection and improved video-based face recognition, in: CVPRW, 2011, pp. 74–81. [41] P. Viola, M. J. Jones, Robust real-time face detection, International Journal of Computer Vision 57 (2) (2004) 137–154. [42] J. Ni, Q. Qiu, R. Chellappa, Subspace interpolation via dictionary learning for unsupervised domain adaptation, in: CVPR, 2013, pp. 692– 699. [43] M. Aharon, M. Elad, A. Bruckstein, rmk-svd: An algorithm for designing overcomplete dictionaries for sparse representation, IEEE Transactions on Signal Processing 54 (11) (2006) 4311–4322. A PPENDIX A. Face Synthesizing Results Examples of the synthetic face images generated via DSFS, 3DMM[25] and 3DMM-CNN[26] techniques for individual ID#23 of the Chokepoint dataset in Fig. 12 shown. B. Face Frontalization Results Fig. 13 shows an example of the face frontalized for the facial probe ROI for individual ID#23 of the Chokepoint dataset via the flow-based face frontalization technique [5]. 15 (i) (ii) (iii) (i) (iv) (v) (ii) (iii) (i) (iv) (v) (ii) (iii) Figure 12: Synthetic face images generated via (a) DSFS, (b) 3DMM, (c) 3DMM-CNN with Chockpoint data. Figure 13: Face frontalization via flow-based technique: (a) probe face image under profile view, (b) frontalized face image. (iv) (v)
1cs.CV
Differentially Private Ordinary Least Squares Or Sheffet 1 arXiv:1507.02482v4 [cs.DS] 21 Aug 2017 Abstract Linear regression is one of the most prevalent techniques in machine learning; however, it is also common to use linear regression for its explanatory capabilities rather than label prediction. Ordinary Least Squares (OLS) is often used in statistics to establish a correlation between an attribute (e.g. gender) and a label (e.g. income) in the presence of other (potentially correlated) features. OLS assumes a particular model that randomly generates the data, and derives tvalues — representing the likelihood of each real value to be the true correlation. Using t-values, OLS can release a confidence interval, which is an interval on the reals that is likely to contain the true correlation; and when this interval does not intersect the origin, we can reject the null hypothesis as it is likely that the true correlation is non-zero. Our work aims at achieving similar guarantees on data under differentially private estimators. First, we show that for wellspread data, the Gaussian Johnson-Lindenstrauss Transform (JLT) gives a very good approximation of t-values; secondly, when JLT approximates Ridge regression (linear regression with l2 -regularization) we derive, under certain conditions, confidence intervals using the projected data; lastly, we derive, under different conditions, confidence intervals for the “Analyze Gauss” algorithm (Dwork et al., 2014). 1. Introduction Since the early days of differential privacy, its main goal was to design privacy preserving versions of existing techniques for data analysis. It is therefore no surprise that several of the first differentially private algorithms were machine learning algorithms, with a special emphasis on the ubiquitous problem of linear regression (Kasiviswanathan et al., 2008; Chaudhuri et al., 2011; Kifer et al., 2012; Bass1 Computing Science Dept., University of Alberta, Edmonton AB, Canada. This work was done when the author was at Harvard University, supported by NSF grant CNS-123723. Correspondence to: Or Sheffet <[email protected]>. ily et al., 2014). However, all existing body of work on differentially private linear regression measures utility by bounding the distance between the linear regressor found by the standard non-private algorithm and the regressor found by the privacy-preserving algorithm. This is motivated from a machine-learning perspective, since bounds on the difference in the estimators translate to error bounds on prediction (or on the loss function). Such bounds are (highly) interesting and non-trivial, yet they are of little use in situations where one uses linear regression to establish correlations rather than predict labels. In the statistics literature, Ordinary Least Squares (OLS) is a technique that uses linear regression in order to infer the correlation between a variable and an outcome, especially in the presence of other factors. And so, in this paper, we draw a distinction between “linear regression,” by which we refer to the machine learning technique of finding a specific estimator for a specific loss function; and “Ordinary Least Squares,” by which we refer to the statistical inference done assuming a specific model for generating the data and that uses linear regression. Many argue that OLS is the most prevalent technique in social sciences (Agresti & Finlay, 2009). Such works make no claim as to the labels of a new unlabeled batch of samples. Rather they aim to establish the existence of a strong correlation between the label and some feature. Needless to say, in such works, the privacy of individuals’ data is a concern. In order to determine that a certain variable xj is positively (resp. negatively) correlated with an outcome y, OLS assumes a model where the outcome y is a noisy version of a linear mapping of all variables: y = β · x + e (with e denoting random Gaussian noise) for some predetermined xi , yi ) OLS and unknown β . Then, given many samples (x establishes two things: (i) when fitting a linear function to best predict y from x over the sample (via computing  P P T −1 β= β̂ ( i yix i )) the coefficient β̂j is positive i x ix i (resp. negative); and (ii) inferring, based on βˆj , that the true βj is likely to reside in R>0 (resp. R<0 ). In fact, the crux in OLS is by describing βj using a probability distribution over the reals, indicating where βj is likely to fall, derived by computing t-values. These values take into account both the variance in the data as well as the variance of the noise e.1 Based on this probability distribution one can 1 For example, imagine we run linear regression on a certain β with coordinates β̂1 = β̂2 = (X, y ) which results in a vector β̂ Differentially Private Ordinary Least Squares define the α-confidence interval — an interval I centered at β̂j whose likelihood to contain βj is 1 − α. Of particular importance is the notion of rejecting the null-hypothesis, where the interval I does not contain the origin, and so one is able to say with high confidence that βj is positive (resp. negative). Further details regarding OLS appear in Section 2. In this work we give the first analysis of statistical inference for OLS using differentially private estimators. We emphasize that the novelty of our work does not lie in the differentially-private algorithms, which are, as we discuss next, based on the Johnson-Lindenstrauss Transform (JLT) and on additive Gaussian noise and are already known to be differentially private (Blocki et al., 2012; Dwork et al., 2014). Instead, the novelty of our work lies in the analyses of the algorithms and in proving that the output of the algorithms is useful for statistical inference. The Algorithms. Our first algorithm (Algorithm 1) is an adaptation of Gaussian JLT. Proving that this adaptation remains (, δ)-differentially private is straightforward (the proof appears in Appendix A.1). As described, the algorithm takes as input a parameter r (in addition to the other parameters of the problem) that indicates the number of rows in the JL-matrix. Later, we analyze what should one set as the value of r. Our second algorithm is taken Algorithm 1 Outputting a private Johnson-Lindenstrauss projection of a matrix. n×d Input: A matrix A ∈ R and a bound B > 0 on the l2 -norm of any row in A. Privacy parameters: , δ > 0. Parameter r indicating the number of rows in the resulting matrix. p  2 Set w s.t. w2 = 8B 2r ln(8/δ) + 2 ln(8/δ) . Sample Z ∼ Lap(4B 2 /) and let σmin (A) denote the smallest singular value of A. 2 if σmin (A)2 > w2 + Z + 4B ln(1/δ) then  Sample a (r×n)-matrix R whose entries are i.i.d samples from a normal Gaussian. return RA and “matrix unaltered”. else Let A0 denote the result of appending A with the d×dmatrix wId×d . Sample a (r × (n + d))-matrix R whose entries are i.i.d samples from a normal Gaussian. returnRA0 and “matrix altered”. end if verbatim from the work of Dwork et al (2014). We de0.1. Yet while the column X1 contains many 1s and (−1)s, the column X2 is mostly populated with zeros. In such a setting, OLS gives that it is likely to have β1 ≈ 0.1, whereas no such guarantees can be given for β2 . liberately focus on algorithms that approximate the 2nd moment matrix of the data and then run hypothesis-testing by post-processing the output, for two reasons. First, they enable sharing of data2 and running unboundedly many hypothesis-tests. Since, we do not deal with OLS based on the private single-regression ERM algorithms (Chaudhuri et al., 2011; Bassily et al., 2014) as such inference requires us to use the Fisher-information matrix of the loss function — but these algorithms do not minimize a private loss-function but rather prove that outputting the minimizer of the perturbed loss-function is private. This means that differentially-private OLS based on these ERM algorithms requires us to devise new versions of these algorithms, making this a second step in this line of work... (After first understanding what we can do using existing algorithms.) We leave this approach — as well as performing private hypothesis testing using a PTR-type algorithm (Dwork & Lei, 2009) (output merely reject / don’t-reject decision without justification), or releasing only relevant tests judging by their p-values (Dwork et al., 2015) — for future work. Our Contribution and Organization. We analyze the performances of our algorithms on a matrix A of the form A = [X; y ], where each coordinate yi is generated according to the homoscedastic model with Gaussian noise, which is a classical model in statistics. We assume the existence of a vector β s.t. for every i we have yi = β Tx i + ei and ei is sampled i.i.d from N (0, σ 2 ).3 We study the result of running Algorithm 1 on such data in the two cases: where A wasn’t altered by the algorithm and when A was appended by the algorithm. In the former case, Algorithm 1 boils down to projecting the data under a Gaussian JLT. Sarlos (2006) has already shown that the JLT is useful for linear regression, yet his work bounds the l2 -norm of the difference between the estimated regression before and after the projection. Following Sarlos’ work, other works in statistics have analyzed compressed 2 Researcher A collects the data and uses the approximation of the 2nd -moment matrix to test some OLS hypothesis; but once the approximation is published researcher B can use it to test for a completely different hypothesis. 3 This model may seem objectionable. Assumptions like the noise independence, 0-meaned or sampled from a Gaussian distribution have all been called into question in the past. Yet due to the prevalence of this model we see fit to initiate the line of work on differentially private Least Squares with this Ordinary model. Algorithm 2 “Analyze Gauss” Algorithm of Dwork et al (2014). Input: A matrix A ∈ Rn×d and a bound B > 0 on the l2 -norm of any row in A. Privacy parameters: , δ > 0. N ← symmetric (d × d)-matrix with upper   triangle entries sampled i.i.d from N 0, 2B T return A A + N . 4 ln(2/δ) 2 . Differentially Private Ordinary Least Squares linear regression (Zhou et al., 2007; Pilanci & Wainwright, 2014a;b). However, none of these works give confidence intervals based on the projected data, presumably for three reasons. Firstly, these works are motivated by computational speedups, and so they use fast JLT as opposed to our analysis which leverages on the fact that our JL-matrix is composed of i.i.d Gaussians. Secondly, the focus of these works is not on OLS but rather on newer versions of linear regression, such as Lasso or when β lies in some convex set. Lastly, it is evident that the smallest confidence interval is derived from the data itself. Since these works do not consider privacy applications, (actually, (Zhou et al., 2007; Pilanci & Wainwright, 2014a) do consider privacy applications of the JLT, but quite different than differential privacy) they assume the analyst has access to the data itself, and so there was no need to give confidence intervals for the projected data. Our analysis is therefore the first, to the best of our knowledge, to derive t-values — and therefore achieve all of the rich expressivity one infers from tvalues, such as confidence bounds and null-hypotheses rejection — for OLS estimations without having access to X itself. We also show that, under certain conditions, the sample complexity for correctly rejecting the null-hypothesis increases from a certain bound N0 (without privacy) to a √ bound of N0 + Õ( N0 · κ( n1 AT A)/) with privacy (where κ(M ) denotes the condition number of the matrix M .) This appears in Section 3. In Section 4 we analyze the case Algorithm 1 does append the data and the JLT is applied to A0 . In this case, solving the linear regression problem on the projected A0 approximates the solution for Ridge Regression (Tikhonov, 1963; Hoerl & Kennard, we aim  P 1970).T In 2Ridge2 Regression 2 z to solve minz (y − z x ) + w kz k , which means i i i we penalize vectors whose l2 -norm is large. In general, it is not known how to derive t-values from Ridge regression, and the literature on deriving confidence intervals solely from Ridge regression is virtually non-existent. Indeed, prior to our work there was no need for such calculations, as access to the data was (in general) freely given, and so deriving confidence intervals could be done by appealing back to OLS. We too are unable to derive approximated t-values in the general case, but under additional assumptions about the data — which admittedly depend in part on β k and so cannot be verified solely from the data — we kβ show that solving the linear regression problem on RA0 allows us to give confidence intervals for βj , thus correctly determining the correlation’s sign. In Section 5 we discuss the “Analyze Gauss” algorithm (Dwork et al., 2014) that outputs a noisy version of a covariance of a given matrix using additive noise rather than multiplicative noise. Empirical work (Xi et al., 2011) shows that Analyze Gauss’s output might be non-PSD if the input has small singular values, and this results in truly bad regressors. Nonetheless, under additional conditions (that imply that the output is PSD), we derive confidence bounds for Dwork et al’s “Analyze Gauss” algorithm. Finally, in Section 6 we experiment with the heuristic of computing the t-values directly from the outputs of Algorithms 1 and 2. We show that Algorithm 1 is more “conservative” than Algorithm 2 in the sense that it tends to not reject the null-hypothesis until the number of examples is large enough to give a very strong indication of rejection. In contrast, Algorithm 2 may wrongly rejects the null-hypothesis even when it is true. Discussion. Some works have already looked at the intersection of differentially privacy and statistics (Dwork & Lei, 2009; Smith, 2011; Chaudhuri & Hsu, 2012; Duchi et al., 2013; Dwork et al., 2015) (especially focusing on robust statistics and rate of convergence). But only a handful of works studied the significance and power of hypotheses testing under differential privacy, without arguing that the noise introduced by differential privacy vanishes asymptotically (Vu & Slavkovic, 2009; Uhler et al., 2013; Wang et al., 2015; Rogers et al., 2016). These works are experimentally promising, yet they (i) focus on different statistical tests (mostly Goodness-of-Fit and Independence testing), (ii) are only able to prove results for the case of simple hypothesis-testing (a single hypothesis) with an efficient data-generation procedure through repeated simulations — a cumbersome and time consuming approach. In contrast, we deal with a composite hypothesis (we simultaneously reject all β s with sign(βj ) 6= sign(β̂j )) by altering the confidence interval (or the critical region). One potential reason for avoiding confidence-interval analysis for differentially private hypotheses testing is that it does involve re-visiting existing results. Typically, in statistical inference the sole source of randomness lies in the underlying model of data generation, whereas the estimators themselves are a deterministic function of the dataset. In contrast, differentially private estimators are inherently random in their computation. Statistical inference that considers both the randomness in the data and the randomness in the computation is highly uncommon, and this work, to the best of our knowledge, is the first to deal with randomness in OLS hypothesis testing. We therefore strive in our analysis to separate the two sources of randomness — as in classic hypothesis testing, we use α to denote the bound on any bad event that depends solely on the homoscedastic model, and use ν to bound any bad event that depends on the randomized algorithm.4 (Thus, any result which is originally of the form “α-reject the null-hypothesis” is now converted into a result “(α+ν)-reject the null hypothesis”.) 4 Or any randomness in generating the feature matrix X which standard OLS theory assumes to be fixed, see Theorems 2.2 and 3.3. Differentially Private Ordinary Least Squares 2. Preliminaries and OLS Background kζk2 ∼ χ2k , and taking the quantity Z/ p kζk2 /k. It is a k→∞ Notation. Throughout this paper, we use lower-case letters to denote scalars (e.g., yi or ei ); bold characters to denote vectors; and UPPER-case letters to denote matrices. The l-dimensional all zero vector is denoted 0l , and the l × m-matrix of all zeros is denoted 0l×m . We use e β in our model; and to denote the specific vector y − Xβ though the reader may find it a bit confusing but hopefully clear from the context — we also use e j and e k to denote elements of the natural basis (unit length vector in the direction of coordinate j or k). We use , δ to denote the privacy parameters of Algorithms 1 and 2, and use α and ν to denote confidence parameters (referring to bad events that hold w.p. ≤ α and ≤ ν resp.) based on the homoscedastic model or the randomized algorithm resp. We also stick to the notation from Algorithm 1 and use w to denote the posip  8B 2 2 tive scalar for which w =  2r ln(8/δ) + ln(8/δ) throughout this paper. We use standard notation for SVD composition of a matrix (M = U ΣV T ), its singular values and its Moore-Penrose inverse (M + ). The Gaussian distribution. A univariate Gaussian N (µ, σ 2 ) denotes the Gaussian distribution whose mean is µ and variance σ 2 . Standard concentration bounds on p Gaussians give that Pr[x > µ + 2σ ln(2/ν)] < ν µ, Σ) for any ν ∈ (0, 1e ). A multivariate Gaussian N (µ for some positive semi-definite Σ denotes the multivariate Gaussian distribution where the mean of the j-th coordinate is the µj and the covariance between coordinates j and k is Σj,k . The PDF of such Gaussian is defined only on the subspace colspan(Σ). A matrix Gaussian distribution, denoted N (Ma×b , Ia×a , V ) has mean M , independence among its rows and variance V for each of its columns. We also require the following property of Gaussian random variables: Let X and Y be two random Gaussians s.t. X ∼ N (0, σ 2 ) and Y ∼ N (0, λ2 ) where 2 1 ≤ σλ2 ≤ c2 for some c, then for any S ⊂ R we have 1 c Prx←Y [x ∈ S] ≤ Prx←X [x ∈ S] ≤ cPrx←Y [x ∈ S/c] (see Proposition A.2). Additional Distributions. We denote by Lap(σ) the Laplace distribution whose mean is 0 and variance is 2σ 2 . The χ2k -distribution, where k is referred to as the degrees of freedom of the distribution, is the distribution over the l2 -norm squared of the sum of k independent normal Gaussians. That is, given i.i.d X1 , . . . , Xk ∼ def N (0, 1) it holds that ζ = (X1 , X2 , . . . , Xk ) ∼ 2 N (00k , Ik×k ), and kζζ k ∼ χ2k . Existing tail bounds on the hχ2k distribution (Laurent & Massart, 2000) give that i p √ 2 2 Pr kζζ k ∈ ( k ± 2 ln(2/ν)) ≥ 1 − ν. The Tk distribution, where k is referred to as the degrees of freedom of the distribution, denotes the distribution over the reals created by independently sampling Z ∼ N (0, 1) and known fact that Tk → N (0, 1), thus it is a common practice to apply Gaussian tail bounds to the Tk -distribution when k is sufficiently large. Differential Privacy. In this work, we deal with input in the form of a n × d-matrix with each row bounded by a l2 -norm of B. Two inputs A and A0 are called neighbors if they differ on a single row. Definition 2.1 ((Dwork et al., 2006a)). An algorithm ALG which maps (n × d)-matrices into some range R is (, δ)differential privacy it holds that Pr[ALG(A) ∈ S] ≤ e Pr[ALG(A0 ) ∈ S] + δ for all neighboring inputs A and A0 and all subsets S ⊂ R. Background on OLS. For the unfamiliar reader, we give here a very brief overview of the main points in OLS. Further details, explanations and proofs appear in Section A.3. xi , yi )}ni=1 where ∀i, x i ∈ We are given n observations {(x p R and yi ∈ R. We assume the existence of β ∈ Rp s.t. the label yi was derived by yi = β Tx i + ei where ei ∼ N (0, σ 2 ) independently (also known as the homoscedastic Gaussian model). We use the matrix notation where X denotes the (n × p)- feature matrix and y denotes the labels. We assume X has full rank. The parameters of the model are therefore β and σ 2 , which we set to discover. To that end, we minimize minz kyy − Xzz k2 and have β = (X T X)−1 X Ty = (X T X)−1 X T (Xββ + e) = β + X +e (1) β̂ ζ = y − Xβ̂β = (Xββ + e ) − X(ββ + X +e ) = (I − XX + )ee (2) And then for any coordinate j the t-value, which def β̂j −βj q is the quantity t(βj ) = , is ζk kζ −1 T (X X)j,j · √n−p distributed according to Tn−p I.e., h i -distribution. R β and ζ satisfying t(βj ) ∈ S = Pr β̂ PDFTn−p (x)dx S for any measurable S ⊂ R. Thus t(βj ) describes the likelihood of any βj — for any z ∈ R we can now give an estimation of how likely it is to have βj = z (which is PDFTn−p (t(z))), and this is known as t-test for the value z. In particular, given 0 < α < 1, we denote cα as the number for which the interval (−cα , cα ) contains a probability mass of 1 − α from the Tn−p -distribution. And so we derive a corresponding confidence interval Iα centered at β̂j where βj ∈ Iα with confidence of level of 1 − α. def Of particular importance is the quantity t0 = t(0) = √ β̂j n−p q ,since (X T X)−1 j,j kζζ k if there is no correlation between xj and y then the likelihood of seeing βˆj depends on the ratio of its magnitude to its standard deviation. As mentioned k→∞ earlier, since Tk → N (0, 1), then rather than viewing Differentially Private Ordinary Least Squares this t0 as sampled from a Tn−p -distribution, it is common to think of t0 as a sample from a normal Gaussian N (0, 1). This allows us to associate t0 with a p-value, estimating the event “βj and β̂j have different signs.” Specifically, given α ∈ (0, 1/2), we α-reject the null hypothesis if p0 < α. R∞ 2 Let τα be the number s.t. Φ(τα ) = τα √12π e−x /2 dx = α. This means we α-reject the null hypothesis when |t0 | > τα . We now lower bound the number of i.i.d sample points needed in order to α-reject the null hypothesis. This bound is our basis for comparison between standard OLS and the differentially private version.5 Theorem 2.2. Fix any positive definite matrix Σ ∈ Rp×p and any ν ∈ (0, 21 ). Fix parameters β ∈ Rp and σ 2 and a coordinate j s.t. βj 6= 0. Let X be a matrix whose n rows are i.i.d samples from N (00, Σ), and β )i is sampled i.i.d from y be a vector where yi − (Xβ N (0, σ 2 ). Fix α ∈ (0, 1). Then w.p. ≥ 1 − α − ν we have p that OLS’s (1 − α)-confidence interval has length O(cα σ 2 /(nσmin (Σ))) provided n ≥ C1 (p + ln(1/ν)) for some sufficiently large constant C1 . Furthermore, there exists a constant C2 such that w.p. ≥ 1 − α − ν OLS n (correctly) rejects the null hypothesis provided n ≥ o 2 c2α +τα σ2 max C1 (p + ln(1/ν)), p + C2 β 2 · σmin (Σ) , where cα j Rc is the number for which −cαα PDFTn−p (x)dx = 1 − α. 3. OLS over Projected Data In this section we deal with the output of Algorithm 1 in the special case where Algorithm 1 outputs matrix unaltered and so we work with RA. To clarify, the setting is as follows. We denote A = [X; y ] the column-wise concatenation of the (n × (d − 1))-matrix X with the n-length vector y . (Clearly, we can denote any column of A as y and any subset of the remaining columns as the matrix X.) We therefore denote the output RA = [RX; Ryy ] and for simplicity we denote M = RX and p = d − 1. We denote the SVD decomposition of X = U ΣV T . So U is an orthonormal basis for the columnspan of X and as X is full-rank V is an orthonormal basis for Rp . Finally, in our work we examine the linear regression problem derived from the projected data. That is, we denote β = (X T RT RX)−1 (RX)T (Ryy ) = β + (RX)+ Ree β̃ σ̃ 2 = r kζ̃ζ k2 , with ζ̃ζ = r−p √1 Ry y r − √1 (RX)β̃ β r (3) (4) We now give our main theorem, for estimating the t-values β and σ̃. based on β̃ 5 Theorem 2.2 also illustrates how we “separate” the two sources of privacy. In this case, ν bounds the probability of bad events that depend to sampling the rows of X, and α bounds the probability of a bad event that depends on the sampling of the y coordinates. Theorem 3.1. Let X be a (n × p)-matrix, and parameters β ∈ Rp and σ 2 are such that we generate the vector β + e with each coordinate of e sampled indepeny = Xβ dently from N (0, σ 2 ). Assume Algorithm 1 projects the matrix A = [X; y ] without altering it. Fix ν ∈ (0, 1/2) and r = p + Ω(ln(1/ν)). Fix coordinate j. Then we have β and σ̃ 2 as in Equations (3) that w.p. ≥ 1 − ν deriving β̃ β̃ −β and (4), the pivot quantity t̃(βj ) = q Tj T j −1 has a σ̃ (X R RX)j,j distribution D satisfying e−a PDFTr−p (x) ≤ PDFD (x) ≤ ea PDFTr−p (e−a x) for any x ∈ R, where we denote a = r−p n−p . The implications of Theorem 3.1 are immediate: all estimations one can do based on the t-values from the true data X, y , we can now do based on t̃ modulo an approximation r−p factor of exp( n−p ). In particular, Theorem 3.1 enables us β. to deduce a corresponding confidence interval based on β̃ Corollary 3.2. In the same setting as in Theorem 3.1, w.p. ≥ 1 − ν we have the following. Fix any α ∈ (0, 12 ). Let c̃α denote the number s.t. the interval (c̃α , ∞) contains α2 e−a probability mass q of the Tr−p -distribution. Then Pr[βj ∈   β̃j ± ea · c̃α · σ̃ (X T RT RX)−1 j,j ] ≥ 1 − α. 6 We compare the confidence interval of Corollary 3.2 to the confidence intervalqof the standard OLS model, ζk (X T X)−1 As R is a JLwhose length is cα √kζ j,j . n−p matrix, known results regarding the JL transform give q that kζ̃ζ k = Θ (kζζ k), and that (r − p)(X T RT RX)−1 j,j =  q (X T X)−1 We therefore have that Θ j,j . q √ q kζ̃ζ k r √ σ̃ (X T RT RX)−1 = (X T RT RX)−1 = j,j j,j r−p q q   kζζ k r·(n−p) √ (X T X)−1 j,j . So for values of r (r−p)2 · Θ n−p r r−p = Θ(1) we get that the confidence interval   q of Theorem 3.1 is a factor of Θ cc̃αα n−p r−p -larger than the standard OLS confidence interval. Observe that when α = Θ(1), p which is the common case, the dominating factor is (n − p)/(r − p). This bound intuitively makes sense: we have contracted n observations to r observations, hence our model is based on confidence intervals derived from Tr−p rather than Tn−p . for which In the supplementary material we give further discussion, in which we compare our work to the more straight-forward bounds one gets by “plugging in” Sarlos’ work (2006); and we also compare ourselves to the bounds derived from alternative works in differentially private linear regression. 6 Moreover, this interval is essentially optimal: r−p de- note d˜α s.t the interval (d˜α , ∞) contains α2 e n−p probability mass qof the Tr−p -distribution. Then Pr[βj ∈   −1 T T ˜ β̃j ± dα · σ̃ (X R RX) ] ≤ 1 − α. j,j Differentially Private Ordinary Least Squares Rejecting the Null Hypothesis. Due to Theorem 3.1, we can mimic OLS’ technique for rejecting the null hyβ̃ pothesis. I.e., we denote t̃0 = q T jT and re−1 σ̃ (X R RX)j,j ject the null-hypothesis if indeed the associated p̃0 , denotr−p − n−p ing p-value of the slightly truncated e r−p − n−p t̃0 , is below α·e . Much like Theorem 2.2 we now establish a lower bound on n so that w.h.p we end up (correctly) rejecting the null-hypothesis. Theorem 3.3. Fix a positive definite matrix Σ ∈ Rp×p . Fix parameters β ∈ Rp and σ 2 > 0 and a coordinate j s.t. βj 6= 0. Let X be a matrix whose n rows are sampled β )i i.i.d from N (00p , Σ). Let y be a vector s.t. yi − (Xβ is sampled i.i.d from N (0, σ 2 ). Fix ν ∈ (0, 1/2) and α ∈ (0, 1/2). Then there exist constants C1 , C2 , C3 and C4 such that when we run Algorithm 1 over [X; y ] with parameter r w.p. ≥ 1 − α − ν we (correctly) reject the null hypothesis using p̃0 (i.e., Algorithm 1 returns matrix unaltered and we can estimate t̃0 − r−p and verify thatnindeed p̃0 < α · e n−p o ) provided 2 σ 2 (c̃2α +τ̃α ) r ≥ p + max C1 β 2 σmin (Σ) , C2 ln(1/ν) , and n ≥ j n o w2 max r, C3 min{σmin where (Σ),σ 2 } , C4 p ln(1/ν) r−p c̃α , τ̃α defined s.t. PrX∼Tr−p [X > c̃α /e n−p ] = r−p PrX∼N (0,1) [X > τ̃α /e n−p ] = r−p α − n−p e . 2 n 2 2 o  σ (ΣA ) 2 min n, B 4min (n − ln(1/δ)) . This discussion culln(1/δ) minates in the following corollary. 2 2 +τ̃α ) , we = σβ 2(c̃σαmin (Σ) j   ^ thus conclude that if n − p ≥ Ω LB and n = 2.2   q B 2 ln(1/δ) ^ Ω σ · LB 2.2 , then the result of Theorem 3.3 min (ΣA ) n 2 2 o  σ (ΣA ) 2 holds by setting r = min n, B 4min (n − ln(1/δ)) . ln(1/δ) ^ Corollary 3.4. Denoting LB 2.2 It is interesting to note that when we know ΣA , we also have a bound on B. Recall ΣA , the variance of the x ◦ y). Since every sample is an independent Gaussian (x draw from N (00p+1 , ΣA ) then we have an upper bound of B 2 ≤ log(np)σmax (ΣA ). So our lower bound on n (using κ(ΣA ) to denote number of ΣAq ) is given by  the condition   κ(ΣA ) ln(1/δ) ^ ^ n ≥ max Ω LB · LB . 2.2 , Ω̃ 2.2  Observe, overall this result is similar in nature to many other results in differentially private learning (Bassily et al., 2014) which are of the form “without privacy, in order to achieve a total loss of ≤ η we have a sample complexity bound of some Nη ; and with differential p privacy the sample complexity increases to Nη + Ω( Nη /).” However, ^ there’s a subtlety here worth noting. LB 2.2 is proportional (ΣA ) to σmin1(ΣA ) but not to κ(ΣA ) = σσmax . The additional min (ΣA ) dependence on σmax follows from the fact that differential privacy adds noise proportional to the upper bound on the norm of each row. 3.1. Setting the Value of r, Deriving a Bound on n Comparing the lower bound on n given by Theorem 3.3 to the bound ofTheorem 2.2,  we have that the data-dependent (c̃α +τ̃α )2 σ 2 bound of Ω β 2 σmin (Σ) should now hold for r rather than j n. Yet, Theorem 3.3 also introduces an additional depen2 w2 dency between n and r: we require n = Ω( w σ 2 + σmin (Σ) ) (since otherwise we do not have σmin (A)  w and Algorithm 1 might alter A before projecting it) and by definition p w2 is proportional to r ln(1/δ)/. This is precisely the focus of our discussion in this subsection. We would like to set r’s value as high as possible — the larger r is, the more observations we have in RA and the better our confidence bounds (that depend on Tr−p ) are — while satisfying √ n = Ω( ·min{σ2 ,σr min (Σ)} ). Recall that if each sample point is drawn i.i.d x ∼ xi ◦ yi ) is sampled from N (00p , Σ), then each sample (x N (00p+1 , ΣA ) for Σ defined in the proof of A   Theorem 3.3, β Σ Σβ that is: ΣA = . So, Theoβ T Σβ β β TΣ σ 2 +β   2 2 +τ̃α ) rem 3.3 gives the lower bound r − p = Ω σβ 2(c̃σαmin (Σ) j and the following lower bounds on n: n ≥ r and  √  B 2 ( r ln(1/δ)+ln(1/δ)) n = Ω , which means r = σmin (ΣA ) 4. Projected Ridge Regression We now turn to deal with the case that our matrix does not pass the if-condition of Algorithm 1. In this case, the matrix is appended  with a d ×d-matrix which is wId×d . DeA noting A0 = we have that the algorithm’s w · Id×d output is RA0 . Similarly to before, we are going to denote d = p + 1 and decompose A = [X; y ] with X ∈ Rn×p and β + e and y ∈ Rn , with the standard assumption of y = Xβ ei sampled i.i.d from N (0, σ 2 ). We now need to introduce some additional notation. We denote the appended matrix and vectors X 0 and y 0 s.t. A0 = [X 0 ; y 0 ]. And so, using the output RA0 of Algorithm 1, we solve the linear regression problem derived from √1r RX 0 and √1r Ryy 0 . I.e., we set β 0 = (X 0T RT RX 0 )−1 (RX 0 )T (Ryy 0 ) ζ 0 = √1r (Ryy 0 − RX 0β 0 ) (5) Sarlos’ results (2006) regarding the Johnson Lindenstrauss transform give that, when R has sufficiently many rows, solving the latter optimization problem gives a good approximation for the solution of the optimization problem β R = argminz kyy 0 − X 0z k2 = arg minz kyy − Xzz k2 + w2 kzz k2 . The latter problem is Differentially Private Ordinary Least Squares known as the Ridge Regression problem. Invented in the 60s (Tikhonov, 1963; Hoerl & Kennard, 1970), Ridge Regression is often motivated from the perspective of penalizing linear vectors whose coefficients are too large. It is also often applied in the case where X doesn’t have full rank or is close to not having full-rank: one can show that the minimizer β R = (X T X + w2 Ip×p )−1 X Ty is the unique solution of the Ridge Regression problem and that the RHS is always well-defined. While the solution of the Ridge Regression problem might have smaller risk than the OLS solution, it is not known how to derive t-values and/or reject the null hypothesis under Ridge Regression (except for using X to manipulate β = (X T X)−1 X Ty and relying on OLS). β R back into β̂ In fact, prior to our work there was no need for such analysis! For confidence intervals one could just use the standard OLS, because access to X and y was given. Therefore, much for the same reason, we are unable to derive t-values under projected Ridge Regression.7 Clearly, there are situations where such confidence bounds simply cannot be derived.Nonetheless, under additional assumptions about the data, our work can give confidence intervals for βj , and in the case where the interval doesn’t intersect the origin — assure us that sign(βj0 ) = sign(βj ) w.h.p. This is detailed in the supplementary material. To give an overview of our analysis, we first discuss a β is fixed (i.e., the data is fixed model where e = y − Xβ and the algorithm is the sole source of randomness), and β. prove that in this model β 0 is as an approximation to β̂ so, in summary, in Section C we give conditions under which the q length of the interval I is dominated by the ζ0k c0α √kζr−p r(M 0T M 0 )−1 j,j factor derived from Theorem 4.1. 5. Confidence Intervals for “Analyze Gauss” In this section we analyze the “Analyze Gauss” algorithm of Dwork et al (2014). Algorithm 2 works by adding random Gaussian noise to AT A, where the noise is symmetric with each coordinate above  the diagonal  sampled i.i.d from 2 2 4 log(1/δ) N (0, ∆ ) with ∆ = O B . Using the same no2 tation for a sub-matrix of A as  [X; y ] as before, we  denote the output of Algorithm 2 as where c0α denotes the number such that (−c0α , c0α ) contains 1 − α mass of the Tr−p -distribution. However, our goal remains to argue that βj0 serves as a good approximation for βj . To that end, we combine the standard OLS confidence interval — which says that w.p. ≥ 1 − α over the randomness of picking er in the homoscedastic model we have |βj − β̂j | ≤ cα kζζ k (X T X)−1 j,j n−p ^ TX X TX yg we approximate β and kζζ k by βe =  g Ty  X  .  Ty yg ^ TX X −1 Thus, g Ty and X g ^ ] e + βe T X e resp. We now argue Ty − 2 y TXβ TX β ζ k2 = yg kζ g that it is possible to use βej and kζζ k2 to get a confidence interval for βj under certain conditions. Theorem 5.1. Fix α, ν ∈ (0, 12 ). Assume that there exists p η ∈ (0, 21 ) s.t. σmin (X T X) > ∆ p ln(1/ν)/η. Under the homoscedastic model, given β and σ 2 , if we assume also β k ≤ B and kβ̂ β k = k(X T X)−1 X Ty k ≤ B, then that kβ w.p. ≥ 1 − α − ν it holds that βj − βej is at most s   −1 −2 p ^ ^ TX TX O ρ· + ∆ p ln(1/ν) · X X ln(1/α) j,j n×p β = Theorem 4.1. Fix X ∈ R and y ∈ R. Define β̂ X +y and ζ = (I − XX + )yy . Let RX 0 = M 0 and Ryy 0 denote the result of applying Algorithm 1 to the matrix A = [X; y ] when the algorithm appends the data with a w · I matrix. Fix a coordinate j and any α ∈ (0, 1/2). When computing β 0 and ζ 0 as have that w.p. ≥ 1 −  in (5), we q  r 0 0 ζ0 α it holds that β̂j ∈ βj ± cα kζ k r−p · (M 0T M 0 )−1 j,j     j,j r +∆ −2 √ ^ TX X j,j · ln(1/ν) · (B p + 1)  where ρ is w.h.p an upper bound on σ (details appear in the Supplementary material). β k ≤ B and kβ̂ βk ≤ B Note that the assumptions that kβ are fairly benign once we assume each row has bounded l2 -norm. The key assumption is that X T X is well-spread. Yet in the model where each row in X is sampled i.i.d from N (00, Σ), this assumption merely √ means that n is large enough — namely, that n = Ω̃( ∆ p ln(1/ν) η·σmin (Σ) ). 6. Experiment: t-Values of Output — with the confidence interval q of Theorem 4.10 above, q and denotkζζ k kζζ k −1 0 T ing I = cα √n−p (X X)j,j + cα √r−p r(M 0T M 0 )−1 j,j we have that Pr[|βj0 − βj | = O(I)] ≥ 1 − α. And 7 Note: The naı̈ve approach of using RX 0 and Ryy 0 to interpolate RX and Ryy and then apply Theorem 3.1 using these estimations of RX and Ryy ignores the noise added from appending the matrix A into A0 , and therefore leads to inaccurate estimations of the t-values. Goal. We set to experiment with the outputs of Algorithms 1 and 2. While Theorem 3.1 guarantees that computing the t-value from the output of Algorithm 1 in the matrix unaltered case does give a good approximation of the t-value – we were wondering if by computing the t-value directly from the output we can (a) get a good approximation of the true (non-private) t-value and (b) get the same “higher-level conclusion” of rejecting the nullhypothesis. The answers are, as ever, mixed. The two main Differentially Private Ordinary Least Squares observations we do notice is that both algorithms improve as the number of examples increases, and that Algorithm 1 is more conservative then Algorithm 2. Setting. We tested both algorithms in two settings. The first is over synthetic data. Much like the setting in Theorems 2.2 and 3.3, X was generated using p = 3 independent normal Gaussian features, and y was generated using the homoscedastic model. We chose β = (0.5, −0.25, 0) so the first coordinate is twice as big a the second but of opposite sign, and moreover, y is independent of the 3rd feature. The variance of the label is also set to 1, and so the variance of the homosedastic noise equals to σ 2 = 1 − (0.5)2 − (−0.25)2 . The number of observations n ranges from n = 1000 to n = 100000. The second setting is over real-life data. We ran the two algorithms over diabetes dataset collected over ten years (1999-2008) taken from the UCI repository (Strack et al., 2014). We truncated the data to 4 attributes: sex (binary), age (in buckets of 10 years), number medications (numeric, 0-100), and a diagnosis (numeric, 0-1000). Naturally, we added a 5th column of all-1 (intercept). Omitting any entry with missing or non-numeric values on these nine attributes we were left with N = 91842 entries, which we shuffled and fed to the algorithm in varying sizes — from n = 30, 000 to n = 90, 000. Running OLS over the entire N observation yields β ≈ (14.07, 0.54, −0.22, 482.59), and t-Values of (10.48, 1.25, −2.66, 157.55). get fairly high (in magnitude) t-values. As the result, we falsely reject the null-hypothesis based on the t-value of Analyze Gauss quite often, even for large values of n. This is shown in Figure 1b. Additional figures (including plotting the distribution of the t-value approximations) appear in the supplementary material. The results show that t-value approximations that do not take into account the inherent randomness in the DPalgorithms lead to erroneous conclusions. One approach would be to follow the more conservative approach we advocate in this paper, where Algorithm 1 may allow you to get true approximation of the t-values and otherwise reject the null-hypothesis only based on the confidence interval (of Algorithm 1 or 2) not intersecting the origin. Another approach, which we leave as future work, is to replace the T -distribution with a new distribution, one that takes into account the randomness in the estimator as well. This, however, has been an open and long-standing challenge since the first works on DP and statistics (see (Vu & Slavkovic, 2009; Dwork & Lei, 2009)) and requires we move into non-asymptotic hypothesis testing. The Algorithms. We ran a version of Algorithm 1 that uses a DP-estimation of σmin , and finds the largest r the we can use without altering the input, yet if this r is below 25 then it does alter the input and approximates Ridge regression. We ran Algorithm 2 verbatim. We set  = 0.25 and δ = 10−6 . We repeated each algorithm 100 times. (a) Synthetic data, coordinate β1 Results. We plot the t-values we get from Algorithms 1 and 2 and decide to reject the null-hypothesis based on tvalue larger than 2.8 (which corresponds to a fairly conservative p-value of 0.005). Not surprisingly, as n increases, the t-values become closer to their expected value – the tvalue of Analyze Gauss is close to the non-private p t-value and the t-value from Algorithm 1 is a factor of nr smaller as detailed above (see after Corollary 3.2). As a result, when the null-hypothesis is false, Analyze Gauss tends to produce larger t-values (and thus reject the null-hypothesis) for values of n under which Algorithm 1 still does not reject, as shown in Figure 1a. This is exacerbated in real data setting, where its actual least singular value (≈ 500) is fairly small in comparison to its size (N = 91842). However, what is fairly surprising is the case where the null-hypothesis should not be rejected — since βj = 0 (in the synthetic case) or its non-private t-value is close to 0 (in the real-data case). Here, the Analyze Gauss’ tvalue approximation has fairly large variance, and we still (b) Synthetic data, coordinate β3 Figure 1. Correctly and Wrongly Rejecting the Null-Hypothesis Differentially Private Ordinary Least Squares Acknowledgements The bulk of this work was done when the author was a postdoctoral fellow at Harvard University, supported by NSF grant CNS-123723; and also an unpaid collaborator on NSF grant 1565387. The author wishes to wholeheartedly thank Prof. Salil Vadhan, for his tremendous help in shaping this paper. The author would also like to thank Prof. Jelani Nelson and the members of the “Privacy Tools for Sharing Research Data” project at Harvard University (especially James Honaker, Vito D’Orazio, Vishesh Karwa, Prof. Kobbi Nissim and Prof. Gary King) for many helpful discussions and suggestions; as well as Abhradeep Thakurta for clarifying the similarity between our result. Lastly the author thanks the anonymous referees for many helpful suggestions in general and for a reference to (Ullman, 2015) in particular. References Agresti, A. and Finlay, B. Statistical Methods for the Social Sciences. Pearson P. Hall, 2009. Bassily, R., Smith, A., and Thakurta, A. Private empirical risk minimization: Efficient algorithms and tight error bounds. In FOCS, 2014. Blocki, J., Blum, A., Datta, A., and Sheffet, O. The Johnson-Lindenstrauss transform itself preserves differential privacy. In FOCS, 2012. Chaudhuri, Kamalika and Hsu, Daniel J. Convergence rates for differentially private statistical estimation. In ICML, 2012. Dwork, Cynthia, Su, Weijie, and Zhang, Li. Private false discovery rate control. CoRR, abs/1511.03803, 2015. Hoerl, A. E. and Kennard, R. W. Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12:55–67, 1970. Kasiviswanathan, S., Lee, H., Nissim, K., Raskhodnikova, S., and Smith, A. What can we learn privately? In FOCS, 2008. Kifer, Daniel, Smith, Adam D., and Thakurta, Abhradeep. Private convex optimization for empirical risk minimization with applications to high-dimensional regression. In COLT, 2012. Laurent, B. and Massart, P. Adaptive estimation of a quadratic functional by model selection. The Annals of Statistics, 28(5), 10 2000. Ma, E. M. and Zarowski, Christopher J. On lower bounds for the smallest eigenvalue of a hermitian positivedefinite matrix. IEEE Transactions on Information Theory, 41(2), 1995. Muller, Keith E. and Stewart, Paul W. Linear Model Theory: Univariate, Multivariate, and Mixed Models. John Wiley & Sons, Inc., 2006. Pilanci, M. and Wainwright, M. Randomized sketches of convex programs with sharp guarantees. In ISIT, 2014a. Pilanci, Mert and Wainwright, Martin J. Iterative hessian sketch: Fast and accurate solution approximation for constrained least-squares. CoRR, abs/1411.0347, 2014b. Chaudhuri, Kamalika, Monteleoni, Claire, and Sarwate, Anand D. Differentially private empirical risk minimization. Journal of Machine Learning Research, 12, 2011. Rao, C. Radhakrishna. Linear statistical inference and its applications. Wiley, 1973. Duchi, John C., Jordan, Michael I., and Wainwright, Martin J. Local privacy and statistical minimax rates. In FOCS, pp. 429–438, 2013. Rogers, Ryan M., Vadhan, Salil P., Lim, Hyun-Woo, and Gaboardi, Marco. Differentially private chi-squared hypothesis testing: Goodness of fit and independence testing. In ICML, pp. 2111–2120, 2016. Dwork, C. and Lei, J. Differential privacy and robust statistics. In STOC, 2009. Dwork, Cynthia, Kenthapadi, Krishnaram, McSherry, Frank, Mironov, Ilya, and Naor, Moni. Our data, ourselves: Privacy via distributed noise generation. In EUROCRYPT, 2006a. Dwork, Cynthia, Mcsherry, Frank, Nissim, Kobbi, and Smith, Adam. Calibrating noise to sensitivity in private data analysis. In TCC, 2006b. Dwork, Cynthia, Talwar, Kunal, Thakurta, Abhradeep, and Zhang, Li. Analyze gauss - optimal bounds for privacy preserving principal component analysis. In STOC, 2014. Rudelson, Mark and Vershynin, Roman. Smallest singular value of a random rectangular matrix. Comm. Pure Appl. Math, pp. 1707–1739, 2009. Sarlós, T. Improved approx. algs for large matrices via random projections. In FOCS, 2006. Sheffet, O. Private approximations of the 2nd-moment matrix using existing techniques in linear regression. CoRR, abs/1507.00056, 2015. URL http://arxiv.org/ abs/1507.00056. Smith, Adam D. Privacy-preserving statistical estimation with optimal convergence rates. In STOC, pp. 813–822, 2011. Differentially Private Ordinary Least Squares Strack, B., DeShazo, J., Gennings, C., Olmo, J., Ventura, S., Cios, K., and Clore, J. Impact of HbA1c measurement on hospital readmission rates: Analysis of 70,000 clinical database patient records. BioMed Research International, 2014:11 pages, 2014. Tao, T. Topics in Random Matrix Theory. American Mathematical Soc., 2012. Thakurta, Abhradeep and Smith, Adam. Differentially private feature selection via stability arguments, and the robustness of the lasso. In COLT, 2013. Tikhonov, A. N. Solution of incorrectly formulated problems and the regularization method. Soviet Math. Dokl., 4, 1963. Uhler, Caroline, Slavkovic, Aleksandra B., and Fienberg, Stephen E. Privacy-preserving data sharing for genome-wide association studies. Journal of Privacy and Confidentiality, 2013. Available at: http:// repository.cmu.edu/jpc/vol5/iss1/6. Ullman, J. Private multiplicative weights beyond linear queries. In PODS, 2015. Vu, D. and Slavkovic, A. Differential privacy for clinical trial data: Preliminary evaluations. In ICDM, 2009. Wang, Yue, Lee, Jaewoo, and Kifer, Daniel. entially private hypothesis testing, revisited. abs/1511.03376, 2015. DifferCoRR, Xi, B., Kantarcioglu, M., and Inan, A. Mixture of gaussian models and bayes error under differential privacy. In CODASPY. ACM, 2011. Zhou, S., Lafferty, J., and Wasserman, L. Compressed regression. In NIPS, 2007. Differentially Private Ordinary Least Squares A. Extended Introductory Discussion A.2. Omitted Preliminary Details Due to space constraint, a few details from the introductory parts (Sections 1,2) were omitted. We bring them in this appendix. We especially recommend the uninformed reader to go over the extended OLS background we provide in Appendix A.3. Linear Algebra and Pseudo-Inverses. Given a matrix M we denote its SVD as M = U SV T with U and V being orthonormal matrices and S being a non-negative diagonal matrix whose entries are the singular values of M . We use σmax (M ) and σmin (M ) to denote the largest and smallest singular value resp. Despite the risk of confusion, we stick to the standard notation of using σ 2 to denote the variance of a Gaussian, and use σj (M ) to denote the j-th singular value of M . We use M + to denote the Moore-Penrose inverse of M , defined as M + = V S −1 U T where S −1 is a −1 matrix with Sj,j = 1/Sj,j for any j s.t. Sj,j > 0. A.1. Proof Of Privacy of Algorithm 1 Theorem A.1. Algorithm 1 is (, δ)-differentially private. Proof. The proof of the theorem is based on the fact the Algorithm 1 is the result of composing the differentially private Propose-Test-Release algorithm of (Dwork & Lei, 2009) with the differentially private analysis of the Johnson-Lindenstrauss transform of (Sheffet, 2015). More specifically, we use Theorem B.1 from (Sheffet, 2015) that states that given a matrix A whose all of its 2 singular p values at greater than T (, δ) where T (, δ) = 2B 2 2r ln(4/δ) + 2 ln(4/δ) , publishing RA is (, δ) differentially private for a r-row matrix R whose entries sampled are i.i.d normal Gaussians. Since we have that all of the singular values of A0 are greater than w (as specified in Algorithm 1), outputting RA0 is (/2, δ/2)-differentially private. The rest of the proof boils down to showing that (i) the if-else-condition is (/2, 0)-differentially private and that (ii) w.p. ≤ δ/2 any matrix A whose smallest singular value is smaller than w passes the if-condition (step 3). If both these facts hold, then knowing whether we pass the if-condition or not is (/2)-differentially private and the output of the algorithm is (/2, δ)-differentially private, hence basic composition gives the overall bound of (, δ)differential privacy. To prove (i) we have that for any pair of neighboring matrices A and B that differ only on the i-th row, denoted a i and T T b i resp., we have B T B − b ib T i = A A − a ia i . Applying Weyl’s inequality we have b ib T σmin (B T B) ≤ σmin (B T B − b ib T i ) + σmax (b i) a ia T b ib T ≤ σmin (AT A) + σmax (a i ) + σmax (b i) ≤ σmin (AT A) + 2B 2 2 hence |σmin (A)2 −σmin (B)2 | ≤ 2B 2 , so adding Lap( 4B ) is (/2)-differentially private. To prove (ii), note that by standard tail-bounds on the Laplace distribution we have that Pr[Z < − 4B 2 ln(1/δ) δ ] ≤ . Therefore, w.p. 1 − δ/2 it holds that  2 any matrix A that passes the if-test of the algorithm must have σmin (A)2 > w2 . Also note that a similar argument shows that for any 0 < β < 1, any matrix A s.t. 2 passes the if-condition of σmin (A)2 > w2 + 4B ln(1/β)  the algorithm w.p. 1 − β. The Gaussian Distribution. A univariate Gaussian N (µ, σ 2 ) denotes the Gaussian distribution whose mean is µ and variance σ 2 , with PDF(x) = √ 2 ( 2πσ )−1 exp(− x−µ bounds 2σ 2 ). Standard concentration p on Gaussians give that Pr[x > µ + 2σ ln(1/ν)] < ν µ, Σ) for any ν ∈ (0, 1e ). A multivariate Gaussian N (µ for some positive semi-definite Σ denotes the multivariate Gaussian distribution where the mean of the j-th coordinate is the µj and the co-variance between coordinates j and k is Σj,k . The PDF of such Gaussian is defined only on the subspace colspan(Σ), x) = where for every x ∈ colspan(Σ) we have PDF(x  −1/2  1 rank(Σ) T + ˜ x − µ ) Σ (x x − µ) (2π) · det(Σ) exp − 2 (x ˜ and det(Σ) is the multiplication of all non-zero singular values of Σ. A matrix Gaussian distribution denoted N (Ma×b , U, V ) has mean M , variance U on its rows and variance V on its columns. For full rank U and V it holds that PDFN (M,U,V ) (X) = (2π)−ab/2 (det(U ))−b/2 (det(V ))−a/2 ·  exp(− 21 trace V −1 (X − M )T U −1 (X − M ) ). In our case, we will only use matrix Gaussian distributions with N (Ma×b , Ia×a , V ) and so each row in this matrix is an i.i.d sample from a b-dimensional multivariate Gaussian N ((M )j→ , V ). We will repeatedly use the rules regarding linear operations on Gaussians. That in, for any c, it holds that cN (µ, σ 2 ) = µ, Σ) = N (c · µ, c2 σ 2 ). For any C it holds that C · N (µ µ, CΣC T ). And for any C is holds that N (M, U, V ) · N (Cµ C = N (M C, U, C T V C). In particular, for any c (which can be viewed as a b × 1-matrix) it holds that N (M, U, V ) · c = N (Mcc, U, c T V c ) = N (Mcc, c T V c · U ). We will also require the following proposition. 2 Proposition A.2. Given σ 2 , λ2 s.t. 1 ≤ σλ2 ≤ c2 for some constant c, let X and Y be two random Gaussians s.t. X ∼ N (0, σ 2 ) and Y ∼ N (0, λ2 ). It follows that 1c PDFY (x) ≤ PDFX (x) ≤ cPDFcY (x) for any x. Corollary A.3. Under the same notation as in Proposition A.2, for any set S ⊂ R it holds that 1c Prx←Y [x ∈ S] ≤ Prx←X [x ∈ S] ≤ cPrx←cY [x ∈ S] = Differentially Private Ordinary Least Squares cPrx←Y [x ∈ S/c] haustive account of OLS and we refer the interested reader to (Rao, 1973; Muller & Stewart, 2006). Proof. The proof is mere calculation. xi , yi )}ni=1 where for all i we have Given n observations {(x p x i ∈ R and yi ∈ R, we assume the existence of a pdimensional vector β ∈ Rp s.t. the label yi was derived by yi = β Tx i + ei where ei ∼ N (0, σ 2 ) independently (also known as the homoscedastic Gaussian model). We use the matrix notation where X denotes the (n × p)-matrix whose rows are x i , and use y , e ∈ Rn to denote the vectors whose i-th entry is yi and ei resp. To simplify the discussion, we assume X has full rank. PDFX (x) = PDFcY (x) r 2 x c2 λ2 exp(− 2σ 2) · 2 2 σ exp(− 2cx2 λ2 ) x2 1 1 ≤ c · exp( ( 2 2 − 2 )) ≤ c · exp(0) = c 2 c λ σ r x2 ) PDFX (x) λ2 exp(− 2σ 2 · = PDFY (x) σ 2 exp(− x22 ) ≥c −1 2λ x2 1 exp( 2 ( λ2 − σ12 )) ≥ exp(0) c = c−1 The parameters of the model are therefore β and σ 2 , which we set to discover. To that end, we minimize minz kyy − Xzz k2 and solve β = (X T X)−1 X Ty = (X T X)−1 X T (Xβ β +ee) = β +X +e β̂ The Tk -Distribution. The Tk -distribution, where k is referred to as the degrees of freedom of the distribution, denotes the distribution over the reals created by independently sampling Z ∼ N (0, 1) and kζk2 ∼ χ2k , and taking the quantity √ Z 2 . Its PDF is given by  kζk /k − k+1 2 2 x . It k PDFTk (x) ∝ 1 + is a known fact that as k increases, Tk becomes closer and closer to a normal Gaussian. The T -distribution is often used to determine suitable bounds on the rate of converges, as we illustrate in Section A.3. As the T -distribution is heavy-tailed, existing tail boundsp on the T -distribution (which are of the form:R if τν = C k((1/ν)2/k − 1) for some constant C ∞ then τν PDFTk (x)dx < ν) are often cumbersome to work with. Therefore, in many cases in practice, it common to assume ν = Θ(1) (most commonly, ν = 0.05) and use existing tail-bounds on normal Gaussians. Differential Privacy facts. It is known (Dwork et al., 2006b) that if ALG outputs a vector in Rd such that for any A and A0 it holds that kALG(A) − ALG(A0 )k1 ≤ B, then adding Laplace noise Lap(1/) to each coordinate of the output of ALG(A) satisfies -differential privacy. Similarly, (2006b) showed that if for any neighboring A and A0 it holds that kALG(A) − ALG(A0 )k22 ≤ ∆2 then adding Gaussian noise N (0, ∆2 · 2 ln(2/δ) ) to each coordinate of 2 the output of ALG(A) satisfies (, δ)-differential privacy. Another standard result (Dwork et al., 2006a) gives that the composition of the output of a (1 , δ1 )-differentially private algorithm with the output of a (2 , δ2 )-differentially private algorithm results in a (1 +2 , δ1 +δ2 )-differentially private algorithm. A.3. Detailed Background on Ordinary Least Squares For the unfamiliar reader, we give a short description of the model under which OLS operates as well as the confidence bounds one derives using OLS. This is by no means an ex- β As e ∼ N (00n , σ 2 In×n ), it holds that β̂ ∼ β , σ 2 (X T X)−1 ), or alternatively, that for every coorN (β β ∼ N (βj , σ 2 (X T X)−1 dinate j it holds that β̂j = e T j β̂ j,j ). Hence we get σ β̂ −βj q j (X T X)−1 j,j ∼ N (0, 1). In addition, we de- note the vector β = (Xβ β + e ) − X(β β + X +e ) = (I − XX + )ee ζ = y − X β̂ and since XX + is a rank-p (symmetric) projection matrix, we have ζ ∼ N (0, σ 2 (I − XX + )). Therefore, kζζ k2 is equivalent to summing the squares of (n − p) i.i.d samples from N (0, σ 2 ). In other words, the quantity kζζ k2 /σ 2 is sampled from a χ2 -distribution with (n − p) degrees of freedom. We sidetrack from the OLS discussion to give the following β , as the next bounds on the l2 -distance between β and β̂ claim shows. Claim A.4. For any 0 < ν < 1/2, the following holds w.p. ≥ 1−ν over the randomness of the model (the randomness over e ) β − β̂ β k2 = kX +e k2 kβ = O σ 2 log(p/ν) · kX + k2F 2 +  (6) 2 β k = kβ β + X ek kβ̂  2 p β k + σ · kX + kF · log(p/ν) ) = O( kβ q ln(1/ν) 2 2 1 ζ kζ k − σ = O( n−p n−p ) Proof. Since e ∼ N (00n , σ 2 In×n ) then X +e ∼ N (00n , σ 2 (X T X)−1 ). Denoting the SVD decomposition (X T X)−1 = V SV T with S denoting the diagonal ma−2 −2 trix whose entries are σmax (X), . . . , σmin (X), we have T + 2 that V X e ∼ N (00n , σ S). And so, each coordinate of V T X +e is distributed like an i.i.d Gaussian. So Differentially Private Ordinary Least Squares w.p. p≥ 1 − ν/2 non of these Gaussians is a factor of O(σ ln(p/ν)) greater than its standard deviation. And so w.p. ≥ 1 − ν/2P it holds that kX +e k2 =PkV T X +e k2 ≤ −2 −2 2 Since O(σ log(p/ν) i σi (X) ). i σi (X) = T −1 + + T trace((X X) ) = trace(X (X ) ) = kX + k2F , the bound of (6) is proven. β k2 is an immediate corollary of (6) using The bound on kβ̂ the triangle inequality.8 The bound on kζζ k2 follows from tail bounds on the χ2n−p distribution, as detailed in Section 2. β and ζ are Returning to OLS, it is important to note that β̂ β depends solely on independent of one another. (Note, β̂ X +e = (X + X)X +e = X + PU e , whereas ζ depends on (I − XX + )ee = PU ⊥ e . As e is spherically symmetric, the β is two projections are independent of one another and so β̂ independent of ζ .) As a result of the above two calculations, we have that the quantity def tβ̂j (βj ) = β̂j −βj q ζk kζ √ (X T X)−1 j,j · n−p = σ β̂ −βj q j (X T X)−1 j,j . kζζ k √ σ n−p is distributed like a T -distribution with (n − p) degrees of freedom. Therefore, we can compute an exact probability estimation for this quantity. That is, for any measurable S ⊂ R we have i Z h β and ζ satisfying tβ̂j (βj ) ∈ S = PDFTn−p (x)dx Pr β̂ S The importance of the t-value t(βj ) lies in the fact that it can be fully estimated from the observed data X and y (for any value of βj ), which makes it a pivotal quantity. Therefore, given X and y , we can use t(βj ) to describe the likelihood of any βj — for any z ∈ R we can now give an estimation of how likely it is to have βj = z (which is PDFTn−p (t(z))). The t-values enable us to perform multitude of statistical inferences. For example, we can say which of two hypotheses is more likely and by how much (e.g., we are 5-times more likely that the hypothesis βj = 3 is true than the hypothesis βj = 14 is true); we can compare between two coordinates j and j 0 and report we are more confident that βj > 0 than βj 0 > 0; or even compare among the t-values we get across multiple datasets (such as the datasets we get from subsampling rows from a single dataset). In particular, we can use t(βj ) to α-reject unlikely values of βj . Given 0 < α < 1, we denote cα as the number for which the interval (−cα , cα ) contains a probability mass of 1 − α from the Tn−p -distribution. And so we derive a 8 Observe, though e is spherically symmetric, and is likely to be approximately-orthogonal to β , this does not necessarily hold for X +e which isn’t spherically symmetric. Therefore, we result β using the triangle bound. to bounding the l2 -norm of β̂ corresponding confidence interval Iα centered at β̂j where βj ∈ Iα with confidence of level of 1 − α. We comment as to the actual meaning of this confidence interval. Our analysis thus far applied w.h.p to a vector y derived according to this model. Such X and y will result in the quantity tβ̂j (βj ) being distributed like a Tn−p distribution — where βj is given as the model parameters and β̂j is the random variable. We therefore have that guarantee that for X and  y derived according to this model,  the q 2 def ζ kζ k −1 event Eα = β̂j ∈ βj ± cα · (X T X)j,j · n−p happens w.p. 1 − α. However, the analysis done over a given dataset X and y (once y has been drawn) views the quantity tβ̂j (βj ) with β̂j given and βj unknown. Therefore the event Eα either holds or does not hold. That is why the alternative terms of likelihood or confidence are used, instead of probability. We have q a confidence 2level of 1 − α ζ ˆ that indeed βj ∈ βj ± cα · (X T X)−1 · kζ k , because this j,j n−p event does happen in 1−α fraction of all datasets generated according to our model. Rejecting the Null Hypothesis. One important implication of the quantity t(βj ) is that we can refer specifically to the hypothesis that βj = 0, called the null hypothesis. This def quantity, t0 = tβ̂j (0) = √ β̂j n−p q , kζζ k (X T X)−1 j,j represents how large is β̂j relatively to the empirical estimation of standard deviation σ. Since it is known that as the number of degrees of freedom of a T -distribution tends to infinity then the T distribution becomes a normal Gaussian, it is common to think of t0 as a sample from a normal Gaussian N (0, 1). This allows us to associate t0 with a p-value, estimating the event “βj and β̂j have different signs.” Formally, we define R∞ 2 p0 = |t0 | √12π e−x /2 dx. It is common to reject the null hypothesis when p0 is sufficiently small (typically, below 0.05).9 Specifically, given α ∈ (0, 1/2), we say we α-reject the null hypothesis R ∞ if p0 <2 α. Let τα be the number s.t. Φ(τα ) = τα √12π e−x /2 dx = α. (Standard bounds p give that τα < 2 ln(1/α).) This means we α-reject the null hypothesis if t0 > τα or t0 < −τα , meaning if q |β̂j | > τα kζζ k √ (X T X)−1 j,j n−p . ζ We can now lower bound the number of i.i.d sample points needed in order to α-reject the null hypothesis. This bound will be our basis for comparison — between standard OLS and the differentially private version.10 9 R ∞ Indeed, it is more accurate to associate with t0 the value PDFTn−p (x)dx and check that this value is < α. However, |t0 | as most uses take α to be a constant (often α = 0.05), asymptotically the threshold we get for rejecting the null hypothesis are the same. 10 This theorem is far from being new (except for maybe fo- Differentially Private Ordinary Least Squares Theorem A.5 (Theorem 2.2 restated.). Fix any positive definite matrix Σ ∈ Rp×p and any ν ∈ (0, 12 ). Fix parameters β ∈ Rp and σ 2 and a coordinate j s.t. βj 6= 0. Let X be a matrix whose n rows are i.i.d samples from β )i is sampled N (00, Σ), and y be a vector where yi − (Xβ i.i.d from N (0, σ 2 ). Fix α ∈ (0, 1). Then w.p. ≥ 1 − ν we have p that the (1 − α)-confidence interval is of length O(cα σ 2 /(nσmin (Σ))) provided n ≥ C1 (p + ln(1/ν)) for some sufficiently large constant C1 . Furthermore, there exists a constant C2 such that w.p. ≥ 1 − α − ν we (correctly) reject the null hypothesis provided ( ) σ 2 c2α + τα2 n ≥ max C1 (p + ln(1/ν)), C2 2 · βj σmin (Σ) cα denotes the number for which PDF (x)dx = 1 − α. (If we are content T n−p −cα with approximating Tn−p p with a normal Gaussian than one can set cα ≈ τα < 2 ln(1/α).) Here R cα Proof. The discussion above ≥ 1−α q shows that w.p. 2 −1 kζζ k T we have |βj − β̂j | ≤ cα (X X)j,j n−p ; and in orderqto α-reject the null hypothesis we must have |β̂j | > kζζ k2 τα (X T X)−1 j,j n−p . Therefore, a sufficient condition for OLS to α-reject the null-hypothesis is to have n large q 2 kζζ k enough s.t. |βj | > (cα + τα ) (X T X)−1 j,j n−p . We therefore argue that w.p.≥ 1 − ν this inequality indeed holds. ζ We assume each row of X i.i.d vector x i ∼ N (00p , Σ), and recall that according to the model kζζ k2 ∼ σ 2 χ2 (n − p). Straightforward concentration bounds on Gaussians and on the χ2 -distribution give: √ (i) W.p. ≤ α it holds that kζζ k > σ ( n − p + 2 ln(2/α))). (This is part of the standard OLS analysis.) √ (ii) W.p.p≤ ν it holds that σmin (X T X) ≤ σmin (Σ)( n − √ ( p + 2 ln(2/ν)))2 . (Rudelson & Vershynin, 2009) Therefore, due to the lower bound n = Ω(p + ln(1/ν)), w.p.≥ 1 − ν − α we have that none of hold. In such a case we have q these events p −1 T (X X)j,j ≤ σmax ((X T X)−1 ) = O( √ 1 ) nσmin (Σ) √ and kζζ k = O(σ n − p). This implies that the confidence interval of level 1 − α has length of q  q  2 −1 kζζ k σ2 T cα (X X)j,j · n−p = O cα nσmin (Σ) ; and that in order to α-reject that null-hypothesis it suffices to have q   2 σ |βj | = Ω (cα + τα ) nσmin (Σ) . Plugging in the lower bound on n, we see that this inequality holds. We comment that for sufficiently large constants C1 , C2 , cusing on the setting where every row in X is sampled from an i.i.d multivariate Gaussians), it is just stated in a non-standard way, discussing solely the power of the t-test in OLS. For further discussions on sample size calculations see (Muller & Stewart, 2006). it holds that all the constants hidden in the O- and Ωnotations of the proof are close to 1. I.e., they are all within the interval (1 ± η) for some small η > 0 given C1 , C2 ∈ Ω(η −2 ). B. Projecting the Data using Gaussian Johnson-Lindenstrauss Transform B.1. Main Theorem Restated and Further Discussion Theorem B.1 (Theorem 3.1 restated.). Let X be a n × p matrix, and parameters β ∈ Rp and σ 2 are such that β + e with each coordiwe generate the vector y = Xβ nate of e sampled independently from N (0, σ 2 ). Assume σmin (X) ≥ C · w and that n is sufficiently large s.t. all of the singular values of the matrix [X; y ] are greater than C · w for some large constant C, and so Algorithm 1 projects the matrix A = [X; y ] without altering it, and publishes [RX; Ryy ]. Fix ν ∈ (0, 1/2) and r = p + Ω(ln(1/ν)). Fix coordinate β , ζ̃ζ and σ̃ 2 as j. Then w.p. ≥ 1 − ν we have that deriving β̃ follows β β̃ = (X T RT RX)−1 (RX)T (Ryy ) = β + (RX)+ Ree ζ̃ζ = = σ̃ 2 = √1 Ry y − √1r (RX)β̃ β r  T 1 √ I − (RX)(X RT RX)−1 (RX)T ) Ree r r kζ̃ζ k2 r−p then the pivot quantity β̃j − βj t̃(βj ) = σ̃ q (X T RT RX)−1 j,j has a distribution D satisfying e−a PDFTr−p (x) ≤ PDFD (x) ≤ ea PDFTr−p (e−a x) for any x ∈ R, where we r−p denote a = n−p . Comparison with Existing Bounds. Sarlos’ work (2006) utilizes the fact that when r, the numbers of rows in R, is large enough, then √1r R is a Johnson-Lindenstrauss matrix. q Specifically, given r and ν ∈ (0, 1) we denote η = Ω( p ln(p) ln(1/ν) ), r and so r = O( p ln(p)ηln(1/ν) ). 2 β = arg minz 1r kRXzz − Ryy k2 . In Let us denote β̃ this setting, Sarlos’ work (Sarlós, 2006) (Theorem 12(3)) guarantees that w.p.q≥ 1 − ν we have  p log(p) log(1/ν) β − β̃ β k2 ≤ ηkζζ k/σmin (X) = O ζ kβ̂ kζ k . rσmin (X T X) β − β̃ β k and using the Naı̈vely bounding |β̂j − β̃j | ≤ kβ̂ β j − β j from Section A.311 confidence interval for β̂ 11 Where we approximate cα , the tail bound of the Tn−p distribution with the tail p bound on a Gaussian, i.e., use the approximation cα ≈ O( ln(1/α)). Differentially Private Ordinary Least Squares gives a confidence interval of q level 1 − (α + ν)  cenp ln(p) log(1/ν) tered at β̃j with length of O kζζ k + rσmin (X T X) q  log(1/α) ζk O (X T X)−1 = j,j n−p kζ q  p ln(p) log(1/ν)+log(1/α) O kζζ k . This implies that rσmin (X T X) our confidence interval has decreased its degrees of freedom from n − p to roughly r/p ln(p), and furthermore, that it no longer depends on (X T X)−1 j,j but rather on T 1/σmin (X X). It is only due to the fact that we rely on Gaussians and by mimicking carefully the original proof that we can deduce that the t̃-value has (roughly) r − p degrees of freedom and depends solely on (X T X)−1 j,j . (In the worst case, we have that (X T X)−1 j,j is proportional to σmin (X T X)−1 , but it is not uncommon to have matrices where the former is much larger than the latter.) As mentioned in the introduction, alternative techniques ((Chaudhuri et al., 2011; Bassily et al., 2014; Ullman, 2015)) for finding a DP estimator β dp of the linear regression give a β dp − β̂ β k = Õ(p/). Such data-independent12 bound of kβ bounds are harder to compare with the interval length given by Corollary 3.2. Indeed, as we discuss in Section 3 under “Rejecting the null-hypothesis,” enough samples from a multivariate Gaussian whose covariance-matrix is well conditioned give a bound which is well below the worstupper bound of O(p/). (Yet, it is possible that these techniques also do much better on such “well-behaved” data.) What the works of Sarlos and alternative works regrading differentially private linear regression do not take into account are questions such as generating a likelihood for βj nor do they discuss rejecting the null hypothesis. B.2. Proof of Theorem 3.1 β and ζ̃ζ , where our goal We now turn to our analysis of β̃ is to show that the distribution of the t̃-values as specified in Theorem 3.1 is well-approximated by the Tr−p distribution. For now, we assume the existence of fixed β + e . (Later, vectors β ∈ Rp and e ∈ Rn s.t. y = Xβ we will return to the homoscedastic model where each coordinate of e is sampled i.i.d from N (0, σ 2 ) for some σ 2 .) In other words, we first examine the case where R is the sole source of randomness in our estimation. Based on the assumption that e is fixed, we argue the following. Claim B.2. In our model, given X and β the output M = RX, we have that β̃ ∼ + 2 T −1 N β + X e , kPU ⊥ e k (M M ) and ζ̃ζ ∼   kPU ⊥ e k2 T −1 T N 0n, (Ir×r − M (M M ) M ) . Where r PU ⊥ denotes the projection operator onto the subspace orthogonal to colspan(X); i.e., PU = XX + and PU ⊥ = (Ir×r − XX + ). 12 In other words, independent of X, ζ . Proof. The matrix R is sampled from N (0r×p , Ir×r , Ip×p ). Given X and RX = M , we learn the projection of each row in R onto the subspace spanned by the columns of X. That is, denoting u T as the i-th row of R and v T as the i-th row of M , we have that X Tu = v . Recall, initially u ∼ N (00n , In×n ) – a spherically symmetric Gaussian. As a result, we can denote u = PU u × PU ⊥ u where the two projections are independent samples from N (00n , PU ) and N (00n , PU ⊥ ) resp. However, once we know that v = X Tu we have that PU u = X(X T X)−1 X Tu = X(X T X)−1v so we learn PU u exactly, whereas we get no information about PU ⊥ so PU ⊥ u is still sampled from a Gaussian N (00n , PU ⊥ ). As we know for each row of R that u T PU = v T X + , we therefore have that R = RPU + RPU ⊥ = M X + + RPU ⊥ where RPU ⊥ ∼ N (0r×n , Ir×r , PU ⊥ ). From here on, we just rely on the existing results about the linearity of Gaussians. R ∼ N (M X + , Ir×r , PU ⊥ ) ⇒ Ree ∼ N (M X +e , kPU ⊥ e k2 Ir×r ) ⇒ M + Ree ∼ N (X +e , kPU ⊥ e k2 (M T M )−1 ) β = β + M + Ree implies β̃ β ∼ N (β β + so β̃ + X e , kPU ⊥ e k2 (M T M )−1 ). And as ζ̃ζ = T −1 T √1 (Ir×r e − M (M M ) M )Re then we r kP have ζ̃ζ ∼ N (00r , U r⊥ + (Ir×r − M M )M = 0r×p . e k2 (Ir×r − M M + )) as Claim B.2 was based on the assumption that e is fixed. However, given X and y there are many different ways to β + e . However, the assign vectors β and e s.t. y = Xβ distributions we get in Claim B.2 are unique. To see that, β and recall Equations (1) and (2): β + X +e = X +y = β̂ PU ⊥ e = PU ⊥ y = (I − XX + )yy = ζ . We therefore have 2 β ∼ N (β̂ β , kζζ k2 (M T M )−1 ) and ζ̃ζ ∼ N (00n , kζζrk (I − β̃ M M + )). We will discuss this further, in Section 4, where we will not be able to better analyze the explicit distributions of our estimators. But in this section, we are able to β and ζ̃ζ . argue more about the distributions of β̃ So far we have considered the case that e is fixed, whereas our goal is to argue about the case where each coordinate of e is sampled i.i.d from N (0, σ 2 ). To that end, we now switch to an intermediate model, in which PU e is sampled from a multivariate Gaussian while PU ⊥ e is fixed as some arbitrary vector of length l. Formally, let Dl denote the distribution where PU e ∼ N (0, σ 2 PU ) and PU ⊥ e is fixed as some specific vector whose length is denoted by kPU ⊥ ek = l. Claim B.3. Under the same assumptions as in Claim B.2, given that e ∼ Dl , we have that Differentially Private Ordinary Least Squares ∼ N β , σ 2 (X T  X)−1 + l2 (M T M )−1  2 ζ̃ζ ∼ N 0 n , lr (I − M M + ) . β β̃  β = β + M + Ree = β + M + (M X + + Proof. Recall, β̃ RPU ⊥ )ee = β + X +e + M + R(PU ⊥ e ). Now, under the assumption e ∼ Dl we have that β is the sum of two independent Gaussians:  β , σ 2 X + · PU · (X + )T ) β + X +e ∼ N (β β , σ 2 (X T X)−1 ) = N (β ∼ N (00r , kPU ⊥ e k2 Ir×r ) RPU ⊥ e + e ⇒ M Re ∼ N (00p , kPU ⊥ e k2 (M T M )−1 ) Summing the two independent Gaussians’ means and β . Furthermore, in variances gives the distribution of β̃ Claim B.2 we have already established that  for any fixed  kPU ⊥ e k2 + e we have ζ̃ζ ∼ N 0 n , (I − M M ) . Hence, for r   2 e ∼ Dl we still have ζ̃ζ ∼ N 0 n , lr (I − M M + ) . (It is easy to verify that the same chain of derivations is applicable when e ∼ Dl .) Corollary B.4. Given that e ∼ Dl we have that β̃j ∼ −1 2 T N (βj , σ 2 (X T X)−1 j,j + l (M M )j,j ) for any coordinate j, and that kζ̃ζ k2 ∼ l2 r · χ2r−p . Proof. The corollary follows immediately from the fact β , and from the definition of the χ2 that βj = e T j β̃ distribution, as ζ̃ζ is a spherically symmetric Gaussian defined on the subspace colspan(M )⊥ of dimension r − p. To continue, we need the following claim. Claim B.5. Given X and M = RX, and given that e ∼ Dl β and ζ̃ζ are independent. we have that β̃ β = β + X +e + M + R(PU ⊥ e ). And Proof. Recall, β̃ so, given X, M and a specific vector PU ⊥ e we have β depends on (i) the projection that the distribution of β̃ of e on U = colspan(X) and on (ii) the projection of each row in R onto Ũ = colspan(M ). The distribution of ζ̃ζ = √1r PŨ ⊥ Ree = √1r PŨ ⊥ (M X + + RPU ⊥ )ee = √1 P ⊥ RPU ⊥ e depends on (i) the projection of e onto U ⊥ r Ũ (which for the time being is fix to some specific vector of length l) and on (ii) the projection of each row in R onto Ũ ⊥ . Since PU e is independent from PU ⊥ e , and since for any row u T of R we have that PŨ u is independent of PŨ ⊥ u , and since e and R are chosen independently, we have that β and ζ̃ζ are independent. β̃ Formally, consider any pair of coordinates β̃j and ζ̃k , and we have β̃j − βj + T + = eT j X e + e j M (RPU ⊥ e ) ζ̃k and = eT k PŨ ⊥ (RPU ⊥ e ) Recall, we are given X and M = RX. Therefore, we know PU and PŨ . And so Cov[β̃j , ζ̃k ] = E[(β̃j − βj )(ζ̃k − 0)] + T = E[eeT j X e (RPU ⊥ e ) PŨ ⊥ e k ] T + + E[eeT j M (RPU ⊥ e )(RPU ⊥ e ) PŨ ⊥ e k ] + ee T PU ⊥ ]E[RT ]PŨ ⊥ e k = eT j X E[e T + + eT j M E[(RPU ⊥ e )(RPU ⊥ e ) ]PŨ ⊥ e k  + eeT PU ⊥ ] (M X + )T + E[(RPU ⊥ )T ] PŨ ⊥ ek = eT j X E[e  + + eT kPU ⊥ e k2 Ir×r PŨ ⊥ e k jM  + ee T PU ⊥ ](X + )T M T PŨ ⊥ e k + 0 = eT j X E[e  + + l2 · e T j M PŨ ⊥ e k =0+0+0=0 β and ζ̃ζ are Gaussians, having their covariance = 0 And as β̃ implies independence. β and ζ̃ζ are independent Gaussians Having established that β̃ and specified their distributions, we continue with the proof of Theorem 3.1. We assume for now that there exists some small a > 0 s.t. −1 −1 2 T 2 T l2 (M T M )−1 j,j ≤ σ (X X)j,j + l (M M )j,j 2a 2 T ≤ e · l (M M )−1 j,j (7) Then, due to Corollary A.3, denoting the distributions N1 = N (0, l2 (M T M )−1 = j,j ) and N2 −1 2 T N (0, σ 2 (X T X)−1 + l (M M ) ), we have that for any j,j j,j S ⊂ R it holds that13 e−a Prβ̃j ∼N1 [S] ≤ Prβ̃j ∼N2 [S] ≤ ea Prβ̃j ∼N1 [S/ea ] (8) More specifically, denote the function t̃(ψ, kξξ k, βj ) ψ − βj q r kξξ k r−p (M T M )−1 j,j q r ξ kξ k . r−p ψ − βj = q l l (M T M )−1 = j,j and observe that when we sample ψ, ξ independently s.t. 2 ξ k2 ∼ lr χ2r−p then ψ ∼ N (βj , l2 (M T M )−1 j,j ) and kξ t̃(ψ, kξξ k, βj ) is distributed like a T -distribution with r − p 13 In fact, it is possible to use standard techniques from differential privacy, and argue a similar result — that the probabilities of any event that depends on some function f (βj ) under βj ∼ N1 and under βj ∼ N2 are close in the differential privacy sense. Differentially Private Ordinary Least Squares degrees of freedom. And so, for any τ > 0 we have that under such way to sample ψ, ξ we have Pr[t̃(ψ, kξξ k, βj ) > τ ] = 1 − CDFTr−p (τ ). for any I = (τ1 , τ2 ) with τ1 < τ2 ≤ 0, and deduce that the PDF of the function t̃(ψ, kξξ k, βj ) at x — where −1 2 T we sample ψ ∼ N (βj , l2 (M T M )−1 j,j + σ (X X)j,j ) For any τ ≥ 0 and for any non-negative real value z let Szτ denote the suitable set of values s.t. and kξξ k2 ∼ lr χ2r−p independently — lies in the range  e−a PDFTr−p (x), ea PDFTr−p (x/ea ) . And so, using Corollary B.4 and Claim B.5, we have that when e ∼ Dl , the distributions of β̃j and kζ̃ζ k2 are precisely as stated  ξ k, βj ) > τ ] Pr ψ∼N (βj , l2 (M T M )−1 ) [t̃(ψ, kξ j,j l2 kξξ k2 ∼ r χ2r−p  Z∞ = PDF l2 2 r χr−p 0 (z) · 2 def  Pr [Szτ ] dz {ψ−βj ∼N (0, l2 (M T M )−1 j,j )} above, and so we have that the distribution of t̃(βj ) = t̃(β̃j , kζ̃ζ k, βj ) has a PDF that at the point x is “sandwiched” between e−a PDFTr−p (x) and ea PDFTr−p (x/ea ). Next, we aim to argue that this characterization of the PDF of t̃(βj ) still holds when e ∼ N (00n , σ 2 In×n ). r That is, Szτ = τ · z r−p (M T M )−1 , ∞ . j,j It would be convenient to think of e as a sample in N (00n , σ 2 PU ) × N (00n , σ 2 PU ⊥ ). (So while in Dl we have We now use Equation (8) (Since N (0, l2 (M T M )−1 ) is j,j PU e ∼ N (00n , σ 2 PU ) but PU ⊥ e is fixed, now both PU e and precisely N1 ) to deduce that PU ⊥ e are sampled from spherical Gaussians.) The reason why the above still holds lies in the fact that t̃(βj ) does not   Prψ∼N (βj , l2 (M T M )−1 +σ2 (X T X)−1 ) [t̃(ψ, kξξ k, βj ) > τ ] depend on l. In more details: j,j j,j l2     kξξ k2 ∼ r χ2r−p Pre ∼N (00n ,σ2 In×n ) t̃(βj ) ∈ I Z ∞ Z   = PDF l2 2 (z) [Szτ ]dz = Pr Pr v )dvv −1 −1 2 T 2 T 0n ,σ 2 In×n ) t̃(βj ) ∈ I | PU ⊥ e = v PDFPU ⊥ e (v e ∼N (0 ψ − βj ∼ N (0, l (M M )j,j + σ (X X)j,j ) 0 r χr−p v Z ∞ Z   [Szτ /ea ]dz = ≤ ea Pr PDF l2 2 (z) Pr t̃(βj ) ∈ I | l = kvv k PDFPU ⊥ e (vv )dvv 2 (M T M )−1 ) χ ψ−β ∼N (0, l e ∼D 0 j l r r−p j,j v ! Z ∞ Z Z  (∗) = ea PDF l2 0  q r χ2r−p (z) Pr ψ−βj ∼N (0, a [Szτ /e ]dz l2 (M T M )−1 j,j ) j,j = ea 1 − l2 kξξ k2 ∼ r χ2r−p  CDFTr−p (τ /ea ) = ea  ξ k, βj ) > τ ] Pr ψ∼N (βj , l2 (M T M )−1 +σ 2 (X T X)−1 ) [t̃(ψ, kξ j,j > τ] 2 = e−a l kξξ k2 ∼ r χ2r−p   1 − CDFTr−p (τ ) In other words, we have just shown that for any interval I = (τ, ∞) with τ ≥ 0 we have that  ξ k, βj ) ∈ I] Pr ψ∼N (βj , l2 (M T M )−1 +σ 2 (X T X)−1 ) [t̃(ψ, kξ j,j  PDFTr−p (z)dz v PDFPU ⊥ e (vv )dvv Z PDFTr−p (z)dz I/ea where the last transition is possible precisely because t̃ is independent of l (or kvv k) — which is precisely what makes this t-value a pivot quantity. The proof of the lower bound is symmetric. j,j l2  kξξ k2 ∼ r χ2r−p −a  [t̃(ψ, kξ ξ k, βj ) e Pr  ψ∼N (βj , l2 (M T M )−1 j,j )  !Z Z I/ea = where the equality (∗) follows from the fact that τ /c Sz for any c > 0, since it is a non-negative interval. Analogously, we can also show that ≥ e a  Szτ /c  = PDFPU ⊥ e (vv )dvv PDFTr−p (z)dz I/ea v  ξ k, βj ) > τ /ea ] = ea Pr ψ∼N (βj , l2 (M T M )−1 ) [t̃(ψ, kξ  ea ≤ l2 kξξ k2 ∼ r χ2r−p a j,j  R is lower bounded by e PDFTr−p (z)dz and upper I R bounded by ea PDFTr−p (z)dz. We can now repeat I/ea the same argument for I = (τ1 , τ2 ) with 0 ≤ τ1 < τ2 (using an analogous definition of Szτ1 ,τ2 ), and again To conclude, we have shown that if Equation (7) holds, then for every interval   I ⊂ R we have that Pre ∼N (00n ,σ2 In×n ) t̃(βj ) ∈ I is lower bounded by e−a Prz∼Tr−p [z ∈ I] and upper bounded by ea Prz∼Tr−p [z ∈ (I/ea )]. So to conclude the proof of Theorem 3.1, we need to show that w.h.p such a as in Equation (7) exists. Claim B.6. In the homoscedastic model with Gaussian noise, if both n and r satisfy n, r ≥ p + Ω(log(1/ν)), then −1 −1 2 T 2 T we have that σ 2 (X T X)−1 j,j +l (M M )j,j ≥ l (M M )j,j and 2(r−p) −1 −1 2 T 2 T σ 2 (X T X)−1 j,j +l (M M )j,j ≤ (1+ n−p )·l (M M )j,j 2(r−p) n−p , Theorem 3.1 now follows Using (1 + 2(r−p) n−p ) ≤ e r−p from plugging a = n−p to our above discussion. Differentially Private Ordinary Least Squares Proof. The lower bound is immediate from non-negativity T −1/2 of σ 2 and of (X T X)−1 e j k2 . We therej,j = k(X X) fore prove the upper bound. parameter r w.p. ≥ 1 − ν we correctly α-reject the null hypothesis using p̃0 (i.e., w.p. ≥ 1 − ν Algorithm 1 returns matrix unaltered and we can estimate t̃0 and verify that First, observe that l2 = kPU ⊥ e k2 is sampled from σ 2 ·χ2n−p as U ⊥ is of dimension n − p. Therefore, it holds that w.p. ≥ 1 − ν/2 that indeed p̃0 < α · e σ2 √ n−p− p r−p − n−p ) provided ( σ 2 (c̃2 + τ̃α2 ) r ≥ p + max C1 2 α , C2 ln(1/ν) βj σmin (Σ) 2 2 ln(2/ν) ≤ l2 ) and 2 and assuming n > p+100 ln(2/ν) we therefore have σ ≤ 4 2 3(n−p) l . Secondly, we argue that when r > p + 300 ln(4/ν) we have that w.p. ≥ 1 − ν/2 it holds that −1 3 T T T (X X) ≤ (r − p)(X R RX)−1 j,j j,j . To see this, first 4 observe that by picking R ∼ N (0r×n , Ir×r , In×n ) the distribution of the product RX ∼ N (0r×d , Ir×r , X T X) is identical to picking Q ∼ N (0r×d , Ir×r , Id×d ) and taking the product Q(X T X)1/2 . Therefore, the distribution of (X T RT RX)−1 is  T 1/2 T T 1/2 −1 identical to (X X) Q Q(X X) = (X T X)−1/2 (QT Q)−1 (X T X)−1/2 . Denoting v = (X T X)−1/2e j we have kvv k2 = (X T X)−1 j,j . Claim A.1 from (Sheffet, 2015) gives that w.p. ≥ 1 − ν/2 we have  −1 T 1/2 T (r − p) · e T Q Q(X T X)1/2 ej j (X X) 1 = v T ( r−p QT Q)−1v ≥ 43 v Tv = 34 (X T X)−1 j,j  w2 n ≥ max r, C3 , C4 (p + ln(1/ν)) min{σmin (Σ), σ 2 }  16l2 (r−p) (X T RT RX)−1 j,j n−p −1 2 T T ≤ 2(r−p) l (X R RX) j,j n−p and as we denote M = RX we are done. We comment that our analysis in the proof of Claim B.6 implicitly assumes r  n (as we do think of the projection R as dimensionality reduction), and so the ratio r−p n−p is small. However, a similar analysis holds for r which is comparable to n — in which we would argue that −1 2 T σ 2 (X T X)−1 j,j +l (M M )j,j σ 2 (X T X)−1 ∈ [1, 1 + η] for some small η. PDFN (0,1) (x)dx = the numbers r−p α − n−p e 2 = r−p α − n−p 2e s.t. and resp. Proof. First we need to use the lower bound on n to show that indeed Algorithm 1 does not alter A, and that various quantities are not far from their expected values. Formally, we claim the following. Proposition B.8. Under the same lower bounds on n and r as in Theorem 3.3, w.p. 1−α−ν we have that Theorem 3.1 holds and also that r−p 2 2 ζ̃ζ k2 = Θ( r−p r kPU ⊥ e k ) = Θ( r (n − p)σ ) and −1 T 1 (X T RT RX)−1 j,j = Θ( r−p (X X)j,j ) Proof of Proposition B.8. First, we need to argue that we 2 have enough samples as to have the gap σmin ([X; y]) − w2 sufficiently large. Since x i ∼ N (0, Σ), and yi = β Tx i + ei with ei ∼ xi ◦ yi ) is also N (0, σ 2 ), we have that the concatenation (x xi ] + sampled from a Gaussian. Clearly, E[yi ] = β T E[x β Txi + E[ei ] = 0. Similarly, E[xi,j yi ] = E[xi,j · (β β )j and E[yi2 ] = E[e2i ] + E[kXβ β k2 ] = σ 2 + ei )] = (Σβ β T X T Xβ β ] = σ 2 + β T Σβ β . Therefore, each row of A is E[β an i.i.d sample of N (00p+1 , ΣA ), with B.3. Proof of Theorem 3.3 Theorem B.7 (Theorem 3.3 restated.). Fix a positive definite matrix Σ ∈ Rp×p . Fix parameters β ∈ Rp and σ 2 > 0 and a coordinate j s.t. βj 6= 0. Let X be a matrix whose n rows are sampled i.i.d from N (00p , Σ). Let y be a vector s.t. β )i is sampled i.i.d from N (0, σ 2 ). Fix ν ∈ (0, 1/2) yi −(Xβ and α ∈ (0, 1/2). Then there exist constants C1 , C2 , C3 and C4 such that when we run Algorithm 1 over [X; y ] with denote r−p τ̃α /e n−p Combining the two inequalities we get: ≤ τ̃α PDFTr−p (x)dx r−p c̃α /e n−p R∞ which implies the required. σ 2 (X T X)−1 j,j c̃α , where R∞  ΣA = Σ β TΣ β Σβ  β T Σβ β σ 2 +β Denote λ2 = σmin (Σ). Then, to argue that σmin (ΣA ) is large we use the lower bound from (Ma & Zarowski, 1995) (Theorem 3.1) combining with some simple arithmetic manipulations to deduce that σmin (ΣA ) ≥ min{σmin (Σ), σ 2 }. Differentially Private Ordinary Least Squares r−p Having established a lower bound on σmin (ΣA ), it follows that with n = Ω(p ln(1/ν)) i.i.d draws from N (00p+1 , ΣA ) we have w.p. ≤ ν/4 that σmin (AT A) = o(n) · min{σmin (Σ), σ 2 }. Conditioned on σmin (AT A) = Ω(nσmin (ΣA )) = Ω(w2 ) being large enough, we have that w.p. ≤ ν/4 over the randomness of Algorithm 1 the matrix A does not pass the if-condition and the output of the algorithm is not RA. Conditioned on Algorithm 1 outputting RA, and due to the lower bound r = p + Ω(ln(1/ν)), we have that the result of Theorem 3.1 does not hold w.p. ≤ α + ν/4. All in all we deduce that w.p. ≥ 1 − α − 3ν/4 the result of Theorem 3.1 holds. And since we argue Theorem 3.1 holds, then the following two bounds that are used in the proof14 also hold: = Ω(e n−p (c̃α + τ̃α )σ̃  (c̃α +τ̃α )2 σ 2 βj2 σmin (Σ)  C. Projected Ridge Regression In this section we deal with the case that our matrix does not pass the if-condition of Algorithm 1. In this case, the matrix is appended  with a d× d-matrix which is wId×d . A 0 Denoting A = we have that the algorithm’s w · Id×d output is RA0 . Similarly to before, we are going to denote d = p + 1 and decompose A = [X; y ] with X ∈ Rn×p and y ∈ Rn , with β + e and ei sampled the standard assumption of y = Xβ i.i.d from N (0, σ 2 ).15 We now need to introduce some additional notation. We denote the appended matrix and vectors X 0 and y 0 s.t. A0 = [X 0 ; y 0 ]. Meaning:   X X 0 =  wIp×p  0T p 2 kPU ⊥ e k = Θ((n − p)σ ) Lastly, in the proof of Theorem 3.1 we argue that for a given PU ⊥ e the length kζ̃ζ k2 is distributed like kPU ⊥ e k2 2 χr−p . r Appealing again to the fact that r = p + Ω(ln(1/ν) we have that w.p. ≥ ν/4 it holds that kζ̃ζ k2 > kP (X T RT RX)−1 j,j )) which, given the lower bound r = p + Ω indeed holds. −1 T 1 (X T RT RX)−1 j,j = Θ( r−p (X X)j,j ) 2 q e k2 2(r − p) U r⊥ . Plugging in the value of kPU ⊥ e k2 concludes the proof of the proposition. and Based on Proposition B.8, we now show that we indeed reject the null-hypothesis (as we should). When Theorem 3.1 holds, reject the null-hypothesis iff p̃0 < α · e r−p − n−p    y e def β  = X 0β + e 0 y 0 =  0 p  = X 0β +  −wβ w w  r−p which holds iff |t̃0 | > e n−p τ̃α . This implies r−p And so we respectively denote R = [R1 ; R2 ; R3 ] with R1 ∈ Rr×n , R2 ∈ Rr×p and R3 ∈ Rr×1 (so R3 is a vector denoted as a matrix). Hence: n−p τ̃ · we α q reject that null-hypothesis when |β̃j | > e −1 σ̃ (X T RT RX)j,j ). Note that this bound is based onCorollary 3.2 that determines  that |β̃j − βj | = q r−p −1 T T O e n−p c̃α · σ̃ (X R RX)j,j ) . And so we have that M 0 = RX 0 = R1 X + wR2 and w.p. ≥ 1 − ν we α-reject the null hypothesis when it holds q r−p n−p (c̃ + that |βj | > 3(c̃α + τ̃α )· σ̃ (X T RT RX)−1 ) ≥ e α j,j q τ̃α )σ̃ (X T RT RX)−1 j,j ) (due to the lower bound n ≥ r). β +R1e +wR3 Ryy 0 = RX 0β +Ree0 = R1y +wR3 = R1 Xβ Based on the bounds stated above we have that q q q √ √ r r σ̃ = kζ̃ζ k r−p = Θ(σ n − p r−p r r−p ) = Θ(σ n − p)  1 r−p · 1 nσmin (Σ) And so, a sufficient condition for rejecting the nullhypothesis is to have r   n−p q 1 |βj | = Ω (c̃α + τ̃α )σ · nσmin (Σ) r−p 14 β0 = arg min 1r kRyy 0 − RX 0z k2 z = (X 0T RT RX 0 )−1 (RX 0 )T (Ryy 0 ) and that −1 T 1 (X T RT RX)−1 j,j = Θ( r−p (X X)j,j ) = O And so, using the output RA0 of Algorithm 1, we solve the linear regression problem derived from √1r RX 0 and √1 Ry y 0 . I.e., we set r More accurately, both are bounds shown in Claim B.6.  Sarlos’ results (2006) regarding the Johnson Lindenstrauss transform give that, when R has sufficiently many rows, solving the latter optimization problem gives a good approximation for the solution of the optimization problem β R = arg minz kyy 0 − X 0z k2 = arg minz kyy − Xzz k2 + w2 kzz k2 15 Just as before, it is possible to denote any single column as y and any subset of the remaining columns as X.  Differentially Private Ordinary Least Squares The latter problem is known as the Ridge Regression problem. Invented in the 60s (Tikhonov, 1963; Hoerl & Kennard, 1970), Ridge Regression is often motivated from the perspective of penalizing linear vectors whose coefficients are too large. It is also often applied in the case where X doesn’t have full rank or is close to not having full-rank. That is because the Ridge Regression problem is always solvable. One can show that the minimizer β R = (X T X + w2 Ip×p )−1 X Ty is the unique solution of the Ridge Regression problem and that the RHS is always defined (even when X is singular). The original focus of Ridge Regression is on penalizing β R for having large coefficients. Therefore, Ridge Regression actually poses a family of linear regression problems: minz ky − Xzz k + λkzz k2 , where one may set λ to be any non-negative scalar. And so, much of the literature on Ridge Regression is devoted to the art of fine-tuning this penalty term — either empirically or based on the λ that β R ] − β k2 + Var(β β R ).16 Here we yields the best risk: kE[β propose a fundamentally different approach for the choice of the normalization factor — we set it so that solution of the regression problem would satisfy (, δ)-differential privacy (by projecting the problem onto a lower dimension). While the solution of the Ridge Regression problem might have smaller risk than the OLS solution, it is not known how to derive t-values and/or reject the null hypothesis under Ridge Regression (except for using X to manipulate β = (X T X)−1 X Ty and relying on OLS). β R back into β̂ In fact, prior to our work there was no need for such analysis! For confidence intervals one could just use the standard OLS, because access to X and y was given. Therefore, much for the same reason, we are unable to derive t-values under projected Ridge Regression.17 Clearly, there are situations where such confidence bounds simply cannot be derived. (Consider for example the case where X = 0n×p and y is just i.i.d draws from N (0, σ 2 ), so obviously [X; y] gives no information about β .) Nonetheless, under additional assumptions about the data, our work can give confidence intervals for βj , and in the case where the interval doesn’t intersect the origin — assure us that sign(βj0 ) = sign(βj ) w.h.p. Clearly, Sarlos’ work (2006) gives an upper bound on the β 0 −β β R k. However, such distance bound doesn’t distance kβ come with the coordinate by coordinate confidence guarantee we would like to have. In fact, it is not even clear β 0 ] = β R (though it is obvious from Sarlos’ work that E[β 0T T 0 βR to see that E[(X R RX )]β = E[(RX 0 )T Ryy 0 ]). Here, β 0 ] = β̂ β which, more often than not, does we show that E[β R not equal β . Comment about notation. Throughout this section we assume X is of full rank and so (X T X)−1 is well-defined. If X isn’t full-rank, then one can simply replace any occurrence of (X T X)−1 with X + (X + )T . This makes all our formulas well-defined in the general case. C.1. Running OLS on the Projected Data In this section, we analyze the projected Ridge Regression, under the assumption (for now) that e is fixed. That is, for now we assume that the only source of randomness comes from picking the matrix R = [R1 ; R2 ; R3 ]. As before, we analyze the distribution over β 0 (see Equation (9)), and the value of the function we optimize at β 0 . Denoting M 0 = RX 0 , we can formally express the estimators: β0 ζ0 = (M 0T M 0 )−1 M 0T Ryy 0 = √1r (Ryy 0 − RX 0β 0 ) (9) (10) β +ee for a fixed e , and given Claim C.1. Given that y = Xβ X and M 0 = RX 0 = R1 X + wR2 we have that  β 0 ∼ N β + X +e ,  β + X +e k2 + 1) + kPU ⊥ e k2 )(M 0T M 0 )−1 (w2 (kβ  ζ 0 ∼ N 0r ,  β +X +e k2 +1)+kPU ⊥ e k2 w2 (kβ 0 0+ (I − M M ) r×r r and furthermore, β 0 and ζ 0 are independent of one another. Proof. First, we write β 0 and ζ 0 explicitly, based on e and projection matrices: β0 ζ0 = (M 0T M 0 )−1 M 0T Ryy 0 β + M 0+ (R1e + wR3 ) = M 0+ (R1 X)β = √1r (Ryy 0 − RX 0β 0 ) = √1r (Ir×r − M 0 M 0+ )Ree0 = √1r PU 0⊥ (R1e − wR2β + wR3 ) with U 0 denoting colspan(M 0 ) and PU 0⊥ denoting the projection onto the subspace U 0⊥ . 16 Ridge Regression, as opposed to OLS, does not yield an unβ R ] 6= β . biased estimator. I.e., E[β 17 Note: The naı̈ve approach of using RX 0 and Ryy 0 to interpolate RX and Ryy and then apply Theorem 3.1 using these estimations of RX and Ryy ignores the noise added from appending the matrix A into A0 , and it is therefore bound to produce inaccurate estimations of the t-values. Again, we break e into an orthogonal composition: e = PU e + PU ⊥ e with U = colspan(X) (hence PU = XX + ) and U ⊥ = colspan(X)⊥ . Therefore, β0 β + M 0+ (R1 XX +e + R1 PU ⊥ e + wR3 ) = M 0+ (R1 X)β 0+ β + X +e ) + M 0+ (R1 PU ⊥ e + wR3 ) = M (R1 X)(β Differentially Private Ordinary Least Squares whereas ζ 0 is essentially √1 (Ir×r r (∗) − M 0 M 0+ )(R1 XX +e + R1 PU ⊥ e − wR2β + wR3 ) √1 (Ir×r r = 0 −M M 0+ )· β + wR3 ) (R1 XX e + R1 PU ⊥ e + (M 0 − wR2 )β + = √1 (Ir×r r − M 0 M 0+ )· β + X +e k2 + 1) + kPU ⊥ e k2 )PU 0⊥ I.e., N 0 r , 1r (w2 (kβ 0 as PU 0⊥ M = 0r×r .  Finally, observe that β 0 and ζ 0 are independent as the former depends on the projection of the spherical Gaussian R1 X(β + X +e ) + R1 PU ⊥ e + wR3 on U 0 , and the latter depends on the projection of the same multivariate Gaussian on U 0⊥ . β + X +e ) + R1 PU ⊥ e + wR3 ) (R1 X(β where equality (∗) holds because (I − M 0 M 0+ )M 0v = 0 for any v . We now aim to describe the distribution of R given that we know X 0 and M 0 = RX 0 . Since M 0 = R1 X + wR2 + 0 · R3 = R1 X(X + X) + wR2 = (R1 PU )X + wR2 then M 0 is independent of R3 and independent of R1 PU ⊥ . Therefore, given X and M 0 the induced distribution over R3 remains R3 ∼ N (00r , Ir×r ), and similarly, given X and M 0 we have R1 PU ⊥ ∼ N (0r×n , Ir×r , PU ⊥ ) (rows remain independent from one another, and each row is distributed like a spherical Gaussian in colspan(X)⊥ ). And so, we have that R1 X = R1 PU X = M 0 − wR2 , which in turn implies:  R1 X ∼ N M 0 , Ir×r , w2 · Ip×p Observe that Claim C.1 assumes e is given. This may seem somewhat strange, since without assuming anything about e there can be many combinations of β and e for which β + e . However, we always have that β + X +e = y = Xβ + β . Similarly, it is always the case the PU ⊥ e = X y = β̂ β and ζ in (I − XX + )yy = ζ . (Recall OLS definitions of β̂ Equation (1) and (2).) Therefore, the distribution of β 0 and ζ 0 is unique (once y is set):   β , (w2 (kβ̂ β k2 + 1) + kζζ k2 )(M 0T M 0 )−1 β 0 ∼ N β̂ ! 2 β 2 2 ζ w (k β̂ k + 1) + kζ k ζ 0 ∼ N 0r , (Ir×r − M 0 M 0+ ) r And so for a given dataset [X; y ] we have that β 0 serves as β. an approximation for β̂ multiplying this random matrix with a vector, we get An immediate corollary of Claim C.1 is that for any fixed e it holds that the quantity t0 (βj ) = β +X +e ) ∼ N (M 0β + M 0 X +e , w2 kββ + X +e k2 Ir×r ) R1 X(β kζζ 0 k and multiplying this random vector with a matrix we get β +X +e ) ∼ N (β + X +e , M 0+ R1 X(β β + X +e k2 (M 0T M )−1 ) w2 kβ I.e., β +X +e ) ∼ kβ β +X +e k·N (u u, w2 (M 0T M )−1 ) M 0+ R1 X(β where u denotes a unit-length vector in the direction of β + X +e . Similar to before we have RPU ⊥ ∼ N (0r×n , Ir×r , PU ⊥ ) ⇒ M 0+ (RPU ⊥ e) ∼ N (00d , kPU ⊥ ek2 (M 0T M 0 )−1 ) wR3 ∼ N (00r , w2 Ir×r ) ⇒ M 0+ (wR3 ) ∼ N (00d , w2 (M 0+ M 0 )−1 ) Therefore, the distribution of β 0 , which is the sum of the 3 independent Gaussians, is as required. β + X +e ) + R1 PU ⊥ e + wR3 ) Also, ζ 0 = √1r PU 0⊥ (R1 X(β is the sum of 3 independent Gaussians, which implies its distribution is  β + X +e ), N √1r PU 0⊥ M 0 (β  2 + 2 2 1 β (w (kβ + X e k + 1) + kP ⊥ e k )PU 0⊥ U r βj0 −(βj +(X +e )j ) q r 0T 0 −1 r−p ·(M M )j,j = kζζ 0 k β 0 −β̂j q rj 0T 0 −1 r−p ·(M M )j,j is dis- tributed like a Tr−p -distribution. Therefore, the following theorem follows immediately. β = Theorem C.2. Fix X ∈ Rn×p and y ∈ R. Define β̂ X +y and ζ = (I − XX + )yy . Let RX 0 and Ryy 0 denote the result of applying Algorithm 1 to the matrix A = [X; y ] when the algorithm appends the data with a w · I matrix. Fix a coordinate j and any α ∈ (0, 1/2). When computing β 0 and ζ 0 as in Equations (9) it and (10), we have that w.p. ≥ 1 − α it holds that q   r β̂j ∈ βj0 ± c0α kζζ 0 k r−p · (M 0T M 0 )−1 j,j where c0α denotes the number such that (−c0α , c0α ) contains 1 − α mass of the Tr−p -distribution. Note that Theorem C.2, much like the rest of the discussion in this Section, builds on y being fixed, which means βj0 serves as an approximation for β̂j . Yet our goal is to argue about similarity (or proximity) between βj0 and βj . To that end, we combine the standard OLS confidence interval — which says that w.p. ≥ 1 − α over the randomness of picking r e in the homoscedastic model we have |βj − β̂j | ≤ cα kζζ k (X T X)−1 j,j n−p — with the confidence in- terval of Theorem C.2 above, and deduce that w.p. ≥ 1 − α Differentially Private Ordinary Least Squares we have that |βj0 − βj | is at most 1 − ν over the randomness of R we have (r −  kζζ 0 k2 −1 2 T p)(M 0T M )−1 j,j = Θ (w Ip×p + X X)j,j and r−p = q q  kζζ k (X T X)−1 kζζ 0 k r(M 0T M 0 )−1 j,j j,j  √ √ O cα + c0α n−p r−p  Θ( w (11) And so, in the next section, our goal is to give conditions under which the interval of Equation (11) isn’t much larger q in comparison to the interval length of 18 ζ0 ζ k c0α √kζr−p r(M 0T M 0 )−1 j,j we get from Theorem C.2; and more importantly — conditions that make the interval of Theorem C.2 useful q and not too large. (Note, in expecta- tion kζζ 0 k √ r−p is about β k2 + kζζ k2 )/r. So, for (w2 + w2 kβ̂ β k is very large, this interval example, in situations where kβ̂ isn’t likely to inform us as to the sign of βj .) Motivating Example. A good motivating example for the discussion in the following section is when [X; y ] is a strict submatrix of the dataset A. That is, our data contains many variables for each entry (i.e., the dimensionality d of each entry is large), yet our regression is made only over a modest subset of variables out of the d. In this case, the least singular value of A might be too small, causing the algorithm to alter A; however, σmin (X T X) could be sufficiently large so that had we run Algorithm 1 only on [X; y ] we would not alter the input. (Indeed, a differentially private way for finding a subset of the variables that induce a submatrix with high σmin is an interesting open question, partially answered — for a single regression — in the work of Thakurta and Smith (Thakurta & Smith, 2013).) Indeed, the conditions we specify in the following section depend on σmin ( n1 X T X), which, for a zero-mean data, the minimal variance of the data in any direction. For this motivating example, indeed such variance isn’t necessarily small. C.2. Conditions for Deriving a Confidence Interval for Ridge Regression 2 β k2 +kζζ k2 +w2 kβ̂ ). r Proof. The former bound follows from known results on the Johnson-Lindenstrauss transform (as were shown in the proof of Claim B.6). The latter bound follows from standard concentration bounds of the χ2 -distribution. Plugging in the result of Proposition C.3 to Equation (11) we get that w.p. ≥ 1 − ν the difference |βj0 − βj | is at most q  kζζ k O cα √ (X T X)−1 j,j n−p s  β k2 + kζζ k2 q 2 w2 + w2 kβ̂ + c0α (w Ip×p + X T X)−1 j,j r−p (12) We will also use the following proposition. Proposition C.4. (X T X)−1 j,j ≤  1+ w2 σmin (X T X)  (w2 Ip×p + X T X)−1 j,j Proof. We have that (X T X)−1 = (X T X)−1 (X T X + w2 Ip×p )(X T X + w2 Ip×p )−1 = (X T X + w2 Ip×p )−1 + w2 (X T X)−1 (X T X + w2 Ip×p )−1 = (Ip×p + w2 (X T X)−1 )(X T X + w2 Ip×p )−1 Looking at the interval specified in Equation (11), we now give an upper bound on the the random quantities in this interval: kζζ k, kζζ 0 k, and (M 0T M 0 )−1 j,j . First, we give bound that are dependent on the randomness in R (i.e., we continue to view e as fixed). = (X T X + w2 Ip×p )−1/2 · Proposition C.3. For any ν ∈ (0, 1/2), if we have r = p + Ω(ln(1/ν)) then with probability ≥ where the latter holds because (Ip×p + w2 (X T X)−1 ) and (X T X + w2 Ip×p )−1 are diagonalizable by the same matrix V (the same matrix for which (X T X) = V S −1 V T ). 2 Since we have kIp×p + w2 (X T X)−1 k = 1 + σ2 w (X) , it is 18 Observe that w.p. ≥ 1 − α r over the randomness of e we have that |βj − β̂j | ≤ cα kζζ k (X T X)−1 j,j n−p , and w.p. ≥ 1 − α over the randomness of R we have that |βj0 − β̂j | ≤ q r c0α kζζ 0 k r−p · (M 0T M 0 )−1 j,j . So technically, to give a (1 − α)βj0 confidence interval around that contains βj w.p. ≥ 1 − α, we need to use cα/2 and c0α/2 instead of cα and c0α resp. To avoid overburdening the reader with what we already see as too many parameters, we switch to asymptotic notation. (Ip×p + w2 (X T X)−1 )· (X T X + w2 Ip×p )−1/2 min w2 )I . 2 σmin (X) p×p T T −1 e j (X X) e j ≤ (1 + clear that (Ip×p + w2 (X T X)−1 )  (1 + We deduce that (X T X)−1 j,j = w2 )(X T X 2 σmin (X) + w2 Ip×p )−1 j,j . Based on Proposition C.4 we get from Equation (12) that Differentially Private Ordinary Least Squares |βj0 − βj | is at most v u w2 2  u t kζζ k (1 + σmin (X T X) ) O( cα + n−p s β k2 + kζζ k2 q 2 w2 + w2 kβ̂ (w Ip×p + X T X)−1 c0α j,j ) r−p (13) And so, if it happens to be the case that exists some small β , ζ and w2 satisfy η > 0 for which β̂ ! 2 kζζ k2 (1 + σminw(X T X) ) β k2 + kζζ k2 w2 + w2 kβ̂ 2 ≤η n−p r−p (14) then we have that Pr[β ∈ j   q βj0 ± O((1 + η) · 1 − α. c0α kζζ 0 k r r−p · (M 0T M 0 )−1 j,j ) ] ≥ 19 Moreover, if in this case |βj | > q q 2 2 kβ̂ β k2 +kζζ k2 + η) w +w r−p (w2 Ip×p + X T X)−1 j,j then Pr[sign(βj0 ) = sign(βj )] ≥ 1 − α. This is precisely what Claims C.5 and C.6 below do. Claim C.5. If there exists η > 0 2 2 s.t. n − p ≥ (r − p) and n = η2   2 1 3/2 B ln(1/δ) Ω r · · , then Pr[βj ∈ 1  η 2 σmin ( n X T X)   q r βj0 ± O((1 + η) · c0α kζζ 0 k r−p · (M 0T M 0 )−1 ) ] ≥ j,j 1 − α. c0α (1 Proof. Based on the above discussion, it is enough to argue that under the conditions of the claim, the constraint 2 r−p of Equation (14) holds. Since we require η2 ≥ n−p then it is evident that kζζ k2 n−p 2 kζζ k2 n−p η 2 kζζ k2 2(r−p) . So we now show that η 2 kζζ k2 2(r−p) under the conditions of the ≤ · σminw(X T X) ≤ claim, and this will show the required. All that is left is some algebraic manipulations. It suffices to have: η2 2 · n−p T r−p σmin (X X) η2 2 ≥ 32B ≥ which holds for n2 ≥ r3/2 · as we assume to hold. · T n2 1 r σmin ( n X X) √ 2 r ln(8/δ) ≥ w2  64B 2 ln(1/δ) σmin ( n1 X T X)−1 , η 2 Claim C.6. Fix ν ∈ (0, 12 ). If (i) n = p + Ω(ln(1/ν)), β k2 = Ω(σ 2 kX + k2F ln( νp )) and (iii) r − p = (ii) kβ   Ω (c0α )2 (1+η)2 βj2 β k2 + 1 + kβ σ2 1 σmin ( n X T X) , then in the homoscedastic model, with probability ≥ 1−ν −α we have that sign(βj ) = sign(βj0 ). 19 We assume n ≥ r so cα < c0α as the Tn−p -distribution is closer to a normal Gaussian than the Tr−p -distribution. Proof. Based on the above discussion, we aim to show that in the homoscedastic model (where each coordinate ei ∼ N (0, σ 2 ) independently) w.p. ≥ 1 − ν it holds that the magnitude of βj is greater than s c0α (1 + η) β k2 + kζζ k2 q 2 w2 + w2 kβ̂ (w Ip×p + X T X)−1 j,j r−p To show this, we invoke Claim A.4 to argue that w.p. ≥ 1 − ν we have (i) kζζ k2 ≤ 2σ 2 (n − p) (since n = p + β k2 ≤ 2kβ β k2 (since kβ β − β̂ β k2 ≤ Ω(ln(1/ν))), and (ii) kβ̂ p 2 + 2 2 2 + 2 β k = Ω(σ kX kF ln( νp ))). σ kX kF ln( ν ) whereas kβ 2 We also use the fact that (w2 Ip×p + X T X)−1 j,j ≤ (w + −1 T σmin (X X)), and then deduce that s β k2 + kζζ k2 q 2 w2 + w2 kβ̂ (w Ip×p + X T X)−1 j,j r−p s β k2 ) + σ 2 (n − p) (1 + η)c0α w2 (1 + kβ ≤ √ 2 2 r−p w + σmin (X T X) s (1 + η)c0α 2σ 2 (n − p) β k2 ) + ≤ √ 2(1 + kβ ≤ |βj | r−p σmin (X T X) (1 + η)c0α due to our requirement on r − p. Observe, out of the 3 conditions specified in Claim C.6, condition (i) merely guarantees that the sample is large enough to argue that estimations are close to their expect value; and condition (ii) is there merely to guarantee that β k ≈ kβ β k. It is condition (iii) which is non-trivial to kβ̂ hold, especially together with the conditions of Claim C.5 that pose other constraints in regards to r, n, η and the various other parameters in play. It is interesting to compare the requirements on r to the lower bound we get in Theorem 3.3 — especially the latter bound. The two bounds are strikingly similar, with the exception that here we also β k2 require r − p to be greater than 1+kβ . This is part of the βj2 unfortunate effect of altering the matrix A: we cannot give confidence bounds only for the coordinates j for which βj2 β k2 . is very small relative to kβ In summary, we require to have n = p + Ω(ln(1/ν)) and β k compathat X contains enough sample points to have kβ̂ β k, and then set r and η such that (it is convenient rable to kβ to think of η as a small constant, say, η = 0.1) • r − p = O(η 2 (n − p)) (which implies r = O(n))  2 3 n2 • r = O( η 2 B 2 ln(1/δ) σmin ( n1 X T X) ) 2 βk • r − p = Ω( 1+kβ + β2 β j σ2 βj2 −1 1 · σmin ( n X T X)) Differentially Private Ordinary Least Squares to have that the (1 − α)-confidence interval around βj0 does not intersect the origin. Once again, we comment that these conditions are sufficient but not necessary, and furthermore — even with these conditions holding — we do not make any claims of optimality of our confidence bound. That is because from Proposition C.4 onwards our discussion uses upper bounds that do not have corresponding lower bounds, to the best of our knowledge. D. Confidence Intervals for “Analyze Gauss” Algorithm To complete the picture, we now analyze the “Analyze Gauss” algorithm of Dwork et al (Dwork et al., 2014). Algorithm 2 works by adding random Gaussian noise to AT A, where the noise is symmetric with each coordi2 nate abovethe diagonal  sampled i.i.d from N (0, ∆ ) with ∆2 = O B 4 log(1/δ) .20 Using the same notation for a 2 sub-matrix of A as [X; y ] as before, with X ∈ Rn×p and y ∈ Rn , we denote the output of Algorithm 2 as       ^ TX X TX yg   g  Ty  X =   Ty yg  T X X +N y TX + nT Ty X y +n    y Ty + m (15) where N is a symmetric p × p-matrix, n is a p-dimensional vector and m is a scalar, whose coordinates are sampled i.i.d from N (0, ∆2 ). Using the output of Algorithm 2, it is simple to derive anaβ and kζζ k2 (Equations (1) and (2)) logues of β̂ −1  −1 g ^ TX Ty = X T X + N X βe = X (X T y + n ) (16) r +∆ −2 √ ^ TX X j,j · ln(1/ν) · (B p + 1)  where ρ is such that ρ2 is w.h.p an upper bound on σ 2 , defined as 2 def ρ =  1√ √ n−p−2 ln(4/α) 2 ·    √ −1 B2 p p 2 g ^ T 2 kζζ k − C · ∆ 1−η ln(1/ν) + ∆ kX X kF · ln(p/ν) for some large constant C. We comment that in practice, instead of using ρ, it might be better to use the MLE of σ 2 , namely:   −1 def 2 ^ 1 g 2 2 T σ = n−p kζζ k + ∆ kX X kF instead of ρ2 , the upper bound we derived for σ 2 . (Replacing an unknown variable with its MLE estimator is a common approach in applied statistics.) Note that the assumpβ k ≤ B is fairly benign once we assume each tion that kβ β k ≤ B simrow has bounded l2 -norm. The assumption kβ̂ β ply assumes that β̂ is a reasonable estimation of β , which is likely to hold if we assume that X T X is well-spread. The assumption about the magnitude of the least singular value of X T X is therefore the major one. Nonetheless, in the case we considered before where each row in X is sampled i.i.d from N (00, Σ), this assumption merely means that n is √ large enough s.t. n = Ω̃( ∆ p ln(1/ν) η·σmin (Σ) ). In order to prove Theorem D.1, we require the following proposition. (17) Proposition D.2. Fix any ν ∈ (0, 21 ). Fix any matrix M ∈ Rp×p . Let v ∈ Rp be a vector with each coordinate sampled independently from a Gaussian N (0, ∆2 ).i Then h p we have that Pr kMvv k > ∆ · kM kF 2 ln(2p/ν) < ν. g ζ k2 to get a We now argue that it is possible to use βej and kζ confidence interval for βj under certain conditions. Theorem D.1. Fix α, ν ∈ (0, 12 ). Assume that there exists p η ∈ (0, 21 ) s.t. σmin (X T X) > ∆ p ln(1/ν)/η. Under the homoscedastic model, given β and σ 2 , if we assume also β k ≤ B and kβ̂ β k = k(X T X)−1 X Ty k ≤ B, then that kβ w.p. ≥ 1 − α − ν it holds that |βj − βej | it at most s   −1 −2 p ^ ^ TX TX O ρ· X + ∆ p ln(1/ν) · X ln(1/α) j,j j,j Proof. Given M , we have that Mvv ∼ N (00, ∆2 · M M T ). Denoting M ’s singular values as sv1 , . . . , svp , we can rotate Mvv without affecting its l2 -norm and infer that kMvv |2 is distributed like a sum on p independent Gaussians, each sampled from N (0, ∆2 · svi2 ). Standard union bound gives that w.p. ≥ 1 − ν non of the pp Gaussians exceeds its standard deviation by a factor of 2 ln(2p/ν). Hence, w.p. P ≥ 1 − ν it holds that kMvv k2 ≤ 2∆2 i svi2 ln(2p/ν) = 2∆2 · trace(M M T ) · ln(2p/ν). T g ^ ] e + βe X e Ty − 2 y TXβ TX β ζ k2 = yg kζ −1 ^ ] Ty − y TX X TX = yg ] Ty X 20 It is easy to see that the l2 -global sensitivity of the mapping A 7→ AT A is ∝ B 4 . Fix any A1 , A2 that differ on one row which is some vector v with kvv k = B in A1 and the all zero vector in A2 . Then GS22 = kAT1 A1 − AT2 A2 k2F = kvvv T k2F = trace(vvv T · v v T ) = (vv Tv )2 = B 4 . Our proof also requires the use of the following equality, that holds for any invertible A and any matrix B s.t. I + B · A−1 is invertible: −1 −1 (A + B) = A−1 − A−1 I + BA−1 BA−1 Differentially Private Ordinary Least Squares −1 In our case, we have T ^ TX we can bound the variance of X j→ X e by ! 2 −1 −1 ^ ^ T TX . Appealing to σ2 X j,j + kN k · X X j→ −1 ^ TX X = (X T X + N )−1 T −1 −1 T  −1 −1 −1 T − (X X) I + N (X X) N (X X)    −1 = (X T X)−1 I − I + N (X T X)−1 N (X T X)−1  def = (X T X)−1 I − Z · (X T X)−1 (18) = (X X) T Proof of Theorem D.1. Fix ν > 0. First, we apply to standard results about Gaussian matrices, such as (Tao, 2012) (used also by (Dwork et al., 2014) in their analysis), to see p that w.p. ≥ 1 − ν/6 we have kN k = O(∆ p ln(1/ν)). And so, for the remainder of the proof we fix N subject to having bounded operator norm. Note that by fixing N we ^ T X. fix X β + e with Recall that in the homoscedastic model, y = Xβ each coordinate of e sampled i.i.d from N (0, σ 2 ). We therefore have that −1 ^ TX βe = X ^ TX (X Ty + n ) = X −1 −1 ^ TX =X −1 ^ TX =β −X −1 ^ TX β +X Nβ ! σ 2 ln(1/α) . −1 −1 2 −1 2 ^ ^ TX X X T X j→ j→n ∼ N (0, ∆ ). Gaussian concentra−1 ^ TX tion bounds give that w.p ≥ 1−ν/6 we have |X j→n | =   −1 p ^ TX ln(1/ν) . O ∆ X j→ Plugging this into our above bounds on all terms that appear in Equation (19) we have that w.p. ≥ 1 − ν/2 − α/2 we have that βej − βj is at most ^ TX X e+X −1  n ^ TX X j→ · B∆ O p  p ln(1/ν) −1  v u −1 −1 u p ^ ^ TX T  + O σt X j,j + ∆ p ln(1/ν) · X X j→ n 2  ! ln(1/α)  −1 ^ TX Denoting the j-th row of X ^ TX as X j→ we deduce: −1  ^ TX +O ∆ X j→ p  ln(1/ν) −1 −1 −1 2 ^ TX 0, ∆2 I) is samTo bound X j→n note that n ∼ N (0 ^ T X. pled independently of X We therefore have that −1 T ^ TX X Te + X −1 u −1 −1 u p ^ ^ T TX O t X j,j + ∆ p ln(1/ν) · X X j→ β + X Te + n ) (X T Xβ −1 ^ ^ T X − N )β TX β +X (X Gaussian concentration bounds, we have that w.p. ≥ 1v − α/2 the absolute value of this Gaussian is at most T ^ ^ ^ T TX TX β +X βej = βj − X j→ X e + X X j→n j→ Nβ (19) ^ T X we have Note that due to the symmetry of X −1 2 We naı̈vely bound the size of the −1 −1 ^ ^ TX TX β βk X by X j→ Nβ j→ kN kkβ   −1 p ^ TX O X j→ · B∆ p ln(1/ν) . −1 Te ^ TX X j→ X e term = note that e is cho^ TX sen independently of X and since −1 2 T ^ T e ∼ N (00, σ I) we have X X j→ X e ∼   −1 −1 ^ ^ TX T N 0, σ2 · eT · X TX · X ej . Since jX X To bound ^ TX X j→ −2 ^ TX =X j,j (the (j, j)-coordinate of the ma−2 ^ TX trix X  ), thus |βej − βj | is at most s O σ· r +∆ −1 ^ TX X j,j + ∆ −2  −2 p ^ T p ln(1/ν) · X X j,j ln(1/α) √ ^ TX X j,j · ln(1/ν) · (B p + 1)  (20) we have −1 ^ TX X ^ TX · X TX · X −1 −1 −1 ^ ^ TX − N ) · X TX · (X ^ TX =X −1 ^ TX =X −1 ^ TX −X −1 ^ TX ·N ·X All of the terms appearing in Equation (20) are known ^ T X, except for σ — which is a parameter of the given X model. Next, we derive an upper bound on σ which we can then plug into Equation (20) to complete the proof of the theorem and derive a confidence interval for βj . Differentially Private Ordinary Least Squares p most O(∆ · kzz k ln(1/ν)) w.p. ≥ 1 − ν/8. We can β k kI − Z(X T X)−1 k = upper bound kzz k ≤ 2kβ̂ B O( 1−η ), and so this term’s magnitude is upper   √ ∆·B ln(1/ν) bounded by O . 1−η Recall Equation (17), according to which we have −1 g ^ ] Ty − y TX X TX ζ k2 = yg kζ ] Ty X (18) = y Ty + m − (yy T X + n T )(X T X)−1 (I − Z · (X T X)−1 )(X Ty + n ) • Given our assumption about the least singular value of X T X and with the bound on kN k, we have that T ^ T X) ≥ σ σmin (X min (X X) − kN k > 0 and so = y Ty + m − y T X(X T X)−1 X Ty + y T X(X T X)−1 Z(X T X)−1 X Ty T T −1 n T T −1 Z(X T X)−1n − 2yy X(X X) + 2yy X(X X) ^ T X is a PSD. Therefore, the symmetric matrix X −1 −1/2 ^ ^ TX TX n = kX n k2 is strictly the term n T X positive. Applying Proposition D.2 we have that −1 T^ TX w.p. ≥ 1 − ν/8 it holds that n X n ≤   −1 2 ^ O ∆ kX T X kF · ln(p/ν) . n − nT (X T X)−1 (I − Z · (X T X)−1 )n β = (X T X)−1 X Ty , and so we have Recall that β̂  T β Zβ̂ β = y T I − X(X T X)−1 X T y + m − β̂ T ^ TX β (I − Z(X T X)−1 )n n − nTX − 2β̂ Plugging all of the above bounds into Equation (21) we get that w.p. ≥ 1 − ν/2 − α/2 it holds that −1 n (21) and of course, both n and m are chosen independently of ^ T X and y . X Before we bound each term in Equation (21), we first give −1 a bound on kZk. Recall, Z = I + N (X T X)−1 N. Recall our assumption (given in the statement of Theop rem D.1) that σmin (X T X) ≥ ∆ p ln(1/ν). This imη T −1 plies that kN (X X) k ≤ kN k·σmin (X T X)−1 = O(η). Hence  √  ∆ p ln(1/ν) kZk ≤ (kI +N (X T X)−1 k)−1 ·kN k = O 1−η Moreover, this implies that kZ(X T X)−1 k ≤ O   1 and that kI − Z(X T X)−1 k ≤ O 1−η .  η 1−η  Armed with these bounds on the operator norms of Z and (I − Z(X T X)−1 ) we bound the magnitude of the different terms in Equation (21). • The term y T (I − XX + ) y is the exact term from the standard OLS, and we know it is distributed like σ 2 · χ2n−p distribution. Therefore, it is greater than p √ σ 2 ( n − p − 2 ln(4/α))2 w.p. ≥ 1 − α/2. • The scalar m sampled from m ∼ N (0, ∆2 ) is p bounded by O(∆ ln(1/ν)) w.p. ≥ 1 − ν/8. T βk ≤  β Zβ̂ β is upper • Since we assume kβ̂ B, the term β̂ √ 2 B ∆ p ln(1/ν) . bounded by B 2 kZk = O 1−η T β (I − Z(X T X)−1 )n n. We thus have • Denote z Tn = 2β̂ T that z n ∼ N (0, ∆2 kzz k2 ) and that its magnitude is at σ2 ≤   1√ √ n−p−2 ln(4/α)  g ζ k2 + O (1 + kζ 2 · √ p B 2 p+B )∆ ln(1/ν) 1−η ^ TX + ∆ 2 kX −1  kF · ln(p/ν) and indeed, the RHS is the definition of ρ2 in the statement of Theorem D.1. E. Experiment: Additional Figures To complete our discussion about the experiments we have conducted, we attach here additional figures, plotting both the t-value approximations we get from both algorithms, and the “high-level decision” of whether correctly reject or not-reject the null hypothesis (and with what sign). First, we show the distribution of the t-value approximation for coordinates that should be rejected, in Figure 2, and then the decision of whether to reject or not based on this t-value — and whether it was right, conservative (we didn’t reject while we needed to) or wrong (we rejected with the wrong sign, or rejected when we shouldn’t have rejected) in Figure 3. As one can see, Algorithm 1 has far lower t-values (as expected) and therefore is much more conservative. In fact, it tends to not-reject coordinate 1 of the real-data even on the largest value of n (Figure 3c). However, because Algorithm 1 also has much smaller variance, it also does not reject when it ought to notreject, whereas Algorithm 2 erroneiously rejects the nullhypotheses. This can be seen in Figures 4 and 5. Differentially Private Ordinary Least Squares (a) Synthetic data, coordinate β1 = 0.5 (a) Synthetic data, coordinate β1 = 0.5 (b) Synthetic data, coordinate β2 = −0.25 (b) Synthetic data, coordinate β2 = −0.25 (c) real-life data, coordinate β1 = 14.07 Figure 2. The distribution of the t-value approximations from selected experiments on synthetic and real-life data where the null hypothesis should be rejected (c) real-life data, coordinate β1 = 14.07 Figure 3. The correctness of our decision to reject the nullhypothesis based on the approximated t-value where the null hypothesis should be rejected Differentially Private Ordinary Least Squares (a) Synthetic data, coordinate β3 = 0 (a) Synthetic data, coordinate β3 = 0 (b) Real-life data, coordinate β2 = 0.57 (b) Real-life data, coordinate β2 = 0.57 Figure 4. The distribution of the t-value approximations from selected experiments on synthetic and real-life data when the null hypothesis is (essentially) true Figure 5. The correctness of our decision to reject the nullhypothesis based on the approximated t-value when the null hypothesis is (essentially) true
8cs.DS
arXiv:1611.05407v1 [math.ST] 16 Nov 2016 A Semidefinite Program for Structured Blockmodels David Choi November 17, 2016 Abstract Semidefinite programs have recently been developed for the problem of community detection, which may be viewed as a special case of the stochastic blockmodel. Here, we develop a semidefinite program that can be tailored to other instances of the blockmodel, such as non-assortative networks and overlapping communities. We establish label recovery in sparse settings, with conditions that are analogous to recent results for community detection. In settings where the data is not generated by a blockmodel, we give an oracle inequality that bounds excess risk relative to the best blockmodel approximation. Simulations are presented for community detection, for overlapping communities, and for latent space models. 1 Introduction The stochastic blockmodel [19, 7] is a popular class of models for network data in which each node is assumed to belong to a latent class. Various sub-families of the blockmodel now exist, such as community structure [20], hierarchical community structure [23, 27], and overlapping blockmodels [29, 33, 32], as well as relatives such as latent space models [18], mixed membership [1], degreecorrected blockmodels [20], and time-varying blockmodels [24]. For all of these models, estimation of the latent nodal classes is an active area of research. For blockmodels, spectral methods are known to yield asymptotically consistent estimates, provided that the network is sufficiently large and dense [22, 28]. For the special case of community structure, it is additionally known that specialized methods can achieve weakly consistent estimates even when spectral methods fail completely due to sparsity [26, 21, 14, 2, 31]. Examples of such methods include semidefinite programming [3, 17, 25] and message passing [13, 32]. For other variants of the blockmodel and their relatives, estimation methods also exist but are less understood; in particular, theory analogous to that of community detection does not yet seem to exist for these cases. To address this gap, we show in this paper that semidefinite programming can be applied not only to community detection, but also to other blockmodel 1 sub-families as well. Specifically, we propose a semidefinite program that can be tailored to any specific instance of the blockmodel. For this program, we prove estimation bounds that are analogous to those already known for community detection, including weak consistency in the bounded degree setting. When the data is not generated from a blockmodel, the semidefinite program can be used to construct a “de-noised” version of the data matrix, and we provide an oracle inequality bounding its error relative to the best blockmodel approximation. The organization of the paper is as follows. Section 2 presents the semidefinite program. Section 3 presents a convergence analysis for sparse data. Section 4 discusses numerical optimization. Section 5 gives simulations results. Proofs are contained in the appendix. 2 Problem Formulation In this section, we present the generative models that we will consider in this paper; derive a semidefinite relaxation for the combinatorial problem of estimating the latent nodal classes; and present estimators for blockmodel and non-blockmodel settings. 2.1 Preliminary Notation Given a matrix M ∈ RnK×nK , let M (ij) ∈ RK×K for i, j ∈ [n] denote its (i, j)th submatrix of size K ×K, and similarly for x ∈ RnK let x(i) ∈ RK for i = 1, . . . , n denote its ith subvector of length K, so that  (1)    x M (1,1) · · · M (1,n)  ..    . . . . . . and x =  . . M =  . . . M (n,1) ··· x(n) M (n,n) (ij) We will use Mab to denote the (a, b)th entry of the submatrix M (ij) , and (i) likewise use xa to denote the ath entry of the subvector x(i) . This implies that (ij) (i) Mab = Ma+(i−1)K,b+(j−1)K and xa = xa+(i−1)K . 2.2 Generative Models Stochastic Blockmodel Let A ∈ {0, 1}n×n denote the symmetric adjacency matrix of a undirected network with n nodes. In a stochastic blockmodel with K classes, each node has a random latent class zi ∈ [K], and the upper triangular entries of A are independent Bernoulli when conditioned on z: zi ∼ Discrete(π) (1) Aij ∼ Bernoulli(θzi ,zj ), Aji = Aij , 2 i, j ∈ [n], i < j (2) where π is a probability distribution over [K] giving the expected class frequencies, and θ ∈ [0, 1]K×K is a symmetric matrix that gives the connection probabilities between each class type. General Model Under a more general model, A ∈ {0, 1}n×n is a random matrix generated by Aij ∼ Bernoulli(Pij ) i<j (3) Aji = Aij , where P ∈ [0, 1]n×n is symmetric and satisfies Pii = 0 for i ∈ [n]. It can be seen that the stochastic blockmodel is a special case of (3), where Pij = θzi ,zj . 2.3 Semidefinite program We will assume that A ∈ {0, 1}n×n is observed, and the estimation task is to find z ∈ [K]n maximizing the generic combinatorial problem maxn z∈[K] n n X X fij (zi , zj ), (4) i=1 j=1 under some choice of objective functions fij : [K]2 7→ R for i, j ∈ [n]. In this paper, we will let {fij } equal the likelihood function fij (zi , zj ) = Aij log θ̂zi zj + (1 − Aij ) log(1 − θ̂zi ,zj ), (5) in which case (4) finds the maximum likelihood assignment of z under a specified parameter matrix θ̂ ∈ [0, 1]K×K . Note that θ̂ may differ from the actual generative model for A. Optimizing (4) is not computationally tractable, so we will relax it into a semidefinite program. Let F ∈ RnK×nK denote a matrix with submatrices F (ij) ∈ RK×K given by (ij) a, b ∈ [K], Fab = fij (a, b) (6) so that (4) can be expressed as maxn z∈[K] n X n X eTzi F (ij) ezj , (7) i=1 j=1 where e1 , . . . , eK ∈ {0, 1}K denote the canonical basis in RK . This can be further rewritten as   ez1   max hF, xxT i subject to x =  ...  . z∈[K]n ,x∈{0,1}nK ezn 3 This suggests the following semidefinite program relaxation, where xxT is approximated by a positive semidefinite matrix X: max X∈RnK×nK hF, Xi (8) s.t. X  0, X ≥ 0 K X K X (ij) ∀ i, j ∈ [n], Xab = 1 a=1 b=1 where X  0 denotes that X positive semidefinite, and X ≥ 0 denotes that X is elementwise non-negative. For any feasible X ∈ RnK×nK , each submatrix X (ij) ∈ RK×K is nonnegative and sums to one, and can be viewed as a relaxed version of the indicator matrix ezi eTzj encoding the class pair (zi , zj ). 2.4 Matrix Denoising and Blockmodel Estimation Let X̂ ∈ [0, 1]nK×nK denote the solution to the semidefinite program (8), and let A be generated from the general model (3), with generative matrix P ∈ [0, 1]n×n . Let P̂ ∈ [0, 1]n×n denote a “MAP estimate” of P , constructed by treating each submatrix X̂ (ij) as a probability distribution over [K]2 : P̂ij = arg max ϑ∈[0,1] K X K X (ij) X̂ab · 1{θ̂ab = ϑ} (9) a=1 b=1 Alternatively, let P̃ denote a randomized estimate of P , where each dyad is an independent random variable with distribution (ij) P̃ij = θ̂ab with probability X̂ab ∀i < j (10) P̃ji = P̃ij . Let ẑ ∈ [K]n denote the cluster labels found by spectral clustering of P̂ – i.e., applying K-means to the first K eigencoordinates of P̂ . If A is generated by a blockmodel, then the generative P will be block structured, with blocks induced by θ and z. In this case, we will use ẑ to estimate z, up to label-switching permutation. To estimate θ up to permutation, let θ̂est ∈ [0, 1]K×K denote the matrix of between-block densities induced by ẑ, Pn Pn j=1 Aij 1{ẑi = a, ẑj = b} i=1 est a, b ∈ [K]. (11) θ̂ab = Pn Pn i=1 j=1 1{ẑi = a, ẑj = b} 2.5 Discussion Related Work Semidefinite programs have been used for community detection in [3, 17, 25], as well as [9] which allowed for outliers, and [11] which 4 allowed for degree heterogeneity. In each of these works, the network is required to exhibit assortatitve block structure. For the general model (3) without such restrictions, estimation has been considered in [10], but only for dense settings. To the best of our knowledge, networks that are both non-assortative and sparse (i.e., bounded degree), such as those presented in Sections 5.2 and 5.3, have not been considered in previous work. Additionally, the semidefinite program presented here bears resemblance to one appearing in [34] for lower bounding the optimal objective value of the quadratic assignment problem (without finding a feasible solution)1 , and also recent work on estimating pairwise alignments beween objects [6]. 3 Convergence Analysis In this section, we analyze the solution of the semidefinite program (8) for both matrix denoising and label recovery. Analogous to existing results for community detection, our results will imply weak consistency (i.e., performance better than random guessing) in the regime where the average degree of A is asymptotically bounded above some constant, and consistency of ẑ, as well as vanishing excess risk of P̂ , when the average degree → ∞. The organization of this section is the following: Section 3.1 defines basic notation; Section 3.2 states the required conditions; and Section 3.3 presents the convergence results, which are proven in Appendix A. 3.1 Preliminaries The following notation will be used. Given A ∈ {0, 1}n×n that is generated by (3) under some P ∈ [0, 1]n×n , let ρ denote its expected density X 1 Pij . ρ= n(n − 1) ij Given θ̂ ∈ [0, 1]K×K , let F ∈ RnK×nK denote the objective function of the semidefinite program (8), with submatrices F (ij) ∈ RK×K given by (ij) Fab = Aij log θ̂ab + (1 − Aij ) log(1 − θ̂ab ) i, j ∈ [n], a, b ∈ [K]. (12) nK×nK Let F̄ ∈ R denote a idealized version of F in which A is replaced by its expectation P , with submatrices F̄ (ij) ∈ RK×K given by (ij) F̄ab = Pij log θ̂ab + (1 − Pij ) log(1 − θ̂ab ) i, j ∈ [n], a, b ∈ [K]. (13) Let X ⊂ RnK×nK denote the feasible region of the semidefinite program (8): ( ) K X K X (ij) nK×nK X = X∈R : X  0, X ≥ 0, and Xab = 1 for all i, j ∈ [n] . a=1 b=1 (14) 1 which can be used as an intermediate step in a branch-and-bound algorithm. 5 Let X̂ denote any solution to the semidefinite program (8), which can be written as maximize hF, Xi over all X ∈ X . For any matrix B ∈ [0, 1]K×K , let the function QB be given by QB (a, b) = {(c, d) ∈ [K]2 : Bcd = Bab } a, b ∈ [K], so that QB identifies the subsets of [K]2 that have equal values under B. 3.2 Assumptions Assumption 1 and 2 will apply when P̃ is used to estimate the general model (3). Assumption 1 requires P to have density ρ exceeding 1/n. Assumption 2 bounds the entries of θ̂ to differ from ρ by roughly at most a constant factor. Assumption 1. Let A ∈ {0, 1}n×n be generated by (3), with P ∈ [0, 1]n×n (which evolves with n) satisfying ρ ≥ 1/n. Assumption 2. The matrix θ̂ ∈ [0, 1]K×K (which may evolve with n) satisfies ρ θ̂ab ≤ cρ for some c > 0 and all n and a, b ∈ [K]. c ≤ 1−θ̂ ab Assumptions 3 and 4 will apply when A is generated by a stochastic blockmodel, and are sufficient to show that ẑ converges to the true z, up to label switching. Assumption 3 describes a parametrization that is commonly used for sparse blockmodels. Assumption 4 places bounds on the misspecification between θ̂ and θ∗ in the sparse blockmodel setting. Assumption 3. For all n, let A ∈ {0, 1}n×n and z ∈ [K]n be generated by a stochastic blockmodel with parameters (π, θ∗ ). Let π be constant, and let θ∗ = αB ∗ , where α ∈ R satisfies α → 0 and α > 1/n, and B ∗ ∈ RK×K is constant, + rank K, and satisfies K X K X ∗ πa πb Bab = 1. (15) a=1 b=1 P Aij , and B̂ ∈ RK×K is a + ∀a, b ∈ [K] (16) Assumption 4. Let θ̂ = α̂B̂, where α̂ = 1 n(n−1) ij fixed matrix such that B̂ and B ∗ satisfy QB̂ (a, b) = QB ∗ (a, b) ∗ Bab log B̂ab B̂cd − (B̂ab − B̂cd ) > 0 ∀a, b ∈ [K] and c, d ∈ / QB ∗ (a, b). (17) Assumption 4 states that B̂ and B ∗ need not have identical values, but should have the same structure (as given by QB̂ and QB ∗ ). Additionally, for all ∗ a, b ∈ [K], the entry B̂ab should be the closest element of B̂ to Bab , in terms of the Bregman divergence associated with the Poisson likelihood. 6 3.3 Results Theorem 1 holds when A is generated from the general model (3), including non-blockmodels. It gives an oracle inequality on the quality of the randomized estimate P̃ given by (10), relative to the best blockmodel approximation to the generative P . Theorem 1. Let Assumptions 1 and 2 hold. Let P̃ denote the randomized estimate of P given by (10). Then   n n X n n X 1 XX 1 1 min , KL(P , P̃ ) ≤ KL(P , θ̂ ) + O √ ij ij ij ẑi ,ẑj P n2 ρ i=1 j=1 n2 ρ ẑ∈[K]n i=1 j=1 nρ with OP (·) having constant terms depending only on K and c (which appears in Assumption 2). Theorem 2 assumes the sparse blockmodel setting of Assumptions 3 and 4, and shows that both P̂ and the randomized estimate P̃ asymptotically recover P , with vanishing fraction of incorrect values. Theorem 2. Let Assumptions 3 and 4 hold. Let P̂ denote the estimate of P given by (9). Then   n n 1 1 XX 1{P̂ij 6= θ̂zi zj } = OP √ , n2 i=1 j=1 nα (18) with the same result if P̂ is replaced by P̃ given by (10). Corollary 1 follows from Theorem 2, and states that the eigencoordinates from P̂ , which are used to compute ẑ, converge (up to a unitary transformation) to those of P . As P is block structured, this suggests that ẑ will converge to z up to a permutation of the labels. It is proven in Appendix C, and is a direct application of the Davis-Kahan theorem in [30, Th. 4]. Corollary 1. Let Assumptions 3 and 4 hold, and let V = (v1 , . . . , vK ) denote the eigenvectors of P . Let V̂ = (v̂1 , . . . , v̂K ) denote the eigenvectors of the K largest eigenvalues (in absolute value) of P̂ or P̃ . Let O denote the set of K ×K orthogonal matrices. It holds that   1 . min kV̂ O − V k2F ≤ OP √ O∈O nα Remark Weak consistency in the bounded degree regime is implied by each of the results, in that the estimation error is bounded away from the performance of random guessing, provided that limn→∞ ρ ≥ c0 /n (for Theorem 1) or limn→∞ α ≥ c0 /n (for Theorem 2), for some constant c0 . 7 4 Numerical optimization The semidefinite program (8) can be solved by the alternating direction method of multipliers (ADMM) [8]. While this semidefinite program is much larger than those previously introduced for community detection, speedups can often be achieved by exploiting problem structure, resulting in competitive computation times. To solve (8) using ADMM, we introduce the decision variable X ∈ RnK×nK and auxiliary variables Y, W, U, V ∈ RnK×nK , which are all initialized to zero and evolve according to the following rule:    1 1 Wt − Ut + Y t − V t + F (19) X t+1 = ΠX 2 ρ W t+1 = max(0, X t+1 + U t ) Y t+1 = ΠS+ (X t+1 + V t ) U t+1 = U t + X t+1 − W t+1 V t+1 = V t + X t+1 − Y t+1 , where F ∈ RnK×nK is given by (6), ρ ∈ R is a positive stepsize parameter, the operator ΠS+ denotes projection onto the set of positive semidefinite matrices, and the operator ΠX denotes projection onto the affine subspace of all matrices X ∈ RnK×nK satisfying the linear constraints K X K X (ij) Xab = 1 ∀i, j ∈ [n]. a=1 b=1 The slowest step of the ADMM iterations is the computation of Y t+1 = ΠS+ (X t+1 + V t ), which requires the eigendecomposition of an nK × nK matrix. In comparison, semidefinite programs for community detection require only the decomposition of an n × n matrix in each ADMM iteration. However, in many settings of interest, X t+1 + V t will be highly structured and have fast eigendecomposition methods. In particular, let the K × K submatrices [X t+1 + V t ](ij) for i, j ∈ [n] be symmetric and share a common set of orthonormal eigenvectors v1 , . . . , vK . It then holds for some ` ≤ K and some partition S0 , . . . , S` of [K] that [X t+1 + V t ](ij) = ` X l=0 λijl X vj vjT ∀ i, j ∈ [n], (20) j∈Sl where λijl is the eigenvalue corresponding to the eigenvectors {vj : j ∈ Sl }. In this case, Y t+1 can be computed in the following manner: 1. Find the eigendecomposition for each submatrix [X t+1 + V t ](ij) ∈ RK×K , yielding eigenvectors v1 , . . . , vK , sets S0 , . . . , S` partitioning [K], and eigenvalues {λijl } satisfying (20). 8 2. Let Λ0 , . . . , Λ` ∈ Rn×n and E0 , . . . , E` ∈ RK×K be given by X Λl (i, j) = λijl and El = vj vjT l = 0, . . . , `, j∈Sl so that X t+1 + V t = ` X Λl ⊗ El . l=0 3. Return ΠS+ (X t+1 + V t ) = ` X ΠS+ (Λl ) ⊗ El , (21) l=0 which holds because the matrices E0 , . . . , E` are orthogonal and positive semidefinite. Since Λ0 , . . . , Λ` ∈ Rn×n , the above steps require ` + 1 eigendecompositions of n × n matrices. As the computation time of eigendecomposition scales cubically in the matrix size, the resulting speedup can be quite significant in practice; for example, if K = 10 and ` = log2 K, the speedup is a factor of roughly 200 (e.g., going from 3 hours to ≤ 1 minute to solve the semidefinite program). When will the decomposition (20) hold? A sufficient condition is that θ̂ is in the span of an association scheme, which is evidently a fundamental concept in combinatorics [15, 16], and is defined as follows: Definition 1. [15, Sec 2] A set of binary-valued and symmetric matrices B0 , . . . , B` form an association scheme if the following properties hold: 1. B0 = I P` T 2. i=0 Bi = 11 3. For all i, j, it holds that Bi Bj ∈ span(B0 , . . . , B` ) The key property of association schemes is the following result, which is Theorem 2.6 in [5], or follows from E1-E4 in [15]. The result states that B0 , . . . , B` share a common set of eigenvectors. Lemma 1 ([15, 5]). Let B0 , . . . , B` ∈ RK×K form an association scheme. Then B0 , . . . , B` have the same eigenvectors v1 , . . . , vK , and for some partition (i) S0 , . . . , S` of [K] and scalars {λj }`i,j=0 it holds for that Bi = ` X j=0 (i) λj X vk vkT , i = 0, . . . , `. k∈Sj Additionally, the vector 1 will be one of the eigenvectors. 9 (22) Theorem 3, which is proven in Appendix B, states that if the parameter matrix θ̂ ∈ RK×K is in the span of an association scheme, then the decomposition (20) will hold, with ` equal to the number of matrices in the association scheme, and with precomputable {Sl } and v1 , . . . , vK : Theorem 3. Let F be defined as (12), for any symmetric A ∈ {0, 1}n×n and θ̂ ∈ span(B0 , . . . , B` ), where {Bi }`i=0 form an association scheme. Let X, W, Y, U, V ∈ RnK×nK be initialized to zero and evolve by the ADMM equations (19). Then (20) holds for all t, with v1 , . . . , vK and S0 , . . . , S` satisfying (22). In Section 5, we will give three examples of semidefinite programs in which θ̂ can be shown to belong to association schemes, with ` = 1, ` = 2, and ` ≤ K respectively. We remark that association schemes were originally invented by statisticians for the study of experiment design [4, 5], and that they have been used with semidefinite programming in [12] to lower bound the optimal objective value of the traveling salesperson problem (without finding a feasible solution). 5 Simulation results To illustrate the usage and performance of the semidefinite program, we show simulated results for three examples: community structure, overlapping communities, and latent space models. 5.1 Community Structure In the best-understood blockmodel setting, A is generated by θ ∈ [0, 1]K×K which has parameters γ0 , γ1 ∈ [0, 1], and equals θ = γ0 I + γ1 (11T − I). (23) In this model, nodes connect with probability γ0 if they are in the same class, and probability γ1 if they are in different classes. Under (23), the parameter matrix θ can be written as θ = γ0 B0 + γ1 B1 , for B0 = I and B1 = 11T −I. By manual verification, this can be seen to satisfy the requirements given in Definition 1 for an association scheme with ` = 1 so that fast methods can be used to evaluate the ADMM iterations. Figure 1 shows an adjacency matrix A generated by (23), the estimated class labels ẑ found by spectral clustering of P̂ (as discussed in Section 2.4), and the estimates found by direct spectral clustering of A. In this instance, the semidefinite program yields nearly perfect class estimates, while spectral clustering of A fails due to its sparsity. Figure 2 shows the average simulated performance, over a range of values for the network size n and average degree nρ. We see that for nρ ≥ 10, the 10 0 200 400 600 800 0 200 400 600 800 nz = 14424 (a) Adj. Matrix A (b) ẑ (c) Spectral clusters Missclassification Rate Figure 1: Community structured blockmodel (23) with n = 800 nodes, K = 4 classes, average degree = 18, and unbalanced class sizes. (a) adjacency matrix A. (b) similarity matrix for ẑ, which resulted in 4 miss-classified nodes. (c) shows the similarity matrix for class estimates found by spectral clustering of A, which split the largest community, failed to find the smallest two communities, and resulted in 447 miss-classified nodes. 0.6 0.6 0.6 0.6 0.5 0.5 0.5 0.5 0.4 0.4 0.4 0.4 0.3 0.3 0.3 0.3 0.2 0.2 0.2 0.1 0.1 0.1 0 0 0.2 SDP spectral 0.1 0 200 600 1000 Number of Nodes (a) nρ = 5 200 600 1000 0 200 (b) nρ = 10 600 1000 (c) nρ = 20 200 600 1000 (d) nρ = 30 Figure 2: Misclassification rates for ẑ found by semidefinite programming (blue line, solid) vs. spectral clustering of A (red line, dotted), under the community structured blockmodel (23) with K = 4, n = {100, 200, 400, 800, 1200}, and expected average degree nρ = {5, 10, 20, 30}. 100 simulations per trial, standard errors shown. semidefinite program has roughly constant error if the average degree is fixed, which is consistent with Theorem 2 (and other known results for community detection). In contrast, the misclassification rate for spectral clustering of A increases with the sparsity of the graph. This is exemplified by subplot (d), where spectral clustering of A performs well for small networks but degrades severely as n increases. 5.2 Two Overlapping Groups of Communities Let parameters γ0 , γ1 ∈ [0, 1] satisfy γ0 > γ1 , and let K = k 2 for some integer k, so that each a ∈ [K] has a k-ary representation (a1 , a2 ) ∈ [k]2 . Let θ equal ( γ0 if a1 = b1 or a2 = b2 θab = a, b ∈ [K]. (24) γ1 otherwise 11 In this model, there exist two types of community structure, each type comprised of k communities, where node belongs to one community of each type. Two nodes have a higher probability of connection if they share at least one community in common. We observe that θ = γ0 B0 +γ0 B1 +γ1 B2 , where B0 , B1 , and B2 ∈ {0, 1}K×K are given by B0 = I B1 = (I − 11T ) ⊗ I + I ⊗ (I − 11T ) B2 = (I − 11T ) ⊗ (I − 11T ). By manual verification, {B0 , B1 , B2 } can be seen to satisfy the requirements given in Definition 1 for an association scheme with ` = 2. For this model, it may be of interest to not only compute ẑ and θ̂est , which estimate z and θ up to label switching, but to also estimate the 2k overlapping communities, which we will denote by C1 , . . . , C2k ⊂ [n]. It can be seen that C1 , . . . , C2k are given by Cl+(m−1)k = {i ∈ [n] : zim = l} l ∈ [k], m ∈ [2], where each zi ∈ [K] has k-ary representation (zi1 , zi2 ). Equivalently, C1 , . . . , C2k may also be defined as follows: Let G denote a graph with K vertices, and with edges induced by thresholding θ between γ0 and γ1 : ( 1 if θab ≥ (γ0 + γ1 )/2 Gab = a, b ∈ [K]. 0 otherwise. It can be seen that G has 2k maximal cliques C1 , . . . , C2k , for which the communities C1 , . . . , C2k satisfy C` = {i ∈ [n] : zi ∈ Cπ(`) } ` = 1, . . . , 2k, (25) for some permutation π of [2k]. Thus, to estimate C1 , . . . , C2k , we can construct θ̂est ∈ [0, 1]K×K as given by (11), and estimate G by   γ0 + γ1 est a, b ∈ [K], (26) Ĝab = 1 θ̂ab ≥ 2 which has maximal cliques Ĉ1 , . . . , Ĉm0 ⊂ [K] for some m0 . Using the maximal cliques of Ĝ, we can estimate overlapping communities Cˆ1 , . . . , Cˆm0 ⊂ [n] by Cˆ` = {i ∈ [n] : ẑi ∈ Ĉ` }, ` = 1, . . . , m0 . (27) We remark that even in settings where the model (24) is not valid, by (26) and (27) the subsets Cˆ1 , . . . , Cˆm0 are still interpretable as overlapping subsets of densely connected nodes. 12 0 200 400 600 800 0 200 400 600 800 nz = 40414 (a) Adjacency (b) Cˆ1 , Cˆ2 , Cˆ3 1 2 (c) Cˆ4 , Cˆ5 , Cˆ6 1 2 (d) Nonoverlap- (e) Spectral matrix A 34 34 ping model clustering of A Figure 3: Overlapping community model (24), with n = 800, nρ = 50, and 6 overlapping communities C1 , . . . , C6 . (a) adjacency matrix A. (b) similarity matrix for Cˆ1 , Cˆ2 , Cˆ3 . (c) similarity matrix for Cˆ4 , Cˆ5 , Cˆ6 . (d) similarity matrix for ẑ, but assuming non-overlapping model (23). (e) similarity matrix using spectral clustering of A. Cˆ1 , . . . , Cˆ6 had 32 errors, while ẑ using the non-overlapping model (23) had 397 errors, and spectral clustering of A had 187 errors. Figure 3a shows an adjacency matrix A generated by (24), with k = 3 and K = 9. The pattern of θ is clearly visible in A. Figures 3b and 3c show the estimated communities Cˆ1 , . . . , Cˆ6 using (27). For comparison, Figure 3d shows ẑ when the semidefinite program assumes (23) instead of (24), and Figure 3e shows the estimate of z under spectral clustering of A. In this instance, Cˆ1 , . . . , Cˆ6 accurately estimate the true communities C1 , . . . , C6 , with a misclassification rate of 0.04. This is consistent with Theorem 2, which predicts that P̂ will be nearly block-structured, implying that the subsequent steps of estimating ẑ, θ̂est , and Ĝ will succeed as well. In contrast, the two alternative methods give poor estimates for z, with misclassification rates of 0.50 and 0.23, respectively. Figure 4 shows the average misclassification rate for Cˆ1 , . . . , Cˆ6 , in simulations over a range of values for the network size n and average degree nρ. For comparison, the misclassification rate for spectral clustering of A (which estimates z instead of C1 , . . . , C6 ) is shown as well. The misclassification rate of the semidefinite program is not quite constant in n for fixed nρ, suggesting that the asymptotic results of Theorem 2 may require larger n for this model compared to the results shown in Figure 2. However, as nρ increases the semidefinite program estimates the overlapping communities (and hence z as well) with much better accuracy than spectral clustering of A, which shows little improvement with increasing nρ. 5.3 Latent Space Models We consider a latent space model, reminiscent of [18], in which each node is assigned a latent coordinate vector y1 , . . . , yn ∈ [0, 1]d . Conditional on {yi }ni=1 , each dyad is independent Bernoulli with log odds given by log odds Aij = −kyi − yj k/σ, (28) where σ ≥ 0 is a bandwidth parameter. In general, (28) is not equivalent to a blockmodel. 13 Missclassification Rate 1 1 1 1 0.8 0.8 0.8 0.8 0.6 0.6 0.6 0.6 0.4 0.4 0.4 0.2 0.2 0.2 0 0 0.4 SDP spectral 0.2 0 500 1000 1500 Number of Nodes (a) nρ = 30 500 1000 1500 (b) nρ = 40 500 1000 1500 (c) nρ = 50 0 500 1000 1500 (d) nρ = 60 Figure 4: Misclassification rates for Cˆ1 , . . . , Cˆ6 found by semidefinite programming (blue line, solid), and for estimates of z found by spectral clustering of A (red line, dotted), under the overlapping community model (24) with K = 9, k = 3, n = {400, 800, 1200, 1600}, expected average degree nρ = {30, 40, 50, 60}, and unbalanced class sizes. 100 simulations per trial, standard errors shown. Let D ∈ Rn×n denote the matrix of squared distances between the latent coordinates, given by Dij = kyi − yj k2 . It is known that the first d eigencoordinates of (I − 11T /n)D(I − 11T /n) will recover y1 , . . . , yn up to a unitary transformation. To estimate D, we will approximate (28) by a blockmodel with K = (2k)d classes, where each class represents a coordinate in Rd , so that θ̂ equals logit θ̂ab = −δ(γa , γb )/σ, (29) where γ1 , . . . , γK ∈ Rd , and δ is a distance metric. In order for θ̂ to belong to an association scheme, we choose γ1 , . . . , γK extending beyond [0, 1]d to form a grid in [0, 2]d , and choose δ to be a toric distance. That is, given a ∈ [K], let (a1 , . . . , ad ) denote its (2k)-ary representation, and let γ1 , . . . , γK be given by a ad  1 ,..., γa = , a ∈ [K], k k and let δ : [0, 2]d × [0, 2]d 7→ R equal the distance on a torus of circumference 2,  1/2 d X δ(γa , γb ) =  min(|γaj − γbj |, 2 − |γaj − γbj |)2  , j=1 where γaj is the jth element of the vector γa . Since θ̂ab depends on γa and γb only through their element-wise differences |γaj −γbj |, for j = 1, . . . , d, it follows that θ̂ can be written as a weighted sum of matrices θ̂ = 2k−1 X j1 =0 ··· 2k−1 X γj1 ···jd C (j1 ) ⊗ · · · ⊗ C (jd ) , jd =0 14 where C (j) ∈ {0, 1}2k×2k for j = 0, . . . , 2k − 1 is the circulant matrix given by ( 1 if min(|a − b|, 2k − |a − b|) = j (j) Cab = 0 otherwise. By manual inspection, it can be seen that C = {C (0) , . . . , C (2k−1) } satisfies the requirements of an association scheme, and hence that also C ⊗ · · · ⊗ C is an association scheme as well, with ` ≤ (2k)d = K. (See [5, Chapters 1-3] for a complete treatment.) Let X̂ denote the solution to the semidefinite program (8) with θ̂ given by (29). To estimate D, let D̂ ∈ Rn×n equal the MAP-style estimate under X̂, D̂ij = arg max x∈R K X K X (ij) X̂ab 1{δ(γa , γb )2 = x}, (30) a=1 b=1 and let D̃ ∈ Rn×n denote the randomized estimate (ij) D̃ij = δ(γa , γb )2 with probability Xab . (31) Given D̂, we will take the first d eigencoordinates of (I − 11T /n)D̂(I − 11T /n) to estimate y1 , . . . , yn (or similarly using D̃). Corollary 2 bounds the error between the randomized estimate D̃ and the true distances D, relative to rounding the coordinates {yi }ni=1 to their closest points on a grid over [0, 1]d : Corollary 2. Let L : R × R 7→ R denote the loss function ! 0 e−x /σ e−x/σ 0 , , L(x, x ) = KL 1 + e−x/σ 1 + e−x0 /σ and let η1 , . . . , ηkd ∈ R form a grid on [0, 1]d , a ad  1 ηa = ,..., , k k a ∈ [k d ], where (a1 , . . . , ad ) denotes the k-ary representation of a ∈ [k d ]. Then   q n n n n  p 1 XX 1 X X p L D , D̃ ≤ min L Dij , kηzi − ηzj k ij ij 2 2 n ρ i=1 j=1 z∈[kd ]n n ρ i=1 j=1   1 + OP √ nρ 15 Proof. It holds that     q n n n n  p 1 XX 1 X X p 1 Dij , D̃ij ≤ minn 2 Dij , δ(γzi , γzj ) + OP √ L L n2 ρ i=1 j=1 nρ z∈[K] n ρ i=1 j=1   n n  1 X X p 1 ≤ min 2 Dij , δ(ηzi , ηzj ) + OP √ L nρ z∈[kd ]n n ρ i=1 j=1   n n  1 1 X X p Dij , kηzi − ηzj k + OP √ ≤ min 2 , L nρ z∈[kd ]n n ρ i=1 j=1 where the first inequality holds by Theorem 1 and definition of L; the second inequality holds because the minimization is over a strictly smaller set than in the previous line; and the last inequality holds because δ(x, x0 ) = kx − x0 k for all (x, x0 ) ∈ [0, 1]d × [0, 1]d . Figure 5 shows latent coordinates y1 , . . . , yn ∈ R2 arranged in a circle, from which an adjacency matrix was generated by (28) with n = 500 and nρ = 20. The figure also shows the estimated coordinates ŷ derived from the randomized D̃ given by (31), from the MAP-style D̂ given by (30), and by applying the USVT method of [10] to the adjacency matrix A, in which a spectral estimate of P is constructed from A, and then inverted to form an estimate of D. In this instance, both D̃ and D̂ yield estimates ŷ that are similar, and are substantially more accurate than the USVT approach which failed due to the sparsity of A. Figure 6 shows a different configuration for y1 , . . . , yn , with similar results. Figure 7 shows the average simulated estimation accuracy using D̂, for a range of values for the network size n and average degree nρ. For comparison, the performance of the spectral USVT method is shown as well. We see that the estimation error for D̂ is near-constant when the average degree is fixed. In contrast, the estimation error for the spectral USVT method worsens with the sparsity of A. This is exemplified by subplot (d), in which the USVT method performs well for small networks but degrades severely as n increases. A A.1 Proof of Theorems 1 and 2 Intermediate Results We first present intermediate results that will be used in the proof of Theorems 1 and 2. Let X ∗ denote any solution to the idealized problem maximize hF̄, Xi over all X ∈ X . Lemma 2 is the main technical result, and states that for the general matrix model (3), X̂ nearly optimizes the desired objective function F̄ , even though only the noisy proxy F is available. Its proof closely follows the approach of [17]. 16 (a) y (b) ŷ from D̃ (c) ŷ from D̂ (d) ŷ, USVT Figure 5: Latent space model (28), with n = 500, nρ = 20, and latent coordinates y1 , . . . , yn ∈ R2 arranged in a circle. (a) Latent coordinates y. (b) estimated ŷ using randomized D̃ from (31). (c) estimated ŷ using MAP-style D̂ from (30). (d) estimated ŷ, using USVT spectral method [10] directly on A. RMS errors for (b), (c), and (d) were 0.08, 0.07, and 0.25 respectively. (a) y (b) ŷ from D̃ (c) ŷ from D̂ (d) ŷ, USVT Estimation Error Figure 6: Latent space model (28), with n = 1000, nρ = 140, and latent coordinates y1 , . . . , yn ∈ R2 arranged in a cross. (a) Latent coordinates y. (b) estimated ŷ using randomized D̃ from (31). (c) estimated ŷ using MAP-style D̂ from (30). (d) estimated ŷ, using USVT spectral method [10] directly on A. RMS errors for (b), (c), and (d) were 0.044, 0.040, and 0.11 respectively. 0.3 0.3 0.3 0.3 0.25 0.25 0.25 0.25 0.2 0.2 0.2 0.2 0.15 0.15 0.15 0.15 0.1 SDP USVT 0.05 0 200 600 1000 Number of Nodes (a) nρ = 5 0.1 0.1 0.1 0.05 0.05 0.05 0 200 400 600 800 1000 1200 (b) nρ = 15 0 200 400 600 800 1000 1200 (c) nρ = 25 0 200 400 600 800 1000 1200 (d) nρ = 35 Figure 7: Estimation error for ŷ found by semidefinite programing (blue line, solid) vs. USVT method on A (red line, dotted), under the latent space model (28) with n = {200, 300, 400, 600, 800, 1000, 1200}, expected average degree nρ = {5, 15, 25, 35}, and latent coordinates y1 , . . . , yn ∈ R2 arranged in a circle. 100 simulations per trial, standard errors shown. 17 Lemma 2. Let Assumptions 1 and 2 hold. Then for some C1 , C2 > 0 it holds for all n that   1 C1 ∗ P hF̄, X − X̂i ≥ √ = e−C2 n , n2 ρ nρ where C1 and C2 depend only on K and c. Lemma 3 gives a condition under which P̂ and P̃ will both be approximately block structured. It roughly states that if there exists z ∈ [K]n such that (ij) (zi , zj ) ∈ arg maxab F̄ab for all i, j ∈ [n], then both P̂ and P̃ will asymptotically have block structure corresponding to z. Lemma 3. Let Assumptions 1 and 2 hold. If there exists z ∈ [K]n and ∆ > 0 such that P, θ̂ and F̄ satisfy (ij) F̄z(ij) ≥ F̄ab + ρ∆ i ,zj ∀i, j ∈ [n] and a, b ∈ / Qθ̂ (zi , zj ), (32) then it holds that n n K K X X X X (ij) 1 X̂ab · 1{(a, b) ∈ / Qθ̂ (zi , zj )} ≤ OP n(n − 1) i=1 j=1 a=1 b=1  1 √ nρ  , (33) Lemma 4 states that the error between P and the randomized estimate P̃ converges to its expectation. Lemma 4. Let Assumptions 1 and 2 hold. Then n n n n    i XX XX h 1 1 KL Pij , P̃ij = E KL Pij , P̃ij n(n − 1)ρ i=1 j=1 n(n − 1)ρ i=1 j=1   1 + OP √ . nρ Bernstein’s inequality states that for independent x1 , . . . , xn satisfying |xi | ≤ b, with variance σi2 and expectation Exi = 0, it holds that !   n 1X nt2 P xi ≥ t ≤ exp − 2 Pn . 2 n i=1 i=1 σi + bt/3 n Grothendieck’s inequality [17, Th. 3.1] states that there exists a universal constant CG such that for any matrix M ∈ Rn×n , max |hM, Xi| ≤ CG X∈M max s,t∈{−1,1}n |sT M t|, (34) where M = {U V T : all rows of U, V ∈ B2n }, and B2n = {x ∈ Rn : kxk2 ≤ 1} is the n-dimensional unit ball. Lemmas 2, 3, and 4 are proven in Section A.3. 18 A.2 Proof of Theorems 1 and 2 Proof of Theorem 1. Given z ∈ [K]n , let the vector x(z) ∈ {0, 1}nK be given by  T x(z) = eTz1 · · · eTzn . Theorem 1 holds by the the following steps: n n   XX 1 KL Pij , P̃ij n(n − 1)ρ i=1 j=1   n X n h  i X 1 1 = E KL Pij , P̃ij + OP √ n(n − 1)ρ i=1 j=1 nρ   n n X X 1 1 H(Pij ) − hF̄, X̂i + OP √ = n(n − 1)ρ i=1 j=1 nρ   n n X X 1 1 H(Pij ) − hF̄, X ∗ i + OP √ ≤ n(n − 1)ρ i=1 j=1 nρ (35) (36) (37)   n n X X 1 1 T H(Pij ) − maxn hF̄, x(z)x(z) i + OP √ ≤ (38) n(n − 1)ρ i=1 j=1 nρ z∈[K]   n n X   X 1 1 KL Pij , θ̂zi ,zj + OP √ ≤ minn (39) nρ z∈[K] n(n − 1)ρ i=1 j=1 where (35) holds by Lemma 4; (36) and (39) follow from the identity (ij) KL(Pij , θ̂ab ) = H(Pij ) − F̄ab , with (36) additionally using (10), the definition of P̃ ; (37) holds by Lemma 2; and (38) holds because x(z)x(z)T ∈ X , implying that hF̄, X ∗ − x(z)x(z)T i ≥ 0. Proof of Theorem 2. Define π̂ by n π̂a = 1X 1{zi = a}. n i=1 By Bernstein’s inequality, it can be seen that α̂ = ρ(1 + oP (1)), and that ρ = P 1 P satisfies (n2 ) i<j ij ρ= K X K X ∗ π̂a π̂b θab (1 + o(1)) a=1 b=1 = α(1 + oP (1)), 19 so that α̂ → ρ → α. As a result, Assumptions 1 and 2 can be seen to hold (in probability). Let ∆0 be defined by ∆0 = ∗ min Bab log min a,b∈[K]2 c,d∈Q / B∗ B̂ab B̂cd − (B̂ab − B̂cd ). (ij) (ij) It can be seen that ∆0 > 0 by assumption. To bound F̄zi ,zj − F̄cd apply Lemma 3, observe for all i, j ∈ [n] and c, d ∈ / Qθ̂ (zi , zj ): (ij) F̄z(ij) − F̄cd = Pij log i ,zj θ̂zi ,zj θ̂cd = αBz∗i ,zj log = αBz∗i ,zj log = ρBz∗i ,zj log + (1 − Pij ) log B̂zi ,zj B̂cd B̂zi ,zj B̂cd B̂zi ,zj B̂cd ≥ ρ∆0 + oP (α), so as to 1 − θ̂zi ,zj 1 − θ̂cd 1 − α̂B̂zi ,zj 1 − α̂B̂zi ,zj + log − αBz∗i ,zj log 1 − α̂B̂cd 1 − α̂B̂cd + α̂(B̂zi ,zj − B̂cd ) + O(α̂2 ) + O(αα̂) − ρ(B̂zi ,zj − B̂cd ) + oP (α) where the oP (α) terms are bounded uniformly over all (i, j) ∈ [n]2 and (c, d) ∈ [K]4 . This implies that for all i, j ∈ [n] and all c, d ∈ / QB ∗ (zi , zj ), it holds that (ij) F̄z(ij) − F̄cd ≥ ρ(∆0 + oP (1)), i ,zj implying that the conditions of Lemma 3 will hold in probability for any ∆ < ∆0 . Lemma 3 thus implies   n K K n 1 1 X X X X (ij) X̂ab · 1{(a, b) ∈ / QB ∗ (zi , zj )} = OP √ . n2 i=1 j=1 a=1 nα b=1 Let Eij for i, j ∈ [n] be given by Eij = K X K X (ij) X̂ab · 1{(a, b) ∈ / QB ∗ (zi , zj )}. a=1 b=1 To show (18), we apply (40) as follows: n n n n 1 XX 1 XX 1{P̂ij 6= θ̂zi zj } ≤ 2 1{Eij ≥ 1/2} n2 i=1 j=1 n i=1 j=1 n n 1 XX 2Eij n2 i=1 j=1   1 = OP √ , nα ≤ 20 (40) where the last equality follows from (40). To show that (18) holds with P̃ in place of P̂ , we observe the following bounds:   n X n n n X 1 1 XX E 2 1{P̃ij 6= θ̂zi zj } = 2 Eij n i=1 j=1 n i=1 j=1   1 = OP √ nα and  n X n h i X 4 X 1 1{P̃ij 6= θ̂zi zj } = 4 Var 1{P̃ij 6= θij } Var  2 n i=1 j=1 n i<j  4 X  P P̃ij 6= θij ≤ 4 n i<j  4 X Eij n4 i<j   1 1 . = 2 OP √ n nα   √ Applying Chebychev, which states that P |X − EX| ≥ k Var X ≤ k −2 , with = k = n3/4 α−1/4 yields that   n n 1 XX 1 1{P̃ij 6= θ̂zi zj } = OP √ . n2 i=1 j=1 nα A.3 Proof of Lemmas 2, 3, and 4 Proof of Lemma 2. Let F̃ ∈ RnK×nK be a re-centered version of F̄ , with submatrices F̃ (ij) ∈ RK×K given by F̃ (ij) = F̄ (ij) + (Aij − Pij ) log ρ · 11T . Alegebraic manipulation yields that hF̄, X ∗ i − hF̄, X̂i = hF̃, X ∗ i + hF̄ − F̃, X ∗ i − hF̃, X̂i − hF̄ − F̃, X̂i = hF̃, X ∗ i − hF̃, X̂i ∗ ∗ ≤ hF̃, X i − hF, X i + hF, X̂i − hF̃, X̂i (41) (42) ≤ 2 max hF̄ − F, Xi X∈X ≤ 2CG max s,t∈{−1,1}nK 21 sT (F − F̃ )t, (43) where (41) holds because F̃ (ij) − F̄ (ij) ∝ 11T for all i, j ∈ [n], implying that hF̃ − F̄, Xi = hF̃ − F̄, X 0 i for all X, X 0 ∈ X ; (42) holds because X̂ maximizes hF, Xi, implying that hF, X ∗ − X̂i ≤ 0; and (43) follows by Grothendieck’s inequality and because X ⊂ M. It remains to bound the right hand side of (43). By the definition of F̃ , it can be seen that (ij) (ij) Fab − F̃ab = (Aij − Pij ) log θ̂ab /ρ 1 − θ̂ab , so that sT (F − F̃ )t = n X n X K X K X (j) s(i) a tb (Aij − Pij ) log i=1 j=1 a=1 b=1 θ̂ab /ρ 1 − θ̂ab . Given s, t ∈ {−1, 1}nK define xij ≡ xij (s, t) by xij = (Aij − Pij ) K  K X X (j) (j) (j) s(i) a tb + sa tb  a=1 b=1 log θ̂ab /ρ 1 − θ̂ab , P so that sT (F − F̃ )t = i<j xij . Using ρ/c ≤ θ̂ab /(1 − θ̂ab ) ≤ cρ which holds by Assumption 2 and letting C = 2| log c|, it can be seen that Var(xij + xji ) ≤ Pij (1 − Pij )K 4 C 2 By Bernstein’s inequality, it follows that   X 1 xij ≥  ≤ exp − P  n 2 i,j:i<j |xij | ≤ K 2 C. and n 2  2 K 4 C 2 ρ + 2K 2 C ! , −1 P where we have used the fact that n2 i<j Pij (1 − Pij ) ≤ ρ. Letting  = pρ C1 n for any value of C1 implies   r   1 X nC 2 1 ρ xij ≥ C1 ≤ exp − 4 22 1 2 . P  n n K C + 2K C 2 i,j:i<j Applying a union bound over all s, t ∈ {−1, 1}nK implies   r   1 2 X 1 ρ nK 2 nC1  P max x ≥ C ≤ 2 exp − , ij 1 n n K 4 C 2 + 2K 2 C s,t∈{−1,1}nK 2 i,j:i<j which implies for all C1 satisfying 21 C12 /(K 4 C 2 + 2K 2 CC1 ) > K log 2 that   r X 1 ρ  = e−C2 n ,  P max xij ≥ C1 (44) n n s,t∈{−1,1}nK 2 i,j:i<j where C2 = 12 C12 /(K 4 C 2 + 2K 2 CC1 ) − K log 2. Since sT (F − F̃ )t = combining (44) and (43) proves the lemma. 22 P i<j xij , Proof of Lemma 3. It holds that hF̄, X̂i = n X n X K X K X (ij) (ij) F̄ab X̂ab i=1 j=1 a=1 b=1 = n X n X " F̄z(ij) i ,zj + ≤ (ij) F̄ab − F̄z(ij) i ,zj  # (ij) X̂ab a=1 b=1 i=1 j=1 n X n X K X K  X " F̄z(ij) i ,zj − ρ∆ K X K X # (ij) X̂ab · 1{(a, b) ∈ / Qθ̂ (zi , zj )} . a=1 b=1 i=1 j=1 Rearranging and using hF̄, X ∗ i = n P n ij (ij) F̄zi ,zj (as implied by (32)) yields K K hF̄, X ∗ i − hF̄, X̂i X X X X (ij) X̂ab · 1{(a, b) ∈ / Qθ̂ (zi , zj )}, ≥ ρ∆ i=1 j=1 a=1 b=1 and dividing both sides by n2 and using Lemma 2 yields that with probability at least 1 − e−C2 n , n n K K C1 /∆ 1 X X X X (ij) X̂ab · 1{(a, b) ∈ / Qθ̂ (zi , zj )}, ≥ √ nρ n2 i=1 j=1 a=1 b=1 proving the lemma. Proof of Lemma 4. Let xij for i, j ∈ [n] be given by   xij = H(Pij ) − Pij log ρ − KL Pij , P̃ij . It can be seen that xij for i < j are independent random variables with distributions xij = Pij log θ̂ab /ρ 1 − θ̂ab + log(1 − θ̂ab ) (ij) with probability X̂ab , with xji = xij for i > j and xii = 0. By definition of {xij }, it holds that n X n  X n X n   h  i X KL Pij , P̃ij − E KL Pij , P̃ij = (Exij − xij ) . i=1 j=1 i=1 j=1 To bound the right hand side of (45), observe that by Assumption 2 |xij | ≤ Pij | log c| + | log(1 + cρ)| cρ ≤ Pij | log c| + 1 + cρ 23 (45) and hence it holds that max |xij − Exij | ≤ O(1) ij X 1 Var(xij + xji ) ≤ O(ρ), n(n − 1) i,j:i<j Applying Bernstein’s inequality thus yields   X 1 (xij − Exij ) ≥  ≤ exp − P  n 2 i,j:i<j 1 and letting  = (ρ/n)1/2 implies that n 2 )ρ P i,j (xij ( Combining this bound with (45) proves the lemma. B n 2  2 O(ρ) + O(1) ! ,  − Exij ) = OP (nρ)−1/2 . Proof of Theorem 3 Lemma 1 can be found as E1-E4 in [15], and as Theorem 2.6 in [5]. Proof of Theorem 3. Let B = span(B0 , . . . , B` ), and let A denote the set A = {X ∈ RnK×nK : X (ij) ∈ B ∀ i, j}, and observe the following properties of A: 1. If M ∈ A, then its submatrices M (ij) must be symmetric and have the same eigenvectors since they are in the span of an association scheme. Specifically, if X t+1 + V t ∈ A then (20) holds. 2. A is a linear space, so if M1 , M2 ∈ A, then M1 + M2 ∈ A as well. 3. 0 ∈ A, so the initial values X 0 , W 0 , Y 0 , U 0 , V 0 are in A P` 4. Let B = i=0 γi Bi for some weights γ0 , . . . , γ` . BecausePB0 , . . . , B` are binary with disjoint support, it holds that max(0, B) = i max(0, γi )Bi P and log(B) = i log(γi )Bi . 5. If θ̂ ∈ B then log θ̂ and log(1 − θ̂) are in B as well, by property 4. This implies the matrix F given by (12) is in A, since each submatrix F (ij) is a linear combination of log θ̂ and log(1 − θ̂). 6. If M ∈ A then max(0, M ) is also in A, by property 4. 7. If M ∈ A, then the eigenvectors of each submatrix are orthogonal and include the vector 1, by Lemma 1. As a result, the effect of the projection ΠX (M ) is to change the eigenvalue associated with the vector 1 in each submatrix, implying that ΠX (M ) ∈ A. 24 8. If X t+1 + V t ∈ A, then (20) and hence (21) hold, which implies that ΠS+ (X t+1 + V t ) ∈ A. Using these properties, we show by induction that X t , W t , Y t , U t , V t ∈ A for all t. As for the base case, it holds that X 0 , W 0 , Y 0 , U 0 , V 0 ∈ A by property 3. Now suppose that X t , W t , Y t , U t , V t ∈ A for any t. Then by (19) it follows that X t+1 ∈ A by properties 2, 5, and 7; that W t+1 ∈ A by properties 2 and 6; that Y t+1 ∈ A by properties 2 and 8; and that U t+1 , V t+1 ∈ A by property 2. This completes the induction argument. Since X t , W t , Y t , U t , V t ∈ A for all t, it follows by property 2 that X t+1 + t V ∈ A for all t. By property 1, this implies that (20) holds for all t, proving the theorem. C Proof of Corollary 1 Here we prove Corollary 1, which states that the eigencoordinates of P̂ or P̃ will approximate those of P (up to a unitary transform) when Theorem 2 holds. This suggests that ẑ, which is computed by spectral clustering of P̂ , will converge to z up to label permutation. C.1 Intermediate results Lemma 5 bounds the eigenvalues of P under Assumptions 1 and 2 . Lemma 5. Let Assumptions 1 and 2 hold. Let D ∈ [0, 1]K×K denote the matrix D = diag(π). Let λ∗1 , . . . , λ∗K and λ1 , . . . , λK respectively denote the sorted eigenvalues of D1/2 B ∗ D1/2 and P . It holds that λk = nα(λ∗k (1 + oP (1))) k = 1, . . . , K. We will use the following version of the Davis-Kahan theorem, taken from [30, Th. 4]: Theorem 3. Let P, P̂ ∈ Rn×n be symmetric, with singular values σ1 ≥ . . . ≥ σn 2 and σ̂1 ≥ . . . ≥ σ̂n respectively. Fix 1 ≤ r ≤ s ≤ n and assume that min(σr−1 − 2 ) > 0, where σ02 = ∞ and σn+1 = −∞. Let d = s−r+1, and let V = σr2 , σs2 −σs+1 (vr , vr+1 , . . . , vs ) ∈ Rn×d and V̂ = (v̂r , v̂r+1 , . . . , v̂s ) ∈ Rn×d have orthonormal columns satisfying P vj = σj uj and P̂ v̂j = σ̂j ûj for j = r, r + 1, . . . , s. Then there exists orthogonal Ô ∈ Rd×d such that kV̂ Ô − V kF ≤ 23/2 (2σ1 + kP̂ − P kop )kP̂ − P kF 2 2 ) min(σr−1 − σr2 , σs2 − σs+1 25 C.2 Proof of Corollary 1 and Lemma 5 2 Proof of Corollary 1. Let r = 1 and s = K = rank(P ), so that σs2 − σs+1 = λ2K . By Theorem 3, it holds that kV̂ Ô − V k2F ≤ 23/2 (2σ1 + kP̂ − P kop )kP̂ − P kF λ2K !2 . It follows that kV̂ Ô − V k2F ≤ = !2 23/2 O(nα)kP̂ − P kF (nαλ∗K )2 (1 + oP (1)) !2 23/2 O(1)kP̂ − P kF , nα(λ∗K )2 (1 + oP (1)) (46) where in the first inequality follows from λK = nαλ∗K (1 + oP (1)) by Lemma 5, and also from 2σ1 + kP̂ − P kop ≤ 3kP kop + kP̂ kop ≤ 3n max Pij + n max P̂ij ij ≤ ∗ 3nα max Bab ab ij + nα max B̂ab . ab By Theorem 2 it holds that n n 1 1 XX 2 k P̂ − P k = (P̂ij − Pij )2 F n2 n2 i=1 j=1 n n 1 XX 1{P̂ij − Pij } · max(P̂ij − Pij )2 i,j n2 i=1 j=1   1 ≤ OP √ · O(α2 ). nα ≤ Substituting (47) into (46) yields O(1) kV̂ Ô − V k2F ≤ √ , nα completing the proof. Proof of Lemma 5. Let π̂ ∈ [0, 1]K be given by n 1X π̂a = 1{zi = a}, n i=1 26 (47) and let D̂ = diag(π̂). Let ũ ∈ RK denote an eigenvector of D̂1/2 B ∗ D̂1/2 with eigenvalue λ̂, let ṽ = D̂−1/2 ũ, and let v ∈ Rn be given by vi = ṽzi for i ∈ [n]. It can be seen that [P v]i = [nαB ∗ D̂ṽ]zi = [nαB ∗ D̂1/2 ũ]zi = [nαD̂−1/2 D̂1/2 B ∗ D̂1/2 ũ]zi = [nαD̂−1/2 λ̂ũ]zi = [nαλ̂ṽ]zi = nαλ̂vi , showing that v is an eigenvector of P with eigenvalue nαλ̂. Since D̂ → D, it follows that the eigenvalues of D̂1/2 B ∗ D̂1/2 converge to those of D1/2 B ∗ D1/2 , completing the proof. References [1] Edoardo M Airoldi, David M Blei, Stephen E Fienberg, and Eric P Xing. Mixed membership stochastic blockmodels. Journal of Machine Learning Research, 9(Sep):1981–2014, 2008. [2] Arash A Amini, Aiyou Chen, Peter J Bickel, Elizaveta Levina, et al. Pseudo-likelihood methods for community detection in large sparse networks. The Annals of Statistics, 41(4):2097–2122, 2013. [3] Arash A Amini and Elizaveta Levina. On semidefinite relaxations for the block model. arXiv preprint arXiv:1406.5647, 2014. [4] RA Bailey. Designs on association schemes. Lecture Notes-Monograph Series, pages 79–102, 2003. [5] Rosemary A Bailey. Association schemes: Designed experiments, algebra and combinatorics, volume 84. Cambridge University Press, 2004. [6] Afonso S Bandeira, Yutong Chen, and Amit Singer. Non-unique games over compact groups and orientation estimation in cryo-em. arXiv preprint arXiv:1505.03840, 2015. [7] Peter J Bickel and Aiyou Chen. A nonparametric view of network models and newman–girvan and other modularities. Proceedings of the National Academy of Sciences, 106(50):21068–21073, 2009. [8] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends R in Machine Learning, 3(1):1–122, 2011. 27 [9] T Tony Cai, Xiaodong Li, et al. Robust and computationally feasible community detection in the presence of arbitrary outlier nodes. The Annals of Statistics, 43(3):1027–1059, 2015. [10] Sourav Chatterjee et al. Matrix estimation by universal singular value thresholding. The Annals of Statistics, 43(1):177–214, 2015. [11] Yudong Chen, Xiaodong Li, and Jiaming Xu. Convexified modularity maximization for degree-corrected stochastic block models. arXiv preprint arXiv:1512.08425, 2015. [12] Etienne De Klerk, Dmitrii V Pasechnik, and Renata Sotirov. On semidefinite programming relaxations of the traveling salesman problem. SIAM Journal on Optimization, 19(4):1559–1573, 2008. [13] Aurelien Decelle, Florent Krzakala, Cristopher Moore, and Lenka Zdeborová. Inference and phase transitions in the detection of modules in sparse networks. Physical Review Letters, 107(6):065701, 2011. [14] Chao Gao, Zongming Ma, Anderson Y Zhang, and Harrison H Zhou. Achieving optimal misclassification proportion in stochastic block model. arXiv preprint arXiv:1505.03772, 2015. [15] Michel X Goemans and Franz Rendl. Semidefinite programs and association schemes. Computing, 63(4):331–340, 1999. [16] Ronald L Graham. Handbook of combinatorics, volume 1. 1995. [17] Olivier Guédon and Roman Vershynin. Community detection in sparse networks via grothendiecks inequality. Probability Theory and Related Fields, pages 1–25, 2015. [18] Peter D Hoff, Adrian E Raftery, and Mark S Handcock. Latent space approaches to social network analysis. Journal of the american Statistical association, 97(460):1090–1098, 2002. [19] Paul W Holland, Kathryn Blackmond Laskey, and Samuel Leinhardt. Stochastic blockmodels: First steps. Social networks, 5(2):109–137, 1983. [20] Brian Karrer and Mark EJ Newman. Stochastic blockmodels and community structure in networks. Physical Review E, 83(1):016107, 2011. [21] Florent Krzakala, Cristopher Moore, Elchanan Mossel, Joe Neeman, Allan Sly, Lenka Zdeborová, and Pan Zhang. Spectral redemption in clustering sparse networks. Proceedings of the National Academy of Sciences, 110(52):20935–20940, 2013. [22] Vince Lyzinski, Daniel L Sussman, Minh Tang, Avanti Athreya, Carey E Priebe, et al. Perfect clustering for stochastic blockmodel graphs via adjacency spectral embedding. Electronic Journal of Statistics, 8(2):2905–2922, 2014. 28 [23] Vince Lyzinski, Minh Tang, Avanti Athreya, Youngser Park, and Carey E Priebe. Community detection and classification in hierarchical stochastic blockmodels. arXiv preprint arXiv:1503.02115, 2015. [24] Catherine Matias and Vincent Miele. Statistical clustering of temporal networks through a dynamic stochastic block model. arXiv preprint arXiv:1506.07464, 2015. [25] Andrea Montanari and Subhabrata Sen. Semidefinite programs on sparse random graphs and their application to community detection. arXiv preprint arXiv:1504.05910, 2015. [26] Elchanan Mossel, Joe Neeman, and Allan Sly. Stochastic block models and reconstruction. arXiv preprint arXiv:1202.1499, 2012. [27] Tiago P Peixoto. Hierarchical block structures and high-resolution model selection in large networks. Physical Review X, 4(1):011047, 2014. [28] Karl Rohe, Sourav Chatterjee, and Bin Yu. Spectral clustering and the high-dimensional stochastic blockmodel. The Annals of Statistics, pages 1878–1915, 2011. [29] Jaewon Yang and Jure Leskovec. Overlapping community detection at scale: a nonnegative matrix factorization approach. In Proceedings of the sixth ACM international conference on Web search and data mining, pages 587–596. ACM, 2013. [30] Yi Yu, Tengyao Wang, and Richard J Samworth. A useful variant of the davis–kahan theorem for statisticians. Biometrika, 102(2):315–323, 2015. [31] Anderson Y Zhang and Harrison H Zhou. Minimax rates of community detection in stochastic block models. arXiv preprint arXiv:1507.05313, 2015. [32] Pan Zhang and Cristopher Moore. Scalable detection of statistically significant communities and hierarchies, using message passing for modularity. Proceedings of the National Academy of Sciences, 111(51):18144–18149, 2014. [33] Yuan Zhang, Elizaveta Levina, and Ji Zhu. Detecting overlapping communities in networks using spectral methods. arXiv preprint arXiv:1412.3432, 2014. [34] Qing Zhao, Stefan E Karisch, Franz Rendl, and Henry Wolkowicz. Semidefinite programming relaxations for the quadratic assignment problem. Journal of Combinatorial Optimization, 2(1):71–109, 1998. 29
10math.ST
THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS1 The Exact Solution to Rank-1 L1-norm TUCKER2 Decomposition Panos P. Markopoulos,∗ Dimitris G. Chachlakis, and Evangelos E. Papalexakis November 1, 2017 arXiv:1710.11306v1 [cs.DS] 31 Oct 2017 Abstract We study rank-1 L1-norm-based TUCKER2 (L1-TUCKER2) decomposition of 3-way tensors, treated as a collection of N D × M matrices that are to be jointly decomposed. Our contributions are as follows. i) We prove that the problem is equivalent to combinatorial optimization over N antipodal-binary variables. ii) We derive the first two algorithms in the literature for its exact solution. The first algorithm has cost exponential in N ; the second one has cost polynomial in N (under a mild assumption). Our algorithms are accompanied by formal complexity analysis. iii) We conduct numerical studies to compare the performance of exact L1-TUCKER2 (proposed) with standard HOSVD, HOOI, GLRAM, PCA, L1-PCA, and TPCA-L1. Our studies show that L1-TUCKER2 outperforms (in tensor approximation) all the above counterparts when the processed data are outlier corrupted. Index Terms Data analysis, L1-norm, outliers, robust, TUCKER decomposition, tensors. I. I NTRODUCTION AND P ROBLEM S TATEMENT Introduced by L. R. Tucker [1] in the mid-1960s, TUCKER decomposition is a fundamental method n-way tensor analysis, with applications in a wide range of fields, including machine learning, computer vision [2], [3], wireless communications [4], biomedical signal processing [5], and social-network data analysis [6], [7] to name a few. Considering that the n-way tensor under processing is formed by the concatenation (say, across the n-th mode, with no loss of generality) of a number of coherent (same class, or distribution) (n − 1)-way coherent tensor measurements, then TUCKER decomposition simplifies to TUCKER2 decomposition. TUCKER2 strives to jointly decompose the collected (n − 1)-way tensors and unveil the low-rank multi-linear structure of their class, or distribution. Higher-Order SVD (HOSVD) and Higher-Order Orthogonal Iteration (HOOI) algorithms [8] are wellknown solvers for TUCKER2 (and TUCKER) decompositions. A detailed presentation of TUCKER, TUCKER2, P. P. Markopoulos and D. G. Chachlakis are with the Department of Electrical and Microelectronic Engineering, Rochester Institute of Technology, Rochester, NY 14623 USA (e-mail: [email protected], [email protected]). E. E. Papalexakis is with the Department of Computer Science and Engineering, University of California Riverside, Riverside, CA 92521 USA (e-mail: [email protected]). ∗ Corresponding author. THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS2 and the respective solvers is offered in [9]–[11]. Note that both types of solvers can generally only guarantee a locally optimal solution. For n = 2, TUCKER/TUCKER2 take the familiar form of Principal-Component Analysis (PCA). Thus, similar to PCA, TUCKER/TUCKER2 are sensitive against outliers within the processed tensor [12]–[14]. On the other hand, L1-Principal-component Analysis (L1-PCA) [15]–[17], substituting the L2-norm in PCA by the outlier-resistant L1norm, has illustrated remarkable outlier-resistance. Extending this formulation to tensor processing, one can similarly endow robustness to TUCKER and TUCKER2 decompositions by substituting the L2-norm in their formulations by the L1-norm. Indeed, an approximate algorithm for L1-norm-based TUCKER2 (L1-TUCKER2) was proposed in [12]. However, L1-TUCKER2 remains to date unsolved. In this work, we offer for the first time the exact solution to L1-TUCKER2 for the special case of rank-1 approximation, and provide two optimal algorithms. A formal problem statement follows. Consider a collection of N real-valued matrices of equal size, X1 , X2 , . . . , XN ∈ RD×M . For any rank d ≤ PN > 2 min{D, M }, a TUCKER2 decomposition strives to jointly analyze {Xi }N i=1 , by maximizing i=1 kU Xi VkF over U ∈ RD×d and V ∈ RM ×d , such that U> U = V> V = Id ; then, Xi is low-rank approximated as UU> Xi VV> . The squared Frobenius norm k · k2F returns the summation of the squared entries of its matrix argument. Among other methods in the tensor-processing literature, TUCKER2 coincides with Multilinear PCA [18] (for zero-centered matrices) and the Generalized Low-Rank Approximation of Matrices (GLRAM) [19]. Clearly, for N = 1, TUCKER2 simplifies to the rank-d approximation of matrix X1 ∈ RD×M , solved by means of the familiar singular-value decomposition (SVD) [20]; i.e., the optimal arguments U and V are built by the d left-hand and right-hand singular vectors of X1 , respectively. To counteract against the impact of any outliers in {Xi }N i=1 , in this work, we consider the L1-norm-based TUCKER2 reformulation L1-TUCKER2: maximize D×d > U∈R ; U U=Id V∈RM ×d ; V> V=Id N X kU> Xi Vk1 , (1) i=1 where the L1-norm k · k1 returns the summation of the absolute values of its matrix argument. The problem in (1) was studied in [12] under the title L1-Tensor Principal-Component Analysis (TPCA-L1).1 Authors in [12] presented an approximate algorithm for its solution which they employed for image reconstruction. To date, (1) has not been solved exactly in the literature, even for the special case of rank-1 approximation (i.e., d = 1). In this work, we deliver, for the first time, the exact solution to L1-TUCKER2 for d = 1, by means of two novel algorithms. In addition, we provide numerical studies that demonstrate the outlier-resistance of exact L1-TUCKER2, and its 1 In this work, we refer to the problem as L1-TUCKER2, so as to highlight its connection with the TUCKER2 formulation (instead of the general TUCKER formulation). THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS3 superiority (in joint-matrix decomposition and reconstruction) over L2-norm-based (standard) TUCKER2, GLRAM, TPCA-L1, PCA, and L1-PCA. II. E XACT S OLUTION A. Reformulation into combinatorial optimization For rank d = 1, L1-TUCKER2 in (1) takes the form N X maximize M ×1 u∈RD×1 ; v∈R ; kuk2 =kvk2 =1 |u> Xi v| (2) i=1 First, we focus on the absolute value in (2) and notice that, for any a ∈ RN , PN i=1 |ai | = PN i=1 sgn (ai ) ai = sgn (a)> a = maxb∈{±1}N b> a, where sgn (·) returns the {±1}-sign of its (vector) argument. In view of the above, Lemma 1 follows. Lemma 1. For any given u ∈ RD and v ∈ RM , it holds that N X > |u Xi v| = max b∈{±1}N i=1 u N X > ! bi Xi v. (3) i=1    The maximum in (3) is attained for b = [sgn u> X1 v , sgn u> X2 v , . . . , sgn u> XN v ]> .  In addition, the following well-known Lemma 2 derives by the matrix-approximation optimality of SVD [20]. Lemma 2. For any given b ∈ {±1}N , it holds that max > u u∈RD×1 ; kuk2 =1 v∈RM ×1 ; kvk2 =1 N X ! bi Xi v = σmax i=1 N X ! bi Xi (4) i=1 where σmax (·) returns the highest singular value of its matrix argument. The maximum in (4) is attained if u and P v are the left-hand and right-hand dominant singular vectors of N  i=1 bi Xi , respectively. · D×M N . Then, for any To compact our notation, we concatenate {Xi }N i=1 into X = [X1 , X2 , . . . , XN ] ∈ R P b ∈ {±1}N , it holds N i=1 bi Xi = X(b ⊗ IM ), where ⊗ denotes the Kronecker matrix product [21]. Then, in view of Lemma 1 and Lemma 2, we can rewrite the L1-TUCKER2 in (2) as max D×1 u∈R ; kuk2 =1 v∈RM ×1 ; kvk2 =1 = max b∈{±1}N u∈RD×1 ; kuk2 =1 v∈RM ×1 ; kvk2 =1 N X |u> Xi v| u> (X(b ⊗ IM )) v = max N σmax (X(b ⊗ IM )) . b∈{±1} (5) i=1 (6) (7) THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS4 It is clear that (7) is a combinatorial problem over the size-2N feasibility set {±1}N . The following Proposition 1 derives straightforwardly from Lemma 1, Lemma 2, and (5)-(7) and concludes our transformation of (2) into a combinatorial problem. Proposition 1. Let bopt be a solution to the combinatorial maximize σmax (X(b ⊗ IM )) N (8) b∈{±} and denote by uopt ∈ RD and vopt ∈ RM the left- and right-hand singular vectors of X(bopt ⊗ IM ) ∈ RD×M ,  > > respectively. Then, (uopt , vopt ) is an optimal solution to (2). Also, bopt = [sgn u> opt X1 vopt , . . . , sgn uopt XN vopt ] P > > > and N i=1 |uopt Xi vopt | = uopt (X(bopt ⊗ IM ))vopt = σmax (X(bopt ⊗ IM )). In the special case that uopt Xi vopt = 0, for some i ∈ {1, 2, . . . , N }, [bopt ]i can be set to +1, having no effect to the metric of (8).  Given bopt , (uopt , vopt ) are obtained by SVD of X(bopt ⊗ IM ). Thus, by Proposition 1, the solution to L1TUCKER2 for low-rank d = 1 is obtained by the solution of the combinatorial problem (8) and a D-by-M SVD. B. Connection to L1-PCA and hardness In the sequel, we show that for M = 1 and d = 1, L1-TUCKER2 in (2) simplifies to L1-PCA [15]–[17]. · Specifically, for M = 1, matrix Xi is a D × 1 vector, satisfying Xi = xi = vec(Xi ), and (2) can be rewritten as max N X u∈RD ; v∈R; kuk2 =|v|=1 |u> xi v|. (9) i=1 It is clear that for every u, an optimal value for v is trivially v = 1 (or, equivalently, v = −1); thus, for X = [x1 , x2 , . . . , xN ] ∈ RD×N , (9) becomes max N X u∈RD ; kuk2 =1 |u> xi | = i=1 max u∈RD ; kuk2 =1 kX> uk1 , (10) which is the exact formulation of the well-studied L1-PCA problem [15]–[17]. We notice also that for M = 1 the combinatorial optimization (8) in Proposition 1 becomes max b∈{±1}N σmax (X(b ⊗ 1)) = max b∈{±1}N kXbk2 , (11) since the maximum singular-value of a vector coincides with its Euclidean norm, which is in accordance to the L1-PCA analysis in [16], [17]. Based of the equivalence of L1-PCA to (11), [16] has proven that L1-PCA of X is formally NP-hard in N , for jointly asymptotic N and rank(X). Thus, by its equivalence to L1-PCA for d = 1 and M = 1, L1-TUCKER2 is also NP-hard in N , for jointly asymptotic N and rank(X). THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS5 Fig. 1. For ρ = 3 and N = 4, we draw W ∈ Rρ×N , such that WW> = I3 and Assumption1 holds  true. Then, we plot the nullspaces of all 4 columns of W (colored planes). We observe that the planes partition R3 into K = 2( 30 + 31 + 32 ) = 2(1 + 3 + 3) = 14 coherent cells (i.e., 7 visible cells above the cyan hyperplane and 7 cells below.) C. Exact Algorithm 1: Exhaustive search Proposition 1 shows how the solution to (2) can be obtained through the solution to the combinatorial problem in (8). Our first exact algorithm solves (8) straightforwardly by an exhaustive search over its feasibility set. In fact, noticing that σmax (·) is invariant to negations of its matrix argument, we obtain a solution bopt to (8) by an exhaustive search in the size-2N −1 set Bex = {b ∈ {±1}N : b1 = 1}. For every value that b takes in Bex , we conduct SVD to X(b ⊗ IM ) to calculate σmax (X(b ⊗ IM )), with cost O(min{D, M }DM ) [20]. Since it entails 2N −1 SVD calculations, the cost of this exhaustive-search algorithm is O(2N −1 min{D, M }DM ); thus, it is exponential to the number of jointly processed matrices, N , and at most quadratic to the matrix sizes, D and M . D. Exact Algorithm 2: Search with cost polynomial in N In the sequel, we focus on the case where N is low-bounded by the constant DM and present an algorithm that solves (2) with polynomial cost in N . DM < N emerges as a case of interest in signal processing applications when {Xi }N i=1 are measurements of a D × M fixed-size sensing system (e.g., D × M images). By Proposition 1, for the optimal solutions bopt and (uopt , vopt ) of (8) and (2), respectively, it holds     > > > > X> u , . . . , sgn v X u bopt = [sgn vopt opt N opt ] , 1 opt (12)  > with sgn u> opt Xi vopt = +1, if uopt Xi vopt = 0. In addition, for every i ∈ {1, 2, . . . , N }, we find that   > > > > vopt X> u = Tr X u v opt opt i i opt = xi (vopt ⊗ uopt ). (13) THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS6 Therefore, defining Y = [x1 , x2 , . . . , xN ] ∈ RDM ×N , (12) can be rewritten as   bopt = sgn Y> (vopt ⊗ uopt ) . (14) svd Consider now that Y is of some rank ρ ≤ min{DM, N } and admits SVD Y = QSW, where Q> Q = WW> = · Iρ and S is the ρ×ρ diagonal matrix that carries the ρ non-zero singular-values of Y. Defining popt = S> Q> (vopt ⊗ uopt ), (15) can be rewritten as   bopt = sgn W> popt . (15) In view of (15) and since sgn (·) is invariant to positive scalings of its vector argument, an optimal solution to (8), bopt , can be found in the binary set   B = {b ∈ {±1}N : b = sgn W> c , c ∈ Rρ }. (16) Certainly, by definition, (16) is a subset of {±1}N and, thus, has finite size upper bounded by 2N . This, in turn,  implies that there exist instances of c ∈ Rρ that yield the same value in sgn W> c . Below, we delve into this observation to build a tight superset of B that has polynomial size in N , under the following mild “general position” assumption [22]. Assumption 1. For every I ⊂ {1, 2, . . . , N } with |I| = ρ − 1, it holds that rank([W]:,I ) = ρ − 1; i.e., any collection of ρ − 1 columns of W are linearly independent. · For any i ∈ {1, 2, . . . , N }, define wi = [W]:,i and denote by Ni the nullspace of wi . Then, for every c ∈ Ni , the (non-negative) angle between c and wi , φ(c, wi ), is equal to π 2 and, accordingly, wi> c = kck2 kwi k2 cos (φ(c, wi )) = 0. Clearly, the hyperplane Ni partitions Rρ in two non-overlapping halfspaces, Hi+ and Hi− [23], such that   sgn c> wi = +1 for every c ∈ Hi+ and sgn c> wi = −1 for every c ∈ Hi− . In accordance with Proposition 1, we consider that Hi+ is a closed set that includes its boundary Ni , whereas Hi− is open and does not overlap with Ni . In view of these definitions, we proceed with the following illustrative example. Consider some ρ > 2 and two + , H− } column indices m < i ∈ {1, 2, . . . , N }. Then, hyperplanes Nm and Ni divide Rρ in the halfspace pairs {Hm m and {Hi+ , Hi− }, respectively. By Assumption 1,2 each one of the two halfspaces defined by Nm will intersect with + ∩ H+ , C = H+ ∩ H− , both halfspaces defined by Ni , forming the four halfspace-intersection “cells” C1 = Hm 2 m i i  − ∩ H− , C = H− ∩ H+ . It is now clear that, for any k ∈ {1, 2, 3, 4}, [sgn [W]> c ] C3 = Hm 4 m,i is the same for m i i   every c ∈ Ck . For example, for every c ∈ C2 , it holds that [sgn [W]> c ]m = +1 and [sgn [W]> c ]i = −1. Next, we go one step further and consider the arrangement of all N hyperplanes {Ni }N i=1 . Similar to our discussion 2 If wm and wi are linearly independent, then Nm and Ni intersect but do not coincide. THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS7 above, these hyperplanes partition Rρ in K cells {Ck }K k=1 , where K depends on ρ and N . Formally, for every k , the k -th halfspace-intersection set is defined as · Ck = \ Hi+ \ − Hm , (17) m∈Ik−1 i∈Ik+ for complementary index sets Ik+ and Ik− that satisfy Ik+ ∩ Ik− = ∅ and Ik+ ∪ Ik− = {1, 2, . . . , N } [24], [25]. By the definition in (17), and in accordance with our example above, every c ∈ Ck lies in the same intersection of  halfpsaces and, thus, yields the exact same value in sgn W> c . Specifically, for every c ∈ Ck , it holds that h  sgn W> c  +1, i ∈ I + k = sgn wi> c = . −1, i ∈ I −  i i  (18) k · In view of (18), for every k ∈ {1, 2, . . . , K} and any c ∈ Ck , we define the “signature” of the k -th cell bk =  ρ sgn W> c . Moreover, we observe that Ck ∩ Cl = ∅ for every k 6= l and that ∪K k=1 Ck = R . By the above observations and definitions, (16) can be rewritten as B= K [   {sgn W> c : c ∈ Ck } = {b1 , b2 , . . . , bK }. (19) k=1 Importantly, in [24], [26], it was shown that the exact number of coherent cells formed by the nullspaces of N points in Rρ that are in general position (under Assumption 1) is exactly  ρ−1  X N −1 K=2 ≤ 2N , j (20) j=0 with equality in (20) if and only if ρ = N . Accordingly, per (20), the cardinality of B in (16) is equal to |B| =  P N −1 2 ρ−1 . For clarity, in Fig. 1, we plot the nullspaces (colored planes) of the columns of arbitrary W ∈ R3×4 j=0 j that satisfies both WW> = I3 and Assumption 1. It is interesting that exactly K = 14 < 24 = 16 coherent cells emerge by the intersection of the formed halfspaces. In the sequel, we rely on (19) to develop a conceptually simple method for computing a tight superset of the cell signatures in B . · Under Assumption 1, for any I ⊆ {1, 2, . . . , N } with |I| = ρ − 1, the hyperplane intersection VI = ∩i∈I Ni is a line (1-dimensional subspace) in Rρ . By its definition, this line is the verge between all cells that are jointly bounded by the ρ − 1 hyperplanes in {Ni }i∈I . Consider now a vector c ∈ Rρ that crosses over the verge VI (at any   point other than 0ρ ). By this crossing, the value of [sgn W> c ]I will change so that sgn W> c adjusts to the signature of the new cell to which c just entered. At the same time, a crossing over VI cannot be simultaneously · over any of the hyperplanes in {Ni }i∈I c , for I c = {1, 2, . . . , N } \ I ; this is because, under Assumption 1, it is  only at 0ρ that more than ρ − 1 hyperplanes can intersect. Therefore, it is clear that [sgn W> c ]I c will remain THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS8 Algorithm 2: Polynomial in N Input: {Xi }N i=1 0: Y ← [vec(X1 ), vec(X2 ), . . . , vec(XN )] 1: (Q, Sd×d , W) ← svd(Y), mt ← 0 2: For every I ⊆ {1, 2, . . . , N }, |I| = d − 1 3: Build BI in (21) 4: For every b ∈ BI 5: (U, Σ, V) ← svd(X(b ⊗ IM )) 6: m ← max{diag(Σ)} 7: if m > mt , 8: mt ← m, bt ← b, u ← [U]:,1 , v ← [V]:,1 Output: bopt ← bt , uopt ← u, and vopt ← v Fig. 2. Algorithm for the exact solution of rank-1 L1-TUCKER2 in (2), with cost O(N ρ+1 ).  invariant during this crossing and, in fact, equal to [sgn W> v ]I c , for any v ∈ VI with v> c > 0. In view of the above, for any v ∈ VI \ 0ρ , the set   · BI = {b ∈ {±1}N : [b]I c = [sgn W> v ]I c } (21) contains the signatures of all sets that are bounded by the verge VI . Moreover, it has been shown (see, e.g., [26]) that, for every cell, there exists at least one such verge that bounds it. Therefore, it derives that the set [ Bpol = BI (22) I⊂{1,2,...,N }; |I|=ρ−1 includes all cell signatures and, thus, is a superset of B . We notice that, for every I , BI has size 2ρ−1 . Since I   N N can take ρ−1 distinct values, we find that Bpol is upper bounded by 2ρ−1 ρ−1 . Thus, both |Bpol | and |B| are polynomial, in the order of O(N ρ−1 ). Practically, for every I , v can be calculated by Gram-Schmidt orthogonalization of [W]:,I with cost O(ρ3 ).  N Keeping the dominant terms, the construction of Bpol costs O(N ρ−1 ) and can be parallelized in ρ−1 processes. Then, testing every entry of Bpol for optimality in (8) costs an additional O(N ). Thus, the overall cost of our second algorithm, taking also into account the O(N ) (for constant DM ) SVD cost for the formation of W, is O(N ρ ). The presented algorithm is summarized in Fig. 2. III. N UMERICAL S TUDIES 20×20 where A = b uv> and kuk = kvk = 1, b ∼ N (0, 49), Consider {Xi }14 i i 2 2 i i=1 such that Xi = Ai + Ni ∈ R and each entry of Ni is additive white Gaussian noise (AWGN) from N (0, 1). We consider that Ai is the rank1 useful data in Xi that we want to reconstruct, by joint analysis (TUCKER2-type) of {Xi }14 i=1 . By irregular corruption, 30 entries in 2 out of the 14 matrices (i.e., 60 entries out of the total 5600 entries in {Xi }14 i=1 ) have THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS9 14000 12000 10000 8000 6000 4000 2000 0 6 8 10 12 14 16 18 20 22 Fig. 3. Reconstruction MSE versus corruption variance σc2 (dB). 14 been further corrupted additively by noise from N (0, σc2 ). To reconstruct {Ai }14 i=1 from {Xi }i=1 , we follow one of the two approaches below. In the first approach, we vectorize the matrix samples and perform standard matrix analysis. That is, we obtain the first (d = 1) principal component (PC) of [vec(X1 ), vec(X2 ), . . . , vec(XN )], q. Then, for every i, we approximate Ai by Âi = mat(qq> ai ), where mat(·) reshapes its vector argument into a 20 × 20 matrix, in accordance with vec(·). In the second approach, we process the samples in their natural form, as matrices, analyzing them by TUCKER2. If (u, v) is the TUCKER2 solution pair, then we approximate Ai by Âi = uu> Xi vv> . For the first approach, we obtain q by PCA (i.e., SVD) and L1-PCA [16]. For the second approach, we conduct TUCKER2 by HOSVD [3], HOOI [9], GLRAM [19], TPCA-L1 [12], and the proposed exact L1-TUCKER2. Then, for each P14 2 reconstruction method, we measure the mean of the squared error i=1 kAi − Âi kF over 1000 independent realizations for corruption variance σc2 = 6, 8, . . . , 22dB. In Fig. 3, we plot the reconstruction mean squared error (MSE) for every method, versus σc2 . We observe that PCA and L1-PCA exhibit the highest MSE due to the vectorization operation (L1-PCA outperforms PCA clearly, across all values of σc2 ). Then, all TUCKER2-type methods perform similarly well when σc2 is low. As the outlier variance σc2 increases, the performance of L2-normbased TUCKER2 (HOSVD, HOOI) and GLRAM deteriorates severely. On the other hand, the L1-norm-based TPCA-L1 exhibits some robustness. The proposed exact L1-TUCKER2 maintains the sturdiest resistance against the corruption, outperforming its counterparts across the board. THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS10 R EFERENCES [1] L. R. Tucker, “Some mathematical notes on three-mode factor analysis,” Psychometrika, vol. 31, pp. 279-311, 1966. [2] M. A. O. Vasilescu and D. Terzopoulos, “Multilinear analysis of image ensembles: Tensorfaces, in Proc. 7th European Conf. on Comput. Vision (ECCV), Copenhagen, Denmark, May 2002, pp. 447-460. [3] L.D. Lathauwer, B.D. Moor, and J. Vandewalle, “A multilinear singular value decomposition,” SIAM J. Matrix Anal. App., vol. 21, pp. 1253-1278, 2000. [4] P. R. B. Gomes, A. L. F. de Almeida, and J. P. C. L. de Costal, “Fourth-order tensor method for blind spatial signature estimation,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process., Florence, Italy, May 2014, pp. 2992-2996. [5] M. Mørup, L. Hansen, K. Lars, and S. M. Arnfred, “Algorithms for sparse nonnegative TUCKER decompositions,” Neural computation (MIT Press), vol. 20, pp. 2112-2131, 2008. [6] J. Sun, S. Papadimitriou, C. Lin, N. Cao, S. Liu, and W. Qian, “Multivis: Content-based social network exploration through multi-way visual analysis,” in Proc. SIAM Int. Conf. Data Mining (SDM), Sparks, NV, May 2009, pp. 1064-1075. [7] T. G. Kolda and J. Sun, “Scalable tensor decompositions for multi-aspect data mining,” in Proc. IEEE Int. Conf. Data mining, Pisa, Italy, Dec. 2008, pp. 363-372. [8] L. D. Lathauwer, B. De Moor, and J. Vandewalle, “On the best rank-1 and rank-(R1,R2,.,RN) approximation of higher-order tensors,” SIAM J. Matrix Anal. Appl., vol. 21, pp. 1324-1342, May 2000. [9] T. G. Kolda and B. W. Bader, “Tensor decompositions and applications,” SIAM Review, vol. 51, pp. 455-500, 2009. [10] J. Sun, D. Tao, S. Papadimitriou, P. Yu, and C. Faloutsos, “Incremental tensor analysis: Theory and applications, ACM Trans. Knowl. Disc. Data, vol. 2, pp. 1-37, Oct. 2008. [11] N. Sidiropoulos, L. D. Lathauwer, X. Fu, K. Huang, E. Papalexakis, and C. Faloutsos, “Tensor decomposition for signal processing and machine learning,” IEEE Trans. Signal Process., vol. 63 no.13, pp. 3551-3582, Jul. 2017. [12] Y. Pang, X. Li, and Y. Yuan, “Robust tensor analysis with L1-norm,” IEEE Trans. Circuits Syst. Video Technol., vol. 20, pp. 172-178, Feb. 2010. [13] X. Fu, K. Huang, W. K. Ma, N. D. Sidiropoulos, and R. Bro, “Joint tensor factorization and outlying slab suppression with applications,” IEEE Trans. Signal Process., vol. 63, no. 23, pp. 6315-6328, Dec. 2015. [14] X. Cao, X. Wei, Y. Han, and D. Lin, “Robust face clustering via tensor decomposition,” IEEE Trans. Cybern., vol. 45, no. 11, pp. 2546-2557, Nov. 2015. [15] P. P. Markopoulos, G. N. Karystinos, and D. A. Pados, “Some options for L1-subspace signal processing,” in Proc. 10th Intern. Sym. Wireless Commun. Sys. (IEEE ISWCS 2013), Ilmenau, Germany, Aug. 2013, pp. 1-5. [16] P. P. Markopoulos, G. N. Karystinos and D. A. Pados, “Optimal algorithms for L1-subspace signal processing,” IEEE Trans. Signal Process., vol. 62, pp. 5046-5058, Oct. 2014. [17] P. P. Markopoulos, S. Kundu, S. Chamadia, and D. A. Pados, “Efficient L1-norm Principal-Component Analysis via bit flipping,” IEEE Trans. Signal Process., vol. 65, pp. 4252-4264, Aug. 2017. [18] H. Lu, K. N. Plataniotis and A. N. Venetsanopoulos, “MPCA: Multilinear principal component analysis of tensor objects,” IEEE Trans. Neural Net., vol. 19, pp. 18-39, Jan. 2008. [19] J. Ye, “Generalized low rank approximations of matrices,” Mach. Lear., vol. 61, pp. 167-191, Nov. 2005. [20] G. H. Golub and C. F. Van Loan, Matrix Computations. (3rd ed.) Baltimore, MD: Johns Hopkins University Press, 1996. [21] C. F. Van Loan, “The ubiquitous Kronecker product, J. Comput. Appl. Math., pp. 85-100, 2000. [22] P. B. Yale, Geometry and Symmetry. San Francisco, CA: Holden-Day, 1968. [23] P. Orlik and H. Terao, Arrangements of Hyperplanes. New York, NY: Springer-Verlag, 1992. THIS IS A PREPRINT; AN EDITED/FINALIZED VERSION OF THIS MANUSCRIPT HAS BEEN SUBMITTED TO IEEE SIGNAL PROCESSING LETTERS11 [24] R. O. Winder, ”Partitions of N-Space by hyperplanes,” SIAM J. Appl. Math., vol. 14, pp. 811-818, 1966. [25] S. K. Brown and P. Diaconis, “Random walks and hyperplane arrangements,” Ann. of Probability, pp. 1813-1854, 1998. [26] G. N. Karystinos and A. P. Liavas, “Efficient Computation of the Binary Vector That Maximizes a Rank-Deficient Quadratic Form,” IEEE Trans. Inf. Theory, vol. 56, pp. 3581-3593, Jul. 2010.
8cs.DS
How to Round Subspaces: A New Spectral Clustering Algorithm Ali Kemal Sinop∗ arXiv:1503.00827v5 [cs.DS] 19 Oct 2015 October 20, 2015 Abstract A basic problem in spectral clustering is the following. If a solution obtained from the spectral relaxation is close to an integral solution, is it possible to find this integral solution even though they might be in completely different basis? In this paper, we propose a new spectral clustering algorithm. It can recover √ a k-partition such that the subspace corresponding to the span of its indicator vectors is O( OPT) close to the original subspace in spectral norm with OPT being the minimum possible (OPT ≤ 1 always). Moreover our algorithm does not impose any restriction on the cluster sizes. Previously, no algorithm was known which could find a k-partition closer than o(k · OPT). We present two applications for our algorithm. First one finds a disjoint union of bounded degree expanders which approximate a given graph in spectral norm. The second one is for approximating the sparsest k-partition in a graph where each cluster have expansion at most φk provided φk ≤ O(λk+1 ) where λk+1 is the (k + 1)st eigenvalue of Laplacian matrix. This significantly improves upon the previous algorithms, which required φk ≤ O(λk+1 /k). 1 Introduction In this paper, we study the following problem. If the solution of spectral relaxation for some k-way partitioning problem is close to an integral solution, can we still find this integral solution? The main difficulty is due to the rotational invariance of the spectral relaxation. The basis of an integral solution might be completely different than the basis of solutions for the spectral relaxation. Arguably, this is an important problem in spectral clustering, which is a widely used approach for many data clustering and graph partitioning problems arising in practice. In spectral clustering, one uses the top (or bottom) k-eigenvectors of some matrix derived from the input (usually the Laplacian or adjacency matrix of some graph derived from the distances or nearest neighbors) to find a k-partition. If the clusters are separated in a nice way, then these k-eigenvectors will be close a k-partition up to an arbitrary rotation. Hence a crucial part of spectral clustering methods is how to “round” these k-eigenvectors to a close-by k-partition. Formally, we study the problem of approximating a k-dimensional linear subspace of Rn by another subspace which is k-piecewise constant: Every vector of this subspace has its coordinates ∗ Email: [email protected]. This work was done while author was visiting Simons Institute for the Theory of Computing, University of California at Berkeley. This material is based upon work supported by the National Science Foundation under Grant No. 1540685. 1 comprised of at most k distinct values. Or equivalently, given a k-by-n orthonormal matrix Y of the form Y = [y1 , . . . , yn ] (think of Y as an embedding of n points in Rk ), our problem is to find a k-partition Γ = {T1 , . . . , Tk } so as to minimize the total variance under any direction: XX min max hz, yu − cS i2 . Γ z∈Rk :kzk2 =1 S∈Γ u∈S Here cS is the mean of points in the cluster S. If we use C ∈ Rn×k to denote the matrix of cluster means with each row of C being one of the cluster means, then our objective can be stated more concisely as minC kY − Ck2 with k · k2 being the spectral norm. Geometrically speaking, this corresponds to finding a k-piecewise constant subspace that makes the minimum angle with Y . This is the problem of clustering with spectral norm [KK10]. In 2-dimensions, where k = 2, optimal solution corresponds to one of the threshold cuts. From this perspective, our problem can be seen as a generalization of thresholding to higher dimensions. Our main contribution is a new spectral clustering algorithm that can recover a k-partition √ 0 0 whose center matrix C satisfies kY − C k2 ≤ O( OPT), where OPT is √ the minimum possible (observe that OPT ≤ 1). Furthermore, the recovered k-partition will be O( OPT)-close in Jaccard index to the optimum partition: Each cluster we found will be close to a unique cluster among the optimum k-partition. Previously, no algorithm was known to find a k-partition closer than o(k · OPT). We also study two closely related problems. In the first one, the goal is to approximate a matrix in spectral norm by a block diagonal matrix, with every block being the normalized adjacency matrix of a clique. In our second application, we turn to the problem of k- EXPANSION. Given an undirected, weighted graph G = (V, C); find a k-partition Γ = {S1 , . . . , Sk } of the nodes so as to minimize the maximum expansion: def Φk (G) = min max Γ S∈Γ C(S, S) . min(|S|, |S|) (1) Here C(S, S) denotes the total weight of edges crossing S. Our second application is for approximating the optimum k-partition of k- EXPANSION on graphs whose spectrum grows faster than φk (we will make this precise later). The choice of spectral norm to measure the closeness of associated subspaces is quite natural from the perspective of our second application. Given any subspace, we show how to construct graphs in polynomial time, such that approximating k- EXPANSION on such graphs implies a solution for the spectral clustering problem. From this perspective, we can see that the subspace rounding problem is a prerequisite toward obtaining a o(k)-factor approximation algorithm for the problem of k- EXPANSION, where the best known is O(k 4 ) due to [LGT14]. 1.1 Related Work Spectral methods have been successfully used for clustering tasks [Bol13] arising in many different areas such as VLSI [AKY99], machine learning, data analysis [NJW01] and computer vision [SM00, YS03]. They are usually obtained by formulating the clustering task as a combinatorial optimization problem (such as sparsest/normalized cuts [SM00]), then solving the corresponding basic SDP relaxation, whose solution is often given by k extremal eigenvectors of an associated matrix. 2 One of the first spectral clustering algorithms with worst case guarantees was given in [KVV04] for the graph partitioning problem assuming certain conditions on the internal versus external conductance. The problem of finding a k-partition so as to minimize the spectral norm was first introduced by [KK10] in the context of learning mixtures of Gaussians. The best known approximation factor is O(k) due to [AS12]. A problem closely related to spectral clustering is k- EXPANSION, as defined in (1). When √ all cluster sizes are constrained to be nearly equal, this problem admits a O( log n log k)-factor approximation [BFK+ 11]. On the other hand, if a bi-criteria approximation is sought, then one can √ find (1 − Ω(1))k clusters each of which has expansion at most O( log n log k) times the optimum [LM14]. If we look at the basic SDP relaxation of k- EXPANSION, then the optimal fractional solution is given by the k smallest eigenvectors of the corresponding graph Laplacian matrix. In fact, this is the main motivation behind the usage of k-eigenvectors for clustering tasks in practice. A natural question is whether one can “round” these eigenvectors to a k-partition (the so called Cheeger inequalities). When k = 2, it was shown in [AM85] that simple thresholding yields a 2-partition √ with O( φ2 ) expansion, where φk is the optimal value for k- EXPANSION. Later a better bound was given in [KLL+ 13], assuming there is some gap between eigenvalues. When k > 2, bi-criteria versions of Cheeger’s inequality are known [ABS10, LRTV12, LGT14]. Here the guarantees on the √ e φk ), where O e hides the dependencies on logarithmic factors; but the expansion are of the form O( algorithms can only find (1 − Ω(1))k parts. The problem becomes significantly harder when exactly k clusters are desired. In this case, it was shown in [LGT14] that a method similar to the one proposed in [NJW01] will yield a k√ partition with maximum expansion O(k 4 φk ). This is the best known approximation algorithm for k- EXPANSION problem and, as of yet, there is no algorithm known which achieves a polylogarithmic approximation. Perhaps the simplest case of k- EXPANSION is when there is a gap between the (k + 1)st smallest λ ≥ 1ε . One might think of this as a eigenvalue of Laplacian matrix, λk+1 , and φk of the form φk+1 k stability criteria: It implies that all k-partitions with maximum expansion ≤ O(φk ) are O(ε)-close to each other. To put it in another way, approximating the optimum k-partition is at least as easy as finding a k-partition with minimum possible expansion among all its clusters. For the case of k = 2, it is trivial to show that thresholding the second smallest eigenvector of Laplacian yields ε-close partition to the optimal one. On the other hand, when k > 2, the best prior result is due to [AS12], which can find a k-partition that is O(kε)-close to the optimal one. In other words, when ε  k1 , there is no algorithm known to find a non-trivial approximation of the optimum k-partition. 1.2 Organization We first introduce some useful notation and background in Section 2. After this, we state our main contributions in Section 3. Then we propose a new spectral clustering algorithm in Section 4. √ In Section 5, we will prove that our algorithm always finds a k-partition that is ε-close to any given subspace, where ε is the optimum. In Section 6, we discuss some applications of our algorithm. Our main applications will be: • (Section 6.1) Approximating a graph using disjoint union of expanders and, • (Section 6.2) k- EXPANSION when φk ≤ O(λk+1 ). 3 Finally, in Section 7, we present a simple reduction from k- EXPANSION to our problem: This means any algorithm for k- EXPANSION has to solve our subspace rounding problem as well. 2 Notation and Background def Let [m] = {1, 2, . . . , m}. We will associate V = [n] with the set of nodes. For any vector q ∈ RΥ , def 1 kqk2 q def 1 n and q = kqk 2 q. Given a subset S ⊆ V , we use eS ∈ R to denote the indicator vector for 2 ( 1 if i ∈ S, S, eS (i) = . 0 else. Matrices. We use Rr×c to denote the set of r-by-c real matrices. Likewise, we use Sc and Sc+ ⊆ Sc to denote the set of c-by-c symmetric and positive semidefinite matrices, respectively. Finally let Sk (Rn ) be the set of all n-by-k orthonormal matrices (Stiefel manifold) for k ≤ n: n o def Sk (Rn ) = A ∈ Rn×k AT A = Ik . q = Given an r-by-c matrix A ∈ Rr×c , we use σi (A), i ∈ {1, 2, . . . , min(r, c)} to refer to the ith largest singular value of A. We define σmin (A) as the minimum singular value of A, and kAk2 as the √2-norm of A, which is kAk2 = σ1 (A). Likewise kAkF denotes the Frobenius norm of A, kAkF = AT A = qP 2 j σj (A). Given matrix R ⊆ [r], C ⊆ [c], we will use AR,C to refer to the minor corresponding to rows R and columns C. Finally, we will use AΠ , A⊥ ∈ Sr+ to denote the r-by-r projection matrices onto the column space and co-kernel of A, respectively. Observe that for any A ∈ Sk (Rn ), AΠ = AAT and A⊥ = In − AAT . One way of measuring the closeness of two subspaces is to look at how much (in degrees) we need to rotate a vector in one subspace to the closest vector in the other subspace. It is well known that this quantity is related to the spectral norm. For completeness, we provide a formal version of this statement along with its proof: Proposition 2.1 ([SS90]). Given two linear k-dimensional subspaces of Rn with orthonormal basis A, B ∈ Sk (Rn ) respectively; the cosine of the largest angle between these two subspaces is given by the following: def cos(∠AB) = |hx, yi| . x∈span(A) y∈span(B) kxk2 kyk2 min max We have sin(∠AB) = kA⊥ Bk2 = kB ⊥ Ak2 . Proof. From the definition of ]AB, it is easy to see how it measures the maximum degrees necessary to rotate a point in A to any point in B and vice versa. We will now prove the second statement. Any point x in span(A) can be written as Ap for some p ∈ Rk . Moreover A is orthonormal, thus kxk = kApk = kpk. This allows us to rewrite cos(]AB) as follows: |hx, yi| |hAp, yi| = min max . p y∈span(B) kpk2 kyk2 x∈span(A) y∈span(B) kxk2 kyk2 min max For any p, best y is given by B Π Ap. Moreover kB Π Apk22 + kB ⊥ Apk22 = kpk22 , thus: s kB Π Apk2 kB ⊥ Apk22 = min = 1 − max . p p kpk2 kpk22 4 Consequently, sin(∠AB) = maxp kB ⊥ Apk22 kpk22 = kB ⊥ Ak22 . Definition 2.2. Let SetV (k) be the family of sets of k non-empty subsets of V . We will use DisjV (k) ⊆ SetV (k) to denote the set of k disjoint subsets of V : Γ ∈ DisjV (k) if and only if Γ ∈ SetV (k) and S ∩ T = ∅ for all S 6= T ∈ Γ. In order to compare subspaces with k-partitions, we need to identify a canonical representation of the subspaces associated with k-partitions. The most natural representation is to use each basis vector as the normalized indicator of one of the clusters. Notation 2.3 (Basis Matrices of k-Partitions). Given k-subsets Γ = {A1 , . . . , Ak } of V , let Γ ∈ Rn×k  def  be the corresponding normalized incidence matrix Γ = eA1 . . . eAk . We will use ΓΠ ∈ Sn+ and Γ⊥ ∈ Sn+ to denote the associated projection matrices so that ΓΠ Γ = Γ and Γ⊥ Γ = 0. Multiplication with either of the projection matrices ΓΠ and Γ⊥ has a natural correspondence with means and the differences to means: Proposition 2.4. If Γ ∈ DisjV , then Γ is an orthonormal matrix, Γ ∈ Sk (Rn ), and Γ⊥ is a Laplacian matrix. For any Y ∈ Rk×n , ith column of: • Y ΓΠ is the mean of points in the same cluster with i provided i is in any cluster of Γ, and 0 otherwise. • Y Γ⊥ is the difference between yi and its associated center as defined above. For example, kY Γ⊥ k2F measures the sum of squared distances of each point to the center of its cluster or origin if it is not in any cluster. We will measure the distance between sets in a way similar to cosine distance. def Notation 2.5. Given p, q ∈ Rn , we define ∆(p, q) as ∆(p, q) = 1 − hp, qi2 . Note that ∆(p, q) = 2 1 ⊗2 − q ⊗2 k2 . For convenience, we will use ∆(S, q) as ∆(e , q). In particular, ∆(A, B) = 1 − |A∩B| . S 2 kp |A||B| Our measure of set similarity is closely related to the Jaccard index. Proposition 2.6. For any pair of subsets A, B ⊆ V : |A∆B| 1 |A∆B| ≤ ∆(A, B) ≤ . 4 |A ∪ B| |A ∪ B| Proof. Since |A∪B|2 ≥ |A||B|, we immediately see that 1−∆(A, B) ≥ |A∩B| |A∪B| . For the other direction, p suppose ∆(A, B) ≤ ε and |A| ≥ |B|. Then (1 − ε) |A||B| ≤ |A ∩ B| which implies s s |A ∩ B| |B| |A ∩ B| ≥ (1 − ε) ≥ (1 − ε) . |A| |A| |A| Therefore |A ∩ B| ≥ (1 − ε)2 |A| and |A∆B| = |A| + |B| − 2|A ∩ B| ≤ |B| − (1 − 4ε + 2ε2 )|A| ≤ 4ε|B|. In particular, |A∆B| ≥ 4∆(A, B). |A ∪ B| 5 We will now generalize our set similarity measure to k-partitions. b ∈ SetV (k); we define ∆(Γ, Γ) b as: Notation 2.7. Given Γ, Γ def b = min max ∆(S, π(S)). ∆(Γ, Γ) b S∈Γ π:Γ↔Γ b whenever ∆(A, B) ≤ ε (resp. ∆(Γ, Γ) b ≤ ε). We say A (resp. Γ) is ε-close to B (resp. Γ) Observe that our notion of proximity is a very strong bound. For example if Γ is ε-close to Γ∗ , then any subset S ∈ Γ∗ of size |S| < 1ε has to be preserved exactly in Γ. The next theorem says that the similarity measure we use for k-partitions in Notation 2.7 is tightly related to the spectral norm distance between the corresponding basis. b 2 ≤ 2∆(Γ, Γ). b ∈ DisjV (k); ∆(Γ, Γ) b ≤ kΓ⊥ Γk b Moreover, after appropriately Theorem 2.8. Given Γ, Γ 2 2 b b b ordering the columns of Γ, kΓ − Γk2 ≤ 4∆(Γ, Γ). Proof of Theorem 2.8 is given in Section 8.1. Proposition 2.9. Given A, B ∈ Sk (Rn ), σmin (AT B) = p 1 − kA⊥ Bk22 . Proof. B T A⊥ B = B T B − B T AAT B = Ik − B T AAT B. Since kAT Bk2 ≤ 1, kA⊥ Bk22 = 1 − σmin (AT B)2 . Consider two subspaces with basis A and B. If the angle between these two subspaces is small, then one might intuitively expect that AAT and BB T are very close also. In the next lemma, we make this intuition formal. We also include its proof for completeness. Lemma 2.10 ([SS90]). Given A, B ∈ Sk (Rn ); kAAT − BB T k2 = kA⊥ Bk2 . Proof. We will prove ≤ by upper bounding the spectral norm of (AAT − BB T )2 . Since AAT = AΠ and BB T = B Π : (AAT − BB T )2 =AΠ + B Π − AΠ B Π − B Π AΠ =AΠ B ⊥ + B Π A⊥ . (2) If this matrix is zero, then our claim is trivially true. Suppose not. Consider the largest eigenvalue σ of eq. (2) and a corresponding eigenvector q. We have 0 6= σq = (AΠ B ⊥ + B Π A⊥ )q, which means either B ⊥ q 6= 0 or A⊥ q 6= 0 (or both). Without loss of generality, we may assume A⊥ q 6= 0: σq = (AΠ B ⊥ + B Π A⊥ )q =⇒ σA⊥ q = A⊥ B Π A⊥ q. def Consequently, q 0 = A⊥ q is an eigenvector of A⊥ B Π A⊥ with eigenvalue σ: A⊥ B Π A⊥ q 0 = A⊥ B Π A⊥ q = σA⊥ q = σq 0 . In particular, kAAT − BB T k22 = k(AAT − BB T )2 k2 = σ ≤ kA⊥ B Π A⊥ k2 = kA⊥ BB T A⊥ k2 = kA⊥ Bk2 . Now we will prove ≥. If we multiply both sides of eq. (2) with A⊥ , we see that (AAT − BB T )2  A⊥ (AAT − BB T )2 A⊥ = A⊥ B Π A⊥ which implies k(AAT − BB T )2 k2 ≥ kA⊥ Bk22 . 6 2.1 Graph Partitioning Given an undirected graph G = (V, C) with nodes V and non-negative edge weights C, we use AG ∈ SV and LG ∈ SV+ to denote the adjacency and Laplacian matrices of G. Consider the following k-way graph partitioning problem where the goal is to minimize the maximum ratio of the total weight of edges cut and the number of nodes inside among all clusters. Definition 2.11 (k- EXPANSION). Given an undirected graph G = (V, C) with nodes V and non-negative edge weights C, we define the k-way expansion of G as the following: def φk (G) = min max Γ∈DisjV (k) T ∈Γ C(T, T ) . |T | Here C(A, B) denotes the total weight of unordered edges between A and B. For fixed G, we will use Γ∗ ∈ DisjV (k) to refer to the k-partition which achieves φk (G). At the first glance, our notion of expansion might seem different than the usual definition given in eq. (1). However they are indeed the same: Proposition 2.12. For any G = (V, C) and a k-partition of V , Γ ∈ DisjV (k), max T ∈Γ C(T, T ) C(S, S) = max . S∈Γ min(|S|, |S|) |T | In particular, φk (G) = Φk (G). Proof. For any S, min(|S|, |S|) ≤ |S|, therefore C(S,S) |S| C(S,S) . min(|S|,|S|) ≤ Now we will prove the other C(T,T ) |T | . For any T 0 ∈ Γ: X X C(T, T ) ≤ φ |T | = φ|V \ T 0 |. C(T 0 , T 0 ) ≤ direction. Let φ = maxT ∈Γ T ∈Γ\T 0 Consequently, C(T 0 ,T 0 ) |V \T 0 | = C(T 0 ,T 0 ) |T 0 | T ∈Γ\T 0 ≤ φ. Recall that C(T 0 ,T 0 ) |T 0 | ≤ φ, so C(T 0 ,T 0 ) min(|T 0 |,|T 0 | ≤ φ. We can capture the objective function of φk using the spectral norm, within a factor of 2: Lemma 2.13. Given Γ ∈ DisjV (k), 21 kΓT LΓk2 ≤ maxT ∈Γ def Proof. Let φ = maxT ∈Γ C(T,T ) |T | . C(T,T ) |T | ≤ kΓT LΓk2 . We need to prove φ ≤ σmax (ΓT LΓ) ≤ 2φ. The lower bound is trivial, so we only give the proof of upper bound. Note Γ = JD−1/2 where D is a matrix whose diagonals are |T | for T ∈ Γ and the columns of J are indicator vectors for every T ∈ Γ. Then ΓT LΓ = D−1/2 J T LJD−1/2 . Define W as the matrix which is equal to J T LJ along its diagonals and 0 everywhere else. Since J T LJ is a Laplacian matrix J T LJ  2W . Therefore: ΓT LΓ  2D−1/2 W D−1/2 . D−1/2 W D−1/2 is diagonal whose entries are eT T LeT |T | = C(T,T ) |T | ≤ φ over all T ∈ Γ. Consequently, σmax (ΓT LΓ) ≤ 2σmax (D−1/2 ZD−1/2 ) ≤ 2φ. 7 Given Lemma 2.13, a simple relaxation for φk (G) (the basic SDP relaxation) is the following: min kQT LQk2 st QT Q = Ik . (3) Note that for any Γ ∈ DisjV (k), Γ is feasible and eq. (3) is indeed a relaxation. Moreover the CourantFischer-Weyl principle implies that the optimum value of eq. (3) is λk with the corresponding optimal solution being the smallest k-eigenvectors of L. Therefore: λk ≤ φk (G). 3 (4) Our Contributions We re-state our main problem. Given a k-by-n matrix Y : Y T ∈ Sk (Rn ) of the form Y = [y1 , . . . , yn ] (think of Y as an embedding of n points in Rk ), find a k-partition Γ ∈ DisjV (k) so as to minimize the total variance under any direction: XX hz, yu − cS i2 . (5) min max Γ z∈Rk :kzk2 =1 S∈Γ u∈S Here cu is the mean of points in the same cluster with u if one exists, and cu = 0 otherwise. This is the problem of clustering with spectral norm [KK10]. Remark 3.1 (Covering all points). For simplicity, we allow some points to be left uncovered by any set in Γ. However the same guarantees still hold even if we require Γ to cover all points: We arbitrarily assign uncovered points to clusters while making sure that the relative cluster sizes do not change. This procedure changes the approximation ratio by a factor of 2. We can express eq. (5) more succinctly as the following: min kY Γ⊥ k22 Proposition 2.4 = Γ eq. (5) (6) There are two closely related problems, whose optimum is within square root of eq. (5) (Lemma 2.10): • Finding a k-by-k rotation matrix R : RT R = RRT = Ik and a k-partition Γ ∈ DisjV (k) so as to minimize the following: min kRY − Γk2 . R,Γ (7) • Approximate the Gram matrix of Y , Y T Y , using block diagonal matrices with each block being constant. This is equivalent to: min kY T Y − ΓΓT k2 . Γ (8) Our main contribution is a new spectral clustering algorithm whose pseudo-code is given through Algorithms 1 to 5. We prove the following guarantee on its outputs. 8 Theorem 3.2 (Restatement of Theorem 5.12). Let Γ∗ ∈ DisjV (k) with kY Γ∗ ⊥ k22 ≤ O(ε). Then b ← S PECTRAL C LUSTERING(Y ) is a k-partition so that Γ b ∈ DisjV (k), and it is O(√ε) close to both Γ∗ Γ and Y : √ √ b ⊥ k2 ≤ O( ε). b ≤ O( ε) and kY Γ ∆(Γ∗ , Γ) 2 any cluster size. Remark 3.3 (Small Clusters). Our main guarantee as stated in Theorem 5.12 works for √  For example, consider the case of some optimal cluster T ∈ Γ∗ having size |T | ≤ O 1/ ε . For such cluster, √ any S with ∆(S, T ) ≤ O( ε) has to be exactly equal to T . √ In other words, our algorithm will recover any T ∈ Γ∗ with |T | ≤ O(1/ ε) exactly. As an easy consequence, we show how to approximate a graph as a disjoint union of expanders (provided one exists) in polynomial time. Corollary 3.4 (Restatement of Corollary 6.4). Given a graph G, if there exists Γ∗ ∈ DisjV (k) such that Laplacian of G is ε-close (in spectral norm) to the Laplacian corresponding to the disjoint union of normalized cliques on each T ∈ Γ∗ : kL − Γ∗ ⊥ k2 ≤ ε, √  then in polynomial time, we can find Γ ∈ DisjV (k) which is O ε -close to Γ∗ and G: L − Γ⊥ k2 ≤ O(ε1/4 ). Next we significantly improve the known bounds for recovering a k-partition when all clusters have small expansion as in Definition 2.11. Previous spectral clustering algorithms only guarantee recovering each T ∈ Γ∗ when the (k + 1)st smallest eigenvalue, λk+1 , of the associated Laplacian matrix for G satisfies λk+1 > Ω(k · φk ). Our new algorithm significantly relaxes this requirement to λk+1 > Ω(φk ). Theorem 3.5 (Restatement of Theorem 6.1). Given a graph G with Laplacian matrix L, let Γ be the k-partition obtained by running Algorithm 3 on the smallest k eigenvectors of L. Then: s ! φk . ∆(Γ, Γ∗ ) ≤ O λk+1 Finally, we show that any approximation algorithm for k- EXPANSION implies the same approximation bound for the spectral clustering problem restricted to orthonormal matrices. In other words, the spectral clustering problem is a prerequisite for approximating k- EXPANSION even on graphs whose normalized Laplacian matrix has its (k + 1)st eigenvalue λk+1 larger than a constant. def Theorem 3.6 (Restatement of Theorem 7.1). Given Y : Y T ∈ Sk (Rn ), let Γ∗ = argminΓ kY Γ⊥ k22 2 with ε = kY Γ⊥ graph X, whose normalized Laplacian ∗ k2 . Then there exists a weighted, undirected, regular√ st matrix has its (k + 1) smallest eigenvalue at least λk+1 ≥ 1 − O( ε) such that: • Each T ∈ Γ∗ has small expansion, φX (T ) ≤ O(ε); • If Γ ∈ DisjV (k) is a k-partition with maxS∈Γ φX (S) ≤ δ, then ∆(Γ, Γ∗ ) ≤ O(δ + Moreover such X can be constructed in polynomial time. 9 √ ε). 4 Our Algorithm The pseudo-code of our clustering algorithm and its sub-procedures are listed in Algorithms 1 to 5. b = S PECTRAL C LUSTERING(Y ) (Algorithm 3), where Y is a The main procedure is invoked by Γ b is a k-by-n matrix Y such as the smallest k-eigenvectors of some Laplacian matrix. The output Γ k-partition close to Y . We use Γ∗ = (T1 , . . . , Tk ) to denote the closest k-partition to Y . We will refer to T ’s as true clusters. 4.1 Intuition First we start with the discussion of some of the main challenges involved in spectral clustering and the intuition behind the major components of our algorithm. Finding a Cluster. Since there are k directions and k clusters, we can think of each direction being associated with one of the clusters. Moreover, for one of the true clusters T , the total correlation of its center with remaining directions will be very small. By utilizing this intuition, we can easily find such a subset, say S (Algorithm 4). However this property need not be true for all T ’s: Even though each T will be at most ε-close to every non-associated direction, the total correlation might be (k − 1)ε  1, thus overwhelming the correlation it had with its associated direction. In fact, this is the reason why k-means type procedures will fail to find every cluster when ε > 1/k. To remedy this, each time we find S, we can try to “peel” it off. A natural approach is to project the columns of Y onto the orthogonal complement of the center of S. Similar ideas were used before in the context of learning mixtures of anisotropic Gaussians [BV08] and column based matrix reconstruction [DR10, GS12]. After projection, we obtain a new (k − 1)-by-n orthonormal matrix, Z, corresponding to remaining k − 1 clusters. Boosting. Unfortunately we can not iterate the above approach: No matter how accurate we are in S, there will be some error: If Y were ε-close to (T1 , . . . , Tk ), then we can at best guarantee that Z is 2ε-close to (T2 , . . . , Tk ). After k iterations, our error will be 2O(k) ε, which is much worse than k-means! In our algorithm, we keep the error from accumulating via a boosting step (Algorithm 1). Unraveling. Even with boosting, there remains one issue: The clusters we found may overlap with one another. Unlike other distance based clustering problems such as k-means, the assignment problem (“which cluster does this node belong to?”) is quite non-trivial in spectral clustering even if we are given all k-centers. There is no simple local procedure which can figure out the assignment of node u by only looking at yu and the cluster centers. We deal with this issue by reducing the ownership problem to finding a matching in a bipartite graph (Algorithm 5). Our approach is very similar to the one used in [BS06] for a special case of Santa Claus problem. Unfortunately, this operation has a cascading effect: Adding a new cluster might considerably change the previous clusters and their centers. Dealing with this challenge is what causes our final algorithm to be rather involved. Final Algorithm. The final difficulty we face is that, the boosted cluster might cannibalize other much smaller clusters. We overcome this issue by maintaining both estimates for every true cluster: a coarse estimate, which is the core we originally found; and the finer estimate obtained after boosting. Due to the cascading effect of unraveling whenever we add a new cluster, we have to re-compute the centers and project onto their orthogonal complement at every round. 10 4.2 Overview Our algorithm proceeds iteratively. At rth iteration, it finds a core Sr for one of the yet-unseen true clusters, say Tr . The main invariant we need from the core set is the following (Lemma 5.7): (i) Sr is noticeably close to Tr , say ∆(Sr , Tr ) ≤ 1 100 . (ii) All the remaining k − r true clusters, {Tr+1 , . . . , Tk }, have small overlap with Sr in the sense 1 that |Tj ∩ Sr | ≤ 100 |Tj | over all j > r. cr . For boosting to work however After having found Sr , our algorithm needs to boost Sr to S (Theorem 5.8), we need the invariant (ii) to be true for all j 6= i. We do this by (U1 , . . . , Ur ) ← U NRAVEL(S1 , . . . , Sr ). Since Ui ’s are close to Si ’s, each Tj with j < r will still be mostly overlapping with Sj (Theorem 5.6); hence Tj ’s with j < r can not overlap with Ur as Uj ’s are disjoint. cr . The only invariant we Consequently we can use Ur instead of Sr for boosting so as to obtain S cr is that it is much closer to Tr than Sr : require from S √ cr , Tr ) ≤ O( ε). ∆(S By using the centers of boosted sets instead of core sets, we can make sure that the error does not b 0 )⊥ Y (Lemma 5.5). accumulate after the projection step Z ← (Y Γ c1 , . . . , S ck ) one last time and output After k iterations, we apply U NRAVEL to all boosted sets (S the result. Remark 4.1. In Algorithms 1 and 4, the last step involves computing the top singular vector. In both cases, we have: • A good initial guess (the indicator vector), • Large separation between σ1 and σ2 . Thus, we can simply use power method for O(log 1/ε) many iterations to compute a sufficiently accurate approximation of the top right singular vector, from which we can obtain an approximation of the top left singular vector easily. It was previously shown in [GKB13] that power method is sufficient in the context of spectral clustering. 5 Analysis of the Algorithm In this section, we prove the correctness of our algorithm. Our main result is the following. Its proof is given at the end of Section 5.5. Theorem 5.1 (Restatement of Theorem 5.12). Let Γ∗ ∈ DisjV (k) with kY Γ∗ ⊥ k22 ≤ O(ε). Then b ← S PECTRAL C LUSTERING(Y ) is a k-partition so that Γ b ∈ DisjV (k), and it is O(√ε) close to both Γ∗ Γ and Y : √ √ b ⊥ k2 ≤ O( ε). b ≤ O( ε) and kY Γ ∆(Γ∗ , Γ) 2 In order to keep the analysis simple, we make no effort toward optimizing the constants. 11 Algorithm 1 Sb = B OOST(Y, S). 1. p ← top left singular vector of YS . 2. Return R OUND(Y T p). Algorithm 2 S = R OUND(q).  1. F ← {u | squ ≥ sqv } | v ∈ V, s ∈ {±1}}. 2. Return argmaxS∈F |hq, eS i|. b = S PECTRAL C LUSTERING(Y ). Algorithm 3 Γ Algorithm 4 S = F IND C LUSTER(Y ). 1. For r ← 1 to rank(Y ) do: 1. Choose δ 0 ∈ [0, 1] as the minimum for which the following returns some S. 2. For each c ∈ V : b 0 ← U NRAVEL(S c1 , S c2 , . . . , S [ Γ r−1 ). 0 ⊥ b Z ← (Y Γ ) Y . Sr ← F IND C LUSTER(Z). (U1 , ..., Ur ) ← U NRAVEL(S1 , ..., Sr ). cr ← B OOST(Y, Ur ). S b 2. Return U NRAVEL(Γ). (a) (b) (c) (d) (e) kY −Yc k kY i. S ← {π(1), . . . , π(m)}. ii. q ← top right singular vector of YS . iii. Return R OUND(q). b = U NRAVELδ (Γ) (see Figure 1 for a sample graph construction.) Algorithm 5 Γ 1. Choose δ 0 ∈ [0, 1] as the minimum for which the following returns a matching. 2. Construct a bipartite graph H = (L, R, E), where left side L is V : (a) For all S ∈ Γ, there is a block BS of d(1 − δ)|S|e identical nodes in R. (b) For all S ∈ Γ and u ∈ S, there is an edge between u and all nodes in BS . 3. Find a matching that covers R. b ... | S ∈ Γ). 4. For all S ∈ Γ, Sb ← nodes matched to the block BS . Return (S, Input Γ = {S1 , S2 , S3 , S4 }. Bipartite Graph. Figure 1 The graph constructed by U NRAVEL on input S1 = {a, b, c, e}, S2 = {d, e, f, g}, S3 = {g, h, i, j, k}, S4 = {k} for δ = 14 . 5.1 −Yc k π(i) π(i+1) (a) π be an ordering st kY k ≤ kYπ(i+1) k . π(i) n P o 2 0 (b) m ← min j i≤j kYπ(i) k ≥ 1 − δ . P (c) If j≤m kYπ(j) − Yc k2 ≤ δ 0 , then: Preliminaries In the following proposition, we show that for any pair of symmetric matrices that are close to each other in spectral norm, if there is a gap between the largest and second largest eigenvalues; then the largest eigenvectors of both matrices will be very close to each other. This can also be obtained using Wedin’s theorem [SS90], but we chose to give a simple and self-contained proof. 12 Proposition 5.2. Given A, B ∈ Sn with maximum eigenvectors p, q ∈ Rn : hp, qi2 ≥ 1 − 2kA − Bk2 . σ1 (A) − σ2 (A) def def Proof. Suppose kpk = kqk = 1. Let δ = kA − Bk2 and θ = hp, qi2 . We have σ1 (A) =pT Ap ≤ δ + σ1 (B)hq, pi2 + σ2 (B)kp⊥ qk2 ≤δ + (σ1 (A) + δ)θ + (σ2 (A) + δ)(1 − θ) =δ + θ(σ1 − σ2 ) + (σ2 + 2δ). Hence θ ≥ σ1 −σ2 −2δ σ1 −σ2 . The main tool we use to identify the clusters will be the eigenvalues of principal minors of the Gram matrix, Y T Y . Basically, eigenvalues measure how much true clusters, T , overlap with given principal minor. We make this connection formal in the following claim:  Claim 5.3. Given Y ∈ Rm×n , Γ ∈ DisjV (r) and subset S ⊆ V , let ρ = |S ∩ T |/|T | T ∈ Γ . Then for any i: |σi2 (YS ) − (ρ)↓i | ≤ kY T Y − ΓΠ k2 . Here (ρ)↓i is the ith largest element of ρ. Proof. We have kY T Y − Γ∗ Π k2 ≥ kYST YS − (Γ∗ Π )S,S k2 . Observe that the eigenvectors of (Γ∗ Π )S,S 0 are eT 0 ∩S with corresponding eigenvalue |T|T∩S| over all T 0 ∈ Γ∗ . Thus ρ’s are the eigenvalues of 0| (Γ∗ Π )S,S . Consider a principal minor corresponding to some S whose largest eigenvalue is large, and second largest eigenvalue is small. The previous claim implies that there is a unique optimal cluster T which is almost contained by S. However this is still not sufficient: S might be much larger than T . In the next lemma, we show that, one can take the top right singular vector of YS and round (threshold) it to obtain another subset Sb ⊆ S which is now very close to T . Lemma 5.4 (Initial Guess). Given Y ∈ Rm×n , Γ∗ ∈ DisjV (r) with kY T Y − Γ∗ Π k2 ≤ δ, and subset def def S ⊆ V , let q ∈ RS be the top right singular vector of YS . If we define σ1 = σ12 (YS ) and σ2 = σ22 (YS ), then the subset Sb ⊆ S obtained by: Sb ← R OUND(q) satisfies the following. For T being argmaxT ∈Γ∗ |S∩T | |T | :  b p |T ∩ S| 4δ  q ≥ σ1 − δ 1 − σ1 − σ2 b |T ||S| and b ≤ (σ2 + δ)|T 0 |. ∀T 0 6= T ∈ Γ∗ : |T 0 ∩ S| 13 def def Proof. We will use σ1 = σ12 (YS ), σ2 = σ22 (YS ) and ∆ = σ1 − σ2 . Since q is the top right singular vector of YS , kYS qk2 = σ1 and kqk = 1. |S∩T | |S∩T 0 | 0 By Claim 5.3, |T|T∩S| | − σ1 ≤ δ, which implies |T | ≥ σ1 − δ. For any T 6= T , |T 0 | ≤ σ2 + δ. Via Proposition 5.2, we see that: hq, eT ∩S i2 ≥ 1 − 2δ 2δ 2δ ≥1− =⇒ hq, eSbi2 ≥ 1 − . σ1 − σ2 ∆ ∆ Provided that δ ≤ 14 ∆, both hq, eT ∩S i and hq, eSbi have the same sign. Therefore: heT ∩S , eSbi ≥ hq, eT ∩S ihq, eSbi − kq ⊥ eT ∩S kkq ⊥ eSbk ≥ 1 − 4δ . ∆ b ≤ (α + δ)|T 0 | and Consequently, using the fact Sb ⊆ S, we see that any T 0 6= T has |T 0 ∩ S| b T ∩ S ∩ Sb = T ∩ S: b b |T ∩ S| 1 |T ∩ S| 4δ q ≤q ≤√ . 1− ∆ σ − δ 1 b b |T ∩ S||S| |T ||S| After we found new clusters, we iterate by projecting Y onto the orthogonal complement of their center. In the following lemma, we prove that, as long as the clusters were close to optimal ones, the projection preserves remaining clusters. Lemma 5.5. Given Y : Y T ∈ Sk (Rn ) and Γ ∈ DisjV (r) with the cluster centers in Γ being linearly independent, suppose there exists Γ∗ ∈ DisjV (k) of the form Γ∗ = Γ0∗ ]Γ00∗ : Γ0∗ ∈ DisjV (r), Γ00∗ ∈ DisjV (k−r) such that: • kΓ − Γ∗ 0 k22 ≤ α. • kY Γ∗ ⊥ k22 ≤ ε. def Then Γ00∗ is a good spectral clustering for Z = (Y Γ)⊥ Y , in the sense that kZ(Γ∗ 00 )⊥ k22 ≤ ε + α. In addition, σ1 (Z) = . . . = σk−r (Z) = 1, σk−r+1 (Z) = 0. Proof. Note that Z has all singular values either 0 or 1: ZZ T = (Y Γ)⊥ Y Y T (Y Γ)⊥ = (Y Γ)⊥ . Moreover (Y Γ)⊥ has rank rank(Y ) − rank(Y Γ) = k − r. Since spectral clustering is invariant under change of basis, we can assume Z ∈ R(k−r)×n so that all singular values of Z are 1. This means Z is orthonormal. It is obtained from Y by a linear transformation, therefore Γ∗ is a good spectral clustering for Z also: ε ≥kY Γ∗ ⊥ Y T k2 ≥ kZΓ∗ ⊥ Z T k2 =kZZ T − (ZΓ∗ )(ZΓ∗ )T k2 =kIk−r − (ZΓ∗ )(ZΓ∗ )T k2 . 14 In other words,   (1 − ε)Ik−r ZΓ∗ Π Z T = Z (Γ∗ 0 )Π + (Γ∗ 00 )Π Z T =⇒ εIk−r Z(Γ∗ 00 )⊥ Z T − Z T Γ∗ Π Z T . Now we will upper bound kZ(Γ∗ 0 )Π Z T k2 = kZΓ∗ 0 k2 = k(Y Γ)⊥ (Y Γ∗ 0 )k2 by a simple CauchySchwarz: k(Y Γ)⊥ (Y Γ∗ 0 )k22 =k(Y Γ)⊥ (Y Γ∗ 0 ) − (Y Γ)⊥ (Y Γ)k22 =k(Y Γ)⊥ Y (Γ∗ 0 − Γ)k22 ≤k(Y Γ)⊥ Y k22 kΓ∗ 0 − Γk22 ≤kY k22 kΓ∗ 0 − Γk22 ≤ kΓ∗ 0 − Γk22 ≤ α. As a consequence, kZ(Γ∗ 00 )⊥ k22 ≤ ε + kZΓ∗ 0 k22 ≤ ε + α. Now we will start with the proof of correctness for our unraveling procedure. 5.2 Correctness of U NRAVEL (Algorithm 5) We will now prove that if the input of U NRAVEL(Γ) (Algorithm 5) is a list of (possibly overlapping) sets which are close to some k-partition (ground truth), then the output will be a list of k disjoint sets which are also close to the ground truth. Our algorithm is based on formulating this as a simple maximum bipartite matching problem. Lemma 5.6. Given Γ ∈ SetV (k), if there exists Γ∗ ∈ DisjV (k) which is δ-close to Γ, then U NRAVEL(Γ) (Alb ∈ DisjV (k) such that: gorithm 5) will output Γ b with U ⊆ S and |U | ≥ (1 − δ)|S|. • For each S ∈ Γ, there exists U ∈ Γ b is 4δ-close to Γ∗ . • Γ Proof. It is easy to see that if all blocks are matched, then the resulting assignment is a collection of k-disjoint subsets so it has the first property. For the second property, consider any S ∈ Γ with b and T ∈ Γ∗ . corresponding subsets U ∈ Γ |U | |S \ U | |S ∩ U |2 =1− = ≤ δ. |S||U | |S| |S| p p p √ b is 4δ-close to Γ∗ . Hence ∆(U, T ) ≤ ∆(U, S) + ∆(S, T ) ≤ 2 δ. This implies Γ Now we will prove that if δ-close Γ∗ ∈ DisjV (k) exists, then there is always a matching of all blocks. Suppose π : Γ ↔ Γ∗ is a matching which minimizes maxS ∆(S, π(S)). Then: ∆(U, S) = 1 − |S ∩ π(S)|2 ≥ (1 − δ)|S||π(S)| =⇒ |S ∩ π(S)| ≥ (1 − δ)|S|. By Hall’s theorem, we have to show that for any set of right nodes, B ⊆ R, B’s neighbors on the left, N (B), are more than B: |N (B)| ≥ |B|. Observe that if B contains some nodes of block BS , then adding the whole block BS to B does not increase |N (B)|, because all nodes in BS have the 15 same set of neighbors. Hence the only subsets we need to consider are of the form B = ∪S∈A BS over all A ⊆ Γ: |N (B)| = ∪S∈A S ≥ ∪S∈A (S ∩ π(S)) X X = |S ∩ π(S)| ≥ (1 − δ) |S| = |B|. S∈A 5.3 S Correctness of F IND C LUSTER (Algorithm 4) Here we prove that, given an orthonormal basis Y , if it is close to a k-partition up to rotation, then F IND C LUSTER(Y ) (Algorithm 4) will output a set which is close to one of the clusters in this k-partition. Lemma 5.7. Given Y ∈ Rm×n , whose singular values are 0 or 1, if there exists Γ∗ ∈ DisjV (k) with kY T Y − Γ∗ Π k22 ≤ δ for some small enough constant δ, then F IND C LUSTER(Y ) (Algorithm 4) will output S 0 ⊆ V such that: √ • There exists T ∈ Γ∗ with ∆(S 0 , T ) ≤ O( δ), √ • Any T 0 6= T : T 0 ∈ Γ∗ has |T 0 ∩ S 0 | ≤ O( δ)|T 0 |. Proof. kY T Y − Γ∗ Π k22 ≤ δ implies σk (Y ) = 1 and σk+1 (Y ) = 0. Therefore kY Γ∗ ⊥ k2F ≤ δk. In other words, X X (1 − kY eT k22 ) ≤ δk. (kYT k2F − kY eT k22 ) = T ∈Γ∗ T ∈Γ∗ So: X h i max(1, kYT k2F ) − kY eT k22 ≤ 2δk. T ∈Γ∗ As a consequence, there exists T ∈ Γ∗ and some c ∈ T such that: kYT k2F ≥ kY eT k22 ≥ 1 − 2δ. 4δ ≥ 1 |T | X kYu − Yv k22 ≥ u∈T,v∈T X kYu − Yc k2 . u∈T  kYu − Yc k2 4δ ≥ Eu∼kYu k2 . 1 − 2δ kYu k2  def kYu −Yc k2 kYu k2 Let’s define ρu = and sort the nodes in ascending order so that ρ1 ≤ ρ2 ≤ . . . ≤ ρn :   Eu∼kYu k2 ρu ≤ 4δ ≤ 9δ 1 − 2δ provided δ ≤ 14 . √ √ By a simple Markov inequality, sum of all kYuP k2 over u ∈ T with ρu √ ≤ 3 δ is atP least 1 − 3 δ. Consequently, the smallest integer m for which 1≤u≤m kYu k2 ≥ 1 − 3 δ satisfies 1≤u≤m kYu − √ Yc k2 ≤ 3 δ. 16 √ From now on, we assume S is a subset and δ 0 : δ 0 ≤ 3 δ with: X X kYS k2F = σj2 (YS ) ≥ 1 − δ 0 and δ 0 ≥ kYu − Yc k2 . j u∈S Recall that variance is lower bounded by sum of the squares of all but largest singular values: X X σj2 (YS ). kYu − Yc k2 ≥ kYS k2F − σ12 (YS ) = j≥2 u∈S Hence σ12 (YS ) ≥ 1 − 2δ 0 and σ22 (YS ) ≤ δ 0 . Provided that δ ≤  (σ1 − δ) 1 − 1 100 , which implies δ 0 ≤ 3 10 : √ 4δ  ≥ 1 − 8 δ. σ1 − σ2 For such S, Lemma 5.4 tells us that the new subset Sb ⊆ S obtained by rounding the top right def singular vector of YS satisfies, for T = argmaxT ∈Γ∗   √ b T ) ≤ 1 − (σ1 − δ) 1 − 4δ • ∆(S, σ1 −σ2 ≤ 8 δ. |S∩T | |T | : √ b ≤ 4 δ|T 0 |. • For any T 0 6= T ∈ Γ∗ , |T 0 ∩ S| 5.4 Correctness of B OOST (Algorithm 1) As we mentioned earlier, if we keep finding clusters and removing them iteratively, the error will quickly accumulate and degrade the quality of remaining clusters. To prevent this, we apply a boosting procedure as described in Sb ← B OOST(Y, S) (Algorithm 1) every time we find a new cluster. The main idea is that, if S is close to some cluster in ground truth, say T , and far from others; then the top left singular vector, say p, of the vectors associated with S will be close to the ones S ∩ T . Unfortunately, we can not use simple perturbation bounds such as Wedin’s theorem. We have to make full use of eq. (5) instead: Under projection by p, the vectors of T tend to stay together; therefore vectors in T \ S will be very close to the vectors in S ∩ T . Hence indeed p will be close most of T \ S in addition to S ∩ T . Theorem 5.8 (Boosting). Given Y ∈ Sk (Rn ) and Γ∗ ∈ DisjV (k) with kY Γ∗ ⊥ k22 ≤ ε, consider any subset S ⊆ V . Suppose there exists T ∈ Γ∗ with |S ∩ T | ≥ (1 − α)|T | such that for any T 0 6= T ∈ Γ∗ , |S ∩ T 0 | ≤ α|T 0 | for some α ≤ 41 . Then for Sb ← B OOST(Y, S) (Algorithm 1), Sb satisfies: √ b T ) ≤ c0 ε ∆(S, for some constant c0 ≤ 50. Remark 5.9. Note that Theorem 5.8 allows us to convert a subset with non-negligible overlap into a subset which is very close. Unfortunately, the new subset we obtain is no longer guaranteed to have small intersection with other T 0 6= T . 17 def of Theorem 5.8. By Lemma 2.10, for δ = √ ε: kY T Y − Γ∗ Π k2 ≤ δ. def We will use σ1 = σ12 (YS ) and σ2 = σ22 (YS ). By Claim 5.3, σ1 − |S ∩ T |/|T | ≤ δ and σ2 ≤ β + δ. def Since p is the left top singular vector of YS , kYST pk2 = σ1 . We define q = Y T p so that kqS k2 = σ1 : kqS k2 δ ≥1 − |S ∩ T |/|T | |S ∩ T |/|T | δ 4δ ≥1 − ≥1− . 1−α 3 (9) Since σ1 ((Γ∗ Π )S,S ) − σ2 ((Γ∗ Π )S,S ) ≥ 1 − 2α, Proposition 5.2 implies:  heT ∩S , qi2 ≥ kqS k2 1 −   2δ  ≥ kqS k2 1 − 4δ . 1 − 2α def Let’s use µA to denote the mean of p on subset A, µA = heA , qi. We will assume, without loss of √ generality, µS∩T ≥ 0. Hence µS∩T ≥ √kqS k 1 − 4δ. On the other hand, |S∩T | ε ≥pT Y Γ∗ ⊥ Y T p = q T Γ∗ ⊥ q X 1 ≥ (qi − qj )2 ≥ |S ∩ T |(µS∩T − µT )2 . |T | {i,j}∈(T2 ) r ε µT ≥µS∩T − . |S ∩ T | s p ε|T | heT , qi ≥ |T |µS∩T − |S ∩ T | s √ √  |T |  ≥ kqS k 1 − 4δ − ε . |S ∩ T | Using eq. (9), we can lower bound this quantity as: r  r ε 4δ  ≥ 1− 1 − 4δ − 3 1−α r 4ε 26 ≥1 − 4δ − ≥ 1 − δ. 3 5 Since kqk = kY T pk ≤ 1, we have ∆(p, T ) ≤ 1 − heT , qi2 ≤ 11δ. Using Proposition 5.10, we see that Sb ← R OUND(q) satisfies: √ b T ) ≤ 4∆(q, T ) ≤ 44δ = 44 ε. ∆(S, 18 5.5 Correctness of R OUND (Algorithm 2) Possibly the simplest case for our problem is when Y is 1-dimensional, i.e. it is a vector. As we argued in the introduction, our algorithm boils down to simple thresholding in this case. Proposition 5.10. Given q 6= 0 ∈ Rn , for any T 6= ∅, S ← R OUND(q) (Algorithm 2) satisfies ∆(S, T ) ≤ 4∆(q, T ). def Proof. Let ε = ∆(q, T ). Without loss of generality, we may assume q1 ≥ . . . ≥ qm > 0 ≥ . . . ≥ qn , kqk = 1 and hq, eT i ≥ 0. We have: P √ hq, eT i j≤|T | qj 1−ε≤ p ≤ p |T | |T | P P j≤|S 0 | qj j≤|S| qj p p ≤ max ≤ ≤ |hq, eS i|. S0 |S 0 | |S| p p p √ So ∆(S, q) ≤ ε and ∆(S, T ) ≤ ∆(S, q) + ∆(q, T ) ≤ 2 ε. 5.6 Correctness of S PECTRAL C LUSTERING (Algorithm 3) Finally, we put everything together and prove the correctness of S PECTRAL C LUSTERING(Y ) (Algorithm 3). In the following lemma, we will show that the algorithm will iteratively find sets S1 , S2 , . . . (think of them as coarse approximations of Ti ’s) and Sb1 , Sb2 , . . . (think of them as fine approximations of Ti ’s) such that at each iteration, each Si and Sbi will correspond to a unique Ti . Moreover, each Si will have very small overlap with remaining Tj ’s coming after themselves. Even though Si ’s might still have large overlap with previous Tj ’s for j < i, we can easily use U NRAVEL(Γ) (Algorithm 5) to rectify this issue. Lemma 5.11. Let Γ∗ ∈ DisjV (k) with kY Γ∗ ⊥ k22 ≤ ε for some ε ≤ ε0 , where ε0 ∈ (0, 1) is a conb = (S c1 , . . . , S cr ) as found by stant. For any r ∈ [k], consider the sequences Γ = (S1 , . . . , Sr ) and Γ S PECTRAL C LUSTERING(Y ) at the start of rth iteration. Then there exists an ordering of Γ∗ : Γ∗ = (T1 , T2 , . . . , Tr , Tr+1 , . . . , Tk ), | {z } | {z } def 0 = Γ∗ with the following properties for some α ≤ 1 16 def 00 = Γ∗ and β ≤ 100: (a) For every i ≤ r: • ∆(Si , Ti ) ≤ α. • For all j > i, |Tj ∩ Si | ≤ α|Tj |. √ (b) For every i ≤ r, ∆(Sbi , Ti ) ≤ β ε. Proof. By induction on r. For r = 0, (a) and (b) are trivially true. Given r, suppose (a) and (b) are true with (T1 , . . . , Tk ), Γ0∗ and Γ00∗ being as described. 19 b = (S c1 , . . . , S cr ). (b) means At the beginning of (r + 1)st iteration, we have Γ = (S1 , . . . , Sr ) and Γ √ 0 b Γ is β ε-close to Γ∗ . b 0 ← U NRAVEL(Γ), b by Lemma 5.6, Γ b 0 is 4β √ε-close to Γ∗ and Γ b 0 ∈ DisjV (r). Using After Γ √ b 0 − Γ∗ 0 k2 ≤ 8β ε. Now we can invoke Lemma 5.5, which implies: Theorem 2.8, we see that kΓ 2 √ √ kZ(Γ∗ 00 )⊥ k22 ≤ ε + 8β ε ≤ 9β ε. √ Provided 9β ε ≤ δ0 for some small enough constant δ0 , we can use Lemma 5.7 to see that the subset Sr+1 ← F IND C LUSTER(Z) satisfies ∆(Sr+1 , T ) ≤ α, and ∀T 0 ∈ Γ00∗ : T 0 6= T =⇒ |T 0 ∩ Sr+1 | ≤ α|T 0 |. We reorder (Tr+1 , . . . , Tk ) so that Tr+1 = T . Then (a) holds true when i = r + 1. Since T1 , . . . , Tr remain the same, (a) is true for all i ≤ r + 1. Consider (U1 , . . . , Ur+1 ) ← U NRAVEL(Γ). By Lemma 5.6, we know that ∆(Ui , Ti ) ≤ 4α and Ui ⊆ Si , |Ui | ≥ (1 − α)|Si | for each i ∈ [r + 1]. In particular, for all i ≤ r + 1: |Ui ∩ Ti | ≥ (1 − 4α)|Ti |. Ur+1 being a subset of Sr+1 means |Ur+1 ∩ Tj | ≤ |Sr+1 ∩ Tj | ≤ α|Tj | whenever j > r + 1. Now we will prove the case of j ≤ r. Using the fact that U ’s are disjoint, for any j ≤ r: |Ur+1 ∩ Tj | ≤ |Tj | − |Tj ∩ Uj | ≤ |Tj | − (1 − 4α)|Tj | = 4α|Tj |. Consequently, for any j 6= r + 1: |Ur+1 ∩ Tj | ≤ 4α|Tj |. [ After executing S r+1 ← B OOST (Y, Ur+1 ), noting α ≤ 1 16 , we see via Theorem 5.8: √ √ [ ∆(S r+1 , Tr+1 ) ≤ c0 ε = β ε. Combined with the fact that Sbi and Ti remain the same for i ≤ r, (b) also remains true for all i ≤ r + 1. By induction, we now see that both (a) and (b) are true for all r ≤ k. b ← S PECTRAL C LUSTERING(Y ) is a Theorem 5.12. Let Γ∗ ∈ DisjV (k) with kY Γ∗ ⊥ k22 ≤ O(ε). Then Γ √ b ∈ DisjV (k), and it is O( ε) close to both Γ∗ and Y : k-partition so that Γ √ √ b ⊥ k2 ≤ O( ε). b ≤ O( ε) and kY Γ ∆(Γ∗ , Γ) 2 b b = (S c1 , . . . , S ck ) is β √ε-close to Γ∗ . Lemma 5.6 implies that U NRAVEL(Γ) Proof. By Lemma 5.11, Γ √ outputs a disjoint collection of k-subsets which is 4β ε-close to Γ∗ . For the second bound: 1 b⊥ 2 b ⊥ k2 + kY Γ∗ Π Γ b ⊥ k2 kY Γ k2 ≤kY Γ∗ ⊥ Γ 2 2 2 b ⊥ k2 + kY Γ∗ k2 · kΓ∗ T Γ b ⊥ k2 ≤kY Γ∗ ⊥ k22 · kΓ 2 2 2 √ T b⊥ 2 b ≤ε + kΓ∗ Γ k ≤ ε + 2∆(Γ∗ , Γ) ≤ O( ε). 2 In the second to last inequality, we used Theorem 2.8. 20 6 Applications In this section, we will show some applications of our spectral clustering algorithm. 6.1 k- EXPANSION Our first application is approximating non-expanding k-partitions in graphs. One may also interpret this as applying our subspace rounding algorithm on the basic SDP relaxation for k- EXPANSION problem. Theorem 6.1. Given a graph G with Laplacian matrix L, let Γ be the k-partition obtained by running Algorithm 3 on the smallest k eigenvectors of L. Then: s ! φk ∆(Γ, Γ∗ ) ≤ O . λk+1 Remark 6.2 (Faster Algorithm). By slightly modifying our algorithm to take advantage of the underlying graph structure, one can obtain a faster randomized algorithm having the same guarantees with Theorem 6.1 with expected running time O(k 2 (n + m)). Proof. From Lemma 2.13, we know that φk ≤ σmax (Γ∗ T LΓ∗ ) ≤ 2φk . Now consider the matrix Z = Y T , whose columns are the smallest k eigenvectors of L. We have L  λk+1 Z ⊥ which means: λk+1 · Γ∗ T Z ⊥ Γ∗  Γ∗ T LΓ∗  2φIk . This implies O(ε) ≥ kΓ∗ T Z ⊥ Γ∗ k2 = kIk − Γ∗ T ZZ T Γ∗ k2 . p Thus σk (Z T Γ∗ ) = σmin (Z T Γ∗ ) ≥ 1 − O(ε) and: kY Γ∗ ⊥ k22 =kZ T Γ∗ ⊥ Zk2 = kIk − Z T Γ∗ Γ∗ T Zk2 =1 − σmin (Γ∗ T Z) ≤ O(ε). The claim follows from Theorem 5.12. 6.2 Matrix and Graph Approximations Our next application is for approximating a matrix in terms of k-block diagonal matrices corresponding to the adjacency matrices of normalized cliques, under spectral norm. def Theorem 6.3. Given a matrix X ∈ Sn , let ε = minΓ∗ ∈DisjV (k) kX − Γ∗ Π k2 . In polynomial time, we can √ find Γ ∈ DisjV (k) such that ∆(Γ∗ , Γ) ≤ O( ε) and:  kX − ΓΠ k2 ≤ O ε1/4 . Proof. Let Y be the matrix whose Consider Γ ← S PECTRAL C LUSTERING(Y ): rows are the top kY T Y − Xk2 ≤ kX − Γ∗ Γ∗ T k2 ≤ ε 21 k eigenvectors of X. which means kY T Y − Γ∗ Γ∗ T k2 ≤ 2ε =⇒ kY Γ∗ ⊥ k22 ≤ 2ε. √ √ By Theorem 5.12, ∆(Γ∗ , Γ) ≤ O( ε) and kY Γ⊥ k22 ≤ O( ε): kΓΓT − Xk2 ≤ ε + kΓ∗ Γ∗ T − ΓΓT k2 ≤ O(ε1/4 ). Our final application is for approximating a graph Laplacian via another Laplacian corresponding to the graph formed as a disjoint union of k normalized cliques (expanders), again under spectral norm. Since we are working with Laplacian matrices, this means the new graph approximates cuts of the original graph also. Corollary 6.4. Given a graph G, if there exists Γ∗ ∈ DisjV (k) such that Laplacian of G is ε-close (in spectral norm) to the Laplacian corresponding to the disjoint union of normalized cliques on each T ∈ Γ∗ : kL − Γ∗ ⊥ k2 ≤ ε, √  then we can find Γ ∈ DisjV (k) which is O ε -close to Γ∗ and G in polynomial time: L − Γ⊥ k2 ≤ O(ε1/4 ). Proof. Since kL − Γ∗ ⊥ k2 = k(I − L) − Γ∗ Π k2 , we can apply Theorem 6.3 on the matrix I − L. The rest follows easily. 7 k- EXPANSION Implies Spectral Clustering In this section, we will show that approximation algorithms for various graph partitioning problems imply similar approximation guarantees for our clustering problem. def Theorem 7.1. Given Y : Y T ∈ Sk (Rn ), let Γ∗ = argminΓ kY Γ⊥ k22 with ε = kY Γ∗ ⊥ k22 . Then there exists a weighted, undirected, regular graph X, whose normalized Laplacian matrix has its (k + 1)st smallest √ eigenvalue λk+1 is at least λk+1 ≥ 1 − O( ε) such that: • Each T ∈ Γ∗ has small expansion, φX (T ) ≤ O(ε), • If Γ ∈ DisjV (k) is a k-partition with maxS∈Γ φX (S) ≤ δ, then ∆(Γ, Γ∗ ) ≤ O(δ + √ ε). Moreover such X can be constructed in polynomial time. Proof. Consider the following SDP. Here we chose ε ∈ [0, 1] to be the minimum value where this SDP remains feasible: √ (i) X  Y Π + εY ⊥ . (ii) Y XY T  (1 − ε)Ik , (iii) X is doubly stochastic, diagonally dominant, PSD and has trace k. 22 It is easy to see that Γ∗ Π is a feasible solution (Lemma 2.10). Moreover any feasible solution X corresponds to the adjacency matrix of a graph which is undirected and has all degrees equal to 1. Now we will show that it has the other properties: √ √ • λk+1 = 1 − σk+1 (X) ≥ 1 − σk+1 (Y Π + εY ⊥ ) = 1 − ε. • maxT φX (T ) ≤ 2kΓ∗ T (I − X)Γ∗ k2 ≤ O(kY T (I − X)Y k2 ) + ε ≤ O(ε). • Recall maxS φX (S) ≥ 12 kΓT (I − X)Γk2 so σk (Y T Γ) ≥ 1 − O(δ + ε). In particular σk (Γ∗ T Γ) ≥ √ √ 1 − O( ε + δ). Using Theorem 2.8, we have ∆(Γ, Γ∗ ) ≤ O( ε + δ). 8 8.1 Omitted Proofs Proof of Theorem 2.8 b 2 ≤ 2∆(Γ, Γ). b ∈ DisjV (k); ∆(Γ, Γ) b ≤ kΓ⊥ Γk b Theorem 8.1 (Restatement of Theorem 2.8). Given Γ, Γ 2 2 b kΓ − Γk b ≤ 4∆(Γ, Γ). b Moreover, after appropriately ordering the columns of Γ, 2 b T Γ⊥ Γk b 2 is Upper Bound. Recall that Γ⊥ is a Laplacian matrix. From Lemma 2.13, we see that kΓ b let S be the matching set in Γ so within factor-2 of the maximum diagonal element. Given T ∈ Γ b T Γ⊥ Γ b corresponding to T is: b The diagonal element of Γ that ∆(S, T ) ≤ ∆(Γ, Γ). 2 eT T Γ⊥ eT ≤ ke⊥ S eT k = 1 − |S ∩ T |2 = ∆(S, T ) ≤ ε. |S||T | b 2 ≤ 2ε. Before proving the lower bound, we will show how this bounds kΓ − Γk b 2: Therefore kΓ⊥ Γk 2 1 b T (Γ − Γ) b = Ik − 1 (ΓT Γ b +Γ b T Γ). (Γ − Γ) 2 2 q b 2 ≤ 2ε. b 2 ≤ 1 − σmin (Γ b T Γ) = 1 − 1 − kΓ⊥ Γk So 12 kΓ − Γk 2 2 b and π2 : Γ b → Γ as the following: Lower Bound. We define π1 : Γ → Γ def ∀S ∈ Γ : π1 (S) = argmax b T ∈Γ |S ∩ T | , |T | |S ∩ T | b : π2 (T ) def ∀T ∈ Γ = argmax . |S| S∈Γ Consider M = {(S, π1 (S)) | S ∈ Γ}: By Claims 8.3 and 8.4, M is indeed a perfect matching between b Now consider any matched pair (S, T ) ∈ M . Without loss of generality, say |S| ≥ |T |. By Γ and Γ. Claim 8.2, |S ∩ T | ≥ (1 − ε)|S|. Since |S∆T | = |S| + |T | − 2|S ∩ T |: |S∆T | ≤ |S| + |T | − 2(1 − ε)|S| = 2ε|S| + (|T | − |S|) ≤ 2ε|S|. We finish our proof with Claims 8.2, 8.3 and 8.4. 23 Claim 8.2. If π1 (S) = T , then |S ∩ T | ≥ (1 − ε)|T |. Similarly, if π2 (T ) = S, then |S ∩ T | ≥ (1 − ε)|S|. bΓ b T Γ ∈ Sk so that λmin (P ) = σ 2 (ΓT Γ). b Thus λmin (P ) = Proof. Consider the matrix P = ΓT Γ + min b 2 ≥ 1 − ε. In particular, all diagonals of P are at least 1 − ε. Consider any diagonal σmin (ΓT Γ) corresponding to S ∈ Γ: X |S ∩ T |2 bΓ b T eS eTS Γ = |S| |S||T | b T ∈Γ ! |S ∩ T 0 | X |S ∩ T | ≤ max |T 0 | |S| b T 0 ∈Γ 1−ε≤ b T ∈Γ = max b T 0 ∈Γ which, by construction, is equal to T 0| |S ∩ |T 0 | , |S∩π1 (S)| |π1 (S)| . This proves the first part of the claim. The second part b and Γ. follows immediately by applying the same argument on Γ Claim 8.3. Both π1 and π2 are bijections. Proof. Suppose π1 (S) = π1 (S 0 ) = T for some S 6= S 0 . Since S, S 0 are disjoint and ε < 12 : |T | ≥ |S ∩ T | + |S 0 ∩ T | ≥ 2(1 − ε)|T | > |T |, a contradiction. A similar argument shows that π2 is a bijection as well. Claim 8.4. π1 = π2−1 . b are bijections by Claim 8.3, there exists a cycle of the form Proof. Suppose not. Since both Γ and Γ (S0 , T0 , . . . , Sm−1 , Tm−1 , Sm = S0 ) where π1 (Si ) = Ti and π2 (Ti ) = Si+1 for some m ≥ 2. By construction, |Si ∩ Ti | ≥ (1 − ε)|Ti | which means ε|Ti | ≥ |Ti \ Si |. Since Si and Si+1 are disjoint, |Ti \ Si | ≥ |Ti ∩ Si+1 |. Again, by construction, |Ti ∩ Si+1 | ≥ (1 − ε)|Si+1 |. Therefore ε|Ti | ≥ (1 − ε)|Si+1 | which implies |Ti | ≥ 1−ε ε |Si+1 | > |Si+1 | since ε < 1/2. By a similar argument, we can also show that |Si | > |Ti |. Consequently, |S0 | > |S1 | > . . . > |Sm | = |S0 | which is a contradiction. So all cycles have length 2, which implies π1 = π2−1 . Acknowledgments We thank Moses Charikar and Ravishankar Krishnaswamy for stimulating discussions about the problem. We also thank Anup Rao for pointing out that Lemma 2.10 holds with equality. 24 References [ABS10] Sanjeev Arora, Boaz Barak, and David Steurer. Subexponential algorithms for Unique Games and related problems. In 51th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada, USA, pages 563–572, 2010. [AKY99] Charles J. Alpert, Andrew B. Kahng, and So-Zen Yao. Spectral partitioning with multiple eigenvectors. Discrete Applied Mathematics, 90(1-3):3–26, 1999. [AM85] Noga Alon and V. D. Milman. λ1 , Isoperimetric inequalities for graphs, and superconcentrators. J. Comb. Theory, Ser. B, 38(1):73–88, 1985. [AS12] Pranjal Awasthi and Or Sheffet. Improved spectral-norm bounds for clustering. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques 15th International Workshop, APPROX 2012, and 16th International Workshop, RANDOM 2012, Cambridge, MA, USA, August 15-17, 2012. Proceedings, pages 37–49, 2012. [BFK+ 11] Nikhil Bansal, Uriel Feige, Robert Krauthgamer, Konstantin Makarychev, Viswanath Nagarajan, Joseph Naor, and Roy Schwartz. Min-max graph partitioning and small set expansion. In IEEE 52nd Annual Symposium on Foundations of Computer Science, FOCS 2011, Palm Springs, CA, USA, October 22-25, 2011, pages 17–26, 2011. [Bol13] Marianna Bolla. Spectral Clustering and Biclustering: Learning Large Graphs and Contingency Tables. Wiley, 2013. [BS06] Nikhil Bansal and Maxim Sviridenko. The Santa Claus problem. In Proceedings of the 38th Annual ACM Symposium on Theory of Computing, Seattle, WA, USA, May 21-23, 2006, pages 31–40, 2006. [BV08] S. Charles Brubaker and Santosh Vempala. Isotropic PCA and affine-invariant clustering. In 49th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2008, October 25-28, 2008, Philadelphia, PA, USA, pages 551–560, 2008. [DR10] Amit Deshpande and Luis Rademacher. Efficient volume sampling for row/column subset selection. In 51th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada, USA, pages 329–338, 2010. [GKB13] Alex Gittens, Prabhanjan Kambadur, and Christos Boutsidis. Spectral clustering via the power method – provably. CoRR, abs/1311.2854, 2013. [GS12] Venkatesan Guruswami and Ali Kemal Sinop. Optimal column-based low-rank matrix reconstruction. In Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2012, Kyoto, Japan, January 17-19, 2012, pages 1207–1214, 2012. [KK10] Amit Kumar and Ravindran Kannan. Clustering with spectral norm and the k-Means algorithm. In 51th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2010, October 23-26, 2010, Las Vegas, Nevada, USA, pages 299–308, 2010. 25 [KLL+ 13] Tsz Chiu Kwok, Lap Chi Lau, Yin Tat Lee, Shayan Oveis Gharan, and Luca Trevisan. Improved Cheeger’s inequality: analysis of spectral partitioning algorithms through higher order spectral gap. In Symposium on Theory of Computing Conference, STOC’13, Palo Alto, CA, USA, June 1-4, 2013, pages 11–20, 2013. [KVV04] Ravi Kannan, Santosh Vempala, and Adrian Vetta. On clusterings: Good, bad and spectral. Journal of the ACM, 51(3):497–515, 2004. [LGT14] James R. Lee, Shayan Oveis Gharan, and Luca Trevisan. Multiway spectral partitioning and higher-order Cheeger inequalities. Journal of the ACM, 61(6):37, 2014. [LM14] Anand Louis and Konstantin Makarychev. Approximation algorithm for sparsest kpartitioning. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014, pages 1244–1255, 2014. [LRTV12] Anand Louis, Prasad Raghavendra, Prasad Tetali, and Santosh Vempala. Many sparse cuts via higher eigenvalues. In Proceedings of the 44th Symposium on Theory of Computing Conference, STOC 2012, New York, NY, USA, May 19 - 22, 2012, pages 1131–1140, 2012. [NJW01] Andrew Y. Ng, Michael I. Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In Advances in Neural Information Processing Systems 14 [Neural Information Processing Systems: Natural and Synthetic, NIPS 2001, December 3-8, 2001, Vancouver, British Columbia, Canada], pages 849–856, 2001. [SM00] Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. IEEE Trans. Pattern Anal. Mach. Intell., 22(8):888–905, 2000. [SS90] G. W. Stewart and Ji-guang Sun. Matrix Perturbation Theory. Academic Press, 1990. [YS03] Stella X. Yu and Jianbo Shi. Multiclass spectral clustering. In 9th IEEE International Conference on Computer Vision (ICCV 2003), 14-17 October 2003, Nice, France, pages 313– 319, 2003. 26
8cs.DS
arXiv:1610.10023v1 [math.AC] 31 Oct 2016 QUASI-PRÜFER EXTENSIONS OF RINGS GABRIEL PICAVET AND MARTINE PICAVET-L’HERMITTE Abstract. We introduce quasi-Prüfer ring extensions, in order to relativize quasi-Prüfer domains and to take also into account some contexts in recent papers, where such extensions appear in a hidden form. An extension is quasi-Prüfer if and only if it is an INC pair. The class of these extensions has nice stability properties. We also define almost-Prüfer extensions that are quasi-Prüfer, the converse being not true. Quasi-Prüfer extensions are closely linked to finiteness properties of fibers. Applications are given for FMC extensions, because they are quasi-Prüfer. 1. Introduction and Notation We consider the category of commutative and unital rings. An epimorphism is an epimorphism of this category. Let R ⊆ S be a (ring) extension. The set of all R-subalgebras of S is denoted by [R, S]. The extension R ⊆ S is said to have FIP (for the “finitely many intermediate algebras property”) if [R, S] is finite. A chain of R-subalgebras of S is a set of elements of [R, S] that are pairwise comparable with respect to inclusion. We say that the extension R ⊆ S has FCP (for the “finite chain property”) if each chain in [R, S] is finite. Dobbs and the authors characterized FCP and FIP extensions [10]. Clearly, an extension that satisfies FIP must also satisfy FCP. An extension R ⊆ S is called FMC if there is a finite maximal chain of extensions from R to S. We begin by explaining our motivations and aims. The reader who is not familiar with the notions used will find some Scholia in the sequel, as well as necessary definitions that exist in the literature. Knebusch and Zang introduced Prüfer extensions in their book [26]. Actually, these extensions are nothing but normal pairs, that are intensively studied in the literature. We do not intend to give an extensive list of recent papers, written by Ayache, Ben Nasr, Dobbs, Jaballah, Jarboui and some others. We are indebted to these authors because their papers are a rich source of suggestions. We observed that some of them 2010 Mathematics Subject Classification. Primary:13B22; Secondary: Key words and phrases. flat epimorphism, FIP, FCP extension, minimal extension, integral extension, Morita, Prüfer hull, support of a module. 1 2 G. PICAVET AND M. PICAVET are dealing with FCP (FIP, FMC) extensions, followed by a Prüfer extension, perhaps under a hidden form. These extensions reminded us quasi-Prüfer domains (see [18]). Therefore, we introduced in [38] quasi-Prüfer extensions R ⊆ S as extensions that can be factored R ⊆ R′ ⊆ S, where the first extension is integral and the second is Prüfer. Note that FMC extensions are quasi-Prüfer. We give a systematic study of quasi-Prüfer extensions in Section 2 and Section 3. The class of quasi-Prüfer extensions has a nice behavior with respect to the classical operations of commutative algebra. An important result is that quasi-Prüfer extensions coincide with INC-pairs. Another one is that this class is stable under forming subextensions and composition. A striking result is the stability of the class of quasiPrüfer extensions by absolutely flat base change, like localizations and Henselizations. Any ring extension R ⊆ S admits a quasi-Prüfer closure, contained in S. Examples are provided by Laskerian pairs, open pairs and the pseudo-Prüfer pairs of Dobbs-Shapiro [15]. Section 4 deals with almost-Prüfer extensions, a special kind of quasiPrüfer extensions. They are of the form R ⊆ T ⊆ S, where the first extension is Prüfer and the second is integral. Any ring extension admits an almost-Prüfer closure, contained in S. The class of almostPrüfer extensions seems to have less properties than the class of quasiPrüfer extensions but has the advantage of the commutation of Prüfer closures with localizations at prime ideals. We examine the transfer of the quasi (almost)-Prüfer properties to subextensions. Section 5 study the transfer of the quasi (almost)-Prüfer properties to Nagata extensions. In section 6, we complete and generalize the results of Ayache-Dobbs in [5], with respect to the finiteness of fibers. These authors have evidently considered particular cases of quasi-Prüfer extensions. A main result is that if R ⊆ S is quasi-Prüfer with finite fibers, then so is R ⊆ T for T ∈ [R, S]. In particular, we recover a result of [5] about FMC extensions. Now Section 7 gives calculations of |[R, S]| with respect to its Prüfer closure, quasi-Prüfer (almost-Prüfer) closure in case R ⊆ S has FCP. 1.1. Recalls about some results and definitions. The reader is warned that we will mostly use the definition of Prüfer extensions by flat epimorphic subextensions investigated in [26]. The results needed may be found in Scholium A for flat epimorphic extensions and some results of [26] are summarized in Scholium B. Their powers give quick proofs of results that are generalizations of results of the literature. QUASI-PRÜFER EXTENSIONS 3 As long as FCP or FMC extensions are concerned, we use minimal (ring) extensions, a concept introduced by Ferrand-Olivier [17]. An extension R ⊂ S is called minimal if [R, S] = {R, S}. It is known that a minimal extension is either module-finite or a flat epimorphism [17] and these conditions are mutually exclusive. There are three types of integral minimal (module-finite) extensions: ramified, decomposed or inert [36, Theorem 3.3]. A minimal extension R ⊂ S admits a crucial ideal C(R, S) =: M which is maximal in R and such that RP = SP for each P 6= M, P ∈ Spec(R). Moreover, C(R, S) = (R : S) when R ⊂ S is an integral minimal extension. The key connection between the above ideas is that if R ⊆ S has FCP or FMC, then any maximal (necessarily finite) chain of R-subalgebras of S, R = R0 ⊂ R1 ⊂ · · · ⊂ Rn−1 ⊂ Rn = S, with length n < ∞, results from juxtaposing n minimal extensions Ri ⊂ Ri+1 , 0 ≤ i ≤ n − 1. Following [24], we define the length ℓ[R, S] of [R, S] as the supremum of the lengths of chains in [R, S]. In particular, if ℓ[R, S] = r, for some integer r, there exists a maximal chain in [R, S] with length r. As usual, Spec(R), Max(R), Min(R), U(R), Tot(R) are respectively the set of prime ideals, maximal ideals, minimal prime ideals, units, total ring of fractions of a ring R and κ(P ) = RP /P RP is the residual field of R at P ∈ Spec(R). If R ⊆ S is an extension, then (R : S) is its conductor and if P ∈ Spec(R), then SP is the localization SR\P . We denote the integral S closure of R in S by R (or R). A local ring is here what is called elsewhere a quasi-local ring. The support of an R-module E is SuppR (E) := {P ∈ Spec(R) | EP 6= 0} and MSuppR (E) := SuppR (E) ∩ Max(R). Finally, ⊂ denotes proper inclusion and |X| the cardinality of a set X. Scholium A We give some recalls about flat epimorphisms (see [27, Chapitre IV], except (2) which is [31, Proposition 2]). (1) R → S is a flat epimorphism ⇔ for all P ∈ Spec(R), either RP → SP is an isomorphism or S = P S ⇔ RP ⊆ SP is a flat epimorphism for all P ∈ Spec(R). (2) (S) A flat epimorphism, with a zero-dimensional domain, is surjective. (3) If f : A → B and g : B → C are ring morphisms such that g ◦ f is injective and f is a flat epimorphism, then g is injective. (4) Let R ⊆ T ⊆ S be a tower of extensions, such that R ⊆ S is a flat epimorphism. Then T ⊆ S is a flat epimorphism but R ⊆ T does not need. A Prüfer extension remedies to this defect. 4 G. PICAVET AND M. PICAVET (5) (L) A faithfully flat epimorphism is an isomorphism. Hence, R = S if R ⊆ S is an integral flat epimorphism. (6) If f : R → S is a flat epimorphism and J an ideal of S, then J = f −1 (J)S. (7) If f : R → S is an epimorphism, then f is spectrally injective and its residual extensions are isomorphisms. (8) Flat epimorphisms remain flat epimorphisms under base change (in particular, after a localization with respect to a multiplicatively closed subset). (9) Flat epimorphisms are descended by faithfully flat morphisms. 1.2. Recalls and results on Prüfer extensions. We recall some definitions and properties of ring extensions R ⊆ S and rings R. There are a lot of characterizations of Prüfer extensions. We keep only those that are useful in this paper. We give the two definitions that are dual and emphasize some characterizations in the local case. Scholium B (1) [26] R ⊆ S is called Prüfer if R ⊆ T is a flat epimorphism for each T ∈ [R, S]. (2) R ⊆ S is called a normal pair if T ⊆ S is integrally closed for each T ∈ [R, S]. (3) R ⊆ S is Prüfer if and only if it is a normal pair [26, Theorem 5.2(4)]. (4) R is called Prüfer if its finitely generated regular ideals are invertible, or equivalently, R ⊆ Tot(R) is Prüfer [20, Theorem 13((5)(9))]. Hence Prüfer extensions are a relativization of Prüfer rings. Clearly, a minimal extension is a flat epimorphism if and only if it is Prüfer. We will then use for such extensions the terminology: Prüfer minimal extensions. The reader may find some properties of Prüfer minimal extensions in [36, Proposition 3.2, Lemma 3.4 and Proposition 3.5], asserted by L. Dechene in her dissertation, but where in addition R must be supposed local. The reason why is that this word has surprisingly disappeared during the printing process of [36]. We will need the two next results. Some of them do not explicitely appear in [26] but deserve to be emphasized. We refer to [26, Definition 1, p.22] for a definition of Manis extensions. Proposition 1.1. Let R ⊆ S be a ring extension. (1) R ⊆ S is Prüfer if and only if RP ⊆ SP is Prüfer for each P ∈ Spec(R) (respectively, P ∈ Supp(S/R)). QUASI-PRÜFER EXTENSIONS 5 (2) R ⊆ S is Prüfer if and only if RM ⊆ SM is Manis for each M ∈ Max(R). Proof. (1) The class of Prüfer extensions is stable under localization [26, Proposition 5.1(ii), p.46-47]. To get the converse, use Scholium A(1). (2) follows from [26, Proposition 2.10, p.28, Definition 1, p.46].  Proposition 1.2. Let R ⊆ S be a ring extension, where R is local. (1) R ⊆ S is Manis if and only if S \ R ⊆ U(S) and x ∈ S \ R ⇒ x−1 ∈ R. In that case, R ⊆ S is integrally closed. (2) R ⊆ S is Manis if and only if R ⊆ S is Prüfer. (3) R ⊆ S is Prüfer if and only if there exists P ∈ Spec(R) such that S = RP , P = SP and R/P is a valuation domain. Under these conditions, S/P is the quotient field of R/P . Proof. (1) is [26, Theorem 2.5, p.24]. (2) is [26, Scholium 10.4, p.147]. Then (3) is [10, Theorem 6.8].  Next result shows that Prüfer FCP extensions can be described in a special manner. Proposition 1.3. Let R ⊂ S be a ring extension. (1) If R ⊂ S has FCP, then R ⊂ S is integrally closed ⇔ R ⊂ S is Prüfer ⇔ R ⊂ S is a composite of Prüfer minimal extensions. (2) If R ⊂ S is integrally closed, then R ⊂ S has FCP ⇔ R ⊂ S is Prüfer and Supp(S/R) is finite. Proof. (1) Assume that R ⊂ S has FCP. If R ⊂ S is integrally closed, then, R ⊂ S is composed of Prüfer minimal extensions by [10, Lemma 3.10]. Conversely, if R ⊂ S is composed of Prüfer minimal extensions, R ⊂ S is integrally closed, since so is each Prüfer minimal extension. A Prüfer extension is obviously integrally closed, and an FCP integrally closed extension is Prüfer by [10, Theorem 6.3]. (2) The logical equivalence is [10, Theorem 6.3].  Definition 1.4. [26] A ring extension R ⊆ S has: bS , called the (1) a greatest flat epimorphic subextension R ⊆ R Morita hull of R in S. eS , called the Prüfer hull (2) a greatest Prüfer subextension R ⊆ R of R in S. b := R bS and R e := R eS , if no confusion can occur. R ⊆ S is We set R e called Prüfer-closed if R = R. eS is denoted by P(R, S) in [26] and R bS is the weakly Note that R surjective hull M(R, S) of [26]. Our terminology is justified because 6 G. PICAVET AND M. PICAVET Morita’s work is earlier [30, Corollary 3.4]. The Morita hull can be computed by using a (transfinite) induction [30]. Let S ′ be the set of all s ∈ S such that there is some ideal I of R, such that IS = S and Is ⊆ R. Then R ⊆ S ′ is a subextension of R ⊆ S. We set S1 := S ′ and Si+1 := (Si )′ ⊆ Si . By [30, p.36], if R ⊂ S is an FCP extension, b = Sn for some integer n. then R At this stage it is interesting to point out a result; showing again that integral closedness and Prüfer extensions are closely related. Proposition 1.5. Olivier [33, Corollary, p.56] An extension R ⊆ S is integrally closed if and only if there is a pullback square: R −−−→   y S   y V −−−→ K where V is a semi-hereditary ring and K its total quotient ring. In that case V ⊆ K is a Prüfer extension, since V is a Prüfer ring, whose localizations at prime ideals are valuation domains and K is an absolutely flat ring. As there exist integrally closed extensions that are not Prüfer, we see in passing that the pullback construction may not descend Prüfer extensions. The above result has a companion for minimal extensions that are Prüfer [21, Proposition 3.2]. Proposition 1.6. Let R ⊆ S be an extension and T ∈ [R, S], then eT = R e ∩ T . Therefore, for T, U ∈ [R, S] with T ⊆ U, then R eT ⊆ R eU . R eT is the greatest Prüfer extenProof. Obvious, since the Prüfer hull R sion R ⊆ V contained in T .  e if R ⊆ S has FCP. We will show later that in some cases Te ⊆ U 2. Quasi-Prüfer extensions We introduced the following definition in [38, p.10]. Definition 2.1. An extension of rings R ⊆ S is called quasi-Prüfer if one of the following equivalent statements holds: (1) R ⊆ S is a Prüfer extension; (2) R ⊆ S can be factored R ⊆ T ⊆ S, where R ⊆ T is integral and T ⊆ S is Prüfer. In that case R = T To see that (2) ⇒ (1) observe that if (2) holds, then T ⊆ R is integral and a flat injective epimorphism, so that R = T by (L) (Scholium A(5)). QUASI-PRÜFER EXTENSIONS 7 We observe that quasi-Prüfer extensions are akin to quasi-finite extensions if we refer to Zariski Main Theorem. This will be explored in Section 6, see for example Theorem 6.2. Hence integral or Prüfer extensions are quasi-Prüfer. An extension is clearly Prüfer if and only if it is quasi-Prüfer and integrally closed. Quasi-Prüfer extensions allow us to avoid FCP hypotheses. We give some other definitions involved in ring extensions R ⊆ S. The fiber at P ∈ Spec(R) of R ⊆ S is FibR,S (P ) := {Q ∈ Spec(S) | Q ∩ R = P }. The subspace FibR,S (P ) of Spec(S) is homeomorphic to the spectrum of the fiber ring FR,S (P ) := κ(P ) ⊗R S at P . The homeomorphism is given by the spectral map of S → κ(P ) ⊗R S and κ(P ) → κ(P ) ⊗R S is the fiber morphism at P . Definition 2.2. A ring extension R ⊆ S is called: (1) incomparable if for each pair Q ⊆ Q′ of prime ideals of S, then Q ∩ R = Q′ ∩ R ⇒ Q = Q′ , or equivalently, κ(P ) ⊗R T is a zero-dimensional ring for each T ∈ [R, S] and P ∈ Spec(R), such that κ(P ) ⊗R T 6= 0. (2) an INC-pair if R ⊆ T is incomparable for each T ∈ [R, S]. (3) residually algebraic if R/(Q ∩ R) ⊆ S/Q is algebraic for each Q ∈ Spec(S). (4) a residually algebraic pair if the extension R ⊆ T is residually algebraic for each T ∈ [R, S]. The following characterization was announced in [38]. We were unaware that this result is also proved in [7, Corollary 1], when we present it in ArXiv. However, our proof is largely shorter because we use the powerful results of [26]. Theorem 2.3. An extension R ⊆ S is quasi-Prüfer if and only if R ⊆ S is an INC-pair and, if and only if, R ⊆ S is a residually algebraic pair. Proof. Suppose that R ⊆ S is quasi-Prüfer and let T ∈ [R, S]. We set U := RT . Then R ⊆ U is a flat epimorphism by definition of a Prüfer extension and hence is incomparable as is R ⊆ R . It follows that R ⊆ U is incomparable. Since T ⊆ U is integral, it has going-up. It follows that R ⊆ T is incomparable. Conversely, if R ⊆ S is an INC-pair, then so is R ⊆ S. Since R ⊆ S is integrally closed, R ⊆ S is Prüfer [26, Theorem 5.2,(9’), p.48]. The second equivalence is [14, Proposition 2.1] or [18, Theorem 6.5.6].  Corollary 2.4. An extension R ⊆ S is quasi-Prüfer if and only if R ⊆ T is Prüfer for each T ∈ [R, S]. 8 G. PICAVET AND M. PICAVET It follows that most of the properties described in [6] for integrally closed INC-pairs of domains are valid for arbitrary ring extensions. Moreover, a result of Dobbs is easily gotten: an INC-pair R ⊆ S is an integral extension if and only if R ⊆ S is spectrally surjective [14, Theorem 2.2]. This follows from Scholium A, Property (L). Example 2.5. Quasi-Prüfer domains R with quotient fields K can be characterized by R ⊆ K is quasi-Prüfer. The reader may consult [9, Theorem 1.1] or [18]. In view of [2, Theorem 2.7], R is a quasi-Prüfer domain if and only if Spec(R(X)) → Spec(R) is bijective. We give here another example of quasi-Prüfer extension. An extension R ⊂ S is called a going-down pair if each of its subextensions has the going-down property. For such a pair, R ⊆ T has incomparability for each T ∈ [R, S], at each non-maximal prime ideal of R [3, Lemma 5.8](ii). Now let M be a maximal ideal of R, whose fiber is not void in T . Then R ⊆ T is a going-down pair, and so is R/M ⊆ T /MT because MT ∩ R = M. By [3, Corollary 5.6], the dimension of T /MT is ≤ 1. Therefore, if R ⊂ S is a going-down pair, then R ⊂ S is quasi-Prüfer if and only if dim(T /MT ) 6= 1 for each T ∈ [R, S] and M ∈ Max(R). Also open-ring pairs R ⊂ S are quasi-Prüfer by [8, Proposition 2.13]. An i-pair is an extension R ⊆ S such that Spec(T ) → Spec(R) is injective for each T ∈ [R, S], or equivalently if and only if R ⊆ S is quasi-Prüfer and R ⊆ R is spectrally injective [38, Proposition 5.8]. These extensions appear frequently in the integral domains context. Another examples are given by some extensions R ⊆ S, such that Spec(S) = Spec(R) as sets, as we will see later. 3. Properties of quasi-Prüfer extensions We now develop the machinery of quasi-Prüfer extensions. Proposition 3.1. An extension R ⊂ S is (quasi-)Prüfer if and only if RP ⊆ SP is (quasi-)Prüfer for any P ∈ Spec(R) (P ∈ MSupp(S/R)). Proof. The proof is easy if we use the INC-pair property definition of quasi-Prüfer extension (see also [6, Proposition 2.4]).  Proposition 3.2. Let R ⊆ S be a quasi-Prüfer extension and ϕ : S → S ′ an integral ring morphism. Then ϕ(R) ⊆ S ′ is quasi-Prüfer and S ′ = ϕ(S)ϕ(R), where ϕ(R) is the integral closure of ϕ(R) in S ′ . Proof. It is enough to apply [26, Theorem 5.9] to the Prüfer extension R ⊆ S and to use Definition 2.1.  This result applies with S ′ := S ⊗R R′ , where R → R′ is an integral morphism. Therefore integrality ascends the quasi-Prüfer property. QUASI-PRÜFER EXTENSIONS 9 We know that a composite of Prüfer extensions is Prüfer [26, Theorem 5.6, p.51]. The following Corollary 3.3 contains [7, Theorem 3]. Corollary 3.3. Let R ⊆ T ⊆ S be a tower of extensions. Then R ⊆ S is quasi-Prüfer if and only if R ⊆ T and T ⊆ S are quasi-Prüfer. It follows that R ⊆ T is quasi-Prüfer if and only if R ⊆ RT is quasiPrüfer. Proof. Consider a tower (T ) of extensions R ⊆ R ⊆ S := R′ ⊆ R′ ⊆ S ′ (a composite of two quasi-Prüfer extensions). By using Proposition 3.2 we see that R ⊆ S = R′ ⊆ R′ is quasi-Prüfer. Then (T ) is obtained by writing on the left an integral extension and on the right a Prüfer extension. Therefore, (T ) is quasi-Prüfer. We prove the converse. If R ⊆ T ⊆ S is a tower of extensions, then R ⊆ T and T ⊆ S are INC-pairs whenever R ⊆ S is an INC-pair. The converse is then a consequence of Theorem 2.3. The last statement is [7, Corollary 4].  Using the above corollary, we can exhibit new examples of quasiPrüfer extensions. We recall that a ring R is called Laskerian if each of its ideals is a finite intersection of primary ideals and a ring extension R ⊂ S a Laskerian pair if each T ∈ [R, S] is a Laskerian ring. Then [42, Proposition 2.1] shows that if R is an integral domain with quotient field F 6= R and F ⊂ K is a field extension, then R ⊂ K is a Laskerian pair if and only if K is algebraic over R and R (in K) is a Laskerian Prüfer domain. It follows easily that R ⊂ K is quasi-Prüfer. Next result generalizes [25, Proposition 1]. Corollary 3.4. An FMC extension R ⊂ S is quasi-Prüfer. Proof. Because R ⊂ S is a composite of finitely many minimal extensions, by Corollary 3.3, it is enough to observe that a minimal extension is either Prüfer or integral.  Corollary 3.5. Let R ⊆ S be a quasi-Prüfer extension and a tower R ⊆ T ⊆ S, where R ⊆ T is integrally closed. Then R ⊆ T is Prüfer. T Proof. Observe that R ⊆ T is quasi-Prüfer and then that R = R .  Next result deals with the Dobbs-Shapiro pseudo-Prüfer extensions of integral domains [15], that they called pseudo-normal pairs. Suppose that R is local, we call here pseudo-Prüfer an extension R ⊆ S such that there exists T ∈ [R, S] with Spec(R) = Spec(T ) and T ⊆ S is Prüfer [15, Corollary 2.5]. If R is arbitrary, the extension R ⊆ S is called pseudo-Prüfer if RM ⊆ SM is pseudo-Prüfer for each M ∈ Max(R). In view of the Corollary 3.3, it is enough to characterize quasi-Prüfer extensions of the type R ⊆ T with Spec(R) = Spec(T ). 10 G. PICAVET AND M. PICAVET Corollary 3.6. Let R ⊆ T be an extension with Spec(R) = Spec(T ) and (R, M) local. Then R ⊆ T is quasi-Prüfer if and only if Spec(R) = Spec(U) for each U ∈ [R, T ] and, if and only if R/M ⊆ T /M is an algebraic field extension. In such a case, R ⊆ T is Prüfer-closed. Proof. It follows from [1] that M ∈ Max(T ). Part of the proof is gotten by observing that R ⊆ U is an INC extension if Spec(R) = Spec(U). e is a spectrally Another one is proved in [1, Corollary 3.26]. Now R ⊆ R e surjective flat epimorphism and then, by Scholium A, R = R.  Let R ⊆ S be an extension and I an ideal shared with R and S. It is easy to show that R ⊆ S is quasi-Prüfer if and only if R/I ⊆ S/I is quasi-Prüfer by using [26, Proposition 5.8] in the Prüfer case. We are able to give a more general statement. Lemma 3.7. Let R ⊆ S be a (quasi-)Prüfer extension and J an ideal of S with I = J ∩ R. Then R/I ⊆ S/J is a (quasi-)Prüfer extension. If R ⊆ S is Prüfer and N is a maximal ideal of S, then R/(N ∩ R) is a valuation domain with quotient field S/N. Proof. Assume first that R ⊆ S is Prüfer. We have J = IS by Scholium A(6), because R ⊆ S is a flat epimorpism. Therefore, any D ∈ [R/I, S/J] is of the form C/J where C ∈ [R, S]. We can write C/IS = (C + I)/IS ∼ = C/C ∩ IS. As R ⊆ C is a flat epimorphism, C ∩ IS = IC. It then follows that D = C ⊗ R/I and we get easily that R/I ⊆ S/J is Prüfer, since R/I ⊆ D is a flat epimorphism. The quasi-Prüfer case is an easy consequence.  With this lemma we generalize and complete [23, Proposition 1.1]. Proposition 3.8. Let R ⊆ S be an extension of rings. The following statements are equivalent: (1) R ⊆ S is quasi-Prüfer; (2) R/(Q ∩ R) ⊆ S/Q is quasi-Prüfer for each Q ∈ Spec(S) ; (3) (X − s)S[X] ∩ R[X] 6⊆ M[X] for each s ∈ S and M ∈ Max(R); (4) For each T ∈ [R, S], the fiber morphisms of R ⊆ T are integral. Proof. (1) ⇒ (2) is entailed by Lemma 3.7. Assume that (2) holds and let M ∈ Max(R) that contains a minimal prime ideal P , lain over by a minimal prime ideal Q of S. Then (2) ⇒ (3) follows from [23, Proposition 1.1(1)], applied to R/(Q ∩ R) ⊆ S/Q. If (3) holds, argue as in the paragraph before [23, Proposition 1.1] to get that R ⊆ S is a Pextension, whence an INC-extension by [14, Proposition 2.1]. Because integral extensions have incomparability, we see that (4) ⇒ (1). Corollary 3.3 shows that the reverse implication holds, if any quasi-Prüfer QUASI-PRÜFER EXTENSIONS 11 extension R ⊆ S has integral fiber morphisms. For P ∈ Spec(R), the extension RP /P RP ⊆ SP /P SP is quasi-Prüfer by Lemma 3.7. The ring RP /P RP is zero-dimensional and RP /P RP → SP /P SP , being a flat epimorphism, is therefore surjective by Scholium A (S). It follows that the fiber morphism at P is integral.  Remark 3.9. The logical equivalence (1) ⇔ (2) is still valid if we replace quasi-Prüfer with integral in the above proposition. It is enough to show that an extension R ⊆ S is integral when R/P ⊆ S/Q is integral for each Q ∈ Spec(S) and P := Q ∩ R. We can suppose that S = R[s] ∼ = R[X]/I, where X is an indeterminate, I an ideal of R[X] and Q varies in Min(S), because for an extension A ⊆ B, any element of Min(A) is lain over by some element of Min(B). If Σ is the set of unitary polynomials of R[X], the assumptions show that any element of Spec(R[X]), containing I, meets Σ. As Σ is a multiplicatively closed subset, I ∩ Σ 6= ∅, whence s is integral over R. But a similar result does not hold if we replace quasi-Prüfer with Prüfer, except if we suppose that R ⊆ S is integrally closed. To see this, apply the above proposition to get a quasi-Prüfer extension R ⊆ S if each R/P ⊆ S/Q is Prüfer. Actually, this situation already occurs for Prüfer rings and their factor domains, as Lucas’s paper [29] shows. More precisely, [29, Proposition 2.7] and the third paragraph of [29, p. 336] shows that if R is a ring with Tot(R) absolutely flat, then R is a quasi-Prüfer ring if R/P is a Prüfer domain for each P ∈ Spec(R). Now example [29, Example 2.4] shows that R is not necessarily Prüfer. We observe that if R ⊆ S is quasi-Prüfer, then R/M is a quasiPrüfer domain for each N ∈ Max(S) and M := N ∩ R (in case R ⊆ S is integral, R/M is a field). To prove this, observe that R/M ⊆ S/N can be factored R/M ⊆ κ(M) ⊆ S/N. As we will see, R/M ⊆ κ(M) is quasi-Prüfer because R/M ⊆ S/N is quasi-Prüfer. The class of Prüfer extensions is not stable by (flat) base change. For example, let V be a valuation domain with quotient field K. Then V [X] ⊆ K[X] is not Prüfer [26, Example 5.12, p.53]. Thus if we consider an ideal I of R and J := IS, R ⊆ S Prüfer may not imply R/I ⊆ S/IS Prüfer except if IS ∩ R = I. This happens for instance for a prime ideal I of R that is lain over by a prime ideal of S. Proposition 3.10. Let R ⊆ S be a (quasi)-Prüfer extension and R → T a flat epimorphism, then T ⊆ S ⊗R T is (quasi)-Prüfer. If in addition S and T are both subrings of some ring and R ⊆ T is an extension, then T ⊆ T S is (quasi)-Prüfer. 12 G. PICAVET AND M. PICAVET Proof. For the first part, it is enough to consider the Prüfer case. It is well known that the following diagram is a pushout if Q ∈ Spec(T ) is lying over P in R: RP −−−→   y SP   y TQ −−−→ (T ⊗R S)Q As RP → TQ is an isomorphism since R → T is a flat epimorphism by Scholium A, it follows that RP ⊆ SP identifies to TQ → (T ⊗R S)Q . The result follows because Prüfer extensions localize and globalize. In case R → T is a flat epimorphic extension, the surjective maps T ⊗R S → T S and R ⊗R T → RT are isomorphisms because R → T R (resp. S → ST ) is injective and R → T ⊗T R (resp. S → S ⊗R T ) is a flat epimorphism. Then it is enough to use Scholium A.  The reader may find in [26, Corollary 5.11, p.53] that if R ⊆ A ⊆ S and R ⊆ B ⊆ S are extensions and R ⊆ A and R ⊆ B are both Prüfer, then R ⊆ AB is Prüfer. Proposition 3.11. Let R ⊆ A and R ⊆ B be two extensions, where A and B are subrings of a ring S. If they are both quasi-Prüfer, then R ⊆ AB is quasi-Prüfer. Proof. Let U and V be the integral closures of R in A and B. Then R ⊆ A ⊆ AV is quasi-Prüfer because A ⊆ AV is integral and Corollary 3.3 applies. Using again Corollary 3.3 with R ⊆ V ⊆ AV , we find that V ⊆ AV is quasi-Prüfer. Now Proposition 3.10 entails that B ⊆ AB is quasi-Prüfer because V ⊆ B is a flat epimorphism. Finally R ⊆ AB is quasi-Prüfer, since a composite of quasi-Prüfer extensions.  It is known that an arbitrary product of extensions is Prüfer if and only if each of its components is Prüfer [26, Proposition 5.20, p.56]. The following result is an easy consequence. Proposition 3.12. Let {Ri ⊆ Si |i = 1, . . . , n} be a finite family of quasi-Prüfer extensions, then R1 × · · · × Rn ⊆ S1 × · · · × Sn is quasiPrüfer. In particular, if {R ⊆ Si |i = 1, . . . , n} is a finite family of quasi-Prüfer extensions, then R ⊆ S1 × · · · × Sn is quasi-Prüfer. In the same way we have the following result deduced from [26, Remark 5.14, p.54]. Proposition 3.13. Let R ⊆ S be an extension of rings and an upward directed family {Rα |α ∈ I} of elements of [R, S] such that R ⊆ Rα is quasi-Prüfer for each α ∈ I. Then R ⊆ ∪[Rα |α ∈ I] is quasi-Prüfer. QUASI-PRÜFER EXTENSIONS 13 Proof. It is enough to use [26, Proposition 5.13, p.54] where Aα is the integral closure of R in Rα .  A ring morphism R → T preserves the integral closure of ring morT ⊗R S ∼ phisms R → S if T = T ⊗R R for every ring morphism R → S. An absolutely flat morphism R → T (R → T and T ⊗R T → T are both flat) preserves integral closure [33, Theorem 5.1]. Flat epimorphisms, Henselizations and étale morphisms are absolutely flat. Another examples are morphisms R → T that are essentially of finite type and (absolutely) reduced [37, Proposition 5.19](2). Such morphisms are flat if R is reduced [28, Proposition 3.2]. We will prove an ascent result for absolutely flat ring morphisms. This will be proved by using base changes. For this we need to introduce some concepts. A ring A is called an AIC ring if each monic polynomial of A[X] has a zero in A. We recalled in [35, p.4662] that any ring A has a faithfully flat integral extension A → A∗ , where A∗ is an AIC ring. Moreover, if A is an AIC ring, each localization AP at a prime ideal P of A is a strict Henselian ring [35, Lemma II.2]. Theorem 3.14. Let R ⊆ S be a (quasi-) Prüfer extension and R → T an absolutely flat ring morphism. Then T → T ⊗R S is a (quasi-) Prüfer extension. Proof. We can suppose that R is an AIC ring. To see this, it is enough to use the base change R → R∗ . We set T ∗ := T ⊗R R∗ , S ∗ := S ⊗R R∗ . We first observe that R∗ ⊆ S ∗ is quasi-Prüfer for the following reason: the composite extension R ⊆ S ⊆ S ∗ is quasi-Prüfer because the last extension is integral. Moreover, R∗ → T ∗ is absolutely flat. In case T ∗ ⊆ T ∗ ⊗R∗ S ∗ is quasi-Prüfer, so is T ⊆ T ⊗R S, because T → T ∗ = T ⊗R R∗ is faithfully flat and T ∗ ⊆ T ∗ ⊗R∗ S ∗ is deduced from T ⊆R S by the faithfully flat base change T → T ⊗R S. It is then enough to apply Proposition 3.17. We thus assume from now on that R is an AIC ring. Let N ∈ Spec(T ) be lying over M in R. Then RM → TN is absolutely flat [32, Proposition f] and RM ⊆ SM is quasi-Prüfer. Now observe that (T ⊗R S)N ∼ = TN ⊗RM SM . Therefore, we can suppose that R and T are local and R → T is local and injective. We deduce from [33, Theorem 5.2], that RM → TN is an isomorphism. Therefore the proof is complete in the quasi-Prüfer case. For the Prüfer case, we need only to observe that absolutely flat morphisms preserve integral closure and a quasi-Prüfer extension is Prüfer if it is integrally closed.  14 G. PICAVET AND M. PICAVET Proposition 3.15. Let R ⊆ S be an extension of rings and R → T a base change which preserves integral closure. If T ⊆ T ⊗R S has FCP and R ⊆ S is Prüfer, then T ⊆ T ⊗R S is Prüfer. Proof. The result holds because an FCP extension is Prüfer if and only if it is integrally closed.  e ⊆ Te needs not to be an isomorphism, since We observe that T ⊗R R this property may fail even for a localization R → RP , where P is a prime ideal of R. Proposition 3.16. Let R ⊆ S be an extension of rings, R → R′ a faithfully flat ring morphism and set S ′ := R′ ⊗R S. If R′ ⊆ S ′ is (quasi-) Prüfer (respectively, FCP), then so is R ⊆ S. Proof. The Prüfer case is clear, because faithfully flat morphisms descend flat epimorphisms (Scholium A (9)). For the quasi-Prüfer case, we use the INC-pair characterization and the fact that FR,S (P ) → FR′ ,S ′ (P ′ ) is faithfully flat for P ′ ∈ Spec(R′ ) lying over P in R [22, Corollaire 3.4.9]. The FCP case is proved in [11, Theorem 2.2].  Proposition 3.17. Let R ⊆ S be a ring extension and R → R′ a spectrally surjective ring morphism (for example, either faithfully flat or injective and integral). Then R ⊆ S is quasi-Prüfer if R′ → R′ ⊗R S is injective (for example, if R → R′ is faithfully flat) and quasi-Prüfer. Proof. Let T ∈ [R, S] and P ∈ Spec(R) and set T ′ := T ⊗R R′ . There is some P ′ ∈ Spec(R′ ) lying over P , because R → R′ is spectrally surjective. There is a faithfully flat morphism FR,T (P ) → FR′ ,T ′ (P ′) ∼ = ′ FR,T (P ) ⊗k(P ) κ(P ) [22, Corollaire 3.4.9]. By Theorem 2.3, the result  follows from the faithful flatness of FR,T (P ) → FR′ ,T ⊗R R′ (P ′ ). Theorem 3.18. Let R ⊆ S be a ring extension. =⇒ e (1) R ⊆ S has a greatest quasi-Prüfer subextension R ⊆ R = R. =⇒ e =: R ~ is quasi-Prüfer and then R ~ ⊆ R. (2) R ⊆ RR =⇒ (3) R R =⇒ e R = R. e = R and R Proof. To see (1), use Proposition 3.13 which tells us that the set of all quasi-Prüfer subextensions is upward directed and then use Proposi=⇒ =⇒ tion 3.12 to prove the existence of R . Then let R ⊆ T ⊆ R be a tower =⇒ e ⊆ =⇒ R , we with R ⊆ T integral and T ⊆ R Prüfer. From T ⊆ R ⊆ R =⇒ e deduce that T = R and then R = R. e can be factored R ⊆ R e ⊆ RR e and is a tower of (2) Now R ⊆ RR e → RR e is integral. quasi-Prüfer extensions, because R QUASI-PRÜFER EXTENSIONS 15 =⇒ (3) Clearly, the integral closure and the Prüfer closure of R in R are =⇒ =⇒ e with R , and R, R e ⊆ R. the respective intersections of R and R  This last result means that, as long integral closures and Prüfer =⇒ closures of subsets of R are concerned, we can suppose that R ⊆ S is quasi-Prüfer. 4. Almost-Prüfer extensions We next give a definition “dual” of the definition of a quasi-Prüfer extension. 4.1. Arbitrary extensions. Definition 4.1. A ring extension R ⊆ S is called an almost-Prüfer extension if it can be factored R ⊆ T ⊆ S, where R ⊆ T is Prüfer and T ⊆ S is integral. Proposition 4.2. An extension R ⊆ S is almost-Prüfer if and only if e ⊆ S is integral. It follows that the subring T of the above definition R e=R b when R ⊆ S is almost-Prüfer. is R Proof. If R ⊆ S is almost-Prüfer, there is a factorization R ⊆ T ⊆ e⊆R b ⊆ S, where T ⊆ R b is both integral and a flat epimorphism by R e=R b by Scholium A (5) (L). Scholium A (4). Therefore, T = R  Corollary 4.3. Let R ⊆ S be a quasi-Prüfer extension, and let T ∈ ^ ∩T [R, S]. Then, T ∩ R ⊆ T R is almost-Prüfer. Moreover, T = R TR . Proof. T ∩ R ⊆ T is quasi-Prüfer by Corollary 3.3. Being integrally closed, it is Prüfer by Corollary 3.5. Moreover, T ⊆ T R is an integral ^ extension. Then, T ∩ R ⊆ T R is almost-Prüfer and T = R ∩T TR .  We note that integral extensions and Prüfer extensions are almostPrüfer and hence minimal extensions are almost-Prüfer. There are quasi-Prüfer extensions that are not almost-Prüfer. It is enough to consider [39, Example 3.5(1)]. Let R ⊆ T ⊆ S be two minimal extensions, where R is local, R ⊆ T integral and T ⊆ S is Prüfer. Then b and R ⊆ S is quasi-Prüfer but not almost-Prüfer, because S = R e The same example shows that a composite of almost-Prüfer R = R. extensions may not be almost-Prüfer. But the reverse implication holds. 16 G. PICAVET AND M. PICAVET Theorem 4.4. Let R ⊆ S be an almost-Prüfer extension. Then R ⊆ S e = R, b (R) e P =R fP for each P ∈ Spec(R). is quasi-Prüfer. Moreover, R In this case, any flat epimorphic subextension R ⊆ T is Prüfer. e ⊆ S, be an almost-Prüfer extension, that is R e ⊆ S is Proof. Let R ⊆ R e is Prüfer. Now the Morita integral. The result follows because R ⊆ R hull and the Prüfer hull coincide by Proposition 4.2. In the same way, e P →R fP is a flat epimorphism and (R) e P → SP is integral. (R)  We could define almost-Prüfer rings as the rings R such that R ⊆ e = Tot(R) (by TheoTot(R) is almost-Prüfer. But in that case R rem 4.4), so that R is a Prüfer ring. The converse evidently holds. Therefore, this concept does not define something new. We observed in [10, Remark 2.9(c)] that there is an almost-Prüfer FMC extension R ⊆ S ⊆ T , where R ⊆ S is a Prüfer minimal extension and S ⊆ T is minimal and integral. But R ⊆ T is not an FCP extension. Proposition 4.5. Let R ⊆ S be an extension verifying the hypotheses: (i) R ⊆ S is quasi-Prüfer. (ii) R ⊆ S can be factored R ⊆ T ⊆ S, where R ⊆ T is a flat epimorphism. (1) Then the following commutative diagram (D) is a pushout, R −−−→   y R   y T −−−→ T R T R ⊆ S is Prüfer and R ⊆ T R is quasi-Prüfer. Moreover, FR,R (P ) ∼ = FT,T R (Q) for each Q ∈ Spec(T ) and P := Q ∩ R. (2) If in addition R ⊆ T is integrally closed, (D) is a pullback, T ∩ R = R, (R : R) = (T : T R) ∩ R and (T : T R) = (R : R)T . Proof. (1) Consider the injective composite map R → R ⊗R T → T R. As R → R ⊗R T is a flat epimorphism, because deduced by a base change of R → T , we get that the surjective map R ⊗R T → T R is an isomorphism by Scholium A (3). By fibers transitivity, we have FT,RT (Q) ∼ = κ(Q)⊗k(P ) FR,R (P ) [22, Corollaire 3.4.9]. As κ(P ) → κ(Q) is an isomorphism by Scholium A, we get that FR,R (P ) ∼ = FT,RT (Q). (2) As in [5, Lemma 3.5], R = T ∩ R. The first statement on the conductors has the same proof as in [5, Lemma 3.5]. The second holds because R ⊆ T is a flat epimorphism (see Scholium A (6)).  QUASI-PRÜFER EXTENSIONS 17 Theorem 4.6. Let R ⊂ S be a quasi-Prüfer extension and the diagram (D’): R −−−→ R     y y (1) (2) (3) (4) (5) e −−−→ RR e R e = R and (D’) is a pushout and a pullback, such that R ∩ R e : RR) e ∩ R so that (R e : RR) e = (R : R)R. e (R : R) = (R =⇒ e = S, where e=R ~ ⊆ R =R e =R R ⊂ S can be factored R ⊆ RR the first extension is almost-Prüfer and the second is Prüfer. e = R. e e⇔R R ⊂ S is almost-Prüfer if and only if S = RR e =R e=R ~ is the greatest almost-Prüfer subextension of R ⊆ RR e=R eR~ . R ⊆ S and R e Supp(S/R) = Supp(R/R) ∪ Supp(R/R) if R ⊆ S is almostPrüfer. (Supp can be replaced with MSupp). Proof. To show (1), (2), in view of Theorem 3.18, it is enough to apply =⇒ e and S = R , because R ⊆ RR e is almostProposition 4.5 with T = R Prüfer whence quasi-Prüfer, keeping in mind that a Prüfer extension is integrally closed, whereas an integral Prüfer extension is trivial. Moree = RR e because RR e⊆R e is both integral and integrally closed. over, R (3) is obvious. (4) Now consider an almost-Prüfer subextension R ⊆ T ⊆ U, where R ⊆ T is Prüfer and T ⊆ U is integral. Applying (3), we see that U U e ⊆ RR e in view of Proposition 1.6. U =R R e (5) Obviously, Supp(R/R) ∪ Supp(R/R) ⊆ Supp(S/R). Conversely, e M = RM . let M ∈ Spec(R) be such that RM 6= SM , and RM = (R) e M = RM , which is absurd. Then (3) entails that SM = (R)M (R)  Corollary 4.7. Let R ⊆ S be an almost-Prüfer extension. The following conditions are equivalent: (1) Supp(S/R) ∩ Supp(R/R) = ∅. e ∩ Supp(R/R) e (2) Supp(S/R) = ∅. e (3) Supp(R/R) ∩ Supp(R/R) = ∅. eP = R fP for each Proof. Since R ⊆ S is almost-Prüfer, we get (R) e P ∈ Spec(R). Moreover, Supp(S/R) = Supp(R/R) ∪ Supp(R/R) = e ∪ Supp(R/R). e Supp(S/R) ∪ Supp(R/R) = Supp(S/R) e ∩ Supp(R/R). e (1) ⇒ (2): Assume that there exists P ∈ Supp(S/R) e P 6= SP , RP , so that RP ⊂ SP is neither Prüfer, nor integral. Then, (R) 18 G. PICAVET AND M. PICAVET But, P ∈ Supp(S/R) = Supp(S/R) ∪ Supp(R/R). If P ∈ Supp(S/R), then P 6∈ Supp(R/R), so that (R)P = RP and RP ⊂ SP is Prüfer, a contradiction. If P ∈ Supp(R/R), then P 6∈ Supp(S/R), so that (R)P = SP and RP ⊂ SP is integral, a contradiction. e (2) ⇒ (3): Assume that there exists P ∈ Supp(R/R) ∩ Supp(R/R). e Then, RP 6= (R)P , (R)P , so that RP ⊂ SP is neither Prüfer, nor ine ∪ Supp(R/R). e tegral. But, P ∈ Supp(S/R) = Supp(S/R) If P ∈ e e e Supp(S/R), then P 6∈ Supp(R/R), so that (R)P = RP and RP ⊂ SP e e is integral, a contradiction. If P ∈ Supp(R/R), then P 6∈ Supp(S/R), e P = SP and RP ⊂ SP is Prüfer, a contradiction. so that (R) (3) ⇒ (1): Assume that there exists P ∈ Supp(S/R) ∩ Supp(R/R). Then, (R)P 6= RP , SP , so that RP ⊂ SP is neither Prüfer, nor integral. e e If P ∈ Supp(R/R), But, P ∈ Supp(S/R) = Supp(R/R) ∪ Supp(R/R). then P 6∈ Supp(R/R), so that (R)P = RP and RP ⊂ SP is Prüfer, e a contradiction. If P ∈ Supp(R/R), then P 6∈ Supp(R/R), so that e (R)P = RP and RP ⊂ SP is integral, a contradiction.  Proposition 4.5 has the following similar statement proved by Ayache and Dobbs. It reduces to Theorem 4.6 in case R ⊆ S has FCP because of Proposition 1.3. Proposition 4.8. Let R ⊆ T ⊆ S be a quasi-Prüfer extension, where T ⊆ S is an integral minimal extension and R ⊆ T is integrally closed . Then the diagram (D) is a pullback, S = T R and (T : S) = (R : R)T . Proof. [5, Lemma 3.5].  Proposition 4.9. Let R ⊆ U ⊆ S and R ⊆ V ⊆ S be two towers of extensions, such that R ⊆ U and R ⊆ V are almost-Prüfer. Then g=U e Ve . R ⊆ UV is almost-Prüfer and UV Proof. Denote by U ′ , V ′ and W ′ the Prüfer hulls of R in U, V and W = UV . We deduce from [26, Corollary 5.11, p.53], that R ⊆ U ′ V ′ is Prüfer. Moreover, U ′ V ′ ⊆ UV is clearly integral and U ′ V ′ ⊆ W ′ because the Prüfer hull is the greatest Prüfer subextension. We deduce g=U e Ve . that R ⊆ UV is almost-Prüfer and that UV  Proposition 4.10. Let R ⊆ U ⊆ S and R ⊆ V ⊆ S be two towers of extensions, such that R ⊆ U is almost-Prüfer and R ⊆ V is a flat epimorphism. Then U ⊆ UV is almost-Prüfer. Proof. Mimic the proof of Proposition 4.9 and use [26, Theorem 5.10, p.53].  Proposition 4.11. Let R ⊆ S be an almost-Prüfer extension and R → T a flat epimorphism. Then T ⊆ T ⊗R S is almost-Prüfer. QUASI-PRÜFER EXTENSIONS Proof. It is enough to use Proposition 3.10 and Definition 4.1. 19  Proposition 4.12. An extension R ⊆ S is almost-Prüfer if and only fP = (R) e P for each P ∈ Spec(R). if RP ⊆ SP is almost-Prüfer and R e P ⊆R fP . Suppose Proof. For an arbitrary extension R ⊆ S we have (R) eP =R fP by that R ⊆ S is almost-Prüfer, then so is RP ⊆ SP and (R) Theorem 4.4. Conversely, if R ⊆ S is locally almost-Prüfer, whence fP = (R) e P holds locally quasi-Prüfer, then R ⊆ S is quasi-Prüfer. If R e P so that S = RR e and for each P ∈ Spec(R), we have SP = (RR) R ⊆ S is almost-Prüfer by Theorem 4.6.  Corollary 4.13. An FCP extension R ⊆ S is almost-Prüfer if and only if RP ⊆ SP is almost-Prüfer for each P ∈ Spec(R). Proof. It is enough to show that R ⊆ S is almost-Prüfer if RP ⊆ SP is almost-Prüfer for each P ∈ Spec(R) using Proposition 4.12. Any e ⊂ R1 is integral by definition of R. e Assume that minimal extension R ′ ′ ] e P ⊂ (R e e (R) P ), so that there exists R2 ∈ [R, S] such that (R)P ⊂ (R2 )P e P , for is a Prüfer minimal extension with crucial maximal ideal Q(R) e with Q ∩ R ⊆ P . In particular, R e ⊂ R′ is not some Q ∈ Max(R) 2 e R′ ] such that integral. We may assume that there exists R1′ ∈ [R, 2 e Using R1′ ⊂ R2′ is a Prüfer minimal extension with P 6∈ Supp(R1′ /R). e R′ ] such that R e ⊂ R2 is a [39, Lemma 1.10], there exists R2 ∈ [R, 2 Prüfer minimal extension with crucial maximal ideal Q, a contradic] e P ⊂ SP is integral for each P , whence (R) e P = (R tion. Then, (R) P ).  We now intend to demonstrate that our methods allow us to prove easily some results. For instance, next statement generalizes [5, Corollary 4.5] and can be fruitful in algebraic number theory. Proposition 4.14. Let (R, M) be a one-dimensional local ring and R ⊆ S a quasi-Prüfer extension. Suppose that there is a tower R ⊂ T ⊆ S, where R ⊂ T is integrally closed. Then R ⊆ S is almost-Prüfer, e and S is zero-dimensional. T =R Proof. Because R ⊂ T is quasi-Prüfer and integrally closed, it is Prüfer. If some prime ideal of T is lying over M, R ⊂ T is a faithfully flat epimorphism, whence an isomorphism by Scholium A, which is absurd. Now let N be a prime ideal of T and P := N ∩ R. Then RP is zerodimensional and isomorphic to TN . Therefore, T is zero-dimensional. It follows that T R is zero-dimensional. Since RT ⊆ S is Prüfer, we deduce from Scholium A, that RT = S. The proof is now complete.  20 G. PICAVET AND M. PICAVET We also generalize [5, Proposition 5.2] as follows. Proposition 4.15. Let R ⊂ S be a quasi-Prüfer extension, such that q R is local with maximal ideal N := (R : R). Then R is local and [R, S] = [R, R] ∪ [R, S]. If in addition R is one-dimensional, then either R ⊂ S is integral or there is some minimal prime ideal P of R, such that S = (R)P , P = SP and R/P is a one-dimensional valuation domain with quotient field S/P . Proof. R is obviously local. Let T ∈ [R, S] \ [R, R] and s ∈ T \ R. Then s ∈ U(S) and s−1 ∈ R by Proposition 1.2 (1). But s−1 6∈ U(R), so that s−1 ∈ N. It follows that there exists some integer n such that s−n ∈ (R : R), giving s−n R ⊆ R, or, equivalently, R ⊆ Rsn ⊆ T . Then, T ∈ [R, S] and we obtain [R, S] = [R, R] ∪ [R, S]. Assume that R is one-dimensional. If R ⊂ S is not integral then R ⊂ S is Prüfer and R is one-dimensional. To complete the proof, use Proposition 1.2 (3).  4.2. FCP extensions. In case we consider only FCP extensions, we obtain more results. Proposition 4.16. Let R ⊆ S be an FCP extension. The following statements are equivalent: (1) R ⊆ S is almost-Prüfer. (2) RP ⊆ SP is either integral or Prüfer for each P ∈ Spec(R). e ∩ Supp(R/R) e (3) RP ⊆ SP is almost-Prüfer and Supp(S/R) = ∅. (4) Supp(R/R) ∩ Supp(S/R) = ∅. Proof. The equivalence of Proposition 4.12 shows that (2) ⇔ (1) holds because Tb = Te and over a local ring T , an almost-Prüfer FCP extension T ⊆ U is either integral or Prüfer [39, Proposition 2.4] . Moreover when e P =R fP RP ⊆ SP is either integral or Prüfer, it is easy to show that (R) Next we show that (3) is equivalent to (2) of Proposition 4.12. e ∩ Supp(R/R) e Let P ∈ Supp(S/R) be such that RP ⊆ SP is almoste e P ⊂ SP . Since R ⊂ R e Prüfer. Then, (R)P 6= RP , SP , so that RP ⊂ (R) e P , giving (R) e P ⊆R fP and RP 6= R fP . It follows is Prüfer, so is RP ⊂ (R) fP = SP in view of the dichotomy principle [39, Proposition 3.3] that R fP 6= (R) e P. since RP is a local ring, and then R fP 6= (R) e P , i.e. P ∈ Supp(S/R). Then, Conversely, assume that R fP , so that R fP = SP , as we have just seen. Hence RP ⊂ SP RP 6= R is integrally closed. It follows that RP = RP = RP , so that P 6∈ e eP 6= by Theorem 4.6(5). Moreover, R Supp(R/R) and P ∈ Supp(R/R) QUASI-PRÜFER EXTENSIONS 21 e e ∩ SP implies that P ∈ Supp(S/R). To conclude, P ∈ Supp(S/R) e Supp(R/R). (1) ⇔ (4) An FCP extension is quasi-Prüfer by Corollary 3.4. Supe we pose that R ⊆ S is almost-Prüfer. By Theorem 4.6, letting U := R, get that U ∩R = R and S = RU. We deduce from [39, Proposition 3.6] that Supp(R/R) ∩ Supp(S/R) = ∅. Suppose that this last condition holds. Then by [39, Proposition 3.6] R ⊆ S can be factored R ⊆ U ⊆ S, where R ⊆ U is integrally closed, whence Prüfer by Proposition 1.3, and U ⊆ S is integral. Therefore, R ⊆ S is almost-Prüfer.  Lemma 4.17. Let B ⊂ D and C ⊂ D be two integral minimal extensions and A := B ∩ C. If A ⊂ D has FCP, then, A ⊂ D is integral. Proof. Set M := (B : D) and N := (C : D). If M 6= N, then, A ⊂ D is integral by [13, Proposition 6.6]. Assume that M = N. Then, M ∈ Max(A) by [13, Proposition 5.7]. Let B ′ be the integral closure of A in B. Then M is also an ideal of B ′ , which is prime in B ′ , and then maximal in B ′ . If A ⊂ D is an FCP extension, so is B ′ ⊆ B, which is a flat epimorphism, and so is B ′ /M ⊆ B/M. Then, B ′ = B since B ′ /M is a field. It follows that A ⊆ B is an integral extension, and so is A ⊂ D.  Proposition 4.18. Let R ⊂ S be an FCP almost-Prüfer extension. e=R b is the least T ∈ [R, S] such that T ⊆ S is integral. Then, R Proof. We may assume that R ⊂ S is not integral. If there is some e such that U ⊆ R e is integral, then U = R. e Set X := {T ∈ U ∈ [R, R] e is a minimal element of X. [R, S] | T ⊆ S integral}. It follows that R e is the least element of X. We are going to show that R e S] ≥ 1 and let R e = R0 ⊂ R1 ⊂ · · · ⊂ Rn−1 ⊂ Rn = S Set n := ℓ[R, e S], with length n. There does not exist a be a maximal chain of [R, e maximal chain of R-subalgebras of S with length > n. Let T ∈ X. We e intend to show that T ∈ [R, S]. It is enough to choose T such that T is a minimal element of X. Consider the induction hypothesis: (Hn ): e S] when n := ℓ[R, e S]. X ⊆ [R, e ⊂ S is minimal. Let T ∈ X and We first show (H1 ). If n = 1, R e T1 ∈ [T, S] be such that T1 ⊂ S is minimal. Assume that T1 6= R. e⊂R e is integral, which contradicts the Lemma 4.17 shows that T1 ∩ R e so that T = R e for the same beginning of the proof. Then, T1 = R, contradiction and (H1 ) is proved. Assume that n > 1 and that (Hk ) holds for any k < n. Let T ∈ X e S], then and T1 ∈ [T, S] be such that T1 ⊂ S is minimal. If T1 ∈ [R, 22 G. PICAVET AND M. PICAVET e T1 ] ≤ n−1. But we get that T ∈ [R, T1 ], with T ⊆ T1 integral. k := ℓ[R, e is also the Prüfer hull of R ⊆ T1 , with k := ℓ[R, e T1 ] ≤ n−1. Moreover, R e T1 ] ⊂ [R, e S]. Since (Hk ) holds, we get that T ∈ [R, e If T1 6∈ [R, S], set U := T1 ∩Rn−1 . We get that T1 ⊂ S and Rn−1 ⊂ S are minimal and integral. Using again Lemma 4.17, we get that U ⊂ S e Rn−1 ] = n − 1 and U ∈ [R, Rn−1 ]. As before, R e is is integral, with ℓ[R, e Rn−1 ], also the Prüfer hull of R ⊆ Rn−1 . Since (Hn−1 ) holds, U ∈ [R, e so that T1 ∈ [R, S], a contradiction. Therefore, (Hn ) is proved.  We will need a relative version of the support. Let f : R → T be a ring morphism and E a T -module. The relative support of E over R is SR (E) := a f (SuppT (E)) and MSR (E) := SR (E)∩Max(R). In particular, for a ring extension R ⊂ S, we have SR (S/R) := SuppR (S/R)). Proposition 4.19. Let R ⊆ S be an FCP extension. The following statements hold: e (1) Supp(R/R) ∩ Supp(R/R) = ∅. e e R) e ∩ Supp(R/R) e (2) Supp(R/R) ∩ Supp(R/R) = Supp(R/ = ∅. e (3) MSupp(S/R) = MSupp(R/R) ∪ MSupp(R/R). e is Proof. (1) is a consequence of Proposition 4.16(4) because R ⊆ R almost-Prüfer. e We prove the first part of (2). If some M ∈ Supp(R/R)∩Supp(R/R), ′ e M , T := (R)M it can be supposed in Max(R). Set R := RM , U := (R) and M ′ := MRM . Then, R′ 6= U, T , with R′ ⊂ U FCP Prüfer and R′ ⊂ T FCP integral, an absurdity [39, Proposition 3.3]. e R) e ∩ To show the second part, assume that some P ∈ Supp(R/ e Supp(R/R). Then, P 6∈ Supp(R/R) by the first part of (2), so that e P = RP R eP = R eP , a contradiction. RP = RP , giving (R) S S (3) Obviously, MSupp(S/R) = MS (S/R) = MS (S/T )∪MS (T /T ) T T ∪MS (T /U )∪MS (U /U)∪MS (U/R). By [39, Propositions 2.3 and S S T 3.2], we have MS (S/T ) ⊆ S (T /T ) = S (R/R ) = MS (R/R) = T T MSupp(R/R), MS (T /U ) = S (R /R) ⊆ S (R/R) = Supp(R/R) T T and MS (U /U) = S (R /R) = Supp(R/R). To conclude, MSupp(S/R) = e MSupp(R/R) ∪ MSupp(R/R).  Proposition 4.20. Let R ⊂ S be an FCP extension and M ∈ MSupp(S/R), g e e e then R M = (R)M if and only if M 6∈ MSupp(S/R) ∩ MSupp(R/R). g e Proof. In fact, we are going to show that R M 6= (R)M if and only if e ∩ MSupp(R/R). e M ∈ MSupp(S/R) QUASI-PRÜFER EXTENSIONS 23 e ∩ MSupp(R/R). e g Let M ∈ MSupp(S/R) Then, R M 6= RM , SM and g e g then RM ⊂ R ⊂ S . Since R ⊂ R is Prüfer, so is RM ⊂ R M M M e M ⊆ R g g by Proposition 1.2, giving (R) and R = 6 R . Therefore, M M M g g e R = S [39, Proposition 3.3] since R is local, and then R M M M M 6= (R)M . g e g g Conversely, if R M 6= (R)M , then, RM 6= RM , so that RM = SM , as we have just seen and then RM ⊂ SM is integrally closed. It follows that RM = RM = RM , so that M 6∈ MSupp(R/R). Hence, M ∈ e eM 6= SM ⇒ M ∈ MSupp(R/R) by Proposition 4.19(3). Moreover, R e To conclude, M ∈ MSupp(S/R) e ∩ MSupp(R/R). e MSupp(S/R).  g e If R ⊆ S is any ring extension, with dim(R) = 0, then R M = (R)M for any M ∈ Max(R). Indeed by Scholium A (2), the flat epimorphism e is bijective as well as RM → (R) e M . This conclusion is still R → R valid in another context. Corollary 4.21. Let R ⊂ S be an FCP extension. Assume that one of the following conditions is satisfied: e ∩ MSupp(R/R) e (1) MSupp(S/R) = ∅. e (2) S = RR, or equivalently, R ⊆ S is almost-Prüfer. g e Then, R M = (R)M for any M ∈ Max(R). Proof. (1) is Proposition 4.20. (2) is Proposition 4.12.  Proposition 4.22. Let R ⊂ S be an almost-Prüfer FCP extension. e in T R. e Then, any T ∈ [R, S] is the integral closure of T ∩ R e and V := T R. e Since R ⊂ S is almost-Prüfer, Proof. Set U := T ∩ R e e e is also the Prüfer hull of U ⊆ R is Prüfer and R ⊆ V is integral and R U ⊆ V . Because R ⊂ S is almost-Prüfer, for each M ∈ MSuppR (S/R), RM ⊆ SM is either integral, or Prüfer by Proposition 4.16, and so is g e UM ⊆ VM . But R M = (R)M by Corollary 4.21 is also the Prüfer hull ′ ′ of UM ⊆ VM . Let T be the integral closure of U in V . Then, TM is the integral closure of UM in VM . ′ e M, Assume that UM ⊆ VM is integral. Then VM = TM and UM = (R) e M = TM , giving TM = T ′ . so that VM = TM (R) M ′ e M, Assume that UM ⊆ VM is Prüfer. Then UM = TM and VM = (R) ′ e M = TM , giving TM = T . so that UM = TM ∩ (R) M ′ To conclude, we get that TM = TM for each M ∈ MSuppR (S/R). ′ Since RM = SM , with TM = TM for each M ∈ Max(R)\MSuppR (S/R), ′ we get T = T , whence T is the integral closure of U ⊆ V .  24 G. PICAVET AND M. PICAVET We build an example of an FCP extension R ⊂ S where we have g e M for some M ∈ Max(R). In particular, R ⊂ S is not RM 6= (R) almost-Prüfer. Example 4.23. Let R be an integral domain with quotient field S and Spec(R) := {M1 , M2 , P, 0}, where M1 6= M2 are two maximal ideals and P a prime ideal satisfying P ⊂ M1 ∩ M2 . Assume that there are R1 , R2 and R3 such that R ⊂ R1 is Prüfer minimal, with C (R, R1 ) = M1 , R ⊂ R2 is integral minimal, with C (R, R2 ) = M2 and R2 ⊂ R3 is Prüfer minimal, with C (R2 , R3 ) = M3 ∈ Max(R2 ) such that M3 ∩ R = M2 and M2 R3 = R3 . This last condition is satisfied when R ⊂ R2 is either ramified or inert. Indeed, in both cases, M3 R3 = R3 ; moreover, in the ramified case, we have M32 ⊆ M2 and in the inert case, M3 = M2 [36, Theorem 3.3]. We apply [13, Proposition 7.10] and [10, Lemma 2.4] several times. Set R2′ := R1 R2 . Then, R1 ⊂ R2′ is integral minimal, with C (R1 , R2′ ) =: M2′ = M2 R1 and R2 ⊂ R2′ is Prüfer minimal, with C (R2 , R2′ ) =: M1′ = M1 R2 ∈ Max(R2 ). Moreover, M1′ 6= M3 , Spec(R1 ) = {M2′ , P1 , 0}, where P1 is the only prime ideal of R1 lying over P . But, P = (R : R1 ) by [17, Proposition 3.3], so that P = P1 . Set R3′ := R3 R2′ . Then, R2′ ⊂ R3′ is Prüfer minimal, with C (R2′ , R3′ ) =: M3′ = M3 R2′ ∈ Max(R2′ ) and R3 ⊂ R3′ is Prüfer minimal, with C (R3 , R3′ ) = M1′′ = M1 R3 ∈ Max(R3 ). It follows that we have Spec(R3′ ) = {P ′ , 0} where P ′ is the only prime ideal of R3′ lying over P . To end, assume that R3′ ⊂ S is Prüfer minimal, with C (R3′ , S) = P ′. Hence, R2 is the integral closure of R in S. In particular, R ⊂ S has FCP [10, Theorems 6.3 and 3.13] and is quasi-Prüfer. Since R ⊂ R1 is integrally closed, we have e Assume that R1 6= R. e Then, there exists T ∈ [R1 , S] such R1 ⊆ R. that R1 ⊂ T is Prüfer minimal and C (R1 , T ) = M2′ , a contradiction by Proposition 4.16 since M2′ = C (R1 , R2′ ), with R1 ⊂ R2′ integral e It follows that M1 ∈ MSupp(R/R). e minimal. Then, R1 = R. But, ′ e e P = C (R3 , S) ∩ R ∈ Supp(S/R) and P ⊂ M1 give M1 ∈ MSupp(S/R), g e so that R M1 6= (R)M1 by Proposition 4.20 giving that R ⊂ S is not almost-Prüfer. We now intend to refine Theorem 4.6, following the scheme used in [4, Proposition 4] for extensions of integral domains. Proposition 4.24. Let R ⊆ S and U, T ∈ [R, S] be such that R ⊆ U is integral and R ⊆ T is Prüfer. Then U ⊆ UT is Prüfer in the following cases and R ⊆ UT is almost-Prüfer. e (1) Supp(R/R)∩Supp(R/R) = ∅ (for example, if R ⊆ S has FCP). (2) R ⊆ U preserves integral closure. QUASI-PRÜFER EXTENSIONS 25 Proof. (1) We have ∅ = MSupp(U/R)∩MSupp(T /R), since U ⊆ R and e Let M ∈ MSupp((UT )/R). For M ∈ MSupp(U/R), we have T ⊆ R. RM = TM and (UT )M = UM . If M ∈ / MSupp(U/R), then UM = RM and (UT )M = TM , so that UM ⊆ (UT )M identifies to RM ⊆ TM . Let N ∈ Max(U) and set M := N ∩ R ∈ Max(R) since R ⊆ U is integral. If M 6∈ Supp(R/R), then RM = RM = UM and N is the only maximal ideal of U lying over M. It follows that UM = UN and (UT )M = (UT )N by [10, Lemma 2.4]. Then, UN ⊆ (UT )N identifies e to RM ⊆ TM which is Prüfer. If M 6∈ Supp(R/R), then RM = TM gives UM = (UT )M , so that UN = (UT )N by localizing the precedent equality and UN ⊆ (UT )N is still Prüfer. Therefore, U ⊆ UT is locally Prüfer, whence Prüfer by Proposition 1.1. (2) The usual reasoning shows that U ⊗R T ∼ = UT , so that U ⊆ UT UT UT is integrally closed. Since U is contained in R , we get that U = R . Now observe that R ⊆ UT is almost-Prüfer, whence quasi-Prüfer. It follows that U ⊆ UT is Prüfer.  Next propositions generalize Ayache’s results of [4, Proposition 11]. Proposition 4.25. Let R ⊆ S be a quasi-Prüfer extension, T, T ′ ∈ [R, S] and U := T ∩ T ′ . The following statements hold: Te = (T^ ∩ R) for each T ∈ [R, S]. ′ e e T ∩ T ⊆ T^ ∩ T ′. Let Supp(T /T ) ∩ Supp(Te/T ) = ∅ (this assumption holds if R ⊆ S has FCP). Then, T ⊆ T ′ ⇒ Te ⊆ Te′ . e (4) If Supp(U /U) ∩ Supp(U/U) = ∅, then Te ∩ Te′ = T^ ∩ T ′. (1) (2) (3) Proof. (1) We observe that R ⊆ T is quasi-Prüfer by Corollary 3.3. Since T ∩ R is the integral closure of R in T , we get that T ∩ R ⊆ T is ∩ R. Prüfer. It follows that T ∩ R ⊆ Te is Prüfer. We thus have Te ⊆ T^ e To prove the reverse inclusion, we set V := T ∩ R and W := V ∩ T . We have W ∩ R = Ve ∩ R = V , because V ⊆ Ve ∩ R is integral and Prüfer since we have a tower V ⊆ Ve ∩ R ⊆ Ve . Therefore, V ⊆ W is Prüfer because W ∈ [V, Ve ]. Moreover, T ⊆ Te ⊆ Ve , since V ⊆ Te is Prüfer. Then, T ⊆ W is integral because W ∈ [T, T ], and we have V ⊆ T ⊆ W . This entails that T = W = Ve ∩ T , so that T ⊆ Ve is Prüfer. It follows that Ve ⊆ Te since T ∈ [V, Ve ]. (2) A quasi-Prüfer extension is Prüfer if and only if it is integrally closed. We observe that T ∩ T ′ ⊆ Te ∩ Te′ is integrally closed, whence Prüfer. It follows that Te ∩ Te′ ⊆ T^ ∩ T ′. 26 G. PICAVET AND M. PICAVET (3) Set U = T ∩ R and U ′ = T ′ ∩ R, so that U, U ′ ∈ [R, R] with U ⊆ U ′ . In view of (1), we thus can suppose that T, T ′ ∈ [R, R]. It follows that T ⊆ T ′ is integral and T ⊆ Te is Prüfer. We deduce from Proposition 4.24(1) that T ′ ⊆ T ′ Te is Prüfer, so that TeT ′ ⊆ Te′ , because Supp(T /T ) ∩ Supp(Te/T ) = ∅ and T = R. Therefore, we have Te ⊆ Te′ . e /U) = ∅. Then, T ∩T ′ ⊂ T, T ′ (4) Assume that Supp(U /U)∩Supp(U gives T^ ∩ T ′ ⊆ Te ∩ Te′ in view of (3), so that T^ ∩ T ′ = Te ∩ Te′ by (2).  Proposition 4.26. Let R ⊆ S be a quasi-Prüfer extension and T ⊆ T ′ a subextension of R ⊆ S. Set U := T ∩ R, U ′ := T ′ ∩ R, V := T R and V ′ := T ′ R. The following statements hold: (1) T ⊆ T ′ is integral if and only if V = V ′ . (2) T ⊆ T ′ is Prüfer if and only if U = U ′ . (3) Assume that U ⊂ U ′ is integral minimal and V = V ′ . Then, T ⊂ T ′ is integral minimal, of the same type as U ⊂ U ′ . (4) Assume that V ⊂ V ′ is Prüfer minimal and U = U ′ . Then, T ⊂ T ′ is Prüfer minimal. (5) Assume that T ⊂ T ′ is minimal and set P := C(T, T ′ ). (a) If T ⊂ T ′ is integral, then U ⊂ U ′ is integral minimal if and only if P ∩ U ∈ Max(U). (b) If T ⊂ T ′ is Prüfer, then V ⊂ V ′ is Prüfer minimal if and only if there is exactly one prime ideal in V lying over P . Proof. In [R, S] we have the integral extensions U ⊆ U ′ , T ⊆ V, T ′ ⊆ V ′ and the Prüfer extensions V ⊆ V ′ , U ⊆ T, U ′ ⊆ T ′ . Moreover, R is also the integral closure of U ⊆ V ′ . (1) is gotten by considering the extension T ⊆ V ′ , which is both T ⊆ V ⊆ V ′ and T ⊆ T ′ ⊆ V ′ . (2) is gotten by considering the extension U ⊆ T ′ , which is both U ⊆ T ⊆ T ′ and U ⊆ U ′ ⊆ T ′ . (3) Assume that U ⊂ U ′ is integral minimal and V = V ′ . Then, T ⊂ T ′ is integral by (1) and T 6= T ′ because of (2). Set M := (U : U ′ ) ∈ SuppU (U ′ /U). For any M ′ ∈ Max(U) such that M ′ 6= M, we ′ ′ ′ have UM ′ = UM ′ , so that TM ′ = T M ′ because UM ′ ⊆ TM ′ is Prüfer. ′ ′ ′ But, U ⊆ T is almost-Prüfer, giving T = T U . By Theorem 4.6, (T : T ′ ) = (U : U ′ )T = MT 6= T because T 6= T ′ . We get that U ⊆ T Prüfer implies that M 6∈ SuppU (T /U) and UM = TM . It follows that T ′ M = TM U ′ M = U ′ M . Therefore, TM ⊆ T ′ M identifies to UM ⊆ U ′ M , which is minimal of the same type as U ⊂ U ′ by [13, Proposition 4.6]. Then, T ⊂ T ′ is integral minimal, of the same type as U ⊂ U ′ . (4) Assume that V ⊂ V ′ is Prüfer minimal and U = U ′ . Then, T ⊂ T ′ is Prüfer by (2) and T 6= T ′ because of (1). Set Q := C(V, V ′ ) QUASI-PRÜFER EXTENSIONS 27 and P := Q ∩ T ∈ Max(T ) since Q ∈ Max(V ). For any P ′ ∈ Max(T ) such that P ′ 6= P , and Q′ ∈ Max(V ) lying above P ′, we have VQ′ = VQ′ ′ , so that VP ′ = V ′ P ′ . It follows that T ′ P ′ ⊆ V ′ P ′ is integral, so that TP ′ = T ′ P ′ and P ′ 6∈ SuppT (T ′/T ). We get that T ⊂ T ′ is Prüfer minimal in view of [10, Proposition 6.12]. (5) Assume that T ⊂ T ′ is a minimal extension and set P := C(T, T ′ ). (a) Assume that T ⊂ T ′ is integral. Then, V = V ′ and U 6= U ′ by (1) and (2). We can use Proposition 4.5 getting that P = (U : U ′ )T ∈ Max(T ) and Q := (U : U ′ ) = P ∩ U ∈ Spec(U). It follows that Q 6∈ SuppU (T /U), so that UQ = TQ and UQ′ = TQ′ . Then, UQ ⊂ UQ′ is integral minimal, with Q ∈ SuppU (U ′ /U). If Q 6∈ Max(U), then U ⊂ U ′ is not minimal by the properties of the crucial maximal ideal. Assume that Q ∈ Max(U) and let M ∈ Max(U), with M 6= Q. ′ Then, UM = UM because M + Q = U, so that U ⊂ U ′ is a minimal extension and (a) is gotten. (b) Assume that T ⊂ T ′ is Prüfer. Then, V 6= V ′ and U = U ′ by (1) and (2). Moreover, P T ′ = T ′ gives P V ′ = V ′ . Let Q ∈ Max(V ) lying over P . Then, QV ′ = V ′ gives that Q ∈ SuppV (V ′ /V ). Moreover, we have V ′ = V T ′ . Let P ′ ∈ Max(T ), P ′ 6= P . Then, TP ′ = TP′ ′ gives VP ′ = VP′ ′ . It follows that SuppT (V ′ /V ) = {P } and SuppV (V ′ /V ) = {Q ∈ Max(V ) | Q ∩ T = P }. But, by [10, Proposition 6.12], V ⊂ V ′ is Prüfer minimal if and only if |SuppV (V ′ /V )| = 1, and then if and only if there is exactly one prime ideal in V lying over P .  Lemma 4.27. Let R ⊆ S be an FCP almost-Prüfer extension and U ∈ [R, R], V ∈ [R, S]. Then U ⊆ V has FCP and is almost-Prüfer. Proof. Obviously, U ⊆ V has FCP and R is the integral closure of U in V . Proposition 4.16 entails that SuppR (R/R) ∩ SuppR (S/R) = ∅. We claim that SuppU (R/U) ∩ SuppU (V /R) = ∅. Deny and let Q ∈ SuppU (R/U) ∩ SuppU (V /R). Then, RQ 6= UQ , VQ . If P := Q ∩ R. we get that RP 6= UP , VP , giving RP 6= RP , SP , a contradiction. Another use of Proposition 4.16 shows that U ⊆ V is almost-Prüfer.  Proposition 4.28. Let R ⊆ S be an FCP almost-Prüfer extension and T ⊆ T ′ a subextension of R ⊆ S. Set U := T ∩ R and V ′ := T ′ R. Let W be the Prüfer hull of U ⊆ V ′ . Then, W is also the Prüfer hull of T ⊆ T ′ and T ⊆ T ′ is an FCP almost-Prüfer extension. Proof. By Lemma 4.27, we get that U ⊆ V ′ is an FCP almost-Prüfer extension. Let Te be the Prüfer hull of T ⊆ T ′ . Since U ⊆ T and T ⊆ Te are Prüfer, so is U ⊆ Te and Te ⊆ V ′ gives that Te ⊆ W . Then, T ⊆ W is Prüfer as a subextension of U ⊆ W . 28 G. PICAVET AND M. PICAVET Moreover, in view of Proposition 4.18, W is the least U-subalgebra of V ′ over which V ′ is integral. Since T ′ ⊆ V ′ is integral, we get that W ⊆ T ′ , so that W ∈ [T, T ′ ], with W ⊆ T ′ integral as a subextension of W ⊆ V ′ . It follows that W is also the Prüfer hull of T ⊆ T ′ and T ⊆ T ′ is an FCP almost-Prüfer extension.  5. The case of Nagata extensions In this section we transfer the quasi-Prüfer (and almost-Prüfer) properties to Nagata extensions. Proposition 5.1. Let R ⊆ S be a Prüfer (and FCP) extension, then R(X) ⊆ S(X) is a Prüfer (and FCP) extension. Proof. We can suppose that (R, M) is local, in order to use Proposition 1.2(3). Then it is enough to know the following facts: V (X) is a valuation domain if so is V ; R[X]P [X] ∼ = RP (X) where = R(X)P (X) ∼ ∼ P (X) = P R(X) and R(X)/P (X) = (R/P )(X) for P ∈ Spec(R). If in addition R ⊆ S is FCP, it is enough to use [11, Theorem 3.9]: R ⊂ S has FCP if and only if R(X) ⊂ S(X) has FCP.  Proposition 5.2. If R ⊆ S is quasi-Prüfer, then so is R(X) ⊆ S(X), R(X) = R(X) ∼ = R ⊗R R(X) and S(X) ∼ = S ⊗R R(X). Proof. It is enough to use proposition 5.1, because R(X) = R(X). The third assertion results from [34, Proposition 4 and Proposition 7].  Proposition 5.3. If R ⊆ S is almost-Prüfer, then so is R(X) ⊆ S(X). ^ = R(X) e It follows that R(X) for an almost-Prüfer extension R ⊆ S. e is Prüfer and R e ⊆ S is Proof. If R ⊆ S is almost-Prüfer, then R ⊆ R e e integral and then R(X) ⊆ R(X) is Prüfer and R(X) ⊆ S(X) is integral, ^ = R(X). e whence R(X) ⊆ S(X) is almost-Prüfer with R(X)  e = R. Lemma 5.4. Let R ⊂ S be an FCP ring extension such that R ^ = R(X). Then, R(X) ^ there is some T ′ ∈ [R(X), R(X)] ^ such that Proof. If R(X) 6= R(X), ′ ′ R(X) ⊂ T is Prüfer minimal. Set C (R(X), T ) ∈ MSupp(S(X)/R(X)) =: M ′ . There is M ∈ MSupp(S/R) such that M ′ = MR(X) [11, Lemma 3.3]. But, M ′ 6∈ MSupp(R(X)/R(X)) = MSupp(R(X)/R(X)) by Proposition 4.19(2), giving that M 6∈ MSupp(R/R) = S (R/R). Then [39, Proposition 1.7(3)] entails that M ∈ S (S/R). By [39, Proposition 1.7(4)], there are some T1 , T2 ∈ [R, S] with T1 ⊂ T2 Prüfer minimal (an FCP extension is quasi-Prüfer), with M = C (T1 , T2 ) ∩ R. QUASI-PRÜFER EXTENSIONS 29 We can choose for T1 ⊂ T2 the first minimal extension verifying the preceding property. Therefore, M 6∈ S (T1 /R), so that M 6∈ S (T1 /R) = Supp(T1 /R). By [39, Lemma 1.10], we get that there exists T ∈ [R, T2 ] such that R ⊂ T is Prüfer minimal, a contradiction.  ^ e Proposition 5.5. If R ⊂ S is an FCP extension, then, R(X) = R(X). e is Prüfer, R(X) ⊆ R(X) e Proof. Because R ⊆ R is Prüfer by Corol^ Assume that R(X) ^ and set e e lary 5.1. Then, R(X) ⊆ R(X). 6= R(X) ^ e so that T = Te, giving T e T := R, (X) = T (X) = R(X) by Lemma 5.4. ^ ^ is a Prüfer extension, contradicting the definition Hence T (X) ⊂ R(X) ^ ^ e of T (X). So, R(X) = R(X).  Proposition 5.6. Let R ⊆ S be an almost-Prüfer FCP extension, then \ = R(X). ^ b R(X) = R(X) \ = R(X) ^ = R(X) e b Proof. We have a tower R(X) ⊆ R(X) = R(X), where the first and the third equalities come from Theorem 4.4 and the second from Proposition 5.5.  We end this section with a special result. Proposition 5.7. Let R ⊆ S be an extension such that R(X) ⊆ S(X) \ b has FIP, then R(X) = R(X). Proof. The map [R, S] → [R(X), S(X)] defined by T 7→ T (X) = \ = T (X) for R(X) ⊗R T is bijective [12, Theorem 32], whence R(X) \ is a flat epimorphism. b some T ∈ [R, S]. Moreover, R(X) → R(X) b = T and the result follows. Since R → R(X) is faithfully flat, R  6. Fibers of quasi-Prüfer extensions We intend to complete some results of Ayache-Dobbs [5]. We begin by recalling some features about quasi-finite ring morphisms. A ring morphism R → S is called quasi-finite by [40] if it is of finite type and κ(P ) → κ(P ) ⊗R S is finite (as a κ(P )-vector space), for each P ∈ Spec(R) [40, Proposition 3, p.40]. Proposition 6.1. A ring morphism of finite type is incomparable if and only if it is quasi-finite and, if and only if its fibers are finite. Proof. Use [41, Corollary 1.8] and the above definition.  30 G. PICAVET AND M. PICAVET Theorem 6.2. An extension R ⊆ S is quasi-Prüfer if and only if R ⊆ T is quasi-finite (respectively, has finite fibers) for each T ∈ [R, S] such that T is of finite type over R, if and only if R ⊆ T has integral fiber morphisms for each T ∈ [R, S]. Proof. It is clear that R ⊆ S is an INC-pair implies the condition because of Proposition 6.1. To prove the converse, let T ∈ [R, S] and write T as the union of its finite type R-subalgebras Tα . Now let Q ⊆ Q′ be prime ideals of T , lying over a prime ideal P of R and set Qα := Q ∩ Tα and Q′α := Q′ ∩ Tα . If R ⊆ Tα is quasi-finite, then Qα = Q′α , so that Q = Q′ and then R ⊆ T is incomparable. The last statement is Proposition 3.8.  Corollary 6.3. An integrally closed extension is Prüfer if and only if each of its subextensions R ⊆ T of finite type has finite fibers. Proof. It is enough to observe that the fibers of a (flat) epimorphism have a cardinal ≤ 1, because an epimorphism is spectrally injective.  A ring extension R ⊆ S is called strongly affine if each of its subextensions R ⊆ T is of finite type. The above considerations show that in this case R ⊆ S is quasi-Prüfer if and only if each of its subextensions R ⊆ T has finite fibers. For example, an FCP extension is strongly affine and quasi-Prüfer. We also are interested in extensions R ⊆ S that are not necessarily strongly affine and such that each of its subextensions R ⊆ T have finite fibers. Next lemma will be useful, its proof is obvious. Lemma 6.4. Let R ⊆ S be an extension and T ∈ [R, S] (1) If T ⊆ S is spectrally injective and R ⊆ T has finite fibers, then R ⊆ S has finite fibers. (2) If R ⊆ T is spectrally injective, then T ⊆ S has finite fibers if and only if R ⊆ S has finite fibers. Remark 6.5. Let R ⊆ S be an almost-Prüfer extension, such that the e ⊆ S has finite fibers and let P ∈ Spec(R). integral extension T := R The study of the finiteness of FibR,S (P ) can be reduced as follows. As R ⊆ S is an epimorphism, because it is Prüfer, it is spectrally injective (see Scholium A). The hypotheses of Proposition 4.5 hold. We examine three cases. In case (R : R) 6⊆ P , it is well known that RP = (R)P so that |FibR,S (P )| = 1, because R → S is spectrally injective. Suppose now that (R : R) = P . From (R : R) = (T : S)∩R, we deduce that P is lain over by some Q ∈ Spec(T ) and then FibR,R (P ) ∼ = FibT,S (Q). The conclusion follows as above. Thus the remaining case is (R : R) ⊂ P QUASI-PRÜFER EXTENSIONS 31 and we can assume that P T = T for if not FibR,R (P ) ∼ = FibT,S (Q) for some Q ∈ Spec(T ) by Scholium A (1). e⊆S Proposition 6.6. Let R ⊆ S be an almost-Pr̈ufer extension. If R eP : SP ) is a maximal ideal of R eP for has finite fiber morphisms and (R e then R ⊆ R and R ⊆ S have finite fibers. each P ∈ SuppR (S/R), Proof. The Prüfer closure commutes with the localization at prime e Let P be a prime ideal ideals by Proposition 4.12. We set T := R. of R and ϕ : R → RP the canonical morphism. We clearly have FibR,. (P ) = a ϕ(FibRP ,.P (P RP )). Therefore, we can localize the data at P and we can assume that R is local. In case (T : S) = T , we get a factorization R → R → T . Since R → T is Prüfer so is R → R and it follows that R = R because a Prüfer extension is integrally closed. From Proposition 1.2 applied to R ⊆ T , we get that there is some P ∈ Spec(R) such that T = RP , R/P is a valuation ring with quotient field T /P and P = PT . It follows that (T : S) = PT = P ⊆ R, and hence (T : S) = (T : S) ∩ R = (R : R). We have therefore a pushout diagram by Theorem 4.6: R′ := R/P −−−→ R/P := R′     y y T ′ := T /P −−−→ S/P := S ′ where R/P is a valuation domain, T /P is its quotient field and R/P → S/P is Prüfer by [26, Proposition 5.8, p. 52]. Because R′ → S ′ is injective and a flat epimorphism, there is a bijective map Min(S ′ ) → Min(R′ ). But T ′ → S ′ is the fiber at P of T → S and is therefore finite. Therefore, Min(S ′ ) is a finite set {N1 , . . . , Nn } of maximal ideals lying over the minimal prime ideals {M1 , . . . , Mn } of R′ lying over 0 in R′ . We infer from Lemma 3.7 that R′ /Mi → S ′ /Ni is Prüfer, whence integrally closed. Therefore, R′ /Mi is an integral domain and the integral closure of R′ in S ′ /Ni . Any maximal ideal M of R′ contains some Mi . To conclude it is enough to use a result of Gilmer [19, Corollary 20.3] because the number of maximal ideals in R′ /Mi is less than the separable degree of the extension of fields T ′ ⊆ S ′ /Ni .  e : S) is a maximal ideal of R. e We Remark 6.7. (1) Suppose that (R e : S)P ⊆ (R eP : SP ) and the hypotheses on (R e : S) of clearly have (R the above proposition hold. 32 G. PICAVET AND M. PICAVET e ⊆ S is a tower of finitely many integral minimal (2) In case R e = extensions Ri−1 ⊆ Ri with Mi = (Ri−1 : Ri ), then SuppRe (S/R) e where Ni = Mi ∩ R. If the ideals Ni are dif{N1 , . . . , Nn } ⊆ Max(R) e ⊆ S is integral minimal and the ferent, each localization at Ni of R above result may apply. This generalizes the Ayache-Dobbs result [5, e ⊆ S is supposed to be integral minimal. Lemma 3.6], where R Proposition 6.8. Let R ⊆ S be a quasi-Prüfer ring extension. (1) R ⊆ S has finite fibers if and only if R ⊆ R has finite fibers. (2) R ⊆ R has finite fibers if and only if each extension R ⊆ T , where T ∈ [R, S] has finite fibers. Proof. (1) Let P ∈ Spec(R) and the morphisms κ(P ) → κ(P ) ⊗R R → κ(P )⊗R S. The first (second) morphism is integral (a flat epimorphism) because deduced by base change from the integral morphism R → R (the flat epimorphism R → S). Therefore, the ring κ(P ) ⊗R R is zero dimensional, so that the second morphism is surjective by Scholium A (2). Set A := κ(P ) ⊗R R and B := κ(P ) ⊗R S, we thus have a module finite flat ring morphism A → B. Hence, AQ → BQ is free for each Q ∈ Spec(A) [16, Proposition 9] and BQ 6= 0 because it contains κ(P ) 6= 0. Therefore, AQ → BQ is injective and it follows that A ∼ = B. (2) Suppose that R ⊆ R has finite fibers and let T ∈ [R, S], then R ⊆ RT is a flat epimorphism by Proposition 4.5(1) and so is κ(P ) ⊗R R → κ(P ) ⊗R RT . Since Spec(κ(P ) ⊗R RT ) → Spec(κ(P ) ⊗R R) is injective, R ⊆ RT has finite fibers. Now R ⊆ T has finite fibers because T ⊆ RT is integral and is therefore spectrally surjective.  Remark 6.9. Actually, the statement (1) is valid if we only suppose that R ⊆ S is a flat epimorphism. Next result contains [5, Lemma 3.6], gotten after a long proof. Corollary 6.10. Let R ⊆ S be an almost-Prüfer extension. Then R ⊆ S has finite fibers if and only if R ⊆ R has finite fibers, and if e ⊆ S has finite fibers. and only if R Proof. By Proposition 6.8(1) the first equivalence is clear. The second is a consequence of Lemma 6.4(2).  The following result is then clear. Theorem 6.11. Let R ⊆ S be a quasi-Prüfer extension with finite fibers, then R ⊆ T has finite fibers for each T ∈ [R, S]. Corollary 6.12. If R ⊆ S is quasi-finite and quasi-Prüfer, then R ⊆ T e ⊆ S is module finite. has finite fibers for each T ∈ [R, S] and R QUASI-PRÜFER EXTENSIONS 33 Proof. By the Zariski Main Theorem, there is a factorization R ⊆ F ⊆ S where R ⊆ F is module finite and F ⊆ S is a flat epimorphism [40, Corollaire 2, p.42]. To conclude, we use Scholium A in the rest of e ⊗R F → S is injective because F → R e ⊗R F the proof. The map R is a flat epimorphism and is surjective, since it is integral and a flat e ⊗R F → S is a flat epimorphism . epimorphism because R  Corollary 6.13. An FMC extension R ⊆ S is such that R ⊆ T has finite fibers for each T ∈ [R, S]. Proof. Such an extension is quasi-finite and quasi-Prüfer. Then use Corollary 6.12.  [5, Example 4.7] exhibits some FMC extension R ⊆ S, such that R ⊆ R has not FCP. Actually, [R, R] is an infinite (maximal) chain. Proposition 6.14. Let R ⊆ S be a quasi-Prüfer extension such that R ⊆ R has finite fibers and R is semi-local. Then T is semi-local for each T ∈ [R, S]. Proof. Obviously R is semi-local. From the tower R ⊆ T R ⊆ S we deduce that R ⊆ T R is Prüfer. It follows that T R is semi-local [5, Lemma 2.5 (f)]. As T ⊆ T R is integral, we get that T is semi-local.  The following proposition gives a kind of converse. Proposition 6.15. Let R ⊆ S be an extension with R semi-local. Then R ⊆ S is quasi-Prüfer if and only if T is semi-local for each T ∈ [R, S]. Proof. If R ⊆ S is quasi-Prüfer, R ⊆ S is Prüfer. Let T ∈ [R, S] and set T ′ := T R, so that T ⊆ T ′ is integral, and R ⊆ T ′ is Prüfer (and then a normal pair). It follows from [5, Lemma 2.5 (f)] that T ′ is semi-local, and so is T . If T is semi-local for each T ∈ [R, S], so is any T ∈ [R, S]. Then, (R, S) is a residually algebraic pair [6, Theorem 3.10] (generalized to arbitrary extensions) and so is RM ⊆ SM for each M ∈ Max(R), whence is Prüfer [6, Theorem 2.5] (same remark) and Proposition 1.2. Then, R ⊆ S is Prüfer by Proposition 1.1 and R ⊆ S is quasi-Prüfer.  7. Numerical properties of FCP extensions Lemma 7.1. Let R ⊂ S be an FCP extension. The map ϕ : [R, S] → {(T ′, T ′′ ) ∈ [R, R]×[R, S] | SuppT ′ (R/T ′)∩SuppT ′ (T ′′ /R) = ∅}, defined by ϕ(T ) := (T ∩ R, RT ) for each T ∈ [R, S], is bijective. In particular, if R ⊂ S has FIP, then |[R, S]| ≤ |[R, R]||[R, S]|. 34 G. PICAVET AND M. PICAVET Proof. Let (T ′ , T ′′) ∈ [R, R]×[R, S]. Then, R is also the integral closure of T ′ in T ′′ (and in S). Let T ∈ [R, S]. Set T ′ := T ∩ R and T ′′ := RT . Then (T ′ , T ′′ ) ∈ [R, R] × [R, S]. Assume that T ′ = T ′′ , so that T ′ = T ′′ = R, giving T = R and SuppT ′ (R/T ′ ) = SuppT ′ (T ′′ /R) = ∅. Assume that T ′ 6= T ′′ . In view of [39, Proposition 3.6], we get SuppT ′ (R/T ′ )∩SuppT ′ (T ′′ /R) = ∅. Hence ϕ is well defined. Now, let T1 , T2 ∈ [R, S] be such that ϕ(T1 ) = ϕ(T2 ) = (T ′ , T ′′). Assume T ′ 6= T ′′ . Another use of [39, Proposition 3.6] gives that T1 = T2 . If T ′ = T ′′ , then, T ′ = T ′′ = R, so that T1 = T2 = R. It follows that ϕ is injective. The same reference gives that ϕ is bijective.  Proposition 7.2. Let R ⊂ S be a FCP extension. We define two order-isomorphisms ϕ′ and ψ as follows: ~ → [R, R] × [R, R] ~ defined by ϕ′ (T ) := (T ∩ R, T R) ϕ′ : [R, R] ~ → [R, R] e × [R, e R] ~ defined by ψ(T ) := (T ∩ R, e T R). e ψ : [R, R] Proof. This follows from [39, Lemma 3.7] and Proposition 4.19. (We ~ = R.) e recall that R  ~ R) e = Supp(R/R), Corollary 7.3. If R ⊆ S has FCP, then Supp(R/ e ~ e ~ = Supp(R/R) and Supp(R/R) = Supp(R/R)∪Supp(R/R). Supp(R/R) e R), e B := Supp(R/R), e e Proof. Set A := Supp(R/ C := Supp(R/R) e with and D := Supp(R/R). Then, A ∪ B = C ∪ D = Supp(R/R), A ∩ B = C ∩ D = B ∩ D = ∅ by Proposition 4.19. Assume that A ∪ B 6= B ∪ D and let P ∈ (A ∪ B) \ (B ∪ D). e P = (R)P (R) e P = RP , a contradiction. It follows that Then, RP 6= (R) A ∪ B = B ∪ D. Intersecting the two members of this equality with A and D, we get A = A ∩ D = D. In the same way, intersecting the equality A ∪ B = C ∪ D = C ∪ A by B and C, we get B = C.  Corollary 7.4. Let R ⊂ S be an FCP extension. We define two orderisomorphisms ~ by ϕ1 (T ) := T R e → [R, R] ϕ1 : [R, R] e R] ~ by ψ1 (T ) := T R. e ψ1 : [R, R] → [R, Proof. We use notation of Proposition 4.19. We begin to remark that e play symmetric roles. R and R e be such that ϕ1 (T ) = ϕ1 (T ′ ). Since T ∩ R = Let T, T ′ ∈ [R, R] ′ T ∩ R = R by Proposition 4.19, we get ϕ(T ) = ϕ(T ′ ), so that T = T ′ and ϕ1 is injective. A similar argument shows that ψ1 is injective. QUASI-PRÜFER EXTENSIONS 35 e There exists T ∈ [R, R] e such that ϕ(T ) = (R, U), so Let U ∈ [R, R]. e e that R = T ∩ R and U = T R. Let M ∈ Supp(R/R) = Supp(R/R) ∪ e Supp(R/R) by Corollary 7.3. If M ∈ Supp(R/R), then M 6∈ Supp(R/R) e M = RM R eM = R eM . If M ∈ by Proposition 4.19, giving TM ⊆ R Supp(R/R), the same reasoning gives TM ⊆ RM , so that RM = TM ∩ eM . Then, TM = R eM . It follows that T ⊆ R, e RM = TM , but RM = R e giving T ∈ [R, R] and ϕ1 is surjective, hence bijective. A similar argument shows that ψ1 is surjective, hence bijective.  ~ e × [R, R] → [R, R] Corollary 7.5. If R ⊂ S has FCP, then θ : [R, R] ′ ′ defined by θ(T, T ) := T T , is an order-isomorphism. In particular, if e ~ ≤ |[R, S]|. R ⊂ S has FIP, then |[R, R]||[R, R] = |[R, R]k Proof. Using notation of Proposition 7.2 and Corollary 7.4, we may remark that ψ◦θ = Id×ψ1 . Since ψ and Id×ψ1 are order-isomorphisms, so is θ. The FIP case is obvious.  Gathering the previous results, we get the following theorem. Theorem 7.6. If R ⊂ S has FCP, the next statements are equivalent: (1) Supp(R/R) ∩ Supp(S/R) = ∅. (2) The map ϕ : [R, S] → [R, R] × [R, S] defined by ϕ(T ) := (T ∩ R, T R) is an order-isomorphism. (3) R ⊆ S is almost-Prüfer. e (4) Supp(S/R) = Supp(R/R). e → [R, S] defined by ϕ1 (T ) := T R is an (5) The map ϕ1 : [R, R] order-isomorphism. e S] defined by ψ1 (T ) := T R e is an (6) The map ψ1 : [R, R] → [R, order-isomorphism. e × [R, R] → [R, S] defined by θ(T, T ′ ) := T T ′ (7) The map θ : [R, R] is an order-isomorphism. e = Supp(R/R). If one of these conditions holds, then Supp(S/R) If R ⊂ S has FIP, the former conditions are equivalent to each of the following conditions: e R]|. (8) |[R, S]| = |[R, R]||[R, (9) k[R, S]| = |[R, R]||[R, S]|. e = |[R, S]|. (10) |[R, R]| e S]|. (11) |[R, R]| = |[R, Proof. (1) ⇒ (2) by [39, Lemma 3.7]. 36 G. PICAVET AND M. PICAVET (2) ⇒ (1). If the statement (2) holds, there exists T ∈ [R, S] such that T ∩ R = R and T R = S. Then, [39, Proposition 3.6] gives that Supp(R/R) ∩ Supp(S/R) = ∅. (1) ⇒ (3) by [39, Proposition 3.6]. (3) ⇒ (4), (5), (6) and (7): Use Corollary 7.3 to get (4), Corollary 7.4 to get (5) and (6), and Corollary 7.5 to get (7). Moreover, (3) and e = Supp(R/R). Corollary 7.3 give Supp(S/R) (4) ⇒ (1) by Proposition 4.19(2). e (5), (6) or (7) ⇒ (3) because, in each case, we have S = RR. Assume now that R ⊂ S has FIP. Then, obviously, (7) ⇒ (8), (2) ⇒ (9), (5) ⇒ (10) and (6) ⇒ (11). e so e R]| = |[R, R]|, (9) ⇒ (3) by Corollary 7.5, which gives |[R, R]||[R, e and then S = R. e that |[R, S]| = |[R, R]|, (8) ⇒ (1): Using the map ϕ of Lemma 7.1, we get that {(T ′ , T ′′) ∈ [R, R] × [R, S] | SuppT ′ (R/T ′ ) ∩ SuppT ′ (T ′′ /R) = ∅} = [R, R] × [R, S], so that SuppR (R/R) ∩ SuppR (S/R) = ∅. (10) ⇒ (3) and (11) ⇒ (3) by Corollary 7.4.  Example 7.7. We give an example where the results of Theorem 7.6 do not hold if R ⊆ S has not FCP. Set R := ZP and S := Q[X]/(X 2 ), e = Q because R ⊂ R e is Prüfer (minimal) where P ∈ Max(Z). Then, R e ⊂ S is integral minimal. Set M := P RP ∈ Max(R) with (R, M) and R a local ring. It follows that M ∈ Supp(R/R) ∩ Supp(S/R) because R ⊂ S is neither integral, nor Prüfer. Similarly, M ∈ Supp(R/R) ∩ e Supp(R/R). Indeed, R ⊂ R has not FCP. We end the paper by some length computations in the FCP case. Proposition 7.8. Let R ⊆ S be an FCP extension. The following statements hold: e = ℓ[R, R] ~ and ℓ[R, R] = ℓ[R, e R] ~ (1) ℓ[R, R] ~ = ℓ[R, R] e + ℓ[R, e R] ~ = ℓ[R, R] + ℓ[R, R] ~ (2) ℓ[R, R] ~ = |Supp (R/R)| e = |SuppR (R/R)|. e ~ (3) ℓ[R, R] = ℓ[R, R] R Proof. To prove (1), use the maps ϕ1 and ψ1 of Corollary 7.4. Then (2) follows from [11, Theorem 4.11] and (3) from [10, Proposition 6.12].  References [1] D.F. Anderson and D.E. Dobbs, Pairs of rings with the same prime ideals, Can. J. Math. XXXII, (1980), 362–384. [2] D. F. Anderson, D. E. Dobbs and M. Fontana, On treed Nagata rings, J. Pure Appl. Algebra, 61, (1989), 107–122. QUASI-PRÜFER EXTENSIONS 37 [3] A. Ayache, M. Ben Nasr, O. Echi and N. Jarboui, Universally catenarian and going-down pairs of rings, Math. Z, 238, (2001), 695–731. [4] A. Ayache, A constructive study about the set of intermediate rings, Comm. Algebra, 41 (2013), 4637–4661. [5] A. Ayache and D. E. Dobbs, Finite maximal chains of commutative rings, JAA, 14, (2015), 14500751–1450075-27. [6] A. Ayache and A. Jaballah, Residually algebraic pairs of rings, Math. Z, 225, (1997), 49–65. [7] M. Ben Nasr and N. Jarboui, New results about normal pairs of rings with zero-divisors, Ricerche mat. 63 (2014), 149–155. [8] R.D. Chatham, Going-down pairs of commutative rings, Rendiconti del Circolo Matematico di Palermo, Serie II, Tomo L, (2001), 509–542. [9] G. W. Chang and M. Fontana, Uppers to 0 in polynomial rings and Prüfer -like domains, Comm. Algebra, 37 (2009), 164–192. [10] D. E. Dobbs, G. Picavet and M. Picavet-L’Hermitte, Characterizing the ring extensions that satisfy FIP or FCP, J. Algebra, 371 (2012), 391–429. [11] D. E. Dobbs, G. Picavet and M. Picavet-L’Hermitte, Transfer results for the FIP and FCP properties of ring extensions, Comm. Algebra, 43 (2015), 1279–1316. [12] D. E. Dobbs, G. Picavet and M. Picavet-L’Hermitte, When an extension of Nagata rings has only finitely many intermediate rings, each of those is a Nagata ring?, Int. J. Math. Math. Sci., 2014 (2014), Article ID315919, 13 pp. [13] D. E. Dobbs, G. Picavet, M. Picavet-L’Hermitte and J. Shapiro, On intersections and composites of minimal ring extensions, J P J. Algebra, Number Theory Appl., 26 (2012), 103–158. [14] D. E. Dobbs, On characterizations of integrality involving the lying-over and incomparability properties, J. Comm. Algebra, 1 (2009), 227–235. [15] D.E. Dobbs and J. Shapiro, Pseudo-normal pairs of integral domains, Houston J. Math., 40 (2014), 1–9. [16] S. Endo, On semi-hereditary rings, J. Math. Soc. Japan, 13 (1961), 109– 119. [17] D. Ferrand and J.-P. Olivier, Homomorphismes minimaux d’anneaux, J. Algebra, 16 (1970), 461–471. [18] M. Fontana, J. A. Huckaba and I. J. Papick, Prüfer domains, Dekker, New York, 1997. [19] R. Gilmer, Multiplicative Ideal Theory, Dekker, New York, 1972. [20] M. Griffin, Prüfer rings with zero divisors, Journal fur die reine and angewande Mathematik, 239, (1969), 55–67. [21] M. Grandet, Une caratérisation des morphismes minimaux non entiers, C.R. Acad. Sc. Paris, 271, (1970), Série A 581–583. [22] A. Grothendieck and J. Dieudonné, Eléments de Géométrie Algébrique, Springer Verlag, Berlin, (1971). [23] E. Houston, Uppers to zero in polynomial rings, pp. 243–261, in: Multiplicative Ideal Theory in Commutative Algebra, Springer-Verlag, New York, 2006. [24] A. Jaballah, Finiteness of the set of intermediary rings in normal pairs, Saitama Math. J., 17 (1999), 59–61. 38 G. PICAVET AND M. PICAVET [25] N. Jarboui and E. Massaoud, On finite saturated chains of overrings, Comm. Algebra, 40, (2012), 1563–1569. [26] M. Knebusch and D. Zhang, Manis Valuations and Prüfer Extensions I, Springer, Berlin, 2002. [27] D. Lazard, Autour de la platitude, Bull. Soc. Math. France, 97, (1969), 81–128. [28] M. Lazarus, Fermeture intégrale et changement de base, Ann. Fac. Sci. Toulouse, 6, (1984), 103–120. [29] T. G. Lucas, Some results on Prüfer rings, Pacific J. Math., 124, (1986), 333–343. [30] K. Morita, Flat modules, Injective modules and quotient rings, Math. Z., 120 (1971), 25–40. [31] J.P. Olivier, Anneaux absolument plats universels et épimorphismes à buts réduits, Séminaire Samuel. Algèbre Commutative, Tome 2 (1967-1968), exp. no 6, p. 1–12. [32] J. P. Olivier, Montée des propriété par morphismes absolument plats, J. Alg. Pure Appl., Université des Sciences et Technique du Languedoc, Montpellier, France (1971). [33] J.P. Olivier, Going up along absolutely flat morphisms, J. Pure Appl. Algebra, 30 (1983), 47–59. [34] G. Picavet, Propriétés et applications de la notion de contenu, Comm. Algebra,13, (1985), 2231–2265. [35] G. Picavet, Universally going-down rings, 1-split rings, and absolute integral closure, Comm. Algebra, 31, (2003), 4655–4685. [36] G. Picavet and M. Picavet-L’Hermitte, About minimal morphisms, pp. 369–386, in: Multiplicative Ideal Theory in Commutative Algebra, Springer, New York, 2006. [37] G. Picavet, Seminormal or t-closed schemes and Rees rings, Algebra Repr. Theory, 1, (1998), 255–309. [38] G. Picavet and M. Picavet-L’Hermitte, Some more combinatorics results on Nagata extensions, Palestine J. Math., 1, (Spec.1), (2016), 49–62. [39] G. Picavet and M. Picavet-L’Hermitte, Prüfer and Morita hulls of FCP extensions, Comm. Algebra, 43, (2015), 102-119. [40] M. Raynaud, Anneaux locaux Henséliens, Lect. Notes in Math., Springer, Vol. 169, (1970). [41] H. Uda, Incomparability in ring extensions, Hiroshima Math. J., 9, (1979), 451–463. [42] S. Visweswaran, Laskerian pairs, J. Pure Appl. Algebra, 59, (1989), 87–110. Université Blaise Pascal, Laboratoire de Mathématiques, UMR6620 CNRS, 24, avenue des Landais, BP 80026, 63177 Aubière CEDEX, France E-mail address: [email protected] E-mail address: picavet.gm(at)wanadoo.fr
0math.AC
Stateful Behavioral Types for ABS Eduard Kamburjan and Tzu-Chun Chen arXiv:1802.08492v1 [cs.PL] 23 Feb 2018 Department of Computer Science, Technische Universität Darmstadt, Germany [email protected], [email protected] Abstract. It is notoriously hard to correctly implement a multiparty protocol which involves asynchronous/concurrent interactions and the constraints on states of multiple participants. To assist developers in implementing such protocols, we propose a novel specification language to specify interactions within multiple object-oriented actors and the sideeffects on heap memory of those actors; a behavioral-type-based analysis is presented for type checking. Our specification language formalizes a protocol as a global type, which describes the procedure of asynchronous method calls, the usage of futures, and the heap side-effects with a firstorder logic. To characterize runs of instances of types, we give a modeltheoretic semantics for types and translate them into logical constraints over traces. We prove protocol adherence: If a program is well-typed w.r.t. a protocol, then every trace of the program adheres to the protocol, i.e., every trace is a model for the formula of its type. 1 Introduction The combination of actors [26] in object-oriented languages (e.g., Scala [33] and ABS [28]), sometimes called Active Objects [7,32], is an active research area for system models and is frequently used in practice [36]. In general, Active Objects communicate internally within an object via the object’s heap memory, and communicate externally by asynchronous method calls through futures [3,22], which are constructs for synchronizing executions invoked by those calls. Encapsulated heap memory and asynchronous calls with explicit synchronization points (specified by futures) make it hard to specify and verify protocols for Active Objects. The main obstacle, as Din and Owe [15] pointed out, is to bridge the gap between local perspectives of single objects and global perspectives of the whole system, e.g., it is non-trivial to precisely specify the communication within an object’s heap memory from a global perspective [16]. Multiparty session types (short as MPST) [13,27], one important member of behavioral types [2,19], are established theories for typing globally stateless concurrent interactions (i.e., method calls) among multiple participants (i.e., objects) to ensure communication safety. Current works in MPST [5,37] have attempted to specify states in communication by using global values and assuming that channels are the only communication concept; however, global values are not sufficient to specify the non-trivial interplay of processes with the heap memory inside an object, and channels are not able to fully represent the usage of futures. 1 translation execution We integrate a stateful analysis and the specification of Din et al. [15] into MPST since MPST is able to formally specify the scenario of global interactions. By specifying communication from a global perspective and functional properties of local states in communication, we aim to ensure (1) the correctness of heap accesses of methods of actors and (2) the deadlock freedom of well-typed processes which interact with each other. The verification of local specifications compositionally guarantees the global specification. We specify passed data and modifications of heap memory with first-order logic (FOL) formulas and transform our behavioral types into logical constraints on traces. Moreover, from the model-theoretic perspective, we define protocol adherence as that every generated trace of a well-typed(`) program is a model(|=) for the translation of the type. The following scenario illustrates our approach and the challenges for specifying and verifying protocols for Active Objects. Assume we have a GUI U, a computation server S, Program ` Protocol and an interface server I such that U, without knowing S, wants to compute some data by sending them to I via a method call. After executing this call, U gets ready for the next action by setting field intern to value expect and Trace |= Constraint terminating its process to stay responsive. I delegates U ’s task to S and remains responsive to other requests without waiting for S’s computation through invoking a new method call on U with future x, which will carry the computation result, bigger than 0, back to U. The code and figure below implement this scenario: 1 object U{ 2 TState intern = init; 3 Int resume(FuthInti x){ 4 if( this.intern!=expect } return −1; 5 Int r = x.get; return r; } 6 Unit start(Int j){ 7 FuthUniti f = I!cmp(this, j); 8 this.intern = expect; }} 9 10 11 12 13 14 15 16 object I{ Unit cmp(Int dat){ FuthInti f = S!cmp(dat); FuthInti f’ = U!resume(f);}} object S{ Int cmp(Int i){ ... }} main { U!start(20); } In the code, ! denotes a non-blocking call, I!cmp calls U I S method cmp of I, U!start calls the initial method of U, cmp U!resume calls method resume for continuation, and S!cmp cmp starts the actual computation at S. The challenge for resume formal specifications is to express that (1) I is transparent (get) to U and S such that I must pass the same data to S that it received from U and I does not read the return value from S, and (2) U changes its heap to expect and reads the correct future. Contributions. We propose (1) a specification language for actors’ behaviors, which integrates FOL to specify heap memory, (2) a type system integrating a validity calculus for it and (3) model-theoretic semantics for protocol adherence. Roadmap. Section 2 gives an overview of our approach and illustrates the workflow. We first present the core ideas without loops and branching: Section 3 introduces a core language for Active Objects, Sync, and its dynamic logic, Section 4 gives the types and operations on them and Section 5 gives the type 2 system. Section 6 gives language and type constructs for loops and Section 7 gives language and type constructs for branching. Section 8 gives a conclusion and related work. 2 Challenges and Overview of the Workflow We consider object-oriented actors, which use method calls, futures, and heap memory for communication. Every method call is asynchronous and starts a new process at the callee object. At each such call, the active process at the caller gets a fresh future identity on which one may synchronize on the termination of the started process. An object delete may only switches its active process to another process if the currently active process terminates. Using futures gives programmers the control of when to make a synchronization – however, it leads to the following complications: Unexposed State In the Active Object concurrency model, each process has exactly one future, thus reading from a future is synchronizing with an unknown process and depends on the state of the process’s object. Futures cannot be analyzed in isolation — reading from a future must take the unexposed state of the object into account. Mixed Communication Paradigms Communication through the heap memory is hard to describe with data types, as it requires fine-grained specification of computation and has no explicit caller or callee. Thus, it is difficult to isolate the parts of the program realizing the communication protocol. Additionally, method calls are asynchronous, while future reads are synchronous. Two-Fold Endpoints In the Active Object model, the callee endpoints of methods calls are objects, but the caller endpoints and the endpoints for future synchronization are processes. The interplay of multiple objects, which contain multiple processes, must be captured in the analysis by a two-fold notion of endpoints: Objects and processes are both endpoints. Example 1: Specifying global types. Our specification language for side-effects is a FOL for specifying local memory instead of global values since (1) global values are not natural in an Active Object setting, and (2) a logic over memory locations (variables and fields) allows us to use a well-established theory of first order (FO) dynamic logic [23] to capture the semantics of methods. We formalize the scenario in Section 1 by the following global type in our specification language: . G =main → − U : starthU.state = expecti . U → − I : comp . f . . I− → S : comphi = dat, result > 0i . I → − U : resumehx = f, >i . U ↑ x . End where > denotes true. Following the syntax of Honda et al. [27], U → − I : comp denotes a message comp from U to I, i.e., the call to a method comp. Formula . U.state = expect is the postcondition for the process started by this call. If two formulas are provided, the first is the precondition describing the state of the caller and the second is the postcondition describing the state of the callee and 3 GX prp (G  X) G  X0 prp∗ (G  X0 ) prp∗ (G  X)  m1 ∗ prp∗ (G  X)  m2 G | {z }| Step 1: Generating local types for objects {z Step 2: Propagating guarantees in objects }| prp∗ (G  X0 )  m01 prp∗ (G  X0 )  m02 {z } Step 3: Generating local types for methods Fig. 1. Workflow for Phase 1: G is a global type and  denotes projection on object X resp. method m. Function prp∗ is the function propagating guarantees. the return value, which is denoted by keyword result. The annotation f denotes the memory location where the future of the denoted call is stored. Formula . i = dat states that dat, the parameter of S.cmp, carries the same value as re. ceived by I.cmp on parameter i, while formula x = f requires that parameter x of the call at method resume carries the future of the previous call to comp. Finally, U ↑ x describes a read of U on the future stored in the location x. Note that we specify locations in formulas and avoid a situation where that an endpoint must guarantee an obligation containing values that it cannot access. For example Bocchi et al [5] allow this situation and thus require additional analyses of history-sensitivity and temporal-satisfiability. For analysis, we adopt an approach similar to MPST: We project a global type on endpoints defined inside it, to automatically derive local specifications for all objects and methods. Additionally, formulas, which are used to specify conditions on the heap memory, are projected on the logical substructure of the callee, because the callee cannot access the caller’s fields. Two-phase Analysis. The analysis requires that the protocol is encoded as a global type, which defines the order of method calls and future read operations between objects, annotated with FO specifications of heap memory and passed data. Our analysis mechanism has two phases. In Phase 1, a global type is used to generate local types for all endpoints. In Phase 2, the endpoints are type checked against their local types via generating a causality graph. The workflow of Phase 1 is based on MPST’s approach, but is adjusted to the Active Object concurrency model: Phase 1. The workflow of Phase 1 is shown in Fig. 1. – Step 1 : The global type is projected onto the participating objects and generates object types. Such a type specifies the obligation of an object for running methods in a certain order, and for guaranteeing the FOL specifications of the object’s state. During projection, the FO-specifications are projected onto the substructure of this object, i.e., the object only has to prove specifications of memory that it can access. 4 – Step 2 : FO-specifications are propagated within an object type: as the order of method executions is specified by the specification, the postcondition of a method can be assumed as a precondition for the next method. – Step 3 : An object type is projected on its methods, producing method types. A global type encodes the following obligations (short as Obl. ) for the implementation: (Obl. a) the whole system does not deadlock, (Obl. b) for each object, the observable events (calls and reads) are ordered as specified in the global type and (Obl. c) for each method, the observable events are ordered as specified in the local type derived from the global type, and adhere to the FO-specifications. In the following, we demonstrate the Phase 1 workflow of the global type in Example 1. We do not formally introduce the syntax at this point. Step 1: Object Types. Continue with Example 1, projecting G on object U we get . . ?starth>i.I!comph>i.Put state = expect.?resumeh∃f. x = f i.Read x.Put result > 0 Type ?starth>i denotes a starting point for runtime execution and type I! comph>i denotes an invocation of method comp. Type Put ϕ specifies the termination of the currently active process in a state where ϕ holds. The position of Put is derived automatically and we do not specify in a global type when a process terminates. The precondition of resume is weakened: The location f is not visible to U, so callee U can use not all information from caller I. To check what information U is able to access, it is syntactically checked that all locations in ϕ are visible to U. Type Read x specifies a synchronization on the future stored in x. Step 2: Propagation. In the next step we propagate the postcondition of the last process to the precondition of the next process. No process is specified as active between start and resume, so the heap is not modified — thus, the . postcondition of start still holds when resume starts. Adding state = expect to the precondition of resume strengthens the assumption for the type checking of resume. The propagation of conditions results in: prp∗ (G  U) =?starth>i . I!comph>i . Put state = expect . . . ?resumeh∃f. x = f ∧ state = expecti . Read x . Put result > 0 Step 3: Method Types. We generate a method type to specify a method in isolation. Projecting the object type in Step 2 on method resume generates: . . prp∗ (G  U)  resume =?resumeh∃f. x = f ∧ state = expecti.Read x.Put result > 0 Method types share the syntax with object types, and the projection from object types is splitting at positions where one method ends and another starts. Phase 2. After generating method types, Phase 2 of the analysis type checks the implementation of methods against their method types, where the formulas are checked for validity. The type checking of method types guarantees the correct local order of events (Obl. b and c). State specifications are checked by integrating a validity calculus into the type system. To guarantee (Obl. a), we require the following analyses: 5 Causality Graph. We generate a causality graph to ensure deadlock freedom (Obl. a): A deadlock free causality graph for Active Objects is cycle-free [17,25]. A causality graph is also used to ensure that methods of one object are executed in the order specified in the global type that the object obeys to (Obl. b). U I ? ! ? ↓ ? ! ↑ ! ? S ↓ ↓ ↓ The nodes are the local types from the projected object types. An edge connecting two nodes models that the statement for the first type causes the statement for the second type; for example, there are edges from a call to the corresponding receiving type. The graph is partially generated from G, and partially generated from the code: The edge connecting the gray nodes is added by a Points-To analysis, which maps a location of future to the methods resolving this future. The dotted line is considered for cycle-freedom check— the termination of a method causes the next to start— but not for method order check. Model-theoretic Semantics. One of our contribution is defining and verifying protocol adherence from a model-theoretic view: The property that a program follows a specified scenario in the sense that every generated trace is a model for the translation of the global type. We thus define protocol adherence through a logical characterization of global types and translate types into constraints over traces, which are sequences of configurations generated by the program. This declarative approach for defining protocol adherence allows us to connect the FO properties embedded in the type to the execution of methods by using a dynamic logic to capture side-effects. If s is the body of some method m, the dynamic logic formula ϕ → [s]ψ expresses that the first-order formula ψ holds after executing m if ϕ holds in the beginning. If the dynamic logic formula is valid, then for every generated trace, at every position i where m terminates ψ holds if at the corresponding position j < i where it starts ϕ holds. 3 The Core Actor-Based Language using Futures This section introduces Sync, a simple Active Object language based on ABS [28]. Due to space limitation, we present the basic constructs of Sync below, but Projection L G Points-To Future locations Type System SDL-formulas Validity Calculus guarantees guarantees guarantees guarantees through well-formedness Deadlock Freedom Local Action Order Protocol Adherence State Specification Composition Guarantees Fig. 2. Workflow for Phase 2 in our analysis. 6 leave constructs of branching and repetition to later Sections. Sync-program consists of a main statement and a set of actors, which are objects that do have fields and method but do not share states. Inside an object, processes do not interleave such that an active process must terminate before another can be scheduled. Therefore, methods can be considered sequential. We assume standard operations and literals on types of booleans, integers, lists and Object. Definition 1 (Syntax of Sync). Let e denote expressions, T denote data types, x denote variable and field names, X denote object names, and Fut<T> denote future types. · represents possibly empty lists and [·] represents optional elements. Prgm ::= O main{X!m(e)} O ::= object X {M T x = e} M ::= T m(T x){s; return e}     s ::= [Fut<T>] x = X!m(e) | [T] x = e | T x = e.get | skip | s; s Objects communicate only by asynchronous method calls using futures. Upon a method call, a fresh future is generated on callee side and is passed to the caller. The callee writes the return value into the future upon termination of the corresponding process; anyone with the access to the future can read, but not write, into it. Sync is a standard imperative language with two additional statements: (1) x = X!m(e) calls method m with parameters e on object X. The generated future is stored in x. The caller continues execution, while the callee is computing the call on m or scheduling m for later if another process is currently active. (2) e.get reads a value from the future stored in e. If the process computing this future has not terminated, the reading process blocks. To define a small-step reduction relation over events for the semantics of Sync, we first define an event as a process action in communication: Definition 2 (Events). Let f, f 0 range over futures. An event, denoted by ev, is defined by the following grammar: ev ::=iEv(X, X0 , f, m, e) | iREv(X, f, m) | fEv(X, f, m, e) | fREv(X, f, e) | noEv An invocation iEv(X, X0 , f, m, e) models that X calls method X0 .m using f by passing e as parameters. An invocation reaction iREv(X, f, m) models that X starts the execution of m to resolve f . A resolving fEv(X, f, m, e) models that X resolves f , which contains contains e at the moment, by finishing the execution of m. A fetch fREv(X, f, e) models that X reads value e from f . Fig. 3 defines the reduction relation, denoted by →ev , for the semantics. JeKσ,ρ denotes the evaluation of an expression under stores σ and ρ. Rule (call) executes a method call on the object stores in e by generating a fresh future f 0 and an invocation event. The new process is not set as active. By rule (start), the new process becomes active upon creation: the object X must be inactive. An invocation reaction event is generated. Rule (sync) synchronizes on a future f 0 stored in e, by checking whether the configuration contains prc(X0 , f 0 , val(e0 ), σ 0 ), i.e. f 0 is resolved, and reads the return value e0 . Rule (end) terminates a process. In all other rules, the ev parameter is noEv. A configuration is composed of processes and objects. A process has a unique future f , a store σ which maps fields to literals, and the id of its object X. An object has a unique name X, an active future f , and a store ρ which maps variables to literals. 7 C does not contain f 0 (call) JeKσ,ρ = X0 C = ob(X, f, ρ) C0 ev = iEv(X, X0 , f, m, JeKσ,ρ ) c(m, e0 )) C prc(X, f, m(e!m0 (e0 ); s), σ) C →ev prc(X, f, m(s), σ) prc(X0 , f 0 , m0 (M (m0 )), M (start) ev = iREv(X, f, m) prc(X, f, m(s), σ) ob(X, ⊥, ρ) C →ev prc(X, f, m(s), σ) ob(X, f, ρ) C C = prc(X0 , f 0 , val(e0 ), σ 0 ) C0 (sync) (end) JeKσ,ρ = f 0 ev = fREv(X, f, e) prc(X, f, m(e.get; s), σ) ob(X, f, ρ) C →ev prc(X, f, m(s), σ) ob(X, f, ρ) C ev = fEv(X, f, m, e) prc(X, f, m(return e), σ) ob(X, f, ρ) C →ev prc(X, f, val(JeKσ,ρ ), σ) ob(X, ⊥, ρ) C Fig. 3. The semantics rules. Definition 3 (Runtime Syntax of Processes and Objects). The following grammar defines runtime processes and objects as configurations C: C ::= prc(X, f, m(s), σ) | prc(X, f, val(e), σ) | ob(X, f, ρ) | C C A process either is executing a method m for a request carried by f at some object X, represented by prc(X, f, m(s), σ), or has returned e, represented by prc(X, f, val(e), σ). An object ob(X, f, ρ) has its name X, the future of the active process f and the heap ρ. We write ob(X, ⊥, ρ) to indicate that X is inactive. The composition of configurations is commutative and associative, i.e. C C0 = C0 C and C (C0 C00 ) = (C C0 ) C00 . We denote the initial configuration of a program Prgm with I(Prgm). If all processes of a configuration C have terminated, the configuration also terminates. c(m, e) for the The method body of method m is denoted M (m) and we write M initial local store of a task executing m with parameters e. We use traces, sequences of pairs of events and configurations, to capture the behavior of a program. We only consider terminating runs and define big-step semantics Prgm ⇓ tr for finite traces: Definition 4 (Run and Big-Step Semantics). A run from C1 to Cn is a sequence of configurations C1 , . . . , Cn with events ev1 , . . . , evn−1 such that: C1 →ev1 C2 →ev2 . . . →evn−1 Cn A trace tr of a run is a sequence (ev1 , C1 ), . . . , (evm , Cm ) where for every 1 ≤ j < m there is a C such that Cj →evj C is in the run and evj 6= noEv holds. Let Prgm be a Sync program. Prgm generates tr, denoted by Prgm ⇓ tr, if and only if there is a run from its initial configuration to a terminated configuration such that tr is the trace of this run. Dynamic Logic. A dynamic logic combines FO-formulas over the heap with symbolic executions [1,8] of statements. An symbolic execution uses symbolic values to describe a possible set of actual values; and does not reason about one execution of the statement, but describes a set of executions. 8  Example 2. Formula ∃Int a. a > 0 ∧ i > a → [j = i*2;]j > 0 describes that if there is a number a bigger than 0 and smaller than the value stored in i, then after executing j = i*2;, variable j contains a positive value. Based on ABSDL [14], we present Sync Dynamic Logic (short as SDL), which extends first-order logic over program variables and heap memory with modalities that model the effect of statements. In this logic, method parameters are special variables and a modality is a formula [s]ϕ which holds in a configuration, say C, if ϕ holds in every configuration reached from C after executing s. Configurations are FO models where we evaluate modality-free SDL formulas. Definition 5 (Formulas ϕ). We define the set of formulas ϕ and terms t by the following grammar, where p ranges over predicate symbols, f ranges over function symbols, x ranges over logical variables, and v ranges over logical and program variables. The set of all formulas is denoted by SDL. . ϕ ::= tt | ¬ϕ | ϕ ∨ ϕ | p(t . . . t) | t ≥ t | t = t | ∃T x; ϕ | [s]ϕ t ::= v | f(t . . . t) Local program variables (i.e., v) are modeled as special function symbols. To model heap accesses, following Schmitt et al. [35], we use two function symbols store and select with the connecting axiom select(store(heap, f, o, value), f, o) = value where heap is a special local program variable modeling the heap explicitly. A special function symbol result is interpreted as the return value of a method, and a logical variable is free if it is not bound by any quantifier. Definition 6. A formula ϕ is valid if it evaluates to true in every configuration. We differentiate between global formulas which refer to the heap of multiple objects and X-formula which refer only to X. A X-formula, containing only the function symbols for elements from X and special function symbol self that models the reference to X, reasons about X – it can be proven that it holds for a given state, only by checking locally the code of X. A validity calculus for a superset of SDL is presented in [15]. Definition 7. Let ϕ be a formula. The weakened X-formula ϕ@X is obtained by replacing all function symbols in ϕ which are not exclusive to X (i.e., refer to the fields of other objects) by free variables and existentially quantifying over them. Example 3. Let fl be a field, X an object and i the parameter of some method in class X. Consider ϕ = X.fl > 0 ∧ i > X.fl. The formula ϕ is an X-formula, as ϕ = ϕ@X. The weakening for some object X0 is ϕ@X0 = ∃Int a.a > 0 ∧ i > a. ϕ@X0 does not reason about X.fl, but still has the information that i > 1. 4 Behavioral-Type-Based Stateful Specifications of Futures Definition 8 defines a specification language for writing global types to specify the behavior of the system. Due to space limitation, we only represent the key constructs here but leave other constructs to later Sections. 9 Definition 8 (Syntax of Global Types). Let ϕ, ψ range over modality-free SDL formulas and Xi range over object names. [·] denotes optional elements. [x] G ::= main → − X : mhϕi.G G ::= X1 −−→ X2 : mhϕ, ψi.G | X ↑ e.G | End [x] The calling type X1 −−→ X2 : mhϕ, ψi specifies a method call from X1 to m at X2 . If x is written above the arrow, the future of this call must be stored in location x. The SDL-formula ϕ specifies (1) the call parameters passed to the callee and (2) the memory of X1 at the moment of the call. Formula ψ is the postcondition of the callee process and specifies the state of X2 and the return value. The initial method call main → − X : mhψi only specifies the postcondition of the process running X.m. Type X ↑ e specifies a synchronization on the future stored in e. Its parameter e is an expression – it is possible to specify a reading action from a future stored in a list. Every synchronization must be specified. End specifies the end of communication. G denotes a complete protocol with an initializing method call, while G denotes partial types. Even without fields in the formula, the implementation is referenced in the specifications, as the endpoints are object names. Object and method types use share the syntax, together we call them local types. The grammar of local types is defined as follows: Definition 9 (Syntax of Local Types). Let ϕ range over modality-free SDL formulas and Xi range over object names. [·] denotes optional elements. L ::=?mhϕi.L L ::=?mhϕi.L | X![x] mhϕi.L | Put ϕ.L | Read e.L | skip.L | End Receiving type ?mhϕi denotes the start of a process computing m in a state where formula ϕ holds. Here ϕ is a precondition of m and describes the local state and method parameters of m. Type Put ϕ denotes the end of a process in a state where ϕ holds. Here ϕ is a postcondition and describes the return value and the local store. Contrary to global types, a postcondition of a process is not annotated at the call, but at the point of termination, because the point of termination is now explicit. Type X![x] mhϕi corresponds to the caller side of [x] X1 −−→ X2 : mhϕ, ψi. Type Read e models a read from e and skip denotes no communication. We use L to denote a complete local type and L to denote partial types. Projection has three steps: (1) projection of global types on objects, (2) condition propagation, and (3) projection of object types on methods. Projection on Objects. The projection on objects needs to (1) ensure that every object has access to all locations occurring in its specification; and (2) add Put ϕ at the correct position, which requires an additional parameter in the projection to keep track what process is specified to be active and what is its postcondition. To track the postcondition of the last active method of an object, we use a partial function ac : O * SDL, to map objects to formulas. If no method was active on X yet, ac is undefined, written ac(X) = ⊥. The projection of G on an object X is denoted by G ac X. The selected projection rules for methods calls and termination are given in Fig. 4. We write ac⊥ for  the function defined by ψ if X = X0 0 ∀X. ac(X) = ⊥. For updates, we write ac[X 7→ ψ](X ) = . 0 ac(X ) otherwise 10 main − → X2 : mhϕi.G ac X1 =?mhϕ@X2 i.(G ac[X2 7→ψ] X1 ) if ac = ac⊥ ∧ X2 = X1 main − → X2 : mhϕi.G ac X1 = skip.(G ac[X2 7→ψ] X1 ) if ac = ac⊥ ∧ X2 6= X1 x → X2 : mhϕ, ψi.G ac X1 = X2 !x mhϕi.(G ac[X2 7→ψ] X1 ) if ac(X1 ) 6= ⊥ ∧ ϕ = ϕ@X1 X1 −  ?mhϕ@X2 i.(G ac[X2 7→ψ] X1 ) if ac(X2 ) = ⊥ x X1 − → X2 : mhϕ, ψi.G ac X2 = Put ac(X2 ).?mhϕ@X2 i.(G ac[X2 7→ψ] X1 ) if ac(X2 ) 6= ⊥ x → X2 : mhϕ, ψi.G ac X = skip.(G ac[X2 7→ψ] X) if X2 6= X 6= X1 X1 −  Read e.(G ac[X2 7→ψ] X) if ac(X1 ) 6= ⊥ ∧ X1 = X (X1 ↑ e.G 0 ) ac X = skip.(G ac[X2 7→ψ] X) if X1 6= X  Put ac(X).End if ac(X) 6= ⊥ End ac X = End if ac(X) = ⊥ Fig. 4. The selected rules for projection on objects. When projecting on caller X1 , a sending local type is generated if X1 if has an active process (ac(X1 ) 6= ⊥) and the precondition can be proven by the caller (ϕ = ϕ@X1 ). If the callee has an active process (ac(X2 ) 6= ⊥), then for this process the termination type is added before the receiving type; if the callee is specified as being inactive (ac(X2 ) = ⊥), then only the receiving type is added. When projecting on any other object, skip is added. In any case, ac is updated and maps the callee to a new postcondition. In the rest of paper, we omit ac⊥ and write just G  X. Propagation. In our concurrency model the heap does not change if no process is active — all guarantees from the last active process still hold for the next process. By propagation, formulas are added from the postcondition of one method to the precondition of the next. Propagation moves formulas from where they must hold to all points where they still are assumed to hold. Propagation replaces a partial local type, if the partial type matches the given pattern. Definition 10 (Propagation). The propagation function prp is defined via term rewriting (denoted ) as follows. prp∗ denotes the fixpoint of rewriting. Put ϕ.?mhψi Put ϕ.?mhψ ∧ ϕ@Xi where X is the target object Projection on Methods. The projection on a method, say L m0 m, results in a set of method types. A method may have multiple methods types, as long as the method types can are distinguishable. We call the method types in the result set are distinguishable if they have non-overlapping preconditions, e.g., for any two preconditions ϕ1 and ϕ2 , formula ¬(ϕ1 ∧ ϕ2 ) is valid. The rules for projection on a method are straightforward and we refer to Section 2 for an example. Full rules are given in Figure 5. Definition 11 (Well-Formedness). A global type G is well-formed, if the projections on all methods are defined and all types of a method are distinguishable. 11 {(?mhϕi, m)} if m0 = ⊥ Put ϕ m0 m = {(skip, m0 )} otherwise  {(Read e, m0 )} if m = m0 Read e m0 m = {(skip, m0 )} otherwise  00 0 {(X1 !v m hϕi, m )} if m = m0 X1 !v m00 hϕi m0 m = {(skip, m0 )} otherwise ?mhϕi m0 m =  skip m0 m = {(skip, m0 )} (L1 .L2 ) m0 m =  {(Put ϕ, ⊥)} if m = m0 {(skip, ⊥)} otherwise End m0 m = {(skip, m0 )}if m0 = ⊥ {(L01 .L02 , m000 ) | (L01 , m00 ) ∈ L1 m0 ∧m00 6= ⊥ ∧ (L02 , m000 ) ∈ L2 m00 } ∪ {(L02 , m000 ) | (L01 , ⊥) ∈ L1 m0 ∧(L02 , m000 ) ∈ L2 ⊥ } Fig. 5. Projection on Methods. Semantics of Types as Constraints on Traces. To formalize the behavioral types of the last section, we transform them into first-order constraints over traces. We define C as a function transforming global types to constraints on traces. Recall that we have defined C for configurations and ev for events. The primitive C(i) references the ith configuration and ev(i) references the ith event in a trace. We use events and formulas as colors and thus include futures, method names, literals and object names in the domain. Constraints refer to SDL formulas ϕ with C(i) |= ϕ, meaning that in the ith configuration, ϕ holds. The translation of G1 .G2 models that there is a position i such that, the C(G1 ) holds on the subtrace before i and the C(G2 ) holds on the subtrace after i. To construct such a constraint, we use relativization [24], a syntactic restriction of a constraint γ to a substructure described by another constraint χ. Definition 12. Let χ be a constraint with a free variable x of data type T and γ a constraint. We denote the relativization of γ with χ by γ[x ∈ T/χ]. For all quantifiers of type T in constraint γ, relativization adds χ(x) as restrictions. The main rule for relativization is (∃y ∈ T.γ)[x ∈ T/χ] = ∃y ∈ T.χ(y) ∧ γ[x ∈ T/χ]. The following example relativizes a constraint over natural numbers: γ = ∀i ∈ N. isEven(i) ⇒ ∃j ∈ N. j < i χ=k≥1 γ[k ∈ N/χ] = ∀i ∈ N. i ≥ 1 ⇒ isEven(i) ⇒ ∃j ∈ N. j ≥ 1 ∧ j < i The rules for translating G into a constraint C(G) are defined as follows. Definition 13 (Semantics of Global Types). Predicate res(i) holds if ev(i) is a resolving event and A(i, X) holds if X is active in C(i). . C(main − → X2 : mhψi.G) = ∃j, k. ∃f. ∃e0 . ev(j) = iREv(X2 , f, m) ∧ C(j) |= ϕ@X2 ∧ . 0 ev(k) = fEv(X2 , f, e ) ∧ C(k) |= ψ ∧ ∀l.l 6= j ∧ l 6= k ⇒ res(l) ∧ C(G) x C(X1 − → X2 : mhϕ, ψi) = ∃i, j, k. ∃f. ∃e, e0 . . . ev(i) = iEv(X1 , X2 , f, m, e) ∧ C(i) |= ϕ ∧ ev(j) = iREv(X2 , f, m) ∧ C(j) |= ϕ@X2 ∧ . . ev(k) = fEv(X2 , f, e0 ) ∧ C(k) |= ψ ∧ C(i) |= X1 .x = f ∧ ∀l. l 6= i ∧ l 6= j ∧ l 6= k ⇒ res(l) C(X1 − → X2 : mhϕ, ψi) = ∃i, j, k. ∃f. ∃e, e0 . 12 . . ev(i) = iEv(X1 , X2 , f, m, e) ∧ C(i) |= ϕ ∧ ev(j) = iREv(X2 , f, m) ∧ C(j) |= ϕ@X2 ∧ . 0 ev(k) = fEv(X2 , f, e ) ∧ C(k) |= ψ ∧ ∧∀l. l 6= i ∧ l 6= j ∧ l 6= k ⇒ res(l) . . C(X ↑ e) = ∃i. ∃f. ∃e0 . ∃X0 . ev(i) = fREv(X, X0 , f, e0 ) ∧ C(i) |= e = f ∧ ∀l. l 6= i ⇒ res(l) ^  C(G1 .G2 ) = ∃i ∈ N. C(G1 )[j ∈ N/A(j, X) ⇒ j < i] ∧ C(G2 )[j ∈ N/A(j, X) ⇒ j ≥ i] X C(End) = true The constraint describing the call type is that the three events modeling (1) call, (2) start of the process and (3) termination of the process exist and that at the configurations for these events, the projected formulas hold. Every other event is a fEv: The exact position of termination (i.e., fEv events) is not specified in global types, so we do not constrain them. Reading from a location is defined analogously, and sequential composition is described above. Expressing a global type as a constraint on traces also enables us to connect the types with SDL, because the semantics of SDL is defined in terms of traces. Consider again Example 2: If the statement s in the modality is the body of a method m with precondition ϕ and postcondition ψ, then the formula ϕ ⇒ [s]ψ expresses that if ev(i) is the invocation reaction event of m and C(i) |= ϕ, then at position j where the corresponding resolving event is, C(j) |= ψ holds. We also give a translation of local types: C(L1 . L2 ) = ∃i ∈ N. C(L1 )[n ∈ N/n < i] ∧ C(L2 )[n ∈ N/n ≥ i] C(?mhϕi) = ∃i. ∀j. i = j ∧ ∃f. iREv(X, f, m) ∧ C(i) |= ϕ@X . C(X0 !x mhϕi) = ∃i. ∀j. i = j ∧ ∃f, e. iEv(X, X0 , f, m, e) ∧ C(i) |= ϕ@X ∧ C(i) |= (x = f ) C(X0 !mhϕi) = ∃i. ∀j. i = j ∧ ∃f, e. iEv(X, X0 , f, m, e) ∧ C(i) |= ϕ@X C(Put ϕ) = ∃i. ∀j. i = j ∧ ∃f, e. fEv(X, f, e) ∧ C(i) |= ϕ@X C(Read e) = ∃i. ∀j. i = j ∧ ∃f. fREv(X, X0 , f, e0 ) ∧ e = f C(End) = true 5 Analysis While our aim is to verify protocol adherence, we also verify deadlock freedom, which additionally requires the Points-To analysis. Deadlock freedom is equivalent to cycle-freedom of causality graphs [17] in Active Objects. The causality graph of a global type G is G(G) = (V, E). Each node L ∈ V is a singular partial local type, and each edge (L1 , L2 ) ∈ E models that L2 must happen after L1 . Definition 14 (Causality Graph). Let G be a well-formed global type. The nodes of its causality graph G(G) are all local types derived from projecting G on all endpoints of G. An edge (L1 , L2 ) is added if either (1) L1 .L.L2 is a partial type for some L in some projection on some object in G or (2) L1 is a sending type and L2 is a receiving type derived from the projection of a calling type. 13 Note that global types do not contain sufficient information to deduce all causality, e.g., the causality of get statements can not be deduced from a global type because synchronizations on futures are specified over locations. We use a Points-To analysis for futures [17] instead. For generating a causality graph, we first derive a partial causality graph from the global type, and then we apply the Points-To analysis during type checking for the graph completion by deducing the missing edges. The Points-To analysis, defined below, determines what methods are responsible to resolve the futures in a given expression. Definition 15 (Points-To). Given an expression e in a program, the PointsTo analysis determines the set p2(e) of methods such that there is a reachable configuration C = ob(X, f, ρ) prc(X, f, m(s), σ) C0 with JeKσ,ρ = f and m ∈ p2(e). Whenever a e.get-statement is checked against a type Read e, edges between the node of termination type of the methods which e can point to, and the node of the current type Read e, are added. The graph on page 6 is admissible: Definition 16 (Admissibility). A causality graph is admissible if (1) every path is cycle-free and (2) for every object X, for any pair of receiving types of X, there exists a connecting path without an edge of the form (Put ϕ, ?mhψi). Type System and Analysis. Auxiliary SDL-formula post(X.m, ϕ) models that the value in every future resolved by X.m satisfies ϕ, while formula Post(G) represents the conjunction of all postconditions specified in G. Figure 6 gives the selected typing rules that invokes validity calculus [15] and Points-To analysis. Before introducing the typing rules, we define Roles(G) as the set of in G, G(G)+E as the set of edges of G(G) and E (i.e., E are added into G(G)), term(m) as the set of ↓ nodes of method m, and node(s) as the set of nodes referring to the types that have typed s. We define three kinds of type judgments: The Type Judgment for Programs. ` Prgm : G checks Prgm against global type G. The well-formedness of G is ensured during type checking. Rule (TMain) checks that every endpoint in G is implemented in Prgm, the main block makes the correct initializing call and checks each object against its object type. The edges collected from the typing rules for objects are added to the partial causality graph G(G) and the resulting graph is checked for admissibility. The Type Judgment for Objects. Φ ` O : L B E checks whether O is well-typed by L under a given E with Φ. E is a set of causality edges and Φ is a set of SDL formulas. Rule (T-Object) projects L on all methods, checks each method mi by L  mi and collects all resulting edges. The Type Judgment for Statements. Φ, s ` s : L B E checks whether s is welltyped by L under a given E with Φ, s. The environment s are the statements type-checked so far. Whenever an SDL formula is checked, a validity check is performed and s is added in the modality to consider the side-effects on the heap memory so far. These are not recorded in E: The causality edges only record 14 (T-Main) S Oi = object Xi {. . . } iRoles(G) = {X1 , . . . , Xn } G(G) + i≤n Ei admissible ∃j ≤ n. G = main − → Xj : mhϕi.G ∀i ≤ n. Post(G) ` Oi : prp∗ (G  Xi ) B Ei (T-Object) ` O1 . . . On main{Xj !m()} : G ∀i ≤ n. L ac mi =?mi hϕi i.Li S ∀i ≤ n. Φ, ϕi , skip ` si : Li B Ei E = i≤n Ei Φ ` object X{T1 m1 (T x){s1 } . . . Tn mn (T x){sn } Φ ⇒ [s; return e]ϕ (T-Return) Φ, s ` return e : Put ϕ B E (T-Call) Φ, s; X!m(e) ` s0 : L B E Φ ⇒ [s; X!m(e)]ϕ (T-Call-2) Φ, s; T x = X!m(e) ` s0 : L B E Φ ⇒ [s; T x = X!m(e)]ϕ Φ, s ` T x = X!m(e); s0 : X!x mhϕi.L B E (T-Assign) Φ, s ` X!m(e); s0 : X!mhϕi.L B E T x = e} : L B E Φ, s; T x = e ` s0 : L B E 0 Φ, s ` T x = e; s0 : L B E Φ, s; T x = e.get ` s0 : L B E 0 E = E ∪ {(n, n )|∃m ∈ p2(e). n ∈ term(m) ∧ n0 ∈ node(s; e.get)} 0 (T-Get) 0 Φ, s ` T x = e.get; s0 : Read e.L B E Fig. 6. The selected typing rules. which method a get statement synchronizes on. Rule (T-Return) checks that after executing all the type-checked statements, the return statement results in a state where ϕ holds. Rule (T-Call) also checks the formula ϕ which describes the state when the call has to be executed. Rule (T-Get) additionally executes the Points-To analysis and adds all the edges as described in the previous section. Theorem 1 (Deadlock Freedom and Protocol Adherence). Let Prgm be a program and G be a global type. If Prgm is well-typed against G then (1) Prgm does not deadlock and (2) every generated trace from Prgm satisfies C(G):  ` Prgm : G → ∀tr. Prgm ⇓ tr → tr |= C(G) Decidability and Types for Validation. The judgment ` Prgm : G is undecidable if the validity of the FO logic used for specifying side-effects is undecidable. A developer can choose an FOL fragment with decidable validity to trade off between expressiveness and analyzability, e.g., if the developer of the analysis chooses a more restricted fragment, which may limit the expressiveness of the specification, then the validity of the FO logic used for specifying side-effects may become decidable. When using an undecidable FOL fragment, our approach can be used as a validation tool to check whether the implemented (sub-)system will be behaving as expected. Our approach is able to be integrated into the development process similarly as invariant-based approaches, and applies techniques proposed by MPST to connecting global and local views of concurrent programs, a notoriously difficult problem when using contracts and invariants [15]. 15 Protocol Adherence. Current work on MPST defines protocol adherence as a fidelity theorem, which defines that every sequence of interactions in a session follows the scenario declared in MPST [27] as follows: An operational semantics for types is defined and it is shown that the semantics of the language is a refinement of the semantics of the types. Similarly, behavioral contracts [11] define protocol adherence by compliance, which compares the interaction of contracts. These are operational approaches to specification. We define protocol adherence from a declarative perspective: We define a property that we require to hold for all traces of a well-typed program. A declarative specification can be analyzed with tools for logical specification, and can enable easier integration of other static analysis tools (e.g., to consider state), since they are only required to have a logical characterization or to be specified over traces. 6 Loops In this section, we extend the syntax with loop and use a Kleene-star types (G)∗ϕ (resp. (L)∗ϕ ), which repeats the type G (resp. L) finitely often. The formula ϕ is a loop invariant and has to be satisfied whenever a loop iteration starts or ends. Definition 17 (Syntax with Repetition). s ::= . . . | while(e){s} G ::= . . . | (G)∗ϕ .G L ::= . . . | (L)∗ϕ . L By syntactic restrictions, the local type of an object cannot have the form of (L)∗ϕ .L0 , i.e., it is not allowed to start with a loop. The reason for this restriction is that every loop has an invariant that an object must guarantee before executing the next iteration. If an object is not active before the loop, it can not guarantee the invariant in the very beginning. In the following, we give the projection rules for loop. Definition 18 (Projection Rules for Loops). The auxiliary predicate rcv (X, G) holds if X is specified as being called in G.   Put ac(X).(L00 )∗ϕ@X .L0 if L 6= skip ∧ rcv (X, G) ∧ ac(X) 6= ⊥  ∗ 0 if L 6= skip ∧ ¬rcv (X, G) ∧ ac(X) 6= ⊥ (G)ϕ .G ac X = (L)∗ϕ@X .L0  0 L if L = skip Where G.End ac[X7→⊥] X = L00 ,G ac X = L and G 0 ac X = L0   if m00 = m0 ∧ L (m00 ) m0 6= {(skip, m000 )}  (L m00 m0 )∗ϕ , m00 ∗ 0 0 (L)ϕ m00 m = L (m00 ) m if m00 6= m0 ∧ L (m00 ) m0 6= {(skip, m000 )}  00 {(skip, m )} L (m00 ) m0 = {(skip, m000 )} The first rule projects global types to object types. The first case is applied if the object participates in the repetition of the inner type G by being repeatedly called. The last active process must terminate first and the repeatedly called method must terminate within the repetition. The termination inside the loop 16 is ensured by projecting the inner type with an appended End. The second case is applied if the object participates with only one active process in the whole repeated communication (L 6= skip ∧ ¬rcv (X, G) ∧ ac(X) 6= ⊥). Finally, the last case removes the repetition if the object does not participate in it. Note that there is no case where the object is repeatedly called, but not active before, following the syntactic restriction discussed above. The second rule projects object types to methods. The rule distinguishes its cases by checking if the whole process is inside the repetition or not. If the process is completely inside, the repetition is removed, as it is not visible to the method. Definition 19 (Rules for Propagation for Loops). (1) Put ϕ . (L)∗ψ (3) (L)∗ϕ 0 (4) . (L)∗ψ (?m hϕi . L . Put ϕ ∧ ψ . (L)∗ψ (L)∗ϕ∧ψ Put ϕ0 )∗ψ . (2) (L)∗ψ . ?m0 hϕi (L)∗ψ . ?m0 hϕ ∧ ψi (L)∗ψ 0 (?m hϕ ∧ ψi . L . Put ϕ0 ∧ ψ)∗ψ A fixpoint operator for propagation is used in presence of loops. Loop invariants have to hold before the first repetition, so the first rule ensures that the last process before a repetition satisfies the invariant when terminating. The second rule adds an invariant to the next process (for the same reason as the first rule). The third rule is another case of the first one, in case two repetitions are succeeding each other. Finally, the last rule adds the invariant to the processes inside the repetition. This rule enables the type system to use the invariant in the first method of the repetition and ensures that the last method reestablishes the invariant. For loops, first-order constraints, however, are not expressive enough. The constraint with the Kleene star resemble regular languages and we thus use monadic second order logic (MSO) to capture repetition. MSO extends firstorder logic with a quantifier ∃Y ⊆ Z which quantities over subsets of Z and a ∈ primitive to express membership of those sets. Definition 20 (Translation into MSO).  C(Gϕ∗ ) = ∃X ⊆ N. ∃i, j ∈ X. ∀k ∈ N. i < k ≤ j ∧ ∀i ∈ X. C(i) |= ϕ∧     ∀i, j ∈ X. ∀k ∈ X. k ≥ j ∨ k ≤ i ⇒ C(G) [n ∈ N/i < n ≤ j]  C(L∗ϕ ) = ∃X ⊆ N. ∃i, j ∈ X. ∀k ∈ N. i < k ≤ j ∧ ∀i ∈ X. C(i) |= ϕ∧   ∀i, j ∈ X. ∀k ∈ X. k ≥ j ∨ k ≤ i → C(L) [x ∈ N/i < x ≤ j] For both global and local types, repetition uses a set of boundary indices X, between which the inner translation must hold plus constraints for the invariant. We give the following typing rule for loops, which resembles loop invariant rules from the Hoare or sequent calculi. 17 Definition 21 (Typing Rule for Loops). (T-While) ϕ ∧ Post(G), skip ` s : L B E Φ ⇒ [s00 ]ϕ ϕ ∧ Post(G) ⇒ [s]ϕ ϕ ∧ Post(G), skip ` s : L B E 0 E = E 0 ∪ E 00 0 0 00 Φ, s00 ` while e {s}; s0 : (L)∗ϕ . L0 B E The first premise continues the type checking of the program, in an environment where only the information in the invariant (and the global information in Post, as defined in Section 5 is available. The second premise checks that the invariant holds initially and the third premise checks that the invariant is preserved by the loop body. The forth premise checks the loop body and the last premise combines the derived causality edges. The extension of the causality graph is described in [29]. Example 4. Consider a big data analysis webtool like amazon cloud with a clientside GUI U and a server-side computational server S. U is a state-machine and we model the following scenario: U sends data to the computational server. To stay responsive, U ends its initial process, but is called repeatedly by the server to update the progress. Whenever U is updated, the server also gets information whether the GUI is hidden on the users screen or not. The sequence diagram in Figure 7 illustrates the protocol. S comp update run U Fig. 7. Sequence Diagram for Example 4 Example 5. It is important to specify the behavior of the state of U. One needs to ensure that during updating, U stays in a state expecting to receive updates from the server: The field expect that saves the data is not Nil; A specification is  ∗ x main − → G : runh>i . G − → S : comp . S − → G : update . S ↑ x U.expect6=Nil . end The formula U.expect 6= Nil is the invariant, that the field expect is a nonempty list. The type S ↑ x describes that the server reads the return value from 18 the variable x and the previous action stores the future that identifies the call to the update in x. Every read from futures must be annotated, as these are critical for deadlock: If the process running start would attempt to read from the future for comp, then the system would deadlock: U has an active process waiting for S and S has an active process waiting for a call to update, which can not be processed as U has already an active process. The local type for the method update of U is ?updatehself .expect 6= Nili.Put self .expect 6= Nil There is no repetition, because the repetition is only visible for the object, not a single process. Thus the pre- and postcondition are derived from the invariant. Similarly, there is no End, because the End type models the termination of the protocol which again in visible for the object (no more incoming messages arrive) but not for a single process. Example 6. The code in Figure 8 implements the behavior of the GUI and the Server from Example 4 and can be checked with the types from Example 5. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 object U{ List<Int> expect = Nil; Unit run(List<Int> l){ S!comp(l); expect = l;} Bool update(Int val, Int res){ return updateScreen(expect,val,res); //crashes if called in wrong state } } object S{ Unit comp(List<Int> l){ Int i = 0; while(i < length(l)){ Int res = compute(l[i]); //dummy Fut<Bool> b = U!update(l[i],res); b.get; i++; } } } Fig. 8. The code for Example 4, with loop. 7 Branching Active Object have multiple ways to communicate the choice how to continue the protocol and how an object reacts on it: 19 – (1) The choice is communicated via method selection, i.e., each branch corresponds to a different method call. – (2) The choice is communicated via futures, i.e., other objects must react to the choice of an object by reading its future. – (3) The choice is communicated via the heap memory, i.e., processes must behave according to some condition for the memory. We aim to stick with standard imperative statements and must regard the restriction that an if statement can only choose between two branches, while a protocol may describe more than two. In our analysis of branching, choice is communicated: – (1) method calls and condition on the passed data for new process running on other objects – (2) the condition on future for already running processes running on (possibly) other objects. – (3) via post-conditions to processes running later on the same object. Definition 22 (Syntax with Branching). s ::= . . . | if(e)s else s fi   G ::= . . . | X hϕi i, Xij hϕij i j∈J ; Gi i∈I L ::= . . . | ⊕ {Li }i∈I | &{X.mhϕi i; Li }i∈I   The global type X hϕi i, Xij hϕij i j∈J ; Gi i∈I describes that X chooses a branch Gi . The formulas ϕi are additional postconditions for the choosing  process. Other process can read the choice by reading this future. In Xij hϕij i j∈J , we describe that the currently active process of Xij has the additional postcondition ϕij . The local type ⊕{Li }i∈I is an active choice and &{X.mhϕi i; Li }i∈I is a passive choice. The branch must be taken by reading the future from X.m and evaluating ϕi . Definition 23 (Projection Rules for Branching). Given the ith branch hϕi i, Xij hϕij i j∈J ; Gi , we denote the updated ac function with aci = ac[X 7→ ac(X) ∧ ϕi @X][Xij 7→ ac(Xij ) ∧ ϕij @Xij ]j∈J The auxiliary predicate allAct states that all mentioned objects and occur in all branches are active and dist states that a set of formulas does not overlap. ^ allAct = ac(X) 6= ⊥ ∧ i∈I ac(Xij ) 6= ⊥ ∧ ∀i, i0 ∈ I. ∀j. Xij = Xi0 j j∈J dist({ϕ1 , . . . , ϕn }) = ∀i, j < n. i 6= j → (ϕi ∧ ϕj is unsatisfiable) Figure 9 shows the projection rules for branching. The projection rule from global to object-local types has four cases: the first two are straightforward for the choosing process and the currently active reacting processes. The third case handles objects which behave the same in all branches and the forth handles objects which are active in only one. The projection on the 20 passive choice moves the Read type from its position after the choice in front of it: The global type has no explicit point where a process terminates, thus the read must be after the choice which adds the postcondition to the choosing process. However the get statement must be before the if statement, which relies on the read value in the guard.  ⊕{Li }i∈I    0  &{X.mhϕ  i @X i; Li }     0 X hϕi i, Xij hϕij i j∈J ; Gi i∈I ac X = L   L    if if if if X = X0 ∧ allAct ∧ Gi aci X0 = Li Xij = X0 ∧ allAct ∧ Gi aci X0 = Li ac(X0 ) = ⊥ ∧ ∀i. Gi aci X0 = L ac(X0 ) = ⊥ ∧ ∃i. Gi aci X0 = L ∧∀j 6= i. Gj acj X0 = skip S Li m0 m if m 6= m0 ⊕{Li }i∈I m0 m =  i∈I ⊕ {Li }i∈I if m = m0 ∧ ∀i ∈ I. Li m0 m = L0i S if m 6= m0   i∈I Li m0 m Read e.&{X.mhϕi i; Li }i∈I if m = m0 ∧ dist((ϕ0i )i∈ I )∧ &{X.mhϕi i; Li }i∈I m0 m =  ∀i ∈ I. Li m0 m = L0i = Read e.L00i Fig. 9. Projection Rules for Branching Definition 24 (Translation into MSO for Branching). For the translation into MSO constraints, we use the auxiliary predicate firstTerm(i, X) that states that the ith position in the trace refers to the first resolving event from X and the auxiliary predicate lastTerm(i, X.m) that states that the ith position in the trace refers to the last resolving event of X.m.  . firstTerm(i, X) =∀j. ∃f. ∃m. ∃e. ev (j) = fEv(X, f, m, e) → i ≤ j  . lastTerm(i, X.m) =∀j. ∃f. ∃e. ev (j) = fEv(X, f, m, e) → i ≥ j Additionally to the translation of the branches, it encodes that the choosing process terminates before any process that relies on the communication of its choice via the return value. The rules are as follows: _ i∈I     C X hϕi i, Xij hϕij i j∈J ; Gi i∈I =  ^  C(Gi ) ∧ ∃k. firstTerm(k, X)∧ ∃kj . firstTerm(kj , Xij ) ∧ k ≥ kj ∧ σ(h)[kj ] |= ϕij j∈J C(⊕{Li }) = _ C(&{X.Mhϕi i; Li }) = _ C(Li ) i i  ∃j ∈ N. lastTerm(j, p.m) ∧ σ(j) |= ϕi ∧ C(Li ) In the following we present the rules for branching. The typing rules split the branches into two disjoint sets and shows that the guard of the if statement together with the added choice-conditions of the branch selects the correct 21 continuation of the type. Once the sets of branches are singletons, the choice operators can be removed. Definition 25 (Typing Rules). (T-Offer) I = I1 ∪ I2 I1 ∩ I2 = ∅ E = E1 ∪ E2 ∀i ∈ I1 . Φ ∧ post(X.m, ϕi ) ⇒ e) ∀i ∈ I2 . Φ ∧ post(X.m, ϕi ) ⇒ ¬e) W Φ; e; Wi∈I1 post(X.m, ϕi ), s ` s0 ; s000 : &{X.mhϕi i; Li }i∈I1 B E1 Φ; ¬e; i∈I2 post(X.m, ϕi ), s ` s0 ; s000 : &{X.mhϕi i; Li }i∈I2 B E2 Φ, s ` if e then s0 else s00 fi ; s000 : &{X.mhϕi i; Li }i∈I B E (T-Offer-Single) (T-Select-Single) Φ, s ` s : L B E Φ, s0 ` s : L B E 0 Φ, s0 ` s : &{X.m : ϕ; L} B E Φ, s0 ` s : ⊕{L} B E I = I1 ∪ I2 I1 ∩ I2 = ∅ E = E1 ∪ E2 Φ; e, s ` s ; s : ⊕{Li }i∈I1 B E1 Φ; ¬e, s ` s00 ; s000 : ⊕{Li }i∈I2 B E2 0 (T-Select) 000 Φ, s ` if e then s0 else s00 fi ; s000 : ⊕{Li }i∈I B E The extension of the causality graph is described in [29]. We use the following example to illustrate how we handle branching. Example 7. Consider the scenario: Client X1 wants to access data on server X2 and sends its login data by calling method acc. Then X2 decides. If the login data is invalid, X2 logs the denied access by calling logging server S and returns −1 to X1 ; if the access succeeds, it returns the data, a value > 0, to X2 . X1 reacts on the return value and returns a boolean indicating whether the access was successful. This is formalized by the following type: x main − → X1 : start . X1 − → X2 : acc.X2   . → S : log.End hresult = −1i X1 h¬resulti ; X1 ↑ x.X2 − hresult > 0i X1 hresulti ; X1 ↑ x.End The local type for X1 .start is the following. Note that the Read type is now before the branching. ?start.X2 !x acc.Read x.& 8   . X2 .acchresult = −1i ; Put ¬result X2 .acchresult > 0i ; Put result Conclusion and Related Work In this paper, we propose a two-phase analysis, which gives developers a means to specify and verify protocols where information is not only transmitted via asynchronous method calls but also through the heap memory of Active Objects; and the model-theoretic semantics, which give a declarative definition of protocol adherence. The following works are related: 22 Actors and Objects. Our previous type system for Active Objects [30] cannot specify and verify state and future passing. Furthermore, we do not need to check the scheduler in this work. Crafa and Padovani [12,34] investigate behavioral types for the object-oriented join calculus with typestate, a concurrency model similar to actors, but with an encoding for futures. Gay et al. [18] model channels as objects, integrating MPST with classes; Dezani-Ciancaglini et al. [13] use MPST in the object-oriented language MOOSE, where types describe communication through shared channels. We ensure deadlock freedom with the approach similar to Giachino et al. [20,21], who ensure deadlock freedom by inferring behavioral contracts and applying a cycle detection algorithm; however, they do not consider protocol adherence. State and Contracts. In an non-object-oriented setting, Bocchi et al. [4,5,6] develop a MPST discipline with assertions for endpoint state. The specifications use global values in global types and require complex checks for history-sensitivity and temporal-sensitivity to ensure that an endpoint proves its obligations. They explicitly track values over several endpoints, while we implicitly do so by equations over locations. In a stateless setting, Laneve and Padovani [31] combine contracts and behavioral types, and Toninho and Yoshida use dependent MPST [37] to reason about passed data. Logics. Session types as formulas have been examined by Caires et al. [9] and Carbone et al. [10] for intuitionistic and linear logics as types-as-proposition for the π-calculus. In our work, we examine a dynamic logic combines FO-formulas, called SDL, over the heap with symbolic executions of statements, and examine a declarative formulation of protocol adherence. 23 References 1. Anand, S., and Harrold, M. J. Heap cloning: Enabling dynamic symbolic execution of java programs. In ASE’11 (2011), IEEE Computer Society, pp. 33– 42. 2. Ancona, D., Bono, V., and Bravetti, M. Behavioral Types in Programming Languages. Now Publishers Inc., Hanover, MA, USA, 2016. 3. Baker, H. G., and Hewitt, C. The incremental garbage collection of processes. SIGART Newsletter 64 (1977), 55–59. 4. Bocchi, L., Demangeon, R., and Yoshida, N. A multiparty multi-session logic. In TGC’12 (2012), vol. 8191 of LNCS, Springer, pp. 97–111. 5. Bocchi, L., Honda, K., Tuosto, E., and Yoshida, N. A theory of design-bycontract for distributed multiparty interactions. In CONCUR’10 (2010), vol. 6269 of LNCS, Springer, pp. 162–176. 6. Bocchi, L., Lange, J., and Tuosto, E. Three algorithms and a methodology for amending contracts for choreographies. Sci. Ann. Comp. Sci. 22, 1 (2012), 61–104. 7. Boer, F. D., Serbanescu, V., Hähnle, R., Henrio, L., Rochas, J., Din, C. C., Johnsen, E. B., Sirjani, M., Khamespanah, E., Fernandez-Reyes, K., and Yang, A. M. A Survey of Active Object Languages. ACM Comput. Surv. 50, 5 (2017), 76:1–76:39. 8. Cadar, C., and Sen, K. Symbolic execution. In RV’12 (2012), vol. 7687 of LNCS, Springer, p. 2. 9. Caires, L., and Pfenning, F. Session types as intuitionistic linear propositions. In CONCUR’10 (2010), vol. 6269 of LNCS, Springer, pp. 222–236. 10. Carbone, M., Lindley, S., Montesi, F., Schürmann, C., and Wadler, P. Coherence generalises duality: A logical explanation of multiparty session types. In CONCUR’16 (2016), vol. 59 of LIPIcs, Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, pp. 33:1–33:15. 11. Castagna, G., Gesbert, N., and Padovani, L. A theory of contracts for web services. ACM Trans. Program. Lang. Syst. 31, 5 (2009), 19:1–19:61. 12. Crafa, S., and Padovani, L. The chemical approach to typestate-oriented programming. ACM Trans. Program. Lang. Syst. 39, 3 (2017), 13:1–13:45. 13. Dezani-Ciancaglini, M., Drossopoulou, S., Mostrous, D., and Yoshida, N. Objects and session types. Information and Computation 207, 5 (2009), 595 – 641. 14. Din, C. C., Bubel, R., and Hähnle, R. Key-abs: A deductive verification tool for the concurrent modelling language ABS. In CADE’15 (2015), vol. 9195 of LNCS, Springer, pp. 517–526. 15. Din, C. C., and Owe, O. A sound and complete reasoning system for asynchronous communication with shared futures. J. Log. Algebr. Meth. Program. 83, 5-6 (2014), 360–383. 16. Din, C. C., Tarifa, S. L. T., Hähnle, R., and Johnsen, E. B. History-based specification and verification of scalable concurrent and distributed systems. In ICFEM’15 (2015), vol. 9407 of LNCS, Springer, pp. 217–233. 17. Flores-Montoya, A., Albert, E., and Genaim, S. May-happen-in-parallel based deadlock analysis for concurrent objects. In FMOODS/FORTE’13 (2013), vol. 7892 of LNCS, Springer, pp. 273–288. 18. Gay, S. J., Gesbert, N., Ravara, A., and Vasconcelos, V. T. Modular session types for objects. Logical Methods in Computer Science 11, 4 (2015). 24 19. Gay, S. J., Vasconcelos, V. T., Wadler, P., and Yoshida, N. Theory and applications of behavioural types (dagstuhl seminar 17051). Dagstuhl Reports 7, 1 (2017), 158–189. 20. Giachino, E., Henrio, L., Laneve, C., and Mastandrea, V. Actors may synchronize, safely! In PPDP’16 (2016), ACM, pp. 118–131. 21. Giachino, E., Laneve, C., and Lienhardt, M. A framework for deadlock detection in coreabs. Software & Systems Modeling 15, 4 (Oct 2016), 1013–1048. 22. Halstead Jr., R. H. Multilisp: a language for concurrent symbolic computation. ACM TOPLAS 7, 4 (1985), 501–538. 23. Harel, D. First-Order Dynamic Logic. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 1979. 24. Henkin, L. Relativization with respect to formulas and its use in proofs of independence. Compositio Mathematica 20 (1968), 88–106. 25. Henrio, L., Laneve, C., and Mastandrea, V. Analysis of synchronisations in stateful active objects. In iFM’17 (2017), vol. 10510 of LNCS, Springer, pp. 195– 210. 26. Hewitt, C., Bishop, P., and Steiger, R. A universal modular ACTOR formalism for artificial intelligence. In Proceedings of the 3rd International Joint Conference on Artificial Intelligence (1973), IJCAI’73, Morgan Kaufmann Publishers Inc., pp. 235–245. 27. Honda, K., Yoshida, N., and Carbone, M. Multiparty asynchronous session types. J. ACM 63, 1 (Mar. 2016), 9:1–9:67. 28. Johnsen, E. B., Hähnle, R., Schäfer, J., Schlatte, R., and Steffen, M. ABS: A core language for abstract behavioral specification. In FMCO’10 (2010), pp. 142–164. 29. Kamburjan, E. Session Types for ABS. Tech. rep., TU Darmstadt, 2016. http://formbar.raillab.de/en/techreportsessiontypesabs/. 30. Kamburjan, E., Din, C. C., and Chen, T. Session-based compositional analysis for actor-based languages using futures. In ICFEM’16 (2016), vol. 10009 of LNCS, Springer, pp. 296–312. 31. Laneve, C., and Padovani, L. The Pairing of Contracts and Session Types. In Concurrency, Graphs and Models (Ugo65’08) (2008), vol. 5065 of LNCS, Springer, pp. 681–700. 32. Lavender, R. G., and Schmidt, D. C. Pattern languages of program design 2. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1996, ch. Active Object: An Object Behavioral Pattern for Concurrent Programming, pp. 483–499. 33. Odersky, M et al. Scala programming language. http://www.scala-lang.org. 34. Padovani, L. Deadlock-Free Typestate-Oriented Programming. Submitted to The Art, Science, and Engineering of Programming, preprint available under https://hal.archives-ouvertes.fr/hal-01628801/file/main.pdf, Nov. 2017. 35. Schmitt, P. H., Ulbrich, M., and Weiß, B. Dynamic frames in Java dynamic logic. In FoVeOOS’10 (2011), vol. 6528 of LNCS, Springer, pp. 138–152. 36. Tasharofi, S., Dinges, P., and Johnson, R. E. Why do scala developers mix the actor model with other concurrency models? In ECOOP’13 (2013), vol. 7920 of LNCS, Springer, pp. 302–326. 37. Toninho, B., and Yoshida, N. Certifying data in multiparty session types. J. Log. Algebr. Meth. Program. 90 (2017), 61–83. 25 A Soundness The proof for Theorem 1 is similar to the proof for Theorem 2 in [29], we thus only give a sketch and point out where the proofs differ. Propagation First, we state the correctness of propagation. Let tr X be the projection of trace tr on X, i.e., tr X results from tr by replacing all events not issued by X. Lemma 1. Let Prgm be a program and G a type for Prgm. If in all traces produced by Prgm, the order of invocation events is the same, then every trace that satisfies the translation of the propagated type iff it satisfies the translation of the original type: ` Prgm : G → ∀tr. ∀X. Prgm ⇓ tr → tr X |= C(prp∗ (G  X)) ↔ tr X |= C(G  X)  Proof. We fix X and denote G  X with L. We show this by induction on the number n of applications of prp for the fixpoint. Induction Base, n = 0 Then prp∗ (L) = L and the lemma holds trivially. 0 Induction Step, n = n0 + 1 By induction hypothesis there is a type L0 = prpn (L) such that the desired property holds. We make a case distinction on the applied case in the definition of prp in its last application: - Case 1 Put ϕ.?mhψi Put ϕ.?mhψ ∧ ϕ@Xi In this case we have to show that the start of execution of method m the formula ψ as holds. Let m0 be the method whose termination action Put ϕ is responsible for ϕ. By assumption, the order of invocation events is fixed and the program can be typed. Thus, there is no trace such that between the invocation action of m0 and m, there is another invocation event. Thus, each trace tr that contains pairs of the form (iREv(X, f, m), C), for some f, C s.t. C |= ψ contains this pair as part of a subtrace of the following form: h  i fEv(X, f 0 , m0 , e0 ), C0 , iREv(X, f, m), C for some f 0 , C s.t. C |= ϕ. Every state change on X must be executed by some process on X, but as there is no such such process (as there would be an invocation event for it) between the two events in the subtrace, the state-part of ϕ, i.e. ϕ@X, still holds at the invocation event: C |= ϕ@X. This is exactly the condition captured by this propagation case. - Case 2 Put ϕ . (L)∗ψ Put ϕ ∧ ψ . (L)∗ψ By the definition of C((L)∗ ) there is a set of indices X in every trace, such that every such position i ∈ X, the invariant holds and for every pair of consecutive positions i, j ∈ X, the subtrace tr[i..j] satisfies C(L). Now, Put ϕ is the last event before the repetition, thus before the very first position i0 ∈ X there is a pair  tr[i0 − 1] = fEv(X, f, m, e), C 26 In C, no process is active at X. We only regard traces produced Prgm, thus tr is well-formed1 and i0 must be a invocation reaction event  tr[i0 ] = iREv(X, f 0 , m0 ), C Such that C |= ψ. With the same argument as above, the condition at ψ must hold at i0 − 1, as there was no process who could have changed it. Note, that i0 6= 0 as every local type starts with a receiving action, not a repetition. - Case 3 (L)∗ψ . ?m0 hϕi (L)∗ψ . ?m0 hϕ ∧ ψi This case is analogous to case 2. (L)∗ϕ∧ψ . (L)∗ψ - Case 4 (L)∗ϕ . (L)∗ψ This case is analogous to case 2. - Case 5 (?m0 hϕi . L . Put ϕ0 )∗ψ (?m0 hϕ ∧ ψi . L . Put ϕ0 ∧ ψ)∗ψ ∗ By the definition of C((L) ), there is a set of indices X in every trace, such that every such position i ∈ X, the invariant holds and for every pair of consecutive positions i, j ∈ X, If the repetition start with a receiving action and ends with a termination, the chosen positions are those of the termination actions and the first action before (Again, the syntactic form guarantees such a position). This reduces this case to show that the same propagation as in case 1 holds and thus technical details are analogous to case 1. Main Theorem Given a well-formed global type G we can say that another (possibly not wellformed) global G0 is a prefix of G if we can extend G0 to G by concatenating another global type: G0 v G ⇐⇒ G = G0 .G And similarly for local types L and traces tr. The main lemma is similar to subject reduction in non-model-theoretic semantics for types, as it connects types and operational semantics of the language. It states that each step in the execution preserves the property that the trace so far is a prefix of a a trace which is a model for the type. Lemma 2. Let Prgm be a program and G a well-formed type with ` Prgm : G. Every prefix of every trace of Prgm satisfies the translation of a prefix of G:   ` Prgm : G → ∀tr. Prgm ⇓ tr → ∀tr0 . tr0 v tr → ∃G0 . G0 v G∧tr0 |= C(G0 ) The property that the whole execution of the program satisfies the translation of the whole type and not some prefix follows from well-formedness of global types (Theorem 1 in [29]) and deadlock freedom. The main differences to the proof in [29] are the following: 1 The well-formedness of traces is defined in [15,29] 27 All assumed conditions hold at the point they are used We distinguish between the following kinds of assumed conditions: – The precondition at method start. The precondition is a conjunction ϕ1 ∧ ϕ2 where ϕ1 is resulting from the projection and ϕ2 from the propagation. That ϕ2 holds follows from Lemma 1. That ϕ1 holds follows from the fact that the precondition is projected from a formula ψ in the global call, which is fully proven by the caller, checked in rule (T-Call) with the condition that ψ is equal to its projection on the caller. – The selection condition of the passive choice. It must connect that the additional condition executes the statement branch which is typed with the corresponding type branch. This follows directly from the two additional promises of (T-Offer) with respect to (T-Select). Methods are executed in the right order Assume there is a method m1 that is executed on some object X before m2 in the type, but executed the other way around in the generated trace. Then m2 does not depend on m1 . But by assumption the program has been typed. Rule (T-Main) checks, however, that the start of m1 causes m2 in its admissibility check and this means that m2 cannot be executed before m1 (Lemma 36 in [29]). Deadlock Freedom A deadlocked configuration is a configuration which is not terminated, yet cannot continue execution. First we observe that every deadlock is caused by processes blocking at get statements. It cannot be a single process, because a process has no access on its own future. It can also not be stored in the heap between call and execution start, as this would mean that another method was active to store it and this would violate the condition that all methods are executed in the right order shown above. Assume there would be a deadlock. W.l.o.g. we assume that only two processes are involved, p1 executing m1 and p2 executing m2 . If p1 blocks while attempting to read a future belonging to m2 then the Points-To analysis will include m2 in the set of possible method in rule (T-Get). As m1 has been type checked, this mean that an edge from the corresponding termination to the corresponding read would be added to the causality graph. The same holds for m2 . The termination of mi is in the same object type as the reading type, thus there is a path from the read in mi to the termination in mi . The resulting graph is pictured below and contains a cycle. The absence of cycles is however checked in rule (T-Main). For a full formalization of deadlocks through causality graphs, we refer to [17]. m2 ... ↑ ... ↓ m1 ... ↑ ... ↓ 28
6cs.PL
arXiv:1712.08626v1 [cs.AI] 22 Dec 2017 Obtaining Accurate Probabilistic Causal Inference by Post-Processing Calibration Fattaneh Jabbari1 , Mahdi Pakdaman Naeini2 , Gregory F. Cooper1,3 1 Intelligent Systems Program, University of Pittsburgh, Pittsburgh, PA 2 Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 3 Department of Biomedical Informatics, University of Pittsburgh, Pittsburgh, PA [email protected], [email protected], [email protected] Abstract Discovery of an accurate causal Bayesian network structure from observational data can be useful in many areas of science. Often the discoveries are made under uncertainty, which can be expressed as probabilities. To guide the use of such discoveries, including directing further investigation, it is important that those probabilities be well-calibrated. In this paper, we introduce a novel framework to derive calibrated probabilities of causal relationships from observational data. The framework consists of three components: (1) an approximate method for generating initial probability estimates of the edge types for each pair of variables, (2) the availability of a relatively small number of the causal relationships in the network for which the truth status is known, which we call a calibration training set, and (3) a calibration method for using the approximate probability estimates and the calibration training set to generate calibrated probabilities for the many remaining pairs of variables. We also introduce a new calibration method based on a shallow neural network. Our experiments on simulated data support that the proposed approach improves the calibration of causal edge predictions. The results also support that the approach often improves the precision and recall of predictions. 1 Introduction Much of science consists of discovering and modeling causal relationships in nature. Increasingly, scientists have available multiple complex data and a large number of samples, each of which has an enormous number of measurements recorded, thanks to rapid advancements in sophisticated measurement technology, where this data are often purely observational. In past 25 years, there has been tremendous progress in developing computational methods for discovering causal knowledge from observational data [11, 24, 19, 23, 12]. A primary use of such methods is to analyze observational data to generate novel causal hypotheses that are likely to be correct when subjected to experimental validation; such an approach can significantly increase the efficiency of causal discovery in science. To make informed decisions about which novel causal hypotheses to investigate experimentally, scientists need to know how likely the hypotheses are to be true. In probabilistic terms, this means they need to have the probabilities of the hypotheses (as output by a causal discovery algorithm) be well-calibrated. Informally, we say that probabilities are well-calibrated if events predicted to occur with probability p do occur about p fraction of the time, for all p [4]. In general, it is important to use calibrated probabilities when making decisions using decision theory. In this paper, we focus on the discovery of causal Bayesian network (CBN) structure from observational data. In particular, we focus on the discovery of the causal relationships (edge types) between pairs of measured variables. If a causal arc is novel and important, it may be worthwhile to experimentally investigate it. The extent to which it is worth doing so depends in part on how high is A NIPS 2017 Workshop: From ’What If?’ To ’What Next?’, Long Beach, CA, USA. the calibrated probability that the causal arc is present. We introduce a method to calibrate edge type probabilities in CBNs with thousands of measured variables and arbitrarily many latent variables. The method requires the following components: (1) a method for generating initial probability estimates of the edge types for each pair of variables; in general those estimates need not be wellcalibrated, (2) the truth status of a small unbiased sample of the causal relationships in the network, which we call a calibration training set, and (3) a calibration method for using the uncalibrated probability estimates and the calibration training set to generate calibrated probabilities for the large number of remaining pairs of variables. We use a bootstrapping method [8] for generating probability estimates of edge types. This method resamples a dataset n times with replacement and learns a model for each dataset. In particular, for each dataset we use the Really Fast Causal Inference (RFCI) algorithm [3] to estimate the underlying generative network when allowing for the possibility of latent confounders. For any given pair of nodes (A, B), the probability they have a given edge type (e.g., A → B) is estimated as the fraction of that edge type for (A, B) in the n networks. Previously, researchers have successfully applied this approach for estimating the probabilities of edge types in Bayesian networks [9]. These bootstrap estimates are not guaranteed to represent calibrated posterior probabilities, however, even in the large sample limit of the number of bootstrap samples. A key reason is that heuristic search, while practically necessary, may get stuck in local maxima. Thus, there is a need to map those estimates to calibrated probabilities, which is the focus of the current paper. The bootstrapping approach described above provides empirical estimates of edge-type posterior probabilities for both constraint-based (e.g., PC, FCI [23], and RFCI [3]) and Bayesian structure learning algorithms (e.g., GES [2]). Bayesian model averaging [15, 10, 14, 7, 13] provides an alternative approach for estimating edge probabilities. However, such Bayesian methods are typically applicable when using datasets in which the number of random variables is in the double digits (for exact search methods) to triple digits (for heuristic search methods). In contrast, we are interested in providing calibrated estimates of edge probabilities for datasets that may contain thousands of variables, as typically encountered with modern biological data. We also note that Bayesian model averaging methods are sensitive to the method applied for heuristic search [9] and to the structure and parameter priors that are used, even if they are non-informative. Consequently, their generated probabilities are still subject to possibly being uncalibrated. Finally, there are no computationally tractable Bayesian methods for discovering CBNs that contain more than a few latent confounders; in contrast, constraint-based methods exist that can perform discovery of CBNs with hundreds (or more) latent variables on datasets with thousands of variables in a feasible amount of time [3]. We assume the availability of a calibration training set that allows us to induce a mapping from bootstrap probability estimates to calibrated posterior probabilities. The training set should contain the truth status for the subset of edge types. In the domain of biomedical applications, the truth status might come, for example, from results published in the literature. We emphasize that the calibration training set can be very small, relative to the number of total node pairs. In the experiments we performed, it consists of less than 0.02% of all the node pairs. Using it, our goal is to generate better calibrated probabilities for the remaining 99.98% of node pairs. In an application using biomedical data, for example, a biomedical scientist who chose to experimentally test causal relationships that have high probabilities (i.e., close to 1) that are well-calibrated could be confident that the experiments would usually corroborate those relationships. We introduce a new neural-network-based calibration method that uses the calibration training set to construct a mapping from bootstrap probability estimates to calibrated posterior probabilities of edge types for all node pairs in a CBN (except those few that are used for training). We apply that mapping to all of those node pairs. In this paper, we use simulated data to investigate two main questions1 . First, how calibrated are the bootstrap-derived probabilities of edge types? Second, how calibrated are the probabilities produced by our neural-network-based calibration method? Given a finite calibration training set, the latter method is not guaranteed to always output perfectly calibrated probabilities either. Our main hypothesis in this paper is that this calibration method will output probabilities that are better calibrated than are the bootstrap probabilities, while being at least as discriminative in terms of measures such as precision, recall, and F1 score. 1 Note that it is difficult to obtain gold standards for the causal relationships among the variables in large observational datasets. As a result, the use of simulated data is important and commonly done to evaluate causal discovery methods. 2 2 Method In this section we briefly describe the RFCI search, bootstrap RFCI, and calibration model. 2.1 Overview of RFCI Colombo et al.[3] developed an algorithm called Really Fast Causal Inference (RFCI), which identifies the causal structure of the data-generating process in the presence of latent variables using Partial Ancestral Graphs (PAGs) as a representation. A PAG encodes a Markov equivalence class of Bayesian networks (possibly with latent variables) that exhibit the same conditional independence relationships. RFCI has two stages: (1) adjacency search: this involves a selective search for the (in)dependencies among the measured variables, (2) orientation phase: this orients the endpoints among pairs of nodes that are connected according to the first stage. As is typical of constraint-based causal discovery algorithms, RFCI outputs a single graph structure (PAG) and does not provide any information about the uncertainty of the edges between the nodes in the structure. 2.2 Bootstrap RFCI Considering the PAG generated by RFCI, it is possible to partition all pairs of nodes (A, B) into the following seven classes: (1) A · · · B: there is no edge between A and B; (2) A → B: a directed edge from A to B means that A is a direct or indirect cause of B; (3) B → A: this is similar to (2); (4) A ◦→ B: this edge type indicates either A is a cause of B, there is an unmeasured confounder of A and B, or both; (5)B ◦→ A: this is similar to (4); (6) A◦–◦ B: this edge type expresses that A is a cause of B, B is a cause of A, there is an unmeasured confounder of A and B, or that there is an unmeasured confounder and one of those two causal relationships holds; (7) A ↔ B: a bi-directed edge between A and B represents the presence of an unmeasured confounder of A and B. The bootstrap RFCI (BRFCI) method that we apply has three main steps. First, it performs bootstrap sampling over the training data n times (n = 200 in our experiments) to create n different bootstrap training datasets. In the second step, it runs RFCI on each of n datasets to obtain n PAGs. Finally, for every pair of nodes, it uses the frequency counts of each edge class for that pair over the generated PAGs to determine a probability distribution for the seven possible edge classes. As mentioned, these bootstrap estimates are not guaranteed to be calibrated. In the following section, we describe a post-processing method to map the bootstrap probabilities to calibrated probabilities. 2.3 Calibration Model For a pair of nodes (A, B), the resulting output of the BRFCI method will be seven jointly exhaustive and mutually exclusive class probabilities that correspond to the seven classes described above. Therefore, we need to apply a calibration method that post-processes a multi-class classification score (in our case seven classes). One simple approach to devise such a multi-class calibration model is to use a well-performing non-parametric binary classifier calibration method such as isotonic regression [25], averaging over Bayesian binning (ABB) [16], or Bayesian binning into quantiles (BBQ) [17] to post-process the corresponding output probabilities of each class separately. This is performed in a one-versus-remainder fashion as described in [25]. The major drawback of this approach is that such binary calibration methods are histogram-based non-parametric and they require a considerable amount of data to produce well-calibrated probabilities. However, it is often too expensive or not feasible to obtain the truth status for a large number of node pairs in real applications of causal discovery. Consequently, the availability of only a small calibration training set is a critical constraint in the design of the calibration approach. To resolve this problem, we make a simple extension to Platt’s method [20], which is a parametric binary classifier calibration approach. Platt’s method uses a sigmoid transformation to map the output of a binary classifier into a calibrated probability. It then uses a logistic loss function to learn the two parameters of the model. The method has two advantages: (1) it has only two parameters that make it a viable choice for low sample size calibration datasets, and (2) the method runs in O(1) at test time, and thus, it is fast. A natural extension to Platt’s method for the multi-class calibration task is to use a combination of a softmax transfer function and a cross-entropy loss function instead of a sigmoid function and a logistic loss function, respectively. Minimizing the cross entropy is equivalent to minimizing the empirical Kullback-Leibler divergence of the estimated probabilities and the observed 3 Σ P(cal A→B) ... P(B→A) P( A!→B) Σ Σ P(B!→A) P( A!−!B) P( A↔B) Σ Σ Σ cal P(B→A) P(cal A!→B) cal P(B!→A) P(cal A!−!B) P(cal A↔B) Figure 1: The structure of post-processing calibration method. The inputs on the left are the bootstrap probabilities for seven edge types. The outputs on the right are the corresponding postprocessed probabilities that are intended to be better calibrated. V = 2000, E = 2000 V = 2000, E = 4000 800 P(cal A... B) Σ P( A→B) Softmax P( A... B) Output Layer Number of nodes Hidden Layer 600 400 200 0 0 2 4 6 8 10 12 14 Degree Figure 2: Parent size distribution for simulated CBNs with V = 2000 nodes and E = 2000 or 4000 edges. ones. The minimum will be achieved by the true probability distribution and minimizing the cross entropy function will result in finding the closest distribution parameterized by the model to the observed distribution of data [18]. The model that uses the softmax transfer function and optimizes the cross entropy loss function is called softmax regression [18]. The softmax regression-based calibration model inherits the desirable properties of Platt’s method. However, similar to Platt’s method, the mapping that the softmax regression-based calibration method can learn is restrictive since the final separating boundaries between each pair of classes are always linear. A simple relaxation of this restriction is to use a shallow neural network with one hidden layer. Figure 1 shows the architecture of the shallow neural network model that we use to post-process the bootstrap-generated probabilities. In our experiments, we train 10 different such shallow neural networks by setting the number of neurons in the hidden layer to be 4, 5, 6, or 7 randomly. At test time, we use the average of the 10 different outputs generated by these models as the final calibrated probability estimates. The averaging is helpful since it reduces the variance error of the predictions and improves the final performance of the post-processed probabilities [5]. We will use the notation fcal (p1, p2, p3, p4, p5, p6, p7) to denote the mapping from a seven-element vector of uncalibrated probabilities that are input to a seven-element vector of calibrated probabilities that are output. We implemented our model using the scikit flow Python package2 , which uses the tensorflow machine learning package [1]. We used the cross-entropy loss function and the adagrad optimization method [6] to learn the parameters; we set the learning rate and the batch size to be 0.1 and 10, respectively. 3 Experimental Methods This section describes the experimental methods that we used to evaluate the performance of the calibrated network discovery method introduced above. The evaluation involves the following steps: 1. Create a random causal Bayesian network, BN , with V real-valued nodes and E edges. We set V to be 1000 and 2000. We also set the average number of edges per node to be 1 and 2 (i.e., E = V and E = 2V ). To construct the BN , we first ordered the nodes. Then, we randomly added edges in a forward direction until obtaining the specified mean graph density. This process generates a graph with a power-law-type distribution over the number of parents, with some nodes having many more than the average number of parents (Figure 2). In each BN , the nodes correspond to continuous random variables where for every pair of nodes, (A, B), we parametrize a relation A → B in the BN as a structural equation model (SEM): A = A and B = Aβ + B , where A and B are zero-mean Gaussian noise terms and β is a linear coefficient. In our experiments, similar to Ramsey[21, 22], variances of A and B are uniformly randomly chosen from the interval [1.0, 3.0] and β is drawn uniformly randomly from the interval [−1.5, 0.2] ∪ [0.2, 1.5]. This choice of parameter values for the simulations implies that, on average, around half of the variance of the variables is due to the error term, which makes structure learning more difficult [21, 22]. 2. Simulate a dataset D of size 1000 from BN , subject to constraints that are described below. 2 https://github.com/tensorflow/skflow 4 3. Set a percentage of variables, h, to be unobserved (i.e., latent). These latent variables are randomly chosen from confounder variables (i.e., common causes) in a given data-generating BN . We set h to be either 10% or 20%. 4. Generate 200 bootstrap datasets, DB[1..200] from D. 5. For each bootstrap dataset, learn a PAG using the RFCI method; let P AG[1..200] designate these PAGs. RFCI uses Fisher’s Z test to check conditional independence of variables in the dataset. We set the significance level at which independence judgments were made to be α = 0.001 and 0.005. 6. For each node pair (A, B), calculate the probability distribution Pe (A, B) of the edge types of (A, B) using maximum likelihood estimates on the counts in P AG[1..200]. 7. Perform a stratified random sampling on the node pairs to obtain N training samples for calibration and use the rest of the data for testing. We set N = 70, 140, or 210. In obtaining N samples, we used stratified random sampling to select N /7 samples for each of the seven edge classes3 . In particular, we first sorted the probability scores of edges in each edge class according to the bootstrap probabilities. We then partitioned the instances into 5 bins of {[0, 0.2), [0.2, 0.4), [0.4, 0.6), [0.6, 0.8), [0.8, 1]} based on their bootstrap probabilities. Finally, we sampled separately from each bin with equal frequency. 8. Learn the calibration function fcal using the calibration training data. 9. For each node pair (A, B) in the test set, derive Pecal (A, B) = fcal (Pe (A, B)). 10. Compare the performance of Pecal versus Pe in correctly predicting the data-generating structure of BN for the test set pairs, and doing so in a manner that is well calibrated. In running the above evaluation procedure, step (5) is the most time consuming part that involves running RFCI on 200 bootstrap datasets. However, this is still feasible due to the run-time efficiency of the RFCI method and our use of parallel computing4 . For all simulations, we used Tetrad5 , which is an open-source, freely available software application that is coded in Java. Steps (1) through (10) above were repeated for 10 randomly generated BNs and the performance results were averaged. For a given node pair, we take the predicted edge type for that pair to be the one that has the highest probability. Note that although there are seven different edge classes, we consider only five edge types for performance evaluation, because A → B and B → A are both directed edge types, and A◦→ B and B ◦→ A are both partially directed edge types. The first two edge-type-based evaluation measures are precision (P) and recall (R). To compute these measures for each edge type, we calculated the four basic statistics of true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN) for each of the types separately. Precision is then derived as the ratio T P/(T P + F P ). Recall is derived as the ratio T P/(T P + F N ). We also report the F1-score (i.e., the harmonic mean of the precision and recall), which is a summary measure that shows the overall performance of the predictions in terms of both precision and recall. We also evaluated the edge-type-based predictions in terms of maximum calibration error (MCE) [17]. We calculated the MCE for each edge type by partitioning the output space of the estimated edge-type probabilities, which is on the interval [0, 1], into equal-frequency bins with 100 randomly chosen instances. The estimated probability for each instance is located in one of the bins. For each bin, we define the associated calibration error as the absolute difference between the mean value of the predictions and the actual observed frequency of positive instances. The MCE calculates the maximum calibration error over all the bins. The lower the value of MCE, the better the calibration of the probability scores. The lowest possible value of MCE is 0 and the highest possible value is 1. We also report the overall (micro averaged) MCE as a summary measure which shows the performance of the predictions in terms of calibration. To compute this measure, we augmented the seven-element probability distribution vectors, Pe (A, B) for all test instances to form an aggregated vector Pall . We also augmented their corresponding 1-of-k binary labels [18, 1] to form an aggregated binary vector Zall . The overall MCE is defined as the maximum calibration error calculated based on Pall and Zall . 3 Using stratified random sampling is crucial due to severe class imbalance of the data (i.e., more than 99% of the pairs are no-edge type). The running times of the experiments varied from 11 to 176 minutes on a 16-core compute node, which is computationally feasible, because step (5) needs to be done one time only. 5 https://github.com/cmu-phil/tetrad 4 5 4 Experimental Results This section presents the results of our experiments in evaluating the performance of the generated probabilities for the five edge types before and after calibration. We use the shallow neural network calibration method to learn the calibration function fcal from calibration training data. Since the purpose of this paper is not to compare calibration methods, we do not report the results of experiments on using other calibration methods (e.g., IsoReg or Platt’s method). Rather, we only report the results of calibration using the neural network method which we found performs well with relatively small calibration training sample sizes compared to the other calibration methods that we tried. For each set of configurations (e.g., N = 210, V = 2000, E = 2000), we report the average results of using 10 randomly simulated CBNs. Tables 1a, 1b, 1c, and 1d show the results for CBNs with 2000 nodes (due to the page limit, the results of experiments for V = 1000 are not included but similar results are achieved). In these tables, boldface indicates the results that are statistically significantly superior, based on a two-sided Wilcoxon signed rank test at 5% significance level. Tables 1a-1d indicate that by post-processing the bootstrap probabilities, we can improve the overall edge-type performance both in terms of discrimination and calibration. The only exception is the A ↔ B edge type for which we lose discrimination. This is happening because the original precision and recall of the bootstrap probabilities are very low for this edge type. Consequently, we often obtain very few positive instances from this edge type in the calibration training set, which negatively affects the performance of predictions after calibration. Note that for the no-edge type we do not report precision, recall, and F1, because they were always very close to 1. Figure 3 shows the calibration diagram [4] of the estimated probabilities before and after calibration when we use 210 calibration training instances. We emphasize that observing 210 calibration instances is equivalent to observing less than 0.02% of all node pairs in the CBN (i.e., there are 1999 × 103 node pairs in a CBN with 2000 nodes). To draw the calibration diagrams, we partitioned the output space of the estimated probabilities into five equal-size bins. In each bin, we draw the average frequency of positive class versus the mean of the predictions that are located in that bin. In these diagrams, the straight dashed line connecting (0, 0) to (1, 1) represents a perfectly calibrated model. The closer a calibration curve is to this line, the better calibrated is the prediction model. Figure 3 shows the proposed shallow neural network post-processing method often improves the calibration performance of the predictions for the A → B edge-type, which is the most important edge type since it is the one that is most likely to drive experimentation. In particular, directed edges that a scientist considers to be high probability, as well as novel and important, would be prime candidates for experimental validation. Furthermore, for this edge-type, the high probability region is arguably the most critical one for making decisions about which directed arcs to investigate, such that false positive experimental investigations are minimized. Also, the associated diagrams of the no-edge type (i.e., A · · · B) in Figure 3 show that the estimated probabilities are pretty well-calibrated after calibration. This is an interesting observation considering the fact that the precision and recall are also always very close to 1 for this edge type after using the post-processing calibration method. These results indicate that when the calibrated probabilities indicate with high probability that there is no edge between a pair of variables, then those nodes rarely are directly causally related. This result provides confidence in not prioritizing the experimental investigation of such node pairs for direct causal relationships. Another interesting observation in Figure 3 is that the bootstrap probabilities of the A ↔ B edge-type are highly overestimated. This results in high false positive rate for that edge-type, and consequently, increases the false negative rate for other edge types. Note that post-processing the bootstrap probabilities does not generate high probabilities for the A ↔ B edge-type and consequently there is no red circle in the high-probability bins but some in low probability bins, which is appropriate, because those edges, which are output by RFCI, are seldom correct. Overall, the calibration diagrams in Figure 3 show that post-processing the bootstrap probabilities using the proposed shallow-neural network model generally improves the calibration performance of the predictions. A key advantage of the shallow neural network approach for post-processing the estimated probabilities is that we can readily condition on other types of features for learning a calibration mapping (e.g., features extracted from the structure of the predicted PAGs by the RFCI method, such as the indegree of B when we are generating a calibrated probability for the edge type A → B). Such conditioning on local or global features of the learned graph could potentially yield improvements in the post-processed calibrated probabilities. This is an area for future research. 6 Table 1: Simulation results. V , E, and h represent the number of variables, edges, and percentage of hidden variables in the data-generating CBN, respectively. α is the significance level used in the RFCI method and N is the calibration training set size. Boldface indicates the results that are significantly better, based on the Wilcoxon signed rank test at 5% significance level. For MCE, lower is better. (a) V = 2000, h = 0.1, and α = 0.001 N E 2K 70 4K 2K 140 4K 2K 210 4K method before after before after before after before after before after before after P 0.61 0.69 0.66 0.67 0.57 0.66 0.66 0.67 0.53 0.65 0.65 0.67 A→B R F1 0.33 0.42 0.37 0.47 0.30 0.41 0.38 0.48 0.28 0.37 0.31 0.41 0.29 0.40 0.37 0.48 0.24 0.32 0.28 0.37 0.29 0.40 0.36 0.47 P 0.35 0.43 0.65 0.63 0.32 0.39 0.65 0.65 0.26 0.35 0.65 0.65 A→B R F1 0.15 0.21 0.15 0.21 0.25 0.36 0.33 0.42 0.11 0.15 0.10 0.14 0.24 0.35 0.31 0.42 0.09 0.13 0.08 0.13 0.23 0.34 0.30 0.41 P 0.60 0.65 0.74 0.70 0.49 0.62 0.74 0.70 0.33 0.43 0.75 0.72 A→B R F1 0.19 0.28 0.32 0.41 0.29 0.41 0.39 0.50 0.13 0.20 0.23 0.32 0.28 0.41 0.40 0.50 0.07 0.11 0.14 0.19 0.27 0.40 0.37 0.48 P 0.25 0.39 0.72 0.68 0.15 0.24 0.73 0.71 0.07 0.13 0.73 0.71 A→B R F1 0.05 0.07 0.10 0.14 0.22 0.34 0.30 0.42 0.02 0.03 0.06 0.09 0.21 0.32 0.29 0.41 0.00 0.01 0.02 0.03 0.20 0.31 0.28 0.40 MCE 0.12 0.10 0.30 0.20 0.10 0.09 0.30 0.17 0.10 0.09 0.31 0.19 P 0.45 0.57 0.51 0.46 0.42 0.58 0.51 0.47 0.40 0.58 0.51 0.47 A◦→ B R F1 0.07 0.12 0.62 0.59 0.03 0.06 0.43 0.44 0.06 0.10 0.63 0.60 0.03 0.06 0.44 0.46 0.05 0.09 0.64 0.61 0.03 0.05 0.43 0.45 MCE 0.44 0.25 0.45 0.23 0.46 0.27 0.45 0.24 0.46 0.26 0.46 0.23 P 0.79 0.79 0.62 0.68 0.64 0.79 0.44 0.68 0.62 0.80 0.27 0.66 A◦–◦ B R F1 0.06 0.12 0.44 0.56 0.03 0.05 0.27 0.38 0.05 0.09 0.41 0.54 0.02 0.03 0.26 0.37 0.04 0.07 0.40 0.53 0.01 0.02 0.23 0.34 MCE 0.65 0.27 0.44 0.26 0.65 0.29 0.44 0.26 0.66 0.25 0.44 0.29 P 0.05 0.03 0.04 0.00 0.04 0.02 0.04 0.00 0.04 0.02 0.04 0.01 A↔B R F1 0.25 0.08 0.02 0.02 0.09 0.06 0.00 0.00 0.23 0.07 0.01 0.01 0.09 0.06 0.00 0.00 0.23 0.07 0.01 0.01 0.09 0.06 0.00 0.00 MCE 0.94 0.18 0.95 0.09 0.93 0.17 0.95 0.09 0.93 0.16 0.95 0.08 A ··· B MCE 0.22 0.14 0.51 0.21 0.21 0.12 0.51 0.18 0.21 0.12 0.51 0.17 Overall MCE 0.33 0.23 0.55 0.22 0.34 0.26 0.55 0.21 0.35 0.26 0.56 0.20 MCE 0.66 0.27 0.40 0.22 0.67 0.30 0.40 0.20 0.67 0.31 0.40 0.20 P 0.11 0.21 0.09 0.08 0.10 0.20 0.09 0.06 0.10 0.19 0.09 0.14 A↔B R F1 0.18 0.13 0.10 0.12 0.06 0.07 0.01 0.01 0.17 0.13 0.10 0.11 0.06 0.07 0.01 0.01 0.17 0.13 0.10 0.11 0.06 0.07 0.01 0.01 MCE 0.90 0.29 0.91 0.14 0.90 0.27 0.91 0.14 0.90 0.28 0.91 0.12 A ··· B MCE 0.24 0.13 0.53 0.20 0.23 0.12 0.53 0.19 0.23 0.12 0.52 0.18 Overall MCE 0.34 0.24 0.56 0.23 0.33 0.23 0.59 0.21 0.33 0.23 0.58 0.21 MCE 0.70 0.25 0.46 0.28 0.69 0.24 0.46 0.27 0.62 0.21 0.47 0.25 P 0.05 0.00 0.05 0.01 0.05 0.00 0.05 0.00 0.05 0.00 0.05 0.00 A↔B R F1 0.30 0.09 0.00 0.00 0.12 0.07 0.00 0.00 0.29 0.09 0.00 0.00 0.11 0.06 0.00 0.00 0.29 0.09 0.00 0.00 0.11 0.06 0.00 0.00 MCE 0.96 0.09 0.97 0.10 0.96 0.09 0.97 0.09 0.96 0.09 0.97 0.08 A ··· B MCE 0.24 0.14 0.38 0.17 0.24 0.13 0.38 0.17 0.24 0.11 0.38 0.15 Overall MCE 0.42 0.25 0.55 0.24 0.38 0.24 0.55 0.25 0.34 0.25 0.54 0.24 MCE 0.49 0.20 0.43 0.25 0.47 0.20 0.39 0.21 0.39 0.20 0.37 0.21 P 0.11 0.06 0.10 0.05 0.11 0.09 0.10 0.04 0.12 0.09 0.10 0.03 A↔B R F1 0.21 0.15 0.01 0.02 0.08 0.09 0.00 0.01 0.21 0.14 0.01 0.02 0.08 0.08 0.00 0.01 0.20 0.15 0.01 0.02 0.08 0.08 0.00 0.00 MCE 0.92 0.14 0.94 0.13 0.92 0.14 0.94 0.12 0.92 0.13 0.94 0.12 A ··· B MCE 0.22 0.13 0.40 0.18 0.22 0.12 0.39 0.15 0.22 0.11 0.40 0.16 Overall MCE 0.52 0.23 0.49 0.25 0.50 0.23 0.48 0.23 0.48 0.23 0.48 0.25 (b) V = 2000, h = 0.2, and α = 0.001 N E 2K 70 4K 2K 140 4K 2K 210 4K method before after before after before after before after before after before after MCE 0.10 0.08 0.28 0.18 0.09 0.08 0.28 0.15 0.10 0.08 0.29 0.15 P 0.37 0.53 0.49 0.44 0.32 0.55 0.48 0.43 0.32 0.55 0.49 0.43 A◦→ B R F1 0.03 0.05 0.34 0.41 0.02 0.04 0.31 0.36 0.02 0.04 0.34 0.41 0.02 0.03 0.31 0.36 0.02 0.03 0.32 0.40 0.01 0.03 0.31 0.36 MCE 0.48 0.26 0.44 0.25 0.50 0.26 0.45 0.24 0.50 0.27 0.45 0.23 P 0.56 0.77 0.36 0.65 0.44 0.79 0.20 0.65 0.40 0.80 0.13 0.63 A◦–◦ B R F1 0.03 0.05 0.30 0.42 0.02 0.04 0.21 0.31 0.02 0.03 0.28 0.40 0.01 0.03 0.22 0.32 0.01 0.02 0.27 0.39 0.01 0.01 0.20 0.30 (c) V = 2000, h = 0.1, and α = 0.005 N E 2K 70 4K 2K 140 4K 2K 210 4K method before after before after before after before after before after before after MCE 0.16 0.12 0.29 0.20 0.16 0.11 0.29 0.19 0.16 0.11 0.30 0.18 P 0.36 0.43 0.39 0.42 0.27 0.44 0.39 0.44 0.15 0.46 0.35 0.44 A◦→ B R F1 0.01 0.02 0.62 0.51 0.01 0.01 0.44 0.43 0.01 0.01 0.62 0.51 0.01 0.01 0.44 0.44 0.00 0.00 0.63 0.53 0.00 0.01 0.45 0.44 MCE 0.43 0.27 0.46 0.27 0.43 0.26 0.46 0.27 0.44 0.26 0.47 0.26 P 0.17 0.76 0.18 0.66 0.00 0.77 0.12 0.73 0.00 0.76 0.10 0.73 A◦–◦ B R F1 0.00 0.00 0.18 0.28 0.00 0.00 0.14 0.22 0.00 0.00 0.18 0.28 0.00 0.00 0.16 0.26 0.00 0.00 0.15 0.24 0.00 0.00 0.17 0.27 (d) V = 2000, h = 0.2, and α = 0.005 2K 210 4K 0.2 1.0 0.8 0.6 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability 1.0 0.8 0.2 Estimated Probability 0.2 Estimated Probability 1.0 0.8 0.6 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability 1.0 0.8 0.4 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability 1.0 0.8 0.6 0.2 Estimated Probability 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability 1.0 0.8 0.6 0.4 0.00.0 0.2 0.4 0.6 0.8 1.0 A···B 1.0 0.8 0.6 0.4 0.4 0.00.0 0.2 0.4 0.6 0.8 1.0 A↔B A◦–◦B 1.0 0.8 0.6 0.4 0.00.0 0.2 0.4 0.6 0.8 1.0 A◦–◦ B R F1 0.00 0.00 0.12 0.19 0.00 0.00 0.12 0.20 0.00 0.00 0.11 0.17 0.00 0.00 0.12 0.20 0.00 0.00 0.06 0.10 0.00 0.00 0.12 0.20 0.4 0.6 0.4 P 0.06 0.67 0.12 0.70 0.00 0.72 0.00 0.67 0.00 0.66 0.00 0.71 0.6 0.4 Estimated Probability Objective Probability 1.0 0.8 0.6 0.4 0.00.0 0.2 0.4 0.6 0.8 1.0 V = 2k, E = 4k Objective Probability 0.6 V = 2k, E = 2k A◦→B Objective Probability Objective Probability A→B 1.0 0.8 MCE 0.42 0.24 0.45 0.27 0.44 0.25 0.46 0.25 0.47 0.24 0.46 0.26 Objective Probability 4K A◦→ B R F1 0.00 0.01 0.45 0.41 0.00 0.01 0.32 0.35 0.00 0.00 0.45 0.42 0.00 0.00 0.33 0.35 0.00 0.00 0.45 0.42 0.00 0.00 0.33 0.35 Objective Probability 2K 140 P 0.17 0.39 0.32 0.37 0.14 0.40 0.26 0.38 0.06 0.40 0.26 0.38 Objective Probability 4K before after before after before after before after before after before after MCE 0.12 0.09 0.30 0.22 0.11 0.07 0.31 0.20 0.11 0.07 0.32 0.21 Objective Probability 2K 70 method Objective Probability E Objective Probability N 0.4 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability 0.2 0.00.0 0.2 0.4 0.6 0.8 1.0 Estimated Probability Figure 3: The calibration curves of the edge-type probabilities before (blue crosses) and after (red circles) calibration. The closer the predictions to the diagonal, the more calibrated are the probabilities. In these results, the calibration training set size is 210, the percentage of hidden variables is 0.1, and the significance level of the test of independence in RFCI is 0.005 7 5 Conclusion In this paper, we introduced a new approach for improving the calibration of CBN structure discovery. We used a bootstrapping method to obtain estimated probabilities of the causal relationships between each pair of random variables. Although we applied the bootstrapping method to the RFCI algorithm, it can be applied with any other type of the network discovery method, as long as the method is sufficiently fast to run hundreds of times on a dataset to obtain bootstrap probability estimates. To calibrate the bootstrap probabilities, we devised a natural extension of Platt’s calibration method that supports multi-class calibration using a shallow neural network. Our experiments on a wide range of large simulated datasets show that by using only a small set of instances as gold standards for training the calibration model, we can obtain substantial improvements in terms of precision, recall, and calibration, relative to the bootstrap probabilities. In future work, we plan to expand the range of simulated experiments we perform, as well as evaluate the method using real biomedical data for which the truth status is known from the literature for a relatively small subset of variables. Acknowledgement We thank the members of the Center for Causal Discovery for their helpful feedback. The research reported in this publication was supported by grant U54HG008540 awarded by the National Human Genome Research Institute through funds provided by the trans-NIH Big Data to Knowledge (BD2K) initiative. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health. This material is also based upon work supported by the National Science Foundation under Grant No. IIS-1636786. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. References [1] Martín Abadi, Ashish Agarwal, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv:1603.04467, 2016. [2] David Maxwell Chickering. Optimal structure identification with greedy search. Journal of Machine Learning Research, 3:507–554, 2003. [3] Diego Colombo, Marloes Maathuis, Markus Kalisch, and Thomas Richardson. Learning high-dimensional directed acyclic graphs with latent and selection variables. The Annals of Statistics, 40(1):294–321, 2012. [4] Morris DeGroot and Stephen Fienberg. The comparison and evaluation of forecasters. The Statistician, 1983. [5] Pedro Domingos. A few useful things to know about machine learning. Communications of the ACM, 55(10):78–87, 2012. [6] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011. [7] Daniel Eaton and Kevin Murphy. Exact Bayesian structure learning from uncertain interventions. In International Conference on Artificial Intelligence and Statistics, pages 107–114, 2007. [8] Bradley Efron and Robert Tibshirani. An Introduction to the Bootstrap. CRC press, 1994. [9] Nir Friedman, Moises Goldszmidt, and Abraham Wyner. Data analysis with Bayesian networks: A bootstrap approach. In Proceedings of the Fifteenth Conference on Uncertainty in artificial intelligence, pages 196–205, 1999. [10] Nir Friedman and Daphne Koller. Being Bayesian about network structure. a Bayesian approach to structure discovery in Bayesian networks. Machine learning, 50(1-2):95–125, 2003. [11] Clark Glymour and Gregory Cooper. Computation, Causation, and Discovery. MIT Press, 1999. [12] Phyllis Illari, Federica Russo, and Jon Williamson. Causality in the Sciences. OUP Oxford, 2011. [13] Mikko Koivisto. Advances in exact Bayesian structure discovery in Bayesian networks. arXiv:1206.6828, 2012. [14] Mikko Koivisto and Kismat Sood. Exact Bayesian structure discovery in Bayesian networks. Journal of Machine Learning Research, 5:549–573, 2004. [15] David Madigan, Jeremy York, and Denis Allard. Bayesian graphical models for discrete data. International Statistical Review, pages 215–232, 1995. [16] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Binary classifier calibration using a Bayesian non-parametric approach. In Proceedings of the SIAM International Conference on Data Mining, pages 208–216, 2015. [17] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using Bayesian binning. In AAAI, pages 2901–2907, 2015. [18] Michael A Nielsen. Neural networks and deep learning. Determination Press, 2015. [19] Judea Pearl. Causality: Models, reasoning and inference. Econometric Theory, 19:675–685, 2003. [20] John Platt. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in Large Margin Classifiers, 10(3):61–74, 1999. [21] Joseph Ramsey. Scaling up greedy equivalence search for continuous variables. arXiv:1507.07749, 2015. [22] Ricardo Silva, Richard Scheines, Clark Glymour, and Peter Spirtes. Learning the structure of linear latent variable models. Journal of Machine Learning Research, 7:191–246, 2006. [23] Peter Spirtes. Introduction to causal inference. Journal of Machine Learning Research, 11:1643–1662, 2010. [24] Peter Spirtes, Clark Glymour, and Richard Scheines. Causation, Prediction, and Search. MIT press, 2000. [25] Bianca Zadrozny and Charles Elkan. Transforming classifier scores into accurate multiclass probability estimates. In Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 694–699, 2002. 8
2cs.AI
arXiv:1802.01227v1 [math.ST] 5 Feb 2018 Copula-based Partial Correlation Screening: a Joint and Robust Approach Jialiang Li1,2,3 and Xiaochao Xia1,4∗ 1 Department of Statistics and Applied Probability, National University of Singapore 2 Duke-NUS Graduate Medical School 4 3 Singapore Eye Research Institute College of Science, Huazhong Agricultural University, Wuhan, China Abstract Screening for ultrahigh dimensional features may encounter complicated issues such as outlying observations, heteroscedasticity or heavy-tailed distribution, multicollinearity and confounding effects. Standard correlation-based marginal screening methods may be a weak solution to these issues. We contribute a novel robust joint screener to safeguard against outliers and distribution mis-specification for both the response variable and the covariates, and to account for external variables at the screening step. Specifically, we introduce a copula-based partial correlation (CPC) screener. We show that the empirical process of the estimated CPC converges weakly to a Gaussian process and establish the sure screening property for CPC screener under very mild technical conditions, where we need not require any moment condition, weaker than existing alternatives in the literature. Moreover, our approach allows for a diverging number of conditional variables from the theoretical point of view. Extensive simulation studies and two data applications are included to illustrate our proposal. 1 Keywords: Copula; Partial correlation; Outlier; Joint screening; Sure independent screening. 1 Introduction With the arrival of a big data era, ultrahigh dimensional data become readily available from many business and scientific research fields, including medicine, genetics, finance and economics. Such massive data usually carry two common features: (i) the number of predictors or features can be tremendous and diverge to infinity with the sample size and (ii) the data distribution is very likely to be heteroscedastic and heavy-tailed for both the response and the covariates. These two features are observed in the two real data sets investigated in this paper. It is usually hoped that screening identifies important predictors among numerous candidates. We note that ultimately data scientists for such large scale data still need to construct a comprehensive joint model to accurately predict the future outcome. Thus a purely marginal screening approach as is usually adopted in the literature may not adequately serve the model building purpose. We contribute a new screening method that addresses the above issues and complements the existing methodology. Variable screening serves as a fast and efficient computing device. Abundant feature screening methods are proposed in recent decades, including the sure independence screening (SIS) by Fan and Lv (2008) who first established the sure screening property under Gaussian linear model, the sure independent ranking screening (SIRS, Zhu et al. (2011)), the Kendall’s τ based screening (Kendall-SIS, Li et al. (2012a)), the distance correlation based screening (DC-SIS, Li et al. (2012b)), the quantile-adaptive screening (QaSIS, He et al. (2013)), empirical likelihood screening (Chang et al. (2013, 2016)), the censored rank independence screening for lifetime data (CRIS, Song et al. (2014)), the screening method based on quantile correlation (QC-SIS, Li et al. (2015)), the conditional quantile screening (CQ-SIS, Wu and Yin 2 (2015)), the survival impaction index screening (SII, Li et al. (2016)), the nonparametric independence screening (NIS, Fan et al. (2011)), among many others. These screening tools might suffer the following two drawbacks: First, almost all methods evaluate a marginal association between the response and the predictors without adjusting external variables. Therefore some jointly important markers may be incorrectly screened out if their marginal signal is not as strong as the spurious markers in the ranked list. On the other hand, marginally important variables may be jointly ineffective and hence including them in a multivariate model may lead to less convincing prediction. To take into account the joint effects, a marginal feature screening is usually followed by an iterative calculation, such as the iterative SIS (ISIS) in Fan and Lv (2008), which is computationally expensive and does not come with any theoretical guarantee. Secondly, distribution of the response and the covariates may be rather different from the light-tailed symmetric normal distribution and very often there are outliers affecting the computed screening indices. Some of the aforementioned procedures address the robustness of the response but to our knowledge none of the existing work addresses the robustness of the covariates yet, which is a harder problem with higher dimension. We aim to tackle the two problems with a new screener. Specifically, to address the first issue, we develop a joint feature screening method by incorporating additional information. Recently a few conditional feature screening methods have been proposed. For instance, Liu et al. (2014) considered a sure independence screening procedure via conditional Pearson correlation coefficient through a kernel smoothing. Their method can be employed to handle ultrahigh dimensional varying-coefficient feature variables, which were investigated in Fan et al. (2014) and Cheng et al. (2014) as well. In addition, Xia et al. (2018) considered a robust screening method based on conditional quantile correlation, a generalized conception of Li et al. (2015). However, these authors only considered a single conditional variable. To extend to multivariate conditional variables, Chu et al. (2016) studied several confounding 3 variables. Barut et al. (2016) extended Fan and Song (2010))’s approach to allow for a portion of predictors as conditional variables. Our work provides a more general framework where all the ultrahigh dimensional markers and other low dimensional confounders can be jointly considered during the screening process. For the second issue, we incorporate robust copula-based correlation and partial correlation in our screening methods. The nonparametric copula is a well-known distribution-free summary measure and naturally leads to a screener against outliers and distribution mis-specification. To the best of our knowledge, there are very few works applying this classical dependence concept in high-dimensional setting. Xia et al. (2018) proposed a robust conditional feature screening approach, however, their method is only robust for the response but not for the covariates. Another relevant recent work is Ma et al. (2017). The contribution of this paper can be summarized as follows. Firstly, we proposed a double robust copula-based correlation (CC). Copula is very popular bivariate function to model the nonlinear dependence between paired variates. See Nelsen (2007) for an introduction for copula. The CC characterizes the empirical dependence between two random variables evaluated at a level pair and is invariant under monotone transformation for both variables. We study the asymptotic process properties of the CC. A marginal variable screening approach via CC (CC-SIS) can be performed and achieves the desired sure screening consistency (Fan and Lv (2008)). Secondly, extending copula-based correlation to copula-based partial correlation (CPC), we then construct a more general framework for joint screening. The importance of each marker is evaluated in the presence of conditional variables. This provides a fast way for conditional feature screening as it avoids the iterated computation. CPC is also robust by its construction from a nonparametric estimation and thus may be more reliable than a similar approach in Ma et al. (2017) with a broader range of application. We provide both theoretical and numerical support for the proposed screening method. Our data analysis indicates that the final multivariate regression models built after our screening 4 approach indeed predict the outcome with improved accuracy. The rest of the paper is organized as follows. Section 2 presents CC, its empirical estimate and CC-SIS. Asymptotic properties for the estimated CC functions are established in Section 2 as well. Methodologies and large sample properties for the CPC and the CPC-SIS are presented in Section 3. Further implementation details on CPC-SIS for different cases are given in Section 4. Simulation studies and two applications are carried out in Section 5. Section 6 concludes the paper. All the technical proofs are relegated to the Appendix. 2 Copula-based Correlation and Variable Screening Consider two random variables X and Y . Let FX be the cumulative distribution function (CDF) of X, which is assumed to be right continuous. FX−1 (τ ) = inf{x : FX (x) ≥ τ } is the τ quantile of FX . FY,X is the joint CDF of Y and X, and FY |X is the conditional distribution −1 function of Y given X with a density fY |X . Use Fn,X , Fn,X and Fn,Y,X to denote empirical versions of FX , FX−1 and FY,X , respectively, based on a sample of size n. Let D[a, b] be the Banach space of all càdlàg functions z : [a, b] 7→ R on an interval [a, b] ⊂ R̄ equipped with the uniform norm, and ℓ∞ ([a, b]2 ) denotes the collection of all bounded functions z : [a, b]2 7→ R. d We use → to denote convergence in distribution. 2.1 Copula-based Correlation We propose the following copula-based correlation (CC) ̺Y,X (τ, ι) = FY,X (FY−1 (τ ), FX−1 (ι)) − τ ι p , τ (1 − τ )ι(1 − ι) 0 ≤ τ, ι ≤ 1, (1) where the first term in the numerator is a copula function of (X, Y ) defined by C(u, v) = FU,V (u, v) with U = FY (Y ) and V = FX (X), evaluated at (u, v) = (τ, ι) (see Corollary 2.3.7 5 of Nelsen (2007), p.22). By a simple algebra, it follows that ̺Y,X (τ, ι) = −1 cov(ψτ (Y −FY−1 (τ )),ψι (X−FX (ι))) √ τ (1−τ )ι(1−ι) −1 E[ψτ (Y −FY−1 (τ ))ψι (X−FX (ι))] √ τ (1−τ )ι(1−ι) , where ψτ (u) = τ − I(u ≤ 0) and I(·) is the indicator function. Since var(ψτ (Y − FY−1 (τ ))) = τ (1 − τ ), ̺Y,X (τ, ι) in (1) is indeed a legitimate correlation coefficient that lives between −1 and 1. Like other correlation measures, CC equals 0 if X and Y are independent. CC can measure the nonlinear dependence between X and Y , thus incorporates all kinds of bivariate joint distribution of X and Y . In addition, because the indicator function is unaffected by outliers and extreme values, CC is robust for certain heavy-tailed distribution for both Y and X. We note that monotone transformation of X and Y does not alter the value of CC. Given a sample of i.i.d. observations {(Xi , Yi ), i = 1, . . . , n}, we can construct an empirical estimate of ̺Y,X (τ, ι) as −1 −1 n−1 Fn,Y,X (Fn,Y (τ ), Fn,X (ι)) − τ ι p = ̺bY,X (τ, ι) = τ (1 − τ )ι(1 − ι) Pn i=1 ψτ (Yi p −1 −1 − Fn,Y (τ ))ψι (Xi − Fn,X (ι)) τ (1 − τ )ι(1 − ι) . (2) Let σY,X (τ, ι) = FY,X (FY−1 (τ ), FX−1 (ι)), σX|Y (τ, ι) = FX|Y =F −1 (τ ) (FX−1 (ι)) and σY |X (τ, ι) = Y FY |X=F −1(ι) (FY−1 (τ )). In the following, we fix the level at (τ, ι) and write σY,X , σX|Y and X σY |X for simplicity. Furthermore, define h 1 I(Y ≤ FY−1 (τ ), X ≤ FX−1 (ι)) ξ(Y, X; τ, ι) = p τ (1 − τ )ι(1 − ι) −σX|Y (τ, ι)I(Y ≤ FY−1 (τ )) − σY |X (τ, ι)I(X ≤ FX−1 (ι)) i . We have the weak convergence result for ̺bY,X (τ, ι) established in the next theorem. Theorem 2.1. Let 0 < a < b < 1 and suppose that marginal distributions FX and FY are continuously differentiable on the intervals [FX−1 (a)−ε, FX−1 (b)+ε] and [FY−1 (a)−ε, FY−1 (b)+ε] with positive derivatives fX and fY , respectively, for some ε > 0. Furthermore, assume that 6 = conditional density functions fY |X and fX|Y are continuous on the product of these intervals. Then we have √ in ℓ∞ ([a, b]2 ), where w n{b ̺Y,X (τ, ι) − ̺Y,X (τ, ι)} w GY,X (τ, ι) denotes ”converge weakly”, and GY,X (τ, ι) is Gaussian process with mean zero and covariance function Ω1 (τ1 , ι1 ; τ2 , ι2 ) ≡ E{[ξ(Y, X; τ1 , ι1 ) − Eξ(Y, X; τ1 , ι1 )] × [ξ(Y, X; τ2, ι2 ) − Eξ(Y, X; τ2 , ι2 )]}. We may write the covariance function Ω1 (τ1 , ι1 ; τ2 , ι2 ) =  FY,X (FY−1(τ1 ∧ τ2 ), FX−1(ι1 ∧ ι2 )) − FY,X (FY−1 (τ1 ), FX−1 (ι1 ))FY,X (FY−1 (τ2 ), FX−1 (ι2 )) −σX|Y (τ2 , ι2 )[FY,X (FY−1 (τ1 ∧ τ2 ), FX−1 (ι1 )) − FY,X (FY−1 (τ1 ), FX−1 (ι1 ))τ2 ] −σY |X (τ2 , ι2 )[FY,X (FY−1 (τ1 ), FX−1 (ι1 ∧ ι2 )) − FY,X (FY−1 (τ1 ), FX−1 (ι1 ))ι2 ] −σX|Y (τ1 , ι1 )[FY,X (FY−1 (τ1 ), FX−1 (ι2 )) − FY,X (FY−1 (τ2 ), FX−1(ι2 ))τ1 ] +σX|Y (τ1 , ι1 )σX|Y (τ2 , ι2 )(τ1 ∧ τ2 − τ1 τ2 ) +σX|Y (τ1 , ι1 )σY |X (τ2 , ι2 )[FY,X (FY−1 (τ1 ), FX−1(ι2 )) − τ1 ι2 ] −σY |X (τ1 , ι1 )[FY,X (FY−1 (τ2 ), FX−1 (ι1 ∧ ι2 )) − FY,X (FY−1 (τ2 ), FX−1 (ι2 ))ι1 ] +σY |X (τ1 , ι1 )σX|Y (τ2 , ι2 )[FY,X (FY−1 (τ2 ), FX−1(ι1 )) − τ2 ι1 ] +σY |X (τ1 , ι1 )σY |X (τ2 , ι2 )(ι1 ∧ ι2 − ι1 ι2 ) /[τ1 (1 − τ1 )ι1 (1 − ι1 )τ2 (1 − τ2 )ι2 (1 − ι2 )]1/2 . √ d ̺Y,X (τ, ι) → N(0, Ω1 ), where Ω1 ≡ In particular, at fixed (τ, ι), if ̺Y,X (τ, ι) = 0, then nb  2 2 Ω1 (τ, ι; τ, ι) = σY,X − σY,X + (τ − τ 2 )σX|Y + (ι − ι2 )σY2 |X − 2(1 − τ )σY,X σX|Y − 2(1 − ι)σY,X σY |X + 2[σY,X − τ ι]σX|Y σY |X /[τ (1 − τ )ι(1 − ι)]. If Y and X are independent, then Ω1 = 1, producing the same null distribution used in classical correlation and auto-correlation studies. Compared with Li et al. (2015), our result is free of the moment conditions on X, 7 while Li et al. (2015) requires the existence of a fourth order moment on X to achieve the convergence in law. In order to make statistical inference, such as constructing a confidence interval for ̺Y,X (τ, ι) and testing a hypothesis like H0 : ̺Y,X (τ, ι) = 0, we need to estimate the covariance function Ω1 (τ1 , ι1 ; τ2 , ι2 ). To this end, denote m1 (y) = E{I(X ≤ FX−1 (ι))|Y = y} and m2 (x) = E{I(Y ≤ FY−1 (τ ))|X = x}. We can use the nonparametric approach like the Nadaraya-Watson (NW) method to obtain estimates m b 1 (y) and m b 2 (x) for m1 (y) and m2 (x), −1 −1 respectively, where the unknown FX−1 (ι) and FY−1 (τ ) are replaced by Fn,X (ι) and Fn,Y (τ ), −1 respectively. Therefore, we obtain the estimates σ bX|Y (τ, ι) = m b 1 (Fn,Y (τ )) and σ bY |X (τ, ι) =  −1 m b 2 (Fn,X (ι)). Next, we give an estimate of Ω1 (τ1 , ι1 ; τ2 , ι2 ). Denote ξbn (Yi , Xi ; τ, ι) = I(Yi ≤  p −1 −1 −1 −1 Fn,Y (τ ), Xi ≤ Fn,Y (ι))−b σX|Y (τ, ι)I(Yi ≤ Fn,Y (τ ))−b σY |X (τ, ι)I(Xi ≤ Fn,X (τ )) / τ (1 − τ )ι(1 − ι) P and ξ n (Y, X; τ, ι) = n−1 ni=1 ξbn (Yi , Xi ; τ, ι). Then, we obtain a consistent estimate of b 1 (τ1 , ι1 ; τ2 , ι2 ) = n−1 Pn [ξbn (Yi , Xi ; τ1 , ι1 )−ξ n (Y, X; τ1 , ι1 )]×[ξbn (Yi , Xi ; τ2 , ι2 )− Ω1 (τ1 , ι1 ; τ2 , ι2 ) as Ω i=1 ξ n (Y, X; τ2 , ι2 )]. As is relevant to this paper, we consider a single Y but many X candidates. In practice, to compare the dependence strength of two random variables X1 and X2 on Y , we may check the difference ̺Y,X1 (τ, ι) − ̺Y,X2 (τ, ι). In particular, we may test a hypothesis regarding this difference. Given a sample {(Yi , Xi1 , Xi2 ), i = 1, . . . , n}, similarly to (2), we can define ̺bY,X1 (τ, ι) and ̺bY,X2 (τ, ι). The following theorem can be applied to answer this question. Theorem 2.2. Let 0 < a < b < 1 and suppose that marginal distributions FXk and FY are continuously differentiable on the intervals [FX−1k (a)−ε, FX−1k (b)+ε] and [FY−1 (a)−ε, FY−1 (b)+ε] with positive derivatives fXk and fY , respectively, for some ε > 0 and k = 1, 2. Furthermore, assume that conditional density functions fY |Xk and fXk |Y , k = 1, 2, are continuous on the product of these intervals. Then we have √ n{[b ̺Y,X1 (τ, ι) − ̺bY,X2 (τ, ι)] − [̺Y,X1 (τ, ι) − ̺Y,X2 (τ, ι)]} 8 w GY,X1 ,X2 (τ, ι), in ℓ∞ ([a, b]2 ), where GY,X1 ,X2 (τ, ι) is Gaussian process with mean zero and covariance function Ξ1 (τ1 , ι1 ; τ2 , ι2 ) ≡ E{[η(Y, X1 , X2 ; τ1 , ι1 ) − Eη(Y, X1 , X2 ; τ1 , ι1 )] × [η(Y, X1 , X2 ; τ2 , ι2 ) − Eη(Y, X1 , X2 ; τ2 , ι2 )]}, η(Y, X1 , X2 ; τ, ι) = ξ(Y, X1 ; τ, ι) − ξ(Y, X2 ; τ, ι) and ξ(Y, X; τ, ι) is defined in Theorem 2.1. It follows from Theorem 2.2 that for a fixed pair (τ, ι), if ̺Y,X1 (τ, ι) = ̺Y,X2 (τ, ι), then √ d (1) (2) n{[b ̺Y,X1 (τ, ι) − ̺bY,X2 (τ, ι)] → N(0, Ξ1 ), where Ξ1 ≡ Ξ1 (τ, ι; τ, ι) = Ω1 + Ω1 − 2A12 , where (k) Ω1 is the same as Ω1 only except that X involved in Ω1 is substituted by Xk for k = 1, 2,  and A12 ≡ A12 (τ, ι) = [σY,X1 ,X2 (τ, ι)−σY,X1 σY,X2 ]−(1−τ )σX2 |Y σY,X1 −σY |X2 [σY,X1 ,X2 (τ, ι)− ισY,X1 ]−(1−τ )σX1 |Y σY,X2 +τ (1−τ )σX1 |Y σX2 |Y +σX1 |Y σY |X2 (σY,X2 −τ ι)−σY |X1 [σY,X1 ,X2 (τ, ι)− p ισY,X2 ] + σY |X1 σX2 |Y (σY,X1 − τ ι) + σY |X1 σY |X2 [σX1 ,X2 (ι, ι) − ι2 ] / τ (1 − τ )ι(1 − ι), where σY,X1 ,X2 (τ, ι) = FY,X1 ,X2 (FY−1 (τ ), FX−11 (ι), FX−12 (ι)) and σX1 ,X2 (ι, ι) = FX1 ,X2 (FX−11 (ι), FX−12 (ι)). If Y, X1 and X2 are mutually independent, then Ξ1 = 2. Next, we estimate the covariance function Ξ1 (τ1 , ι1 ; τ2 , ι2 ). Let ηbn (Yi , Xi1 , Xi2 ; τ, ι) = ξbn (Yi , Xi1 ; τ, ι) − ξbn (Yi , Xi2 ; τ, ι), P where ξbn (Yi , Xi ; τ, ι) is given before, and η n (Y, X1 , X2 ; τ, ι) = n−1 ni=1 ηbn (Yi , Xi1 , Xi2 ; τ, ι). P b 1 (τ1 , ι1 ; τ2 , ι2 ) = n−1 n [b Then, Ξ1 (τ1 , ι1 ; τ2 , ι2 ) can be estimated as Ξ i=1 ηn (Yi , Xi1 , Xi2 ; τ1 , ι1 )− η n (Y, X1 , X2 ; τ1 , ι1 )] × [b ηn (Yi , Xi1 , Xi2 ; τ2 , ι2 ) − ηn (Y, X1 , X2 ; τ2 , ι2 )]. 2.2 CC-based Variable Screening Suppose that we collect a sample {(Yi , Xi ), i = 1, · · · , n} consisting of n independent copies of (Y, X), where Y is the response variable and X = (X1 , · · · , Xp )T is a vector of p predictors. When the number, p, of predictors is of an exponential order of sample size n, i.e., the socalled ultrahigh dimension, and most of p predictors are irrelevant, we can use CC as a screener to identify the sparse set of informative predictors. We write pn instead of p to emphasize the dependence on sample size. An empirical estimate for CC between Y and Xj 9 is given by ̺bY,Xj (τ, ι) = n−1 Pn i=1 −1 −1 ψτ (Yi − Fn,Y (τ ))ψι (Xij − Fn,X (ι)) j p . τ (1 − τ )ι(1 − ι) (3) Then, we may select an empirical active set to be  ca = j : |b M ̺Y,Xj (τ, ι)| ≥ νn , 1 ≤ j ≤ pn , (4) where νn is a user-specified threshold parameter that controls the size of finally screened model. Using CC may lead to sure independence screening (SIS) property and this procedure will be abbreviated as CC-SIS. Denote the true active set by M∗a = {j : |̺Y,Xj (τ, ι)| > 0, j = 1, . . . , pn }. Write FY−1|X (τ ) = inf{y : P (Y ≤ y|X) ≥ τ }, uj = |̺Y,Xj (τ, ι)| and u bj = |b ̺Y,Xj (τ, ι)|. To establish the screening consistency, we need the following conditions. (C1) In a neighbourhood of FY−1 (τ ), the density fY (y) of Y is uniformly bounded away from zero and infinity and has bounded derivative. For every 1 ≤ j ≤ pn , in a neighbourhood of FX−1j (ι), the density fXj (x) of Xj is uniformly bounded away from zero and infinity and has bounded derivative. (C2) minj∈M∗a uj ≥ C0 n−κ for some κ > 0 and C0 > 0. Theorem 2.3. (Screening Property for CC-SIS) Suppose that the condition (C1) holds, (i) for any constant C > 0, then there exists some positive constant c̃1 such that for sufficiently large n, P   bj − uj ≥ Cn−κ ≤ 6pn exp(−c̃1 n1−2κ ). max u 1≤j≤pn (ii) In addition, if condition (C2) is further satisfied and by choosing νn = C1 n−κ with 10 C1 ≤ C0 /2, we have   ca ≥ 1 − 6sn exp(−c̃1 n1−2κ ) P M∗a ⊂ M for sufficiently large n, where sn = |M∗a | is the cardinality of set M∗a . This result implies that the CC-SIS can select all the truly active predictors with an overwhelming probability. The dimensionality can be as high as pn = o(exp(n1−2κ )), similar to many model-free feature screening methods (see Li et al. (2012a) and Wu and Yin (2015) for example). Moreover, our result requires less condition on both the predictors and the response due to the nonparametric nature. In fact, the condition does not involve any moment assumption of the predictors or the response. In practice, the threshold parameter νn plays an important role in producing a satisfied model. Small νn value will result in a large number of predictors after screening, which in turn leads to many incorrect positives. Here we consider a data-driven procedure to determine the threshold for the CC-SIS by controlling the false discovery rates (FDR). By Theorem 2.1, for covariate j such that ̺Y,Xj (τ, ι) = 0, it follows that asymptotically, √ b n[Ω1 (τ, ι; τ, ι)]−1/2 ̺bY,Xj (τ, ι) ∼ N(0, 1). We can use high-criticism t-tests to select varib 1 (τ, ι; τ, ι)]−1/2 |b ca,δ = {j : √n[Ω ̺Y,Xj (τ, ι)| ≥ δ} for a small δ > 0. This controls the ables M ca,δ ∩ (M∗ )c |/|(M∗ )c |} defined by Zhao and Li (2012). The following proposition FDR E{|M a a justifies this FDR procedure under the condition below. (C3) For j ∈ (M∗a )c , ̺Y,Xj (τ, ι) = 0. Proposition 2.4. (FDR Property) Under conditions (C1)-(C3) and the condition of Theorem 2.1, if we choose δ = Φ−1 (1 − d¯n /(2pn )) and Φ(·) is CDF of standard normal variable and d¯n is the number of false positives that can be tolerated, then for some constant ca > 0, 11 we have n |M ca,δ ∩ (M∗ )c | o d¯n √ a n. E ≤ + c / a |(M∗a )c | pn 3 Copula-based Partial Correlation and Variable Screening 3.1 Copula-based Partial Correlation, CPC To facilitate a joint screening procedure (Ma et al. (2017)), we define a copula-based partial correlation (CPC) for Y and X conditional on a q-dimensional random vector Z as E{ψτ (Y − ZT α0 )ψι (X − ZT θ 0 )} p , ̺Y,X|Z (τ, ι) = τ (1 − τ )ι(1 − ι) (5) where α0 = argminα E{ρτ (Y − ZT α)} and θ 0 = argminθ E{ρι (X − ZT θ)} and ρw (u) = u[w − −1 I(u ≤ 0)] for w = τ or ι. Note that this implies that ZT α0 = FY−1|Z (τ ) and ZT θ 0 = FX|Z (ι). Parameters α and θ can be interpreted as the marginal increment on conditional quantiles of Y and X given Z, respectively, when increasing by a unit of Z. CPC is actually the CC between Y and Xj after removing the confounding effects of Z. Linear partial correlation has been widely used in regression diagnostics and describes the association of the response and predictor conditional on specifical values of other predictors. The unconditional ̺Y,X (τ, ι) value may be spurious due to lurking variables and does not necessarily imply the same ̺Y,X|Z (τ, ι) value conditional on Z. Our copula based version is relatively more robust for real data analysis. The CC is a special case of CPC when Z is a constant. With sample observations {(Yi , Xi , Zi ), i = 1, . . . , n}, we can obtain the following estimate P b = argmin 1 Pn ρι (Xi − ZT θ). b = argminα n1 ni=1 ρτ (Yi − ZTi α) and θ of ̺Y,X|Z (τ, ι). Let α θn i i=1 12 Both can be obtained from a quantile regression straightforwardly. An empirical estimator for ̺Y,X|Z (τ, ι) is ̺bY,X|Z (τ, ι) = n−1 Pn i=1 b b ι (Xi − ZTi θ) ψτ (Yi − ZTi α)ψ p . τ (1 − τ )ι(1 − ι) (6) To study the asymptotic property of ̺bY,X|Z (τ, ι), we denote  ∆11 = E{fY |Z (ZT α0 )ZZT }, ∆12 = E FX|Z,Y =ZT α0 (ZT θ 0 )fY |Z (ZT α0 )Z ,  ∆21 = E FY |Z,X=ZT θ0 (ZT α0 )fX|Z (ZT θ 0 )Z , ∆22 = E{fX|Z (ZT θ 0 )ZZT }, Σ11 = E{FY,X|Z (ZT α0 , ZT θ 0 )}[1 − E{FY,X|Z (ZT α0 , ZT θ 0 )}], Σ22 = E{ψτ2 (Y − ZT α0 )ZZT }, Σ12 = E{FY,X|Z (ZT α0 , ZT θ 0 )Z}, Σ33 = E{ψι2 (X − ZT θ 0 )ZZT }, Σ23 = E{ψτ (Y − ZT α0 )ψι (X − ZT θ 0 )ZZT }, where α0 and θ 0 are defined in (5). We have the following asymptotic result for the CPC. Theorem 3.1. Let 0 < a < b < 1. Suppose that ∆11 and ∆22 are uniformly positive definite matrices in τ and ι, and there exists a constant π > 0 such that fY |Z (ZT α0 + ·), fY |Z,X (ZT α0 + ·), fX|Z,Y (ZT θ 0 + ·) and fX|Z (ZT θ 0 + ·) are uniformly integrable on [−π, π] and uniformly bounded away from zero and infinity in τ and ι. Then we have √ n{b ̺Y,X|Z (τ, ι) − ̺Y,X|Z (τ, ι)} w GY,X|Z (τ, ι) in ℓ∞ ([a, b]2 ), where GY,X|Z (τ, ι) is Gaussian process with mean zero and covariance function Ω2 (τ1 , ι1 ; τ2 , ι2 ) ≡ E{[ζ(Y, X, Z; τ1 , ι1 )−Eζ(Y, X, Z; τ1 , ι1 )]×[ζ(Y, X, Z; τ2 , ι2 )−Eζ(Y, X, Z; τ2 , ι2 )]} −1 T 0 T and ζ(Y, X, Z; τ, ι) = [I(Y ≤ ZT α0 , X ≤ ZT θ 0 ) − ∆T12 ∆−1 11 I(Y ≤ Z α )Z − ∆21 ∆22 I(X ≤ p ZT θ 0 )Z]/ τ (1 − τ )ι(1 − ι). 13 If Z ≡ 1, in another word, there is no conditional variable available, the asymptotic distribution in Theorem 3.1 reduces to that in Theorem 2.1. The above result implies √ d ̺Y,X|Z (τ, ι) → N(0, Ω2 ), where Ω2 ≡ that for a fixed pair (τ, ι), if ̺Y,X|Z (τ, ι) = 0, then nb Ω2 (τ, ι; τ, ι) = E{[ζ(Y, X, Z; τ, ι)−Eζ(Y, X, Z; τ, ι)]2 } = −1 1 [Σ11 +∆T12 ∆−1 11 Σ22 ∆11 ∆12 + τ (1−τ )ι(1−ι) −1 −1 −1 −1 −1 T T T ∆T21 ∆−1 22 Σ33 ∆22 ∆21 − 2(1 − τ )∆12 ∆11 Σ12 − 2(1 − ι)∆21 ∆22 Σ12 + 2∆12 ∆11 Σ23 ∆22 ∆21 ]. This theorem can be used for statistical inference if we can find a consistent estimate of Ω2 . To this end, let e∗1 = Y − ZT α0 and e∗2 = X − ZT θ 0 and assume that the random vectors (e∗1 , Z, X) and (e∗2 , Z, Y ) have joint densities fe∗1 ,Z,X and fe∗2 ,Z,Y , respectively. Denote by fe∗1 , fe∗2 , fe∗1 |Z , fe∗1 |Z,X , fe∗2 |Z and fe∗2 |Z,Y the marginal densities of e∗1 and of e∗2 , the conditional densities of e∗1 given Z and (Z, X) and of e∗2 given Z and (Z, Y ), respectively. Then, it can be verified that ∆11 = E{fe∗1 |Z (0)ZZT } = fe∗1 (0)E{ZZT |e∗1 = 0} and, similarly, ∆12 = fe∗1 (0)E{I(X ≤ ZT θ 0 )Z|e∗1 = 0}, ∆21 = fe∗2 (0)E{I(Y ≤ ZT α0 )Z|e∗2 = 0} and ∆22 = fe∗2 (0)E{ZZT |e∗2 = 0}. To estimate these quantities, we first calculate the b and then obtain the corresponding quantile residb and θ quantile regression estimates α b for i = 1, . . . , n. Next, we provide an estib and ê∗2i = Xi − ZTi θ uals ê∗1i = Yi − ZTi α mate for ∆12 and the estimators for ∆11 , ∆21 and ∆22 can be obtained similarly. We can use nonparametric NW estimates used in estimating σX|Y (τ, ι) and σY |X (τ, ι) in Section 2.1 to obtain estimates for each component of m(s) = E{I(X ≤ ZT θ 0 )Z|e∗1 = s} using b i ), i = 1, . . . , n}, and denote it by m(s). b Then we obtain the data {(ê∗1i , I(Xi ≤ ZTi θ)Z b 12 = fbe∗ (0)m(0), b ∆ where fbe∗1 (0) is a nonparametric kernel density estimate for fe∗1 (0) in ∆12 1 b 12 is consistent under some regubased on {ê∗1i , i = 1, . . . , n}. It can be shown that such ∆ b 11 = n−1 Pn I(Yi ≤ larity conditions. For other unknown terms involved in Ω2 , we have Σ i=1 P P n Tb 2 b −1 2 T b − [n−1 n I(Yi ≤ ZT α, b Xi ≤ ZTi θ) b i ZTi , ZTi α, i b Xi ≤ Zi θ)] , Σ22 = n i=1 i=1 ψτ (Yi − Zi α)Z P P Tb b i ZT , Σ b 12 = n−1 n I(Yi ≤ ZT α, b 33 = n−1 n ψ 2 (Xi − ZT θ)Z Σ i b Xi ≤ Zi θ)Zi , and i i i=1 i=1 ι P Tb T b 23 = n−1 n ψτ (Yi − ZT α)ψ Σ ι (Xi − Zi θ)Zi Zi . Using the plug-in approach, a consisi b i=1 b 2. tent estimate of Ω2 is thus obtained and denoted by Ω 14 The next theorem can be used to test whether ̺τ,ι (Y, X1 |Z) = ̺τ,ι (Y, X2 |Z) for two different random variables X1 and X2 . Write θ 0k = argminθ E{ρι (Xk − ZT θ)} for k = 1, 2 and (k) let ∆12 be ∆12 , where the involved X and θ 0 are replaced by Xk and θ 0k , respectively, for (k) (k) (k) (k) (k) (k) k = 1, 2. In the same manner, we can define ∆21 , ∆22 , Σ11 , Σ33 , Σ12 , Σ23 and, accord(k) ingly, Ω2 with k = 1, 2. In addition, we write ∆31 = E{FY,X1 ,X2 |Z (ZT α0 , ZT θ 01 , ZT θ 02 )} − E{FY,X1 |Z (ZT α0 , ZT θ 01 )}E{FY,X2 |Z (ZT α0 , ZT θ 02 )}, ∆32 = E{FY,X1 ,X2 |Z (ZT α0 , ZT θ 01 , ZT θ 02 )Z} and ∆33 = E{ψι (X1 − ZT θ 01 )ψι (X2 − ZT θ 02 )ZZT }. (k) Theorem 3.2. Let 0 < a < b < 1. Suppose that matrices ∆11 and ∆22 , k = 1, 2, are uniformly positive definite in τ and ι, and there exists a constant π > 0 such that fY |Z (ZT α0 + ·), fY |Z,Xk (ZT α0 +·), fXk |Z,Y (ZT θ 0 +·) and fXk |Z (ZT θ 0 +·) are uniformly integrable on [−π, π] for k = 1, 2 and uniformly bounded away from zero and infinity in τ and ι. Then √ n{[b ̺Y,X1 |Z (τ, ι) − ̺bY,X2 |Z (τ, ι)] − [̺Y,X1 |Z (τ, ι) − ̺Y,X2 |Z (τ, ι)]} w GY,X1 ,X2 |Z (τ, ι) in ℓ∞ ([a, b]2 ), where GY,X1 ,X2 |Z (τ, ι) is Gaussian process with mean zero and covariance function Ξ2 (τ1 , ι1 ; τ2 , ι2 ) ≡ E{[β(Y, X1 , X2 , Z; τ1 , ι1 )−Eβ(Y, X1 , X2 , Z; τ1 , ι1 )]×[β(Y, X1 , X2 , Z; τ2 , ι2 )− Eβ(Y, X1 , X2 , Z; τ2 , ι2 )]} and β(Y, X1 , X2 , Z; τ, ι) = ζ(Y, X1, Z; τ, ι) − ζ(Y, X2 , Z; τ, ι), where ζ(Y, X1, Z; τ, ι) is given in Theorem 3.1. For fixed (τ, ι), if ̺τ,ι (Y, X1 |Z) = ̺τ,ι (Y, X2 |Z), then (1) (2) √ d n[b ̺Y,X1 |Z (τ, ι) − ̺bY,X2 |Z (τ, ι)] → N(0, Ξ2 ), where Ξ2 ≡ Ξ2 (τ, ι; τ, ι) = Ω2 +Ω2 −2B12 and B12 ≡ B12 (τ, ι) = (2) (1) (1) (2) (1) (2) 1 [∆31 − τ (1−τ )ι(1−ι) (1) (2) (2) (2) −1 T −1 T −1 T −1 −1 (1−τ )(∆12 )T ∆−1 11 Σ12 −(1−τ )(∆12 ) ∆11 Σ12 +(∆12 ) ∆11 Σ22 ∆11 ∆12 +(∆12 ) ∆11 Σ23 (∆22 ) ∆21 + (1) (1) (1) (1) (1) (2) (2) (2) (1) (1) (1) (2) T −1 T −1 −1 (∆21 )T (∆22 )−1 ∆32 +(∆21 )T (∆22 )−1 Σ23 ∆−1 11 ∆12 +(∆21 ) (∆22 ) (ιΣ12 −∆32 )+(∆21 ) (∆22 ) ∆33 (∆22 ) Given a sample of observations {(Yi , Xi1 , Xi2 , Zi ), i = 1, . . . , n}, the asymptotic variance Ξ2 b2 = Ω b (1) + Ω b (2) − 2B b12 , where Ω b (1) and Ω b (2) are defined as Ω b 2 given can be estimated as Ξ 2 2 2 2 b12 , we only need to estimate ∆31 , Σ32 and Σ32 since the rest above. To obtain the estimate B of unknown quantities involved in B12 can be estimated using the previous methods. To this 15 Tb b 31 = n−1 Pn I(Yi ≤ ZT α, end, we can use the following estimates: ∆ i b Xi1 ≤ Zi θ 1 , Xi2 ≤ i=1   −1 Pn  Tb T b2 ) − n−1 Pn I(Yi ≤ ZT α, b2 ) , ∆ b 32 = b Xi2 ≤ ZTi θ ZTi θ i b Xi1 ≤ Zi θ 1 ) n i=1 i=1 I(Yi ≤ Zi α, Pn P Tb −1 b1 , Xi2 ≤ ZT θ b b b Xi1 ≤ ZTi θ n−1 ni=1 I(Yi ≤ ZTi α, i 2 )Zi , ∆33 = n i=1 ψι (Xi1 − Zi θ 1 )ψι (Xi2 − b2 )Zi ZT , where θ bk = argmin n−1 Pn ρι (Xik − ZT θ), k = 1, 2. ZTi θ θ i i i=1 3.2 CPC-based Variable Screening We may now propose a joint robust screening using the CPC. There are two practical scenarios to favor joint screening over marginal screening. First, very often we may acquire low-dimensional variables W ∈ Rr in addition to ultrahigh dimensional covariates X. For example, when studying the relationship between a disease phenotype Y and genetic variables X, we may also have patient demographical information or environmental variables and include them in W. Consequently, we have a data set {(Yi , Xi , Wi ), i = 1, . . . , n}. Second, even if there is no external variables W, it may still be necessary to consider a joint screening by removing the effects from correlated components in X. For instance, some covariates, XSj , may be closely correlated to Xj and influence the observed correlation between Y and Xj indirectly, where Sj is a subset of {1, · · · , pn } \ {j}. Ma et al. (2017) also considered a set Sj which is referred to as a conditional set with relatively small size (< n). To account for both scenarios, we may consider the conditional variables Z = (WT , XTSj )T in this paper. We allow that the conditional variables Z to differ with j. However, for simplicity of presentation, we still use Z instead of Zj , and we denote by qn the dimension of Z. In principle, we only need qn = max1≤j≤pn (r + |Sj |) for sure screening. In practice, we may select a proper Sj as follows: Treat Xj as the response and X−j = {Xk , k 6= j, 1 ≤ k ≤ pn } as the predictors and then apply any sensible marginal screening method such as the CC-SIS to pick out the top ℓ most important predictors and set them as the conditional variables. For ultrahigh dimensional covariates X = (X1 , · · · , Xpn )T , we can define CPC between 16 Y and the jth marker Xj given Z in the same way as in (5), namely, ̺Y,Xj |Z (τ, ι) = E{ψτ (Y − ZT α0 )ψι (Xj − ZT θ 0j )} p , τ (1 − τ )ι(1 − ι) (7) where α0 = argminα E{ρτ (Y − ZT α)} and θ 0j = argminθj E{ρι (Xj − ZT θ j )}. As in (6), a sample estimate for ̺Y,Xj |Z (τ, ι) can be given as ̺bY,Xj |Z (τ, ι) = b = argminα n1 where α Pn i=1 n−1 Pn i=1 bj ) b ι (Xij − ZTi θ ψτ (Yi − ZTi α)ψ p , τ (1 − τ )ι(1 − ι) (8) bj = argmin 1 Pn ρι (Xij − ZT θ j ). The ρτ (Yi − ZTi α) and θ θj n i i=1 CPC screening yields the following empirical active set: cb = {j : |b M ̺Y,Xj |Z (τ, ι)| ≥ vn , 1 ≤ j ≤ pn }, (9) where vn is a user-specified threshold parameter. We refer to this sure independence screening procedure as CPC-SIS. Clearly, CPC-SIS extends earlier conditional sure independence screening such as Barut et al. (2016). Let M∗b = {j : |̺Y,Xj |Z (τ, ι)| > 0, j = 1, . . . , p} be the true active set. We write FY−1|X,W (τ ) = inf{y : P (Y ≤ y|X, W) ≥ τ }. For simplicity, we still use uj = |̺Y,Xj |Z (τ, ι)| and u bj = |b ̺Y,Xj |Z (τ, ι)| to denote the underlying and empirical CPC utilities, respectively. To establish the sure screening property, we need the following conditions, which are very mild and similarly imposed in Ma et al. (2017). (D1) (i) The conditional density fY |Z=z (y) of Y given Z = z satisfies the Lipschitz condition of order 1 and fY |Z=z (y) > 0 for any y in a neighborhood of ZT α0 = zT α0 . (ii) For every 1 ≤ j ≤ pn , the conditional density fXj |Z=z (x) of Xj given Z = z satisfies the Lipschitz condition of order 1 and fXj |Z=z (x) > 0 for any x in a neighborhood of ZT θ 0 = zT θ 0 . 17 (D2) (i) There exist some finite constants m1 , m2 and m3 such that max |Zij | ≤ m1 , i,j max |ZTi α0 | ≤ m2 , i max |ZTi θ 0j | ≤ m3 . i,j (ii) There exist two positive finite constants cmin and cmax such that cmin ≤ λmin (E(ZZT )) ≤ λmax (E(ZZT )) ≤ cmax , where λmin (E(ZZT )) and λmax (E(ZZT )) stand for the minimum and maximum eigenvalues of E(ZZT ), respectively. (D3) minj∈M∗b uj ≥ C0∗ n−κ for some κ > 0 and C0∗ > 0. Theorem 3.3. (Screening Property for CPC-SIS) Suppose that the conditions (D1) and (D2) hold, (i) for any constant C > 0, then there exists some positive constant c̃∗1 such that for sufficiently large n, P   bj − uj ≥ Cn−κ ≤ 12pn exp(−c̃∗1 qn−1 n1−2κ ). max u 1≤j≤pn (ii) In addition, if condition (D3) is further satisfied and by choosing vn = C2 n−κ with C2 ≤ C0∗ /2, we have   ∗ c P Mb ⊂ Mb ≥ 1 − 12sn exp(−c̃∗1 qn−1 n1−2κ ) for sufficiently large n, where sn = |M∗b |. When conditional variables are available, our proposed CPC-SIS method can handle the dimensionality of order pn = o(exp(qn−1 n1−2κ )). If qn = O(1), then the dimension can be as 18 high as o(n1−2κ ), the same order as that of the CC-SIS. Moreover, the proposed CPC-SIS can be readily used for the ultrahigh dimensional data as long as qn = o(n1−2κ ). As in Section 2.2, we can determine a proper vn by controlling FDR. By Theorem 3.1, for √ b −1/2 covariate j such that ̺Y,Xj |Z (τ, ι) = 0, we have nΩ ̺bY,Xj |Z (τ, ι) ∼ N(0, 1) asymptotically. 2 cb,δ = {j : √nΩ b −1/2 |b Then, we select variables M ̺Y,Xj |Z (τ, ι)| ≥ δ} for a small δ > 0, which 2 cb,δ ∩ (M∗ )c |/|(M∗)c |} under the following condition. controls the FDR E{|M b b (D4) For j ∈ (M∗a )c , we have that ̺Y,Xj |Z (τ, ι) = 0. Proposition 3.4. (FDR Property) Under conditions (D1)-(D4) and the condition of Theorem 3.1, if we choose δ = Φ−1 (1 − d¯n /(2pn )) and Φ(·) and d¯n are the same as those in Proposition 2.4, then for some constant cb > 0, we have n |M cb,δ ∩ (M∗ )c | o d¯n √ b E ≤ + cb / n. ∗ c |(Mb ) | pn 4 Implementation on CPC-SIS We provide more details on the implementation of CPC-SIS. We consider three practical types of conditional variables in the following. Case 1. If W is not available, we consider the conditional variables from X itself for each Xj , namely, Z = XSj for j = 1, . . . , pn . We start with an empty active set A(0) = ∅. • Step 1. For j = 1, . . . , pn , select confounding sets Sjν ’s via the partial correlation based consequential test (Ma et al. (2017)). • Step 2. In the kth iteration, where k = 1, . . . , d∗ and d∗ = ⌊2(n/ log n)1/2 ⌋, for given A(k−1) , we update Sj = A(k−1) ∪ Sjν and then find the variable index j ∗ such that j ∗ = argmaxj6∈A(k−1) |b ̺Y,Xj |Z (τ, ι)|. Update A(k) = A(k−1) ∪ {j ∗ }. 19 • Step 3. In the kth iteration, where k = d∗ + 1, . . . , dn , we set Sj = A(d ) ∪ Sjν and then ∗ cb find j ∗ = argmaxj6∈A(k−1) |b ̺Y,Xj |Z (τ, ι)|. Update A(k) = A(k−1) ∪ {j ∗ }. Use A(dn ) ≡ M as the final set of selected covariates. Case 2. If W is available, we consider the same conditional variables for each target Xj , namely, Z = W for j = 1, . . . , pn . • Step 1. For j = 1, . . . , pn , compute the CPC utility statistics u bj = |b ̺Y,Xj |Z (τ, ι)|. • Step 2. Rank the covariates in terms of their u bj ’s in a decreasing order and then select the top dn covariates as the final set of selected covariates. Case 3. If W is available, we slightly modify the algorithm in Case 1. The steps are the same as those in Case 1 only except that we consider the conditional variables Z = (WT , XTSj )T in each iteration for 1 ≤ k ≤ dn for each step. Case 1 only utilizes the confounding information from covariates X itself while Case 2 incorporates the exogenous conditional information but ignores the confounding effect from X itself. Case 3 is a the most flexible version incorporating all types of covariate information. We will implement Case 3 for the real data analysis in this paper. 5 5.1 Numerical Studies Simulation Studies In this section, we conduct simulations to examine the finite sample performances of the two proposed copula-based correlations: CC and CPC, as well as the two so-constructed screening procedures: CC-SIS and CPC-SIS. 20 5.1.1 Inference Performance We consider two simulation examples with fixed dimension p in this subsection, and illustrate the practical performance of estimated CC and CPC, respectively. We consider sample size n = 200 and 400 and set the number of repetitions to be N = 5000 in Examples 1 and 2. Example 1. We generate the response from two models • (a1) Y = exp(2X1 ) + exp((2 + c0 )X2 ), where (X1 , X2 ) is from a standard bivariate normal distribution with corr(X1 , X2 ) = ρ; • (a2) Y = 2X01 + (2 + c0 )X02 + ε, where in model (a2), covariates X1 and X2 are both generated from a mixture distribution of a normal distribution with probability 0.9 and a cauchy distribution with probability 0.1, that is, X1 = 0.9X01 + 0.1ǫ1 and X2 = 0.9X02 + 0.1ǫ2 with (X01 , X02 ) following a standard bivariate normal distribution with corr(X01 , X02 ) = ρ, ǫ1 ∼ 1 Cauchy(0, 1) 5 and ǫ2 ∼ 15 Cauchy(0, 1) are independent and the model error ε is generated from N(0, 1). Our interest of this example is to test H0 : ̺Y,X1 (τ, ι) = ̺Y,X2 (τ, ι) at the significance level α0 = 0.05 under various values of c0 . We consider different ρ’s and set c0 = 0, 1, 2, 4, where c0 = 0 implies that H0 holds true, whereas H0 should be rejected with large probability for other values of c0 . We report the empirical size and power for each setup over 5000 runs in Table 1. Observing Table 1, we can see that our proposed CC testing procedure based on Theorem 2.2 performs satisfactorily across different quantile levels (τ, ι) since the empirical size are close to nominal level α0 = 0.05 and enlarging the sample size from 200 to 400 generally tends to improve the performance. Also we can see that when c0 runs away from 0, the empirical power increases to 1, and when the correlation between X1 and X2 is low, the performance will be better. Example 2. In this example, we generate conditional variables Z = (Z1 , Z2 , Z3 , Z4 )T from the 4-dimensional multivariate normal distribution N(04 , Σ) with Σ = (ρ|j−k|)1≤j,k≤4. We 21 ρ 0 Method(τ, ι) CC(0.25,0.25) CC(0.5,0.5) CC(0.75,0.75) 0.5 CC(0.25,0.25) CC(0.5,0.5) CC(0.75,0.75) 0.9 CC(0.25,0.25) CC(0.5,0.5) CC(0.75,0.75) n 200 400 200 400 200 400 200 400 200 400 200 400 200 400 200 400 200 400 c0 = 0 0.056 0.051 0.059 0.054 0.057 0.055 0.055 0.056 0.057 0.053 0.054 0.052 0.055 0.052 0.061 0.050 0.045 0.047 Model (a1) 1 2 0.07 0.07 0.07 0.09 0.33 0.69 0.57 0.93 0.77 0.99 0.96 1.00 0.06 0.08 0.06 0.08 0.26 0.56 0.44 0.83 0.71 0.99 0.95 1.00 0.08 0.17 0.09 0.29 0.17 0.36 0.27 0.59 0.52 0.91 0.85 1.00 4 0.08 0.08 0.94 1.00 1.00 1.00 0.14 0.18 0.85 0.98 1.00 1.00 0.47 0.75 0.63 0.87 0.99 1.00 c0 = 0 0.051 0.055 0.057 0.048 0.053 0.050 0.048 0.052 0.050 0.049 0.052 0.043 0.048 0.052 0.048 0.048 0.053 0.049 Model (a2) 1 2 0.48 0.90 0.78 1.00 0.56 0.95 0.85 1.00 0.49 0.90 0.78 1.00 0.27 0.62 0.45 0.90 0.29 0.68 0.51 0.93 0.26 0.63 0.47 0.89 0.10 0.19 0.14 0.35 0.09 0.20 0.15 0.36 0.09 0.20 0.14 0.36 4 1.00 1.00 1.00 1.00 1.00 1.00 0.94 1.00 0.96 1.00 0.93 1.00 0.43 0.73 0.45 0.75 0.43 0.72 Table 1: Empirical size and power for testing H0 : ̺Y,X1 (τ, ι) = ̺Y,X2 (τ, ι) using CC across (τ, ι) = (0.25, 0.25), (0.5, 0.5) and (0.75, 0.75) for Example 1. generate Y from the model • Y = 2X1 + (2 + c0 )X2 + ZT b + ε, where b = (3, 4, 3, 4)T , X1 = ZT b + ǫ1 and X2 = ZT b + ǫ2 , where ǫ1 ∼ 13 t(3) and ǫ2 ∼ 31 t(3) are independent. The other setups are the same as Example 1. In this example, our interest is to test H0 : ̺Y,X1 |Z (τ, ι) = ̺Y,X2 |Z (τ, ι) at the significance level α0 = 0.05. Here, we consider the performance of CPC with (τ, ι) = (0.5, 0.5) and the corresponding empirical size and power are reported in Table 2. A similar conclusion can be drawn as in Example 1. These numerical results empirically demonstrate that our theoretical result in Theorem 3.2 is valid. 5.1.2 Screening Performance for CC-SIS and CPC-SIS Throughout this subsection, we adopt the following simulation setup: the sample size n = 200, the covariate dimension p = 1000, and the number of simulations N = 200 22 ρ 0 0.5 0.9 n 200 400 200 400 200 400 c0 = 0 0.032 0.035 0.035 0.036 0.032 0.044 ε ∼ N (0, 1) 1 2 0.22 0.57 0.51 0.94 0.22 0.57 0.50 0.94 0.22 0.59 0.50 0.94 4 0.90 1.00 0.90 1.00 0.91 1.00 c0 = 0 0.033 0.041 0.037 0.048 0.042 0.050 ε ∼ 13 Cauchy(0, 1) 1 2 0.25 0.61 0.58 0.95 0.26 0.61 0.59 0.95 0.26 0.61 0.58 0.96 4 0.87 1.00 0.88 1.00 0.87 1.00 Table 2: Empirical size and power for testing H0 : ̺Y,X1 |Z (τ, ι) = ̺Y,X2 |Z (τ, ι) using CPC with (τ, ι) = (0.5, 0.5) in Example 2. for each simulation setup. Moreover, for the purpose of comparison, we use three criteria for evaluation: the first criterion is the minimum model size (MMS), namely, the smallest number of the selected covariates that contain all the active covariates, and its robust standard deviation (RSD); the second is the rank for each active covariates (Rj ); and the third is the proportion of all the active covariates being selected (P) with the screening threshold specified as ⌊n/ log n⌋ over N simulations. We report the median of MMS and Rj . In Example 3, we compare our CC-SIS methods with a few existing methods: SIS (Fan and Lv (2008)), SIRS (Zhu et al. (2011)), DC-SIS (Li et al. (2012b)), Kendall-SIS (Li et al. (2012a)), QC-SIS (Li et al. (2015)) and CQC-SIS (Ma and Zhang (2016)). In Example 4, we compare our CPC-SIS procedure with the aforementioned marginal screening methods as well as the QPC-SIS (Ma et al. (2017)), where confounding effects arise from covariates X. In this example, we employ the algorithm in Case 1 given in Section 4 in order to compare with the QPC-SIS by Ma et al. (2017). In Example 5, we apply the algorithm in Case 2 and compare with the QPC-SIS by Ma et al. (2017). Example 3. This example is used to assess the performance of the proposed CC-SIS. Let X∗ = (X1∗ , . . . , Xp∗n )T be a latent random vector having the pn -dimensional normal distribution N(0pn , Σ) with Σ = (ρ|k−l| )1≤k,l≤pn , where we set the correlation ρ = 0.4 and 0.8. We write ǫ = (ǫ1 , . . . , ǫpn )T with each component ǫj being independent of other components and having the standard Cauchy distribution, i.e., ǫj ∼ Cauchy(0, 1). We generate covariates X from a mixture distribution: X = 0.8X∗ + 0.2ǫ, and simulate the response data from the 23 following three models: • (b1) Y = 3X1∗ + 3X2∗ + 2X3∗ + 2X4∗ + 2X5∗ + ε, ∗ • (b2) Y = 5X1∗ I(X1∗ < 0) + 5X2∗ I(X2∗ > 0) + 5 sin(X10 ) + ε, • (b3) Y = exp{3β1 sin(X1∗ ) + 2β2 exp(X2∗ ) + 1.5β3 I(X3∗ > 0) + 2 log(|X4∗ |)} + ε, where ε is simulated from two scenarios: ε ∼ N(0, 1) and ε ∼ Cauchy(0, 1) and, in model √ (b3), we set βj = cj (−1)U (4 log n/ n + Z0 ) for j = 1, 2 and 3, where U ∼ Bernoulli(0.4), Z0 ∼ N(0, 0.52 ) and (c1 , c2 , c3 ) = (1, 0.5, 1). The resulting screening results in terms of MMS and P are presented in Table 3. Eyeballing Table 3, we can make some key observations. Under models (b1) and (b2), our CC-SIS outperforms SIS, SIRS, DC-SIS and QC-SIS.In this case, both response and covariates are heavy-tailed and thus traditional linear correlation screening methods all fail to work. Our methods are also comparable to the nonparametric Kendall’s τ which achieves high accuracy but is slower due to the numerical integration in its implementation. (b3) is a difficult case and very hard to screen accurately. Under this case, our CC-SIS still performs much better than other methods. Example 4. This example is designed to evaluate the performance of the proposed CPCSIS. We generate the response from the following two models √ • (d1) Y = βX1 + βX2 + βX3 − 3β ρX4 + ε, √ • (d2) Y = βX1∗ + βX2∗ + βX3∗ − 3β ρX4∗ + ε, where β = 4 for both models. In model (d1), we consider the observed covariates X ∼ N(0pn , Σ) with Σ = (σij )1≤i,j≤pn , implying that covariates X have no outliers and the response Y is fully dependent on observed X up to a random noise. Under this setting, it is desired to expect that the QPC-SIS performs better than our CPC-SIS since X is normal. 24 Method(τ, ι) SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) CQC-SIS SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) CQC-SIS SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) CQC-SIS ρ = 0.4 ε ∼ N (0, 1) ε ∼ Cauchy(0, 1) MMS(RSD) P MMS(RSD) P Model (b1) 655 (396) 0.03 790 (227) 0.00 615 (176) 0.00 669 (158) 0.00 634 (441) 0.09 725 (350) 0.04 5 (0) 0.99 5 (1) 0.96 9 (18) 0.80 20 (41) 0.70 6 (7) 0.93 9 (14) 0.84 9 (15) 0.85 14 (40) 0.70 710 (315) 0.01 782 (271) 0.00 716 (334) 0.01 790 (250) 0.02 711 (297) 0.01 751 (314) 0.01 573 (156) 0.00 614 (149) 0.00 Model (b2) 482 (408) 0.13 638 (376) 0.01 551 (161) 0.00 589 (195) 0.00 284 (585) 0.30 607 (493) 0.12 3 (0) 1.00 3 (0) 1.00 6 (20) 0.78 13 (45) 0.68 3 (1) 0.98 4 (3) 0.95 7 (15) 0.85 14 (43) 0.66 615 (356) 0.06 588 (391) 0.05 584 (460) 0.07 640 (373) 0.05 588 (414) 0.03 579 (353) 0.02 512 (153) 0.00 562 (155) 0.00 Model (b3) 737 (296) 0.00 768 (204) 0.00 767 (215) 0.00 745 (182) 0.00 790 (245) 0.00 789 (213) 0.01 504 (467) 0.12 475 (442) 0.10 475 (234) 0.02 679 (317) 0.02 483 (357) 0.09 478 (337) 0.07 426 (419) 0.17 281 (460) 0.19 791 (199) 0.00 795 (191) 0.00 785 (210) 0.00 810 (209) 0.01 762 (257) 0.00 793 (240) 0.00 743 (216) 0.00 749 (177) 0.00 ρ = 0.8 ε ∼ N (0, 1) ε ∼ Cauchy(0, 1) MMS(RSD) P MMS(RSD) P 522 513 460 5 5 5 5 649 665 599 442 (431) (149) (527) (0) (0) (0) (0) (444) (438) (379) (118) 0.12 0.00 0.20 1.00 1.00 1.00 1.00 0.06 0.07 0.04 0.00 608 547 615 5 5 5 5 678 693 670 474 (389) (138) (489) (0) (0) (0) (0) (406) (398) (408) (104) 0.03 0.00 0.13 1.00 1.00 1.00 1.00 0.03 0.06 0.02 0.00 351 523 230 4 5 4 6 411 539 486 441 (414) (173) (569) (1) (2) (2) (3) (418) (474) (374) (122) 0.15 0.00 0.35 1.00 0.99 1.00 0.99 0.07 0.13 0.09 0.00 686 543 506 4 7 5 7 598 592 604 481 (331) (158) (514) (1) (4) (1) (3) (411) (425) (401) (150) 0.03 0.00 0.17 1.00 0.94 1.00 0.96 0.05 0.10 0.06 0.00 524 (399) 664 (240) 722 (276) 5 (192) 252 (365) 18 (341) 12 (309) 794 (222) 750 (266) 698 (408) 623 (210) 0.01 0.00 0.02 0.65 0.21 0.56 0.59 0.01 0.02 0.01 0.00 619 (368) 703 (203) 719 (309) 16 (377) 279 (455) 53 (357) 113 (349) 781 (225) 796 (219) 714 (311) 628 (260) 0.01 0.00 0.01 0.60 0.14 0.47 0.47 0.01 0.04 0.02 0.00 Table 3: Simulation results for Example 3, where MMS stands for the median of the minimum model size and its robust standard deviations (RSD) are given in parenthesis, P is the proportion of screened sets that cover all active predictors with screening parameter dn = ⌊n/ log n⌋. 25 In model (d2), we generate covariates X from a mixture distribution 0.9X∗ + 0.1ǫ, where X∗ ∼ N(0pn , Σ) with Σ = (σij )1≤i,j≤pn , and each element of ǫ is independent and distributed as 15 Cauchy(0, 1). In this model, the covariates are contaminated with outliers, while the heterogenicity of response Y stems merely from the random error ε. In addition, in model √ (d1), we let σii = 1 and σij = ρ, j 6= i except that σ4j = σj4 = ρ. In model (d1), we set σij = 0 if i > 4 or j > 4 and the rest are the same as model (d1). For both models, at the population level, the covariate X4 is marginally uncorrelated with Y . We consider two cases of ρ = 0.95 and 0.5 for simulation comparison. Tables 4 and 5 report the screening results regarding the rank Rj and MMS. From the tables, we can see that all the marginal screening approaches fail to pick out the covariate X4 with very large values of the rank R4 . QPC-SIS and our CPC-SIS work much better than those marginal methods. Particularly, under model (d1), our CPC-SIS has a very competitive performance to QPC-SIS. Under model (d2), when the covariates are highly correlated (ρ = 0.95), our proposal CPC-SIS(0.5,0.5) has the best performance. Example 5. In this example, we examine the case of Z = W. Since conditional variables selected for each Xj are the same, so we can simply employ our proposed CPC-SIS and the QPC-SIS of Ma et al. (2017) for variable screening. We generate the response from the model • Y = 2X1 + 2X2 − 4X3 + 3X4 + ε, where Xj = WT b+Uj , W has the same distribution as Z in Example 2, b = (2, 4/3, 2, 4/3)T and Uj ∼ 13 Cauchy(0, 1) for j = 1, · · · , pn . The model error ε is the same as that in Example 4. The simulation results are given in Table 6. As expected, we can see that all the marginal screening procedures fail to work since they are unable to identify the covariate X3 . Our proposed CPC-SIS still performs better than QPC-SIS in terms of MMS. 26 ρ Method(τ, ι) R1 R2 0.5 SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 28 3 3 91 56 114 3 3 3 2 2 2 2 2 2 2 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 52 3 3 95 49 92 3 3 3 2 2 2 2 2 2 0.95 ε ∼ N (0, 1) R3 R4 MMS (RSD) Model (d1) 2 450 450 (235) 3 469 501 (243) 2 497 497 (280) 2 454 454 (228) 2 367 372 (331) 2 415 425 (272) 2 371 387 (324) 2 478 493 (270) 2 437 437 (236) 2 437 438 (227) 2 4 4 (0) 2 4 4 (0) 2 4 4 (0) 2 4 4 (0) 2 4 4 (0) 2 4 4 (0) 3 470 498 (306) 45 474 541 (331) 3 506 556 (220) 3 482 529 (296) 104 303 481 (276) 67 365 499 (383) 94 297 470 (301) 3 470 512 (387) 3 465 499 (346) 3 468 520 (379) 2 4 4 (0) 2 4 4 (0) 2 4 4 (0) 2 4 4 (1) 2 4 4 (0) 2 4 4 (1) R1 ε ∼ 13 Cauchy(0, 1) R2 R3 R4 MMS (RSD) 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 214 24 10 3 88 53 125 3 3 3 2 2 2 2 2 2 3 3 2 2 3 2 3 2 2 2 2 2 2 2 2 2 269 26 12 3 99 68 63 3 3 3 2 2 2 2 2 2 3 4 2 2 2 2 2 2 2 2 2 2 2 2 2 2 262 43 15 3 88 47 138 3 3 3 2 2 2 2 2 2 411 432 464 467 382 396 378 473 461 408 4 4 4 4 4 4 466 473 495 486 318 354 318 467 467 469 4 4 4 5 4 4 476 466 464 468 390 408 388 477 463 421 4 4 4 4 4 4 735 584 610 557 485 610 492 522 506 508 4 4 4 5 4 4 (270) (258) (220) (280) (311) (275) (311) (245) (331) (247) (0) (0) (0) (0) (0) (0) (353) (376) (240) (325) (292) (377) (289) (375) (382) (329) (0) (0) (0) (1) (0) (1) Table 4: Simulation results for Example 4 (d1), where Rj indicates the median of the rank of the relevant predictors and MMS stands for the median of the minimum model size and its robust standard deviations (RSD) are given in parenthesis. 27 ρ Method(τ, ι) R1 R2 0.5 SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) 2 99 2 2 3 3 3 3 2 3 3 2 3 2 3 2 182 355 238 192 266 292 262 313 274 259 112 106 148 14 5 11 2 93 2 2 3 3 3 3 2 3 3 3 3 2 3 2 169 388 191 154 281 224 265 295 304 341 150 147 164 11 5 13 0.95 ε ∼ N (0, 1) R3 R4 MMS (RSD) Model (d2) 2 530 566 (359) 100 453 485 (304) 2 558 629 (393) 2 514 514 (362) 3 437 442 (362) 3 339 348 (358) 3 440 446 (315) 3 499 594 (352) 2 514 583 (377) 3 532 588 (345) 3 2 4 (1) 3 2 4 (0) 3 2 4 (1) 2 4 4 (2) 3 1 4 (0) 2 4 4 (1) 200 557 712 (285) 375 507 729 (290) 236 540 762 (335) 181 534 675 (274) 268 443 695 (197) 303 473 672 (305) 265 441 694 (199) 338 595 791 (259) 308 529 795 (283) 279 529 746 (276) 158 4 530 (465) 103 3 518 (524) 214 3 574 (437) 11 3 270 (478) 6 1 110 (404) 15 3 225 (453) R1 ε ∼ 13 Cauchy(0, 1) R2 R3 R4 MMS (RSD) 10 107 2 2 4 2 3 3 2 3 3 3 3 2 3 2 518 450 347 224 254 318 268 393 291 362 163 148 146 13 4 13 12 110 2 2 4 3 4 3 3 3 3 3 3 2 3 2 434 401 329 222 260 305 423 394 282 374 186 102 196 16 4 39 14 112 2 2 4 3 5 2 2 3 3 3 3 2 3 3 435 403 365 196 255 213 284 357 290 376 162 96 126 34 4 14 535 478 554 578 453 459 449 531 501 460 2 2 2 4 2 4 496 507 507 482 438 462 431 480 480 459 5 3 6 6 1 5 667 (351) 507 (356) 638 (322) 578 (381) 456 (333) 463 (343) 451 (333) 618 (363) 533 (322) 537 (337) 4 (1) 4 (0) 4 (3) 5 (3) 4 (0) 5 (3) 770 (282) 720 (305) 825 (262) 734 (309) 688 (205) 666 (300) 693 (195) 755 (280) 753 (258) 806 (268) 583 (475) 514 (535) 591 (483) 311 (591) 24 (371) 299 (537) Table 5: Simulation results for Example 4 (d2), where Rj indicates the median of the rank of the relevant predictors and MMS stands for the median of the minimum model size and its robust standard deviations (RSD) are given in parenthesis. 28 ρ 0.5 0.95 Method(τ, ι) SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) SIS SIRS DC-SIS Kendall-SIS CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CPC-SIS(0.25,0.25) CPC-SIS(0.5,0.5) CPC-SIS(0.75,0.75) R1 12 192 336 2 3 3 3 183 269 223 6 4 5 5 5 5 5 190 441 2 3 3 3 326 400 312 5 4 5 6 5 6 R2 12 215 305 2 3 4 3 249 241 174 7 5 7 4 6 8 9 231 303 3 4 4 4 225 244 168 6 5 5 5 6 6 ε ∼ N (0, 1) R3 R4 MMS (RSD) 377 4 488 (518) 910 188 910 (96) 511 320 744 (162) 997 1 997 (15) 841 2 841 (235) 886 2 886 (175) 817 2 817 (240) 713 208 796 (172) 672 307 823 (160) 701 259 829 (179) 3 3 107 (167) 2 3 53 (95) 3 3 75 (148) 5 1 28 (58) 1 2 14 (27) 6 1 41 (88) 538 4 581 (378) 894 199 894 (95) 508 239 771 (171) 991 1 991 (32) 806 2 806 (247) 831 2 831 (250) 804 2 804 (314) 624 157 795 (188) 597 226 804 (189) 650 143 785 (185) 3 3 73 (165) 3 3 47 (112) 2 3 52 (146) 6 1 31 (47) 1 2 20 (40) 5 1 41 (80) R1 14 236 305 2 5 3 4 178 232 154 7 5 8 7 6 7 17 246 189 2 4 3 4 95 135 73 12 4 8 6 6 6 ε ∼ 13 Cauchy(0, 1) R2 R3 R4 MMS (RSD) 14 396 5 532 (494) 222 938 193 938 (98) 272 546 324 746 (154) 2 998 1 998 (10) 3 830 2 830 (263) 3 895 2 895 (207) 5 865 2 865 (184) 148 748 212 806 (170) 231 687 296 824 (172) 191 731 209 822 (174) 9 3 4 109 (187) 5 3 5 77 (118) 6 3 4 94 (165) 8 8 2 62 (110) 6 1 2 19 (34) 9 7 2 57 (75) 11 525 4 586 (445) 220 895 186 895 (103) 273 558 348 776 (174) 2 990 1 990 (46) 3 825 2 825 (254) 4 836 2 836 (257) 5 758 2 758 (315) 202 682 252 805 (192) 235 661 318 812 (193) 154 695 272 815 (178) 6 3 4 128 (214) 8 3 3 78 (115) 6 3 4 105 (182) 5 7 2 55 (90) 5 1 2 18 (42) 7 7 2 46 (89) Table 6: Simulation results for Example 5, where Rj indicates the median of the rank of the relevant predictors and MMS stands for the median of the minimum model size and its robust standard deviations (RSD) are given in parenthesis. 29 5.2 5.2.1 Real Data Applications Rats Data We illustrate the CC-SIS and CPC-SIS with the gene expression data on 120 male rats of 12 weeks old, including expression measurements of 31,099 gene probes. It has been analyzed in Scheetz et al. (2006) for investigation of the gene regulation in the mammalian and is available at ftp://ftp.ncbi.nlm.nih.gov/geo/series/GSE5nnn/GSE5680/matrix. We follow Ma et al. (2017) and consider the expression of gene TRIM32 (probe 1389163 at) as the response variable Y since it was identified to cause Bardet-Biedl syndrome, closely associated with the human hereditary disease of the retina Chiang et al. (2006). The other gene probes are treated as the covariates X. We first apply Iglewicz and Hoaglin (1993)’s (IH) approach to check outliers. IH constructs a Z-score Zi = 0.6745(xi − x̄)/MAD, where MAD denotes the median absolute deviation, and recommends that any i such that Zi > 3.5 be labeled as outliers. IH method is quite popular in real applications such as engineering. Consequently we find that there are over 60% gene probes having one or more outliers. Figure 1 displays the box-plots for two selected genes and the the response. If one only employs the conventional screening method ignoring the outliers, it would lead to inappropriate results. The copula-based methods may thus be more robust in this situation. In this data analysis, we have the sample {(Yi , Xi ∈ Rpn ), 1 ≤ i ≤ n} with n = 120 and pn = 31098. We report the overlaps of the top ⌊n/ log n⌋ = 25 selected genes by various methods in Table 7. We can see that different methods select quite different genes and such low level of agreement should not be overlooked in practice. Robust and joint screening methods like what we propose in this paper lead to entirely different set of genes which are otherwise screened out by the conventional non-robust and marginal screening approaches. We notice that the CPC-SIS and QPC-SIS have a couple of overlaps, partly because both are conditional screening procedures and able to adjust the confounder effects. 30 rats data breast cancer data 4 name gene ID 104 gene ID 586 Y 6 Gene Expressions Gene Expressions 8 name 2 gene ID 40 gene ID 54 Y 0 4 −2 gene ID 104 gene ID 586 Y gene ID 40 gene ID 54 Y Figure 1: Box-plots for the response and two randomly selected genes for the two datasets. The left panel is for the rats data and the right panel is for the breast cancer data. Table 8 gives a summary of top 10 gene probes by different methods along with the pvalue resulted from a marginal Wald-test. We then use these 10 genes as regressors and build a joint statistical models to predict Y . Linear regression and quantile regression are both considered for this purpose and we displays the mean of their prediction errors (PE1 and PE2) over 500 random partitions, where the partition ratio of training sample to test sample is 4 : 1 for each partition. The PE is computed as the average of {(Yi − Ybi )2 , i ∈ testing set} and Ybi is the predicted value at the ith test data point using the model constructed by the training sample with the 10 genes in Table 8. We can see that our proposed copula-based partial correlation screening performs the best with the smallest prediction error. Such a nice prediction result may be attributed to the fact that CPC selects appropriate markers for joint modelling after addressing the distribution heterogeneity and the conditional effects. The heterogeneity problem typically inflates the variance while a purely marginal screener could introduce bias. The prediction error, consists of the variance and the bias components, is thus much smaller after employing the CPC screening method. 31 QC-SIS(τ ) QPC-SIS(τ ) CC-SIS(τ, ι) CPC-SIS(τ, ι) SIS SIRS DC-SIS Kendall-SIS 0.25 0.5 0.75 0.25 0.5 0.75 (0.25,0.25) (0.5,0.5) (0.75,0.75) (0.25,0.25) (0.5,0.5) (0.75,0.75) SIS 25 0 1 3 1 1 0 0 0 0 1 3 3 0 0 0 SIRS 0 25 0 0 0 0 0 0 0 0 0 0 0 0 0 0 DC-SIS 1 0 25 1 2 2 1 0 0 0 0 0 1 0 0 0 Kendall 3 0 1 25 5 12 3 0 0 0 2 5 3 0 0 0 QC-SIS(0.25) 1 0 2 5 25 5 0 0 0 0 3 2 1 0 0 0 QC-SIS(0.5) 1 0 2 12 5 25 3 0 0 0 1 7 1 0 0 0 QC-SIS(0.75) 0 0 1 3 0 3 25 0 0 0 0 1 1 0 0 0 QPC-SIS(0.25) 0 0 0 0 0 0 0 25 3 2 0 0 1 2 1 0 QPC-SIS(0.5) 0 0 0 0 0 0 0 3 25 0 0 0 0 1 1 0 QPC-SIS(0.75) 0 0 0 0 0 0 0 2 0 25 0 0 0 0 1 0 CC-SIS(0.25,0.25) 1 0 0 2 3 1 0 0 0 0 25 1 0 0 0 0 CC-SIS(0.5,0.5) 3 0 0 5 2 7 1 0 0 0 1 25 1 0 0 0 CC-SIS(0.75,0.75) 3 0 1 3 1 1 1 1 0 0 0 1 25 0 0 0 CPC-SIS(0.25,0.25) 0 0 0 0 0 0 0 2 1 0 0 0 0 25 0 0 CPC-SIS(0.5,0.5) 0 0 0 0 0 0 0 1 1 1 0 0 0 0 25 1 CPC-SIS(0.75,0.75) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 25 Table 7: The overlaps of selected genes using various approaches for the rats data, where the screening threshold parameter is set as ⌊n/ log n⌋ = 25 for each method and the CPC-SIS applies the algorithm in Case 1. Rank 1 2 3 4 5 6 7 8 9 10 PE1 PE2 SIS SIRS DC-SIS Kendall-SIS QC-SIS(0.5) ID p-value ID p-value ID p-value ID p-value ID p-value 14770 2.1E-05 2828 1.000 146 6.4E-04 6083 8.3E-10 22641 5.2E-11 21977 1.8E-05 20503 0.480 260 7.2E-04 5002 4.5E-10 14810 6.4E-12 6436 2.0E-08 233 0.152 30768 2.3E-06 14726 4.4E-16 22339 8.0E-13 4797 1.7E-08 3962 0.716 30745 1.6E-05 14810 6.4E-12 5002 4.5E-10 21150 2.3E-07 7656 0.063 285 1.2E-04 25297 1.5E-11 20898 7.2E-14 25573 4.5E-10 20453 0.468 30791 1.6E-07 5259 6.5E-12 31008 1.5E-07 12127 9.4E-09 22023 0.047 3849 1.1E-04 5223 2.9E-10 26828 1.8E-08 9235 1.6E-07 157 0.208 4626 1.1E-04 31008 1.5E-07 24529 4.2E-10 3682 2.5E-06 2575 0.153 4490 2.8E-10 22339 8.0E-13 14414 1.5E-07 8670 4.5E-11 2841 0.284 3967 2.1E-07 6021 1.7E-07 20724 2.8E-10 0.0394 0.0252 0.0290 0.0310 0.0283 0.0377 0.0269 0.0349 0.0342 0.0344 CC-SIS(0.5,0.5) ID p-value 14726 4.4E-16 6889 6.6E-14 14701 6.2E-14 20898 7.2E-14 22339 8.0E-13 23278 6.2E-13 25117 8.8E-14 30548 6.9E-14 4512 8.0E-12 4712 8.4E-12 0.0330 0.0360 QPC-SIS(0.5) ID p-value 18602 0.473 4101 0.003 12365 0.141 8399 1.000 5063 0.026 9223 0.467 21746 0.716 14019 0.717 30361 0.277 24759 0.010 0.0269 0.0307 CPC-SIS(0.5, 0.5) ID p-value 1621 0.469 11288 0.001 12480 1.000 4398 0.271 29604 0.467 22679 1.000 22267 0.065 17039 0.148 11796 0.720 20967 0.026 0.0247 0.0257 Table 8: Summary of top 10 gene probes selected by different screening methods for the rats data. √ b −1/2 ̺bY,X (0.5, 0.5)|)), ID means the selected gene ID and p-values are computed as 2(1 − Φ(| nΩ 1 where Φ is the cumulative distribution function of standard normal random variable. PE is the mean of prediction errors over 500 random partitions with the partition ratio of training sample to testing sample being 4 : 1, where prediction error is defined as the average of {(Yi − Ybi )2 , i ∈ testing set}. PE1 and PE2 indicate that Ybi is the predicted value via fitting a median regression model and linear model, respectively, using the top 10 genes selected. 32 5.2.2 Breast Cancer Data Breast cancer was the second most common cancer in the world and the most leading cause in women. There were nearly 1.7 million new cases diagnosed in 2012, according to the worldwide statistics1 . Meanwhile, approximately 252,710 new cases of invasive breast cancer and 40,610 breast cancer deaths are expected to occur among US women in 2017 as reported in DeSantis et al. (2017). Although major progresses in breast cancer treatment were made, there is also limited ability to predict the metastatic behavior of tumor. Van’t Veer et al. (2002) was the first to study the breast cancer study involving 97 lymph node-negative breast cancer patients 55 years old or younger, of which 46 developed distant metastases within 5 years (metastatic outcome coded as 1) and 51 remained metastases free for at least 5 years (metastatic outcome coded as 0). This expression data set with clinical variables has been well analyzed in many papers for classification (Boulesteix et al. (2008), Yu et al. (2012), among others). In this study, after removing the genes with missing values, there are expression levels of 24,188 gene probes entering into the next analysis. In addition to gene expression measurements, the data for several clinical factors are available as well. Our interest is to identify which gene probes affect the tumor size given other clinical factors (W) including age, histological grade, angioinvasion, lymphocytic infiltration, estrogen receptor and progesterone receiptor status. Therefore, we have the data {(Yi , Xi ∈ Rpn , Wi ∈ Rr ), 1 ≤ i ≤ n} with n = 97, pn = 24, 188 and r = 6 for further analysis. Using the IH method on outlier detection, we find that 18,098 gene probes have at least 1 and at most 29 outliers, suggesting that approximately three quarters of overall gene probes contain extremely large values. The right panel of Figure 1 displays the empirical distribution of the response and two typical covariates. Thus, it is more suitable to apply robust joint screening approach such as the proposed CPC-SIS. We consider the three cases 1 http://www.wcrf.org/int/cancer-facts-figures/worldwide-data 33 SIS SIRS DC-SIS Kendall QC-SIS(0.25) QC-SIS(0.5) QC-SIS(0.75) QPC-SIS(0.25) QPC-SIS(0.5) QPC-SIS(0.75) CC-SIS(0.25,0.25) CC-SIS(0.5,0.5) CC-SIS(0.75,0.75) CPC-SISa1(0.5,0.5) CPC-SISa2(0.5,0.5) CPC-SISa3(0.5,0.5) QC-SIS(τ ) QPC-SIS(τ ) CC-SIS(τ, ι) CPC-SISa1 CPC-SISa2 CPC-SISa3 SIS SIRS DC-SIS Kendall-SIS 0.25 0.5 0.75 0.25 0.5 0.75 (0.25,0.25) (0.5,0.5) (0.75,0.75) (0.5,0.5) (0.5,0.5) (0.5,0.5) 21 8 7 4 1 7 5 1 1 0 2 1 1 0 1 0 8 21 13 9 1 15 2 1 0 0 3 5 0 0 1 0 7 13 21 11 0 8 3 0 0 0 1 6 0 0 1 0 4 9 11 21 0 3 4 0 0 0 0 3 0 0 0 0 1 1 0 0 21 1 0 0 0 0 1 0 0 0 0 0 7 15 8 3 1 21 0 1 0 0 3 7 0 0 1 0 5 2 3 4 0 0 21 0 1 0 0 0 5 0 0 0 1 1 0 0 0 1 0 21 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 0 0 0 0 2 3 1 0 1 3 0 0 0 0 21 1 0 0 0 0 1 5 6 3 0 7 0 0 0 0 1 21 0 0 1 0 1 0 0 0 0 0 5 0 0 0 0 0 21 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 0 0 1 1 1 0 0 1 0 0 0 0 0 1 1 0 21 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 Table 9: The overlaps of selected genes probes using various approaches for the breast cancer data, where the screening threshold parameter is set as dn = ⌊n/ log n⌋ = 21 for each method. The CPC-SISa1 means the CPC-SIS in Case 1, the CPC-SISa2 indicates the CPC-SIS in Case 2 and the CPC-SISa3 stands for the CPC-SIS in Case 3. discussed in Section 4 and denote the methods as CPC-SISa1 , CPC-SISa2 and CPC-SISa3 , respectively). Table 9 gives the overlaps of the selected genes by various methods. A similar conclusion to that in the rats data analysis can be made. Furthermore, Table 10 presents a summary of top 10 gene probes selected by various methods. The results on PE1 and PE2 in Table 10 empirically verifies that our proposed CPC-SIS in Case 3 has the most satisfactory performance in out-of-sample prediction. 6 Conclusion and Discussion We propose a copula-based correlation and partial correlation to facilitate robust marginal and joint screening for ultrahigh dimensional data sets. Large sample properties for the estimated correlation and sure screening properties for CC and CPC screeners were provided. Empirical studies including simulations and two data applications show that our proposed CC-SIS and CPC-SIS outperform the existing variable screening approaches, when outliers are present in both covariates and response. Therefore, our current proposals are more applicable to the ultrahigh dimensional heterogeneous data. We provide a guideline to carry out variable screening as follows. If the response and predictors are all normal without 34 SIS Rank 1 2 3 4 5 6 7 8 9 10 PE1 PE2 Rank 1 2 3 4 5 6 7 8 9 10 PE1 PE2 ID 24032 11913 11870 17439 6841 20938 10692 19897 9164 17050 p-value 3.0E-06 1.2E-07 2.9E-06 6.9E-06 6.8E-08 2.3E-02 2.0E-01 1.5E-03 1.5E-03 2.2E-02 1.566 1.550 CC-SIS(0.5,0.5) ID p-value 12801 1.5E-06 13742 1.5E-05 402 6.2E-05 4862 3.4E-04 8349 3.1E-05 9158 1.9E-03 12074 6.8E-06 14466 1.8E-03 18903 2.5E-02 19774 8.1E-06 1.404 1.290 ID 24032 6841 9164 13025 2172 17439 20121 11870 22705 10408 SIRS p-value 0.000 0.000 0.001 0.001 0.013 0.000 0.000 0.000 0.028 0.002 1.483 1.398 QPC-SIS(0.5) ID p-value 11696 0.001 672 0.005 21944 0.021 6466 0.024 518 0.758 12635 0.022 12567 0.609 7160 0.483 21188 0.007 11916 0.495 1.466 1.437 ID 8349 24032 13025 23670 20121 6841 15674 1644 5644 20238 DC-SIS p-value 3.1E-05 3.0E-06 6.7E-04 5.9E-03 1.2E-07 6.8E-08 1.2E-06 6.9E-06 2.2E-04 2.3E-02 1.419 1.378 CPC-SISa1 (0.5, 0.5) ID p-value 301 0.005 18678 0.000 3524 0.603 5422 0.021 14782 0.023 21431 0.922 5239 0.295 777 0.352 20958 0.132 4849 0.460 1.399 1.345 ID 17679 20238 10408 1644 8339 14028 23670 12305 3929 14466 Kendall-SIS p-value 6.2E-02 2.3E-02 1.9E-03 6.9E-06 2.6E-03 8.9E-05 5.9E-03 7.3E-04 1.8E-03 1.8E-03 1.399 1.366 CPC-SISa2 (0.5, 0.5) ID p-value 20121 0.000 4356 0.001 13084 0.008 13191 0.035 6436 0.299 10179 0.192 20102 0.185 1299 0.179 1830 0.381 6025 0.467 1.436 1.304 ID 24032 22705 6841 14466 4767 5644 20121 23670 13742 17439 QC-SIS(0.5) p-value 3.0E-06 2.8E-02 6.8E-08 1.8E-03 1.2E-05 2.2E-04 1.2E-07 5.9E-03 1.5E-05 6.9E-06 1.409 1.367 CPC-SISa3 (0.5, 0.5) ID p-value 4132 0.136 17568 0.620 5459 0.482 1079 0.352 23942 0.002 14 0.922 1847 0.169 3392 0.505 20369 0.367 390 0.920 1.372 1.289 Table 10: Summary of top 10 gene probes selected by different screening methods for the breast cancer data. ID means the selected gene ID and p-values are computed as 2(1 − √ b −1/2 Φ(| nΩ ̺bY,X (0.5, 0.5)|)), where Φ is the cumulative distribution function of standard normal 1 random variable. PE is the mean of prediction errors over 500 random partitions with the partition ratio of training sample to testing sample being 4 : 1, where prediction error is defined as the average of {(Yi − Ybi )2 , i ∈ testing set}. PE1 and PE2 indicate that Ybi is the predicted value via fitting a median regression model and linear model, respectively, using the top 10 genes selected. heteroscedastic variance and the predictors have low correlation, any marginal screening methods (SIS, SIRS, DC-SIS) can be applied. If the response contains outliers or follows a heavy tail distribution and the covariates are normal, robust screening methods (Kendall SIS, QC-SIS, CQC-SIS, CC-SIS) can be employed. If the covariates are highly correlated and conditional variables are available, conditional screening procedures (CSIS, QPC-SIS) can work. If the data is heteroscedastic for both the response and covariates and the covariates may be highly correlated, then only CPC-SIS can be applied. The copula formulation may suggest many possible extensions of our methodology. In particular, we may consider censored survival time outcome in this framework. The estimation of copula-based correlation and partial correlation needs to incorporate the random censoring for such data and we need to invoke more complicated empirical process theories to argue the weak convergence results. Furthermore, we may even allow the predictors to be censored. See Cheng and Fine (2008) and Cheng and Li (2015) for some earlier dis35 cussion. Such extension to ultrahigh-dimensional data is non-trivial and requires a further development. Acknowledgement We thank Professors Runze Li and Shujie Ma for sharing their R code for the implementation of QPC approach. Appendix: Proofs The following Lemma is a well-known result for the bivariate empirical process theory. Lemma A.1. (Lemma 3.9.28, van der Vaart and Wellner (1996)) Fix 0 < a < b < 1, and suppose that H is a distribution function on R2 with marginal distribution functions F and G that are continuously differentiable on the intervals [F −1 (a) − ε, F −1 (b) + ε] and [G−1 (a) − ε, G−1 (b) + ε] with positive derivatives f and g, respectively, for some ε > 0. Furthermore, assume that ∂H/∂x and ∂H/∂y exist and are continuous on the product of these intervals. Then the map φ : D(R̄) 7→ ℓ∞ ([a, b]2 ) is Hadamard-differentiable at H tangentially to C(R̄). The derivative is given by h(F −1 (u), ∞) ∂H −1 (F (u), G−1(v)) ∂x f (F −1 (u)) ∂H −1 h(∞, G−1(v)} − (F (u), G−1 (v)) . ∂y g(G−1(v)) φ̇H (h)(u, v) = h(F −1 (u), G−1(v)) − Proof of Theorem 2.1 By the definition, we have √ n{b ̺Y,X (τ, ι) − ̺Y,X (τ, ι)} = √ −1 −1 n[Fn,Y,X (Fn,Y (τ ), Fn,X (ι)) − FY,X (FY−1 (τ ), FX−1 (ι))] p . τ (1 − τ )ι(1 − ι) Employing Lemma A.1 and the empirical process theory (Example 3.9.29 in van der Vaart and Wellner 36 (1996)), we are able to show that √ n 1 X a −1 −1 n[Fn,Y,X (Fn,Y [ϕ(Xi , Yi ; τ, ι) − E{ϕ(Xi , Yi ; τ, ι)}], (τ ), Fn,X (ι)) − FY,X (FY−1 (τ ), FX−1 (ι))] = √ n i=1 a where = means ”asymptotically equivalent” and ϕ(Xi , Yi ; τ, ι) is given by ϕ(Yi , Xi ; τ, ι) = I{Yi ≤ FY−1 (τ ), Xi ≤ FX−1 (ι)} I{Yi ≤ FY−1 (τ )} ∂ FY,X (FY−1 (τ ), FX−1 (ι)) ∂y fY (FY−1 (τ )) ∂ I{Xi ≤ FX−1 (ι)} − FY,X (FY−1 (τ ), FX−1 (ι)) . ∂x fX (FX−1 (ι)) − Furthermore, it is easily verified that ∂ FY,X (FY−1 (τ ), FX−1 (ι)) = fY (FY−1 (τ ))FX|Y =F −1 (τ ) (FX−1 (ι)), Y ∂y ∂ FY,X (FY−1 (τ ), FX−1 (ι)) = fX (FX−1 (ι))FY |X=F −1 (ι) (FY−1 (τ )). X ∂x (A.1) (A.2) Hence, by (A.1) and (A.2), it follows that √ n 1 X n{b ̺Y,X (τ, ι) − ̺Y,X (τ, ι)} = √ [ξ(Yi , Xi ; τ, ι) − E{ξ(Yi , Xi ; τ, ι)}], n i=1 a where ξ(Y, X; τ, ι) is defined in the line before Theorem 2.1. Because the class of indicator functions is Donsker, thus {ξ(Yi , Xi ; τ, ι), (τ, ι) ∈ [a, b]2 } is Donsker. By Donsker theorem, √ in ℓ∞ ([a, b]2 ), where w n{b ̺Y,X (τ, ι) − ̺Y,X (τ, ι)} w GY,X (τ, ι) denotes ”converge weakly”, and the process GY,X (τ, ι) has mean zero and covariance function cov(GY,X (τ1 , ι1 ), GY,X (τ2 , ι2 )) = Ω1 (τ1 , ι1 ; τ2 , ι2 ) given in Theorem 37 2.1. Proof of Theorem 2.2 Following the arguments in the proof of Theorem 2.1, we can show √ n{[b ̺Y,X1 (τ, ι) − ̺Y,X1 (τ, ι)] − [b ̺Y,X2 (τ, ι) − ̺Y,X2 (τ, ι)]} n 1 X a =√ [η(Yi , Xi1 , Xi2 ; τ, ι) − E{η(Yi , Xi1 , Xi2 ; τ, ι)}] n i=1 where η(Yi , Xi1 , Xi2 ; τ, ι) = ξ(Yi , Xi1 ; τ, ι)−ξ(Yi , Xi2 ; τ, ι) and ξ(Y, X; τ, ι) is given in Theorem 2.1. Since {ξ(Xi , Yi ; τ, ι), (τ, ι) ∈ [a, b]2 } is Donsker, {η(Yi , Xi1 , Xi2 ; τ, ι), (τ, ι) ∈ [a, b]2 } is also Donsker. By Donsker Theorem, we have √ n{[b ̺Y,X1 (τ, ι) − ̺bY,X2 (τ, ι)] − [̺Y,X1 (τ, ι) − ̺Y,X2 (τ, ι)]} w GY,X1 ,X2 (τ, ι) in ℓ∞ ([a, b]2 ), where the process GY,X1 ,X2 (τ, ι) has mean zero and covariance function cov(GY,X1 ,X2 (τ1 , ι1 ), GY,X1 ,X2 (τ2 , ι2 )) = Ξ(τ1 , ι1 ; τ2 , ι2 ) given in Theorem 2.2. Proof of Theorem 2.3 (i) We first prove the first statement. Observe that −1 −1 Fn,Y,Xj (Fn,Y (τ ), Fn,X (ι)) − FY,Xj (FY−1 (τ ), FX−1j (ι)) = IInj1 + IInj2 j (A.3) P  −1 −1 −1 where IInj1 = Fn,Y,Xj (Fn,Y (τ ), Fn,X (ι))−Fn,Y,Xj (FY−1 (τ ), FX−1j (ι)) = n−1 ni=1 I(Yi ≤ Fn,Y (τ ), Xij ≤ j  −1 Fn,X (ι))−I(Yi ≤ FY−1 (τ ), Xij ≤ FX−1j (ι)) and IInj2 = Fn,Y,Xj (FY−1 (τ ), FX−1j (ι))−FY,Xj (FY−1 (τ ), FX−1j (ι)) = j  P  n−1 ni=1 I(Yi ≤ FY−1 (τ ), Xij ≤ FX−1j (ι)) − FY,Xj (FY−1 (τ ), FX−1j (ι)) . In what follows, we are going to bound the tail probabilities for IInj1 and IInj2 , respectively. Since |I(Yi ≤ FY−1 (τ ), Xij ≤ FX−1j (ι)) − FY,Xj (FY−1 (τ ), FX−1j (ι))| ≤ 2 and var(I(Yi ≤ FY−1 (τ ), Xij ≤ FX−1j (ι))) ≤ 1, applying Bernstein’s inequality (Lemma 2.2.9, van der Vaart and Wellner (1996)) gives that for any δ > 0, max P (|IInj2| > δ/n) ≤ 2 exp(− 1≤j≤pn 38 δ2 ). 2(n + 2δ/3) (A.4) Next consider IInj1 . Note that IInj1 = n−1 n X i=1 −1 +n = ˆ (1) IInj1 +   −1 −1 −1 I(Yi ≤ Fn,Y (τ )) I(Xij ≤ Fn,X (ι)) − I(X ≤ F (ι)) ij X j j n X   −1 I(Yi ≤ Fn,Y (τ )) − I(Yi ≤ FY−1 (τ )) I(Xij ≤ FX−1j (ι)) i=1 (2) IInj1 (say). (A.5) −1 (ι) − On the other hand, it follows from Lemma B of Serfling (1980) (p.96) that |Fn,X j FX−1j (ι)| ≤ 2n−1/2 (log n)1/2 /fXj (FX−1j (ι)) almost surely. Let M1−1 = inf 1≤j≤pn fXj (FX−1j (ι))/2, −1 which is positive under condition (C1). On the event {|Fn,X (ι) − FX−1j (ι)| ≤ M1 n−ς1 } j P (1) −1 with any ς2 < 1/2. we have |IInj1| ≤ n−1 ni=1 |I(Xij ≤ Fn,X (ι)) − I(Xij ≤ FX−1j (ι))| ≤ j Pn −1 −1 −1 1 −ς1 ≤ Xij ≤ FX−1j (ι) + i=1 qι (Xij , FXj (ι)), where qι (Xij , FXj (ι)) = I(FXj (ι) − M1 n n R FX−1j (ι)+M1 n−ς1 −1 −ς1 M1 n ). Because E{qι (Xij , FXj (ι))} = F −1 (ι)−M n−ς1 fXj (s)ds ≤ c1 M1 n−ς1 for some pos1 Xj itive constant c1 by condition (C1). Since qι (Xij , FX−1j (ι)) ≤ 1 and var(qι (Xij , FX−1j (ι))) ≤ E{qι (Xij , FX−1j (ι))}, so applying Bernstein’s inequality (Lemma 2.2.9, van der Vaart and Wellner (1996)) yields that n  1X δ2 δ  −1 −1 [qι (Xij , FXj (ι)) − E{qι (Xij , FXj (ι))}] ≥ ≤ 2 exp(− ). P n i=1 2n 8(c1 M1 n1−ς1 + δ/3) This further implies that (1) n  1X  qι (Xij , FX−1j (ι)) ≥ δ/n n i=1 n   1X [qι (Xij , FX−1j (ι)) − E{qι (Xij , FX−1j (ι))}] ≥ δ/n − c1 M1 n−ς1 ≤ P n i=1 n  1X  −1 −1 ≤ P [qι (Xij , FXj (ι)) − E{qι (Xij , FXj (ι))}] ≥ δ/(2n) n i=1 max P (|IInj1| ≥ δ/n) ≤ P 1≤j≤pn ≤ 2 exp(− δ2 8(c1 M1 n1−ς1 + δ/3) 39 ), (A.6) where the third inequality is due to δ/(2n) ≥ c1 M1 n−ς1 . Similarly, by condition (C1), we can show that δ2 (2) max P (|IInj1| ≥ δ/n) ≤ 2 exp(− 1≤j≤pn 8(c2 M2 n1−ς2 + δ/3) ), (A.7) for any ς2 ∈ (0, 1/2) and for some positive constants c2 and M2 . Therefore, combining (A.4)-(A.7), we obtain that max P (|IInj1 + IInj2| ≥ 3δ/n) ≤ 1≤j≤pn max P (|IInj2| > δ/n) 1≤j≤pn (2) (1) + max P (|IInj1| ≥ δ/n) + max P (|IInj1| ≥ δ/n) 1≤j≤pn 1≤j≤pn δ2 δ ) + 2 exp(− ) 2(n + 2δ/3) 8(c1 M1 n1−ς1 + δ/3) δ2 ) +2 exp(− 8(c2 M2 n1−ς2 + δ/3) δ2 ≤ 6 exp(− ) (A.8) c3 n + c4 δ 2 ≤ 2 exp(− for some positive constants c3 ≥ max(2, 8c1M1 , 8c2 M2 ) and c4 ≥ 8/3, provided that δ/(2n) ≥ max(c1 M1 n−ς1 , c2 M2 n−ς2 ). Using the basic inequality that ||x| − |y|| ≤ |x − y| and the union bound of probability, it follows that uj − uj | ≥ Cn−κ ) uj − uj | ≥ Cn−κ ) ≤ pn max P (|b P ( max |b 1≤j≤pn 1≤j≤pn p ≤ pn max P (|IInj1 + IInj2 | ≥ τ (1 − τ )ι(1 − ι)Cn−κ ). 1≤j≤pn Hence, this in conjunction with the result (A.8) proves the desired result by letting δ = p τ (1 − τ )ι(1 − ι)Cn1−κ /3. 40 (ii) Prove the second assertion. By the choice of νn and using condition (C2), we have      da ≥ P min u P M∗ ⊂ M uj − uj ) > νn − min uj bj > νn ≥ P min (b j∈M∗ j∈M∗ j∈M∗     bj − uj ≥ νn bj − uj > νn ≥ 1 − P max u ≥ P min uj − max u j∈M∗ j∈M∗ j∈M∗ ≥ 1 − 6sn exp(−c̃1 n1−2κ ). Thus, this completes the proof. Proof of Proposition 2.4 Observe that the expected false discovery rate can be rewritten as n |M X ca,δ ∩ (M∗a )c | o  √ 1 b 1 (τ, ι; τ, ι)]−1/2 |b E = P n[ Ω ̺ (τ, ι)| ≥ δ . Y,X j |(M∗a )c | pn − |M∗a | ∗ c j∈(Ma ) By Theorem 2.1 and the Berry-Esséen result, it follows that there exists some constant ca > 0 such that sup P z √  b 1 (τ, ι; τ, ι)]−1/2 ̺bY,X (τ, ι) ≤ z − Φ(z) ≤ ca n−1/2 . n[Ω j Combining the above results, we obtain n |M X ca,δ ∩ (M∗ )c | o √ 1 a E ≤ (2(1 − Φ(δ)) + ca / n). ∗ c ∗ |(Ma ) | pn − |Ma | ∗ c j∈(Ma ) Plugging δ = Φ−1 (1 − d¯n /(2pn )) into the above inequality yields the result. Proof of Theorem 3.1 We first observe that E{ψτ (Y − ZT α0 )Z} = 0 and E{ψτ (X − ZT θ 0 )Z} = 0, where ZT α0 = ZT α0 and ZT θ 0 = ZT θ 0 . Using the arguments in Li et al. 41 (2015) and Koenker (2005), we can obtain √  b − α0 ) = E[fYi |Zi (ZTi α0 )Zi ZTi ] n(α n −1 1 X √ ψτ (Yi − ZTi α0 )Zi + op (1), n i=1 −1 1 X √ ψι (Xi − ZTi θ 0 )Zi + op (1). n i=1 (A.9) and √  b − θ 0 ) = E[fX |Z (ZT θ 0 )Zi ZT ] n(θ i i i i n (A.10) Let n X b − E{FY,X|Z (ZT α0 , ZT θ 0 )}]. b = 1 b Xi ≤ ZTi θ) b θ) [I(Yi ≤ ZTi α, Un (α, n i=1 Then, it follows that √ √ b b θ) nUn (α, , n{b ̺Y,X|Z (τ, ι) − ̺Y,X|Z (τ, ι)} = p τ (1 − τ )ι(1 − ι) where √ n X  b − E{FY,X|Z (ZT α, b b = √1 b Xi ≤ ZTi θ) b ZT θ)} b θ) I(Yi ≤ ZTi α, nUn (α, n i=1   b − E{FY,X|Z (ZT α0 , ZT θ 0 )} b ZT θ)} + E{FY,X|Z (ZT α, b + Kn2 (α, b (say). b θ) b θ) = ˆ Kn1 (α, (A.11) Employing the result of empirical processes (Corollary 2.3.12, van der Vaart and Wellner (1996), p115), we can obtain n X b = √1 b θ) Kn1 (α, I(Yi ≤ ZTi α0 , Xi ≤ ZTi θ 0 ) n i=1  −E{FY,X|Z (ZT α0 , ZT θ 0 )} + op (1). 42 (A.12) By Taylor expansion and using (A.9) and (A.10), we have  b = E FX|Z,Y =ZT α0 (ZT θ 0 )fY |Z (ZT α0 )Z T (α b θ) b − α0 ) Kn2 (α,  T b +E FY |Z,X=ZT θ0 (ZT α0 )fX|Z (ZT θ 0 )Z (θ − θ 0 ) + op (1) n 1 X n T −1 = √ ∆12 ∆11 ψτ (Yi − ZTi α0 )Zi n i=1 o T 0 +∆T21 ∆−1 ψ (X − Z θ )Z i i + op (1). 22 ι i (A.13) Finally, combining (A.11)-(A.13) and recalling the definitions of ̺bY,X|Z (τ, ι) and ̺Y,X|Z (τ, ι), we have p √ τ (1 − τ )ι(1 − ι) n{b ̺Y,X|Z (τ, ι) − ̺Y,X|Z (τ, ι)} n  1 X n I(Yi ≤ ZTi α0 , Xi ≤ ZTi θ 0 ) − E{FY,X|Z (ZT α0 , ZT θ 0 )} =√ n i=1 o T 0 T −1 T 0 +∆T12 ∆−1 ψ (Y − Z α )Z + ∆ ∆ ψ (X − Z θ )Z i i i i + op (1), (A.14) 11 τ i 21 22 ι i which implies that √ a n{b ̺Y,X|Z (τ, ι)−̺Y,X|Z (τ, ι)} = √1 n Pn i=1 [ζ(Xi , Yi , Zi ; τ, ι)−Eζ(X, Y, Z; τ, ι)]. It can be checked that {ζ(Xi , Yi , Zi ; τ, ι) : (τ, ι) ∈ [a, b]2 } is Donsker. Therefore, by Donsker Theorem, we can conclude the result. Proof of Theorem 3.2 This result can be proved using the same arguments in the proof of Theorem 3.1. We omit the details. To prove Theorem 3.3, we need the following two lemmas which can be verified using the same arguments in Ma et al. (2017) and the proofs are omitted. Lemma A.2. Under conditions (D1)(i) and (D2), for any given constant c∗1 > 0 there exist some constant c∗2 such that b − α0 k > c∗1 n−κ ) ≤ 3 exp(−c∗2 qn−1 n1−2κ ). P (kα 43 Lemma A.3. Under conditions (D1)(ii) and (D2), for every 1 ≤ j ≤ pn and for any given constant c∗3 > 0 there exist some constant c∗4 such that bj − θ 0 k > c∗ n−κ ) ≤ 3 exp(−c∗ q −1 n1−2κ ). P (kθ j 3 4 n Proof of Theorem 3.3 To prove the first part of the result, we need to only prove the following fact. Under conditions (D1) and (D2), for every 1 ≤ j ≤ pn and for any given constant c∗5 > 0, there exist some positive constants c∗6 such that n   1X   bj ) − E{ψτ (Yi − ZT α0 )ψι (Xij − ZT θ 0 )} ≥ c∗ n−κ b ι (Xij − ZTi θ P ψτ (Yi − ZTi α)ψ 5 i i j n i=1 ≤ 12 exp(−c∗6 qn−1 n1−2κ ). (A.15) To this end, we first make a decompose as n  1 X bj ) − E{ψτ (Yi − ZT α0 )ψι (Xij − ZT θ 0 )} b ι (Xij − ZTi θ ψτ (Yi − ZTi α)ψ i i j n i=1 =N ˆ nj1 + Nnj2 + Nnj3 , where n Nnj1  1 X = ψτ (Yi − ZTi α0 )ψι (Xij − ZTi θ 0j ) − E{ψτ (Yi − ZTi α0 )ψι (Xij − ZTi θ 0j )} , n i=1 n Nnj2 =  1 X bj ), b − ψτ (Yi − ZTi α0 ) ψι (Xij − ZTi θ ψτ (Yi − ZTi α) n i=1 n Nnj3  1 X bj ) − ψι (Xij − ZT θ 0 ) ψτ (Yi − ZT α0 ). ψι (Xij − ZTi θ = i i j n i=1 Next, we are going to find the probability bounds for Nnj1 , Nnj2 and Nnj3. For Nnj1, let ∆nij = ψτ (Yi − ZTi α0 )ψι (Xij − ZTi θ 0j ). Since |∆nij | ≤ 1 and thence var(∆nij ) ≤ 1, we can 44 obtain that for any δ > 0, P (|Nnj1| ≥ δ/n) ≤ 2 exp(− δ2 ), 2(n + δ/3) (A.16) by applying Bernstein’s inequality (Lemma 2.2.9, van der Vaart and Wellner (1996)). For P b − ψτ (Yi − ZTi α0 ) . It follows that for any Nnj2 , observe that |Nnj2| ≤ n1 ni=1 ψτ (Yi − ZTi α) δ > 0, P (|Nnj2| ≥ δ/n) ≤ P n n1 X n i=1 b − α0 k ≤ c∗1 n−κ b − ψτ (Yi − ZTi α0 ) ≥ δ/n, kα ψτ (Yi − ZTi α) b − α0 k > c∗1 n−κ ). +P (kα o (A.17) Let Πni = supkuk≤1 ψτ (Yi − ZTi (α0 + c∗1 n−κ u)) − ψτ (Yi − ZTi α0 ) . Under condition (D1)(i) and (D2)(ii), there exist a finite positive constant c5 and a u∗ with ku∗ k ≤ 1 such that R ZT α0 +c∗ n−κ ZTi u∗ 1/2 E(Πni ) ≤ E{| ZTi α0 1 fY |Z=z (y)dy|} ≤ c∗1 c5 n−κ E{|ZTi u∗ |} ≤ c∗1 c5 cmax n−κ = c6 n−κ , i where c6 = 1/2 c∗1 c5 cmax the last inequality uses Cauchy-Schwarz inequality. Analogously, we can obtain E(Π2ni ) ≤ c7 n−κ for some positive constant c7 . Notice that |Πni | ≤ 1. Hence, applying Bernstein’s inequality (Lemma 2.2.9, van der Vaart and Wellner (1996)) yields that for any ǫ > 0, n  1X  n2 ǫ2 P Πni − E(Πni ) ≥ ǫ ≤ 2 exp(− ). n i=1 2(c7 n1−κ + nǫ/3) Letting δ ≥ 2c6 n1−κ , that is δ/n − c6 n−κ ≥ δ/(2n), and using the above inequality, we can 45 obtain P n 1 X n i=1 n   1 X Πni ≥ δ/n ≤ P Πni − E(Πni ) ≥ δ/n − c6 n−κ n i=1 n   1X Πni − E(Πni ) ≥ δ/(2n) ≤ P n i=1 ≤ 2 exp(− δ2 8(c7 n1−κ + δ/6) ). (A.18) Because the first probability on the right hand side of (A.17) is bounded by (A.18). So, by Lemma A.2 and the results (A.17) and (A.18), we have P (|Nnj2| ≥ δ/n) ≤ 2 exp(− δ2 8(c7 n1−κ + δ/6) ) + 3 exp(−c∗2 qn−1 n1−2κ ) (A.19) provided that δ ≥ 2c6 n1−κ . Similarly, using Lemma A.3, and under conditions (D1)(ii) and D2(ii), we have P (|Nnj3| ≥ δ/n) ≤ 2 exp(− δ2 8(c8 n1−κ + δ/6) ) + 3 exp(−c∗4 qn−1 n1−2κ ) (A.20) for some positive constant c8 , provided that δ ≥ 2c9 n1−κ for some constant c9 > 0. Let c10 = max(c7 , c8 ) and c11 = max(c∗2 , c∗4 ). Combining the results (A.16), (A.19) and (A.20) gives max P (|Nnj1 + Nnj2 + Nnj3 | ≥ 3δ/n) 1≤j≤pn δ2 δ2 ) + 4 exp(− ) + 6 exp(−c11 qn−1 n1−2κ ), (A.21) ≤ 2 exp(− 1−κ 2(n + δ/3) 8(c10 n + δ/6) provided that δ ≥ 2 max(c6 , c9 )n1−κ . The result in (A.15) follows by letting δ = 3 max(c6 , c9 )n1−κ in (A.21). In addition, applying (A.15) and using similar arguments in the proof of Theorem 2.3, we can conclude the first part of Theorem 3.3. 46 For the second part of the result, we can verify it by following the proof of Theorem 2.3. Proof of Proposition 3.4 The proof directly follows the proof of Proposition 2.4. The details are omitted. References Bahadur R.R. (1966). A note on quantiles in large samples. Annals of Mathematical Statistics, 37, 577-580. Barut E., Fan J. and Verhasselt A. (2016). Conditional sure independence screening. Journal of American Statistical Association, 111, 1266-1277. Boulesteix A.L., Porzelius C. and Daumer M. (2008). Microarray-based classification and clinical predictors: on combined classifiers and additional predictive value. Bioinformatics, 24, 1698-1706. Chang J., Tang C.Y. and Wu Y. (2013). Marginal empirical likelihood and sure independence feature screening. Annals of Statistics, 41, 2123-2148. Chang J., Tang C.Y. and Wu Y. (2016). Local independence feature screening for nonparametric and semiparametric models by marginal empirical likelihood. Annals of Statistics, 44, 515-539. Cheng Y. and Fine J.P. (2008). Nonparametric estimation of cause-specific cross hazard ratio with bivariate competing risks data. Biometrika, 95, 233-240. Cheng Y. and Li J. (2015). Time-dependent diagnostic accuracy analysis with censored outcome and censored predictor. Journal of Statistical Planning and Inference, 156, 90102. 47 Cheng M., Honda T., Li J. and Peng H. (2014) Nonparametric independence screening and structure identification for ultra-high dimensional longitudinal data. Annals of Statistics, 42, 1819-1849. Chiang A.P., Beck J.S., Yan H.J., et al. (2006). Homozygosity mapping with SNP arrays identifies TRIM32, an E3 ubiquitin ligase, as a BardetBiedl syndrome gene (BBS11). Proceedings of the National Academy of Sciences, 103, 6287-6292. Chu W., Li R. and Reimherr M. (2016). Feature screening for time-varying coefficient models with ultrahigh dimensional longitudinal data. Annals of Applied Statistics, 10, 596-617. DeSantis C.E., Ma J., Sauer A.G., Newman L. A. and Jemal A. (2017). Breast cancer statistics, 2017, racial disparity in mortality by state. CA: A Cancer Journal for Clinicians, 67, 439-448. Harvard Fan J. and Lv J. (2008). Sure independence screening for ultrahigh dimensional feature space. Journal of the Royal Statistical Society, Series B, 70, 849-911. Fan J., Feng Y. and Song R. (2011). Nonparametric independence screening in sparse ultrahigh-dimensional additive models. Journal of the American Statistical Association, 106, 544-557. Fan J., Ma Y., Dai W. (2014) Nonparametric independent screening in sparse ultra-high dimensional varying coefficient models. Journal of the American Statistical Association, 109, 1270-1284. Fan J. and Song R. (2010). Sure independence screening in generalized linear models with NP-dimensionality. Annals of Statistics, 38, 3567-3604. He X., Wang, L. and Hong H. (2013). Quantile-adaptive model-free variable screening for high-dimensional heterogeneous data. Annals of Statistics, 41, 342-369. 48 Iglewicz B. and Hoaglin D. (1993), Volume 16: How to detect and handle outliers, The ASQC Basic References in Quality Control: Statistical Techniques, Edward F. Mykytka, Ph.D., Editor. Koenker R. (2005). Quantile Regression, New York: Cambridge University Press. Li G., Li Y. and Tsai C.L. (2015). Quantile correlations and quantile autoregressive modeling. Journal of the American Statistical Association, 110, 246-261. Li G., Peng H., Zhang J. and Zhu L. (2012). Robust rank correlation based screening. Annals of Statistics, 40, 1846-1877. Li J., Zheng Q., Peng L. and Huang Z. (2016). Survival impact index and ultrahighdimensional model-free screening with survival outcomes. Biometrics, 72, 1145-1154. Li R., Zhong W. and Zhu L. (2012). Feature screening via distance correlation learning. Journal of the American Statistical Association, 107, 1129-1139. Liu J., Li R. and Wu R. (2014). Feature selection for varying coefficient models with ultrahigh-dimensional covariates. Journal of the American Statistical Association, 109, 266-274. Ma X. and Zhang J. (2016). Robust model-free feature screening via quantile correlation. Journal of Multivariate Analysis, 143, 472-480. Ma S., Li R. and Tsai C. (2017). Variable screening via quantile partial correlation. Journal of the American Statistical Association, 112, 650-663. Nelsen R. B. (2007). An Introduction to Copulas. Springer Science & Business Media. Serfling R.J. (1980). Approximation Theorems of Mathematical Statistics. Wiley, New York. 49 Scheetz T. E., Kim K.Y. A., Swiderski R. E., et al.(2006). Regulation of gene expression in the mammalian eye and its relevance to eye disease. Proceedings of the National Academy of Sciences of the United States of America, 103, 14429-14434. Song R., Lu W., Ma S. and Jeng X.J. (2014). Censored rank independence screening for high-dimensional survival data. Biometrika, 101, 799-814. van der Vaart A. W. and Wellner J. A. (1996). Weak Convergence and Empirical Processes with Application to Statistics. Springer, New York. Vant Veer L.J., Dai H., van de Vijver M.J., et al. (2002). Gene expression profiling predicts clinical outcome of breast cancer. Nature, 415, 530-536. Wu Y. and Yin G. (2015). Conditional qunatile screening in ultrahigh-dimensional heterogeneous data. Biometrika, 102, 65-76. Xia X., Li J. and Fu B. (2018). Conditional quantile correlation learning for ultrahigh dimensional varying coefficient models and its application in survival analysis. Statistica Sinica, Accepted. Yu T., Li J. and Ma S. (2012). Adjusting confounders in ranking biomarkers: a model-based ROC approach. Briefings in Bioinformatics, 13, 513-523. Zhao D.S. and Li Y. (2012). Principled sure independence screening for Cox models with ultra-high-dimensional covariates. Journal of Multivariate Analysis, 105, 397-411. Zhu L., Li L., Li R. and Zhu L.X. (2011). Model-Free feature screening for ultrahigh dimensional data. Journal of the American Statistical Association, 106, 1464-1475. 50
10math.ST
arXiv:1509.01847v5 [math.GR] 27 Feb 2018 THE BASS–JIANG GROUP FOR AUTOMORPHISM-INDUCED HNN-EXTENSIONS ALAN D. LOGAN Abstract. We use the Bass–Jiang group for automorphism-induced HNN-extensions to build a framework for the construction of tractable groups with pathological outer automorphism groups. We apply this framework to a strong form of a question of Bumagin–Wise on the outer automorphism groups of finitely presented, residually finite groups. 1. Introduction Matumoto proved that every group Q can be realised as the outer automorphism group of some group GQ [Mat89]. Many authors have refined this result by placing restrictions on the groups Q and GQ [Koj88] [GP00] [DGG01] [BG03] [BW05] [FM06] [Min09] [Log15] [Log16] [Log17a]. Bumagin–Wise asked the following question [BW05, Problem 1]: Question 1 (Bumagin–Wise). Can every countable group Q be realised as the outer automorphism group of a finitely generated, residually finite group GQ ? Our main result is Theorem 1.1, which relates to a strong form of Question 1 where the group GQ is taken to be finitely presented rather than finitely generated. Almost nothing is known in general about the outer automorphism groups of finitely presented, residually finite groups. A group H has Serre’s property FA if every action of H on any tree has a global fixed point; this is related to the property of not splitting non-trivially as a free product with amalgamation or HNNextension [Ser80, Theorem 15]. Theorem 1.1. Suppose Q is a finitely presented group with Serre’s property FA. Then there exists a finitely presented group GQ such that Q embeds with finite index into Out(GQ ). Moreover, if Q is residually finite then GQ can be chosen to be residually finite. 2010 Mathematics Subject Classification. 20E06, 20E26, 20E36, 20F28. Key words and phrases. HNN-extensions, outer automorphism groups, residually finite groups. 1 2 ALAN D. LOGAN Examples of finitely presented groups Q with Serre’s property FA are SL3 (Z) [Ser74], triangle groups [Ser80], finitely presented groups with Kazhdan’s property T [Wat82], random groups in the sense of Gromov [DGP11], R. Thompson’s groups T and V [Far11], and the Brin–Thompson groups nV [Kat15]. The proof of Theorem 1.1 has two main ingredients. Firstly, Theorem 1.1 applies a certain framework built in this paper and explained below. Secondly, Theorem 1.1 applies a version of Rips’ construction [BO08]. Rips’ construction is usually applied to obtain finitely generated, nonfinitely presentable groups with pathological properties; our application to finitely presented groups is unusual. The framework. This paper principally consists of an in-depth analysis of the Bass–Jiang group for automorphism-induced HNN-extensions. The Bass–Jiang group of an HNN-extension G, defined in Section 3, is a subgroup of Out(G) which arises naturally in the context of Bass– Serre theory. Automorphism-induced HNN-extensions, defined in Section 2, are a class of tractable HNN-extensions; by “tractable” we mean that they are an easy class of groups to work with and possess nicer properties than general HNN-extensions. In Section 7 we package the technical results of this analysis into a framework for the construction of tractable groups with pathological outer automorphism groups. This framework is applied to prove Theorem 1.1 (see also [Log16] [Log17a]). Describing Out(G). Theorem 1.2 is a striking, non-technical special case of the framework described in Section 7. This theorem gives a convenient description of Out(G) for certain residually finite HNNextensions G. As our motivation comes from Question 1, the assumption that G is residually finite is completely natural. For functions ρ and σ write ρσ(x) := σ(ρ(x)), and write γg (h) := g −1 hg for all h ∈ G. For φ ∈ Aut(H) define Fix(φ) := {h ∈ H : φ(h) = h}. Define AK as: AK := {δ ∈ Aut(H) : δ(K) = K, ∃a ∈ H s.t. δφ(k) = φδγa (k)∀k ∈ K} and this is a subgroup of Aut(H). H and Theorem 1.2. Let G ∼ = hH, t; tkt−1 = φ(k), k ∈ Ki, K φ ∈ Aut(H). Assume that Z(H) ≤ Fix(φ), that H is finitely generated, and that G is residually finite. Then we have a short exact sequence: 1 → CH (K) ⋊ NH (K) AK Inn(H) → Out0 (G) → →1 Z(H)K Inn(H) where Out0 (G) is an index-one or -two subgroup of Out(G). BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 3 Theorem 1.2 follows immediately from Theorems 4.7 and 6.2. Indeed, Theorem 6.2 classifies when Out0 (G) = Out(G); these conditions are applicable here but are omitted for brevity. Note that the proof of Theorem 1.1 requires a more general result than Theorem 1.2, as the groups G = GQ in Theorem 1.1 are not necessarily residually finite. A note on labels of results. In a previous paper [Log16] we cited certain results from this current paper. The labels of the results in this current paper have subsequently changed. We record the relevant changes here: Theorem A is now Theorem 4.7, Lemma 2.1 is now Lemma 4.1, Lemma 5.2 is now Lemma 6.3, and Proposition 5.3 is now Proposition 2.1. Outline of the paper. In Section 2 we define automorphism-induced HNN-extensions and explain their “tractability”. In Section 3 we define the Bass–Jiang group and the Pettet group for HNN-extensions. In Section 4 we prove conditions implying that the Bass–Jiang group is the whole outer automorphism group; our main result is Theorem 4.7. In Section 5 we give a description of the Bass–Jiang group for automorphism-induced HNN-extensions; our main result is Theorem 5.6. In Section 6 we prove results relating the structure of the Bass– Jiang group of an automorphism-induced HNN-extension G to commutativity in the base group of G; our main result is Theorem 6.2. In Section 7 we package the technical results of this paper into a framework for the construction of tractable groups with pathological outer automorphism groups, and we prove Theorem 1.1. Acknowledgements. The author would like to thank Stephen J. Pride and Tara Brendle for many helpful discussions about this paper. 2. Automorphism-induced HNN-extensions Let H be a group and let η : K → K ′ be an isomorphism of subgroups of H. An HNN-extension of H over η is a group with relative presentation G = hH, t; tkt−1 = η(k), k ∈ Ki. We write G = H∗(K,K ′,η) . An automorphism-induced HNN-extension is an HNNextension with relative presentation G = hH, t; tkt−1 = φ(k), k ∈ Ki 4 ALAN D. LOGAN where φ ∈ Aut(H) and K H;1 the isomorphism of associated subgroups is induced by the automorphism φ. We write G = H∗(K,φ). Throughout this paper we use the letters G, H, K and φ as above. In a general HNN-extension the form of the embeddings of the two associated subgroups K and K ′ may be completely different. For example, K may be normal while K ′ is malnormal. In contrast, in an automorphism-induced HNN-extension the form of the embeddings of K and K ′ = φ(K) are necessarily the same (both normal, both malnormal, and so on), and in practice the image group φ(K) may be disregarded. For example, supposing H is finitely generated and residually finite, then G = H∗(K,φ) is residually finite if and only if K is residually separable in H [Log17b]. In this current paper, Theorems 1.2, 5.6 and 6.2 do not mention the image group φ(K). The Baumslag–Solitar groups BS(m, n) = ha, t; tam t−1 = an i are the HNN-extensions of the infinite cyclic group with non-trivial associated subgroups. These provide standard examples of HNN-extensions with pathological properties. For example, Baumslag–Solitar groups can be non-Hopfian (they are Hopfian if any only if n = 1, or m = 1, or gcd(m, n) 6= 1 [CL83]); they can be Hopfian but non-residually finite (they are residually finite if and only if n = 1, or m = 1, or |m| = |n| [Mes72], and note that a finitely generated, residually finite group is Hopfian); and they can have non-finitely generated outer automorphism group (for example, Out(BS(2, 4)) is not finitely generated [CL83]). However, automorphism-induced Baumslag–Solitar groups have |m| = |n|, so are residually finite, by the above classification, and have virtually cyclic outer automorphism group [GHMR00]. The above two paragraphs demonstrate that automorphism-induced HNN-extensions are more tractable and in certain cases have nicer properties than general HNN-extensions. Therefore, increasing the complexity of the base group H maintains the tractability of these HNN-extensions but can allow for pathological properties; see, for example, [Log16], where H is a cubulated hyperbolic group with Serre’s property FA, and [Log17a], where H is a triangle group. Notation. We write hg := g −1 hg and we write γg for the inner automorphism defined by γg (h) = g −1hg for all h ∈ G. These contrast with the notation tkt−1 = φ(k) used here for HNN-extensions because it makes certain proofs more readable. 1If H = K then G = H⋊φ Z is the mapping torus of φ. Here the Bass–Jiang group (see Section 3) is very different because φ extends to an inner automorphism [Log15]. BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 5 The normaliser-quotient NH (K)/K. The following proposition underlies this whole paper. It implies that NH (K)/K embeds into Aut(G) for G = H∗(K,φ), and this paper represents an effort to obtain conditions implying that NH (K)/K is “close to” Out(G) (for example, the are isomorphic, commensurable, and so on). Proposition 2.1 (Ateş–Logan–Pride [ALP17]). Let G = H∗(K,φ). For d ∈ NH (K) define ϕd : h 7→ h, t 7→ φ(d)td−1 . Then the map τ : NH (K) 7→ Aut(G) d 7→ ϕd is a homomorphism with kernel K. Proof. It is routine to prove that ϕd ∈ Aut(G). Then τ is a homomorphism as ϕd1 ϕd2 = ϕd1 d2 , and it has kernel K as φ(d)td−1 = t if and only if d−1 ∈ K by Britton’s Lemma [LS77, Section IV.2].  In the framework built by this paper and explained in Section 7, the pathological properties of Out(G), where G = H∗(K,φ), are inherited from the normaliser-quotient NH (K)/K. In particular, by Proposition 2.1, if NH (K)/K is not residually finite and H is finitely generated then G is not residually finite [Bau63] (and this is an “if and only if” statement if NH (K) has finite index in H [Log17b]). We see later, in Theorem 6.2, that if Z(H) ≤ K ∩ Fix(φ) then NH (K)/K also embeds into Out(G), while Lemma 6.3 gives a finite-index version of this embedding when Z(H) 6≤ K. Thus the properties of NH (K)/K are in a certain sense bestowed upon G. Note that if H is infinite cyclic (and hence G is a Baumslag–Solitar group) then NH (K)/K is cyclic, and so bestows no pathological properties upon G. 3. The Bass–Jiang group This paper analyses the Bass–Jiang group for automorphism induced HNN-extensions. The proof of Theorem 1.1 applies this analysis. In this section we define the Bass–Jiang group OutH (G) of an HNNextension G = H∗(K,K ′,η) . We also define the Pettet group OutH (G), which is applied in one of our main technical results, Theorem 4.7. The Pettet group lies between the Bass–Jiang group and the full outer automorphism group: OutH (G) ≤ OutH (G) ≤ Out(G). 6 ALAN D. LOGAN Note that these groups may be defined for graphs of groups in general [BJ96] [Pet99], but for brevity we only define them for HNN-extensions. Bass–Serre theory. The definitions in this section and certain proofs in Section 4 apply Bass–Serre theory. All relevant definitions and notation are taken from Serre’s book [Ser80]. If G = H∗(K,K ′,η) then G acts in a standard way on a tree Γ, called the Bass–Serre tree of G. Vertex-stabilisers Gv of Γ are precisely the conjugates of the base group H, so Gv = H g for some g ∈ G, while edge-stabilisers Ge are precisely the conjugates of the associated group K, so Ge = K g for some g ∈ G. For vertices v, w ∈ V Γ we write [v, w] for the geodesic connecting v and w, and we define the length of [v, w], denoted |[v, w]|, to be the number of (positive) edges in [v, w]. The Bass–Jiang group. If ψ ∈ Aut(G) then ψb denotes the coset of Out(G) containing ψ. The Bass–Jiang group OutH (G) of G = H∗(K,K ′,η) is the subgroup of Out(G) consisting of those ψb ∈ Out(G) which have a representative ψ such that ψ(H) = H and ψ(t) = gtǫ for some g ∈ H, ǫ = ±1. It is helpful to have a geometric view of the Bass–Jiang group: If AutH (G) is the full pre-image of OutH (G) in Aut(G) then AutH (G) acts on the Bass–Serre Γ of G such that the diagram in Figure 1 commutes. The Bass–Jiang group OutΓ (GΓ ) for the fundamental group GΓ of a graph of groups Γ was described by Bass–Jiang [BJ96]. Levitt described a group related to OutΓ (GΓ ) in his investigation of Out(G) for G a one-ended hyperbolic group [Lev05]. Gilbert–Howie–Metaftsis– Raptis gave conditions implying OutΓ (GΓ ) = Out(GΓ ) for GΓ a generalised Baumslag–Solitar group [GHMR00]. Theorem 4.7 mirrors this result of Gilbert–Howie–Metaftsis–Raptis. The Pettet group. The Pettet group OutH (G) of G = H∗(K,K ′,η) is the subgroup of Out(G) consisting of those ψb ∈ Out(G) which have a representative ψ such that ψ(H) = H. It is helpful to have a geometric view of the Pettet group: If AutH (G) is the full pre-image of OutH (G) in Aut(G) then AutH (G) acts on the Bass–Serre tree Γ of G such that the diagram in Figure 2 commutes. M. Pettet studied AutH (G), and implicitly the Pettet group [Pet99]. He focused on conditions for the Pettet group to equal the Bass–Jiang group; these are related to Conditions (1) and (2) from Theorem 4.7. Two examples. We now give two examples which demonstrate that, BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS G θ AutH (G) G θ 7 AutH (G) Aut(V Γ) Aut(Γ) Figure 1. This diagram commutes, where AutH (G) is the full pre-image of the Bass–Jiang group, G = H∗(K,K ′ ,η) , Γ is the Bass–Serre tree, and θ is the canonical homomorphism with θ(G) = Inn(G). Figure 2. This diagram commutes, where AutH (G) is the full pre-image of the Pettet group, G = H∗(K,K ′ ,η) , V Γ is the vertices of the Bass–Serre tree, and θ is the canonical homomorphism with θ(G) = Inn(G). in general, OutH (G) OutH (G) and OutH (G) Out(G). Our first example is due to Collins–Levin [CL83] and Levitt [Lev07]. Consider the HNN-extension G1 = ha, t; t−1 a2 t = a4 i, with base group H1 = hai. The map ψ1 : a 7→ a, t 7→ t−1 a2 ta−2 t is an automorphism of G1 , and clearly ψb1 ∈ OutH1 (G1 ). However, ψb1 6∈ OutH1 (G1 ) and so OutH1 (G1 ) OutH1 (G1 ). We shall write F (x, y) for the free group with free basis {x, y}. Consider the automorphism-induced HNN-extension G2 = ha, b, t; at = bi, with base group H2 = F (a, b). Clearly G2 = F (a, t), and hence the map ψ2 : a 7→ at, t 7→ at2 is an automorphism of G2 . However, ψb2 6∈ OutH2 (G2 ) as at is not conjugate to any power of a in F (a, t), so OutH2 (G2 ) Out(G2 ). 4. The Bass–Jiang group versus Out(G) The Bass–Jiang group OutH (G) is most of interest when it is the full outer automorphism group Out(G), so OutH (G) = Out(G). In this section we prove Theorem 4.7, which gives conditions implying that OutH (G) = Out(G). To prove these conditions we use the Pettet group OutH (G), as defined in Section 3. Throughout the remainder of this paper we assume all HNN-extensions are automorphism-induced, so G = H∗(K,φ) , unless we explicitly state otherwise. We emphasize that this assumption is necessary for our results. Lemma 4.1 gives a condition implying OutH (G) = Out(G). Lemma 4.6 gives conditions implying OutH (G) = OutH (G). These lemmas combine to prove Theorem 4.7. 8 ALAN D. LOGAN 4.1. Conditions implying OutH (G) = Out(G). Lemma 4.1 now proves that for G = H∗(K,φ), if H has Serre’s property FA then the Pettet group is equal to the full outer automorphism group. We then have OutH (G) ≤ OutH (G) = Out(G). We note the similarity between Lemma 4.1 and a comment of Pettet [Pet99, Introduction]. The principal difference is that Pettet is additionally assuming conditions implying OutH (G) = OutH (G); we require no such preliminary assumptions. The proof of Lemma 4.1 shows that under the conditions of the lemma the base group H is always conjugacy maximal in G = H∗(K,φ) . The proof of Lemma 4.1 may be written purely algebraically; we have used Bass–Serre theory so as to be similar to the other proofs on Section 4. Recall that K 6= H in an automorphism-induced HNN-extension. Lemma 4.1. Let G = H∗(K,φ). If H has Serre’s property FA then OutH (G) = Out(G). Proof. We prove that if ψ ∈ Aut(G) then ψ(H) = H g , where g ∈ G; this is sufficient as then ψγg−1 is a representative for ψb such that ψγg−1 (H) = H. So, let ψ ∈ Aut(G) and consider the action of ψ(H) on the Bass–Serre tree Γ of G. As H has Serre’s property FA, ψ(H) stabilises some vertex of Γ. Hence, ψ(H) ≤ H g1 with g1 ∈ G. Similarly, ψ −1 (H) ≤ H g2 with g2 ∈ G, and so H g3 ≤ ψ(H) with g3 := ψ(g2 )−1 ∈ G. Suppose that ψ(H) H g1 and we shall find a contradiction. By g3 g1 the above, H H . Now, there exist vertices u, w ∈ V Γ such that g1 Gu = H and Gw = H g3 . If u = w then H g1 = H g3 , a contradiction. So u 6= w and H g3 stabilises the geodesic [u, w]. In particular, H g3 stabilises the initial edge of [u, w], and therefore there exists g4 ∈ G such that H g3 = H g4 ≤ K g4 or H g3 = H g4 ≤ φ(K)g4 . Hence H = K, a contradiction.  4.2. Conditions implying OutH (G) = OutH (G). We now work towards proving Lemma 4.6, which gives sufficient conditions for the Bass–Jiang group to be equal to the Pettet group of G = H∗(K,φ). We then have OutH (G) = OutH (G) ≤ Out(G). Conjugacy. We begin our proof of Lemma 4.6 with Lemma 4.2, which describes conjugacy in automorphism-induced HNN-extensions. A word U in an HNN-extension G = H∗(K,K ′,η) is a product of the form h0 tǫ1 h1 tǫ2 h2 · · · hn−1 tǫn hn where hi ∈ H, ǫi = ±1. For words U and V we write U ≡ V if U and V are exactly the same word, and we say U is t-reduced if it contains no subwords of the form tkt−1 , k ∈ K, or t−1 k ′ t, BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 9 k ′ ∈ K ′ . Every element of an HNN-extension has a representative word which is t-reduced, by Britton’s Lemma. Lemma 4.2. Let G = H∗(K,φ). For all g ∈ G there exists i ∈ Z and a ∈ H such that if b, c ∈ H with bg = c then c = φi γa (b). Note that i and a are dependent on g, not on b and c. Proof. Let g ∈ G be arbitrary. Let u, w ∈ V Γ be the vertices of the Bass–Serre tree Γ of G such that Gu = H and Gw = H g . Let W be a t-reduced word in H∗(K,φ) representing g. We induct on n = |[u, w]|, the length of the geodesic [u, w]. If n = 0 then u = w and the result trivially holds. For the induction step, note that if n > 0 then [u, w] decomposes as [u, v] and [v, w] where |[u, v]| = n − 1 and |[v, w]| = 1. We also have a decomposition W ≡ V dn−1 tǫn dn , di ∈ H and where V is such that Gv = H V and the result holds for V . Then: ǫn d n c = bW = (bV )dn−1 t ǫn d n = (φj γan−1 (b))dn−1 t = φi γa (b) as required, where i = j − ǫn and a = φ−ǫn (an−1 dn−1)dn .  We now prove Lemma 4.3, which corresponds to Condition (3) from Lemma 4.6 (and Condition (3) from Theorem 4.7). Lemma 4.3. Let G = H∗(K,φ). Suppose that OutH (G) OutH (G). Additionally, suppose that there does not exist any b ∈ H such that φ(K) γb (K) and there does not exist any c ∈ H such that γc (K) φ(K). Then there exists a ∈ H such that φ(K) = γa (K). Proof. Suppose ψb ∈ OutH (G) \ OutH (G), and let ψ ∈ ψb be such that ψ(H) = H. Recall that ψ acts on the vertices of the Bass–Serre tree Γ of G. Let u, v ∈ V Γ be connected by a single edge e′ , and suppose −1 that Gu = H and that Gv = H t . Then Ge′ = K. Write w := ψ(v), −1 so Gw = H ψ(t) , and consider the geodesic [u, w]. As ψ 6∈ AutH (G), |[u, w]| > 1. Note that ψ(K) stabilises [u, w] because K stabilises e′ −1 (or, algebraically, because ψ(K) ≤ ψ(H), ψ(H t )), so ψ(K) ≤ G[u,w]. Note also that the first edge e1 in this geodesic has stabiliser an Hconjugate either of K or of φ(K), and without loss of generality we can assume Ge1 is either K or φ(K). There exists a edge ej in the geodesic [u, w] such that Gej = ψ(K) [Pet99, Lemma 2.2], so ψ(K) = K g for some g ∈ G. Therefore, Gej = K g = ψ(K) ≤ G[u,w] ≤ Ge1 . As Ge1 = K or φ(K), we have that 10 ALAN D. LOGAN Gej = K g ≤ K or φ(K), so Gej = φi γa0 (K) for some i ∈ Z, a0 ∈ H by Lemma 4.2. Recall that [u, w] contains more than one edge. Let f ∈ [u, w] be ǫ adjacent to ej . Then Gf = Geaj1 t a2 for some a1 , a2 ∈ H, ǫ = ±1, so ǫa 2 φi γa0 (K) = Gej ≤ G[u,w] ≤ Gf = Geaj1 t ǫa 2 = φi γa0 (K)a1 t . Noting that φi γa0 (K) ≤ H, we therefore have that every element of φi γa0 (K) is equal to an element of the form (a1 tǫ a2 )−1 φi γa0 (k)a1 tǫ a2 , k ∈ K, and hence of the form φi−ǫ γa3 (k), with i, ǫ, a3 fixed. Hence, φi γa0 (K) ≤ φi−ǫ γa3 (K), and so γa4 (K) ≤ φ−ǫ (K). By the assumptions of the lemma γa (K) = φ(K), as required, where a = a4 if ǫ = −1 or a = φ(a4 )−1 if ǫ = 1.  Residual finiteness. We now prove Lemma 4.4, which provides conditions for OutH (G) = OutH (G) to hold in a general HNN-extension G = H∗(K,K ′,η) . Lemma 4.5 is essentially Lemma 4.4 for G an automorphisminduced HNN-extension. If the conditions of either of these lemmas hold then the HNN-extension G is residually finite. Baumslag–Tretkoff gave conditions for general HNN-extensions G = H∗(K,K ′,η) to be residually finite [BT78], and the conditions of Lemma 4.4 are a strong form of these residual finiteness conditions. A subgroup N ≤ H is characteristic if ψ(N) = N for all ψ ∈ Aut(H). Lemma 4.4. Let G = hH, t; tkt−1 = η(k), k ∈ Ki where η : K → K ′ is an isomorphism of subgroups of H, and let H be finitely generated and residually finite. Suppose that for any positive integer n and elements xi , yi , zi (i = 1, 2, . . . , n) with xi ∈ H \ K, yi ∈ H \ K ′ , zi ∈ K ∩ K ′ \ 1, there exists a characteristic subgroup N of finite index in H such that (1) xi K ∩ N = yi K ′ ∩ N = ∅, the empty set, and zi 6∈ N, (2) η maps K ∩ N into N and η −1 maps K ′ ∩ N into N. Then OutH (G) = OutH (G). Proof. Note that η induces an isomorphism η ∗ of KN/N onto K ′ N/N. We write G = hH/N, t; t(kN)t−1 = η ∗ (kN), k ∈ Ki. Then the natural map h 7→ hN induces a homomorphism of G onto G [BT78, Proof of Theorem 4.2]. Note that H/N is finite, so OutH/N (G) = OutH/N (G) [Pet99, Theorem 1]. Suppose OutH (G) OutH (G). Then there exists µ ∈ AutH (G) with µ|H ∈ Aut(H) such that µ(t) = h1 tǫ1 h2 tǫ2 . . . hm tǫm is t-reduced with m > 1. Note that for each j = 1, . . . , m, either hj ∈ H \ K or hj ∈ H \ K ′ . Therefore, pick n and the elements xi , yi , zi , i = 1, . . . , n, such that that each hj is an xi or yj as appropriate, pick N characteristic in BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 11 H appropriately and form the corresponding group G. Now, µ induces a map µ∗ : G → G with µ∗ (t) = h1 Ntǫ1 h2 Ntǫ2 . . . hm Ntǫm and µ∗ (h) = µ(h)N. We now prove that µ∗ ∈ Aut(G). Firstly, note that µ∗ |H/N ∈ Aut(H/N) as N is characteristic in H. Then, µ∗ (t)(kN)µ∗ (t)−1 = η ∗ (kN) for all k ∈ K because µ and µ∗ |H/N are homomorphisms. Hence, µ∗ : G → G is a homomorphism. It is surjective because µ(t) and H generate G, and it is injective because G is finitely generated and residually finite [BT78, Theorem 3.1] and hence Hopfian. Then µ∗ ∈ AutH (G) \ AutH (G) as µ∗ |H/N ∈ Aut(H/N) and the word h1 Ntǫ1 h2 Ntǫ2 . . . hm Ntǫm is t-reduced (as each hj is an xi or yi as  appropriate). Hence, OutH/N (G) OutH/N (G), a contradiction. The only difference between the conditions of Lemma 4.4 and those of Baumslag–Tretkoff is that we require the finite-index subgroup N to be characteristic rather than normal. Suppose, as with Baumslag– Tretkoff, we instead assume that N is normal in H. Then, as H is b ≤f N which finitely generated, there exists a characteristic subgroup N b is such that satisfies the first condition. However, it is not clear that N b b η(K ∩ N ) ≤ N . Now, if G = H∗(K,φ) is automorphism-induced then the characteristic b also satisfies the second condition, as for example φ(K ∩ subgroup N b = φ(K) ∩ φ(N) b ≤ φ(N) b =N b . This observation gives the following N) lemma, which corresponds to Condition (3) of Lemma 4.6 (also compare with [BT78, Lemma 4.4]). A subgroup K of H is residually separable in H if for all x ∈ H \ K there exists a finite index, normal subgroup N of H, written N ⊳f H, such that x 6∈ KN. Lemma 4.5. Let G = H∗(K,φ), and let H be finitely generated and residually finite. If K is residually separable in H then OutH (G) = OutH (G). Proof. As K is residually separable in H the conditions of Lemma 4.4 hold. The result follows.  An alternative proof of Lemma 4.5 is as follows: By combining Lemma 4.3 with a result of Shirvani [Shi85, Lemma 3], we see that the conditions of Lemma 4.5 imply that φ(K) = γa (K) for some a ∈ H. The result follows from Condition (2) of Lemma 4.6, below (the proof of this condition is independent of the proof of Condition (4)). Proof of Lemma 4.6. Lemma 4.6 combines Lemma 4.3 and Lemma 12 ALAN D. LOGAN 4.5 with results of Pettet. A subgroup K of a group H is conjugacy maximal if there does not exist any a ∈ H such that K K a . Lemma 4.6. Let G = H∗(K,φ). Suppose that one of the following holds: (1) K is conjugacy maximal in H; (2) φ(K) = γa (K) for some a ∈ H; or (3) There does not exist any b ∈ H such that φ(K) γb (K) and there does not exist any c ∈ H such that γc (K) φ(K); or (4) H is finitely generated and residually finite, and K is residually separable in H; or (5) H is finitely generated and G is residually finite. Then OutH (G) = OutH (G). Proof. If (1) or (2) holds then the result is known to hold [Pet99, Lemma 2.6 and Theorem 1]. Now, note that it is impossible for (3) to hold simultaneously to the inequality OutH (G) Out(G): if both held then (2) would hold, by Lemma 4.3, and so we obtain OutH (G) = Out(G), a contradiction. Hence, if (3) holds then the result holds. If (4) holds then the result holds by Lemma 4.5. If (5) holds then (4) holds [Log17b]. The result follows.  4.3. The Bass–Jiang group versus Out(G). Theorem 4.7 now gives conditions implying that the Bass–Jiang group is the full outer automorphism group. Theorem 4.7. Let G ∼ H and = hH, t; tkt−1 = φ(k), k ∈ Ki, K φ ∈ Aut(H), be an automorphism-induced HNN-extension. If H has Serre’s property FA then OutH (G) = Out(G). If any one of the following statements holds then OutH (G) = OutH (G): (1) K is conjugacy maximal in H; (2) φ(K) = γa (K) for some a ∈ H; or (3) There does not exist any b ∈ H such that φ(K) γb (K) and there does not exist any c ∈ H such that γc (K) φ(K); or (4) K is residually separable in H; or (5) G is residually finite. Proof. Theorem 4.7 follows immediately from Lemmas 4.1 and 4.6.  Note that Theorem 4.7 obtains OutH (G) = Out(G) in two disjoint steps; it proves that OutH (G) = Out(G) and separately that OutH (G) = OutH (G). M. Pettet proved a similar result to Theorem 4.7 involving Conditions (1) and (2) [Pet99, Theorem 1], but he does not obtain these disjoint steps due to his more general setting. BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 13 Theorem 4.7 gives a concrete method of proving that an automorphisminduced HNN-extension G = H∗(K,φ) is not residually finite: if there exists some ψ ∈ AutH (G) \ AutH (G) (that is, OutH (G) OutH (G)) then G is not residually finite. Lemma 4.8, below, provides a way of proving this inequality. 4.4. A condition implying OutH (G) OutH (G). We do not know if the conditions of Lemma 4.6 are both necessary and sufficient for OutH (G) = OutH (G) to hold, and reading closely the proof of Lemma 4.3 one might suspect that they are. Lemma 4.8 now demonstrates how close the conditions of Lemma 4.6 are to being necessary and sufficient. Lemma 4.8 demonstrates this by proving that if Conditions (1) and (3) of Lemma 4.6 fail “compatibly” with one another then OutH (G) OutH (G). Note that these two conditions fail for G = H∗(K,φ) if and only if, after replacing φ with φ−1 if necessary, there exists some a, b ∈ H such that γa (K) K φγb(K). The “compatibility” we require is that we can take a ∈ φγb(K). Lemma 4.8. Let G = H∗(K,φ). Suppose also that K a where a ∈ φγb(K), b ∈ H. Then OutH (G) OutH (G). K φγb(K) Proof. By replacing φ with φγb, we may assume b = 1. Note that a 6∈ K as γa (K) K, and so the word t2 at−1 φ(a)−1 is t-reduced. We prove that the map ψ : h 7→ h ∀h ∈ H t 7→ t2 at−1 φ(a)−1 is an automorphism of G; then ψ ∈ AutH (G) \ AutH (G) and the result follows. Now, φ(a)−1 kφ(a) ∈ φ(K) so ψ : G → G is a homomorphism. To see that ψ is a surjection we prove that t ∈ im(ψ). Begin with the following, where a1 = φ−1 (a) ∈ K. Note that a−1 a−1 1 a ∈ K. −1 (t2 at−1 φ(a)−1 )a−1 = t2 at−1 φ(a−1 a−1 1 aa ) −1 −1 = t2 a−1 1 at φ(a ) = ta−1 tat−1 φ(a−1 ) 14 ALAN D. LOGAN We then have that:   (t2 at−1 φ(a)−1 )φ(a) (t2 at−1 φ(a)−1 )a−1 (t2 at−1 φ(a)−1 )−1   = (t2 at−1 φ(a)−1 )φ(a) ta−1 tat−1 φ(a)−1 (t2 at−1 φ(a)−1 )−1 = (t3 at−1 φ(a)−1 )(t2 at−1 φ(a)−1 )−1 =t Therefore, ψ is surjective. It is injective because it is invertible, with inverse ψ −1 : h 7→ h for all h ∈ H, t 7→ tφ(a)ta−1 t−1 .  5. Describing the Bass–Jiang group In this section we prove Theorem 5.6, which gives a short-exact sequence description of the Bass–Jiang group of G = H∗(K,φ) . Combined with Theorem 4.7, it allow for a description of Out(G). Bass–Jiang gave a decomposition of the group OutH (G) for G a general HNN-extension [BJ96]. Their description took the form of a filtration. However, their description contains both of the associated subgroups K and φ(K), while our description in Theorem 5.6 only (V ) contains K. The difference is in the description of the kernel OutH (G) (V ) from the short exact sequence in Theorem 5.6 (OutH (G) is formally (V ) defined below). Specifically, Bass–Jiang find some N E OutH (G) such that (V ) OutH (G) ∼ (NH (φ(K)) ∩ NH (K)) /Z(H) . = N Z(H)K In general, NH (φ(K)) ∩ NH (K) 6= NH (K). Therefore Bass–Jiang’s de(V ) composition of OutH (G) is different from the decomposition in The(V ) orem 5.6. Our simpler description of OutH (G) is fundamental to the framework described in Section 7 and is essential in proving Theorem 1.1. Results of Bass–Jiang. Our proof of Theorem 5.6 is based on two results of Bass–Jiang, which we state now. We have translated their results and definitions into our setting of automorphism-induced HNNextensions. The first result is a classification of the elements of the Bass–Jiang group OutH (G) [BJ96, Theorem 5.6]. Theorem 5.1 (Bass–Jiang). Let G = H∗(K,φ) . If δ ∈ Aut(H), a ∈ H are such that δ(K) = K and δφ(k) = φδγa (k) for all k ∈ K then the BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 15 map α(δ,a) : h 7→ δ(h) t 7→ at ∀h ∈ H is an automorphism of G. If ζ ∈ Aut(H), b ∈ H are such that ζ(K) = φ(K), ζ 2γb (K) = K, and ζφ−1(k) = φζγb(k) for all k ∈ K then the map β(ζ,b) : h 7→ ζ(h) ∀h ∈ H −1 t 7→ bt is an automorphism of G. Moreover, every element ψb of OutH (G) has a representative in AutH (G) of the form α(δ,a) or of the form β(ζ,b) . The second result of Bass–Jiang which we apply requires certain definitions. The restrictions on a and b in the second, equivalent definition (V ) of OutH (G) follow from Theorem 5.1: α(δ,a) : a ∈ H, δ(K) = K, δφ(k) = φδγa (k) for all k ∈ K}, Out0H (G) := {b (V ) OutH (G) := {b α(γb ,a) : a ∈ H, γb ∈ Inn(H)} = {b α(γb ,a) : a ∈ H, b ∈ NH (K), baφ(b)−1 ∈ CH (φ(K))}. The subgroup Out0H (G) clearly has index two in OutH (G) if there exists some automorphism β(ζ,b) of G, and index one otherwise. The second result of Bass–Jiang which we apply is the initial two steps of their filtration decomposition of OutH (G) [BJ96, Theorem 8.12]. Recall that the subgroup AK ≤ Aut(H) was defined in the introduction. Theorem 5.2 (Bass–Jiang). Let G = H∗(K,φ). The surjection AK Inn(H) Inn(H) 7→ δb χ1 : Out0H (G) → (V ) α b(δ,a) has kernel OutH (G), and either Out0H (G) = OutH (G) or there exists some ζ ∈ Aut(H), b ∈ H such that ζ(K) = φ(K), ζ 2γb (K) = K, and ζφ−1(k) = φζγb(k) for all k ∈ K, whence Out0H (G) has index two in OutH (G). 2Section 8.5 of Bass–Jiang’s paper is a restriction of their Theorem 8.1 to HNNextensions. We cite their more general Theorem 8.1 because certain errors have crept in to the re-statement in Section 8.5. 16 ALAN D. LOGAN (V ) The subgroup OutH (G) of Out0H (G). We wish to describe the (V ) kernel OutH (G) from Theorem 5.2; combining the description we obtain with Theorem 5.2 proves the main result of this section, Theorem 5.6. Our description is given by Lemmas 5.4 and 5.5. These lemmas (V ) both mention the subgroup CK of OutH (G): CK : = {b α(1,a) : a ∈ H} = {b α(1,a) : a ∈ CH (φ(K))} Lemmas 5.4 and 5.5 also both apply the following technical result. Lemma 5.3. Let G = H∗(K,φ), and let g ∈ G and x, y ∈ H. Suppose that both of the following hold. (1) (2) g −1 ytg = x−1 φ(x)t g −1 hg = x−1 hx ∀h∈H Then g ∈ K. Proof. Begin by writing g as a t-reduced word zW , where z ∈ H and W is either empty or begins with t±1 . Assume that W is non-empty. Now, (2) has the form W −1 z −1 hzW = x−1 hx. As K H, h can be chosen such that the word W −1 z −1 hzW is t-reduced (z −1 hz not in K or φ(K) as appropriate), a contradiction by Britton’s Lemma [LS77, Section IV.2]. Hence, W is empty. So g = z ∈ H. It then follows from (1) that g ∈ K, as required.  Our proofs of Lemmas 5.4 and 5.5, and of certain proofs in Section 6, require calculations with automorphisms of the form α(δ,a) . We note the following identities: α(δ1 ,a1 ) α(δ2 ,a2 ) = α(δ1 δ2 ,δ2 (a1 )a2 ) −1 α(δ,a) = α(δ−1 ,δ−1 (a−1 )) Certain calculations are written in terms of cosets α b(δ,a) , but these follow immediately from the above two identities. Lemma 5.4. The map (V ) χ2 : OutH (G) → NH (K)/Z(H)K α b(γb ,a) 7→ bZ(H)K is a well-defined surjective homomorphism with kernel CK . Proof. Suppose the map χ2 is well-defined. Note that for all b ∈ NH (K), the pair (γb , b−1 φ(b)) defines the automorphism α(γb ,b−1 φ(b)) by Theorem 5.1, and so χ2 is surjective. As α b(γb1 ,a1 ) α b(γb2 ,a2 ) = α b(γb1 b2 ,a3 ) BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 17 for some a3 ∈ H, we have that χ2 is also a homomorphism. Now, CK ≤ ker χ2 , but as α b(γk ,a) = α b(1,kaφ(k)−1 ) for all k ∈ K we have that ker χ2 = CK . To see that the map χ2 is well-defined, suppose α b(γb1 ,a1 ) = α b(γb2 ,a2 ) −1 and it is sufficient to prove that b1 b2 ∈ Z(H)K. Note that if α(γb ,a) ∈ Aut(G) then α(γb ,b−1 φ(b)) ∈ Aut(G), and then α(γb ,a) = α(γb ,b−1 φ(b)) α(1,φ(b)−1 ba) . Therefore, the identity α b(γb1 ,a1 ) = α b(γb2 ,a2 ) becomes: α b(γb 1 α b(1,φ(b1 )−1 b1 a1 ) ,b−1 1 φ(b1 )) =α b(γb 2 α b(1,φ(b2 )−1 b2 a2 ) ,b−1 2 φ(b2 )) ⇒α b(1,a3 ) = α b(γ −1 b1 b2 −1 φ(b−1 b )) ,(b−1 2 1 b2 ) 1 for some a3 ∈ H. Hence, α(1,a3 ) γg = α(γ −1 b 1 b2 −1 φ(b−1 b )) ,(b−1 2 1 b2 ) 1 for some g ∈ G and a3 ∈ H. Therefore, the conditions of Lemma 5.3 hold for the two underlying identities (where x := b−1 1 b2 and y := a3 ), hence g ∈ K −1 −1 with g −1 hg = (b−1 b ) hb b for all h ∈ H, and so b−1 2 2 1 1 1 b2 ∈ Z(H)K as required.  Note that NK := {b α(γb ,b−1 φ(b)) : b ∈ NH (K)} is a subgroup of (V ) (V ) OutH (G), and OutH (G) = CK NK . So by Lemma 5.4 we just need CK ∩ NK = 1 to obtain a semidirect product in the statement of Theorem 5.6. This possible splitting of the map χ2 is discussed in Section 6. Lemma 5.5. Define L = {φ−1 (k)k −1 : k ∈ K ∩ Z(H)}. Then L E CH (K) CH (K) and CK ∼ . = L C (φ(K)) ; the result then follows. To begin, Proof. We prove that CK ∼ = H φ(L) note that α b(1,a1 ) α b(1,a2 ) = α b(1,a1 a2 ) , and so CK is a homomorphic image of CH (φ(K)). We therefore prove that α(1,a) ∈ Inn(G) if and only if a ∈ φ(L). Clearly if a = kφ(k)−1 ∈ φ(L) then α(1,a) = γk−1 ∈ Inn(G). On the other hand, suppose α(1,a) ∈ Inn(G). To see that a ∈ φ(L), note that the conditions of Lemma 5.3 hold (where x = 1, y = a, and in the following we take k := g −1 ). Therefore, we have that k −1 hk = h for all h ∈ H and that k −1 tk = at, where k ∈ K. The first identity implies k ∈ Z(H) (and so k ∈ Z(H) ∩ K), while the second implies a = k −1 φ(k). Hence, a ∈ φ(L).  Describing OutH (G). We can now give our description of the Bass– Jiang group OutH (G) for G = H∗(K,φ). Theorem 5.6. Let G ∼ H and = hH, t; tkt−1 = φ(k), k ∈ Ki, K φ ∈ Aut(H), be an automorphism-induced HNN-extension. Let L = 18 ALAN D. LOGAN {φ−1(k)k −1 : k ∈ K ∩ Z(H)}. Then L is a normal subgroup of CH (K) and we have a diagram of exact sequences: 1 CH (K)/L 1 (V ) OutH (G) Out0H (G) AK Inn(H) Inn(H) 1 NH (K)/Z(H)K 1 where either Out0H (G) = OutH (G) or there exists some ζ ∈ Aut(H) and some a ∈ H such that ζ(K) = φ(K), ζ 2γa (K) = K and ζφ−1(k) = φζγa(k) for all k ∈ K, whence Out0H (G) has index two in OutH (G). (V ) Proof. By Theorem 5.2, it is sufficient to prove that OutH (G) decomposes as in the statement of Theorem 5.6. This follows from Lemmas 5.4 and 5.5.  An alternative view. Recall the definition of AK : AK := {δ ∈ Aut(H) : δ(K) = K, ∃a ∈ H s.t. δφ(k) = φδγa (k)∀k ∈ K} The following isomorphism can be substituted in to Theorem 5.6. Here, Inn(NH (K)) = {γb : b ∈ NH (K)}. AK Inn(H) ∼ AK = Inn(H) Inn(NH (K)) This isomorphism holds because Inn(H) ∩ AK = Inn(NH (K)); that Inn(H)∩AK is a subgroup of Inn(NH (K)) is clear from the definition of AK , while if γb (K) = K then γb ∈ AK because γb φ(k) = φγb γb−1 φ(b) (k). 6. The impact of commutativity in H (V ) The reader might feel cheated that the decomposition of OutH (G) in Theorem 5.6 did not split over the subgroups CK and NK , as defined in (V ) (V ) Section 5. Indeed, OutH (G) = CK NK and CK E OutH (G). However, elements of the form α b(γc ,c−1 φ(c)) where c ∈ Z(H) are contained in (V ) both subgroups, so the decomposition of OutH (G) in Theorem 5.6 does not split in general. In this section we prove Theorem 6.2, which BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 19 (V ) assumes that Z(H) ≤ Fix(φ); here the decomposition of OutH (G) does split over CK and NK . We also prove related results which assume commutativity conditions on H. Splitting the description of Theorem 5.6. We begin by “reversing” the map χ2 from Lemma 5.4, which allows us to determine if χ2 splits. Lemma 6.1. The map (V ) χ2 : NH (K) → OutH (G) b 7→ α b(γb ,b−1 φ(b)) is a homomorphism with kernel JK, where J = Z(H) ∩ Fix(φ). Proof. As α b(γb ,b−1 b(γb ,b2 −1 φ(b2 )) = α b(γb b ,b2 −1 b1 −1 φ(b1 b2 )) , the map χ2 φ(b1 )) α 2 1 2 1 1 is a homomorphism. Note that ker χ2 ≥ JK as for b ∈ J, k ∈ K we have α(γbk ,(bk)−1 φ(bk)) = γk . To see that the ker χ2 ≤ JK, suppose that α(γb ,b−1 φ(b)) = γg . Then the conditions of Lemma 5.3 hold for the two underlying identities (where x = b, y = 1), so k := g ∈ K. Hence, bk −1 ∈ Z(H) and b−1 φ(b) = k −1 φ(k). The second identity implies that bk −1 ∈ Fix(φ). Therefore, bk −1 ∈ Z(H) ∩ Fix(φ) = J so b ∈ JK as required.  The hypotheses of Theorem 6.2 are those of Theorem 5.6 with the additional assumption that Z(H) ≤ Fix(φ). Here the vertical exact sequence from Theorem 5.6 splits. Theorem 6.2 does not immediately follow from Theorem 5.6. The subgroup NK corresponds to the factor NH (K)/Z(H)K, while CK corresponds to the factor CH (K). The α(γ ,b−1 φ(b)) action of NK on CK is α(1,a)b = α(1,γφ(b) (a)) . Theorem 6.2. Let G be as in Theorem 5.6, and additionally assume Z(H) ≤ Fix(φ). We have a short exact sequence: 1 → CH (K) ⋊ NH (K) AK Inn(H) → Out0H (G) → →1 Z(H)K Inn(H) where the conditions for the index | OutH (G) : Out0H (G)| are as in Theorem 5.6. Proof. As Z(H) ≤ Fix(φ), Lemma 6.1 implies that the map χ2 from Lemma 5.4 splits. Theorem 6.2 then follows from Theorem 5.6.  Virtually embedding NH (K)/K into Out(G). Lemma 6.3 applies Lemma 6.1 to obtain conditions implying a finite-index subgroup 20 ALAN D. LOGAN of NH (K)/K embeds into Out(G). This normaliser-quotient is the basis of the framework described in Section 7 (see also the discussion after Proposition 2.1). Lemma 6.3 is fundamental to the paper [Log16]. The hypotheses of Lemma 6.3 occur when, for example, H is non-elementary hyperbolic, K EV and V is torsion-free (that is, V contains no elements of finite order). Lemma 6.3. If K E V ≤ NH (K) with V ∩ Z(H) ∩ Fix(φ) = 1 then (V ) V /K embeds into OutH (G) with index dividing |CH (K)|·|NH (K) : V |. Proof. Recall that J := Z(H) ∩ Fix(φ). To prove that V /K em(V ) beds into OutH (G), note that the map χ2 induces maps NH (K) → NH (K)/K → NH (K)/JK (the maps are the canonical maps). It is sufficient to prove that if v ∈ V \ K then vK 67→ JK under the second map. Suppose vK 7→ JK and vK 6= K, then there exists some k ∈ K such that vk ∈ J. However, vk ∈ V and V ∩ J = 1 so v = k −1 ∈ K a (V ) contradiction. Hence, V /K embeds into OutN (G). (V ) To prove that the index of V /K in OutH (G) divides |CH (K)| · |NH (K) : V |, first note that, by considering the map χ2 , the index of (V ) V /K in OutH (G) clearly divides (V ) | OutH (G) : im(χ2 )| · |NH (K) : V |. (V ) We therefore prove that | OutH (G) : im(χ2 )| divides |CH (K)|. It is routine to construct an isomorphism between P/(P ∩ Q) and P Q/Q, Q not necessarily normal in P Q. Take P := CK and Q := NK . Not(V ) ing that im (χ2 ) = NK and that CK NK = OutH (G), we have that (V ) | OutH (G) : im (χ2 ) | divides |CK |. Then |CK | divides |CH (K)| by Lemma 5.5, as required.  Describing Aut0H (G). Our description of Out0H (G) from Theorems 5.6 and 6.2 can be used to describe the full pre-image Aut0H (G) of Out0H (G) in Aut(G). However, this description is not necessarily useful. Lemma 6.4 now gives conditions which allow for a complete description of Aut0H (G). Lemma 6.4 is applied in the paper [Log17a]. Recall that NK = {b α(γb ,b−1 φ(b)) : b ∈ NH (K)}. Lemma 6.4. If AK ≤ Inn(H) and CH (K) = 1 then Out0H (G) ∼ = NH (K)/K and Aut0H (G) can be described as follows. Aut0H (G) = Inn(G) ⋊ Out0H (G) NH (K) ∼ = G⋊ K BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS 21 Proof. Note that α(γb ,a) = α(γb ,b−1 φ(b)) α(1,φ(b)−1 ba) , with φ(b)−1 ba ∈ CH (φ(K)). (V ) Then α(1,φ(b)−1 ba) = 1 as CH (K) = 1, so OutH (G) = NK . As AK ≤ Inn(H), Theorem 5.2 gives us that Out0H (G) = NK . The representatives α(γb ,b−1 φ(b)) of NK generate a subgroup of Aut(G) which contains non-trivial inner automorphisms. We therefore consider the set Φ := {ϕd ; d ∈ NH (K)}. As ϕd = α(γd ,d−1 φ(d)) γd−1 , the set Φ contains a representative for each coset of Aut0H (G)/ Inn(G). Hence, Φ Inn(G) = Aut0H (G). Then ϕd ∈ Inn(G) if and only if d ∈ K, if and only if ϕd = 1, so Φ ∩ Inn(G) = 1. Therefore, Aut0H (G) = Inn(G) ⋊ Φ. The result then follows as Φ ∼ = NH (K)/K by Proposition 2.1 while  Inn(G) ∼ = G because CH (K) = 1. 7. Tractable groups with pathological outer automorphism groups In this section we package the technical results of this paper into a framework for the construction of tractable groups with pathological outer automorphism groups. We then apply this framework to prove Theorem 1.1 from the introduction. Other applications of this framework can be found in [Log16] and [Log17a]. The framework. In the aforementioned framework the pathological properties of Out(G), where G = H∗(K,φ), are inherited from the normaliser-quotient NH (K)/K. The framework is as follows: (1) Obtain K < H such that NH (K)/K has the required properties, e.g. is a stipulated group, is non-residually finite, etc. (2) Apply Theorems 5.6 or 6.2, or Lemma 6.3 to obtain a description of OutH (G) in terms of NH (K)/K, (3) Apply Theorem 4.7 to obtain OutH (G) = Out(G), and so obtain a description of Out(G) in terms of NH (K)/K, (4) Apply Lemma 6.4 to obtain AutH (G) = Inn(G) ⋊ Out(G), and so obtain a description of Aut(G) in terms of NH (K)/K. Proof of Theorem 1.1. We now prove Theorem 1.1. Proof of Theorem 1.1. Suppose Q is finitely presented with Serre’s property FA. Now, there exist torsion-free hyperbolic groups with Serre’s property FA [Pri83], and hence there exists a torsion-free hyperbolic group H with Serre’s property FA, and with a finitely generated noncyclic normal subgroup K such that H/K ∼ = Q [BO08]. Form GQ = hH, t; k t = k, k ∈ Ki. Note that GQ is residually finite if (and only if) Q is residually finite [Log16, Proposition 2.2]. 22 ALAN D. LOGAN Firstly note that OutH (GQ ) = Out(GQ ), which follows from Theorem 4.7 because K is normal so conjugacy maximal, and because H has Serre’s property FA. Secondly, note that NH (K)/K embeds with finite index into OutH (GQ ), which follows from Theorem 5.6 because CH (K) = 1 as H is torsion-free hyperbolic and K is non-cyclic, and because Out(H) is finite as H is hyperbolic with Serre’s property FA [Lev05]. Hence, Q ∼ = H/K = NH (K)/K ≤f OutH (GQ ) = Out(GQ ) as required.  References [ALP17] F. Ateş, A. D. Logan, and S.J. Pride, Automata and Zappa-Szèp products of groups, in preparation (2017). [Bau63] G. Baumslag, Automorphism groups of residually finite groups, J. London Math. Soc. 38 (1963), 117–118. MR 0146271 [BG03] G. Braun and R. Göbel, Outer automorphisms of locally finite p-groups, J. Algebra 264 (2003), no. 1, 55–67. MR 1980685 [BJ96] H. Bass and R. Jiang, Automorphism groups of tree actions and of graphs of groups, J. Pure Appl. Algebra 112 (1996), no. 2, 109–155. MR 1402782 [BO08] I. Belegradek and D. Osin, Rips construction and Kazhdan property (T), Groups Geom. Dyn. 2 (2008), no. 1, 1–12. MR 2367206 [BT78] B. Baumslag and M. Tretkoff, Residually finite HNN extensions, Comm. Algebra 6 (1978), no. 2, 179–194. MR 484178 [BW05] I. Bumagin and D. T. Wise, Every group is an outer automorphism group of a finitely generated group, J. Pure Appl. Algebra 200 (2005), no. 1-2, 137–147. MR 2142354 [CL83] D. J. Collins and F. Levin, Automorphisms and Hopficity of certain Baumslag-Solitar groups, Arch. Math. (Basel) 40 (1983), no. 5, 385– 400. MR 707725 [DGG01] M. Droste, M. Giraudet, and R. Göbel, All groups are outer automorphism groups of simple groups, J. London Math. Soc. (2) 64 (2001), no. 3, 565–575. MR 1865550 [DGP11] F. Dahmani, V. Guirardel, and P. Przytycki, Random groups do not split, Math. Ann. 349 (2011), no. 3, 657–673. MR 2755002 [Far11] D. Farley, A proof that Thompson’s groups have infinitely many relative ends, J. Group Theory 14 (2011), no. 5, 649–656. MR 2831963 [FM06] R. Frigerio and B. Martelli, Countable groups are mapping class groups of hyperbolic 3-manifolds, Math. Res. Lett. 13 (2006), no. 5-6, 897–910. MR 2280783 [GHMR00] N. D. Gilbert, J. Howie, V. Metaftsis, and E. Raptis, Tree actions of automorphism groups, J. Group Theory 3 (2000), no. 2, 213–223. MR 1753479 [GP00] R. Göbel and A. T. Paras, Outer automorphism groups of metabelian groups, J. Pure Appl. Algebra 149 (2000), no. 3, 251–266. MR 1762767 BASS–JIANG GROUP FOR AUT.-INDUCED HNN-EXTENSIONS [Kat15] [Koj88] [Lev05] [Lev07] [Log15] [Log16] [Log17a] [Log17b] [LS77] [Mat89] [Mes72] [Min09] [Pet99] [Pri83] [Ser74] [Ser80] [Shi85] [Wat82] 23 M. Kato, Higher dimensional Thompson groups have Serre’s property FA, arXiv: 1504.06680 (2015). S. Kojima, Isometry transformations of hyperbolic 3-manifolds, Topology Appl. 29 (1988), no. 3, 297–307. MR 953960 G. Levitt, Automorphisms of hyperbolic groups and graphs of groups, Geom. Dedicata 114 (2005), 49–70. MR 2174093 , On the automorphism group of generalized Baumslag–Solitar groups, Geometry & Topology 11 (2007), no. 1, 473–515. A. D. Logan, On the outer automorphism groups of finitely generated, residually finite groups, J. Algebra 423 (2015), 890–901. MR 3283743 , On a question of Bumagin and Wise, New York J. Math. 22 (2016), 865–873. MR 3548127 , Every group is the outer automorphism group of an HNNextension of a fixed triangle group, arXiv:1709.06441 (2017). , The residual finiteness of (hyperbolic) automorphism-induced HNN-extensions, arXiv:1711.05797 (2017). R. C. Lyndon and P. E. Schupp, Combinatorial group theory, SpringerVerlag, Berlin-New York, 1977, Ergebnisse der Mathematik und ihrer Grenzgebiete, Band 89. MR 0577064 T. Matumoto, Any group is represented by an outerautomorphism group, Hiroshima Math. J. 19 (1989), no. 1, 209–219. MR 1009671 S. Meskin, Nonresidually finite one-relator groups, Trans. Amer. Math. Soc. 164 (1972), 105–114. MR 0285589 A. Minasyan, Groups with finitely many conjugacy classes and their automorphisms, Comment. Math. Helv. 84 (2009), no. 2, 259–296. MR 2495795 M. R. Pettet, The automorphism group of a graph product of groups, Comm. Algebra 27 (1999), no. 10, 4691–4708. MR 1709254 Stephen J. Pride, Some finitely presented groups of cohomological dimension two with property (FA), J. Pure Appl. Algebra 29 (1983), no. 2, 167–168. MR 707619 J.P. Serre, Amalgames et points fixes, Proceedings of the Second International Conference on the Theory of Groups (Australian Nat. Univ., Canberra, 1973), Springer, Berlin, 1974, pp. 633–640. Lecture Notes in Math., Vol. 372. MR 0376882 , Trees, Springer, 1980. M. Shirvani, On residually finite HNN-extensions, Arch. Math. (Basel) 44 (1985), no. 2, 110–115. MR 780256 Y. Watatani, Property T of Kazhdan implies property FA of Serre, Math. Japon. 27 (1982), no. 1, 97–103. MR 649023 School of Mathematics and Statistics, University of Glasgow, Glasgow, G12 8QW, UK. E-mail address: [email protected]
4math.GR
Partial Consistency with Sparse Incidental Parameters Jianqing Fan1 , Runlong Tang2 , and Xiaofeng Shi1 arXiv:1210.6950v3 [math.ST] 2 Aug 2017 1 2 Princeton University Johns Hopkins University March 14, 2018 Abstract Penalized estimation principle is fundamental to high-dimensional problems. In the literature, it has been extensively and successfully applied to various models with only structural parameters. As a contrast, in this paper, we apply this penalization principle to a linear regression model with a finite-dimensional vector of structural parameters and a high-dimensional vector of sparse incidental parameters. For the estimators of the structural parameters, we derive their consistency and asymptotic normality, which reveals an oracle property. However, the penalized estimators for the incidental parameters possess only partial selection consistency but not consistency. This is an interesting partial consistency phenomenon: the structural parameters are consistently estimated while the incidental ones cannot. For the structural parameters, also considered is an alternative two-step penalized estimator, which has fewer possible asymptotic distributions and thus is more suitable for statistical inferences. We further extend the methods and results to the case where the dimension of the structural parameter vector diverges with but slower than the sample size. A data-driven approach for selecting a penalty regularization parameter is provided. The finite-sample performance of the penalized estimators for the structural parameters is evaluated by simulations and a real data set is analyzed. Keywords: Structural Parameters, Sparse Incidental Parameters, Penalized Estimation, Partial Consistency, Oracle Property, Two-Step Estimation, Confidence Intervals 1 Introduction Since the pioneering papers by Tibshirani (1996) and Fan and Li (2001), the penalized estimation methodology for exploiting sparsity has been studied extensively. For example, Zhao and Yu (2006) 1 provides an almost necessary and sufficient condition, namely Irrepresentable Condition, for the LASSO estimator to be strong sign consistent. Fan and Lv (2011) shows that an oracle property holds for the folded concave penalized estimator with ultrahigh dimensionality. For an overview on this topic, see Fan and Lv (2010). All the aforementioned papers consider models only with the so-called structural parameters, which are related to every data point. By contrast, we consider in this paper another type of models where there are not only the structural parameters but also the so-called incidental parameters, each of which is related to only one data point. Specifically, suppose data {X i , Yi }ni=1 are from the following linear model: Yi = µ?i + X Ti β ? + i , (1.1) where the vector of incidental parameters µ? = (µ?1 , · · · , µ?n )T is sparse, the vector of structural parameters β ? = (β1? , · · · , βd? )T is of main interest, and for each i, X i is a d-dimensional covariate vector, and i is a random error. Let ν = (µ?T , β ?T )T . Then, in model (1.1), a different data point (X i , Yi ) depends on a different subset of ν, that is, µ?i and β ? . Model (1.1) arises as a working model for estimation from Fan et al. (2012b), which considers a large-scale hypothesis testing problem under arbitrary dependence of test statistics. By Principal Factor Approximation, a method proposed by Fan et al. (2012b), the dependent test statistics Z = (Z1 , · · · , Zp )T ∼ N (µ, Σ) can be decomposed as Zi = µi +bTi W +Ki , where µ = (µ1 , · · · , µp )T and bi is the ith row of the first k unstandardized principal components, denoted by B, of Σ and K = (K1 , · · · , Kp )T ∼ N (0, A) with A = Σ − BB T . The common factor W drives the dependence among the test statistics. This realized but unobserved factor is critical for False Discovery Proportion (FDP) estimation and power improvements by removing the common factor {bTi W } from the test statistics. Hence, an important goal is to estimate W with given {bi }ni=1 . In many applications on large-scale hypothesis testing, the parameters {µi }pi=1 are sparse. For example, genome-wide association studies show that the expression level of gene CCT8 is highly related to the phenotype of Down Syndrome. It is of interest to test the association between each of millions of SNP’s and the CCT8 gene expression level. In the framework of Fan et al. (2012b), each µi stands for such an association. That is, if µi = 0, the ith SNP is not associated with the CCT8 gene expression level; otherwise, it is associated. Since most of the SNP’s are not associated the CCT8 gene expression level, it is reasonable to assume {µi }pi=1 are sparse. Replacing Zi , µi , bi , W , k, p, and Ki with Yi , µ?i , X i , β ? , d, n, and i respectively, we obtain model (1.1) formally. It is of interest to study this model independently with simplifications. 2 Although model (1.1) emerges from a critical component of estimating FDP in Fan et al. (2012b), it stands with its own interest. For example, in some applications, there are only few signals (nonzero µ?i ’s) and what is interesting is to learn about β ? , which reflects the relationship between the covariates and response. For another example, those few nonzero µ?i ’s might be some measurement or recording errors of the responses {Yi }. In these cases, model (1.1) is suitable for modeling data with contaminated responses and a method producing a reliable estimator for β ? is essentially a robust replacement for ordinary least squares estimate, which is sensitive to outliers. Several models with structural and incidental parameters have first been studied in a seminal paper by Neyman and Scott (1948), which points out the inconsistency of the maximum likelihood estimators (MLE) of structural parameters in the presence of a large number of incidental parameters and provides a modified MLE. However, their method does not work for model (1.1) due to no exploration of the sparsity of incidental parameters. Kiefer and Wolfowitz (1956) shows the consistency of the MLE of the structural parameters when the incidental parameters are assumed to be from a common distribution. That is, they eliminate the essential high-dimensional issue of the incidental parameters by randomizing them. In contrast, this paper considers deterministic incidental parameters and handles the high-dimensional issue by penalization with a sparsity assumption. Basu (1977) considers the elimination of nuisance parameters via marginalizing and conditioning methods and Moreira (2009) solves the incidental parameter problem with an invariance principle. For a review of the incidental parameter problems in statistics and economics, see Lancaster (2000). Without loss of generality, suppose the first s incidental parameters {µ?i }si=1 are nonvanishing and the remaining are zero. Then, model (1.1) can be written in a matrix form as Y = Xν + , where  X= Is X T1,s 0 0 X Ts+1,n I n−s  , X Ti,j = (X i , X i+1 , · · · , X j )T , I k is a k × k identity matrix, 0 is a generic block of zeros and ν = (µ?1 , · · · , µ?s , β T , µ?s+1 , · · · , µ?n )T . Although this is a sparse high-dimensional problem, the matrix X does not satisfy the sufficient conditions of the theoretical results in Zhao and Yu (2006) and Fan and Lv (2011) due to the inconsistency of the estimation of the incidental parameters in ν and the penalty should not be simply placed on all parameters. For details, see Supplement C. 3 In this paper, we investigate a penalized estimator of (µ? , β ? ) defined by (µ̂, β̂) = argmin n X (Yi − µi − (µ,β)∈Rn+d i=1 X Ti β)2 + n X pλ (|µi |), (1.2) i=1 where pλ is a penalty function with a regularization parameter λ. Since only the incidental parameters are sparse, the penalty is imposed on them. An iterative algorithm is proposed to numerically compute the estimators. The estimator β̂ possesses consistency, asymptotic normality and an oracle property. On the other hand, the nonvanishing elements of µ? cannot be consistently estimated even if β ? were known. So, there is a partial consistency phenomenon. Penalized estimation (1.2) is a one-step method. For the estimation of β ? , We also propose a twostep method whose first step is designed to eliminate the influence of the data with large incidental parameters. The estimator β̃ from the two-step method has fewer possible asymptotic distributions than β̂ and thus is more suitable for constructing confidence regions for β ? . It is asymptotically equivalent to the one-step estimator β̂ when the sizes of the nonzero incidental parameters are small enough, that is, when the incidental parameters are really sparse. Also, the two-step method improves the convergence rate and efficiency over the one-step method for challenging situations where large nonzero incidental parameters increase the asymptotic covariance or even reduce the convergence rate for the one-step method. The rest of the paper is organized as follows. In Section 2, the model and penalized estimation method are formally introduced and the corresponding penalized estimators are characterized. In Section 3, asymptotic properties of the penalized estimators are derived; a penalized two-step estimator is proposed and its theoretical properties are obtained; we also provide a data-driven approach for selecting the regularization parameter. In Section 4, we consider the case where the number of covariates grows with but slower than the sample size. In Section 5, we present simulation results and analyze a read data set. Section 6 concludes this paper with a discussion and all the proofs and some theoretical results are relegated to the appendix and supplements. 2 Model and Method The matrix form of model (1.1) is given by Y = µ? + Xβ ? + , (2.1) where Y = (Y1 , Y2 , · · · , Yn )T , X = (X 1 , X 2 , · · · , X n )T , and  = (1 , 2 , · · · , n )T . The covariates {X i }ni=1 are independent and identically distributed (i.i.d.) copies of X 0 ∈ Rd , which is a random 4 vector with mean zero and a covariance matrix ΣX > 0. They are independent of the random errors {i }, which are i.i.d. copies of 0 , which is a random variable with mean zero and variance σ 2 > 0. Denote an  bn and an  bn if an = o(bn ) and bn = o(an ), respectively. There is an assumption on the covariates and random errors. Assumption (A): There exist positive sequences κn  √ n, γn  √ n such that P ( max kX i k2 > κn ) → 0 and P ( max |i | > γn ) → 0, as n → ∞, 1≤i≤n 1≤i≤n (2.2) where k · k2 stands for the l2 norm of Rd . Suppose there are three types of incidental parameters in model (1.1) or (2.1): for simplicity on 1 the indexes, the first s1 incidental parameters {µ?i }si=1 are large in the sense that |µ?i |  max{κn , γn } for 1 ≤ i ≤ s1 ; the next s2 ones {µ?i }si=s1 +1 are nonzero and bounded by γn with s = s1 + s2 ; the last n − s ones {µ?i }ni=s+1 are zero. Note that it is unknown to us which µ?i ’s are large, bounded or zero. The sparsity of µ? is understood by s1 + s2  n, i.e. s1 + s2 = o(n). Denote the vectors of the three types of incidental parameters µ?1 , µ?2 , and µ?3 , respectively. The penalized estimation (1.2) can be written as (µ̂, β̂) = argmin L(µ, β), L(µ, β) = kY − µ − Xβk22 + (µ,β) n X pλ (|µi |). (2.3) i=1 The penalty function pλ can be the soft (i.e. L1 or LASSO), hard, SCAD or a general folded concave penalty function (Fan and Li, 2001). For simplicity, we next consider only the soft penalty function, that is, pλ (|µi |) = 2λ|µi |. The cases with the hard and SCAD penalties can be considered in a similar way. By Lemma D.1 in Supplement D, A necessary and sufficient condition for (µ̂, β̂) to be a minimizer of L(µ, β) is that β̂ = (X T X)−1 X T (Y − µ̂), Yi − µ̂i − X Ti β̂ = λSign(µ̂i ) for i ∈ Iˆ0c and |Yi − X Ti β̂| ≤ λ for i ∈ Iˆ0 , where Sign(·) is a sign function and Iˆ0 = {1 ≤ i ≤ n : µ̂i = 0}. Numerically, the special structure of L(µ, β) suggests a marginal decent algorithm for the minimization problem in (2.3), which iteratively computes µ(k) = argmin L(µ, β (k−1) ) and β (k) = µ∈Rn argmin L(µ(k) , β) until convergence. The advantage of this algorithm is that there exist analytic β∈Rd solutions to the above two minimization problems. They are respectively the soft-threshold estimators with residuals {Yi − X Ti β (k−1) } and ordinary least-squares estimator with responses Y − µ(k) . In this section and the next, the number of the covariates d is assumed to be a fixed integer. A case where d diverging to infinity will be considered in Section 4. For the case where d is finite, we make the following assumption on λ. 5 Assumption (B): The regularization parameter λ satisfies κn  λ, αγn ≤ λ, and λ  min{µ? , √ n}, (2.4) where κn and γn are defined in (2.2), α is a constant greater than 2, and µ? = min1≤i≤s1 |µ?i |. For simplicity, abbreviate “with probability going to one” to “wpg1”. A stopping rule for the above algorithm is based on the successive difference kβ (k+1) − β (k) k2 . By Proposition D.2 in Supplement D, wpg1, the iterative algorithm stops at the the second iteration, given the initial estimator is bounded wpg1. Suppose {β (k) } has a theoretical limit β (∞) , corresponding to which, there is a limit estimator µ(∞) . Then, (µ(∞) , β (∞) ) is a solution of the following system of nonlinear equations β = (X T X)−1 X T (Y − µ), (2.5) and, with soft-threshold applied to each component, it follows µ = (|Y − X T β| − λ)+ Sign(Y − X T β), (2.6) where (·)+ returns the maximum value of the input and zero. By Lemma D.3 in Supplement D, a necessary and sufficient condition for (µ̂, β̂) to be a minimizer of L(µ, β) is that it is a solution to equations (2.5) and (2.6). Hence, (µ(∞) , β (∞) ) is a minimizer of L(µ, β) and can also be denoted as (µ̂, β̂). Note that β̂ is also the minimizer of the profiled loss function L̃(β) = L(µ(β), β), where µ(β) as a function of β is given by (2.6) . Interestingly, this profiled loss function is a criterion function equipped with the famous Huber loss function (see Huber (1964) and Huber (1973)). Pn T Specifically, the profiled loss function can be expressed as L̃(β) = i=1 ρ(Yi − X i β), where ρ(x) = x2 I(|x| ≤ λ) + (2λx − λ2 )I(|x| > λ) is exactly the Huber loss function, which is optimal in a minimax sense. This equivalence between the penalized estimation and Huber’s robust estimation indicates that the penalization principle is versatile and can naturally produce an important loss function in robust statistics. This equivalence also provides a formal endorsement of the least absolute deviation robust regression (LAD) in Fan et al. (2012b) and indicates that it is better to use all data with LAD regression rather than 90% of them. It is worthwhile to note that the penalized estimation is only formally equal to the Huber’s. Our model (2.1) considers deterministic sparse incidental parameters µ?i ’s, while the model in Huber’s works assumes random contamination as in Kiefer and Wolfowitz (1956). Recently, there appear a few papers on robust regression in 6 high-dimensional settings, see, for example, Chen et al. (2010), Lambert-Lacroix and Zwald (2011), ? and Bean et al. (2012). Portnoy and He (2000) provide a high level review of literature on robust statistics. From the equations (2.5) and (2.6), β̂ is a solution to ϕn (β) = 0, where ϕn (β) = β − (X T X)−1 X T (Y − µ(β)). (2.7) In general, this is a Z-estimation problem. The following theoretical analysis is based on this characterization of β̂. At the end of this section, we provide for further analysis some notations and an expansion of P P P P P ϕn (β). Let S = ni=1 X i X Ti , SS = i∈S X i X Ti , SµS = i∈S X i µ?i , SS = i∈S X i i , S = ni=1 X i P and SS = i∈S X i , where S is a subset of {1, 2, · · · , n}. It is straightforward to show ϕn (β) = (SS10 + SS11 + SS12 )(β − β ? ) − (SµS11 + SµS12 ) − (SS10 + SS11 + SS12 ) − λ(SS20 + SS21 + SS22 − SS30 − SS31 − SS32 ), (2.8) where the index sets S10 = {s + 1 ≤ i ≤ n : |X Ti (β ? − β) + i | ≤ λ}, S11 = {1 ≤ i ≤ s1 : |µ?i + X Ti (β ? − β) + i | ≤ λ} and S12 = {s1 + 1 ≤ i ≤ s : |µ?i + X Ti (β ? − β) + i | ≤ λ}; S20 , S21 and S22 are defined similarly except that the absolute operation is omitted and “≤” is replaced by “>”; S30 , S31 and S32 , are defined similarly with S20 , S21 and S22 except that “> λ” is replaced by “< −λ”. Note that all these index sets depend on β. 3 Asymptotic Properties In this section, we consider the asymptotic properties of the penalized estimators β̂ and µ̂. Assumption (A), together with Assumption (B), enables the penalized estimation method to distinguish the large incidental parameters from others, and thus simplifies the asymptotic properties of the index sets Sij ’s in (2.8) in the sense that they become independent of β wpg1. Denote a hypercube of β ? by BC (β ? ) = {β ∈ Rd : |βj − βj? | ≤ C, 1 ≤ j ≤ d} with a constant C > 0. Lemma 3.1 (On Index Sets Sij ’s). Under Assumptions (A) and (B), for every C > 0 and every ? , S ? ? ? β ∈ BC (β ? ), wpg1, S10 = S10 11 = ∅, S12 = S12 , S20 = ∅, S21 = S21 , S22 = ∅, S30 = ∅, S31 = S31 ? = {s + 1, s + 2, · · · , n}, S ? = {s + 1, s + 2, · · · , s}, and S32 = ∅, where the limit index sets S10 1 12 ? = {1 ≤ i ≤ s : µ? > 0} and S ? = {1 ≤ i ≤ s : µ? < 0}. S21 1 1 31 i i 7 By Lemma 3.1, wpg1, the solution β̂ to (2.7) has an analytic expression: −1 µ  ? + SS ? ) β̂ = β ? + (SS10 [SS ? + (SS10 ? + SS ? ) + λ(SS ? − SS ? )], 12 21 31 12 12 (3.1) from which, we derive asymptotic properties of β̂. Some analysis needs the following assumption. Assumption (C): There exists some constant δ > 0 such that EkX 0 k2+δ < ∞ and kµ?2 k2 /kµ?2 k2+δ 2  Ps ? 2+δ 1/(2+δ) . diverges to infinity, where kµ?2 k2+δ = i=s1 +1 |µi | The following result shows the existence of a unique consistent estimator of β ? . Theorem 3.2 (Existence and Consistency of β̂). Under Assumptions (A) and (B), if either s2 = o(n/(κn γn )) or Assumption (C) holds, then, for every fixed C > 0, wpg1, there exists a unique P estimator β̂ n ∈ BC (β ? ) such that ψn (β̂ n ) = 0 and β̂ n −→ β ? . In Theorem 3.2, there are two different kinds of sufficient conditions: on is on s2 , which is the size of bounded incidental parameters µ?2 , and the other is Assumption (C), which is about the norms of µ?2 . They come from different analysis approaches on the term SµS ? in (3.1). One does 12 not imply the other. For details, see Supplement E. Specially, if s2 = O(nα2 ) for some α2 ∈ (0, 1) and κn γn  n(1−α2 ) , then β̂ is consistent by Theorem 3.2. Next, we consider the asymptotic distributions of the consistent estimator β̂ n obtained in The? = {1 ≤ i ≤ s : µ? > 0} orem 3.2. Without loss of generality, we assume the sizes of index sets S21 1 i ? = {1 ≤ i ≤ s : µ? < 0} are asymptotically equivalent to as and (1 − a)s with a constant and S31 1 1 1 i a ∈ (0, 1). Similar to Theorem 3.2, there are two different sets of conditions on µ?2 corresponding to two different analysis approaches. Denote ∼ as the asymptotic equivalence and Dn = kµ?2 k2 . Theorem 3.3 (Asymptotic Distributions on β̂ n ). Under Assumptions (A) and (B), suppose s2  √ n/(κn γn ) holds or Assumption (C) and Dn2 /n = o(1) hold. √ d n(β̂ n − β ? ) −→ N (0, σ 2 Σ−1 X ); [main case] √ d + (2) If s1 ∼ bn/λ2 , then n(β̂ n − β ? ) −→ N (0, (b + σ 2 )Σ−1 X ), for every constant b ∈ R ; √ d (3) If s1  n/λ2 , then rn (β̂ n − β ? ) −→ N (0, Σ−1 X ), where rn ∼ n/(λ s1 ). (1) If s1  n/λ2 , then When the incidental parameters are really sparse, the size s1 of large incidental parameters is small and the size s2 or the magnitude Dn of bounded incidental parameters is also small so that the conditions of case (1) tends to hold. This case is of most interest and we denote it as the main case. The other cases are presented to provide a relatively complete picture of the asymptotic distributions 8 of β̂. In fact, Theorem E.1 in Supplement E shows more possible asymptotic distributions. Note that the constant a does not appear in the limit distributions of Theorem 3.3 due to cancelation and √ that the sub- n consistency emerges in case (3) when s1 is large, because for this case the impact of the large incidental parameters is too big to be handled efficiently by the penalized estimation. For case (2), in one direction, as b → 0, its condition and limit distribution become those of case (1); in the other direction, as b increases, it approaches case (3). This boundary phenomenon was in spirit similar to that in Tang et al. (2012). Specially, if λ  nα1 , κn γn  nα2 , s1  n1−α1 and √ d s2  n1/2−α2 , for some α1 ∈ (0, 1) and α2 ∈ (0, 1/2), then n(β̂ n − β ? ) −→ N (0, σ 2 Σ−1 X ) by the main case of Theorem 3.3. Remark 1 (An Oracle Property). Suppose an oracle tells the true µ? . Then, with the adjusted (O) responses Y −µ? , the oracle estimator of β ? is given by β̂ = (XX T )−1 X T (Y −µ? ). The limiting √ (O) distribution of n(β̂ n − β ? ) is N (0, σ 2 Σ−1 X ). Comparing this with the main case of Theorems 3.3, it follows that the penalized estimator β̂ n enjoys an oracle property. Although mainly interested in the estimation of β ? , we also obtain the soft-threshold estimator µ̂ of µ? : for each i, µ̂i = µi (β̂) = (|Yi − X Ti β̂| − λ)+ sgn(Yi − X Ti β̂). (3.2) Denote E = {µ̂i 6= 0, for i = 1, 2, · · · , s1 ; and µ̂i = 0, for i = s1 + 1, s1 + 2, · · · , n}. P Theorem 3.4 (Partial Selection Consistency on µ̂). Under Assumptions (A) and (B), if β̂ −→ β ? , then P (E) → 1. Theorem 3.4 shows that, wpg1, the indexes of µ?1 and µ?3 are estimated correctly, but those of µ?2 wrongly. We call this a partial selection consistency phenomenon. 3.1 Two-Step Estimation Theorems 3.3 shows that the penalized estimator β̂ n has multiple different limit distributions, which complicates the application of these theorems in practice. In addition, the convergence rate √ of β̂ n is less than the optimal rate n in the challenging cases where the impact of large incidental parameters is substantial. To address these issues, we propose the following two-step estimation method: firstly, we apply the penalized estimation (2.3) and let Iˆ0 = {1 ≤ i ≤ n : µ̂i = 0}; secondly, we define the two-step estimator as β̃ = (X TIˆ X Iˆ0 )−1 X TIˆ Y Iˆ0 , 0 0 9 (3.3) where X Iˆ0 consists of X i ’s whose indexes are in Iˆ0 and Y Iˆ0 consists of the corresponding Yi ’s. The following theorem shows that β̃ is consistent and Asymptotic Gaussian. Theorem 3.5 (Consistency and Asymptotic Normality on β̃). Suppose Assumptions (A) and P (B) hold. If either s2 = o(n/(κn γn )) or Assumption (C) holds, then β̃ −→ β ? . If either s2 = √ √ d o( n/(κn γn )) holds or Assumptions (C) and Dn2 /n = o(1) hold, then n(β̃−β ? ) −→ N (0, σ 2 Σ−1 X ). Comparing Theorem 3.5 with Theorem 3.3, we see that β̂ has three possible asymptotic distributions but β̃ has only one since for β̃ the conditions on s1 disappear. It is because the two-step method identifies and removes large incidental parameters by exploiting the partial selection consistency property of µ̂ in Theorem 3.4. Further, the two-step estimator improves the convergence rate to the optimal one over the one-step estimator for the challenging case with s1  n/λ2 . Because of these advantages, we suggest to use the two-step method to make statistical inferences. When the incidental parameters are sparse in the sense that the size or the magnitude of the √ bounded incidental parameters are small, i.e. s2 = o( n/(κn γn )) or Dn2 /n = o(1), it follows, √ d by Theorem 3.5, n(β̃ − β ? ) −→ N (0, σ 2 Σ−1 X ), from which a confidence region with asymptotic confidence level 1 − α is given by √ 1/2 {β ∈ Rd : σ −1 nkΣX (β̃ − β)k2 ≤ qα (χd )}, (3.4) where qα (χd ) is the upper α-quantile of χd , the square root of the chi-squared distribution with degrees of freedom d. For each component βj? of β ? , an asymptotic 1 − α confidence interval is given by −1/2 [β̃j ± n−1/2 σΣX −1/2 where ΣX (j, j)zα/2 ], (3.5) (j, j) is the square root of the (j, j) entry of Σ−1 X and zα/2 is the upper α/2-quantile of N (0, 1). The confidence region (3.4) and interval (3.5) involve unknown parameters ΣX and σ. They can be estimated by Σ̂X = (1/n)X T X and σ̂ = #(Iˆ0 )−1/2 kY Iˆ0 − X TIˆ β̃k2 . 0 (3.6) By Law of Large Numbers, Σ̂X is consistent. By lemma E.3 in Supplement, σ̂ is also consistent. Hence, after replacing ΣX and σ in the confidence region (3.4) and interval (3.5) with Σ̂X and σ̂, the resulting confidence region and interval have the asymptotic confidence level 1 − α. 10 3.2 Theoretical and Data-Driven Regularization Parameters By Assumption (B), the theoretical regularization parameter λ depends on κn and γn , which are also crucial to the boundary conditions of the asymptotic properties of the penalized estimators β̂ and β̃. By Assumption (A), κn and γn is determined by the distributions of X 0 and 0 , respectively. It is of interest to explicitly derive κn and γn for some typical cases on the covariates and errors. When √ the covariates are bounded with CX > 0 and the random errors follow N (0, σ 2 ), let κn = dCX p and γn = 2σ 2 log(n). They satisfy (2.2) in Assumption (A) and the specification of λ (2.4) in p √ Assumption (B) becomes α 2σ 2 log(n) ≤ λ  min{µ? , n}. When X 0 and 0 follow N (0, ΣX ) 2 the maximum of diagonal elements of Σ . We can take and N (0, σ 2 ), respectively. Denote by σX X q p p √ 2 log(n) and γ = 2σ 2 log(n). Then, (2.4) becomes log(n)  λ  min{µ? , n}. A κn = 2dσX n case on exponentially tailed random variables has all been considered in Supplement E.2. Although the theoretical specification of λ guaranties desired asymptotic properties, a datadriven specification is of interest in practice. A popular way to specify λ is to use multi-fold cross-validation. The validation set, however, needs to be made as little contaminated as possible. We propose the following procedure to identify a data-driven regularization parameter: Step 1: On the training and testing data sets. (OLS) 1. Apply ordinary least squares (OLS) to all the data and obtain residuals ˆi X Ti β̂ (OLS) = Yi − for each i. (OLS) 2. Identify the set of “pure” data corresponding to the npure smallest values in {|ˆ i 3. Compute the updated OLS estimator β̂ residuals (OLS,2) {ˆ i } (OLS,2) |}. with the “pure” data and obtain updated for each i. (OLS,2) 4. Identify the updated “pure” data set corresponding to the npure smallest {|ˆ i |} and label the remaining as the “contaminated” data set. 5. Randomly select a subset from the updated “pure” data set as a testing set and merge the remaining “pure” data set and the “contaminated” one into a training set. Step 2: On the range [λL , λU ] of the regularization parameter. 1. Compute the standard deviation σ̂pure of the residuals of the “pure” data set. 2. Set λL = αl σ̂pure and λU = αu σ̂pure , where αl < αu are positive constants. Step 3: On the data-driven regularization parameter. 11 1. For each grid point of λ in the interval [λL , λU ], apply a penalized method to the train2 ing set and obtain the estimator β̂ λ,train and the corresponding test error σ̂λ,test = P T 2 testing set (Yi − X i β̂ λ,train ) . 2 2. Identify the data-driven regularization parameter λopt , which minimizes σ̂λ,test among the grid points. This simple data-driven procedure can certainly be further improved. For example, In Step 1, the sub-steps 3 and 4 can be repeated more times to obtain a better “pure” data set. In Step two, the (OLS,2) range for λ can also be obtained from quantiles of {|ˆ i (OLS,2) on σ̂pure and quantiles of {|ˆ i |}. We can also hybrid quantities based |} to determine [λL , λU ]. The good performance of this data-driven regularization parameter will be demonstrated in Subsection 5.2. 4 Diverging number of structural parameters In Sections 2 and 3, we have considered model (2.1) under the assumption that the number of covariates d is a fixed integer. However, when there are a moderate or large number of covariates, it is appropriate to assume that d diverges to infinity with the sample size. In this section, we consider model (2.1) with the assumption that d → ∞ and d  n. Since the number of covariates grows orderly slower than the sample size, we chose to continue use the penalized estimation (2.3) for (µ? , β ? ) and the penalized two-step estimation (3.3) for β ? . The corresponding estimators are still denoted as (µ̂, β̂) and β̃, but we should keep it in mind that their dimensions diverge to infinity with n. The characterizations of β̂ in Lemmas D.1 and D.3 are still valid since they are finite-sample results. The iteration algorithm also wpg1 stops at the second iteration, which is shown by Proposition F.3 in Supplement F. As before, it is critical to properly specify the regularization parameter λ for the case with a diverging number of covariates. Assumption (B’) The regularization parameter λ satisfies √ dκn  λ, αγn ≤ λ, and λ  µ? , where κn and γn are defined in (2.2) and α > 2. 12 (4.1) Comparing Assumption (B’) with Assumption (B), the main difference in formation is that κn is √ changed to dκn . In fact, κn in (4.1) also depends on d, which will be shown in Supplement E.2. This difference is caused by the assumption that d diverges to ∞. Lemma 4.1 (On Index Sets Sij ’s). Under Assumptions (A) and (B’), the conclusion of Lemma 3.1 holds. Thus, wpg1, still valid is the crucial analytic expression of β̂ (3.1), from which we derive its theoretical properties. They are similar to those in the previous section, with additional technical complexity caused by the diverging dimension d. Denote k·kF,d = d−1/2 k·kF , where k·kF is the Frobenius norm, and κX = d−1 Pd 4 1/2 , j=1 (E[X0j ]) the average of the square root of the fourth marginal moments of X 0 . We make the following assumptions on ΣX and κX . Assumption (D): kΣ−1 X kF,d is bounded. Assumption (E): κX is bounded. Theorem 4.2 (Existence and Consistency on β̂). Suppose Assumptions (A), (B’), (D) and (E) hold. If there exists rd , a sequence of positive numbers depending on d, such that d3 /n → 0, √ √ (rd d)2 /n → 0, s1 = o(n/(rd dκn λ)) and s2 = o(n/(rd dκn γn )), then, for every fixed C > 0, wpg1, P there exists a unique estimator β̂ ∈ BC (β ? ) such that ψn (β̂) = 0 and rd kβ̂ − β ? k2 −→ 0. Next, we consider the asymptotic distribution on β̂. Since the dimension of β̂ diverges to infinity, following Fan and Lv (2011), it is more appropriate to study its linear maps. Let An be a q × d matrix, where q is a fixed integer, Gn = An ATn with the largest eigenvalue λmax (Gn ), and GX,n = T 2 An Σ−1 X An . Denote by λmin (ΣX ) the smallest eigenvalue of ΣX , σX,max = max1≤j≤d Var[X0j ], 2 σX,min = min1≤j≤d Var[X0j ] and γX,max = max1≤j≤d E|X0j |3 . Abbreviate “with respect to” by “wrt”. We assume further Assumption (D’): λmin (ΣX ) is bounded away from zero, which implies Assumption (D). Assumption (D”): kΣX kF,d is bounded. Assumption (F): kAn kF and λmax (Gn ) are bounded and GX,n converges to a q × q symmetric matrix GX wrt k·kF . Assumption (G): σX,max > 0; σX,max and γX,min are bounded from above and σX,min is bounded away from zero. 13 Similar to the main case of Theorem 3.3, a properly scaled β̂ n is asymptotically Gaussian. Theorem 4.3 (Asymptotic Distribution on β̂). Suppose Assumptions (A), (B’), (D’), (D”), (E), √ √ √ √ (F) and (G) hold. If d5 log d = o(n), s1 = o( n/(λ dκn )) and s2 = o( n/( dκn γn )), then √ d nAn (β̂ − β ? ) −→ N (0, σ 2 GX ). The penalized estimator µ̂ obtained by (3.2) is partially consistent. Theorem 4.4 (Partial Selection Consistency on µ̂). Suppose Assumptions (A) and (B’)hold and √ β̂ is a consistent estimator of β ? wrt rd k·k2 . If rd ≥ 1/ d, then P (E) → 1. We can construct the penalized two-step estimator β̃ through (3.3) with µ̂. This two-step estimator is consistent by Theorem F.4 in Supplement F and its asymptotic distribution, as an extension of the main case in Theorem 3.5, is given by the following theorem. Theorem 4.5 (Asymptotic Distribution on β̃). Suppose all the assumptions and conditions of The√ d orem 4.3 hold except that the condition on s1 is not required. Then nAn (β̃−β ? ) −→ N (0, σ 2 GX ). From Theorems 4.3 and 4.5, Wald-type asymptotic confidence regions of β ? are availabe. For example, a confidence region based on β̃ with asymptotic confidence level 1 − α is given by √ −1/2 {β ∈ Rd : σ −1 nkGX,n An (β̃ − β)k2 ≤ qα (χq )}. (4.2) −1 Since GX,n involves the unknown ΣX , we estimate it by ĜX,n = An Σ̂X ATn . On the other hand, σ is estimated by σ̂ in (3.6) as before. After plugging ĜX,n and σ̂ into (4.2), we obtain √ −1/2 {β ∈ Rd : σ̂ −1 nkĜX,n An (β̃ − β)k2 ≤ qα (χq )}. (4.3) By Lemma A.5 in the appendix, the consistency of σ̂ is assured. Then, Theorem A.6 in the appendix guarantees the asymptotic validity of the confidence region (4.3). 5 Numerical Evaluations and Real Data Analysis In this section, we evaluate the finite-sample performance of the penalized estimation through simulations and use it to analyze a real data set. The model for simulations is given by, for ? +  . For simplicity, the deterministic sparse i = 1, · · · , n, Yi = µ?i + Xi,1 β1? + · · · + Xi,50 β50 i incidental parameters {µ?i } are generated as i.i.d. copies of µ: µ is 0, U [−c, c] and W (c + Exp(τ )) with probabilities p0 , p1 , and p2 respectively, where U [−c, c] is a uniform random variable in [−c, c], 14 W takes values 1 and −1 with probabilities pw and 1 − pw , respectively, and Exp(τ ) follows an exponential distribution with mean 1/τ > 0. Note that c can be viewed as a contamination parameter. The larger c is, the more contaminated the data. On the other hand, pw determines ? = 1; the asymmetry of the incidental parameters. The regression coefficients β1? = · · · = β50 i.i.d. {(Xi,1 , · · · , Xi,50 )} ∼ N (0, ΣX ), where ΣX (i, j) = 2 exp(−|i − j|)), which is a Toeplitz matrix and the constant 2 is used to inflate the covariance a little; the covariates are independent of i.i.d. {i } ∼ N (0, 1); and n = 500; p0 = 0.8, p1 = 0.1, p2 = 0.1, c is 0.5, 1, 3 or 5, pw is 0.5 or 0.75 and τ = 1. 5.1 Performance of Penalized Methods The following methods for estimating β ? are evaluated. (i) Oracle method (O): an oracle knows the index set S of zero µ?i ’s. Its performance is used as a benchmark. (ii) Ordinary least squares method (OLS): all µ?i ’s are thought as zeros. (iii) Four penalized least squares (PLS) methods, namely, PLS with soft penalty (PLS.Soft or S), PLS with hard penalty (PLS.Hard or H), two-step PLS with soft penalty (PLS.Soft.TwoStep or S.TS) and two-step PLS with hard penalty (PLS.Hard.TwoStep or P P (O) H.TS). More specifically, the oracle estimator of β ? is given by β̂ = ( i∈S X i X Ti )−1 i∈S X i Yi . The hard penalty function is pλ (|t|) = λ2 −(|t|−λ)2 {|t| < λ} (see Fan and Li (2001)). Each method is evaluated by the square root of the empirical mean squared error (RMSE). Every penalized method is evaluated with a grid of values for the regularization parameter λ, ranging from .5 to 5 by .25. The sequence plot of Figure 1 shows 500 realized incidental parameters µ?i ’s with c = 3 and pw = 0.75. They are used in data generation of simulations. The scatter plot of Figure 1 shows the responses Yi ’s against the first covariate Xi1 ’s of a generated data set and the red stars stand for the contaminated sample points, the ones with nonzero µ?i ’s. With fifty covariates, usually it is difficult to graphically identify the contaminated data points. With the above incidental parameters, those six methods are evaluated by simulations with iteration number 1000. Since ΣX is a Toeplitz matrix with equal diagonal elements, the asymptotic variances of the estimators of β1? and β2? are different and representative for estimators of other βi? ’s. So, we only report simulation results on the estimation of β1? and β2? . Figure 2 shows RMSE’s of six estimators for β1? . RMSE’s for β2? are similar. As expected, the oracle method has the smallest RMSE and OLS the largest. RMSE of each PLS method as a function of λ forms a convex curve, which achieves a minimal RMSE significantly below the green line of OLS and close to the cyan line of O. More specifically, RMSE of PLS.Hard achieves the 15 Marginal Data Plot 40 Sequence Plot of Incidental Parameters ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0 ● ● −40 −5 ● ● ● ● ● ● ● ● 0 ● −20 0 mu ● ● ● 100 200 300 ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●●●●● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ● ●● ● ● ●● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●● ● ● ● ●●● ●● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ●●● ● ● ●● ● ● ● ●● ●● ●● ●● ●● ● ● ● ●● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ●● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ● ● ● ● ●●● ●● ● ● ●● ●●●● ●● ●● ● ● ● ●● ● ● ● ● ● ●● ●● ●● ● ● ●● ● ● ●● ●● ● ● ●●●●● ●● ● ● ● ● ●● ● ● ●●● ● ● ● ● ● ●● ● ● ● ● ● ●●● ● ● ●● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●●● ● ●● ● ● ● ● ●● ● ● ● ● ● ● ●●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ●● ● ● Y 5 ● ● ● 20 ● ● ● ●● ● ● ● ● ● ● ● ● ● ● 400 500 −4 −2 Index 0 2 4 X1 Figure 1: The sequence plot on the left shows 500 incidental parameters µ?i ’s with c = 3 and pw = 0.75. The non-zero µ?i ’s are in red. The scatter plot on the right shows the responses Yi ’s against the first covariate Xi1 ’s of a data set generated with those 500 incidental parameters. The red stars stand for the contaminated sample points, the ones with nonzero µ?i ’s. minimal RMSE when λ is around 2.75. On the other hand, RMSE of PLS.Soft decreases a little till λ is around .75, then increases and stays above RMSE of PLS.Hard. This reflects the fact that a large λ in a soft-threshold method usually causes bias. PLS.Hard.TwoStep has very similar performance with PLS.Hard for all λ. PLS.Soft.TwoStep has similar performance with PLS.Soft when λ is small. However, as λ becomes large, PLS.Soft.TwoStep moves closer to PLS.Hard than PLS.Soft. It is because PLS.Soft.TwoStep and PLS.Hard.TwoStep have similar estimation when λ is large. The minimal RMSE of PLS.Soft is slightly larger than those of other PLS Methods. Table 1 depicts the minimal RMSE’s of the estimators for β1? and β2? with the corresponding optimal λ’s and biases. The biases are ignorable comparing withe the RMSE’s. The optimal λ for PLS.Soft and other PLS methods are around .75 and 2.5, respectively. This indicates the simple soft threshold method tends to work best with a small λ due to the bias issue. Denote the empirical relative efficiency (ERE) of an estimator A with respect to another estimator B as RMSE(B)/RMSE(A). Then, for the estimation of β1? , the ERE’s of PLS.Soft, PLS.Hard, PLS.Soft.TwoStep and PLS.Hard.TwoStep with respect to O are around 78%, 87%, 87% and 87%, respectively; the ERE’s of the PLS methods with respect to OLS are around 176%, 196%, 196% and 196%, respectively. The ERE’s for β2? are similar. Thus, in terms of ERE (and RMSE), the PLS methods perform closely to O and significantly better than OLS. 16 RMSE's for beta1 with Deterministic Sparse Inicidental Parameters OLS ● S H S.TS H.TS 0.08 0.09 O ● ● ● 0.07 ● ● ● ● ● ● ● ● ● ● ● ● ● 0.04 0.05 ● ● 0.06 RMSE ● 1 2 3 4 5 lambda Figure 2: RMSE’s of the O(Oracle), OLS, S(PLS.Soft), H(PLS.Hard), S.TH(PLS.Soft.TwoStep) and H.TH(PLS.Hard.TwoStep) estimators of β1? with the incidental parameters shown in Figure 1. The top and bottom solid horizontal lines show the RMSE’s for OLS and O, respectively. Other four horizontal lines indicate the minimal RMSE’s for those four PLS methods and the corresponding four best λ’s are shown by the vertical lines. From Table 1, we can also see that the RMSE’s of the estimators for β1? are always smaller than those for β1? . This is because the first covariate is less correlated with others covariates than the second one. In order to examine the performance of the methods with general incidental parameters but not just those in Figure 1, we generate µ? randomly for each iteration. The iteration number for each simulation is also 1000. Figure 3 shows the RMSE’s of six estimators of β1? under two settings: pw = 0.5 and c = 1 or 5. Each plot in Figure 3 presents a similar pattern with Figure 2. When pw is fixed at 0.5, the RMSE’s of each non-oracle estimator of β1? increases as the contamination parameter c increases from 1 to 5. This indicates that each non-oracle estimator performs worse as the data becomes more contaminated. However, the PLS estimators are more robust than OLS, which is very sensitive to the change of c. We have also done simulations with pw = 0.75 and the RMSE’s of the estimators of β1? are similar to those with pw = 0.75 so that the corresponding plots are similar to those in Figure 3. In other words, the RMSE’s of all estimators are stable with respect to pw , which means 17 O OLS S H S.TS H.TS S.P H.P LAD Bias(β̂1 )×104 .8 17.8 1.3 .6 5.9 20.4 9.5 11.5 10.4 RMSE(β̂1 )×102 4.0 8.4 5.1 4.6 4.6 4.6 5.4 5.0 5.4 .75 2.75 2.25 2.5 2.45 2.47 λ Bias(β̂2 )×104 -2.3 -46.7 24.6 43.5 -21.8 10.0 32.3 13.9 -7.3 RMSE(β̂2 )×102 4.4 9.0 5.3 4.9 5.0 4.9 5.8 5.5 5.9 .75 2.75 2.75 2.5 2.45 2.47 λ Table 1: RMSE’s of the Oracle, OLS and LAD estimators and The minimal RMSE’s of the penalized estimators of β1? and β2? with the corresponding optimal or data-driven λ’s and biases when the incidental parameters shown in Figure 1 are used. For a data-driven method, the data-driven λ is different in each iteration so that the reported λ’s are averages. The lines over the numbers emphasize the numbers are averages. The standard deviations for the data-driven λ’s of S.P and H.P are 0.37 and 0.34, respectively. RMSE's for beta1 with Random Sparse Incidental Parameters c = 1 , p.w = 0.5 ● 1 ● ● ● 2 ● ● ● ● ● 3 ● ● ● 4 ● ● ● 0.08 0.06 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.04 0.06 RMSE 0.04 ● ● ● ● ● RMSE 0.08 O OLS S H S.TS H.TS ● ● c = 5 , p.w = 0.5 5 1 lambda 2 3 4 5 lambda Figure 3: Similar to Figure 2, these plots show the RMSE’s of the O(Oracle), OLS, S(PLS.Soft), H(PLS.Hard), S.TH(PLS.Soft.TwoStep) and H.TH(PLS.Hard.TwoStep) estimators of β1? with randomly generated µ? under two settings with pw = 0.5 and c = 1 or 5. 18 RMSE(βˆ1 )×102 O OLS S H S.TS H.TS S.P H.P LAD (pw , c) = (.5, .5) 4.06 4.06 3.92 3.95 3.90 3.96 4.01 4.38 4.85 1.25 3.5 2.75 2.5 2.08 2.15 4.11 4.27 4.21 4.27 4.01 4.59 2 3.75 4.25 3.5 2.20 2.24 4.81 4.99 4.81 4.80 5.64 5.19 1 2.5 2 2.25 2.42 2.45 4.96 4.63 4.66 4.64 6.36 4.87 1 2.25 2.75 3 2.52 2.58 3.91 3.88 3.98 3.91 4.08 4.41 1.5 5 3.25 4.5 2.08 2.14 4.19 4.15 4.15 4.20 4.16 4.59 3.25 3 4 3.5 2.15 2.23 4.91 4.93 4.80 5.02 5.35 5.06 1 2.25 2 2.5 2.44 2.47 5.01 4.66 4.75 4.66 6.22 4.90 1.5 2.25 2.5 3 2.55 2.60 λ (pw , c) = (.5, 1) 4.06 4.58 λ (pw , c) = (.5, 3) 4.12 6.47 λ (pw , c) = (.5, 5) 4.07 8.50 λ (pw , c) = (.75, .5) 4.13 4.02 λ (pw , c) = (.75, 1) 4.17 4.41 λ (pw , c) = (.75, 3) 4.15 5.99 λ (pw , c) = (.75, 5) λ 3.97 8.41 4.75 5.49 5.52 4.79 4.98 5.52 5.76 Table 2: Similar to Table 1, this one shows the RMSE’s and minimal RMSE’s of nine estimators of β1? under eight settings on randomly generated µ? with pw = 0.5, 0.75 and c = 0.5, 1, 3, 5. The standard deviations of the data-driven λ’s of S.P and H.P for different settings are between 0.2 and 0.45. the magnitudes of the nonzero incidental parameters matter most but not their signs. We also note that some penalized methods perform closely to or even outperform the oracle one when c is small as showed in the plot with c = 1. This happens because that O ignores all the contaminated data points, even those with very light contamination, but the penalized methods exploit information in such points. Table 2 contains the RMSE’s of the estimators of β1? under eight settings with pw = 0.5 or 0.75 and c = 0.5, 1, 3 or 5. For each pw , as c increases from 0.5 to 5, the RMSE’s of O with the multiplication factor 102 is almost constantly around 4, those of OLS increases from about 4 to 8.5 and those of PLS ones grow from about 4 to 5, which confirms the robustness of the PLS estimators. When c ≤ 1 is small with respect to the variance of random error σ = 1, the data points are only slightly contaminated. OLS and PLS methods perform similar to O. However, when c ≥ 3 is large, 19 which means the data are more contaminated, the RMSE’s of OLS become significantly larger, but PLS methods perform still closely to O. 5.2 Performance of Data-Driven Penalized Methods Previous simulations have shown the PLS methods with optimal λ’s have good RMSE’s comparing with those of the Oracle and OLS ones. In practice, however, these optimal λ’s are unknown. One approach to obtain a data driven λ has been introduced in Subsection 3.2. Since, as shown in the previous simulation results, the two-step PLS methods perform similarly with the one-step PLS methods, i.e. PLS.Soft and PLS.Hard, only the latter are studied by simulations with data-driven λ’s and denoted as PLS.Soft.Prac (S.P) and PLS.Hard.Prac (H.P), respectively. For estimating data-driven λ’s, αl = 2 and αu = 7. The size of the pure data set npure is n/2 and that of the testing data set is npure /2. Simulations are first run with the deterministic sparse incidental parameters as showed in Figure 1. We can see in Table 1 that the RMSE’s of estimators of β1? from PLS.Soft.Prac and PLS.Hard.Prac are around 5.4 and 5.0, slightly larger than the optimal values 5.1 and 4.6.,respectively. However, they are still significantly smaller than RMSE of OLS, which is 8.4. The observations of the estimators of β2? are similar. As before, we also evaluate the performance of the data-driven PLS methods with random sparse incidental parameters. Table 2 shows that, for a given pw , when c is small such as 0.5 and 1, the RMSE’s of PLS.Soft.Prac and PLS.Hard.Prac are close to those of PLS.Soft and PLS.Hard with the optimal λ’s. In these cases, PLS.Soft.Prac performs slightly better than PLS.Hard.Prac, and even better than PLS.Soft with the optimal λ and the Oracle method. On the other hand, for a given pw , when c is large such as 3 and 5, the RMSE’s of PLS.Soft.Prac and PLS.Hard.Prac are greater than those of PLS.Soft and PLS.Hard, respectively, but still less than those of OLS. In these cases, the RMSE’s of PLS.Soft.Prac are larger than those of PLS.Hard.Prac, which indicates the bias issue of the soft threshold method. Thus, the data-driven regularization parameter works well with penalized estimation. When the data is slightly contaminated, the soft penalty is preferred; otherwise, the hard penalty is recommended. Tables 1 and 2 also contain RMSE of the least absolute deviation regression method (LAD) used in Fan et al. (2012b) with all but not part of the sample points with small residuals. Generally speaking, in both deterministic and random incidental parameter cases, LAD performs similarly with the PLS methods with data-driven λ’s. More specifically, when c ≤ 1 is small, PLS.Soft.Prac outperform LAD; otherwise, LAD performs better. For all the cases, LAD is domi20 nated by PLS.Hard.Prac. These observations confirm that LAD is an effective robustness method and the penalized methods make improvement. 5.3 Data-Driven Confidence Intervals We next turn to investigate the finite-sample performance of the asymptotic confidence interval (CI) (3.5) for βj? with j = 1, 2 based on PLS two-step methods. Since CI (3.5) is based on the properties of the penalized two-step estimator with the soft penalty, we focus on PLS.TS.Soft with a data-driven regularization parameter λ. The choice of λ in Subsection 3.2 for minimizing RMSE is usually no longer suitable for constructing confidence intervals, since it is designed to achieve minimal RMSE. We propose to first obtain σ̂pure as in the data-driven procedure in Subsection 3.2 and then simply set the data-driven λ be five times of σ̂pure . Since σ̂pure tends to underestimate σ, this data-driven λ is usually not large with respect to σ. Denote this method as PLS.TwoStage.Soft.Prac or S.TS.P. −1 After plugging in σ̂ and σ̂j−1 , the square root of the (j, j)th element of Σ̂X , and replace n by m = #(Iˆ0 ) in the theoretical CI (3.5), we obtain a data-driven CI [β̃j ± m−1/2 σ̂σ̂j−1 zα/2 ], where β̃j is the PLS.TwoStage.Soft.Prac estimator of βj? for each j. This data-driven CI is compared with CI’s based on Oracle and OLS methods. More specif(O) ically, denote the Oracle and OLS estimators of βj? as β̂j (O) corresponding CI’s are given by [β̂j −1/2 (O) −1 σ̂ σ̂j zα/2 ] ± mo (OLS) and β̂j , respectively. Then, the (OLS) and [β̂j ± n−1/2 σ̂ (OLS) σ̂j−1 zα/2 ], where mo is the number of zero incidental parameters and σ̂ (O) and σ̂ (OLS) are the estimators of σ from O and OLS methods, respectively. The simulation settings are the same to the previous ones with deterministic sparse incidental parameters except the following changes. (a) The number of covariates d is reduced to 5 from 50. This is because when d = 50 and the nominal level is 95%, even the empirical coverage rate (CR) of the oracle confidence interval for β1? becomes 93.5%, not very close to 95%. (b) The iteration number is increased from 1000 to 10000 to improve the accuracy of CR’s. (c) The probabilities of nonzero incidental parameters (p1 , p2 ) are set to be (0.01, 0.01), (0.03, 0.03) and (0.05, 0.05); the contamination parameter c is increased to 10. In order to achieve good second order asymptotic approximation, we can either increase the sample size or enlarge the signal noise ratio. Here we adopt the latter. Table 3 reports the empirical coverage rates (CR) and average lengths (AL) of the CI’s of β1? and β2? from O, OLS and PLS.TS.Soft.Prac methods under three different settings on the incidental parameters. For the oracle method, these three settings are the same and thus only one set of 21 (p1 , p2 ) β1? O OLS S.TS.P .950 .944 .951 .948 (.05,.05) .946 (.01,.01) (.01,.01) (.03,,03) (.03,,03) CR AL (.05,.05) .955 .133 β2? OLS S.TS.P .948 .945 .946 .947 .945 .949 .946 .200 .135 .213 .144 .279 .137 .297 .146 .382 .139 .407 .149 CR AL O .948 .142 Table 3: Coverage rates (CR) and average length (AL) of 95% confidence intervals for β1? and β2? from O, OLS, PLS.TwoStage.Soft.Prac methods under three settings on deterministic sparse incidental parameters. simulation results are presented. Table 3 shows that the CR’s of all methods under all settings are close to the nominal level .95. The OLS treats the deterministic incidental parameters as random ones and achieves excellent CR’s. However, the AL’s of OLS are significantly larger than those of O and PLS.TS.Soft.Prac, especially when there are more non-zero incidental parameters. On the other hand, the AL’s of PLS.TS.Soft.Prac are only slightly larger than those of O. This means PLS.TS.Soft.Prac has excellent efficiency in terms of AL’s given excellent CR’s. Also note that the AL’s for β1? are less than those for β2? . This is because the asymptotic variance of β̂1 is less than that of β̂2 when the covariance matrix ΣX is a Toeplitz matrix. Simulations with random incidental parameters under the same settings have also been done and the results are similar to those in Table 3 with slightly inflated AL’s for OLS and PLS.TS.Soft.Prac due to the randomness of the incidental parameters. 5.4 Real Data Analysis We implement the penalized estimation with the soft penalty in the method of estimating false discovery proportion of a multiple testing procedure proposed by Fan et al. (2012b) for investigating the association between the expression level of gene CCT8, which is closely related to Down Syndrome phenotypes, and thousands of SNPs. The data set consists of three populations: 60 Utah residents (CEU), 45 Japanese and 45 Chinese (JPTCHB) and 60 Yoruba (YRI). More details on the data set can be found in Fan et al. (2012b). In the testing procedure by Fan et al. (2012b), a filtered least absolute deviation regression (LAD) is used to estimate the loading factors with 90% of the cases (SNPs) whose test statistics are small and thus the resulting estimator is statistically biased. We upgrade this step with S.P 22 10 ● ● ● ● ● ● ● ● ● 3.0 3.5 ● ● 2.0 2.5 3.0 ● 0.8 50 ● 0 0 2.5 ● ● ● 2.0 ● ● ● ● ● ● ● ● ● ● ● ● ● 0.4 ● ● ● ●● ● ● Estimated FDP(t) ● ● ●● ● ●●● ● ●● ●● LAD S.P ● ● 0.0 ● ● ● 30 R(t) ● ● ● ● ● ● ● ● ● 30 Estimated V(t) ● ● ● 10 50 CEU ● ● ●● ● ●● ●● ● ●● 3.5 2.0 2.5 3.0 3.5 50 ● ●● ● ● ● ● ● ● 20 ● ● ● ● 10 ● ● ● ● ● ● ●● ● ● ● ● ● ● ● ● ●● ● ● ● 0.8 ● ● ● ● ● ● ● ● 0.4 ● Estimated FDP(t) ● Estimated V(t) 30 ● ● ● 30 40 ● ● ● 40 ● ● ● ● 0.0 R(t) ●● ●● 20 ● 10 50 JPTCHB ● ● ● ● 4 5 6 7 8 ● 0 ● 9 4 5 6 7 8 9 4 5 6 7 8 9 ●● ● ● ● ● ● ● ● ●● ● 0 5 6 −log(t) 7 ● ●● ●● ●● ●● ● ● ● ● ● 8 ●● ●● ● ● ●● 4 5 6 −log(t) 7 8 ● ●● 0.8 ● ●● ● ● ● ●● ● ● ● ● ● ● ● ● ● ● ●● ● ● ● ● ● 0.4 80 100 60 ● ● ● ●● ● ● 4 Estimated FDP(t) ● ● ● ● ●● ●● ● ● ● ● ● ● ● ● ● ●●● ● ●● ● ● ● ●● ● ● ●● ● ● ●● ● ●● ● ● ● ● ● ● ● ● 0.0 ● ● ● ● ● ● ● ● 40 Estimated V(t) ● ● ● ●● ● ● ● ● ● ● 0 40 60 ● ●● ● ● ●● ● ● ● ●● ● 20 ● ● 20 R(t) 80 100 YRI ●● ● ● ● ●● ●● ● ●● 4 5 6 7 8 −log(t) Figure 4: Discovery number R(t), estimated false discovery number V (t) and estimated false discovery proportion FDP(t) as functions of a threshold on t for populations CEU, JTPCHB and YRI. The x-axis is − log10 (t). 23 Population t R(t) [ FDP(t) with LAD [ FDP(t) with S.P CEU 6.12 × 10−4 4 .810 .845 JPTCHB 1.51 × 10−9 5 .153 .373 YRI 2.54 × 10−9 2 .227 .308 ˆ Table 4: Discovery numbers R(t) and estimated false discover proportions FDP(t)s from methods with LAD and S.P for specific values of threshold t. described in Subsections 3.2 and 5.2 and re-estimate the number of false discoveries V (t) and the false discovery proportion FDP(t) as functions of − log10 (t), where t is a thresholding value. Figure [ 4 shows the number of total discoveries R(t), V̂ (t) and FDP(t) from procedures using filtered LAD [ and S.P. It is clear that V̂ (t) and FDP(t) with S.P are uniformly larger than but reasonably close [ to those with filtered LAD. Table 4 contains R(t) and FDP(t) with filtered LAD and S.P for several specific thresholds. The estimated FDPs with S.P for CEU and YRI are slightly larger than those [ for JPTCHB with S.P is more than double of that with filtered LAD. This with LAD and FDP suggests that the estimation of FDP with filtered LAD might tend to be optimistic. 6 Conclusion and Discussion This paper considers the estimation of structural parameters with a finite or diverging number of covariates in a linear regression model with the presence of high-dimensional sparse incidental parameters. By exploiting the sparsity, we propose an estimation method penalizing the incidental parameters. The penalized estimator of the structural parameters is consistent and asymptotically Gaussian and achieves an oracle property. On the contrary, the penalized estimator of the incidental parameters possesses only partial selection consistency but not consistency. Thus, the structural parameters are consistently estimated while the incidental parameters not, which presents a partial consistency phenomenon. Further, in order to construct better confidence regions for the structural parameters, we propose a two-step estimator, which has fewer possible asymptotic distributions and can be asymptotically even more efficient than the one-step penalized estimator when the size and magnitude of nonzero incidental parameters are substantially large. Simulation results show that the penalized methods with best regularization parameters achieve significantly smaller mean square errors than the ordinary least squares method which ignores the incidental parameters. Also provided is a data-driven regularization parameter, with which the 24 penalized estimators continue to significantly outperform ordinary least squares when the incidental parameters are too large to be neglected. In terms of average length together with excellent coverage rates, the advantage of the confidence intervals based on the two-step estimator with an alternative data-driven regularization parameter is verified by simulations. A data set on genomewide association is analyzed with a multiple testing procedure equipped with a data-driven penalized method and false discovery proportions are estimated. In econometrics, a fixed effect panel data model is given by, for 1 ≤ i ≤ n and 1 ≤ t ≤ T , Yit = µ?i + X Tit β ? + it , (6.1) where µ?i ’s are unknown fixed effects. When T diverges, the fixed effects can be consistently estimated. When T is finite and greater than or equal to 2, although the fixed effects can no longer be consistently estimated, they can be removed by a within-group transformation: for each i, Yit − Ȳi = (X it − X̄ i )T β ? + it − ¯i , where Ȳi , X̄ i and ¯i are the averages of Yit ’s, X it ’s and it ’s, respectively. When T is equal to 1, however, the within-group transformation fails. Note that, with T = 1, Model (6.1) becomes Model (1.1) so that the proposed penalized estimations provide a solution under the sparsity assumption on the fixed effects. Although this paper only illustrates the partial consistency phenomenon of a penalized estimation method for a linear regression model, such a phenomenon shall universally exist for a general parametric model, which contains both a structural parameter and a high-dimensional sparse incidental parameter. For example, consider a panel data logistic regression model: P (Yit = 1|X it ) = (1 + exp{−(µ?i + X Tit β ? )})−1 . When T is finite, the fixed effects µ?i ’s cannot be removed by the within-group transformation as in the panel data linear model (6.1). However, the proposed penalized estimations can still provide a solution. Further, if the structural parameter has a dimension diverging faster than the sample size and is sparse, it is expected that the partial consistency phenomenon will continue to appear when sparsity penalty is imposed on both the structural and incidental parameters. Acknowledgement The authors thank the Editor, an associate editor, and three referees for their many helpful comments that have resulted in significant improvements in the article. The research was partially supported by NSF grants DMS-1206464 and DMS-0704337 and NIH Grants R01-GM100474-01 and R01-GM072611-08. 25 A Appendix In this appendix, we provide the proofs of the theoretical results in Section 4. The proofs of the results in Sections 2 and 3 are in Supplements D and E. Denote Sk,l = S{k,k+1,··· ,l} and Sk,l = S{k,k+1,··· ,l} . Let B = {maxs+1≤i≤n kX i k2 ≤ κn } and T D = ni=1 {−γn ≤ i ≤ γn }. Then P (B) → 1 and P (D) → 1 by (2.2). Proof of Lemma 4.1. We first consider Si0 ’s, then Si1 ’s, and finally Si2 ’s with i = 1, 2, 3. Consider ? }. Note that P (A) ≥ P (A|B)P (B) and P (B) → 1. It S10 , S20 and S30 . Let A = {S10 = S10 √ suffices to show that P (A|B) → 1. By λ  dκn , it follows P (A|B) ≥ P ({s + 1 ≤ i ≤ n : √ √ ? |B) ≥ P ({s + 1 ≤ i ≤ −λ + maxs+1≤i≤n kX i k2 dC ≤ i ≤ λ − maxs+1≤i≤n kX i k2 dC} ⊃ S10 √ √ ? ? ) ≥ P (D) → 1. Thus, wpg1, S n : −λ + κn dC ≤ i ≤ λ − κn dC} ⊃ S10 10 = S10 . From ? , it follows that, wpg1, S S10 ∪ S20 ∪ S30 = S10 20 = S30 = ∅. Consider S21 , S31 and S11 . Recall √ that µ? = min{|µ?i | : 1 ≤ i ≤ s1 } and note that λ − µ? + dCκn < −γn when n is large. Let ? and S ?c ? S211 = S21 S21 212 = S21 S21 . We will show P (S211 = S21 ) → 1 and P (S212 = ∅) → 1. ? ) → 1. Denote A = {S ? Then P (S21 = S21 1 211 ⊃ S21 }. On the event B, S211 ⊃ {1 ≤ i ≤ s1 : √ i > λ − µ? + dCκn and µ?i > 0} ⊃ {1 ≤ i ≤ s1 : i > −γn and µ?i > 0}. Then, P (A1 ) ≥ ? )P (B) → 1 · 1 = 1. It follows that, P (A1 |B)P (B) ≥ P ({1 ≤ i ≤ s1 : i > −γn and µ?i > 0} ⊃ S21 ? . Note that S ? ? wpg1, S211 ⊃ S21 211 ⊂ S21 . Then, wpg1, S211 = S21 . Denote A2 = {S212 = ∅}. √ On the event B, S212 ⊂ {1 ≤ i ≤ s1 : i > λ + µ? − dCκn and µ?i < 0}, which contains {1 ≤ i ≤ s1 : i > γn }. Then, P (A2 ) ≥ P (A2 |B)P (B) ≥ P ({1 ≤ i ≤ s1 : i > γn } = ∅)P (B) →= 1. ? ) → 1. Similarly, we can show, wpg1, S ? Then, wpg1, S212 = ∅. Thus, P (S21 = S21 31 = S31 . ? ∪ S ? . Then, wpg1, S Note that S11 , S21 and S31 are disjoint and their union is S21 11 = ∅. 31 √ ? }. Note that −λ − µ? + dCκ < −γ and Consider S12 , S22 and S32 . Denote A = {S12 = S12 n n i √ λ − µ?i − dCκn > γn when n is large for s1 + 1 ≤ i ≤ s. On the event B, S12 ⊃ {s1 + 1 ≤ i ≤ √ √ s : −λ − µ?i + dCκn ≤ i ≤ λ − µ?i − dCκn }, which contains {s1 + 1 ≤ i ≤ s : −γn ≤ i ≤ γn }. ? )P (B) → 1. Thus, Then, P (A) ≥ P (A|B)P (B) ≥ P ({s1 + 1 ≤ i ≤ s : −γn ≤ i ≤ γn } = S12 ? . Note that S , S ? wpg1, S12 = S12 12 22 and S32 are disjoint and their union is S12 . Then, wpg1, S22 = S32 = ∅. 2 = (1/d) Before proceeding to the proofs of Theorems 4.2 to A.6, we denote σ̄X P P 2 and σ̄XX = (1/d2 ) dk=1 dl=1 Var[X0k X0l ] and make the following assumptions. 2 is bounded. Assumption (E1): σ̄X 26 Pd j=1 Var[X0j ] 2 Assumption (E2): σ̄XX is bounded. Assumption (E) in Section 4 implies Assumptions (E1) and (E2) by Cauchy-Schwarz inequality. For simplicity, we adopt the notation ., which means the left hand side is bounded by a constant times the right, where the constant does not affect related analysis. Below are three lemmas needed for proving Theorems 4.2 to A.6. Their proofs are in Supplement F. Suppose that M and E are matrices and k·k is a matrix norm and that {An } is a sequence of random d × d matrices and A a deterministic d × d matrix, and denote Σ̂n = (1/n)Sn , the sample covariance matrix. Lemma A.1 (Stewart (1969)). If kIk = 1 and kM −1 kkEk < 1, then Lemma A.2. If kA−1 kF,d k(M + E)−1 − M −1 k kM −1 kkEk ≤ . kM −1 k 1 − kM −1 kkEk √ P P −1 is bounded, An −→ A, and rd ≥ 1/ d, then A−1 n −→ A , where the convergence in probability is wrt rd k·kF . P Lemma A.3. If Assumption (E2) holds and rd2 d4 /n → 0, then Σ̂n −→ ΣX wrt rd k·kF . Proof of Theorem 4.2. By the proof of Lemma 4.1, wpg1, the solution β̂ n to ϕn (β) = 0 on BC (β ? ) is explicitly given by β̂ n = β ? + T0−1 (T1 + T2 + T3 − T4 ), where T0 = (1/n)Ss1 +1,n , ? ? and T4 = (λ/n)SS ? . Then, rd kβ̂ − β k2 ≤ T1 = (1/n)SµS ? , T2 = (1/n)Ss1 +1,n , T3 = (λ/n)SS21 n 31 12 √ P kT0−1 kF,d 4i=1 rd dkTi k2 . We will show that kT0−1 kF,d is bounded by a positive constant wpg1 √ P and rd dkTi k2 −→ 0 for i = 1, 2, 3, 4. Then, rd kβ̂ n − β ? k2 = oP (1). Consider T0 . By Lemma P A.3, kT0 − ΣX kF,d −→ 0 under Assumption (E2) and the condition d3 /n → 0. Then, by Lemma P −1 A.2, together with Assumption (D), kT0−1 − Σ−1 X kF,d −→ 0. This implies that, wpg1, kT0 kF,d is √ √ bounded by a positive constant. Consider T1 . Wpg1, rd dkT1 k2 ≤ rd ds2 κn γn /n = o(1) for s2 = √ P o(n/(rd dκn γn )). Consider T2 . For any δ > 0, P (kT2 k2 > δ) ≤ (1/δ 2 )P k(1/n) ni=s1 +1 X i i k22 ≤ √ Pd 2 /(nδ 2 ), where σ̄ 2 = (1/d) 2 2 2 2 2 2 dσ 2 σ̄X j=1 σj . Thus, P (rd dkT2 k2 > δ) ≤ rd d σ σ̄X /(nδ ) → 0 by AsX √ √ sumption (E1) and (rd d)2 /n → 0. Consider T3 and T4 . Wpg1, rd dkT3 k2 ≤ rd dλs1 κn /n = o(1) √ √ for s1 = o(n/(rd dλκn )). Similarly, rd dkT4 k2 = oP (1). The next lemma is needed for proving Theorem 4.3 and its proof is in Supplement F. Suppose 2 {ξ i } are i.i.d. copies of ξ 0 , a d-dimensional random vector with mean zero. Denote σξ,max = 2 max1≤j≤d Var[ξ0j ], σξ,min = min1≤j≤d Var[ξ0j ] and γξ,max = max1≤j≤d E|ξ0j |3 . Lemma A.4. Suppose σξ,max and γξ,max are bounded from above and σξ,max is bounded from zero. √ √ √ P If d = o( n), then (1/ n) ni=1 ξ i = OP ( d log d) wrt k·k2 . 27 Proof of Theorem 4.3. We reuse the notations Ti ’s in the proof of Theorems 4.2, from which, √ √ nAn (β̂ n − β ? ) = V1 + V2 + V3 − V4 , where Vi = B n Ti for i = 1, 2, 3, 4 and B n = nAn T0−1 . d It is sufficient to show that V2 −→ N (0, σ 2 GX ) and other Vi ’s are oP (1). Consider V1 . We √ have kV1 k2 ≤ ndkAn kF kT0−1 kF,d kT1 k2 . By Assumption (F), kAn kF is bounded. By Lemmas A.2 and A.3 and Assumption (D), for d = o(n1/3 ), wpg1, kT0−1 kF,d is bounded. We have, wpg1, p √ √ kT1 k2 ≤ s2 κn γn /n. Then, kV1 k2 . d/ns2 κn γn , Thus, kV1 k2 = oP (1) for s2 = o( n/( dκn γn )). √ √ nAn (T0−1 − Σ−1 Consider V2 . We have V2 = V21 + V22 , where V21 = nAn Σ−1 X T2 and V22 = X )T2 . p Pn √ First, note that V21 = (n − s1 )/n i=s1 +1 Z n,i , where Z n,i = (1/ n − s1 )An Σ−1 X X i i . On one Pn hand, for every δ > 0, i=s1 +1 EkZ n,i k22 {kZ n,i k2 > δ} ≤ (n − s1 )EkZ n,0 k42 /δ 2 , and EkZ n,0 k42 = 2 −1 T 1 2 E40 E(X T0 Σ−1 X An An ΣX X 0 ) , (n−s1 )2 −2 d 4 2 which is ≤ (n−s 2 E0 λmax (Gn )λmin (ΣX )κX . Then, by As1) P √ sumptions (D’), (E) and (F) and for d = o( n), ni=s1 +1 EkZ n,i k22 {kZ n,i k2 > δ} → 0. On the other P T 2 hand, ni=s1 +1 Cov(Z n,i ) = σ 2 An Σ−1 X An → σ GX by Assumption (F). Thus, by central limit thed orem (see Proposition 2.27 in van der Vaart (1998)), V21 −→ N (0, σ 2 GX ). Next, consider V22 . Note −1/2 k√nT k . By Assumption (F), kA k that kV22 k2 ≤ kAn kF (d log(d))1/2 kT0−1 −Σ−1 2 2 n F X kF (d log(d)) 5 is O(1); by Lemmas A.2 and A.3, (d log(d))1/2 kT0−1 −Σ−1 X kF is oP (1) for d log(d) = o(n); by Lemma √ √ P A.4, (d log(d))−1/2 k nT2 k2 = (d log(d))−1/2 k √1n Ss1 +1,n k2 is OP (1) for d = o( n). Then, V22 −→ 0. d Thus, by slutsky’s lemma, V2 −→ N (0, σ 2 GX ). Consider V3 and V4 . First consider V3 . By noting √ √ √ √ √ that s1 = o( n/(λ dκn )), wpg1, kV3 k2 ≤ ndkAn kF kT0−1 kF,d kT3 k2 . dλs1 κn / n → 0. Thus, kV3 k2 = oP (1). In the same way, kV4 k2 = oP (1). T1 Proof of Theorem 4.4. By the definition of E, we have P (E) = T1 T2 T3 , where T1 = P ( si=1 {|µ?i + T T X Ti (β ? −β̂)+i | > λ}), T2 = P ( si=s1 +1 {|µ?i +X Ti (β ? −β̂)+i | ≤ λ}) and T3 = P ( ni=s+1 {|X Ti (β ? − β̂) + i | ≤ λ}). We will show that each Ti converges to one. Then, P (E) → 1. Denote C = {rd kβ̂ − β ? k2 ≤ 1}. Then P (C) → 1 since β̂ is a consistent estimator of β ? wrt rd k·k2 . Consider S T1 . We have 1 − T1 ≤ T11 + T12 , where T11 = P ( i∈S ? {|µ?i + X Ti (β ? − β̂) + i | ≤ λ}) and 21 S T12 = P ( i∈S ? {|µ?i +X Ti (β ? − β̂)+i | ≤ λ}). It is sufficient to show that both T11 and T12 converge √31 S to zero. By dκn  λ  µ? , T11 ≤ P ( i∈S ? {i ≤ λ − µ? + kX i k2 · kβ̂ − β ? k2 }, C) + P (C c ), which 21 √ S ? c is ≤ P ( i∈S ? {i ≤ λ − µ + dκn }) + P (C ) ≤ s1 P {0 ≤ −γn } + P (C c ) −→ 0. Similarly, T12 → 0. 21 √ T Thus T1 → 1. Consider T2 and T3 . By αγn ≤ λ and dκn  λ, T2 ≥ P ( si=s1 {−λ−µ?i +(1/rd )κn ≤ √ √ T i ≤ λ − µ?i − (1/rd )κn }, C), which is ≥ P ( si=s1 {−λ − µ?i + dκn ≤ i ≤ λ − µ?i − dκn }, C) ≥ T P ( si=s1 {−γn ≤ i ≤ γn }, C) → 1. Then T2 → 1. Similarly, T3 → 1. Proof of Theorem 4.5. Note that √ 1/2 nAn ΣX (β̃ − β ? ) = R̃1 + R̃2 + V1 + V2 , where R̃1 = 28 √ nAn R1 , R̃2 = √ nAn R2 , R1 = (X TIˆ X Iˆ0 )−1 X TIˆ Y Iˆ0 {Iˆ0 6= I0 }, R2 = −(X TI0 X I0 )−1 X TI0 Y I0 {Iˆ0 6= I0 }, 0 0 and Vi ’s are defined in the proof of Theorem 4.3. Since P (kR̃1 k2 = 0) ≥ P {Iˆ0 = I0 } → 1, we have R̃1 = oP (1). Similarly, R̃2 = oP (1). By the proof of Theorem 4.3, V1 = oP (1) and d V2 −→ N (0, σ 2 GX ). Therefore, the desired result follows by Slutsky’s lemma. Lemma A.5 (Consistency on σ̂). Suppose the assumptions and conditions of Theorem 4.2 hold √ P with rd ≥ d. If s2 = o(n/γn2 ), then σ̂ −→ σ. √ Proof of Lemma A.5. Since the assumptions and conditions of Theorem 4.2 hold with rd ≥ d, √ the penalized estimators β̂ and β̃ are consistent estimators of β ? wrt dk·k2 by Theorems 4.2 and F.4 in Supplement F. Let A = {Iˆ0 = I0 }. Then A occurs wpg1 by Theorem 4.4. Note that σ̂ 2 = T A + σ̂ 2 Ac , where T = (n − s1 )−1 kY I0 − X TI0 β̃k22 . It suffices to show that Pn P6 P ? T 2 −1 T −→ σ 2 . Note that T = i=s1 +1 [X i (β − β̃)] , T2 = (n − i=1 Ti , where T1 = (n − s1 ) P P P s1 )−1 ni=s1 +1 2i , T3 = 2(n − s1 )−1 ni=s1 +1 X Ti (β ? − β̃)i , T4 = (n − s1 )−1 si=s1 +1 µ?2 i , T5 = 2(n − P P P s1 )−1 si=s1 +1 µi X Ti (β ? − β̃) and T6 = 2(n−s1 )−1 si=s1 +1 µ?i i . It is clear that T2 −→ σ 2 . Thus, it √ is sufficient to show other Ti ’s are oP (1). For every η > 0, wpg1, dkβ ? − β̃k2 ≤ η. By Assumption √ T 2 1 Pn 2 . η 2 . For every dkβ ? − β̃k2 )2 ≤ 2η 2 d1 EkX T0 k22 = 2η 2 σ̄X (E1), wpg1, |T1 | ≤ d1 n−s kX k ( i 2 i=s +1 1 1 √ T 1 Pn kX  k η > 0, wpg1, |T3 | ≤ 2 √1d n−s dkβ ? − β̃k2 ≤ 4η √1d EkX T0 0 k2 = 4σησ̄X . η. For i 2 i i=s +1 1 1 √ √ 1 s γ κ dkβ ? − s2 = o(n/γn2 ), |T4 | ≤ (n − s1 )−1 s2 γn2 → 0. For s2 = o( dn/(γn κn )), |T5 | ≤ 2 √1d n−s 2 n n 1 P 1 1 β̃k2 ≤ 2η √1d n−s s2 γn κn −→ 0. For s2 = o(n/γn ), wpg1, |T6 | ≤ 4 n−s γn s2 E|0 | → 0. 1 1 Theorem A.6 (Asymptotic Distributions on β̂ and β̃ with ĜX,n ). Under the assumptions and √ −1/2 d conditions of Theorem 4.3, if d8 (log(d))2 = o(n), then nĜX,n An (β̂ − β ? ) −→ N (0, σ 2 I q ). Similarly, under the assumptions and conditions of Theorem 4.5, If d8 (log(d))2 = o(n), then √ −1/2 d nĜX,n An (β̃ − β ? ) −→ N (0, σ 2 I q ). −1/2 Note that a stronger requirement on d is required to handle ĜX,n in Theorem A.6.. Below is a lemma needed for proving Theorem A.6. Lemma A.7 (Wihler (2009)). Suppose A and B are m × m symmetric positive-semidefinite matrices. Then, for p > 1, kA1/p − B 1/p kpF ≤ m(p−1)/2 kA − BkF . Specifically, for p = 2, kA1/2 − B 1/2 kF ≤ (m1/2 kA − BkF )1/2 . Proof of Theorem A.6. We only show the result on β̂. since the result on β̃ can be obtained in a sim√ −1/2 ilar way. We reuse the notations Ti ’s in the proof of Theorems 4.2, from which, nĜX,n An (β̂ n − √ −1/2 √ −1/2 −1/2 β ? ) = M + R, where M = nGX,n An (β̂ n − β ? ) and R = n(ĜX,n − GX,n )An (β̂ n − β ? ). By 29 d P Theorem 4.3, M −→ N (0, σ 2 GX ). Then, it is sufficient to show that R −→ 0 wrt k·k2 . We have √ −1/2 −1/2 R = R1 + R2 + R3 − R4 , where Ri = B n Ti for i = 1, 2, 3, 4 and B n = n(ĜX,n − GX,n )An T0−1 . We will show each Ri converges to zero in probability, which finishes the proof. Before that, −1/2 −1/2 −1/2 −1/2 we first establish an inequality for kĜX,n − GX,n kF . By Lemma A.7, kĜX,n − GX,n kF ≤ −1 √ P 1/2 . Note that, by Lemma A.3, kΣ̂ − Σ k −→ ( qkĜX,n − G−1 0 for d4 = o(n). Then, by n X F X,n kF ) −1 P 2 Lemma A.2, kĜX,n − GX,n kF ≤ kAn k2F kΣ̂n − Σ−1 X kF . kAn kF kΣ̂n − ΣX kF −→ 0. Thus, by −1 2 Lemma A.2, kĜX,n − G−1 X,n kF . kĜX,n − GX,n kF . kAn kF kΣ̂n − ΣX kF . Since q is a fixed in−1/2 √ −1/2 teger, it follows kĜX,n − GX,n kF . kAn kF ( qkΣ̂n − ΣX kF )1/2 . kAn kF (kΣ̂n − ΣX kF )1/2 . √ √ −1/2 −1/2 Consider R1 . Note that kR1 k2 ≤ n dkĜX,n − GX,n kF kAn kF kT0−1 kF,d kT1 k2 , which is . √ n(dkΣ̂n − ΣX kF )1/2 kAn k2F kT0−1 kF,d kT1 k2 . By Lemmas A.2 and A.3, dkΣ̂n − ΣX kF = oP (1) for d6 = o(n). By Assumption (F), kAn kF is bounded. By Lemmas A.2 and A.3 and Assumption (D), for d = o(n1/3 ), wpg1, kT0−1 kF,d is bounded. Also note that, wpg1, kT1 k2 ≤ √ √ s2 κn γn /n. Then, kR1 k2 . s2 κn γn / n. Thus, kR1 k2 = oP (1) for s2 = o( n/(κn γn )). Consider √ −1/2 −1/2 R2 . Note that kR2 k2 ≤ kĜX,n − GX,n kF kAn kF kT0−1 kF k nT2 k2 , which is . (d2 log(d)kΣ̂n − √ ΣX kF )1/2 kAn k2F kT0−1 kF,d (d log(d))−1/2 k nT2 k2 . By Lemmas A.2 and A.3, d2 log(d)kΣ̂n −ΣX kF is oP (1) for d8 (log(d))2 = o(n). By Assumption (F), kAn kF is O(1). By Lemmas A.2 and A.3 and As√ sumption (D), for d = o(n1/3 ), wpg1, kT0−1 kF,d is bounded. By Lemma A.4, (d log(d))−1/2 k nT2 k2 = √ P (d log(d))−1/2 k √1n Ss1 +1,n k2 is OP (1) for d = o( n). Thus, R2 −→ 0. Consider R3 and R4 . √ √ −1/2 −1/2 By s1 = o( n/(λκn )), wpg1, kR3 k2 ≤ nkĜX,n − GX,n kF kAn kF kT0−1 kF kT3 k2 , which is . √ √ n(dkΣ̂n − ΣX kF )1/2 kAn k2F kT0−1 kF,d kT3 k2 . λs1 κn / n → 0. Thus, kR3 k2 = oP (1). In the same way, kR4 k2 = oP (1). B Supplementary Materials Additional materials for Sections 1 to 4 can be found in the file of supplementary materials. References Debabrata Basu. On the elimination of nuisance parameters. Journal of the American Statistical Association, 72:355–366, 1977. Derek Bean, Peter Bickel, Noureddine El Karoui, Chinghway Lim, and Bin Yu. Penalized robust regression in high-dimension. 2012. 30 Louis H.Y. Chen, Larry Goldstein, and Qi-Man Shao. Normal Approximation by Stein’s Method. Springer-Verlag, 2010. Jianqing Fan and Runze Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456):1348–1360, Dec 2001. ISSN 0162-1459. Jianqing Fan and Jinchi Lv. A selective overview of variable selection in high dimensional feature space. Statistica Sinica, 20:101–148, 2010. Jianqing Fan and Heng Peng. On non-concave penalized likelihood with diverging number of parameters. The Annals of Statistics, 32:928–961, 2004. Jianqing Fan, Yuan Liao, and Martina Mincheva. High dimensional covariance matrix estimation in approximate factor models. 2011. Jianqing Fan, Yingying Fan, and Emre Barut. Adaptive robust variable selection. 2012a. Jianqing Fan, Yang Feng, and Xin Tong. A road to classification in high dimensional space: the regularized optimal affine discriminant. Journal of the Royal Statistical Society Series B, 2012b. Peter J. Huber. Robust estimation of a location parameter. The Annals of Mathematical Statistics, 35:73–101, 1964. Peter J. Huber. Robust regression: Asymptotics, conjectures and monte carlo. The Annals of Statistics, 1:799–821, 1973. Johannes Jahn. Introduction to the Theory of Nonlinear Optimization. Springer Berlin Heidelberg, 2007. J. Kiefer and J. Wolfowitz. Consistency of the maximum likelihood estimator in the presence of infinitely many incidental parameters. The Annals of Mathematical Statistics, 27:887–906, 1956. Michael R. Kosorok. Bootstrapping the grenander estimator. In Beyond Parametrics in Interdisciplinary Research: Festschrift in Honor of Professor Pranab K. Sen, pages 282–292. Institute of Mathematical Statistics: Hayward, CA., 2008. S. Lambert-Lacroix and L. Zwald. Robust regression through the huber’s criterion and adaptive lasso penalty. Electronic Journal of Statistics, 5:1015–1053, 2011. ISSN 1935-7524. 31 Tony Lancaster. The incidental parameter problem since 1948. Journal of Econometrics, 95: 391–413, 2000. Marcelo J. Moreira. A maximum likelihood method for the incidental parameter problem. The Annals of Statistics, 37(6A):3660–3696, 2009. ISSN 0090-5364. Jerzy Neyman and Elizabeth L. Scott. Consistent estimates based on partially consistent observations. Econometrica, 16:1–32, 1948. Stephen Portnoy and Xuming He. A robust journey in the new millennium. Journal of the American Statistical Association, 95:1331–1335, 2000. Albert N. Shiryaev. Probability. Springer-Verlag, second edition, 1995. G. W. Stewart. On the continuity of the generalized inverse. SIAM Journal on Applied Mathematics, 17:33–45, 1969. Runlong Tang, Moulinath Banerjee, and Michael R. Kosorok. Likelihood based inference for current status data on a grid: A boundary phenomenon and an adaptive inference procedure. The Annals of Statistics, 40(1):45–72, 2012. Robert Tibshirani. Regression shrinkage and selection via the lasso. J. Royal. Statist. Soc B, 58: 267–288, 1996. Aad W. van der Vaart. Asymptotic Statistics. Cambridge University Press, 1998. Aad W. van der Vaart and Jon A. Wellner. Weak Convergence and Empirical Processes. Springer, 1996. Thomas P. Wihler. On the holder continuity of matrix functions for normal matrices. Journal of inequalities in pure and applied mathematics, 10, 2009. Peng Zhao and Bin Yu. On model selection consistency of lasso. The Journal of Machine Learning Research, 7(Nov):2541–2563, 2006. 32 Supplementary Materials for Paper: “Partial Consistency with Sparse Incidental Parameters” by Jianqing Fan, Runlong Tang and Xiaofeng Shi C Supplement for Section 1 In this supplement, we first show the method proposed by Neyman and Scott (1948) does not work for model (1.1) and then explain which assumptions or conditions for the consistent results of the penalized methods in Zhao and Yu (2006), Fan and Peng (2004) and Fan and Lv (2011) are not satisfied for model (1.1). Although the modified equations of maximum likelihood method proposed by Neyman and Scott (1948) could handle “a number of important cases” with incidental parameters, unfortunately, it does not work for model (1.1). More specifically, consider the simplest case of model (1.1) with d = 1: Yi = µ?i + Xi β ? + i , for i = 1, 2, · · · , n, where {i } are i.i.d. copies of N (0, σ 2 ). Using the notations of Neyman and Scott (1948), the √ likelihood function for (Xi , Yi ) is pi = pi (β, σ, µi |Xi , Yi ) = ( 2πσ)−1 exp{−(2σ 2 )−1 (Yi −µ?i −Xi β)2 }, √ and the log-likelihood function is log pi = − log( 2πσ) − (2σ 2 )−1 (Yi − µ?i − Xi β)2 . Then, the score functions are 1 ∂ log pi = 2 (Yi − µ?i − Xi β)Xi , ∂β σ ∂ log pi 1 1 φi2 = = + 3 (Yi − µ?i − Xi β)2 , ∂σ σ σ ∂ log pi 1 ωi = = 2 (Yi − µ?i − Xi β). ∂µi σ φi1 = From the equation ωi = 0, we have µ̂i = Yi − Xi β. Plugging this µ̂i into φi1 and φi2 (replacing µi with µ̂i ), we obtain φi1 = 0 and φi2 = 1/σ. Then, Ei1 = Eφi1 = 0 and Ei2 = Eφi1 = 1/σ. Thus, Ei1 and Ei2 do only depend on the structural parameters (β ? and σ). However, we then have Φi1 = φi1 − Ei1 = 0 and Φi2 = φi2 − Ei2 = 0. This means Fn1 = Fn2 = 0, independent of structural parameters! Consequently, the estimation equations degenerate to two 0 = 0 equations, which means the modified equation of maximum likelihood method does not work for model (1.1). i Next, we explicitly explain which assumptions or conditions for the consistent results of the penalized methods in Zhao and Yu (2006), Fan and Peng (2004) and Fan and Lv (2011) are not valid for model (1.1). Zhao and Yu (2006) derive strong sign consistency for lasso estimator. However, their consistency results Theorems 3 and 4 do not apply to model (1.1), since the above specific design matrix X does not satisfy their regularity condition (6) on page 2546. More specifically, with model (1.1),     0 0 I X 1 s 1,s a.s.  n  −→ , C11 =  n X T Pn X X T 0 Σ 1,s i i=1 X i where ΣX is the covariance matrix of the covariates. This means that some of the eigenvalues of n goes to 0 as n → ∞. Then the regularity condition (6), which is C11 n αT C11 α ≥ a positive constant , for all α ∈ Rs+d such that kαk22 = 1, does not hold any more. Thus the consistency results Theorems 3 and 4 in Zhao and Yu (2006) is not applicable for model (1.1). Fan and Peng (2004) show the consistency with Euclidean metric of a penalized likelihood estimator when the dimension of the sparse parameter increases with the sample size in Theorem 1 on Page 935. Under their framework, the log-likelihood function of the data point Vi = (X i , Yi ) for each i from model (1.1) with random errors being i.i.d. copies of N (0, σ 2 ) is given by log fn (Vi , µi , β) ∝ − 1 (Yi − µi − X Ti β)2 , 2σ 2 where ∝ means “proportional to”. As we can see that log-likelihood functions with different i’s might different since µi ’s might be different for different i’s. This violates a condition that all the data points are i.i.d. from a structural density in Assumption (G) on Page 934. This violation might not be essential, however, since we could consider the log-likelihood function for all the data directly. That is, we consider Ln (µ, β) = n X log fn (Vi , µi , β) ∝ − n 1 X (Yi − µi − X Ti β)2 . 2σ 2 i=1 i=1 Then, the Fisher information matrix for (µ, β) is given by   σ −2 I n 0 , In+d (µ, β) =  0 nσ −2 Σ2X ii where In is the n × n identity matrix. Then, the Fisher information for one data point is   −1 σ −2 I n 0 1 n . In+d (µ, β) =  n 0 σ −2 Σ2 X It is clear that the minimal eigenvalue λmin (In+d (µ, β)/n) = n−1 σ 2 → 0 as n → ∞. This violates the condition that the minimal eigenvalue should be lower bounded from 0 in Assumption (F) on Page 934. Thus, the consistency result Theorem 1 in Fan and Peng (2004) can not be applied to model (1.1). Fan and Lv (2011) “consider the variable selection problem of nonpolynomial dimensionality in the context of generalized linear models” by taking the penalized likelihood approach with folded-concave penalties. Theorem 3 on page 5472 of Fan and Lv (2011) shows that there exists a consistent estimator of the unknown parameters with the Euclidean metric under certain conditions. In Condition 4 on page 5472, there is a condition on a minimal eigenvalue min λmin [X TI Σ(XI δ)X I ] ≥ cn, δ∈N0 where X I consists of the first s + d columns of the design matrix X. With model (1.1), this condition becomes λmin [X TI X I ] ≥ cn, which is n λmin [(1/n)X TI X I ] = λmin [C11 ] ≥ c, n is the matrix defined in Zhao and Yu (2006) and c is a positive constant. Since the minwhere C11 n ] converges to 0, the above condition does not hold. Thus, the consistency imal eigenvalue λmin [C11 result Theorem 3 of Fan and Lv (2011) is not applicable for model (1.1). D Supplement for Section 2 In this supplement, we provide Lemmas D.1 and D.3, Proposition D.2 and their proofs. Before that, there are two graphs, Figures 5 and 6, illustrating the incidental parameters and the step of updating the responses in the iteration algorithm with d = 1. iii n−s γn λ µ∗ {µ i∗ : s1 + 1 ≤ i ≤ s} s2 0 ∞ {µi∗ : 1 ≤ i ≤ s1} s1 −∞ − λ − µ∗ −γn Figure 5: An illustration of three types of µ?i ’s, that is, large µ?1 , bounded µ?2 and zero µ?3 . The negative half of the real line is folded at 0 under the positive half for convenience. For the penalized least square method with a soft penalty function and under the assumption of fixed d, the √ specification of the regularization parameter λ is that κn  λ, αγn ≤ λ, and λ  min{µ? , n}. Y 0 X f ( x ) = xβ ( k −1) Figure 6: An illustration for the updating of responses with d = 1. The solid black line is a fitted regression line. The dashed black lines are the corresponding shifted regression lines. The circle and diamond points are the original data points. The circle and triangle points are the updated data points. That is, the diamond points are drawn onto the shifted regression lines. iv Lemma D.1. A necessary and sufficient condition for (µ̂, β̂) to be a minimizer of L(µ, β) is that β̂ = (X T X)−1 X T (Y − µ̂), for i ∈ Iˆ0c , Yi − µ̂i − X Ti β̂ = λSign(µ̂i ), |Yi − X Ti β̂| ≤ λ, for i ∈ Iˆ0 , where Sign(·) is a sign function and Iˆ0 = {1 ≤ i ≤ n : µ̂i = 0}. Proof of Lemma D.1. By subdifferential calculus (see, for example, Theorem 3.27 in Jahn (2007)), a necessary and sufficient condition for (µ̂, β̂) to be a minimizer of L(µ, β) is that zero is in the subdifferential of L at (µ̂, β̂), which means that, for each i, β̂ = (X T X)−1 X T (Y − µ̂), Yi − µ̂i − X Ti β̂ = λSign(µ̂i ), |Yi − X Ti β̂| ≤ λ, if µ̂i 6= 0, if µ̂i = 0. Thus, the conclusion of Lemma D.1 follows. Proposition D.2. Suppose Assumptions (A) and (B) hold and there exist positive constants C1 and C2 such that kβ ? k2 < C1 and kβ (0) k2 < C2 wpg1. If s1 λ/n = O(1) and s2 γn /n = o(1), then, for every K ≥ 1 and k ≤ K, wpg1 as n → ∞, kβ (K+1) − β (K) k2 ≤ O((s1 /n)K ), and √ kβ (k) k2 ≤ 2 dC1 + C2 . Remark 2. For any prespecified critical value in the stopping rule, Proposition D.2 implies that the algorithm stops at the second iteration wpg1. In practice, the sample size n might not be large enough for the two-iteration estimator to have a decent performance so that more iterations are usually needed to activate the stopping rule. By Proposition D.2, K iterations will make the distance kβ (K+1) −β (K) k2 of the small order (s1 /n)K . When s1 /n is small, the algorithm converges quickly, which has been verified by our simulations. √ Proof of Proposition D.2. First, we show that, wpg1, kβ (1) k2 is bounded by 2 dC1 + C2 . For each k ≥ 1, we have Sβ (k) = SµS11 + SµS12 + SS1 β ? + SS1 + SS2 ∪S3 β (k−1) + λ(SS2 − SS3 ), v where Si = ∪3j=1 Sij (β (k−1) ) for i = 1, 2, 3 and Sij ’s are defined at the end of Section 2. Denote Ak−1 as the event ? ? ? ? ? {S11 (β (k−1) ) = ∅, S12 (β (k−1) ) = S12 , S1 (β (k−1) ) = S10 ∪ S12 ; S2 (β (k−1) ) = S21 ; S3 (β (k−1) ) = S31 }, ? ’s are defined at the beginning of Section 3. where Sij By Lemma 3.1, P (A0 ) → 1. Thus, wpg1, β (1) = T0−1 T1 + T0−1 T2 + T0−1 T3 + T0−1 T4 (β (0) ) + T0−1 T5 , where T0 = S/n, T1 = SµS ? /n, T2 = Ss1 +1,n β ? /n, T3 = Ss1 +1,n /n, T4 (β (0) ) = S1,s1 β (0) /n and T5 = 12 √ −1 −1 −1 ? − SS ? )λ/n. We will show that, wpg1, kT (SS21 0 T1 k2 ≤ C2 /4, kT0 T2 k2 ≤ 2 dC1 , kT0 T3 k2 ≤ 31 C2 /4, kT0−1 T4 (β (0) )k2 ≤ C2 /4 and kT0−1 T5 k2 ≤ C2 /4. Then, wpg1, kβ (1) k2 ≤ 5 X √ kT0−1 Ti k2 ≤ 2 dC1 + C2 . i=1 On T0−1 T1 . For s2 γn /n = o(1), wpg1, 1 s2 1 kT0−1 T1 k2 ≤ k( S)−1 kF k SµS ? k2 ≤ 4kΣ−1 γn → 0. X kF EkX 0 k2 12 n n n Thus, wpg1, kT0−1 T1 k2 ≤ C2 /4. On T0−1 T2 . Wpg1, √ 1 1 kT0−1 T2 k2 ≤ k( S)−1 Ss1 +1,n kF kβ ? k2 ≤ 2kI d kF C1 = 2 dC1 . n n On T0−1 T3 . Wpg1, 1  P kT0−1 T3 k2 ≤ 2kΣ−1 X kF k Ss1 +1,n k2 −→ 0. n Thus, wpg1, kT0−1 T3 k2 ≤ C2 /4. On T0−1 T4 (β (0) ). For s1 /n = o(1), kT0−1 T4 (β (0) )k2 ≤ s1 √ s1 1 −1 1 P k( S) S1,s1 kF kβ (0) k2 ≤ 2 dC2 −→ 0. n n s1 n Thus, wpg1, kT0−1 T4 (β (0) )k2 ≤ C2 /4. On T0−1 T5 . For s1 λ/n = O(1), wpg1, kT0−1 T5 k2 ≤ 2kΣ−1 X kF s1 λ 1 1 P ? k2 + k ? k2 ) −→ 0. (k SS21 SS31 n s1 s1 Thus, wpg1, kT0−1 T5 k2 ≤ C2 /4. vi Next, consider kβ 2 − β 1 k2 . Since β (1) is bounded wpg1, by Lemma 3.1, A1 occurs wpg1. Then, β (2) = T0−1 T1 + T0−1 T2 + T0−1 T3 + T0−1 T4 (β (1) ) + T0−1 T5 , where T4 (β (1) ) = (1/n)S1,s1 β (1) . Thus, wpg1, β (2) − β (1) = S−1 S1,s1 (β (1) − β (0) ). It follows that, for s1 = o(n), wpg1, √ √ kβ (2) − β (1) k2 ≤ kS−1 S1,s1 kF kβ (1) − β (0) k2 ≤ (2 ds1 /n)(4 dC1 + 2C2 ) → 0. Then, wpg1, β (2) = β (1) , which means that, wpg1, the iteration algorithm stops at the second iteration. Finally, for any K ≥ 1, repeat the above arguments. Then, with at least probability pn,K = TK P ( k=0 Ak ), which increases to one by Lemma 3.1, we have √ √ kβ (K+1) − β (K) k2 ≤ (2 ds1 /n)K (4 dC1 + 2C2 ) = O((s1 /n)K ) → 0, √ and kβ (k) k2 ≤ 2 dC1 + C2 for all k ≤ K. Lemma D.3. A necessary and sufficient condition for (µ̂, β̂) to be a minimizer of L(µ, β) is that it is a solution to equations (2.5) and (2.6). Proof of Lemma D.3. First, we show a solution of (2.5) and (2.6) satisfies the necessary and sufficient condition in Lemma D.1. Denote a solution of (2.5) and (2.6) as (µ̂, β̂). Then β̂ = (X T X)−1 X T (Y − µ̂), which is exactly the first condition in Lemma D.1, and, for each i = 1, 2, · · · , n, (µ̂, β̂) satisfies one of three cases: |Yi − X Ti β̂| ≤ λ and µ̂i = 0; Yi − X Ti β̂ > λ and µ̂i = Yi − X Ti β̂ − λ; Yi − X Ti β̂ < −λ and µ̂i = Yi − X Ti β̂ + λ. If (µ̂, β̂) satisfies the first case, it satisfies the third condition in Lemma D.1. If (µ̂, β̂) satisfies the second case, then µ̂i > 0 and Yi − µ̂i − X Ti β̂ = λ = λSign(µ̂i ), which means that the second case satisfies the second condition in Lemma D.1. Similarly, the third case also satisfies the second condition in Lemma D.1. Thus (µ̂, β̂) satisfies the necessary and sufficient condition in Lemma D.1. In the other direction, suppose (µ̂, β̂) satisfies the necessary and sufficient condition in Lemma D.1. Then, the first condition in Lemma D.1 exactly (2.5). For each i, (µ̂, β̂) satisfies one of three cases: µ̂i = 0 and |Yi − X Ti β̂| ≤ λ; µ̂i > 0 and Yi − µ̂i − X Ti β̂ = λ; µ̂i < 0 and Yi − µ̂i − X Ti β̂ = −λ. If (µ̂, β̂) satisfies the first case, it satisfies the first case in (2.6). If (µ̂, β̂) satisfies the second case, vii then µ̂i = Yi − X Ti β̂ − λ and Yi − X Ti β̂ > λ, which means that (µ̂, β̂) satisfies the second case of (2.6). Similarly, If (µ̂, β̂) satisfies the third case, then it satisfies the third case of (2.6). Thus, (µ̂, β̂) satisfies (2.5) and (2.6). E Supplement for Section 3 In this supplement, we provide the proofs of the theoretical results in Section 3. Before that, we point out that those two different sufficient conditions in Theorem 3.2 come from the different analysis on the term SµS ? . Each of the two different sufficient conditions does not imply the other. 12 Specifically, on one hand, suppose the absolute values of µ?i ’s are all equal for i = s1 +1, s2 +2, · · · , s. P (2+δ)/2 ? 2+δ Then, kµ?2 k2+δ = s2 |µs | and si=s1 +1 |µ?i |2+δ = s2 |µ?s |2+δ . Thus Assumption (C) holds 2 automatically since s2 → ∞. This means that Assumption (C) holds at least when the absolute magnitudes of µ?i ’s are similar to each other. For this case, there still exists a consistent estimator even if n/(κn γn )  s2  n. On the other hand, suppose µ?s = γn and the other µ?i ’s are all equal to P = [γn2 +(s2 −1)c2 ](2+δ)/2 and si=s1 +1 |µ?i |2+δ = γn2+δ +(s2 −1)c2+δ . a constant c > 0. Then, kµ?2 k2+δ 2 If s2  γn2  n/(κn γn ), the previous two terms are both asymptotically equivalent to γn2+δ . Thus Assumption (C) fails but the other sufficient condition holds. Proof of Lemma 3.1. The proof is the similar to that of Lemma 4.1 and omitted. Proof of Theorems 3.2. By Lemma 3.1, wpg1, the solution β̂ n to ϕn (β) = 0 on BC (β ? ) is explicitly given by β̂ n = β ? + T0−1 (T1 + T2 + T3 − T4 ), ? and T4 = (λ/n)SS ? . where T0 = (1/n)Ss1 +1,n , T1 = (1/n)SµS ? , T2 = (1/n)Ss1 +1,n , T3 = (λ/n)SS21 31 12 P P We will show that T0 −→ Σ−1 X > 0 with the Frobenius norm and Ti −→ 0 with the Euclidean norm for i = 1, 2, 3, 4. Thus, by Slutsky’s lemma (see, for example, Lemma 2.8 on page 11 of van der Vaart (1998)), β̂ n is a consistent estimator of β ? . P On T0−1 . By law of large number, T0 −→ ΣX > 0. Then, by continuous mapping theorem, P T0−1 −→ Σ−1 X > 0. On T1 : Approach One. Suppose s2 = o(n/(κn γn )). Then, kT1 k2 ≤ s s 1 X 1 X kX i µ?i k2 = kX i k2 · |µ?i | ≤ s2 κn γn /n = o(1). n n i=s1 +1 i=s1 +1 viii On T1 : Approach Two. Under Assumption (C), it follows (ΣX ?2 −1/2 Sµ ? i=s1 +1 µi ) S12 Ps d −→ N (0, Id ). In fact, Assumption (C) implies the Lyapunov condition for sequence of random vectors (see, e.g. Proposition 2.27 on page 332 of (van der Vaart, 1998)). More specifically, recall the Lyapunov condition is that there exists some constant δ > 0 such that s X s X Ek(ΣX i=s1 +1 −1/2 µ?2 X i µ?i k2+δ → 0. j ) 2 j=s1 +1 Then, by Assumption (C), s X Ek(ΣX i=s1 +1 s X 1 −2 µ?2 X i µ?i k2+δ ≤( j ) 2 j=s1 +1 s X − µ?2 j ) 2+δ 2 j=s1 +1 s X − 2+δ −→ 0, |µ?i |2+δ λmin2 EkX0 k2+δ 2 i=s1 +1 where λmin > 0 is the minimum eigenvalue of ΣX . Then, s s X X 1 µ 1 ?2 1/2 −1/2 µ kT1 k2 = k SS ? k2 ≤ k(ΣX µi ) kF k(ΣX µ?2 SS ? k2 i ) 12 n 12 n i=s1 +1 = 1 ( n s X i=s1 +1 1/2 1/2 µ?2 kΣX kF OP (1) ≤ i ) i=s1 +1 1 1 (s2 γn2 )1/2 OP (1) ≤ √ γn OP (1) = oP (1). n n On T2 . By law of large number, T2 = oP (1). √ On T3 and T4 . By noting λ  n, √ s1 1 1 λ ? ? k2 ≤ √ OP (1) = oP (1). kT3 k2 = kλ SS21 k2 = λ k √ SS21 n n s1 n Thus T3 = oP (1). In the same way, we can show that T4 = oP (1) holds. In Theorem, one condition is Dn /n = o(1). It turns out we can consider other conditions on Dn and derive more possible asymptotic distributions for β̂ n . Theorem E.1 (Asymptotic Distributions on β̂ n : more cases). Under Assumptions (A), (B) and (C), for all constants b, c ∈ R+ , √ d (1) when s1  n/λ2 and Dn2 /n = o(1), n(β̂ n − β ? ) −→ N (0, σ 2 Σ−1 X ); [main case] √ d (2) when s1  n/λ2 and Dn2 /n ∼ c, n(β̂ n − β ? ) −→ N (0, (c + σ 2 )Σ−1 X ); d √ d √ (3) when s1  n/λ2 and Dn2 /n → ∞, rn (β̂ n − β ? ) −→ N (0, Σ−1 X ), where rn ∼ n/Dn  √ d (4) when s1 ∼ bn/λ2 and Dn2 /n = o(1), n(β̂ n − β ? ) −→ N (0, (b + σ 2 )Σ−1 X ); √ d (5) when s1 ∼ bn/λ2 and Dn2 /n ∼ c, n(β̂ n − β ? ) −→ N (0, (b + c + σ 2 )Σ−1 X ); (6) when s1 ∼ bn/λ2 and Dn2 /n → ∞, rn (β̂ n − β ? ) −→ N (0, Σ−1 X ), where rn ∼ n/Dn  ix n; n; d (7) when s1  n/λ2 and Dn2 /n = o(1) or Dn2 /n ∼ c, rn (β̂ n − β ? ) −→ N (0, Σ−1 X ), where rn ∼ √ √ n/(λ s1 )  n; √ √ √ (8) when s1  n/λ2 and Dn2 /n → ∞, letting rn ∼ min{ bn/(λ s1 ), n/Dn }  n, √ √ d bn/(λ s1 )  n/Dn , then rn (β̂ n − β ? ) −→ N (0, Σ−1 X ); √ √ d (8b) if bn/(λ s1 ) ∼ n/Dn , then rn (β̂ n − β ? ) −→ N (0, (1 + b)Σ−1 X ); √ √ d (8c) if bn/(λ s1 )  n/Dn , then rn (β̂ n − β ? ) −→ N (0, bΣ−1 X ). (8a) if Theorem 3.3 groups the results according to the asymptotic magnitude of s1 given an upper bound of the diverging speed of s2 . Alternatively, Theorem E.1 groups the results according to the asymptotic magnitudes of s1 and Dn2 . Since both s1 and Dn2 have three cases, Theorem E.1 basically contains nine cases. For the last case, there are further three cases on the relationship √ √ between bn/(λ s1 ) and n/Dn . As in Theorem 3.3, the first case of Theorem E.1 is denoted as the main case since for this case the incidental parameters are sparse in the sense that the size and magnitude of the nonzero incidental parameters µ?1 and µ?2 are well controlled. Note that √ s2 = o( n/(κn γn )) implies Dn2 /n = o(1). which means that, under Assumption (C), the cases (1), (4) and (7) of Theorem E.1 actually imply the three results of Theorem 3.3. As in Theorem 3.3, √ the convergence rate of β̂ n becomes less than n when s1  n/λ2 or Dn2 /n → ∞, that is, when the size and magnitude of the nonzero incidental parameters are large; the boundary phenomenon also appears. Proof of Theorems 3.3 and E.1. It is sufficient to provide the proof for the case where the sizes of ? = {1 ≤ i ≤ s : µ? > 0} and S ? = {1 ≤ i ≤ s : µ? < 0} are both asymptotically index sets S21 1 1 31 i i s1 /2 and b = 2. From the proof of Theorems 3.2, wpg1, µ  ? ? β̂ = β ? + S−1 s1 +1,n [SS ? + Ss1 +1,n + λ(SS21 − SS31 )]. 12 Let rn be a sequence going to infinity. Then, rn (β̂ n −β ? ) = T0−1 (V1 +V2 +V3 −V4 ), where V1 = rn T1 , V2 = rn T2 , V3 = rn T3 , V4 = rn T4 and Ti ’s are defined in the proof of Theorem 3.2. Next we derive the asymptotic properties of T0 and Vi ’s, from which the desired results follow by Slutsky’s lemma. P On T0 . By the proof of Theorem 3.2, T0−1 −→ Σ−1 X √ √ On V1 : Approach One. If rn = n and s2 = o( n/(κn γn )), then s 1 µ 1 X 1 1 kT1 k2 = krn SS ? k2 ≤ rn kX i k2 · |µ?i | ≤ rn s2 κn γn = √ s2 κn γn = o(1). 12 n n n n i=s1 +1 x √ n and s2 = o( n/(κn γn )), then T1 = oP (1). √ On V1 : Approach Two. If rn = n, then Thus, if rn = √ n or rn  √ 1 Dn 1 µ Dn 1 µ T1 = rn SµS ? = rn SS ? = √ S ?, n 12 n Dn 12 n Dn S12 P 1/2 . There are three cases on D /√n or D 2 /n. If D 2 /n → 0, where Dn = kµ?2 k2 = ( si=s1 +1 µ?2 n n n i ) √ d P 2 2 then T1 −→ 0. If Dn /n → 1, then T1 −→ N (0, ΣX ). If Dn /n → ∞, it means that rn = n is too √ p √ d fast. Let rn ∼ n/Dn = n n/Dn2  n. Then T1 −→ N (0, ΣX ); √ √ √ d P On V2 . If rn = n, then T2 −→ N (0, σ 2 ΣX ). Thus, if rn  n, T2 −→ 0; if rn  n; P T2 −→ ∞. On V3 and V4 . First consider T3 . Denote #(·) as the size function. If rn = r s1 /2 1 1 ? = λ p S ?. T3 = λrn SS21 ? ) S21 n n #(S21 √ n, then p p P ? ) = s /2. There are three cases on λ s /(2n). If λ s /(2n) → 0, then T −→ Note that #(S21 0. 1 1 1 3 p p d Note that λ s1 /(2n) → 0 is equivalent to s1 = o(2n/λ2 ). If λ s1 /(2n) → 1, then T3 −→ p p N (0, ΣX ). Note that λ s1 /(2n) → 1 is equivalent to s1 ∼ 2n/λ2 . If λ s1 /(2n) → ∞, it means p √ √ √ √ √ rn = n is too large. Let rn ∼ n/(λ (s1 /2)) = n 2n/(λ s1 )  n. With this rate rn , p d T3 −→ N (0, ΣX ). Note that λ s1 /2n → ∞ is equivalent to s1  O(2n/λ2 ). In the same way, T4 can be analyzed and parallel results can be obtained. Proof of Theorem 3.4. The proof is similar to that of Theorem 4.4 and omitted. E.1 Supplement for Subsection 3.1 The following Theorem implies Theorem 3.5 since it contains more details. Theorem E.2 (Consistency and Asymptotic Normality on β̃). Suppose Assumptions (A) and (B) √ P hold. If either s2 = o(n/(κn γn )) or Assumption (C) holds, then β̃ −→ β ? . If s2 = o( n/(κn γn )), √ d then n(β̃ − β ? ) −→ N (0, σ 2 Σ−1 X ). On the other hand, under Assumption (C), (1) if Dn2 /n = o(1), then (2) if Dn2 /n ∼ c, then √ d n(β̃ − β ? ) −→ N (0, σ 2 Σ−1 X ); [main case] √ d + n(β̃ − β ? ) −→ N (0, (c + σ 2 )Σ−1 X ), for every constant c ∈ R ; d (3) if Dn2 /n → ∞, then rn (β̃ − β ? ) −→ N (0, Σ−1 X ) where rn ∼ n/Dn  xi √ n. Proof of Theorem E.2. Denote I0 = {s1 + 1, s1 + 2, · · · , s = s1 + s2 , s + 1, · · · , n}. Note that √ s2 = o( n/(κn γn )) ensures that β̂ is consistent by Theorem 3.2. By Theorem 3.4, P {Iˆ0 = I0 } goes to 1. Then, β̃ = R1 + R2 + T0−1 (T1 + T2 ), where R1 = (X TIˆ X Iˆ0 )−1 X TIˆ Y Iˆ0 {Iˆ0 6= I0 } and R2 = −(X TI0 X I0 )−1 X TI0 Y I0 {Iˆ0 6= I0 } and Ti ’s are 0 0 defined in the proof of Theorem 3.2. The proof for the consistency is similar to that of Theorem 3.2 and is omitted. Next we show the asymptotic normality. We have, rn (β̃ − β ? ) = rn R1 + rn R2 + T0−1 (V1 + V2 ), √ where Vi ’s are defined in the proof of Theorem E.1. Since P ( nR1 = 0) ≥ P {Iˆ0 = I0 } → 1, we √ √ have nR1 = oP (1). Similarly, nR2 = oP (1). From the analysis on Vi ’s in the proof of Theorem E.1, the asymptotic distributions follows by Slutsky’s lemma. Lemma E.3 (Consistency on σ̂). Suppose Assumptions (A) and (B) hold and either s2 = o(n/(κn γn )) P or Assumption (C) holds. If s2 = o(n/γn2 ), then σ̂ −→ σ. Proof of Lemma E.3. When Assumption (C) or s2 = o(n/(κn γn )) holds, the penalized estimators β̂ and β̃ are consistent estimators of β ? by Theorems 3.2 and 3.5. Denote C = {Iˆ0 = I0 }. By Theorem 3.4, C occurs wpg1. Then, σ̂ 2 = T C + σ̂ 2 C c , where T = an kY I0 − X TI0 β̃k22 and an = 1/(n − s1 ). It P P P is sufficient to show T −→ σ 2 . We have T = 6i=1 Ti , where T1 = an ni=s1 +1 [X Ti (β ? − β̃)]2 , T2 = Ps P P P ? T an ni=s1 +1 2i , T3 = 2an ni=s1 +1 X Ti (β ? − β̃)i , T4 = an si=s1 +1 µ?2 i , T5 = 2an i=s1 +1 µi X i (β − P P P β̃) and T6 = 2an si=s1 +1 µ?i i . It is straightforward to show that T2 −→ σ 2 and each other Ti −→ 0 P under the condition s2 = o(n/γn2 ) and by noting that β̃ −→ β ? . Then σ̂ is a consistent estimator of σ. E.2 Supplement for Subsection 3.2 In this supplement, we consider a special case with exponentially tailed covariates and errors. For convenience, we first introduce the definition of Orlicz norm and related inequalities. For a strictly increasing and convex function ψ with ψ(0) = 0, the Orlicz norm of a random variable Z with respect to ψ is defined as kZkψ = inf{C > 0 : Eψ(|Z|/C) ≤ 1}. Then, for each x > 0, P (|Z| > x) ≤ 1/ψ(x/kZkψ ). xii (E.1) (See Page 96 of van der Vaart and Wellner (1996)). Next, we introduce a lemma on Orlicz norm with ψ1 . Suppose {Zi }ni=1 is a sequence of random variables and {Z i }ni=1 is a sequence of d-dimensional random vectors with Z i = (Zi1 , Zi2 , · · · , Zid )T . From Lemma 8.3 on Page 131 of Kosorok (2008), we have the following extension. Lemma E.4. If for each 1 ≤ i ≤ n and 1 ≤ j ≤ d, x2 1 x2 1 } and P (|Zij | > x) ≤ c exp{− · }, P (|Zi | > x) ≤ c exp{− · 2 ax + b 2 ax + b with a, b ≥ 0 and c > 0, then k max |Zi k|ψ1 ≤ K{a(1 + c) log(1 + n) + 1≤i≤n p p b(1 + c) log(1 + n)}, p p √ k max kZ i k2 kψ1 ≤ K{a d(1 + cd) log(1 + n) + bd(1 + cd) log(1 + n)}. 1≤i≤n where K is a universal constant which is independent of a, b, c, {Zi } and {Z i }. Proof of Lemma E.4. The proof for random variables {Zi } is the same to the proof of Lemma 8.3 on Page 131 of Kosorok (2008). For random vectors {Z i }, d X √ √ 1 x2 P (kZ i k2 ≥ x) ≤ P ( max |Zij | > x/ d) ≤ P (|Zij | > x/ d) ≤ c0 exp{− 0 }, 1≤j≤d 2 a x + b0 j=1 √ where a0 = a d, b0 = bd and c0 = cd. Then, by the result on random variables, the desired result on random vectors follows. Now, suppose, for every x > 0, 1 x2 1 x2 P (|i | > x) ≤ c1 exp{− · } and P (|Xij | > x) ≤ c2 exp{− · }, 2 a1 x + b1 2 a2 x + b2 (E.2) with ai , bi ≥ 0 and ci > 0 for i = 1, 2. By Lemma E.4, it follows k max |i k|ψ1 ≤ K{a1 (1 + c2 ) log(1 + n) + 1≤i≤n p b1 (1 + c1 ) p log(1 + n)}, p p √ k max kX i k2 kψ1 ≤ K{a2 d(1 + c2 d) log(1 + n) + b2 d(1 + c2 d) log(1 + n)}. 1≤i≤n p Thus, from the inequality (E.1), if a1 > 0, let γn  log(n); otherwise, let γn  log(n). p Similarly, if a2 > 0, let κn  log(n); otherwise, let κn  log(n). Then, such γn and κn satisfy the condition (2.2). Suppose both a1 and a2 are positive, which means both i and Xij ’s have exponential tails. As before, set κn = γn = log(n)τn . For this case, the regularization parameter √ specification (2.4) becomes log(n)τn  λ  min{µ? , n}. xiii At the end of this supplement, we simply list explicit expressions of κn under different assumptions on the covariates for the case with a diverging number of covariates, which are the extension of the results in Section 3.2. The magnitude of κn becomes larger than that for the case with d √ fixed while γn keeps the same. Specifically, if X 0 is bounded with CX > 0, then κn = dCX . q 2 [(3/2) log(d) + log(n)]. If the If X 0 follows a Gaussian distribution N (0, ΣX ), then κn = 2dσX P Orlicz norm kX0j kψ exists for 1 ≤ j ≤ d and their average (1/d) dj=1 kX0j kψ is bounded, then κn  dψ −1 (n); for instance, if ψ = ψp with p ≥ 1, then κn  d(log(n))1/p . Finally, if the data {X i } satisfies the right inequality of (E.2) with a2 > 0, that is, each component of X i is sub-exponentially tailed, then κn  d3/2 log(n). It is worthwhile to note that these expressions of κn depend on a factor involving the diverging number of covariates d, which will influence the specification of the regularization parameter and the sufficient conditions of all the theoretical results in Section 4. F Supplement for Section 4 In this supplement, we provide Proposition D.2 and its proof, the proofs of the lemmas in the appendix and some additional results. We first extend Proposition D.2 to the case with d → ∞ and d  n. Before that, we list two simple lemmas for a diverging d. Suppose {ξ i } is a sequence of i.i.d. copies of ξ 0 , a d-dimensional P random vector with mean zero. Denote σ̄ξ2 = (1/d) dj=1 Var[ξ0j ]. Lemma F.1. Suppose σ̄ξ2 is bounded. If d/n = o(1), then n k 1X P ξ i k2 −→ 0. n i=1 Lemma F.2. Suppose σ̄ξ2 is bounded. If d/n = o(1), then n 1X P kξ i k2 − P kξ 0 k2 −→ 0. n i=1 Suppose the specification of the regularization parameter is given by dκn  λ, αγn ≤ λ, and λ  µ? , (F.1) where α is a constant greater than 2. Proposition F.3. Suppose assumptions (D) and (G) hold and the regularization parameter satisfies √ √ (F.1). Suppose there exist constants C1 and C2 such that kβ ? k2 < C1 d and kβ (0) k2 < C2 d xiv √ √ wpg1. If the regularization parameter satisfies (2.4), s1 λκn /(n d) = o(1) and s2 κn γn /(n d) = o(1), then, for every K ≥ 1, with at least probability pn,K which increases to one as n → ∞, √ kβ (K+1) − β (K) k2 ≤ O(( ds1 κ2n /n)K d) and kβ (k) k2 ≤ (2C1 + C2 )d for all k ≤ K. Specifically, wpg1, the iterative algorithm stops at the second iteration. Proof of Proposition F.3. Reuse the notations in the proof of Lemma D.2. First, we show that, wpg1, kβ (1) k2 ≤ (2C1 + C2 )d. For each k ≥ 1, Sβ (k) = SµS11 + SµS12 + SS1 β ? + SS1 + SS2 ∪S3 β (k−1) + λ(SS2 − SS3 ), Since the regularization parameter satisfies (F.1), it is easy to check that the conclusion of Lemma 4.1 continues to hold, which implies P (A0 ) → 1. Thus, wpg1, β (1) = T0−1 T1 + T0−1 T2 + T0−1 T3 + T0−1 T4 (β (0) ) + T0−1 T5 . We will show that, wpg1, kT0−1 T1 k2 ≤ (C2 /4)d, kT0−1 T2 k2 ≤ 2C1 d, kT0−1 T3 k2 ≤ (C2 /4)d, kT0−1 T4 (β (0) )k2 ≤ (C2 /4)d, kT0−1 T5 k2 ≤ (C2 /4)d. Thus, wpg1, kβ (1) k2 ≤ 5 X kT0−1 Ti k2 ≤ (2C1 + C2 )d. i=1 √ On T0−1 T1 . Under Assumption (D), for s2 κn γn /(n d) = o(1), wpg1, 1 1 s2 kT0−1 T1 k2 ≤ k( S)−1 kF k SµS ? k2 ≤ 2kΣ−1 X kF,d √ κn γn d → 0. n n 12 n d Thus, wpg1, kT0−1 T1 k2 ≤ C2 d/4. On T0−1 T2 . Wpg1, 1 1 kT0−1 T2 k2 ≤ k( S)−1 Ss1 +1,n kF kβ ? k2 n n √ √ 1 1 ≤ kI d kF C1 d + k( S)−1 S1,s1 kF C1 d n n √ 1 1 −1 ≤ C1 d + k( S) kF k S1,s1 kF C1 d, n n xv and s 1 1X s1 1 kX i k22 ≤ κ2n . k S1,s1 kF = n n n i=1 Thus, Under Assumption (D), for s1 κ2n /n = o(1), wpg1, √ ds1 2 √ −1 −1 kT0 T2 k2 ≤ C1 d + 2kΣX kF,d κn C1 d ≤ 2C1 d. n On T0−1 T3 . Under assumptions (D) and (G), for log(d)/n = o(1), wpg1, √ 1 p 1 1 d√ d log(d)k( S)−1 kF,d (d log(d))−1/2 k √ Ss1 +1,n k2 n n n p d log(d) P √ ≤ 2kΣ−1 X kF,d OP (1) −→ 0. n kT0−1 T3 k2 = Thus, wpg1, kT0−1 T3 k2 ≤ C2 d/4. On T0−1 T4 (β (0) ). Under Assumption (D), for s1 κ2n /n, wpg1, √ 1 1 dk( S)−1 kF,d k S1,s1 kF kβ (0) k2 n n √ s1 2 √ P −1 ≤ d2kΣX kF,d κn C2 d −→ 0. n kT0−1 T4 (β (0) )k2 ≤ Thus, wpg1, kT0−1 T4 (β (0) )k2 ≤ C2 d/4. √ On T0−1 T5 . Under Assumption (D), for s1 κn λ/(n d) = o(1), wpg1, √ λ 1 ? k2 + kSS ? k2 ) dk( S)−1 kF,d (kSS21 31 n n √ λ ≤ d2kΣ−1 X kF,d s1 κn ≤ C2 d/4. n kT0−1 T5 k2 ≤ Next, consider kβ 2 − β 1 k2 . Since β (1) ≤ (2C1 + C2 )d wpg1, the conclusion of Lemma 4.1 holds, which implies A1 occurs wpg1. Then, β (2) = T0−1 T1 + T0−1 T2 + T0−1 T3 + T0−1 T4 (β (1) ) + T0−1 T5 , where T4 (β (1) ) = 1 S1,s1 β (1) . n Thus, wpg1, β (2) − β (1) = S−1 S1,s1 (β (1) − β (0) ). xvi Thus, for d3/2 s1 κ2n /n = o(1), wpg1, √ 1 1 dk S−1 kF,d k S1,s1 kF kβ (1) − β (0) k2 n n √ s1 2 −1 ≤ 2kΣX kF,d d κn (2C1 + C2 )d . d3/2 s1 κ2n /n → 0. n kβ (2) − β (1) k2 ≤ Thus, wpg1, β (2) = β (1) , which means that, wpg1, the iteration algorithm stops at the second iteration. T For any K ≥ 1, repeating the above arguments, with at least probability pn,K = P ( K k=0 Ak ), which increases to one, we have β (k) ≤ (2C1 + C2 )d for k ≤ K and √ s1 2 K √ kβ (K+1) − β (K) k2 ≤ (2kΣ−1 κn ) (2C1 + C2 )d . ( ds1 κ2n /n)K d → 0. X kF,d d n This completes the proof. Next, we provide the proofs of Lemmas A.2, A.3 and A.4 in the appendix. √ P Proof of Lemma A.2. Let E = An − A. Note that rd ≥ 1/ d. Then, rd kEkF −→ 0 implies P kEkF,d −→ 0. Thus, wpg1, kEkF,d is bounded by a constant C > 0. By Lemma A.1, −1 −1 kA−1 n − A kF,d ≤ kA kF,d kEkF,d kA−1 kF,d kEkF,d ≤ C2 . −1 1 − CkEkF,d 1 − kA kF,d kEkF,d Therefore, rd kEkF P −→ 0. 1 − CkEkF,d −1 2 rd kA−1 n − A kF ≤ C This completes the proof. Proof of Lemma A.3. For any δ > 0, we have P (kΣ̂n − ΣX kF > δ) ≤ d X d X d2 k=1 l=1 δ n P( 2 1X d4 1 2 Xik Xil − σkl )2 ≤ σ̄ . n n δ 2 XX i=1 2 r 2 d4 /(nδ 2 ) = o(1) by Assumption (E2) and for r 2 d4 /n → 0. Thus, P (rd kΣ̂n − ΣX kF > δ) ≤ σ̄XX d d Thus, Σ̂n is a consistent estimator of ΣX wrt rd k·kF . Proof of Lemma A.4. Let αd = n √ d log d and C1 ≥ √ d 2σξ,max . Then n X 1 X 1 X ξij αd C1 P (k √ ξ i k2 > αd C1 ) ≤ P (| √ | > √ ), σ n n σj d i=1 j=1 i=1 j xvii where σj is the standard deviation of ξ0j . By Berry and Esseen Theorem (see, for example, P375 √ P in Shiryaev (1995)), there exists a constant C2 > 0 such that P (k(1/ n) ni=1 ξ i k2 > αd C1 ) ≤ T1 + 2T2 , where T1 = d X P (|N (0, 1)| > j=1 αd C1 √ ), σj d T2 = d X C2 E|ξ0j |3 √ . σj3 n j=1 By noting d2 = o(n), √ σξ,max d αd C1 αd C1 √ ) < 2d √ ) → 0, φ( T1 ≤ P (|N (0, 1)| > α d C1 σξ,max d σξ,max d j=1 d X T2 ≤ d X C2 γξ,max C2 γξ,max √ = d 3 √ → 0. 3 σ n σmin n j=1 ξ,min √ P Therefore, k(1/ n) ni=1 ξ i k2 = OP (αd ). Next result is on the consistency of the penalized two-step estimator β̃. Theorem F.4 (Consistency on β̃). Suppose the assumptions and conditions of Theorem 4.2 hold. √ P If rd ≥ 1/ d, then β̃ −→ β ? wrt rd k·k2 . P Proof of Theorems F.4. By Theorem 4.2, β̂ −→ β ? wrt rd k·k2 . By Theorem 4.4, P {Iˆ0 = I0 } → 1 √ for rd ≥ 1/ d, where I0 = {s1 + 1, s1 + 2, · · · , s = s1 + s2 , s + 1, · · · , n}. Then, wpg1, β̃ − β ? = R1 + R2 + T0−1 T1 + T0−1 T2 , where R1 = (X TIˆ X Iˆ0 )−1 X TIˆ Y Iˆ0 {Iˆ0 6= I0 }, R2 = −(X TI0 X I0 )−1 X TI0 Y I0 {Iˆ0 6= I0 } and Ti ’s are 0 0 defined in the proof of Theorem 4.2. Then, √ √ rd kβ̃ − β ? k2 ≤ rd kR1 k2 + rd kR2 k2 + kT0−1 kF,d rd dkT1 k2 + kT0−1 kF,d rd dkT2 k2 . Since P (kR1 k2,d = 0) ≥ P {Iˆ0 = I0 } → 1, we have R1 = oP (1). Similarly, R2 = oP (1). By the proof √ P P of Theorem 4.2, kT0−1 kF,d is bounded and rd dkTi k2 −→ 0 for i = 1, 2. Thus, β̃ −→ β ? wrt rd k·k2 √ and rd ≥ 1/ d. Finally, we provide some additional results on the asymptotic distributions of β̂ and β̃ with a √ different scaling. Specifically, the scaling in Section 4 is nAn . Next, we consider another natural √ 1/2 scaling nAn ΣX . xviii Theorem F.5 (Asymptotic Distribution on β̂). Suppose assumptions (D’), (D”), (E), (F) and √ √ (G) hold. If d6 log d = o(n), s1 = o( n/(λdκn )) and s2 = o( n/(dκn γn )), then √ d 1/2 nAn ΣX (β̂ n − β ? ) −→ N (0, σ 2 G). Theorem F.6 (Asymptotic Distribution on β̃). Suppose the assumptions and conditions of Theo√ rem F.5 hold except the condition s1 = o( n/(λdκn )). Then √ d 1/2 nAn ΣX (β̃ − β ? ) −→ N (0, σ 2 G). By Theorems F.5 and F.6, Wald-type confidence regions can be constructed. In order to validate these confidence regions with estimated σ and ΣX , we need Lemma A.5 and the following result. Theorem F.7 (Asymptotic Distributions on β̂ and β̃ with Σ̂n ). Suppose the assumptions and conditions of Theorem F.5 hold. If d9 (log(d))2 = o(n), then √ 1/2 d nAn Σ̂n (β̂ − β ? ) −→ N (0, σ 2 G). Similarly, suppose the assumptions and conditions of Theorem F.6 hold. If d9 (log(d))2 = o(n), then √ 1/2 d nAn Σ̂n (β̃ − β ? ) −→ N (0, σ 2 G). Remark 3. A comparison of the assumptions and conditions of Theorem F.7 with those of Theorems F.5 and F.6 reveals that a much stronger requirement on d is needed to ensure Σ̂n is a good estimator of ΣX . Precisely, the former require that d9 (log(d))2 = o(n) and the latter d6 log(d) = o(n). This stronger requirement on d is a price paid for estimating ΣX . Remark 4. The condition on the dimension d in Theorems 4.3 and 4.5 is d5 log(d) = o(n), slightly weaker than the condition d6 log(d) = o(n) in Theorems F.5 and F.6. Accordingly, The condition on the dimension d in Theorem A.6 is d8 (log(d))2 = o(n), slightly weaker than the condition √ d9 (log(d))2 = o(n) in Theorem F.7. This means that the scaling nAn is slightly better than the √ 1/2 scaling nAn ΣX in terms of the condition on d. Further, the former scaling is more suitable for constructing confidence regions for some entries of β ? . At the end of this supplement, we provide the proofs of the above theorems. Proof of Theorems F.5. Reuse the notations Ti ’s in the proof of Theorems 4.2, from which, √ 1/2 nAn ΣX (β̂ n − β ? ) = V1 + V2 + V3 − V4 , xix where Vi = B n Ti for i = 1, 2, 3, 4 and B n = √ d 1/2 nAn ΣX T0−1 . We will show V2 −→ N (0, σ 2 G) and other Vi ’s are oP (1), from which the desired result follows by applying Slutsky’s lemma. √ 1/2 On V1 . We have kV1 k2 ≤ ndkAn kF kΣX kF,d kT0−1 kF,d kT1 k2 . By Assumption (F), kAn kF is 1/2 bounded. By Assumption (D”), kΣX kF,d is bounded. By Lemmas A.2 and A.3 and Assumption (D), for d = o(n1/3 ), wpg1, kT0−1 kF,d is bounded. Further, wpg1, kT1 k2 ≤ kV1 k2 . 1 n s2 κn γn . Then, √1 s2 dκn γn , n where . means that the left side is bounded by a constant times the right √ side, as noted at the beginning of the appendix. Thus, kV1 k2 = oP (1) for s2 = o( n/(dκn γn )). On V2 . We have V2 = V21 + V22 , where V21 = √ −1/2 nAn ΣX First, consider V21 . We have V21 = T2 , V22 = 1/2 nAn ΣX (T0−1 − Σ−1 X )T2 . p P (n − s1 )/n ni=s1 +1 Z n,i , where Z n,i = √ On one hand, for every δ > 0, √ 1 −1/2 An ΣX X i i . n − s1 Pn 2 i=s1 +1 EkZ n,i k2 {kZ n,i k2 > δ} ≤ (n − s1 )EkZ n,0 k42 /δ 2 and 1 −1/2 −1/2 E4 E(X T0 ΣX ATn An ΣX X 0 )2 (n − s1 )2 0 1 ≤ E4 λmax (Gn )λmin (ΣX )−1 E(X T0 X 0 )2 (n − s1 )2 0 EkZ n,0 k42 = d ≤ 1X d2 4 1/2 2 E40 λmax (Gn )λmin (ΣX )−1 ( (EX0j ) ) . 2 (n − s1 ) d j=1 P √ Thus, by assumptions (D’), (E) and (F), ni=s1 +1 EkZ n,i k22 {kZ n,i k2 > δ} → 0 for d = o( n). On P the other hand, ni=s1 +1 Cov(Z n,i ) = σ 2 An ATn → σ 2 G. Thus, by central limit theorem (see, for d example, Proposition 2.27 in van der Vaart (1998)), V21 −→ N (0, σ 2 G). Next, consider V22 . We have 1/2 −1/2 √ kV22 k2 ≤ kAn kF kΣX kF,d d(log(d))1/2 kT0−1 − Σ−1 k nT2 k2 . X kF (d log(d)) 1/2 By Assumption (F), kAn kF is O(1); By Assumption (D”), kΣX kF,d is O(1); by Lemmas A.2 6 and A.3, d(log(d))1/2 kT0−1 − Σ−1 X kF is oP (1) for d log(d) = o(n); By Lemma A.4, together with √ √ Assumption (G), (d log(d))−1/2 k nT2 k2 = (d log(d))−1/2 k √1n Ss1 +1,n k2 is OP (1) for d = o( n). P d Thus, V22 −→ 0. By slutsky’s lemma, V2 −→ N (0, σ 2 G). √ On V3 and V4 . First consider V3 . By noting that s1 = o( n/(λdκn )), wpg1, kV3 k2 ≤ √ √ 1/2 d nkAn kF kΣX kF,d kT0−1 kF,d kT3 k2 . dλs1 κn / n → 0. Thus, kV3 k2 = oP (1). In the same way, kV4 k2 = oP (1). This completes the proof. xx √ 1/2 Proof of Theorem F.6. From the proof of Theorem F.4, we have nAn ΣX (β̃ − β ? ) = R̃1 + R̃2 + √ √ 1/2 1/2 V1 + V2 , where R̃1 = nAn ΣX R1 , R̃2 = nAn ΣX R2 , and Ri ’s and Vi ’s are defined in the proofs of Theorems F.4 and F.5. Since P (kR̃1 k2 = 0) ≥ P {Iˆ0 = I0 } → 1, we have R̃1 = oP (1). d Similarly, R̃2 = oP (1). By the proof of Theorem F.5, V1 = oP (1) and V2 −→ N (0, σ 2 G). Thus, the asymptotic distribution of β̃ is Gaussian by Slutsky’s lemma. Proof of Theorem F.7. We only show the result on β̂. since the result on β̃ can be obtained in a similar way. We reuse the definitions of Ti ’s in the proof of Theorems 4.2, from which, √ where M = √ 1/2 nAn Σ̂n (β̂ n − β ? ) = M + R, 1/2 nAn ΣX (β̂ n − β ? ) and R = √ 1/2 nAn (Σ̂n d 1/2 − ΣX )(β̂ n − β ? ). By Theorem F.5, P M −→ N (0, σ 2 G). Then, it is sufficient to show that R −→ 0 wrt k·k2 . We have R = R1 + R2 + R3 − R4 , where Ri = B n Ti for i = 1, 2, 3, 4 and B n = √ 1/2 nAn (Σ̂n 1/2 − ΣX )T0−1 . We will show each Ri converges to zero in probability, which finishes the proof. 1/2 1/2 On R1 . By Lemma A.7, kΣ̂n − ΣX kF ≤ (d1/2 kΣ̂n − ΣX kF )1/2 . Then, kR1 k2 ≤ ≤ √ √ 1/2 1/2 nkAn kF kΣ̂n − ΣX kF kT0−1 kF kT1 k2 ndkAn kF (kΣ̂n − ΣX kF,d )1/2 kT0−1 kF,d kT1 k2 . By Assumption (F), kAn kF is bounded. By Lemma A.3, kΣ̂n − ΣX kF,d = oP (1) for d = o(n1/3 ). By Lemmas A.2 and A.3 and Assumption (D), for d = o(n1/3 ), wpg1, kT0−1 kF,d is bounded. We have, wpg1, kT1 k2 ≤ √ o( n/(dκn γn )). 1 n s2 κn γn . Then, kR1 k2 . √1 s2 dκn γn . n Thus, kR1 k2 = oP (1) for s2 = On R2 . We have √ 1/2 1/2 kR2 k2 ≤ kAn kF d(log(d))1/2 kΣ̂n − ΣX kF kT0−1 kF,d (d log(d))−1/2 k nT2 k2 , and 1/2 1/2 d(log(d))1/2 kΣ̂n − ΣX kF ≤ (d5/2 log(d)kΣ̂n − ΣX kF )1/2 . By Assumption (F), kAn kF is O(1); by Lemma A.3, d5/2 log(d)kΣ̂n −ΣX kF = oP (1) for d9 (log(d))2 = 6 o(n); by Lemmas A.2 and A.3, d(log(d))1/2 kT0−1 − Σ−1 X kF is oP (1) for d log(d) = o(n); by Lemma √ √ P A.4, (d log(d))−1/2 k nT2 k2 = (d log(d))−1/2 k √1n Ss1 +1,n k2 is OP (1) for d = o( n). Thus, R2 −→ 0. xxi √ On R3 and R4 . First consider R3 . By noting that s1 = o( n/(λdκn )), wpg1, √ √ 1/2 1/2 kR3 k2 ≤ d nkAn kF (kΣ̂n − ΣX kF,d )1/2 kT0−1 kF,d kT3 k2 . dλs1 κn / n → 0. Thus, kR3 k2 = oP (1). In the same way, kR4 k2 = oP (1). References Jianqing Fan and Jinchi Lv. Non-concave penalized likelihood with np-dimensionality. IEEE Transactions On Information Theory, 57:5467–5484, 2011. Jianqing Fan and Heng Peng. On non-concave penalized likelihood with diverging number of parameters. The Annals of Statistics, 32:928–961, 2004. Michael R. Kosorok. Introduction to Empirical Processes and Semiparametric Inference. Springer New York, 2008. Jerzy Neyman and Elizabeth L. Scott. Consistent estimates based on partially consistent observations. Econometrica, 16:1–32, 1948. Albert N. Shiryaev. Probability. Springer-Verlag, second edition, 1995. Aad W. van der Vaart. Asymptotic Statistics. Cambridge University Press, 1998. Peng Zhao and Bin Yu. On model selection consistency of lasso. The Journal of Machine Learning Research, 7(Nov):2541–2563, 2006. xxii
10math.ST
REMIX: Automated Exploration for Interactive Outlier Detection Yanjie Fu∗1 , Charu Aggarwal†2 , Srinivasan Parthasarathy‡2 , Deepak S. Turaga§2 and Hui Xiong¶3 arXiv:1705.05986v1 [cs.AI] 17 May 2017 1 Missouri U. of Science & Technology, Missouri, USA 2 IBM T. J. Watson Research Center, NY, USA 3 Rutgers University, NJ, USA May 18, 2017 Abstract Outlier detection is the identification of points in a dataset that do not conform to the norm. Outlier detection is highly sensitive to the choice of the detection algorithm and the feature subspace used by the algorithm. Extracting domain-relevant insights from outliers needs systematic exploration of these choices since diverse outlier sets could lead to complementary insights. This challenge is especially acute in an interactive setting, where the choices must be explored in a time-constrained manner. In this work, we present REMIX, the first system to address the problem of outlier detection in an interactive setting. REMIX uses a novel mixed integer programming (MIP) formulation for automatically selecting and executing a diverse set of outlier detectors within a time limit. This formulation incorporates multiple aspects such as (i) an upper limit on the total execution time of detectors (ii) diversity in the space of algorithms and features, and (iii) meta-learning for evaluating the cost and utility of detectors. REMIX provides two distinct ways for the analyst to consume its results: (i) a partitioning of the detectors explored by REMIX into perspectives through low-rank non-negative matrix factorization; each perspective can be easily visualized as an intuitive heatmap of experiments versus outliers, and (ii) an ensembled set of outliers which combines outlier scores from all detectors. We demonstrate the benefits of REMIX through extensive empirical validation on real-world data. 1 Introduction Outlier detection is the identication of points in a dataset that do not conform to the norm. This is a critical task in data analysis and is widely used in many applications such as financial fraud detection, Internet traffic monitoring, and cyber security [4]. Outlier detection is highly sensitive to the choice of the detection algorithm and the feature subspace used by the algorithm [4, 5, 35]. Further, outlier detection is often performed on high dimensional data in an unsupervised manner without data labels; distinct sets of outliers discovered through different algorithmic choices could reveal complementary insights about the application domain. Thus, unsupervised outlier detection is a data analysis task which inherently requires a principled exploration of the diverse algorithmic choices that are available. Recent advances in interactive data exploration [10, 17, 33, 34] show much promise towards automated discovery of advanced statistical insights from complex datasets while minimizing the burden of exploration for the analyst. We study unsupervised outlier detection in such an interactive setting and consider three practical design requirements: (1) Automated exploration: the system should automatically enumerate, assess, select and execute a diverse set of outlier detectors; the exploration strategy should guarantee coverage ∗ [email protected][email protected][email protected] § [email protected][email protected] 1 in the space of features and algorithm parameters. (2) Predictable response time: the system should conduct its exploration within a specified time limit. This implies an exploration strategy that is sensitive to the execution time (cost) of the detectors. (3) Visual interpretability: the system should enable the user to easily navigate the results of automated exploration by grouping together detectors that are similar in terms of the data points they identify as outliers. Exploratory Action 100 75 50 25 0 0 50 100 150 200 Data Point (a) Perspective 1 Exploratory Action 100 75 50 25 0 0 50 100 150 200 Data Point (b) Perspective 2 Figure 1: Factorization of an outlier matrix into two perspectives. Each perspective is a heatmapped matrix whose columns are data points and rows are detectors. The intensity of a cell (s, p) in a perspective corresponds to the extent to which detector s identifies point p as an outlier. Each perspective clearly identifies a distinct set of outliers. 1.1 Key Contributions We present REMIX, a modular framework for automated outlier exploration and the first to address the outlier detection problem in an interactive setting. To the best of our knowledge, none of the existing outlier detection systems support interactivity in the manner outlined above – in particular, we are not aware of any system which automatically explores the diverse algorithmic choices in outlier detection within a given time limit. The following are the key contributions of our work. 1.1.1 MIP based Automated Exploration REMIX systematically enumerates candidate outlier detectors and formulates the exploration problem as a mixed integer program (MIP). The solution to this MIP yields a subset of candidates which are executed by REMIX. The MIP maximizes a novel aggregate utility measure which trades off between the total utility of the top-k vs all selected candidates; the MIP also enforces (i) an upper limit on the total cost (budget) of the selected candidates, and (ii) a set of diversity constraints which ensure that each detection algorithm and certain prioritized feature subspaces get at least a certain minimum share of the exploration budget. 2 1.1.2 Meta-Learning for Cost and Utility The REMIX MIP requires an estimate of cost and utility for each candidate detector. In order to estimate cost, REMIX trains a meta-learning model for each algorithm which uses the number of data points, size of the feature subspace, and various product terms derived from them as meta-features. It is significantly harder to estimate or even define utility. REMIX handles this by defining the utility of a detector as a proxy for its accuracy on the given data. REMIX estimates this by training a meta-learning model for each algorithm that uses various statistical descriptors of a detector’s feature subspace as meta-features; this model is trained on a corpus of outlier detection datasets that are labeled by domain experts [2]. 1.1.3 Perspective Factorization The diversity of feature subspaces and algorithms explored by REMIX will result in different detectors marking a distinct set of data points as outliers. REMIX provides a succinct way for the data analyst to visualize these results as heatmaps. Consider the outlier matrix ∆ where ∆s,p is the normalized ([0, 1]ranging) outlier score assigned by detector s to data point p. REMIX uses a low rank non-negative matrix factorization scheme to bi-cluster ∆ into a small user-specified number of perspectives such that there is consensus among the detectors within a perspective. The idea of outlier perspectives is a generalization of the idea of outlier ensembles. A notable special case occurs when the number of perspectives equals one: here, the results from all the detectors are ensembled into a single set of outliers. REMIX can be used in two modes. (i) Simple: An analyst can gain rapid visual understanding of the outlier space by providing two simple inputs: an exploration budget and the number of perspectives. This yields bi-clustered heatmaps of outliers that are easily interpretable as in Figure 1. (ii) Advanced: As discussed in Section 4.3.1, an advanced user can also re-configure specific modules within REMIX such as utility estimation or the enumeration of prioritized feature subspaces. Such re-configuration would steer the REMIX MIP towards alternate optimization goals while still guaranteeing exploration within a given budget and providing factorized heatmap visualizations of the diverse outlier sets. The rest of the paper is organized as follows. We survey related work in Section 2, and provide background definitions and an overview in Section 3. In Sections 4.1 – 4.5, we present the details of feature subspace and candidate detector enumeration, cost and utility estimation, MIP for automated exploration, and perspective factorization. We present an evaluation of REMIX on real-world datasets in Section 5 and conclude in Section 6. 2 Related Work Outlier ensembles [4, 23, 31, 5] combine multiple outlier results to obtain a more robust set of outliers. Model centered ensembles combine results from different base detectors while data-centered ensembles explore different horizontal or vertical samples of the dataset and combine their results [4]. Research in the area of subspace mining [23, 18, 19, 8, 30] focuses on exploring a diverse family of feature subspaces which are interesting in terms of their ability to reveal outliers. The work in [28] introduces a new ensemble model that uses detector explanations to choose base detectors selectively and remain robust to errors in those detectors. REMIX is related to ensemble outlier detection since setting the number of perspectives to one in REMIX leads to ensembling of results from the base detectors. However, REMIX has some notable distinctions: the idea of perspectives in REMIX generalizes the notion of ensembles; setting the number of perspectives to a number greater than one is possible in REMIX and results in complementary views of the outlier space which can be visualized as heatmaps; further, REMIX seeks to guarantee coverage not just in the space of features or feature subspaces, but also available algorithms – subject to a budget constraint on the total time available for exploration. None of the existing approaches in literature provide this guarantee on the exploration time. Multiview outlier detection [9, 29, 27, 13] deals with a setting where the input consists of multiple datasets (views), and each view provides a distinct set of features for characterizing the objects in the domain. Algorithms in this setting aim to detect objects that are outliers in each view or objects that are normal but show inconsistent class or clustering characteristics across different views. REMIX is related to multiview 3 outlier detection through non-negative matrix factorization (NMF) which is often used here for creating a combined outlier score of objects. In REMIX, NMF is used not just for ensembling detector scores but also for factorizing detector results into multiple heatmap visualizations. Automated exploration is a growing trend in the world of commercial data science systems [1, 3] as well as machine learning and statistical research [6, 32, 20, 25, 12, 14]. While [14] focuses on model selection, [25, 12] focus on exploration for non-parametric regression models, [1, 3, 6, 32] deal with algorithm exploration for classification models, while [20] deals with automated feature generation for classification and regression. Budgeted allocations and recommendations have also been studied in the context of problems other than outlier analysis [24, 26]. 3 3.1 Preliminaries Baseline Algorithms Our implementation of REMIX uses the following set A of five baseline outlier detection algorithms that are well-known. 1) Local outlier factor: LOF [7] finds outliers by measuring the local deviation of a point from its neighbors. 2) Mahalanobis distance: MD [16] detects outliers by computing the Mahalanobis distance from a point and the center of the entire dataset as outlier score. 3) Angle-based outlier detection: ABOD [22] identifies outliers by considering the variances of the angles between the difference vectors of data points, which is more robust that distance in high-dimensional space. ABOD is robust yet time-consuming. 4) Feature-bagging outlier detection: FBOD [23] is an ensemble method, which is based on the results of local outlier factor (LOF). During each iteration, a random feature subspace is selected. LOF then is applied to calculate the LOF scores based on the selected data subset. The final score of FBOD is the cumulative sum of each iteration. 5) Subspace outlier detection: SOD [21]: SOD aims to detect outliers in varying subspaces of a high dimensional feature space. Specifically, for each point in the dataset, SOD explores the axis-parallel subspace spanned by its neighbors and determines how much the point deviates from the neighbors in this subspace. 3.2 Interactive Outlier Exploration A dataset in REMIX is a real-valued matrix A with m columns and n rows. A feature subspace is a subset of columns in A. An outlier detector Da,f is simply a combination of an algorithm a ∈ A and a feature subspace f of A. The cost and utility values ca,f and ua,f are positive values associated with Da,f which are intended to be estimates of the execution cost and accuracy of Da,f respectively. REMIX enumerates candidate outlier detectors based on a family of prioritized feature subspaces Fp and a family of randomly constructed feature subspaces Fr . The interactive outlier exploration problem is a budgeted optimization problem which selects a subset of detectors with a maximization objective that is a linear combination of two quantities: (i) the total utility of all the selected detectors, and (ii) the total utility of the top-k selected detectors, subject to the following budget and diversity constraints: (i) the total cost the selected detectors does not exceed the budget Ttotal , (ii) each algorithm gets a guaranteed share of the exploration budget, and (iii) each prioritized feature gets a guaranteed share of the exploration budget. 4 The REMIX Framework We now describe the five components of REMIX shown in Figure 2 starting with feature subspace enumeration. 4.1 Feature Subspace and Candidate Detector Enumeration Algorithm 1 describes feature subspace enumeration and has three parts: (i) creating a non-redundant feature bag Fnr (lines 1 – 13), (ii) creating a prioritized family of subspaces Fp (lines 14-18) using a feature ranking 4 Algorithm 1 Feature Subspace Enumeration Input: Data Matrix A Output: Feature subspace families Fp and Fr m S 1: Fnr = A∗,j . Initialize non-redundant feature bag j=1 2: while |Fnr | ≥ 2 do . Bag has at least 2 features P 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: (i6=j)∧(A∗,i ∈Fnr ) σi,j . Mean correlation ∀A∗,j ∈ Fnr , σ̂j ← |Fnr |−1 (p, q) ← arg max(i6=j)∧(A∗,i ∈Fnr )∧(A∗,j ∈Fnr ) σi,j . Max if σp,q ≥ α then . High max correlation? if σ̂p ≥ σ̂q then . Greater average correlation? Fnr ← Fnr \ {A∗,p } . Drop A∗,p else Fnr ← Fnr \ {A∗,q } . Drop A∗,q end if else break . Break out of while loop end if end while Fp = Φ . Initialize to null set for ` ← 1, |Fnr | do S` ← Top-` features in Fnr ranked by their Laplacian scores Fp ← Fp ∪ {S` } . Add prioritized subspace end for Fr = Φ . Initialize to null set for i ← 1, Γ do Ti ← Random subspace with each feature sampled independently at random without replacement from Fnr with probability 21 Fr ← Fr ∪ {Ti } . Add random subspace end for 5 Feature Subspace Enumeration 1 Perspective Factorization and Ensembling Candidate Detector Enumeration 5 2 Mixed Integer Program based Exploration Cost and Utility Estimation 3 4 Figure 2: REMIX Components: REMIX starts by enumerating multiple feature subspaces from the given dataset, which in turn is used to enumerate candidate detectors. Next, REMIX evaluates the cost and utility of all the enumerated detectors (the meta-learning components for training the cost and utility models is not shown in this figure). The cost and utility values are used as part of a mixed integer program (MIP) which selects a subset of candidates for execution based on a utility maximization objective and budget and diversity constraints. The outlier results from the detectors executed by REMIX are factorized into perspectives, and also ensembled into a single set of results. approach and (iii) creating a randomized family of subspaces Fr (lines 19 – 23) used for maximizing coverage and diversity during exploration. Redundant features 6∈ Fnr are not part of subspaces in Fp or Fr . Algorithm 1 begins by initializing Fnr to all features in A (line 1). It then iteratively looks for a member in Fnr which can be considered redundant and hence dropped from Fnr . In order for a feature A∗,p ∈ Fnr to be considered redundant, it needs to (i) be in a maximally correlated feature pair {A∗,p , A∗,q } ⊆ Fnr (line 4), (ii) the correlation coefficient σp,q must be above the REMIX’s redundancy threshold α (line 5), and (iii) of the two features in the pair, A∗,p must have a mean correlation with other features in Fnr that ≥ the mean correlation of A∗,q (line 7). We set the default value of α in REMIX to 0.9 based on our experimental evaluation. It is easy to see that at the end of line 13, Algorithm 1 yields a non-redundant feature bag Fnr with the following property. Observation 1. For any pair of features {A∗,p , A∗,q } ⊆ Fnr , σp,q < α. For any feature A∗,r 6∈ Fnr , ∃A∗,s ∈ Fnr , σr,s ≥ α. The family of randomized feature subspaces Fr is created for the purpose of guaranteeing feature coverage and diversity during exploration. In particular, we select Γ subspaces, where each subspace consists of features selected independently at random without replacement with probability 12 from Fnr . We set the default value of Γ in REMIX to |Fp |/2 to balance the size of the two families. The family of prioritized feature subspaces Fp is created as follows. The features in Fnr are first sorted according to their Laplacian scores [15]. We add |Fnr | subspaces to Fp , where the `th subspace is the set of top-` features in Fnr ranked by their Laplacian scores. We now provide a brief justification for our use of the Laplacian score. Due to lack of space, refer the reader to [15] for the exact details of the Laplacian computation. The Laplacian score is computed as a way to reflect a feature’s ability to preserve locality. In particular, consider the projection A0 of all points in A onto the subspace Fnr ; now, consider the r-nearest neighborhood of points in A0 . Features that respect this r-nearest neighborhood provide a better separation of the inlier class from outlier class within the data. We note that our experimental evaluation in Section 5 consistently demonstrates improved outlier detection accuracy with Fp and Fr as opposed to purely Fr . We also discuss potential alternatives for prioritized feature subspace construction in Section 4.3.1. We enumerate candidate detectors by a cartesian product of Fp ∪ Fr and the set of baseline detection algorithms A. 4.2 Cost Estimation The cost of a candidate detector can be modeled as a function of its algorithm as well as the size of its feature subspace f (n and |f |). The runtime complexity of algorithms in the ‘big-O’ notation provides an asymptotic relationship between cost and input size; however, in REMIX, we seek a more refined model which accounts 6 for lower order terms and the constants hidden by ‘big-O’. We do this by training a multivariate linear regression model for each  algorithm. Specifically, consider the following polynomial: (1 + |f | + n + log |f | + log n)3 − 1. There are 73 − 1 distinct terms in the expansion of this polynomial which can be derived exactly given a feature subspace. The terms1 form the explanatory variables while cost is the dependent variable in the linear regression model. 4.3 Utility Estimation Given a detector Da,f , the utility estimation algorithm (Algorithm 2) first normalizes the features in f , and computes a variety of feature-level statistics for each feature ψ ∈ f . These statistics include the Laplacian score which is a useful measure for unsupervised feature selection (Section 4.1), the standard deviation, skewness which measures the assymetry of the feature distribution, kurtosis which measures the extent to which the feature distribution is heavy-tailed, and entropy which is a measure of the information content in the feature. We note that these computations are done once for each feature in Fnr and is reused for any given any detector. Next, the algorithm computes the meta-feature vector M F V (f ) of feature-subspace-level statistics by combining feature-level statistics. For instance, consider the Laplacian scores of all the features in f ; the mean, median, median absolute deviation, min, max, and standard deviation of all the Laplacian scores provide 6 of the 30 distinct components of M F V (f ) in this step. Finally, it uses an algorithm specific utility model Ua (M F V (f )) to estimate the utility ua,f of Da,f . REMIX trains five distinct linear regression models ULOF , UM D , UABOD , ULOF , and USOD corresponding to each algorithm. These models are trained based on distinct expert labeled datasets from the outlier dataset repository [2]. The explanatory variables for this linear regression are the feature-subspace-level statistics described in Algorithm 2. The dependent variable is the detection accuracy, measured as the fraction of the data points on which both the detector and the expert labeled ground truth agree on the outlier characterization. Algorithm 2 Utility Estimation Input: A candidate detector Da,f Output: The utility ua,f of the detector 1: ∀ψ ∈ f , normalize ψ . One time procedure applied to Fnr 2: ∀ψ ∈ f , extract the following 5 feature-level statistics: Laplacian score, standard deviation, skewness, kurtosis, and entropy . One time procedure applied to Fnr 3: Extract the following 30 feature-subspace-level statistics: mean, median, median absolute deviation, min, max, and standard deviation for each of the 5 feature-level statistics extracted in Step 2. Let M F V (f ) contain these feature subspace-level statistics. 4: Return ua,f = Ua (M F V (f )), where Ua is the utility estimation model learnt for algorithm a 4.3.1 Discussion Estimating or even defining the utility of a detector is significantly harder than estimating its cost. The goal of utility estimation in REMIX is not to learn a perfect model; rather, the goal is merely to learn a utility model which can effectively steer the solution of the mixed integer program (MIP) used by REMIX for exploration (Section 4.4). Our experiments in Section 5 demonstrate that this is indeed the case with REMIX. Further, REMIX is intended to be a flexible framework where alternative mechanisms for utility estimation can be plugged in. For instance, consider Cumulative Mutual Information (CMI) metric and the Apriori-style feature subspace search algorithm presented in [8] for subspace outlier detection. REMIX can use CMI as the detector utility, and this Apriori-style algorithm as an alternative for enumerating prioritized feature subspaces. We chose the meta-learning approach in our implementation since this approach is algorithm agnostic and hence can be generalized easily. 1 The exponent 3 suffices to model the cost of most known outlier detection algorithms 7 4.4 MIP based Exploration REMIX executes only a subset of detectors enumerated by its detector enumeration component (Section 4.1). This subset is determined by solving the following mixed integer program (MIP). max X X za,f ua,f +λ {z } utility of top-k detectors X X X ya,f ua,f (1) a∈A f ∈Fp ∪Fr a∈A f ∈Fp ∪Fr | X | {z utility of all detectors ya,f ca,f ≤ Ttotal } (2) a∈A f ∈Fp ∪Fr X ∀a ∈ A : ya,f ca,f ≥ f ∈Fp ∪Fr ∀f ∈ Fp : X ya,f ca,f ≥ a∈A Ttotal 2 · |A| Ttotal 2 · |Fp | ∀a ∈ A, ∀f ∈ Fp ∪ Fr : za,f ≤ ya,f X X za,f ≤ k (3) (4) (5) (6) a∈A f ∈Fp ∪Fr ∀a ∈ A, ∀f ∈ Fp ∪ Fr : yi,j ∈ {0, 1} (7) ∀a ∈ A, ∀f ∈ Fp ∪ Fr : zi,j ∈ {0, 1} (8) Given an algorithm a and a feature subspace f , ya,f is the binary indicator variable in the MIP which determines if the detector Da,f is chosen for execution in the MIP solution. Recall that ca,f denotes the estimated cost of Da,f . We observe the following. Observation 2. Constraint 2 guarantees that in any feasible solution to the MIP, the total cost of the selected detectors is ≤ Ttotal . The value of the total exploration budget Ttotal is provided by the analyst as part of her interaction with REMIX. Observation 3. Constraint 3 guarantees that in any feasible solution to the MIP, each algorithm is explored total for an estimated duration of time which is ≥ T2·|A| . Observation 4. Constraint 4 guarantees that in any feasible solution to the MIP, each prioritized feature is Ttotal explored for an estimated duration of time which is ≥ 2·|F . This also implies that the exploration focuses p| at least half its total time on prioritized features. Consider the binary indicator variable za,f corresponding to the detector Da,f . Constraint 5 ensures that in any feasible solution to the MIP, za,f can be 1 only if it is chosen in the solution (i.e., ya,f = 1). Constraint 6 ensures at most k of the detectors chosen by the solution have their z-values set to 1. Now consider an optimal solution to Pthe MIP. P Since utility values are non-negative for all detectors, the first part of the objective function a∈A f ∈Fp ∪Fr za,f ua,f is maximized when exactly k detectors have their z-values set to 1 (and not fewer) and when the detectors whose z-values are set to 1 are the ones with the highest utilities amongst the selected detectors. This leads us to the following guarantee. Theorem 5. The optimal solution to the MIP maximizes the sum of utilities of the top-k detectors with highest utilities and the total utility of all the selected detectors scaled by a factor λ. We set k = 10 and λ = 1 in our implementation of REMIX which balances the utility of the top-10 detectors vs the total utility of all the selected detectors. 8 4.5 Perspective Factorization Each detector executed by REMIX provides an outlier score for each data point and the results from different detectors could be potentially divergent. We now present a factorization technique called NMFE (nonnegative matrix factorization and ensembling) for bi-clustering the detection results into a few succinct perspectives. All detectors within a perspective agree on how they characterize outliers although there could be disagreement across perspectives. Let ∆s,p be the outlier score assigned by detector s for data point p normalized across data points to be in the range [0, 1]. Consider the matrix of outlier scores ∆ ∈ [0, 1]t×n , where t is the number of detectors executed by REMIX and n is the number of data points. We perform a rank-g non-negative matrix factorization of ∆ ≈ ΛΩ> , where Λ ∈ Rt×g and Ω ∈ Rn×g , by minimizing the Kullback-Leibler divergence between ∆ and ΛΩ> [11]: min Λ,Ω≥0 X ∆s,p log s,p ∆s,p − ∆s,p + Λs,∗ Ωp,∗ Λs,∗ Ωp,∗ (9) The matrix ΛΩT by definition can be expressed as a sum of g rank-1 matrices whose rows and columns correspond to detectors and data points respectively. In any of these rank-1 matrices, every row (column) is a scaled multiple of any other non-zero row (column), and every entry is between 0 and 1. These properties make it possible for the rank-1 matrices to be visualized as perspectives, or heatmaps where the intensity of a heatmap cell is the value of the corresponding entry in the perspective, as shown in Figure 1. The number of perspectives g is specified by the user as an input to REMIX. Setting g = 1 simply results in a direct averaging (ensembling) of all the detector results into a single perspective. 5 Experiments In this section, we present the evaluation of REMIX on real-world data. 5.1 Data Collection We chose 98 datasets for our study from the outlier dataset repository [2] of the Delft University of Technology. This corpus contains outlier detection datasets labeled by domain experts. These datasets span varied domains such as flowers, breast cancers, heart diseases, sonar signals, genetic diseases, arrhythmia abnormals, hepatitis, diabetes, leukemia, vehicles, housing, and satellite images. Each dataset has benchmark outlier labels, with an entry 1 representing outliers and 0 representing normal points. Figure 3 illustrate some statistics of the 98 data sets. Specifically, Figure 3(a) shows the numbers of features for each dataset sorted in a descending order. In this figure, we can observe that most of the datasets contains less than 100 features while only a small portion of these datasets have more than 1000 features. Figure 3(b) shows the outlier ratio to the total number of data points for each dataset sorted in a descending order. In this figure, we can find that the outlier ratios of more than 50% of the datasets are less than 23.2%. 4970 0.5 0.45 1000 0.4 Outlier ratio Feature number 0.35 100 0.3 0.25 0.2 0.15 10 0.1 0.05 1 0 10 20 30 40 50 60 70 80 90 0 98 0 10 20 30 40 50 60 70 80 90 98 The rankings of data sets with respect to outlier ratio The rankings of data sets with respect to number of features (a) Distribution of feature sizes (b) Distribution of outlier ratios Figure 3: Statistics of the experimental datasets 9 5.2 Cost and Utility Estimation 600 400 Prediction 8 6 0 0 2 200 4 Prediction 10 12 800 14 Among the 98 datasets, we used 96 datasets to train and test the cost and utility estimation models for each of the 5 baseline algorithms in our REMIX implementation (with a 70%-30% split for train vs test). Figures 4(a) and 4(b) present the performance of the cost and utility models for the LOF algorithm from a specific run. Recall that the utility ua,f estimates the fraction of the data points on which the detector da,f and the expert labels agree on the outlier characterization. Consider the Hamming distance between the outlier bit vector (1 if outlier, 0 otherwise) created by the detector and the outlier bit vector created by the expert labels. Clearly, this Hamming distance equals n · (1 − ua,f ) where n is the number of data points. Figure 4(b) plots the estimated Hamming distance on the y-axis and the actual distance as observed by running the detector on the x-axis. The red lines in Figures 4(a) and 4(b) represent ideal predictors. As expected, the cost estimator clearly performs better than the utility estimator. However, as mentioned in Section 4.3.1 our goal in utility estimation is not a perfect predictive model but merely to steer the MIP towards better solutions. We demonstrate this to be the case in our next set of experiments. 0 2 4 6 8 10 12 14 0 200 Groundtruth 400 600 800 Groundtruth (a) Cost Estimation (b) Utility Estimation Figure 4: Cost and Utility Estimation 5.3 Detection Accuracy and Cost 1.2 1 0.08 0.04 LOF MD ABOD FBOD SOD Our 0.035 0.03 LOF MD ABOD FBOD SOD Our 0.07 0.06 0.8 0.025 0.05 0.6 0.02 0.04 0.015 0.03 0.01 0.02 0.005 0.01 LOF MD ABOD FBOD SOD Our 0.4 0.2 0 @10 @13 @15 @17 (a) Precision@N @20 0 @10 @13 @15 @17 (b) Recall@N @20 0 @10 @13 @15 @17 @20 (c) Fmeasure@N Figure 5: Comparison of REMIX with baseline algorithms on the cardiac arrhythmia dataset We now present a detailed study of the detection accuracy vs cost of REMIX on two datasets from the corpus. The first dataset is cardiac arrhythmia. Irregularity in heart beat may be harmless or life threatening. The dataset contains medical records like age, weight and patient’s electrocardiograph related data of arrhythmia patients and outlier healthy people. The task is to spot outlier healthy people from arrhythmia patients. The second dataset is about sonar signals bounced off of a metal cylinder. The dataset contains outlier sonar signals bounced off a roughly cylindrical rock. The task is to separate outlier rock related sonar signals from cylinder-related sonar signals. 5.3.1 Evaluation Metrics Recall that the REMIX perspective factorization scheme can be used as an outlier ensembling technique simply by setting the number of perspectives to 1. We use REMIX in this ensembling mode for the rest of 10 1.2 1 0.35 0.25 LOF MD ABOD FBOD SOD Our 0.2 0.8 LOF MD ABOD FBOD SOD Our 0.3 0.25 0.15 LOF MD ABOD FBOD SOD Our 0.2 0.6 0.15 0.1 0.4 0.1 0.05 0.2 0 0.05 @10 @13 @15 @17 0 @20 @10 (a) Precision@N @13 @15 @17 @20 0 (b) Recall@N @10 @13 @15 @17 @20 (c) Fmeasure@N Figure 6: Comparison of REMIX with baseline algorithms on the sonar signals dataset 0.8 1.1 EE RSR RS1 RS1R NMFE 1 0.9 0.7 0.8 EE RSR RS1 RS1R NMFE 0.75 0.6 0.7 0.5 0.65 EE RSR RS1 RS1R NMFE 0.8 0.4 0.6 0.3 0.55 0.7 0.6 0.5 0.4 @10 @13 @15 @17 (a) Precision@N @20 0.2 0.5 0.1 0.45 0 @10 @13 @15 @17 (b) Recall@N @20 0.4 @10 @13 @15 @17 @20 (c) Fmeasure@N Figure 7: Comparison of REMIX with other exploration and ensemble strategies on the cardiac arrhythmia dataset our experiments. We now define Precision@N, Recall@N, and F-measure@N which we use to compare the detection accuracy of REMIX with various other approaches. Let 1 denote outlier label and 0 denote the label for normal points in the expert labeled data. Precision@N Given the top-N list of data points LN sorted in a descending order of the predicted T |LN L=1 | outlier scores, the precision is defined as: Precision@N = where L=1 are the data points with N expert outlier label = 1. Recall@N Given the top-N list of data points T LN sorted in a descending order of the predicted outlier scores, the recall is defined as: Recall@N = |LN|L=1L|=1 | where L=1 are the outlier data points with label = 1. F-measure@N F-measure@N incorporates both precision and recall in a single metric by taking their ×Recall@N harmonic mean: F@N = 2×Precision@N Precision@N +Recall@N 5.3.2 Baseline Algorithms We report the performance comparison of REMIX vs baseline algorithms on the sonar signals dataset and the cardiac arrhythmia dataset in terms of Precision, Recall, and F-measure. In this experiment, we provide sufficient time for the baseline algorithms in {LOF, M D, ABOD, F BOD, SOD} to complete their executions. Meanwhile, we set a limited exploration time budget of 0.5 second for REMIX. Results on Effectiveness Comparison. Figure 5 shows that on the cardiac arrhythmia dataset, REMIX outperforms the five baseline algorithms in terms Precision@N, Recall@N, and Fmeasure@N (N=10, 13, 15, 17, 20). Figure 6 shows that on the sonar signal dataset, our method is consistently better than the baseline algorithms in terms Precision@N, Recall@N, and Fmeasure@N (N=10, 13, 15, 17, 20). Results on Efficiency Comparison. Figure 9 jointly show that on the cardiac arrhythmia dataset and the sonar signal dataset, Mahalanobis distance (MD) takes the least time; Angle-based outlier detection (ABOD) takes the most time as angle is expensive to compute; REMIX falls in the middle of this cost spectrum. 11 1.3 1.2 1.1 0.35 0.25 EE RSR RS1 RS1R NMFE 0.2 EE RSR RS1 RS1R NMFE 0.3 EE RSR RS1 RS1R NMFE 0.25 1 0.15 0.9 0.2 0.8 0.15 0.1 0.7 0.1 0.6 0.05 0.05 0.5 0.4 @10 @13 @15 @17 0 @20 0 @10 (a) Precision@N @13 @15 @17 @20 @10 (b) Recall@N @13 @15 @17 @20 (c) Fmeasure@N Figure 8: Comparison of REMIX with other exploration and ensemble strategies on the sonar signals dataset 10 2 10 2 46.02 31.769 31.369 23.429 10 1 10 1 4.398 2.8 10 0 0.859 0.478 10 0 0.481 0.158 10 -1 10 -1 10 -2 0.043 0.00184 10 -2 LOF MD ABOD FBOD SOD Our 10 -3 LOF MD ABOD FBOD SOD Our (a) Times costs on the cardiac (b) Times costs on the sonar arrhythmia dataset signal dataset Figure 9: Comparison of execution costs of REMIX and baseline algorithms 5.3.3 The Effectiveness and Efficiency of REMIX NMFE We study the effectiveness of the REMIX NMFE ensembling strategy, in which we used the rank-1 NMF to factorize the outlier score matrix ∆ ≈ ΛΩ> and treat Ω as the predicted ensemble outlier scores. Let t denote the number of detectors selected in the REMIX MIP solution. Let C be the set of all candidate detectors enumerated by REMIX. We compared REMIX with the following exploration and ensembling strategies: (1) Exhaustive Ensemble (EE): we execute all the detectors in C and averaged all the outlier scores; (2) Randomly select t detectors (RSR): we randomly select and execute t detectors from C, and then average the outlier scores of these detectors; (3) Randomly select 1 detector (RS1): we randomly select one detector and use its results; (4) Randomly select 1 detector in the MIP solution (RS1R): we randomly select one detector in the MIP solution and use its results; In this experiment, we provide sufficient time for all strategies complete their execution. We set a limited time budget of 0.5 seconds for REMIX. Results on Effectiveness Comparison. Figure 7 shows that on the cardiac arrhythmia dataset our strategy outperforms the other exploration and ensembling strategies in terms of Precision@N, Recall@N, and Fmeasure@N (N=10, 13, 15, 17, 20). Figure 8 shows that on the sonar signal dataset, REMIX is consistently better than the other strategies in terms of Precision@N, Recall@N, and Fmeasure@N (N=10, 13, 15, 17, 20). Results on Efficiency Comparison. Figure 10(a) shows that on the cardiac arrhythmia dataset REMIX takes 0.48 second, and EE, RSR, RS1 require much more time. While RS1R takes only 0.0037 second, its detection accuracy is lower than ours. Figure 10(b) shows on the sonar signal dataset, our strategy takes only 0.49 second, which is much less than the time costs of EE, RSR, RS1. While RS1R takes only 0.0033 second, our method outperforms RS1R with respect to detection accuracy. 6 Conclusions and Future Directions In this paper, we presented REMIX, a modular framework for outlier exploration which is the first to study the problem of outlier detection in an interactive setting. At the heart of REMIX is an optimization 12 10 4 10 3 10 2 10 4 5931.62 10 3 10 2 10 1 10 1 0 0 10 0.471545 0.313311 10 7097.053 1597.939 1336.612 -1 10 10 10 -2 11.02027 0.4784815 -1 10 -2 0.0037129 10 -3 EE RSR RS1 RS1R 0.003299873 NMFE 10 -3 EE RSR RS1 RS1R NMFE (a) Times costs on the cardiac (b) Times costs on the sonar arrhythmia dataset signal dataset Figure 10: Comparison of execution costs of REMIX and other exploration strategies approach which systematically steers the selection of base outlier detectors in a manner that is sensitive to their execution costs, while maximizing an aggregate utility function of the solution and also ensuring diversity across algorithmic choice points present in exploration. Data analysts are naturally interested in extracting and interpreting outliers through multiple detection mechanisms since distinct outliers could lead to distinct actionable insights within the application domain. REMIX facilitates this understanding in a practical manner by shifting the burden of exploration away from the analyst through automation, and by summarizing the results of automated exploration into a few coherent heatmap visualizations called perspectives. We believe many of the techniques presented in this paper could be of independent interest to other machine learning problems. We are interested in extending the REMIX exploratory approach beyond outlier detection to clustering of high-dimensional data. Another interesting direction of research is sequential recommendations for visual outlier exploration: in particular, we are interested in approaches for presenting outlier insights approximately through a sequence of visualizations (like heatmaps) such that both the length of this sequence as well the perceptual error involved across the visualizations is minimized while coverage across the various exploratory choice points is maximized. Also the study of outlier aspect mining in an interactive setting – which deals with the inverse problem of finding explanatory features which characterize a given set of points as outliers in a cost sensitive manner – presents a new and interesting direction of research. References [1] Data robot. http://www.datarobot.com, 2017. [2] Outlier detection datasets. http://homepage.tudelft.nl/n9d04/occ/index.html, 2017. [3] Sytree. http://www.skytree.net, 2017. [4] Charu C Aggarwal. Outlier analysis. Springer Science & Business Media, 2013. [5] Charu C Aggarwal and Saket Sathe. Theoretical foundations and algorithms for outlier ensembles. ACM SIGKDD Explorations Newsletter, 17(1):24–47, 2015. [6] Alain Biem, Maria Butrico, Mark Feblowitz, Tim Klinger, Yuri Malitsky, Kenney Ng, Adam Perer, Chandra Reddy, Anton Riabov, Horst Samulowitz, Daby M. Sow, Gerald Tesauro, and Deepak S. Turaga. Towards cognitive automation of data science. In Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 25-30, 2015, Austin, Texas, USA., pages 4268–4269, 2015. [7] Markus M Breunig, Hans-Peter Kriegel, Raymond T Ng, and Jörg Sander. Lof: identifying density-based local outliers. In ACM sigmod record, volume 29, pages 93–104. ACM, 2000. 13 [8] Klemens Bhm, Fabian Keller, Emmanuel Mller, Hoang Vu Nguyen, and Jilles Vreeken. Cmi: An information-theoretic contrast measure for enhancing subspace cluster and outlier detection. In SDM, pages 198–206. SIAM, 2013. [9] Santanu Das, Bryan L Matthews, Ashok N Srivastava, and Nikunj C Oza. Multiple kernel learning for heterogeneous anomaly detection: algorithm and aviation safety case study. In Proceedings of the 16th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 47–56. ACM, 2010. [10] Kyriaki Dimitriadou, Olga Papaemmanouil, and Yanlei Diao. Explore-by-example: An automatic query steering framework for interactive data exploration. In Proceedings of the 2014 ACM SIGMOD International Conference on Management of Data, SIGMOD ’14, pages 517–528, New York, NY, USA, 2014. ACM. [11] Chris H. Q. Ding, Tao Li, and Michael I. Jordan. Convex and semi-nonnegative matrix factorizations. IEEE Trans. Pattern Anal. Mach. Intell., 32(1):45–55, January 2010. [12] David Duvenaud, James Robert Lloyd, Roger Grosse, Joshua B. Tenenbaum, and Zoubin Ghahramani. Structure discovery in nonparametric regression through compositional kernel search. In Proceedings of the 30th International Conference on Machine Learning, June 2013. [13] Jing Gao, Wei Fan, Deepak Turaga, Srinivasan Parthasarathy, and Jiawei Han. A spectral framework for detecting inconsistency across multi-source object relationships. In Data Mining (ICDM), 2011 IEEE 11th International Conference on, pages 1050–1055. IEEE, 2011. [14] R.B. Grosse, R. Salakhutdinov, W.T. Freeman, and J.B. Tenenbaum. Exploiting compositionality to explore a large space of model structures. In Uncertainty in Artificial Intelligence, 2012. [15] Xiaofei He, Deng Cai, and Partha Niyogi. Laplacian score for feature selection. In Advances in neural information processing systems, pages 507–514, 2005. [16] Victoria J Hodge and Jim Austin. A survey of outlier detection methodologies. Artificial intelligence review, 22(2):85–126, 2004. [17] Alexander Kalinin, Ugur Cetintemel, and Stan Zdonik. Interactive data exploration using semantic windows. In SIGMOD Conference, 2014. [18] Fabian Keller, Emmanuel Müller, and Klemens Böhm. Hics: high contrast subspaces for density-based outlier ranking. In Data Engineering (ICDE), 2012 IEEE 28th International Conference on, pages 1037–1048. IEEE, 2012. [19] Fabian Keller, Emmanuel Mller, Andreas Wixler, and Klemens Bhm. Flexible and adaptive subspace search for outlier analysis. In Qi He, Arun Iyengar, Wolfgang Nejdl, Jian Pei, and Rajeev Rastogi, editors, CIKM, pages 1381–1390. ACM, 2013. [20] Udayan Khurana, Deepak Turaga, Horst Samulowitz, and Srinivasan Parthasarathy. Cognito: Automated feature engineering for supervised learning. IEEE, 2016. [21] Hans-Peter Kriegel, Peer Kröger, Erich Schubert, and Arthur Zimek. Outlier detection in axis-parallel subspaces of high dimensional data. In Pacific-Asia Conference on Knowledge Discovery and Data Mining, pages 831–838. Springer, 2009. [22] Hans-Peter Kriegel, Arthur Zimek, et al. Angle-based outlier detection in high-dimensional data. In Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 444–452. ACM, 2008. [23] Aleksandar Lazarevic and Vipin Kumar. Feature bagging for outlier detection. In Proceedings of the eleventh ACM SIGKDD international conference on Knowledge discovery in data mining, pages 157– 166. ACM, 2005. 14 [24] Lei Li, Ding-Ding Wang, Shun-Zhi Zhu, and Tao Li. Personalized news recommendation: a review and an experimental investigation. Journal of computer science and technology, 26(5):754–766, 2011. [25] James Robert Lloyd, David Duvenaud, Roger Grosse, Joshua B. Tenenbaum, and Zoubin Ghahramani. Automatic construction and Natural-Language description of nonparametric regression models. In Association for the Advancement of Artificial Intelligence (AAAI), 2014. [26] Tyler Lu and Craig Boutilier. Budgeted social choice: From consensus to personalized decision making. In IJCAI, volume 11, pages 280–286, 2011. [27] Alejandro Marcos Alvarez, Makoto Yamada, Akisato Kimura, and Tomoharu Iwata. Clustering-based anomaly detection in multi-view data. In Proceedings of the 22nd ACM international conference on Conference on information & knowledge management, pages 1545–1548. ACM, 2013. [28] Alex Memory and Ted Senator. Towards robust anomaly detection ensembles using explanations. In In the ODDx3 workshop of KDD2015, 2015. [29] Emmanuel Muller, Ira Assent, Patricia Iglesias, Yvonne Mulle, and Klemens Bohm. Outlier ranking via subspace analysis in multiple views of the data. In Data Mining (ICDM), 2012 IEEE 12th International Conference on, pages 529–538. IEEE, 2012. [30] Emmanuel Müller, Matthias Schiffer, and Thomas Seidl. Statistical selection of relevant subspace projections for outlier ranking. In Data Engineering (ICDE), 2011 IEEE 27th International Conference on, pages 434–445. IEEE, 2011. [31] Shebuti Rayana and Leman Akoglu. Less is more: Building selective anomaly ensembles. arXiv preprint arXiv:1501.01924, 2015. [32] Ashish Sabharwal, Horst Samulowitz, and Gerald Tesauro. Selecting near-optimal learners via incremental data allocation. In Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA., pages 2007–2015, 2016. [33] Tarique Siddiqui, Albert Kim, John Lee, Karrie Karahalios, and Aditya Parameswaran. Effortless data exploration with zenvisage: An expressive and interactive visual analytics system. Proc. VLDB Endow., 10(4):457–468, November 2016. [34] Abdul Wasay, Manos Athanassoulis, and Stratos Idreos. Queriosity: Automated data exploration. In Barbara Carminati and Latifur Khan, editors, BigData Congress, pages 716–719. IEEE, 2015. [35] Arthur Zimek, Ricardo J.G.B. Campello, and Jörg Sander. Ensembles for unsupervised outlier detection: Challenges and research questions a position paper. SIGKDD Explor. Newsl., 15(1):11–22, March 2014. 15
2cs.AI
Functional Units for Natural Numbers arXiv:0911.1851v3 [cs.PL] 17 Oct 2010 J.A. Bergstra and C.A. Middelburg Informatics Institute, Faculty of Science, University of Amsterdam, Science Park 107, 1098 XG Amsterdam, the Netherlands [email protected],[email protected] Abstract. Interaction with services provided by an execution environment forms part of the behaviours exhibited by instruction sequences under execution. Mechanisms related to the kind of interaction in question have been proposed in the setting of thread algebra. Like thread, service is an abstract behavioural concept. The concept of a functional unit is similar to the concept of a service, but more concrete. A state space is inherent in the concept of a functional unit, whereas it is not inherent in the concept of a service. In this paper, we establish the existence of a universal computable functional unit for natural numbers and related results. Keywords: functional unit, instruction sequence. 1998 ACM Computing Classification: F.1.1, F.4.1. 1 Introduction We take the view that sequential programs are in essence sequences of instructions, and that interaction with services provided by an execution environment forms part of the behaviours exhibited by instruction sequences under execution (see e.g. [1,7]). The interaction in question is concerned with the processing of instructions. In earlier work, mechanisms that have a direct bearing on this kind of interaction have been proposed in the setting of basic thread algebra (see e.g. [3,4]). Both thread and service are abstract behavioural concepts. We experienced recently limitations of the concept of a service because a state space is not inherent in this concept. This forms the greater part of our motivation for introducing and studying the concept of a functional unit in this paper. This concept is similar to the concept of a service, but it is at a lower level of abstraction. In the concept of a functional unit, a state space is inherent. Rather than first considering functional units in general for an arbitrary state space, we first consider the special case where the state space is the set of natural numbers. This case is arguably the simplest significant case. We establish general results concerning functional units for natural numbers. The main result is the existence of a universal computable functional unit for natural numbers. Results like this one are outside the scope of the concept of a service. The work presented in this paper belongs to a line of research whose working hypothesis is that instruction sequence is a central notion of computer science. In this line of research, program algebra [1] is the setting used for investigating issues in which instruction sequences are involved. Instruction sequences are also involved in the issues concerning functional units investigated in this paper. The starting-point of program algebra is the perception of a program as a single-pass instruction sequence, i.e. a finite or infinite sequence of instructions of which each instruction is executed at most once and can be dropped after it has been executed or jumped over. This perception is simple, appealing, and links up with practice. Moreover, basic thread algebra [1] is the setting used for modelling the behaviours exhibited by instruction sequences under execution.1 In this paper, we use a program notation rooted in program algebra, instead of program algebra itself. This paper is organized as follows. First, we give a survey of the program notation used in this paper (Section 2) and define its semantics using basic thread algebra (Section 3). Next, we extend basic thread algebra with operators that are related to the processing of instructions by services (Section 4). Then, we introduce the concept of a functional unit and related concepts (Section 5). After that, we investigate functional units for natural numbers (Section 6). We also make some remarks about functional units for finite state spaces (Section 7). Finally, we make some concluding remarks (Section 8). 2 PGLB with Boolean Termination In this section, we give a survey of the program notation PGLBbt . This program notation is a variant of the program notation PGLB, which belongs to a hierarchy of program notations rooted in program algebra presented in [1]. PGLBbt is PGLB with the Boolean termination instructions !t and !f from [3] instead of the termination instruction ! from [1]. PGLB and PGLBbt are close to existing assembly languages and have relative jump instructions. In PGLBbt , it is assumed that a fixed but arbitrary non-empty finite set A of basic instructions has been given. The intuition is that the execution of a basic instruction may modify a state and produces t or f at its completion. PGLBbt has the following primitive instructions: – – – – – – – for each a ∈ A, a plain basic instruction a; for each a ∈ A, a positive test instruction +a; for each a ∈ A, a negative test instruction −a; for each l ∈ N, a forward jump instruction #l; for each l ∈ N, a backward jump instruction \#l; a positive termination instruction !t; a negative termination instruction !f. PGLBbt instruction sequences have the form u1 ; . . . ; uk , where u1 , . . . , uk are primitive instructions of PGLBbt . On execution of a PGLBbt instruction sequence, these primitive instructions have the following effects: 1 In [1], basic thread algebra is introduced under the name basic polarized process algebra. 2 – the effect of a positive test instruction +a is that basic instruction a is executed and execution proceeds with the next primitive instruction if t is produced and otherwise the next primitive instruction is skipped and execution proceeds with the primitive instruction following the skipped one – if there is no primitive instruction to proceed with, deadlock occurs; – the effect of a negative test instruction −a is the same as the effect of +a, but with the role of the value produced reversed; – the effect of a plain basic instruction a is the same as the effect of +a, but execution always proceeds as if t is produced; – the effect of a forward jump instruction #l is that execution proceeds with the lth next primitive instruction – if l equals 0 or there is no primitive instruction to proceed with, deadlock occurs; – the effect of a backward jump instruction \#l is that execution proceeds with the lth previous primitive instruction – if l equals 0 or there is no primitive instruction to proceed with, deadlock occurs; – the effect of the positive termination instruction !t is that execution terminates and in doing so delivers the Boolean value t; – the effect of the negative termination instruction !t is that execution terminates and in doing so delivers the Boolean value f. 3 Thread Extraction In this section, we make precise in the setting of BTAbt (Basic Thread Algebra with Boolean termination) which behaviours are exhibited on execution by PGLBbt instruction sequences. We start by reviewing BTAbt . In BTAbt , it is assumed that a fixed but arbitrary non-empty finite set A of basic actions, with tau 6∈ A, has been given. We write Atau for A ∪ {tau}. The members of Atau are referred to as actions. A thread is a behaviour which consists of performing actions in a sequential fashion. Upon each basic action performed, a reply from an execution environment determines how it proceeds. The possible replies are the Boolean values t (standing for true) and f (standing for false). Performing the action tau leads always to the reply t. BTAbt has one sort: the sort T of threads. We make this sort explicit because we will extend BTAbt with additional sorts in Section 4. To build terms of sort T, BTAbt has the following constants and operators: – – – – the deadlock constant D : T; the positive termination constant S+ : T; the negative termination constant S− : T; for each a ∈ Atau , the binary postconditional composition operator E a D : T × T → T. We assume that there is a countably infinite set of variables of sort T which includes x, y, z. Terms of sort T are built as usual. We use infix notation for 3 Table 1. Axiom of BTAbt x E tau D y = x E tau D x T1 Table 2. Approximation induction principle V n≥0 πn (x) = πn (y) ⇒ x = y π0 (x) = D AIP P0 πn+1 (S+) = S+ P1a πn+1 (S−) = S− P1b πn+1 (D) = D P2 πn+1 (x E a D y) = πn (x) E a D πn (y) P3 postconditional composition. We introduce action prefixing as an abbreviation: a ◦ p, where p is a term of sort T, abbreviates p E a D p. The thread denoted by a closed term of the form p E a D q will first perform a, and then proceed as the thread denoted by p if the reply from the execution environment is t and proceed as the thread denoted by q if the reply from the execution environment is f. The threads denoted by D, S+ and S− will become inactive, terminate with Boolean value t and terminate with Boolean value f, respectively. BTAbt has only one axiom. This axiom is given in Table 1. Each closed BTAbt term of sort T denotes a thread that will become inactive or terminate after it has performed finitely many actions. Infinite threads can be described by linear recursion. A linear recursive specification over BTAbt is a set of recursion equations E = {x = tx | x ∈ V }, where V is a set of variables of sort T and each tx is a BTAbt term of the form D, S+, S− or y E a D z with y, z ∈ V . We are only interested in models of BTAbt in which linear recursive specifications have unique solutions. Regular threads, i.e. threads that can only be in a finite number of states, are solutions of finite linear recursive specifications. To reason about infinite threads, we assume the infinitary conditional equation AIP (Approximation Induction Principle). AIP is based on the view that two threads are identical if their approximations up to any finite depth are identical. The approximation up to depth n of a thread is obtained by cutting it off after it has performed n actions. In AIP, the approximation up to depth n is phrased in terms of the unary projection operator πn : T → T. AIP and the axioms for the projection operators are given in Table 2. In this table, a stands for an arbitrary action from Atau and n stands for an arbitrary natural number. The behaviours exhibited on execution by PGLBbt instruction sequences are considered to be regular threads, with the basic instructions taken for basic actions. The thread extraction operation | | defines, for each PGLBbt instruction sequence, the behaviour exhibited on execution by that PGLBbt instruction sequence. The thread extraction operation is defined by |u1 ; . . . ; uk | = |1, u1 ; . . . ; uk |, where the auxiliary operation | , | is defined by the equations given in 4 Table 3. Defining equations for thread extraction operation |i, u1 ; . . . ; uk | = D if not 1 ≤ i ≤ k |i, u1 ; . . . ; uk | = a ◦ |i + 1, u1 ; . . . ; uk | if ui = a |i, u1 ; . . . ; uk | = |i + 1, u1 ; . . . ; uk | E a D |i + 2, u1 ; . . . ; uk | if ui = +a |i, u1 ; . . . ; uk | = |i + 2, u1 ; . . . ; uk | E a D |i + 1, u1 ; . . . ; uk | if ui = −a |i, u1 ; . . . ; uk | = |i + l, u1 ; . . . ; uk | if ui = #l . |i, u1 ; . . . ; uk | = |i − l, u1 ; . . . ; uk | if ui = \#l |i, u1 ; . . . ; uk | = S+ if ui = !t |i, u1 ; . . . ; uk | = S− if ui = !f Table 3 (for a ∈ A and l, i ∈ N) and the rule that |i, u1 ; . . . ; uk | = D if ui is the beginning of an infinite jump chain.2 4 Interaction between Threads and Services A thread may perform a basic action for the purpose of requesting a named service to process a method and to return a reply value at completion of the processing of the method. In this section, we extend BTAbt such that this kind of interaction between threads and services can be dealt with, resulting in TAtsi bt . This involves the introduction of service families: collections of named services. It is assumed that a fixed but arbitrary non-empty finite set M of methods has been given. Methods play the role of commands. A service is able to process certain methods. The processing of a method by a service may involve a change of state of the service and at completion of the processing of the method the service produces a reply value. The set R of reply values is the set {t, f, d}. In SF, the algebraic theory of service families introduced below, the following is assumed with respect to services: – a set S of services has been given together with: ∂ : S → S; • for each m ∈ M, a total function ∂m • for each m ∈ M, a total function ̺m : S → R; ∂ (S) = S satisfying the condition that there exists a unique S ∈ S with ∂m and ̺m (S) = d for all m ∈ M; – a signature ΣS has been given that includes the following sort: • the sort S of services; and the following constant and operators: • the empty service constant δ : S; ∂ • for each m ∈ M, the derived service operator ∂m : S → S; – S and ΣS are such that: • each service in S can be denoted by a closed term of sort S; 2 This rule can be formalized, cf. [2]. 5 ∂ • the constant δ denotes the unique S ∈ S such that ∂m (S) = S and ̺m (S) = d for all m ∈ M; ∂ ∂ (t) denotes service ∂m (S). • if closed term t denotes service S, then ∂m When a request is made to service S to process method m: – if ̺m (S) 6= d, then S processes m, produces the reply ̺m (S), and next ∂ (S); proceeds as ∂m – if ̺m (S) = d, then S rejects the request to process method m. ∂ The unique service S such that ∂m (S) = S and ̺m (S) = d for all m ∈ M is called the empty service. It is the service that is unable to process any method. It is also assumed that a fixed but arbitrary non-empty finite set F of foci has been given. Foci play the role of names of services in the service family offered by an execution environment. A service family is a set of named services where each name occurs only once. SF has the sorts, constants and operators in ΣS and in addition the following sort: – the sort SF of service families; and the following constant and operators: – – – – the empty service family constant ∅ : SF; for each f ∈ F , the unary singleton service family operator f. : S → SF; the binary service family composition operator ⊕ : SF × SF → SF; for each F ⊆ F , the unary encapsulation operator ∂F : SF → SF. We assume that there is a countably infinite set of variables of sort SF which includes u, v, w. Terms are built as usual in the many-sorted case (see e.g. [8,10]). We use prefix notation for the singleton service family operators and infix notation for the service family composition operator. The service family denoted by ∅ is the empty service family. The service family denoted by a closed term of the form f.H consists of one named service only, the service concerned is the service denoted by H, and the name of this service is f . The service family denoted by a closed term of the form C ⊕ D consists of all named services that belong to either the service family denoted by C or the service family denoted by D. In the case where a named service from the service family denoted by C and a named service from the service family denoted by D have the same name, they collapse to an empty service with the name concerned. The service family denoted by a closed term of the form ∂F (C) consists of all named services with a name not in F that belong to the service family denoted by C. The service family composition operator takes the place of the non-interfering combination operator from [4]. As suggested by the name, service family composition is composition of service families. Non-interfering combination is composition of services, which has the disadvantage that its usefulness is rather limited without an additional renaming mechanism. 6 Table 4. Axioms of SF u⊕∅=u SFC1 u⊕v =v⊕u SFC2 ∂F (∅) = ∅ SFE1 ∂F (f.H) = ∅ if f ∈ F SFE2 (u ⊕ v) ⊕ w = u ⊕ (v ⊕ w) SFC3 ∂F (f.H) = f.H if f ∈ / F SFE3 f.H ⊕ f.H ′ = f.δ ∂F (u ⊕ v) = ∂F (u) ⊕ ∂F (v) SFC4 SFE4 The axioms of SF are given in Table 4. In this table, f stands for an arbitrary focus from F and H and H ′ stand for arbitrary closed terms of sort S. The axioms of SF simply formalize the informal explanation given above. Below we will introduce two operators related to the interaction between threads and services. They are called the apply operator and the reply operator. The apply operator is concerned with the effects of threads on service families and therefore produces service families. The reply operator is concerned with the effects of service families on the Boolean values that threads deliver at their termination. The reply operator does not only produce Boolean values: it produces a special value in cases where no termination takes place. For the set A of basic actions, we take the set {f.m | f ∈ F , m ∈ M}. Both operators mentioned above relate to the processing of methods by services from a service family in pursuance of basic actions performed by a thread. The service involved in the processing of a method is the service whose name is the focus of the basic action in question. TAtsi bt has the sorts, constants and operators of both BTAbt and SF, and in addition the following sort: – the sort R of replies; and the following constants and operators: – the reply constants t, f, d : R; – the binary apply operator • : T × SF → SF; – the binary reply operator ! : T × SF → R. We use infix notation for the apply and reply operators. The service family denoted by a closed term of the form p • C and the reply denoted by a closed term of the form p ! C are the service family and reply, respectively, that result from processing the method of each basic action with a focus of the service family denoted by C that the thread denoted by p performs, where the processing is done by the service in that service family with the focus of the basic action as its name. When the method of a basic action performed by a thread is processed by a service, the service changes in accordance with the method concerned, and affects the thread as follows: the two ways to proceed reduces to one on the basis of the reply value produced by the service. The reply is the Boolean value that the thread denoted by p delivers at termination if it terminates and the value d (standing for divergent) if it does not terminate. 7 Table 5. Axioms for apply operator S+ • u = u A1 S− • u = u A2 D•u=∅ A3 (tau ◦ x) • u = x • u A4 (x E f.m D y) • ∂{f } (u) = ∅ (x E f.m D y) • (f.H ⊕ ∂{f } (u)) = (x E f.m D y) • (f.H ⊕ ∂{f } (u)) = A5 ∂ x • (f. ∂m H ∂ y • (f. ∂m H ⊕ ∂{f } (u)) if ̺m (H) = t A6 ⊕ ∂{f } (u)) if ̺m (H) = f A7 (x E f.m D y) • (f.H ⊕ ∂{f } (u)) = ∅ V n≥0 πn (x) • u = πn (y) • v ⇒ x • u = y • v if ̺m (H) = d A8 A9 Table 6. Axioms for reply operator S+ ! u = t R1 S− ! u = f R2 D!u=d R3 (tau ◦ x) ! u = x ! u R4 (x E f.m D y) ! ∂{f } (u) = d R5 ∂ H ⊕ ∂{f } (u)) if ̺m (H) = t R6 (x E f.m D y) ! (f.H ⊕ ∂{f } (u)) = x ! (f. ∂m ∂ H ⊕ ∂{f } (u)) if ̺m (H) = f R7 (x E f.m D y) ! (f.H ⊕ ∂{f } (u)) = y ! (f. ∂m (x E f.m D y) ! (f.H ⊕ ∂{f } (u)) = d V n≥0 πn (x) ! u = πn (y) ! v ⇒ x ! u = y ! v if ̺m (H) = d R8 R9 The axioms of TAtsi bt are the axioms of BTAbt , the axioms of SF, and the axioms given in Tables 5 and 6. In these tables, f stands for an arbitrary focus from F , m stands for an arbitrary method from M, H stands for an arbitrary term of sort S, and n stands for an arbitrary natural number. The axioms simply formalize the informal explanation given above and in addition stipulate what is the result of apply and reply if inappropriate foci or methods are involved. Axioms A9 and R9 allow for reasoning about infinite threads in the contexts of apply and reply, respectively. 5 Functional Units In this section, we introduce the concept of a functional unit and related concepts such as a functional unit degree. It is assumed that a non-empty set S of states has been given. As before, it is assumed that a non-empty finite set M of methods has been given. However, in the setting of functional units, methods serve as names of operations on a state space. For that reason, the members of M will henceforth be called method names. 8 A method operation on S is a total function from S to B×S . A partial method operation on S is a partial function from S to B × S . We write MO(S ) for the set of all method operations on S . We write M r and M e , where M ∈ MO(S ), for the unique functions R : S → B and E : S → S , respectively, such that M (s) = (R(s), E(s)) for all s ∈ S . A functional unit for S is a finite subset H of M × MO(S ) such that (m, M ) ∈ H and (m, M ′ ) ∈ H implies M = M ′ . We write F U(S ) for the set of all functional units for S . We write I(H), where H ∈ F U(S ), for the set {m ∈ M | ∃M ∈ MO(S ) • (m, M ) ∈ H}. We write mH , where H ∈ F U(S ) and m ∈ I(H), for the unique M ∈ MO(S ) such that (m, M ) ∈ H. We look upon the set I(H), where H ∈ F U (S ), as the interface of H. It looks to be convenient to have a notation for the restriction of a functional unit to a subset of its interface. We write (I, H), where H ∈ F U(S ) and I ⊆ I(H), for the functional unit {(m, M ) ∈ H | m ∈ I}. Let H ∈ F U(S ). Then an extension of H is an H′ ∈ F U (S ) such that H ⊆ H′ . The following is a simple illustration of the use of functional units. An unbounded counter can be modelled by a functional unit for N with method operations for set to zero, increment by one, decrement by one, and test on zero. According to the definition of a functional unit, ∅ ∈ F U(S ). By that we have a unique functional unit with an empty interface, which is not very interesting in itself. However, when considering services that behave according to functional units, ∅ is exactly the functional unit according to which the empty service δ (the service that is not able to process any method) behaves. The method names attached to method operations in functional units should not be confused with the names used to denote specific method operations in describing functional units. Therefore, we will comply with the convention to use names beginning with a lower-case letter in the former case and names beginning with an upper-case letter in the latter case. We will use PGLBbt instruction sequences to derive partial method operations from the method operations of a functional unit. We write L(f.I), where I ⊆ M, for the set of all PGLBbt instruction sequences, taking the set {f.m | m ∈ I} as the set A of basic instructions. The derivation of partial method operations from the method operations of a functional unit involves services whose processing of methods amounts to replies and service changes according to corresponding method operations of the functional unit concerned. These services can be viewed as the behaviours of a machine, on which the processing in question takes place, in its different states. We take the set F U(S ) × S as the set S of services. We write H(s), where ∂ H ∈ F U(S ) and s ∈ S , for the service (H, s). The functions ∂m and ̺m are defined as follows: ( H(meH (s)) if m ∈ I(H) ∂ (H(s)) = ∂m ∅(s′ ) if m ∈ / I(H) , ( mrH (s) if m ∈ I(H) ̺m (H(s)) = d if m ∈ / I(H) , 9 where s′ is a fixed but arbitrary state in S. We assume that each H(s) ∈ S can be denoted by a closed term of sort S. In this connection, we use the following notational convention: for each H(s) ∈ S, we write H(s) for an arbitrary closed term of sort T that denotes H(s). The ambiguity thus introduced could be obviated by decorating H(s) wherever it stands for a closed term. However, in this paper, it is always immediately clear from the context whether it stands for a closed term. Moreover, we believe that the decorations are more often than not distracting. Therefore, we leave it to the reader to make the decorations mentally wherever appropriate. Let H ∈ F U(S ), and let I ⊆ I(H). Then an instruction sequence x ∈ L(f.I) produces a partial method operation |x|H as follows: |x|H (s) = (|x|rH (s), |x|eH (s)) if |x|rH (s) = t ∨ |x|rH (s) = f , |x|H (s) is undefined if |x|rH (s) = d , where |x|rH (s) = x ! f.H(s) , |x|eH (s) = the unique s′ ∈ S such that x • f.H(s) = f.H(s′ ) . If |x|H is total, then it is called a derived method operation of H. The binary relation ≤ on F U(S ) is defined by H ≤ H′ iff for all (m, M ) ∈ H, M is a derived method operation of H′ . The binary relation ≡ on F U(S ) is defined by H ≡ H′ iff H ≤ H′ and H′ ≤ H. Theorem 1. 1. ≤ is transitive; 2. ≡ is an equivalence relation. Proof. Property 1: We have to prove that H ≤ H′ and H′ ≤ H′′ implies H ≤ H′′ . It is sufficient to show that we can obtain instruction sequences in L(f.I(H′′ )) that produce the method operations of H from the instruction sequences in L(f.I(H′ )) that produce the method operations of H and the instruction sequences in L(f.I(H′′ )) that produce the method operations of H′ . Without loss of generality, we may assume that all instruction sequences are of the form u1 ; . . . ; uk ; !t ; !f, where, for each i ∈ [1, k], ui is a positive test instruction, a forward jump instruction or a backward jump instruction. Let m ∈ I(H), let M be such that (m, M ) ∈ H, and let xm ∈ L(f.I(H′ )) be such that M = |xm |H′ . Suppose that I(H′ ) = {m′1 , . . . , m′n }. For each i ∈ [1, n], let Mi′ be such that (m′i , Mi′ ) ∈ H′ and let xm′i = ui1 ; . . . ; uiki ; !t ; !f ∈ L(f.I(H′′ )) be such that Mi′ = |xm′i |H′′ . Consider the x′m ∈ L(f.I(H′′ )) obtained from xm as follows: for each i ∈ [1, n], (i) first increase each jump over the leftmost occurrence of +f.m′i in xm with ki + 1, and next replace this instruction by ui1 ; . . . ; uiki ; (ii) repeat the previous step as long as their are occurrences of +f.m′i . It is easy to see that M = |x′m |H′′ . 10 Property 2: It follows immediately from the definition of ≡ that ≡ is symmetric and from the definition of ≤ that ≤ is reflexive. From these properties, Property 1 and the definition of ≡, it follows immediately that ≡ is symmetric, reflexive and transitive. ⊓ ⊔ The members of the quotient set F U(S )/≡ are called functional unit degrees. Let H ∈ F U(S ) and D ∈ F U(S )/≡. Then D is a functional unit degree below H if there exists an H′ ∈ D such that H′ ≤ H. 6 Functional Units for Natural Numbers In this section, we investigate functional units for natural numbers. The main consequences of considering the special case where the state space is N are the following: (i) N is infinite, (ii) there is a notion of computability known which can be used without further preparations. An example of a functional unit in F U(N) is an unbounded counter. The method names involved are setzero, succ, pred, and iszero. The method operations involved are the functions Setzero, Succ, Pred , Iszero : N → B × N defined as follows: Setzero(x) = (t, 0) , = (t, x + 1) , ( (t, x − 1) Pred (x) = (f, 0) ( (t, x) Iszero(x) = (f, x) Succ(x) if x > 0 , if x = 0 , if x = 0 , if x > 0 . The functional unit Counter is defined as follows: Counter = {(setzero, Setzero), (succ, Succ), (pred, Pred), (iszero, Iszero)} . Proposition 1. There are infinitely many functional unit degrees below ({pred, iszero} , Counter ). Proof. For each n ∈ N, we define a functional unit Hn ∈ F U(N) such that Hn ≤ ({pred, iszero} , Counter ) as follows: Hn = {(pred:n, Pred :n), (iszero, Iszero)} , where Pred :n(x) =  (t, x − n) if x ≥ n (f, 0) if x < n . Let n, m ∈ N be such that n < m. Then Pred :n(m) = (t, m − n). However, there does not exist an x ∈ L(f.I(Hm )) such that |x|Hm (m) = (t, m − n) because Pred :m(m) = (t, 0). Hence, Hn 6≤ Hm for all n, m ∈ N with n < m. ⊓ ⊔ 11 A method operation M ∈ MO(N) is computable if there exist computable functions F, G : N → N such that M (n) = (β(F (n)), G(n)) for all n ∈ N, where β : N → B is inductively defined by β(0) = t and β(n + 1) = f. A functional unit H ∈ F U (N) is computable if, for each (m, M ) ∈ H, M is computable. Theorem 2. Let H, H′ ∈ F U(N) be such that H ≤ H′ . Then H is computable if H′ is computable. Proof. We will show that all derived method operations of H′ are computable. Take an arbitrary P ∈ L(f.I(H′ )) such that |P |H′ is a derived method operations of H′ . It follows immediately from the definition of thread extraction that |P | is the solution of a finite linear recursive specification over BTAbt , i.e. a finite guarded recursive specification over BTAbt in which the right-hand side of each equation is a BTAbt term of the form D, S+, S− or x E a D y where x and y are variables of sort T. Let E be a finite linear recursive specification over BTAbt of which the solution for x1 is |P |. Because |P |H′ is total, it may be assumed without loss of generality that D does not occur as the right-hand side of an equation in E. Suppose that  E = xi = xl(i) E f.mi D xr(i) | i ∈ [1, n] ∪ {xn+1 = S+, xn+2 = S−} . From this set of equations, using the relevant axioms and definitions, we obtain a set of equations of which the solution for F1 is |P |eH′ :  Fi (s) = Fl(i) (mi eH′ (s)) · sg(χi (s)) + Fr(i) (mi eH′ (s)) · sg(χi (s)) | i ∈ [1, n] ∪ {Fn+1 (s) = s, Fn+2 (s) = s} , where, for every i ∈ [1, n], the function χi : N → N is such that for all s ∈ N: χi (s) = 0 ⇔ mi rH′ (s) = t , and the functions sg, sg : N → N are defined as usual: sg(0) =0, sg(n + 1) = 1 , sg(0) =1, sg(n + 1) = 0 . It follows from the way in which this set of equations is obtained from E, the fact that mi eH′ and χi are computable for each i ∈ [1, n], and the fact that sg and sg are computable, that this set of equations is equivalent to a set of equations by which |P |eH′ is defined recursively in the sense of Kleene (see [5]). This means that |P |eH′ is general recursive, and hence computable. In a similar way, it is proved that |P |rH′ is computable. ⊓ ⊔ A computable H ∈ F U(N) is universal if for each computable L ∈ F U(N), we have L ≤ H. There exists a universal computable functional unit for natural numbers. Theorem 3. There exists a computable H ∈ F U(N) that is universal. 12 Proof. We will show that there exists a computable H ∈ F U(N) with the property that each computable M ∈ MO(N) is a derived method operation of H. As a corollary of Theorem 10.3 from [9],3 we have that each computable M ∈ MO(N) can be computed by means of a register machine with six registers, say r0, r1, r2, r3, r4, and r5. The registers are used as follows: r0 as input register; r1 as output register for the output in B; r2 as output register for the output in N; r3, r4 and r5 as auxiliary registers. The content of r1 represents the Boolean output as follows: 0 represents t and all other natural numbers represent f. For each i ∈ [0, 5], register ri can be incremented by one, decremented by one, and tested for zero by means of instructions ri.succ, ri.pred and ri.iszero, respectively. We write L(RM6 ) for the set of all PGLBbt instruction sequences, taking the set {ri.succ, ri.pred, ri.iszero | i ∈ [0, 5]} as the set A of basic instructions. Clearly, L(RM6 ) is adequate to represent all register machine programs using six registers. We define a computable functional unit U ∈ F U(N) whose method operations can simulate the effects of the register machine instructions by encoding the register machine states by natural numbers such that the contents of the registers can reconstructed by prime factorization. This functional unit is defined as follows: U = {(exp2, Exp2 ), (fact5, Fact5 )} ∪ {(ri:succ, Ri:succ), (ri:pred, Ri:pred ), (ri:iszero, Ri:iszero) | i ∈ [0, 5]} , where the method operations are defined as follows: Exp2 (x) = (t, 2x ) , Fact5 (x) = (t, max {y | ∃z • x = 5y · z}) and, for each i ∈ [0, 5]:4 Ri:succ(x) = (t, pi · x) , ( (t, x/pi ) Ri:pred (x) = (f, x) ( (t, x) Ri:iszero(x) = (f, x) if pi | x if ¬(pi | x) , if ¬(pi | x) if pi | x , where pi is the (i+1)th prime number, i.e. p0 = 2, p1 = 3, p2 = 5, . . . . We define a function rml2ful from L(RM6 ) to L(f.I(U)), which gives, for each instruction sequence P in L(RM6 ), the instruction sequence in L(f.I(U)) by which the effect produced by P on a register machine with six registers can be simulated on U. This function is defined as follows: rml2ful(u1 ; . . . ; uk ) = f.exp2 ; φ(u1 ) ; . . . ; φ(uk ) ; −f.r1:iszero ; #3 ; f.fact5 ; !t ; f.fact5 ; !f , 3 4 That theorem can be looked upon as a corollary of Theorem Ia from [6]. As usual, we write x | y for y is divisible by x. 13 where φ(a) = ψ(a) , φ(+a) = +ψ(a) , φ(−a) = −ψ(a) , φ(u) =u if u is a jump or termination instruction , where, for each i ∈ [0, 5]: ψ(ri.succ) = f.ri:succ , ψ(ri.pred) = f.ri:pred , ψ(ri.iszero) = f.ri:iszero . Take an arbitrary computable M ∈ MO(N). Then there exist an instruction sequence in L(RM6 ) that computes M . Take an arbitrary P ∈ L(RM6 ) that computes M . Then |rml2ful(P )|U = M . Hence, M is a derived method operation of U. ⊓ ⊔ The universal computable functional unit U defined in the proof of Theorem 3 has 20 method operations. However, three method operations suffice. Theorem 4. There exists a computable H ∈ F U(N) with only three method operations that is universal. Proof. We know from the proof of Theorem 3 that there exists a computable H ∈ F U(N) with 20 method operations, say M0 , . . . , M19 . We will show that there exists a computable H′ ∈ F U(N) with only three method operations such that H ≤ H′ . We define a computable functional unit U ′ ∈ F U(N) with only three method operations such that U ≤ U ′ as follows: U ′ = {(g1, G1), (g2, G2), (g3, G3)} , where the method operations are defined as follows: G1(x) = (t, 2x ) ,  19  •  (t, 3 · x) if ¬(3 | x) ∧ ∀y (y | x ⇒ (y = 2 ∨ y = 3)) (t, x/319 ) if 319 | x ∧ ¬(320 | x) ∧ ∀y • (y | x ⇒ (y = 2 ∨ y = 3)) G2(x) =    (f, 0) if 320 | x ∨ ¬∀y • (y | x ⇒ (y = 2 ∨ y = 3)) , G3(x) = Mfact3 (x) (fact2 (x)) , where fact2 (x) = max {y | ∃z • x = 2y · z} , fact3 (x) = max {y | ∃z • x = 3y · z} . 14 We have that, for each i ∈ [0, 19], |f.g1 ; f.g2 i ; +f.g3 ; !t ; !f|U ′ = Mi .5 Hence, M0 , . . . , M19 are derived method operations of U ′ . ⊓ ⊔ The universal computable functional unit U ′ defined in the proof of Theorem 4 has three method operations. We can show that one method operation does not suffice. Theorem 5. There does not exist a computable H ∈ F U (N) with only one method operation that is universal. Proof. We will show that there does not exist a computable H ∈ F U(N) with one method operation such that Counter ≤ H. Here, Counter is the functional unit introduced at the beginning of this section. Assume that there exists a computable H ∈ F U(N) with one method operation such that Counter ≤ H. Let H′ ∈ F U(N) be such that H′ has one method operation and Counter ≤ H′ , and let m be the unique method name such that I(H′ ) = {m}. Take arbitrary P1 , P2 ∈ L(f.I(H′ )) such that |P1 |H′ = Succ and |P2 |H′ = Pred . Then |P1 |H′ (0) = (t, 1) and |P2 |H′ (1) = (t, 0). Instruction f.m is processed at least once if P1 is applied to H′ (0) or P2 is applied to H′ (1). Let k0 be the number of times that instruction f.m is processed on application of P1 to H′ (0) and let k1 be the number of times that instruction f.m is processed on application of P2 to H′ (1) (irrespective of replies). Then, from state 0, state 0 is reached again after f.m is processed k0 +k1 times. Thus, by repeated application of P1 to H′ (0) at most k0 + k1 different states can be reached. This contradicts with |P1 |H′ = Succ. Hence, there does not exist a computable H ∈ F U(N) with one method operation such that Counter ≤ H. ⊓ ⊔ It is an open problem whether two method operations suffice. 7 Functional Units for Finite State Spaces In this short section, we make some remarks about functional units for finite state spaces. In the special case where the state space is B, the state space consists of only two states. Because there are four possible unary functions on B, there are precisely 16 method operations in MO(B). There are in principle 216 different functional units in F U(B), for it is useless to include the same method operation more than once under different names in a functional unit. This means that 216 is an upper bound of the number of functional unit degrees in F U(B)/≡. However, it is straightforward to show that F U(B)/≡ has only 12 different functional unit degrees. In the more general case of a finite state space consisting of k states, say Sk , k k there are in principle 22 ·k different functional units in F U(Sk ). Already with k = 3, it becomes unclear whether the number of functional unit degrees in F U(Sk ) can be determined manually. Actually, we do not know at the moment whether it can be determined with computer support either. 5 For each primitive instruction u, the instruction sequence un is defined by induction on n as follows: u0 = #1, u1 = u and un+2 = u ; un+1 . 15 8 Concluding Remarks We have defined the concept of a functional unit for a state space and have established general results concerning functional units for natural numbers. The main result is the existence of a universal computable functional unit for natural numbers. The case where the state space is the set of natural numbers is arguably the simplest significant case. We have not yet investigated other significant cases. An interesting case is the one where the state space is the set of all pairs of sequences over some alphabet: the tape of a Turing machine can be modelled by a functional unit for this state space. Each Turing machine can be simulated by means of a functional unit that corresponds to the tape of the Turing machine and a PGLBbt instruction sequence that corresponds to the finite control of the Turing machine. Variations of the Turing machine theme can be dealt with in this way as well. Thus, functional units allows for many computability issues to be viewed as issues about programs rather than machines. In [3], we introduce an extension of program algebra with Boolean termination instructions, called PGAbt , and define a thread extraction operation for it. PGLBbt instruction sequences can be translated into closed PGAbt terms such that thread extraction for PGLBbt yields the same behaviours as translation followed by thread extraction for PGAbt . In [3], we also introduce an extension of basic thread algebra similar to TAtsi bt . In addition to the constants and operators of TAtsi bt , that extension has a constant (S) for termination without delivery of a Boolean value and an operator (/) which is concerned with the effects of service families on threads and therefore produces threads. References 1. Bergstra, J.A., Loots, M.E.: Program algebra for sequential code. Journal of Logic and Algebraic Programming 51(2), 125–156 (2002) 2. Bergstra, J.A., Middelburg, C.A.: Program algebra with a jump-shift instruction. Journal of Applied Logic 6(4), 553–563 (2008) 3. Bergstra, J.A., Middelburg, C.A.: Instruction sequence processing operators. arXiv:0910.5564v2 [cs.LO] (2009) 4. Bergstra, J.A., Ponse, A.: Combining programs and state machines. Journal of Logic and Algebraic Programming 51(2), 175–192 (2002) 5. Kleene, S.C.: General recursive functions of natural numbers. Mathematische Annalen 112, 727–742 (1936) 6. Minsky, M.L.: Recursive unsolvability of Post’s problem of “tag” and other topics in theory of Turing machines. Annals of Mathematics 74(3), 437–455 (1961) 7. Ponse, A., van der Zwaag, M.B.: An introduction to program and thread algebra. In: Beckmann, A., et al. (eds.) CiE 2006. Lecture Notes in Computer Science, vol. 3988, pp. 445–458. Springer-Verlag (2006) 8. Sannella, D., Tarlecki, A.: Algebraic preliminaries. In: Astesiano, E., Kreowski, H.J., Krieg-Brückner, B. (eds.) Algebraic Foundations of Systems Specification, pp. 13–30. Springer-Verlag, Berlin (1999) 9. Shepherdson, J.C., Sturgis, H.E.: Computability of recursive functions. Journal of the ACM 10(2), 217–255 (1963) 16 10. Wirsing, M.: Algebraic specification. In: van Leeuwen, J. (ed.) Handbook of Theoretical Computer Science, vol. B, pp. 675–788. Elsevier, Amsterdam (1990) 17
6cs.PL
1 The evolution of representation in simple cognitive networks Lars Marstaller1, ? , Arend Hintze2, 3, 4, ? & Christoph Adami2, 3 arXiv:1206.5771v2 [q-bio.NC] 6 Aug 2013 1 Department of Cognitive Science, Macquarie University, Sydney, Australia 2 Microbiology & Molecular Genetics, Michigan State University, East Lansing, MI 3 BEACON Center for the Study of Evolution in Action, Michigan State University, East Lansing, MI 4 Computer Science & Engineering, Michigan State University, East Lansing, MI ∗ Keywords: Information, Representation, Cognition, Evolution Abstract Representations are internal models of the environment that can provide guidance to a behaving agent, even in the absence of sensory information. It is not clear how representations are developed and whether or not they are necessary or even essential for intelligent behavior. We argue here that the ability to represent relevant features of the environment is the expected consequence of an adaptive process, give a formal definition of representation based on information theory, and quantify it with a measure R. To measure how R changes over time, we evolve two types of networks—an artificial neural network and a network of hidden Markov gates—to solve a categorization task using a genetic algorithm. We find that the capacity to represent increases during evolutionary adaptation, and that agents form representations of their environment during their lifetime. This ability allows the agents to act on sensorial inputs in the context of their acquired representations and enables complex and context-dependent behavior. We examine which concepts (features of the environment) our networks are representing, how the representations are logically encoded in the networks, and how they form as an agent behaves to solve a task. We conclude that R should be able to quantify ∗ These authors contributed equally. the representations within any cognitive system, and should be predictive of an agent’s long-term adaptive success. 1 Introduction The notion of representation is as old as cognitive science itself (see, e.g., Chomsky, 1965; Newell and Simon, 1972; Fodor, 1975; Johnson-Laird and Wason, 1977; Marr, 1982; Pinker, 1989; Pitt, 2008), but its usefulness for Artificial Intelligence (AI) research has been doubted (Brooks, 1991). In his widely cited article “Intelligence without representation”, Brooks argued instead for a subsumption architecture where the autonomous behavior producing components (or layers) of the cognitive system directly interface with the world and with each other rather than with a central symbol processor dealing in explicit representations of the environment. In particular, inspired by the biological path to intelligence, Brooks argued that AI research needs to be rooted in mobile autonomous robotics and a direct interaction between action and perception. Echoing Moravec (1984), he asserted that the necessary elements for the development of intelligence are mobility, acute vision, and the ability to behave appropriately in a dynamic environment (Brooks, 1991). This architecture achieved insect-level intelligence and Brooks argued that a path to higher level AI could be forged by incrementally increasing the complexity of subsumption architecture. However, 20 years after advocating such a radical departure from the classical approach to AI, the subsumption approach seems to have stalled as well. We believe that the reason for the lack of progress does not lie in the attempt to base AI research in mobile autonomous robots, but that instead representations (also sometimes called “internal models”, (Craik, 1943; Wolpert et al., 1995; Kawato, 1999)) are key to complex adaptive behavior. Indeed, while representation-free robotics has made some important strides (Nolfi, 2002), it is limited to problems that are not “representation hungry” (Clark, 1997), i.e., problems that do not require past information or additional (external) knowledge about the current context. In addition, the technical difficulty of developing a subsumption architecture increases with the number of layers or subsystems. This problem of subsumption architecture mirrors the difficulties of classic representational AI approaches to build accurate and appropriate models of the world. 2 An alternative approach to engineering cognitive architectures and internal models is evolutionary robotics (Nolfi and Floreano, 2000). Instead of designing the structure or functions of a control architecture, principles of Darwinian evolution are used to create complex networks that interface perception and action in non-obvious and often surprising ways. Such structures can give rise to complex representations of the environment that are hard to engineer and equally hard to analyze (see, e.g. Floreano and Mondada,1996). Evolved representations provide context, are flexible, and can be readjusted given new stimuli that contradict the current assumptions. Representations can be updated during the lifetime or over the course of evolution and thus are able to handle even new sensory input (Bongard et al., 2006). We argue that as robots evolve to behave appropriately (and survive) in a dynamic and noisy world, representations of the environment emerge within the cognitive apparatus, and are integrated with the perceived sensory data to create intelligent behavior–using not only the current state of the environment but crucially taking into account historical data (memory) as well. To test this hypothesis and make internal representations of evolved systems accessible to analysis, we propose a new information-theoretic measure of the degree to which an embodied agent represents its environment within its internal states and show how the capacity to represent environmental features emerges over thousands of generations of simulated evolution. The main idea is that representations encode environmental features because of their relevance for the cognitive system in question (Clark and Toribio, 1994). Hence, for our purposes, representations can be symbolic or sub-symbolic (e.g., neural states) as long as they have a physical basis, i.e., as long as they are encoded in measurable internal states. However, we distinguish representations from sensorial input because sensor inputs cannot provide the same past or external context as internal states. We thus explicitly define representations as that information about relevant features of the environment which is encoded in the internal states of an organism and which goes beyond the information present in its sensors (Haugeland, 1991; Clark, 1997). In particular, this implies that representations can, at time, misrepresent (Haugeland, 1991)–unlike information present in sensors, which always truthfully correlates with the environment. To illuminate the functioning of evolved cognitive systems, we show how it is in principle possible to determine what a representation is about, and how representations form during the lifetime of an agent. We argue that our measure 3 provides a valuable tool to investigate the organization of evolved cognitive systems especially in cases where internal representations are “epistemically opaque”. 2 Methods 2.1 Information-theoretic measure of representation Information theory has been used previously to quantify how context can modulate decisions based on sensory input (Phillipps et al., 1994; Phillips and Singer, 1997; Kay and Phillips, 2011). Here, we present an information-theoretic construction that explicitly takes the entropy of environmental states into account. To quantify representation, we first define the relationship between the representing system and the represented environment in terms of information (shared, or mutual, entropy). Information measures the correlation between two random variables, while the entropy H is a measure of the uncertainty we have about a random variable in the absence of information (uncertainty is therefore potential information). For a random variable X that can take on the states xi with probabilities p(xi ) = P (X = xi ), the entropy is given by (Shannon, 1948): H(X) = − N X p(xi ) log p(xi ) , (1) i=1 where N is the number of possible states that X can take on. The information between two random variables characterizes how much the degree of order in one of the variables is predictive of the regularity in the other variable. It can be defined using entropy as the difference between the sum of the entropies of two random variables X and Y [written as H(X) and H(Y )] and the joint entropy of X and Y , written as H(X, Y ): I(X : Y ) = H(X) + H(Y ) − H(X, Y ) = X xy p(x, y) log p(x, y) . p(x)p(y) (2) In Eq. (2), p(x) and p(y) are the probability distributions for the random variables X and Y respectively [that is, p(x) = P (X = x)], while p(x, y) is the joint probability distribution of the (joint) random variable XY . The shared entropy I(X : Y ) can also be written in terms of a difference between unconditional and conditional entropies, as I(X : Y ) = H(X) − H(X|Y ) = H(Y ) − H(Y |X) . 4 (3) This definition reminds us that information is that which reduces our uncertainty about a system. In other words, it is that which allows us to make predictions about a system with an accuracy that is higher than when we did not have that information. In Eq. (3), we introduced the concept of a conditional entropy (Shannon, 1948). For example, H(X|Y ) (read as “H of X given Y ”) is the entropy of X when the state of the variable Y is known, and is calculated as H(X|Y ) = − X p(x, y) log p(x|y) , (4) xy using the conditional probability p(x|y) = p(x, y)/p(y). In general, information is able to detect arbitrary correlations between signals or sets of events. We assume here that such correlations instantiate semiotic or information relationships between a representing and represented, and use mutual information to measure the correlation between a network’s internal states and its environment [see also Marstaller et al. (2010)]. So, for example, we could imagine that X stands for the states of an environment, whereas Y is a variable that represents those states of the environment. We need to be careful, however, to exclude from possible representational variables those that are mere images of the environment, such as the trace that the world leaves in an agent’s sensors. Indeed, mere correlations between internal states and the environment are not sufficient to be treated as representational because they could be due to behavior that is entirely reactive (Clark, 1997). Haugeland, for example, understands representation as something that “stands in” for something in the environment, but that is no longer reflected in the perceptual system of the agent (Haugeland, 1991). Indeed, representation should be different from a mere translation: Consider a digital camera’s relationship with its environment. The photo chip guarantees a one-to-one mapping between the environment structure and the camera’s state patterns. But a camera is not able to adapt to its environment. By taking a picture, the camera has not ‘learned’ anything about its environment that will affect its future state. It simply stores what it received through its inputs without extracting information from it, i.e., the camera’s internal states are fully determined by its sensor inputs. Representation goes beyond mere translation because the content, i.e. which feature of the environment is represented, depends on the goals of the system. Not everything is represented in the same way. A camera does not have this functional specification of its internal states. 5 To rule out trivial representations like a camera’s internal states, we define representation as the shared entropy between environment states and internal states, but given the sensor states, i.e., conditioned on the sensors. Thus, representation is that part of the shared entropy between environment states and internal states that goes beyond what is seen in the sensors (see Fig. 1). For the following, we take E, given by its probability distribution p(ei ) = P (E = ei ), as the random variable to describe environmental states, while S describes sensor states. If the internal states of the agent (hidden and output states) are characterized by the random variable M with probability distribution p(mj ) = P (M = mj ), then we define the representation R as (for an earlier version, see Marstaller et al.,2010): R = H(E : M |S) = I(E : M ) − I(E : M : S) = Hcorr − I(S : E) − I(S : M ) , (5) where the correlation entropy Hcorr of the three variables E, S, and M [also called “total correlation” (Watanabe, 1960) or “multi-information” (McGill, 1954; Schneidman et al., 2003)] is the amount of information they all three share: Hcorr = H(E) + H(M ) + H(S) − H(E, M, S) . (6) In Eq. (5), we introduced the shared conditional entropy between three variables that is defined as the difference between an information that is unshared and one that is shared (with a third system), just as H(X|Y ) = H(X) − I(X : Y ), from Eq. (4). Thus, the representation R of the world E within internal states M is the total correlation between the three, but without what is reflected in S about E and M , respectively [measured by I(S : E) and I(S : M )]. The relationship between R and the entropies of the three variables S, E, and M is most conveniently summarized by an entropy Venn diagram, as in Fig. 1. In these diagrams, a circle is a quantitative measure of the entropy of the associated variable, and the shared entropy between two variables is represented by the intersection of the variables, and so on (see, e.g., Cover and Thomas,1991). Our information-theoretic definition of representation carries over from discrete variables to continuous variables unchanged, as can be seen as follows. Let XE , XM , and XS be random variables defined with normalized probability density functions fE (e), fM (m), and fS (s). The differential entropy h(X) (Cover and Thomas, 1991), 6 defined as h(X) = − Z f (x) log f (x)dx (7) S where S is the support of random variable X, is related to the discretized version H(X ∆ ) by noting that H(X ∆ ) + log ∆ → h(X) (∆ → 0) , (8) where we introduced the discretization Z (i+1)∆ f (x)dx pi = (9) i∆ in order to define the discretized Shannon entropy H(X ∆ ) = − P i pi log pi . This implies that an n-bit quantization of a continuous random variable is approximately H(X) ≈ h(X) + n (Cover and Thomas, 1991). Let us now assume that the variables XE , XM , and XS are each quantized by nE , nM , and nS bits respectively. Because H(E, M, S) is then quantized by nE + nM + nS bits, it follows that Hcorr ≈ hcorr , that is, the continuous and discrete variable correlation entropies are (in the limit of sufficiently small ∆) approximately the same because the discretization correction cancels. The same is true for the informations I(S : E) and I(S : M ), as these are correlation entropies between two variables. Thus, H(E : M |S) ≈ h(XE : XM |XS ), the differential entropy version of R. We stress that while an exact identity between discrete and continuous variable definitions of R is only ensured in the limit of vanishing discretization, the cancellation of the correction terms log ∆ implies that the discrete version is not biased with respect to the continuous version. R defines a relation between a network’s activity patterns and its environment as the result of information processing. R yields a positive quantity, measured in bits (if logarithms are taken to base 2). In order to show that this measure of representation reflects functional purpose (Clark, 1997), we evolve cognitive systems (networks) that control the behavior of an embodied agent, and show that fitness, a measure for the agent’s functional prowess, is correlated with R. In other words, we show that when the environment (and task) is complex enough, agents react to this challenge by evolving representations of that environment. 7 E H(E|S, M ) M R I(E : S|M ) H(S|E, M ) H(M |E, S) I(S : M |E) S I(E : M : S) Figure 1: Venn diagram of entropies and informations for the three random variable E, S, and M , describing the states of the environment, sensors, and agent internal degrees of freedom. The representation R = H(E : M |S) is shaded. 2.2 Evolution of Active Categorical Perception We study the evolution of an agent that solves an active categorical perception (ACP) task (Beer, 1996, 2003), but with modifications suggested by van Dartel et al. (2005) (see also van Dartel M.F.,2005). Categorization is thought to be one of the key elements in cognition (see Harnad 1987; Cohen and Lefebvre 2005). In categorical perception, an agent has to partition objects in the world into different discrete categories based on their visual appearance. In active categorical perception, the agent takes an active role in which aspects of the object to view, that is, perception is intimately linked with action. Whether or not this task requires internal representations may depend on the specific nature of the task, and it is in general not simple to determine whether the agent uses internal states to represent the environment, and in particular which features of the world are represented by which computational units (Beer, 2003; Ward and Ward, 2009). In the task studied by Beer (1996; 2003), the agent has to discriminate between circles and diamonds that were falling vertically towards the agent, who could move laterally to change its perception of the object. In the version we study here, the agent 8 A B 1 2 0 3 15 14 0 1 2 3 Sensor States = on = off Figure 2: A: In the simulation, large or small blocks fall diagonally towards the bottom row of a 20×20 world, with the agent on the bottom row. For the purpose of illustrating the task, a large brick (to be avoided) is falling to the left, while a small brick (to be caught) is falling to the right. In simulations, only one block is falling at the time, and both small and large bricks can fall either to the left or to the right. B: A depiction of the agent’s neurons (bottom left: triangles depict sensors, circles illustrate brain neurons, trapezoids denote actuators) and the sequence of activity patterns on the agent’s 4-bit retina (right), as a large brick falls to the right. 9 has to discriminate between large and small blocks, by catching the small blocks while avoiding the large ones. In order to create visual ambiguity, the agent’s four upwardlooking sensors have a blind spot (two non-sensing units) between them. Furthermore, blocks are falling diagonally (from left to right or right to left), so that the agent not only has to categorize, but also to predict (see Fig. 2A). We evolve active categorical perception in two experiments, using two different control architectures. One is an artificial neural network (ANN), and one is a Markov network, specifically, a network of Hidden Markov Gates (HMGs) (Edlund et al., 2011), described in more detail in section 2.3. The agent is located at the bottom row of a 20 × 20 world with periodic boundary conditions, and is able to move horizontally one unit per time step (see Fig. 2A). Note that compared to van Dartel et al. (2005) we doubled the vertical size of the arena in order to give the agent more time to assess the direction of the falling block. The agent has four upward-looking sensors. The state of a sensor is si = +1 when a block is detected, and si = 0 if no block is seen. The arrangement of the agent’s sensors does not allow it to unambiguously identify the falling block from three out of eight possible input states (counting the input where no sensors are active). Only the input states S = (s0 , s1 , s2 , s3 ) = (0, 1, 1, 0), (0, 1, 0, 0), and (0, 0, 1, 0) are unambiguous. The first classifies a large block that is positioned right above the agent so that the second and the third sensor are in state s1 = s2 = 1 while the remaining two units of the block are positioned above the two non-sensing units. The other two patterns identify similarly positioned small blocks. All other five input states can be created by either a small block, a big block, or no block at all (see Fig. 2B). At each trial, a block of either small (two units) or large size (four units) falls from top to bottom in 20 time steps. The blocks move continuously downwards and sideways one unit per time step. Blocks either always move to the right or to the left. An object is caught if the position of the block’s units and of the agent’s units at time step 20 overlap in at least one unit. For the information-theoretic characterization of correlations, we have to assign probabilities to the possible states of the world. Theoretically, a falling block can be in any of 20 different starting positions, large or small, and falling left or right, giving rise to 80 possible experimental initial conditions. While the agent can be in any of 20 initial positions, the periodic boundary conditions ensure that each of them is equivalent, given 10 the 20 initial positions of the falling block. Because there are 20 time steps before the block reaches the bottom row, there are in total 1,600 possible different states the world can be in. We do not expect that all of these states will be discriminated by the agent, so instead we introduce a coarse-graining of the world by introducing four bits that we believe capture salient aspects of the world. We define the environmental (joint) variable E = E0 E1 E2 E3 to take on states as defined in Table 1. Of course, this World state World character E0 = 0 no sensor activated E0 = 1 at least one sensor activated E1 = 0 block is to the left of agent E1 = 1 block is to the right of agent E2 = 0 block is two units (small) E2 = 1 block is four units (large) E3 = 0 block is moving left E3 = 1 block is moving right Table 1: Coarse-graining of world states into the four bits E0 , E1 , E2 , E3 . Note that E1 could be ambiguous in case the block is centered over the agent or exactly 10 units away. We resolve this ambiguity by setting E1 = 0 when the block is centered over the agent, and E1 = 1 when it is exactly 10 units away. encoding reveals a bias in what we, the experimenters, believe are salient states of the world, and certainly underestimates the amount of “discoverable” entropy. However, in hindsight this coarse-graining appears to be sufficient to capture the essential variations in the world, and furthermore lends itself to study which aspects of the world are being represented within the agent’s network controller, by defining representations about different aspects i of the world as the representation Ri = H(Ei : M |S). Thus, we will study the four representations Rhit = H(E0 : M |S) (10) RLR = H(E1 : M |S) (11) R4/2 = H(E2 : M |S) (12) R+/− = H(E3 : M |S) (13) 11 that represent whether the sensor has been activated [Eq. (10)], whether the block is to the left or the right of the agent [Eq. (11)], if the block is large (size 4) or small (size 2) [Eq. (12)], or whether the block is moving to the left or right [Eq. (13)]. We can also measure how much (measured in bits) of each binary concept is represented in any particular variable. For example, RLR (node 12) = H(E1 : M12 |S) measures how much of the “block is to my left or to my right” concept is encoded in variable 12. 2.3 Two Architectures for Cognitive Systems The agent is controlled by a cognitive system, composed of computational units (loosely referred to as “neurons” from here on) that map sensor inputs into motor outputs. The cognitive system also has neurons that are internal (a hidden layer), which are those neurons that are not part of the input or of the output layer. We further define sensor neurons as those neurons that directly process the input (the input layer) and we define output neurons as those units that do not map to other units in the network or to themselves (the output layer). Artificial Neural Networks (ANN) with evolvable topology. In our first experiment, the robot’s movements are controlled by an artificial neural network that consists of 16 nodes: four input units (one for each sensor), two output units, and ten hidden units. The states of the input units are discrete with values [+1, −1] specifying whether an object is detected or not. The states of the output units (or actuators) are discrete with integer values A = a ∈ [0, 1] encoding one of three possible actions: move one unit to the right or left, or do not move (A1 A2 = 00 : stand still, A1 A2 = 01 : move right, A1 A2 = 10 : move left, A1 A2 = 11 : stand still. While the hidden units’ states mi are continuous with values [−1.0, 1.0], when evaluating these states to calculate R we discretize them to binary (values below 0.0 become 0, every other value becomes 1). As discussed earlier, this discretization does not introduce a bias in the value of R. Usually, classic artificial neuronal networks have a fixed topology, i.e., one or more layers and their connections are defined and associated with a weight. In a previous experiment, we found that such fixed topologies lead to approximately constant R even as the fitness of the agent increases (data not shown). One way to increase the complexity of the network and the information it represents is to evolve a network’s topology 12 as well as the connection weights. We make the network topology evolvable beyond searching the connection weights by using neuronal gates (NG). A NG can arbitrarily connect nodes of any type (input, hidden, and output nodes) without the fixed layered topology of classic ANNs. Each connection is associated with a certain weight. A NG (k) calculates the sum of the values from a set of incoming nodes mj via gate k, multiplied (k) by the associated weight wj and applies a sigmoid function to calculate its output m m(t + 1) = tanh n X X ! (k) (k) wj mj (t) , (14) k=1 j=1 where the sum over j runs over all the neurons that feed into gate k. This value m is then propagated to every node this NG is connected to. To apply a Genetic Algorithm to this system, each ANN is encoded in a genome as follows: A start codon of two loci mark the beginning of a NG, the subsequent two loci encode the NG’s number of inputs and outputs, while two further loci specify the origin of the inputs (which neurons feed into the gate) and the outputs (where the NG writes into). This information is then followed by an encoding of the n weights of an n-input NG (see Fig. 3). The number of gates in the network can change as it evolves, and is only determined by the number of start codons in the genome. The genomes encoding these ANNs can undergo the same mutational changes as described later in the MB section. In this respect, evolving open-topology ANNs is similar to using evolutionary algorithms (such as NEAT, see, e.g., Stanley and Miikkulainen (2002)) to evolve neural networks with augmented topology. Markov Brains (MB). In our second experiment, the agent is controlled by a network of 16 nodes (four input, two output, and ten internal nodes, i.e., with the same types and number of nodes as the ANNs) which are connected via Hidden Markov Gates (HMGs, see Edlund et al. 2011). Networks of HMGs (Markov brains or MBs for short) are a type of stochastic Markov network (see, e.g., Koller and Friedman 2009) and are related to the hierarchical temporal memory model of neocortical function (Hawkins and Blakeslee, 2004; George and Hawkins, 2005, 2009) and the HMAX algorithm (Riesenhuber and Poggio, 1999), except that Markov brains need not be organized in a strictly hierarchical manner as their connectivity is evolved rather than designed top-down. Each HMG can be understood as a finite-state machine that is defined by its in- 13 in out hidden t W1 W2 W3 W4 W1 W2 W3 W4 neuronal gate 2 neuronal gate 1 t+1 ∑ Figure 3: Open-topology Artificial Neural Network, with four input neurons (orange), ten hidden neurons (blue), and two motor neurons (green). The nodes are connected via two neuronal gates (NG). Each NG connects four arbitrary input nodes with weight W to four output nodes. This figure illustrates how the nodes become updated from time point t to t + 1. When two NGs write into the same node, their outputs are added P (indicated by ) before the sigmoid function is applied. 14 put/output structure (Fig. 4A) and a state transition table (Fig. 4B). All nodes in Markov brains are binary, and in principle the HMGs are stochastic, that is, the output nodes fire (that is, are set to state ‘1’) with a probability determined by the state-to-state transition table. Here, each HMG can receive up to four inputs, and distribute signals to up to 4 nodes, with a minimum of one input and one output node (these settings are configurable). For the evolution of the ACP task, we consider only deterministic HMGs (each row of the transition table contains only one value of 1.0 and all other transitions have a probability of 0.0), turning our hidden Markov gates into classical logic gates. In order to apply an evolutionary algorithm, each HMG is encoded in a similar way as the NGs using a genome that specifies the network as a whole. Each locus of the genome is an integer variable ∈ [0, 255]. Following a start codon (marking the beginning of a gene, where each gene encodes a single HMG), the next two loci encode the number of inputs and outputs of the gate respectively, followed by a specification of the origin of the inputs, and the identity of the nodes being written to. For example, for the HMG depicted in Fig. 4, the loci following the start codon would specify ‘3 inputs’, ‘2 outputs’, ’read from 1,2,3’, ‘write to 3,4’. This information is then followed by an encoding of the 2n+m probabilities of an n-input and m-output state transition table (see Supplementary Fig. S1 in Edlund et al. 2011 for more details.) For the example given in Fig. 4, the particular HMG is specified by a circular genome with 39 loci (not counting the start). The start codon is universally (but arbitrarily) chosen as the consecutive loci (42,213). Because this combination only occurs by chance once every 65,536 pairs of loci (making start codons rare), we insert four start codons at arbitrary positions into a 5,000 loci initial genome to jump start evolution. Thus, the ancestral genomes of all experiments with Markov brains encode at least 4 HMGs. A set of HMGs encoded in this manner uniquely specifies the Markov brain. The encoding is robust in the sense that mutations that change the input-output structure of an HMG leave the probability table intact, while either adding or removing parts of the table. This flexibility also implies that there is considerable neutrality in the genome, as each gene has 256 loci reserved for the probability table even if many fewer loci are used. MBs and ANNs differ with respect to the gates connecting the nodes in each network. ANNs use weights, sums, and a tanh function together with continuous variables to compute their actions. In contrast MBs use discrete states and boolean logic 15 to perform their computation. Using a very similar encoding of the topology means that mutations will have a similar effect on the topology of both systems, but different effects on the computations each system performs. A B ...0110100110... ...0100110001... 1 2 3 4 ....010100100..... 3 p00 p01 p02 p03 p10 p11 p12 p13 p20 p21 p22 p23 p30 p31 p32 p33 p40 p41 p42 p43 p50 p51 p52 p53 p60 p61 p62 p63 p70 p71 p72 p73 1 2 3 4 Figure 4: A: A single HMG with three inputs and two outputs reads from nodes 1, 2, and 3, and writes to nodes 3 and 4, updating the states of these nodes in the process. B: The output states are determined by a set of 23+2 probabilities, here denoted as pxy , where x and y are the decimal equivalent of the binary pattern of the input and output, respectively. For example, p73 is the probability for the pattern ‘11’ to fire if the input was ‘111’, that is, P (11|111) = p73 . 2.4 Evolutionary Algorithm We evolve the two types of networks (ANNs and MBs) using a Genetic Algorithm (GA). A GA can find solutions to problems by using evolutionary search [see, e.g., Michalewicz (1996)]. The GA operates on the specific genetic encoding of the networks’ structure (the genotype), by iterating through a cycle of assessing each network’s fitness in a population of 100 candidates, selecting the successful ones for differential replication, and finally mutating the new candidate pool. When testing a network’s performance in controlling the agent, each network is faced with all 80 possible initial conditions that the world can take on. The fitness w is calculated as the fraction of successful actions (the number of large blocks avoided plus the number of small blocks caught) out of 80 tests (a number between zero and 1). For the purpose of selection, 16 we use an exponential fitness measure that multiplies the score by a factor 1.1 for every successful action, but divides the score by 1.1 for every unsuccessful action, or S = 1.180(2w−1) . After the fitness assessment, the genotypes are ranked according to S and placed into the next generation with a probability that is proportional to the fitness (roulette wheel selection without elite). After replication, genotypes are mutated. We implemented three different mutational mechanisms that all occur after replication, with different probabiities. A point mutation happens with a probability of µ = 0.005 per locus, and causes the value at that locus to be replaced by a uniform random number drawn from the interval [0 · · · 255]. There is a 2% chance that we delete a sequence of adjacent loci ranging from 256-512 in size, and a 5% chance that a stretch of 256512 adjacent loci is duplicated (the size of the sequence to be deleted or duplicated is unformly distributed in the range given). The duplicated stretch is randomly inserted between any two loci in the genome. Duplications and deletions are contrained so that the genome is not allowed to shrink below 1024 sites, and genomes cannot grow beyond 20,000 sites. Because insertions are more likely than deletions, there is a tendency for genomes to grow in size during evolution. We evolve networks through 10,000 generations, and run 200 replicates of each experiment. Note that the type of gates is different between ANNs (neuronal) and MBs (logic), so the rate of evolution of the two networks cannot be compared directly, because mutations will have vastly different effects with respect to the function of the gates. Thus, the optimal mutation rate differs among networks (Orr, 2000). At the end of each evolutionary run, we reconstruct the evolutionary line of descent (Lenski et al., 2003) of the experiment, by following the lineage of the most successful agent at the end of 10,000 generations backwards all the way to the random ancestor that was used to seed the experiment. This is possible because we do not use cross-over between genotypes in our GA. This line of descent, given by a temporally ordered sequence of genotypes, recapitulates the unfolding of the evolutionary process, mutation by mutation, from ancestor to the evolved agent with high fitness, and captures the essence of that particular evolutionary history. For each of the organisms on each of the 200 lines of descent of any particular experiment, we calculate a number of information-theoretic quantities, among which is how much of the world the agent represents in its brain, using Equation (5). 17 2.5 Extracting probabilities from behavior The inputs to the information-theoretic measure of representation R are the probabilities to observe a particular state x, p(x), as well as the joint probabilities p(x, y) describing the probability to observe a state x when at the same time another variable Y takes on the state Y = y. For the representation R defined by Eq. (5), sensor, internal, and environment variables are distinguished. For any particular organism (an agent that performs the ACP task with an evolved controller), R is measured at any point during the evolution by placing the organism into the simulated world and concurrently recording time series data of the states of all 16 controller nodes and the states of the environment. The recordings are then used to calculate the frequency of states. Based on the frequencies of states, all probabilities relevant for the information-theoretical quantities can be calculated, including those that take into account the temporal order of events (for example, the probability p(xt , yt+1 ) that variable Xt takes on state xt while variable Yt+1 takes on the state yt+1 ). If a particular state (or combination of states) never occurs, a probability of zero is recorded for that entry (even though in principle the state or combination of states could occur). R (and the other information-theoretic quantities introduced in section 3) is calculated for organisms on the evolutionary line of descent making it possible to follow the evolutionary trajectory of R from random ancestor to adapted agent. For ANNs that have internal nodes with continuous rather than binary states, a mapping of intervals [−1, 0] → 0 and ]0, 1] → 1 is applied before calculation of probabilities. 3 Results To establish a baseline, 100,000 random controllers for each of the two network types were created and the distributions of R and fitness values were obtained. This baseline served two purposes: it shows how well randomly generated (unevolved) networks perform, and how much information about the world they represent by chance as well as providing information about the distribution of these values. Random ANNs and MBs were created in the same way by randomly drawing values from a uniform probability distribution of the integers ∈ [0, 255] for each of the genome’s loci. Each genome was then sprinkled with 4 start codons at arbitrary positions within the genome. 18 Fig. 5A shows the distribution of fitness scores w for 100,000 random ANNs, and Fig. 5B shows the distribution of their representation R. The respecitve distributions for MBs are shown in Fig. 5C for fitness scores and in Fig. 5D for representation. While both systems use different types of gates, ANNs and MBs do not differ with respect to their initial fitness or representation distributions. This shows that random genomes with a high fitness are–as expected–very rare, and need to evolve their functionality in order to perform optimally. 0.7 0.6 0.5 A B ANN ANN 0.4 0.4 p(r) dr p(w) dw 0.5 0.3 0.3 0.2 0.2 0.1 0.1 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 w 0.7 0.6 0 0.2 0.4 r 0.6 0.8 1 0.5 C D MB MB 0.4 0.4 p(r) dr p(w) dw 0.5 0.3 0.3 0.2 0.2 0.1 0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 w 0 0 0.2 0.4 r 0.6 0.8 1 Figure 5: Probability distribution of fitnesses and representation scores of random machines. A: Probability distribution of fitnesses (fraction of successful actions) p(w)dw = P (w < W < w + dw) for 100,000 random ANNs (dw = 1/80) B: Probability distribution of the representation variable R for the same random ANNs p(r)dr = P (r < R < r + dr), with dr = 0.02. C: Distribution of fitnesses for 100,000 random Markov brains (dw = 1/80). D: Distribution of representation R in the same MB networks (dr = 0.02). In order to compare the two network architectures, the evolutionary trajectories for fitness and representation were analyzed for the evolutionary line of descent (LOD) 19 as described in section 2.4. The different LODs obtained from following back any other member of the final population quickly coalesce to a single line. Hence, the LOD effectively recapitulates the genetic changes that led from random networks to proficient ones. The development of fitness and representation over evolutionary time in Fig. 6 is averaged over 200 independent replicates. While both ANNs and MBs have on average low fitness at the begin of an evolutionary run (as seen in Fig. 5), MBs become significantly more fit than ANNs, and after 10,000 generations we find that in 18 out of 200 runs MBs have evolved to perfect fitness, while none of the ANNs reached this level (the best ANNs correctly make 77 out of 80 decisions). At the same time, we see that the fitness of the ANNs after 10,000 generations is not stagnating, which suggests that more runtime will allow for further improvement. As previously mentioned, the rate at which fitness is achieved in evolutionary time cannot be compared across architectures because mutations affect the function of the gates differently. While we tentatively explain the difference in performance between ANNs and MBs by their difference in representing the world below, we anticipate that the different network architectures also solve the categorization task very differently. To understand the information dynamics and the strategies employed in more detail, we measured a number of other informationtheoretic measures (besides R) (see sections below). The evolutionary trajectory for representation R (see Fig. 6B) is similar to the evolution of fitness (see Fig. 6A), but MBs evolve to a significantly higher value of R. We attribute this difference to the difference in fitness between the two types of networks, as the discretization of the continuous ANN variables cannot introduce a bias in R. Thus, it appears that an increased representation of the world within an agent’s network controller correlates with fitness. We can test this correlation between fitness and representation at the end of a run for the 200 replicates of MBs and ANNs, and find that fitness and R are significantly correlated (Spearman’s r = 0.55, P = 2.5 × 10−17 ) for MBs, but not for ANNs (r = −0.10, P = 0.15). We speculate that because ANNs are forced to compute using a sigmoid function only (effectively implementing a multipleAND gate) while MBs can use arbitrary logic operations to process data, ANNs struggle to internalize (that is, represent) environmental states. In other words, it appears that the ease of memory-formation is crucial in forming representations, which are then efficiently transformed into fit decisions in MBs (Edlund et al., 2011). 20 1 0.8 A 0.9 B 0.7 0.6 0.5 0.7 R w 0.8 0.4 0.3 0.6 0.2 0.5 0.4 0.1 0 2000 4000 6000 generations 8000 10000 0 0 2000 4000 6000 generations 8000 10000 Figure 6: A: Fitness w and B: representation R (in bits) along the line of descent as a function of evolutionary generations, averaged over 200 independent evolutionary lines, for evolved networks (ANNs: black, MBs: blue) 21 3.1 Analysis of Network Structures and Strategies In order to be successful at the task described, an agent has to perform active categorical perception followed by prediction. In the implementation of the ACP task by Beer (1996; 2003), prediction can be achieved without memory, because once the network has entered the attractor representing a category, the prediction (to move away or to stay) can be directly coupled to the attractor. The task used here can only be achieved using memory (data not shown) and requires the agent to perform categorical perception by comparing sensory inputs from at least two different time points (which also allows a prediction of where the object is going to land). In order to analyze how information is processed, we calculated the predictive information (Bialek et al., 2001) of the evolved networks, given by the mutual Shannon information between the network’s inputs at time t and its outputs at time t + 1. Predictive information, defined this way (Ay et al., 2008), measures how much of the entropy of outputs (the firings of motor neurons that control the agent) can be understood in terms of the signals that have appeared in the agent’s sensors just prior to the action. Indirectly, predictive information therefore also indicates the contribution of the hidden nodes of the network. A high predictive information would show that the hidden nodes do not contribute much and that computations are performed mainly by input and output neurons. Using the variable S for sensor states and A for actuator states, the predictive information can be written in terms of the shared entropy between sensor states at time t and motor states at time t + 1 as Ipred = I(St : At+1 ) = − X st ,at+1 p(st , at+1 ) log p(st , at+1 ) , p(st )p(at+1 ) (15) where p(st ) = P (St = st ) is the probability to observe variable St in state st , p(at+1 ) = P (At+1 = at+1 ) is the probability observe variable At+1 in state at+1 , etc. Note that St and At+1 are joint random variables created from the variables of each node, implying that St can take on 16 different states while At+1 can take on 4 possible states. The probabilities are extracted from time series data as described in section 2.5. Figure 7A shows that over the course of evolution, the predictive information Ipred decreases for MBs after an initial increase, but increases slightly overall for ANNs. The drop in predictive information for the MBs indicates that their actions become less dependent 22 2 A Ipred 1.5 1 0.5 0 0 Hunpred 2 2000 4000 6000 8000 10000 2000 4000 6000 8000 10000 4000 6000 generations 8000 10000 B 1.5 1 0.5 SIatom 0 6 5 4 3 2 1 0 0 C 0 2000 Figure 7: Different measures of information processing and integration along the LOD for both types of network architectures: ANNs (black) and Markov brains (blue). A: Predictive information, Eq. (15). B: Unpredicted entropy [Eq. (16)] of the network’s motor variables. C: Information integration SIatom based on Eq. (17). 23 on sensor inputs and are driven more by the hidden neurons, while the ANNs actions remain to be predictable by sensor inputs. To test whether it is the internal states that increasingly guide the agent, the predictive information was subtracted from the entropy of the output states (maximally two bits) to calculate the unpredicted entropy of the outputs, i.e., how much of the motor outputs are uncorrelated to signals from the input: Hunpred = H(At+1 ) − Ipred = H(At+1 |St ) . (16) Figure 7B shows that Hunpred increases over the course of evolution, suggesting that indeed signals other than the sensor readings are guiding the motors. In principle, this increase could be due to an increase in the motor neuron entropy, however, as the latter stays fairly constant we can conclude that the more a network adapts to its environment, the less its outputs are determined by its inputs and the more by its internal states. Again, this effect is stronger for MBs than for ANNs, and suggests that it is indeed the internal states that encode representations that drive the network’s behavior. It is also possible that the motors evolve to react to sensor signals further back in time. Because sensor neurons cannot store information, such a delayed response also has to be processed via internal states. While the absolute value of the predicted information and unpredicted entropy can depend on this time delay, we expect the overall trend of a decreasing Ipred coupled with an increasing Hunpred to be the same as for the one-step predictive information, because the sensorial signal stream itself has temporal correlations, that is, it is non-random. To quantify the synergy of the network we calculated a measure of information integration called synergistic information. Roughly speaking, synergistic information measures the amount of information that is processed by the network as a whole that cannot be understood in terms of the information-processing of each individual node, i.e., it measures the extent to which the whole network is–informationally–more than the sum of its parts (Edlund et al., 2011): SIatom = I(Xt : Xt+1 ) − n X i I(Xti : Xt+1 ). (17) i=1 In Eq. (17), I(Xt : Xt+1 ) measures the amount of information that is processed (across 24 time) by the whole network X (the joint random variable composed of each of the node i variables), whereas I(Xti : Xt+1 ) measures how much is processed by node i. The negative of Eq. (17) has been used before, to quantify the redundancy of information processing in a neural network (Atick, 1992; Nadal and Parga, 1994; Schneidman et al., 2003). SIatom is a special case of the information integration measure Φ (Tononi, 2008; Balduzzi and Tononi, 2008), which is computationally far more complex than SIatom because it relies on computing information integration across all possible partitions of a network. SIatom , instead, calculates information integration across the “atomic” partition only, that is, the partition where each node is its own part. Figure 7C shows that SIatom increases for Markov brains as well as for ANNs, which indicates that both architectures evolve the ability to integrate information to perform the task at hand. We only see a marginal difference between MBs and ANNs in their ability to integrate information, while at the same time MBs are more dependent on internal states and ultimately perform better. This suggests that measuring integrated information in terms of Eq. 17 does not allow inferences about a system’s capacity do memorize. In summary, we observe that MBs evolve to become less dependent on sensorial inputs than ANNs, and in addition, the actions of the MBs become more dependent on internal states than in ANNs. Thus, we conclude that the network properties that R measures are indeed representations that the networks create as an adaptive strategy. But how do the networks represent their environments? Which features of the world are represented and form the successful task-solving strategies? 3.1 Epistemically Opaque Strategies In order to analyze a Markov brain’s function, a number of different tools are available. First, a causal diagram can be generated by drawing an edge between any two neurons that are connected via an HMG. The edges are directed, but note that each edge can in principal perform a different computation. When creating the causal diagram, nodes that are never written into by any other nodes are removed, as they are computationally inert (they remain in their default ‘off’ state). Such nodes can also be identified via a “knock-out” procedure, where the input of each node is forced to either the “0” or “1” state individually. If such a procedure has no effect on fitness, the node is inert. Fig. 8 shows the causal diagram of an evolved Markov brain that solves the clas25 0 2 3 1 5 10 12 6 7 14 4 15 Figure 8: Causal diagram of a Markov brain with perfect fitness, correctly catching all small blocks and avoiding all large ones. Nodes colored in red are sensors, while motor variables are green. Double arrows represent two causal connections, one each way. Nodes with arrows that point to themselves write their output back into their input, and may work as memory (all nodes return to a default “0” if not set otherwise by each update), so state information can only be maintained via such self-connections). Internal nodes can read from motors, giving rise to proprioception, or more precisely, kinesthesia: the ability to sense one’s own motion. The motors themselves can be used as memory. 26 sification task perfectly. One can see that this network uses inputs from the sensors, motors, and memory simultaneously for decisions, fusing the different modalities intelligently (Murphy, 1996). The causal diagram by itself, however, does not reveal how function is achieved in this network. As each HMG in the present instantiation represents a deterministic logic gate (generally they are stochastic), it is possible to determine the logical rules by which the network transitions from state to state by feeding the state-to-state transition table into a logical analyzer (Rickmann, 2011). The analyzer converts the state transition table into the minimal description of functions in Boolean logic using only NOT, AND (∧), and OR (∨). With these functions we can exactly describe each node’s logical influence on other nodes (and possibly itself). For the network depicted in Fig. 8, the logic is given by (here, the numeral represents the node, and its index the state at time t0 or the subsequent time point t1, while an overbar stands for NOT) 4t1 = (2t0 ∧ 5t0 ) ∨ (2t0 ∧ 6t0 ) 5t1 = (2t0 ∧ 10t0 ∧ 12t0 ) ∨ (10t0 ∧ 12t0 ∧ 14t0 ) ∨ (2t0 ∧ 10t0 ∧ 12t0 ∧ 14t0 ) 6t1 = 4t0 ∧ (0t0 ∨ 6t0 ) 7t1 = (2t0 ∧ 12t0 ) ∨ (10t0 ∧ 12t0 ∧ 14t0 ) 10t1 = (2t0 ∧ 6t0 ) ∨ (2t0 ∧ 10t0 ∧ 14t0 ) ∨ (10t0 ∧ 12t0 ∧ 14t0 ) ∨ (2t0 ∧ 14t0 ) ∨(3t0 ∧ 7t0 ∧ 10t0 ∧ 12t0 ∧ 14t0 ) 12t1 = (1t0 ∧ 7t0 ) ∨ (3t0 ∧ 7t0 ) ∨ (3t0 ∧ 7t0 ) 14t1 = (2t0 ∧ 10t0 ∧ 14t0 ) ∨ (2t0 ∧ 10t0 ∧ 12t0 ) ∨ (2t0 ∧ 10t0 ∧ 12t0 ) 15t1 = (3t0 ∧ 7t0 ) ∨ (0t0 ∧ 6t0 ) ∨ (4t0 ∧ 6t0 ) ∨ (0t0 ∧ 4t0 ∧ 6t0 ) . Note that while this logical representation of the network’s dynamics is optimized (and the contribution of inert nodes is removed), it is in general not possible to determine the minimal logic network based on state-to-state transition information only, as finding the minimal logic is believed to be a computationally intractable problem (Kabanets and Cai, 2000). As a consequence, while it is possible to capture the network’s function in terms of a set of logical rules, we should not be surprised that evolution delivers epistemically opaque designs (Humphreys, 2009), that is, designs that we do not understand on a fundamental level. However, the strength of measuring representations with R is 27 that our measure is able to capture representations even if they are highly distributed and take part in complex computations. As such, R provides a valuable tool to analyze evolved neural networks as can be seen below. 0.4 node 4 node 5 node 6 node 7 node 10 node 12 Rhit 0.3 0.2 0.1 0 0.4 RLR 0.3 0.2 0.1 0 0.4 R+/- 0.3 0.2 0.1 0 0.4 R4/2 0.3 0.2 0.1 0 0 2 4 6 83 gener. [10 ] 0 2 4 6 83 gener. [10 ] 0 2 4 6 83 gener. [10 ] 0 2 4 6 83 gener. [10 ] 0 2 4 6 83 gener. [10 ] 0 2 4 6 83 gener. [10 ] Figure 9: Representation of each of the 4 environmental properties (concepts) defined in Eqs. (10-13) as a function of time, within each of the nodes of a network that evolved to become the one depicted in Fig. 8. Representation is measured in bits, along the temporal (genetic) line of descent (measured in generations). 3.2 Concepts and Memory To understand what representations are acquired (representations about which concepts), we calculated R for each property of the environment defined in Eq. (10-13), within each of the key nodes in our example network shown in Fig. 8. For this network, Fig. 9 shows that some nodes prefer to represent given single features or concepts, while others represent several features at the same time. In addition, the degree to which a node represents a certain property changes during the course of evolution. Looking at 28 representation within each individual node, however, only tells part of the story as it is clear that representations are generally “smeared” over several nodes. If this is the case, a pair of nodes (for example) can represent more about a feature than the sum of the representations in each node, i.e., variables can represent synergistically. In order to discover which combination of nodes represents which feature most accurately, a search over all partitions of the network would have to be performed, much like in the search for the partition with minimum information processing in the calculation of a network’s synergistic information processing (Balduzzi and Tononi, 2008). One can also ask whether brain states represent the environment as it is at the time it is being represented, or whether it represents the environment in its past state, or in other words, we can ask whether representations are about more distant or more proximal events. To answer this, we define temporal representations by including the temporal index of the Markov variables. For example, a representation at the same time point t is defined [as implicit in Eq. (5)] as Rt = H(Et : Mt |St ) , (18) while a representation of events one update prior is defined as Rt−1 = H(Et−1 : Mt |St ) , (19) i.e., the shared entropy between the internal variables at time t and the environmental states at time t−1, given the sensor’s states at time t. Naturally, one can define temporal representations about more distant events in the same manner. Rt , Rt−1 , and Rt−2 were calculated and averaged over all 80 experiments in each generation (for both ANNs and MBs) over the course of evolution. Figure 10 shows that in both systems Rt−1 is larger than Rt , and Rt−2 is larger still (but note that Rt−3 is smaller, data not shown), and all values increase over evolutionary time similar to R (see Fig. 6B). This suggest that both networks evolve a form of memory that reaches further back than just one update. We suggest that the peak in representation at a time difference of two updates implied by Fig. 10 can be explained by the hierarchical structure of the networks, which have to process the sensorial information through at least two time steps to reach a decision (it takes at least two time steps in order to assess the direction of motion of the block). Decisions have to be made shortly thereafter, however, in order to move the 29 1 1 A B 0.8 0.6 0.6 R R 0.8 0.4 0.4 0.2 0.2 0 0 0 2000 4000 6000 generations 8000 10000 0 2000 4000 6000 generations 8000 10000 Figure 10: Representation as a function of evolutionary time, for three different time intervals. A: Representation in ANNs (red: Rt , green: Rt−1 , blue: Rt−2 . B: Representation in Markov brains (colors as in A). The red curves are the same as in Fig. 6B, and are shown here for the purpose of comparison. agent to the correct location in time. This further strengthens our view that representations are evolved, and furthermore that they build up during an agent’s lifetime as memory of past events shape the agent’s decisions. 4 Conclusions We defined a quantitative measure of representation R in terms of information theory, as the shared entropy between the states of the environment and internal “brain” states, given the states of the sensors. While internal states are necessary in order to encode internal models, not all internal states are representations. Indeed, representational information (which is about the environment) is a subset of the information stored in internal states. Information about the state of other past internal states or sub-states do not count towards R, and neither would information about imagined worlds, for example. Testing which nodes of the system contain representations about what aspect of the environment helps us to distinguish between information present in internal states and information that is specifically used as a representation. We applied this measure to two types of networks that were evolved to control a simulated agent in an active categorical peception task. Our experiments showed that the achieved R increases with fitness during evolution independently of the system used. We also showed that while 30 the (algorithmic) function of both artificial neural networks and Markov networks is difficult to understand, deterministic Markov networks can be reduced to sets of Boolean logic functions. This logic, however, may be epistemically opaque. While representation R increases in networks over evolutionary time, each neuron can represent parts of individual concepts (features of the environment). However, most often concepts are distributed over several neurons and represent synergistically. In addition, representations also form over the lifetime of the agent, increasing as the agent integrates information about the different concepts to reach a decision. Thus, what evolves in Markov and artificial neural networks via Darwinian processes are not the representations themselves, but rather what evolves is the capacity to represent the environment, while the representations themselves are formed as the agent observes and interacts with the environment. We argued that R can be measured in continuous (artificial neural networks) as well as discrete systems (Markov networks), which suggests that this measure can be used in more complex and more natural systems. We found that in the implementation used here, Markov networks were able to evolve their ability to form representations more easily than artificial neural networks. Future investigations will show what kind of system is more powerful to make intelligent decisions using representations. Acknowledgements We thank C. Koch and G. Tononi for extensive discussions about representations, information integration, and qualia. This research was supported in part by the German Federal Ministry of Education and Research, by the Paul G. Allen Family Foundation, by the National Science Foundation’s Frontiers in Integrative Biological Research grant FIBR-0527023, NSF’s BEACON Center for the Study of Evolution in Action under contract No. DBI-0939454, as well as by the Agriculture and Food Research Initiative Competitive Grant no. 2010-65205-20361 from the USDA National Institute of Food and Agriculture. We wish to acknowledge the support of the BerlinBrandenburg Academy of Sciences, the Michigan State University High Performance Computing Center and the Institute for Cyber Enabled Research. References Atick, J. J. (1992). Could information theory provide an ecological theory of sensory processing. Network, 3(2):213–251. 31 Ay, N., Bertschinger, N., Der, R., Guettler, F., and Olbrich, E. (2008). Predictive information and explorative behavior of autonomous robots. Eur Phys J B, 63(3):329–339. Balduzzi, D. and Tononi, G. (2008). Integrated Information in Discrete Dynamical Systems: Motivation and Theoretical Framework. PLoS Comput Biol, 4(6):e1000091. Beer, R. (1996). Toward the evolution of dynamical neural networks for minimally cognitive behavior. In Maes, P., Mataric, M., Meyer, J., Pollack, J., and Wilson, S., editors, From Animals to Animats: Proceedings of the Fourth International Conference on Simulation of Adaptive Behavior, pages 421–429, Cambridge, MA. MIT Press. Beer, R. (2003). The dynamics of active categorical perception in an evolved model agent. Adaptive Behavior, 11:209–243. Bialek, W., Nemenman, I., and Tishby, N. (2001). Predictability, complexity and learning. Neural Computation, 13(11):2409–63. Bongard, J., Zykov, V., and Lipson, H. (2006). Resilient machines through continuous self-modeling. Science, 314(5802):1118–1121. Brooks, R. A. (1991). Intelligence without representation. Artificial Intelligence, 47:139–159. Chomsky, N. (1965). Aspects of the Theory of Syntax. Cambridge, Mass.: The MIT Press. Clark, A. (1997). The dynamical challenge. Cognitive Science, 21:461–481. Clark, A. and Toribio, J. (1994). Doing without representing? Synthese, 101:401–431. Cohen, H. and Lefebvre, C., editors (2005). Handbook of Categorization in Cognitive Science, Amsterdam, The Netherlands. Elsevier. Cover, T. M. and Thomas, J. A. (1991). Elements of Information Theory. John Wiley, New York, NY. Craik, K. (1943). The Nature of Explanation. Cambridge University Press, Cambridge (UK). 32 Edlund, J. A., Chaumont, N., Hintze, A., Koch, C., Tononi, G., and Adami, C. (2011). Integrated information increases with fitness in the simulated evolution of autonomous agents. PLoS Comput Biol, 7:e1002236. Floreano, D. and Mondada, F. (1996). Evolution of homing navigation in a real mobile robot. Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on, 26(3):396–407. Fodor, J. (1975). The Language of Thought. New York: Crowell. George, D. and Hawkins, J. (2005). A hierarchical Bayesian model of invariant pattern recognition in the visual cortex. In Prokhorov, D., editor, Proceedings of the International Joint Conference on Neural Networks (IJCNN), volume 3, pages 1812–1817. IEEE. George, D. and Hawkins, J. (2009). Towards a mathematical theory of cortical microcircuits. PLoS Comput Biol, 5(10):e1000532. Harnad, S., editor (1987). Categorical Perception: The Groundwork of Cognition, Cambridge, UK. Cambridge University Press. Haugeland, J. (1991). Representational genera. In Ramsey, W., Stich, S. P., and Rumelhart, D. E., editors, Philosophy and connectionist theory, pages 61–89, Hillsdale, NJ. Lawrence Erlbaum. Hawkins, J. and Blakeslee, S. (2004). On Intelligence. Henry Holt and Co., New York, NY. Humphreys, P. (2009). The philosophical novelty of computer simulation methods. Synthese, 169(3):615–626. Johnson-Laird, P. and Wason, P. (1977). Thinking: Readings in Cognitive Science. Cambridge University Press. Kabanets, V. and Cai, J.-Y. (2000). Circuit minimization problem. In Yao, F. and Luks, E., editors, Proc. 32nd Symposium on Theory of Computing, pages 73–79. 33 Kawato, M. (1999). Internal models for motor control and trajectory planning. Current Opinion In Neurobiology, 9(6):718–727. Kay, J. W. and Phillips, W. A. (2011). Coherent infomax as a computational goal for neural systems. Bull Math Biol, 73(2):344–72. Koller, D. and Friedman, N. (2009). Probabilistic Graphical Models. MIT Press, Cambridge, MA. Lenski, R. E., Ofria, C., Pennock, R. T., and Adami, C. (2003). The evolutionary origin of complex features. Nature, 423(6936):139–144. Marr, D. (1982). Vision: A Computational Investigation into the Human Representation and Processing of Visual Information. Henry Holt and Co., Inc., New York, NY, USA. Marstaller, L., Hintze, A., and Adami, C. (2010). Measuring representation. In Christensen, W., Schier, E., and Sutton, J., editors, ASCS09: Proceedings of the 9th Conference of the Australasian Society for Cognitive Science, pages 232–237. Sydney: Macquarie Centre for Cognitive Science. McGill, W. J. (1954). Multivariate information transmission. Psychometrika, 19(2):97– 116. Michalewicz, Z. (1996). Genetic Algorithms + Data Strucures = Evolution Programs. Springer Verlag, New York. Moravec, H. P. (1984). Locomotion, vision and intelligence. In Brady, M. and Paul, R., editors, Robotics Research 1, pages 215–224. Murphy, R. (1996). Biological and cognitive foundations of intelligent sensor fusion. Ieee Transactions On Systems Man and Cybernetics Part A-Systems and Humans, 26(1):42–51. Nadal, J. P. and Parga, N. (1994). Nonlinear neurons in the low noise limit: A factorial code maximizes information transfer. Network, 5(4):565–581. 34 Newell, A. and Simon, H. (1972). Human Problem Solving. Englewood Cliffs, NJ: Prentice Hall. Nolfi, S. (2002). Power and the limits of reactive agents. Neurocomputing, 42(1-4):119– 145. Nolfi, S. and Floreano, D. (2000). Evolutionary Robotics. MIT Press, Cambridge, MA. Orr, H. (2000). The rate of adaptation in asexuals. Genetics, 155(2):961–968. Phillipps, W. A., Kay, J., and Smyth, D. M. (1994). How local cortical processors that maximize coherent variation could lay foundations for representation proper. In Smith, L. S. and Hancock, P. J. B., editors, Neural Computation and Psychology, pages 117–136, New York. Springer Verlag. Phillips, W. and Singer, W. (1997). In search of common foundations for cortical computation. Behavioral and Brain Sciences, 20(4):657–+. Pinker, S. (1989). Learnability and Cognition. Cambridge, Mass.: The MIT Press. Pitt, D. (2008). Mental representation. In Zalta, E. N., editor, The Stanford Encyclopedia of Philosophy. Metaphysics Research Lab, fall 2008 edition. Rickmann, S. (2011). Logic friday (version 1.1.3) [computer software]. Retrieved from: http://www.sontrak.com/downloads.html. Riesenhuber, M. and Poggio, T. (1999). Hierarchical models of object recognition in cortex. Nature Neuroscience, 2(11):1019–1025. Schneidman, E., Still, S., Berry II, M. J., and Bialek, W. (2003). Network information and connected correlations. Phys Rev Lett, 91(23):238701. Shannon, C. E. (1948). A mathematical theory of communication. Bell System Technical Journal, 27:379– 423, 623–656. Stanley, K. O. and Miikkulainen, R. (2002). Evolving neural networks through augmenting topologies. Evol Comput, 10(2):99–127. 35 Tononi, G. (2008). Consciousness as Integrated Information: a Provisional Manifesto. Biol Bull, 215(3):216–242. van Dartel, M., Sprinkhuizen-Kuyper, I., Postma, E., and van den Herik, J. (2005). Reactive agents and perceptual ambiguity. Adaptive Behavior, 13:227–42. van Dartel M.F. (2005). Situated Representation. PhD thesis, Maastricht University. Ward, R. and Ward, R. (2009). Representation in dynamical agents. Neural Networks, 22:258–266. Watanabe, S. (1960). Information theoretical analysis of multivariate correlation. IBM Journal of Research and Development, 4:66–82. Wolpert, D. M., Ghahramani, Z., and Jordan, M. I. (1995). An internal model for sensorimotor integration. Science, 269(5232):1880–1882. 36
9cs.NE
FUSING VIDEO AND INERTIAL SENSOR DATA FOR WALKING PERSON IDENTIFICATION Yuehong Huang, Yu-Chee Tseng arXiv:1802.07021v1 [cs.CV] 20 Feb 2018 Department of Computer Science, National Chiao Tung University, Taiwan Emails:{huang516, yctseng}@cs.nctu.edu.tw ABSTRACT An autonomous computer system (such as a robot) typically needs to identify, locate, and track persons appearing in its sight. However, most solutions have their limitations regarding efficiency, practicability, or environmental constraints. In this paper, we propose an effective and practical system which combines video and inertial sensors for person identification (PID). Persons who do different activities are easy to identify. To show the robustness and potential of our system, we propose a walking person identification (WPID) method to identify persons walking at the same time. By comparing features derived from both video and inertial sensor data, we can associate sensors in smartphones with human objects in videos. Results show that the correctly identified rate of our WPID method can up to 76% in 2 seconds. Index Terms— artificial intelligence, computer vision, gait analysis, inertial sensor, walking person identification. 1. INTRODUCTION Human navigates the world through five senses, including taste, touch, smell, hearing, and sight. We sometimes rely on one sense while sometimes on multiple senses. For computer systems, the optical sensor is perhaps the most essential sensor which captures information like human eyes. Cameras are widely used for public safety and services in hospitals, shopping malls, streets, etc. On the other hand, booming use of other sensors is seen in many IoT applications due to the advances in wireless communications and MEMS. In this work, we like to raise one fundamental question: how can we improve the perceptivity of computer systems by integrating multiple sensors? More specifically, we are interested in fusing video and inertial sensor data to achieve person identification (PID), as is shown in Fig. 1(b). Efficient PID is the first step toward surveillance, home security, person tracking, no checkout supermarkets, and human-robot conversation. Traditional PID technologies are usually based on capturing biological features like face, voice, tooth, fingerprint, DNA, and iris [1–3]. However, these techniques require intimate information of users, cumbersome registration, training process, and user cooperation. Also, (a) (b) Fig. 1: Scenes where biological features are difficult to extract. relying on optical sensors implies high environmental dependency (such as lighting, obstacle, resolution, view angle, etc.), thus not suitable for public sites. A scene captured in a construction site is shown in Fig. 1(a), where workers must wear helmets and masks to protect themselves from falling objects and toxic gases. A top view of a courtyard is shown in Fig. 1(b). Clearly, recognizing biological features is difficult in such scenarios. Some other recognition approaches are based on wireless signals, but require active participation by users [4, 5]. The ID-Match method proposed in [6] integrates computer vision via depth camera and UHF RFID. It is capable of recognizing individuals walking in groups while wearing RFID tags, thus enabling human-robot interaction. However, this method is handicapped by short range, and all the users need to carry extra RFID tags. In this work, we propose a practical, effective and convenient PID system by combining computer vision and inertial sensor data. Because almost everyone carries a smartphone and almost every smartphone has inertial sensors inside. The main workflow of our PID system is shown in Fig. 2. From video data, a set O = {o1 , o2 , ...} of human objects and their comparable features are retrieved. Similarly, from inertial sensors, a set S = {s1 , s2 , ...} of inertial data and their comparable features are retrieved. Then, the similarity score of each oi and each sj is calculated. By analyzing all the similarity scores, the pairing between O and S is derived, which leads to PID result. Inertial sensors are widely used to de- o1 s1 s3 s2 s4 data collector o2 s s12 s3 s4 o3 Video Camera Inertial Sensor Video Feature Extraction Acc Feature Extraction Human Object Retrieval Remove Direction Trace-Finding Butter Worth Filter Step Feature Extraction Down Sampling o4 o1 o2 o3 o4 matching result Fig. 2: Data fusion workflow. rive carrier’s motions, paths, and physical activities. They are standard modules for current smartphones. On the other hand, we can get motions, traces, and physical activities of people from videos. When persons do different types of activities, it is easy to pair an object with a sensor. But when people do the same activity at the same time, it is difficult to identify persons. So this work only discusses the situation that all the people under camera are walking. The contributions of this work are as follows. First, we develop a practical, low-cost, and robust PID system. Second, our solution integrates two types of popular sensors. Third, in this work, our matching method focuses on WPID to show the robust of our PID system that combines video and inertial sensor data together. The rest of this paper is structured as follows. Section 2 introduces our PID system and WPID method. Performance evaluation results are presented in Section 3. Conclusions are drawn in Section 4. 2. PROPOSED WALKING PERSON IDENTIFICATION We consider an environment in Fig. 2 with a video camera and multiple users. The data collected from both camera and smartphones is sent to a server for PID purpose. Our PID system has four software modules as shown in Fig. 3. The video feature extraction module retrieves human objects and walking traces from a sequence of video frames. The acceleration (Acc) feature extraction module retrieves walking information from acceleration data. The similarity scoring module compares the walking features from both data sources and assigns them similarity scores. The object-ID pairing module couples human objects with smartphones based on the similarity scores. 2.1. Video Feature Extraction Module The human object retrieval sub-module processes each frame to extract the objects that are recognized as human. It is directly realized by YOLO [7–9]. For each frame, YOLO outputs a set O of human objects represented by bounding boxes, and each bounding box is a rectangle inside where YOLO Features Features Similarity Scoring Matching Matrix Object-ID pairing Person IDs Video objects (s4 , o1 ), (s2 , o2 ) (s1 , o3 ), (s3 , o4 ) Human object-ID pairs Fig. 3: Our PID architecture. Frame Number 2688 2690 2697 2699 2706 2709 Person 1 Person 2 Fig. 4: The changes of bounding boxes during walking. recognizes a human object. The ith bounding box of O is denoted by oi and its center, width, and height are denoted by oi .c, oi .w, and oi .h, respectively. Examples are shown in Fig. 4. The trace-finding sub-module is to connect the human objects of adjacent video frames and form continuous traces, where a trace is a sequence of human objects that are regarded as the same person. Efficient object tracking algorithms are available in [10–14], but we design a lightweight tracing method based on movement limitation. Generally, human’s running speed is less than 15 km/h. Assuming a frame rate of 30 frames per second (fps), in most cases, a person cannot move over 0.1 of his height between two frames. Based on this assumption, each trace has a search range to find its human object in the next frame. The results are some traces connecting human objects in continuous frames. After trace-finding, the step feature extraction sub-module retrieves walking-related features from each trace. Fig. 4 shows two sequences of frames of two human objects. Suppose our camera has a downward viewing angle. Person 1 walks along a vertical line. When he steps forward, his bounding box becomes taller. When he closes feet, his bounding box becomes shorter. Person 2 walks along a horizontal line. When he steps forward, his bounding box becomes as 0. This process transforms ti and aj into ternary sequences: tei and aej . The similarity score between tei and aej is defined as: n Sim(tei , aej ) = P . (1) e x dif (ti [x], aej ) 4.5 Stride 1 Stride 2 Person 1 Person 2 Stride 3 Step Patterns 4 Stride 4 Stride 5 3.5 3 2.5 Stride 1 2 0 Stride 2 20 Stride 3 Stride 4 40 60 Stride 5 Stride 6 80 100 Frame Number Fig. 5: Ratio-features of walking traces. wider. When he closes feet, his bounding box narrows down. As a result, the changes of oi .h/oi .w over time are regarded as step patterns. We use ti to denote the ratio-feature of ith trace. Fig. 5 shows the ratio-features extracted from two persons, who make 6 and 5 strides in 100 frames, respectively. We also mark the ground truth of strides in the graph. As can be seen, the ratio-feature can well present human step patterns. 2.2. Acc Feature Extraction Module In this work, each user carries a smartphone which has installed our application (app), and they can put them in pockets or just hand them. Our software only collects acceleration from the inertial sensor. Since activity recognition from inertial sensor data has been intensively studied, we simply adopt existing solutions [15, 16]. The sensor data aˆi from the ith device is a sequence of acceleration magnitudes after removing direction. Since most energy captured by accelerometer associated with human movements is below 15 Hz [17], we remove the high-frequency components from aˆi . aˆi is lowpass filtered by a 10th order Butterworth filter with a 15 Hz cut-off frequency [18]. Further, since our frame rate is 30 fps, the simple frequency of aˆi is decreased to 30 per second. After these steps, we get ai as step feature. 2.3. Similarity Scoring Module After retrieving step features from video data and sensor data, we want to answer the following question: How similar is ratio-feature sequence ti to Acc sequence aj ? The similarity between ti and aj is denoted by Sim. In this work, we try to match the extremum positions of two sequences by ignoring their exact values. First, we conduct an extremum detection to find local maximum/minimum points with a window of length d. For example, when we set d = 10, we traverse all the points and their most adjacent 10 points. If the value of a point is bigger/smaller than all the other 10 most adjacent points, this point is recorded as a maximum/minimum point. In our experiments, we set d = 10. A maximum point is marked as 1, a minimum point is marked as −1, and the rest are marked n is the number of extremums in tei and dif (tei [x], aej ) is defined as:  tei [x] = 0;  0, e e dif (ti [x], aej ) = |y − x|, ti [x] 6= 0 and y exists;  1.5 × d, otherwise. (2) Here, we scan each binary value tei [x] of tei . If tei [x] = 0, then dif (tei [x], aej ) returns 0. If tei [x] 6= 0, dif (tei [x], aej ) traverse aej in the range x−d to x+d. y, a position in the search range, is the nearest position from x and has aej [y] = tei [x]. If such y exists in the search range, dif (tei [x], aej ) returns |y −x|; if not, 1.5×d is returned. Dividing n by the sum of these differences gives the similarity score between tei and aej . 2.4. Object-ID Pairing Module After similarity scoring, we get Sim. Sim is a two-dimensional array recording all the similarity scores until frame f . Let Pf be the Object-ID pairing result until frame f . The pairing problem is now formulated as a different expression of linear sum assignment problem (LSAP) [19]: XX max simij pij , (3) i∈O j∈S simij is the similarity score between ith human object in O and jth sensor in S, and the assignment constraints are: X pij ≤ 1 ∀j ∈ S, i∈O X pij ≤ 1 ∀i ∈ O, j∈S pij ∈ {0, 1} ∀i ∈ O, j ∈ S. We use hungarian algorithm to solve this problem. pij = 1 means that human object i is paired to sensor j; pij = 0 means that human object i cannot be paired to sensor j. In our work, each frame f can have a pairing result Pf , and we call the pairing result at this stage as Raw Pair stage result. However, in practice, the identification result is unstable if we base on our Raw Pair stage result. For example, we may identify one person as Sansa when one frame comes in, but we may identify this person as Jack when next frame comes in, and this person may be identified as Lucy when the frame after the next frame comes in. This problem, which is especially serious when the trace of a person is still short, makes the result rough and hard to see. For this consideration, we propose a Refined Pair stage. In Refined Pair stage, the identification result of a trace not just depends on Pf , but P1 to Pf . Let RPf be the result generated in the Refined Pair stage for frame f . Let RSim be a twodimensional array, and the value of rsimij is the number of times that object i has been paired to sensor j. The refined pairing problem can be formulated as a LSAP: XX max rpij log2 (1 + rsimij ), (4) (a) i∈O j∈S subject to: X rpij ≤ 1 ∀j ∈ S, rpij ≤ 1 ∀i ∈ O, i∈O X (b) Fig. 6: Some correctly identified results under different viewing angles and different spaces. Table 1: The correctly identified rates with different T S. j∈S rpij ∈ {0, 1} ∀i ∈ O, j ∈ S. Different from simij , rsimij is the number of pairing times. simij is small, but rsimij can be very large if the trace of human object i is long. The logarithmic function, shown in Eq. 4, is used to weaken the impact of the length of traces on pairing. As pij , rpij = 1 means that human object i is paired to sensor j; rpij = 0 means that human object i is not paired to sensor j. 3. PERFORMANCE EVALUATION We have developed a prototype system with one video camera and multiple mobile devices. The camera is Logitech webcam with the resolution of 640 × 480. To prove that our solution is not device-dependent, we have tried different models of smartphones, including Redmi Note 4X, ASUS ZenFone 3, HTC 10 Evo. The server is a personal computer with an Intel(R) Core(TM) i7-3770 CPU and an NVIDIA GeForce GT 620 graphics card. All devices used in our system are synchronized by the same network time server. We conduct a number of experiments on our WPID method. The average speed of our tracing and WPID method on different pairing stages is around 120 fps. Apparently, our WPID method on two different stages only consumes a few server resources. To show the robustness of our WPID method, experiments are carried out under different areas and viewing angles. A downward viewing angle and outdoor area is set up as shown in Fig. 6(a). The horizontal viewing angle and indoor area is set up as shown in Fig. 6(b). During our experiments, all the persons carry smartphones in their pockets or hands and wander around freely in their styles. As shown in Fig. 6, our WPID method can work under different areas, different view angles, different ways of carrying the smartphones, and different walking styles. The following statistics are all the cases of two persons, and the result of each condition is generated from at least 2000 continuous frames. To measure the accuracy of our WPID method, let O be the number of persons having shown in front of the camera PP PP TS/s 0.33 Stage PPP P Raw 0.69 Refined 0.71 1 2 3 4 0.74 0.74 0.75 0.76 0.75 0.76 0.75 0.76 until the latest frame. Let NiID be the number of frames that the ith person is identified by our program, and NiCD be the number of frames that the ith person is correctly identified by our program. We define our correctly identification rate Rcd as: PO NiCD Rcd = Pi=1 . (5) O ID i=1 Ni Let T L be the length of time that a person is continuously detected by YOLO. If T L is too small, the sequences extracted is too short to be considered as a step pattern. As a result, we set a threshold T S for T L. Only when the lengths of two sequences are both larger than T S, we do our matching processes. By setting T S from 0.33 to 4 seconds, Table 1 shows the Rcd on two stages. From Table 1, the increase of T S leads to the increase of Rcd in most cases. However, the increase of Rcd is not obvious. Also, Refined stage achieves better performance than Raw stage, especially in visual performance. 4. CONCLUSIONS We propose a new PID system by combining optical and inertial sensors. We design a light tracking algorithm, a WPID method, and two pairing stages. When people do different activities, it is easy to identify persons by comparing behaviors extracted from video and inertial sensor data. So the most complex part of our system is to identify persons who do the same activities at the same time. In this work, we design a WPID method to identify walking persons to show the robustness and potential of our PID system. We conduct extensive experiments and do a lot of discussions to validate the above claims. Results show that the correct identification rate of our WPID method can up to 76% in 2 seconds. 5. REFERENCES [1] Y. Taigman, M. Yang, M. Ranzato, and L. Wolf, “DeepFace: Closing the Gap to Human-Level Performance in Face Verification,” in IEEE Conf. on Comput. Vision and Pattern Recognition, 2014, pp. 1701–1708. [12] S. H. Bae and K. J. Yoon, “Robust online multi-object tracking based on tracklet confidence and online discriminative appearance learning,” in IEEE Conf. on Comput. Vision and Pattern Recognition, June 2014, pp. 1218–1225. [2] Dorothy A. Lunt, “Identification and tooth morphology,” J. of the Forensic Sci. Soc., vol. 14, pp. 203–207, Apr. 2017. [13] Min Yang and Yunde Jia, “Temporal dynamic appearance modeling for online multi-person tracking,” Comput. Vis. Image Underst., vol. 153, no. C, pp. 16–28, Dec. 2016. [3] F. Alonso-Fernandez, P. Tome-Gonzalez, V. RuizAlbacete, and J. Ortega-Garcia, “Iris recognition based on sift features,” in First IEEE Int. Conf. on Biometrics, Identity and Security, Sept 2009, pp. 1–8. [14] Y. Xiang, A. Alahi, and S. Savarese, “Learning to track: Online multi-object tracking by decision making,” in IEEE Int. Conf. on Comput. Vision (ICCV), Dec 2015, pp. 4705–4713. [4] Mahsan Rofouei, Andrew Wilson, A.J. Brush, and Stewart Tansley, “Your Phone or Mine?: Fusing Body, Touch and Device Sensing for Multi-user Device-display Interaction,” in Proc. of the SIGCHI Conf. on Human Factors in Computing Syst., New York, NY, USA, 2012, CHI ’12, pp. 1915–1918, ACM. [15] Shane Colton, “The balance filter: a simple solution for integrating accelerometer and gyroscope measurements for a balancing platform,” 2007. [5] Sherry Hsi and Holly Fait, “RFID Enhances Visitors’ Museum Experience at the Exploratorium,” Commun. ACM, vol. 48, no. 9, pp. 60–65, Sept. 2005. [6] Hanchuan Li, Peijin Zhang, Samer Al Moubayed, Shwetak N. Patel, and Alanson P. Sample, “ID-Match: A Hybrid Computer Vision and RFID System for Recognizing Individuals in Groups,” in CHI Conf. on Extended Abstracts on Human Factors in Comput. Syst. 2016, pp. 7–7, ACM. [7] Joseph Redmon, Santosh Divvala, Ross Girshick, and Ali Farhadi, “You only look once: Unified, real-time object detection,” in IEEE Conf. on Comput. Vision and Pattern Recognition (CVPR), 2016. [8] Joseph Redmon and Ali Farhadi, “YOLO9000: Better, Faster, Stronger,” in IEEE Conf. on Comput. Vision and Pattern Recognition (CVPR), 2017. [9] Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik, “Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation,” in IEEE Conf. on Comput. Vision and Pattern Recognition (CVPR), Washington, DC, USA, 2014, pp. 580–587. [10] Alex Bewley, Zongyuan Ge, Lionel Ott, Fabio Ramos, and Ben Upcroft, “Simple online and realtime tracking,” in IEEE Int. Conf. on Image Process., 2016, pp. 3464– 3468. [11] J. H. Yoon, M. H. Yang, J. Lim, and K. J. Yoon, “Bayesian multi-object tracking using motion context from multiple objects,” in IEEE Winter Conf. on Applicat. of Comput. Vision, Jan 2015, pp. 33–40. [16] Muhammad Shoaib, Stephan Bosch, Ozlem Durmaz Incel, Hans Scholten, and Paul J. M. Havinga, “Fusion of smartphone motion sensors for physical activity recognition,” in Sensors, 2014, vol. 14, pp. 10146–10176. [17] M. Mathie, Monitoring and Interpreting Human Movement Patterns Using a Triaxial Accelerometer, University of New South Wales, 2003. [18] Melania Susi, Valrie Renaudin, and Grard Lachapelle, “Motion Mode Recognition and Step Detection Algorithms for Mobile Phone Users,” Sensors, vol. 13, no. 2, pp. 1539–1562, 2013. [19] Rainer E. Burkard and Eranda Çela, Linear Assignment Problems and Extensions, pp. 75–149, Springer US, Boston, MA, 1999.
1cs.CV
1 Pricing the Ramping Reserve and Capacity Reserve in Real Time Markets arXiv:1512.06050v1 [math.OC] 18 Dec 2015 Hongxing Ye, Student Member, IEEE, and Zuyi Li, Senior Member, IEEE Abstract—The increasing penetration of renewable energy in recent years has led to more uncertainties in power systems. In order to maintain system reliability and security, electricity market operators need to keep certain reserves in the SecurityConstrained Economic Dispatch (SCED) problems. A new concept, deliverable generation ramping reserve, is proposed in this paper. The prices of generation ramping reserves and generation capacity reserves are derived in the Affine Adjustable Robust Optimization framework. With the help of these prices, the valuable reserves can be identified among the available reserves. These prices provide crucial information on the values of reserve resources, which are critical for the long-term flexibility investment. The market equilibrium based on these prices is analyzed. Simulations on a 3-bus system and the IEEE 118-bus system are performed to illustrate the concept of ramping reserve price and capacity reserve price. The impacts of the reserve credit on market participants are discussed. Index Terms—Ramping Reserve, Capacity Reserve, Marginal Price, Uncertainties, Affinely Adjustable Robust Optimization N OMENCLATURE Indices i, k, l, t index for unit, uncertainty, line, and time m, n index for bus Functions and sets E(·) expectation function Tr(·), (·)> , (·)j · trace, transpose, j th row of a matrix Λ(·) cost as a function of adjustment matrix Φ(·) Lagrangian function (·)∗ optimal value of a variable G(m) set of units located at bus m Constants ND , NG , NK number of buses, units and uncertainty constraints NL , NT number of lines and time intervals qi , bi cost coefficients for unit i Qi Qi = qi I NT ∈ RNT ×NT , I NT is unity matrix Bi Bi = [bi · · · bi ]> ∈ RNT fi cost related to unit commitment decision dm,t , d aggregated equivalent load demand on bus m at t, d = [d1,t · · · dND ,1 · · · dND ,NT ]> F̄l , F branch flow limit, abstract vector F ∈ R2NL NT Γl,m shift factor for line l and bus m Pimin , Pimax minimum and maximum generation outputs Iˆi,t , ŷi,t , ẑi,t unit on/off, start-up and shutdown indicators The authors are with the Robert W. Galvin Center for Electricity Innovation at Illinois Institute of Technology, Chicago, IL 60616, USA. (e-mail: [email protected]; [email protected]). RiU , RiD D A, Ri Γi , Γd S, h Variables Gi π unit ramping up/down limits time-load incidence matrix, D ∈ RNT ×ND NT abstract matrix and vector for (1-3), A ∈ R4NT ×NT , Ri ∈ R4NT . abstract shift factor matrix for unit i and load polyhedron uncertainty set matrix and vector generation adjustment matrix, Gi ∈ RNT ×ND NT Prices. π ei is the energy LMP for unit i, π ei ∈ RNT ; π ri is the reserve price vector for unit i, π ri ∈ R4NT ; π ai is the marginal price for affine adjustment, π ai ∈ RNT ×ND NT . Pi,t generation output, Pi,t ∈ R Pi generation vector, Pi = [Pi,1 · · · Pi,NT ]> ∈ RNT P̂ i generation re-dispatch vector, P̂i ∈ RNT ru rd rd Qi,t , Qi,t generation ramping reserve, Qru i,t ∈ R, Qi,t ∈ R cu cd cu cd Qi,t , Qi,t generation capacity reserve, Qi,t ∈ R, Qi,t ∈ R  uncertainty vector,  ∈ RNT ×ND λ, αi , η Lagrangian multipliers for constraints (15, 17, 19) γ, βi , τ Lagrangian multipliers for constraints (16,18,20) Θi credits to uncertainty mitigators i T I. I NTRODUCTION HE renewable energy sources (RES), such as wind power generation, and price-sensitive demand response (DR) have attracted a lot of attentions recently. The total installed capacity of wind power in the U.S. reached 47 GW at the end of 2011 [1]. Several ISOs/RTOs, such as PJM, ISO New England, NYISO, and CAISO have initiated DR programs in their markets [2]. The essential objective to use renewable energy and initiate DR programs in electricity markets is to maximize the total social warfare as well as to protect the environment. However, they also pose new challenges to the system operators in electricity markets. Due to its intrinsic characteristics, the amount of available renewable energy is sometimes hard to predict. For instance, large-scale wind production varies from -20% to 20% of the installed wind capacity in Denmark on an hourly basis [3]. Prediction error for wind farms aggregated output by existing state-of-art method may fall into a range of 5%-20% of the total installed capacity [4]. In the meantime, the amount of un-predictable loads also increases in the wholesale market as the forecasting of price-sensitive loads relies on the forecasted price as input, which itself has significant error. Surviving uncertainties is fundamentally important for the reliable and secure operation of a power system. If the system 2 with pre-planned schedule cannot accommodate the deviation of the wind power and load from their forecasted values, the system operator may have to curtail wind energy or shed load in the real-time market (RTM). In order to keep a certain level of reliability or security, the ISO/RTO has to increase the ramping capability of the system to compensate the variations of wind energy and load in a short time [5], [6]. More efficient and reliable methods are required to determine the optimal reserves when the uncertainty level is high. Recently stochastic and robust approaches have been successfully applied by researchers to address the issues related to uncertainties in electricity markets. At the same time, market designers are also seeking effective market mechanism to address the uncertainty issues. For instance, intraday market (IDM) is now established between day-ahead market (DAM) and RTM in European countries since uncertainties on the intraday level are significantly smaller compared to those on the day-ahead level [7]. In the U.S., hour-ahead scheduling process (HASP) is employed by the California ISO [8]. Typical approaches to solving stochastic SCUC are scenario based [9], [10]. The basic idea is to generate enough samples for uncertain parameters with an assumption that their probability distribution function (PDF) is known. Those samples are then modeled in a Mixed Integer Linear/Quadratic Programming (MILP/MIQP) problem. The two main drawbacks of the scenario-based approaches are that the PDF is hard to obtain in some circumstances, and uncertainty accommodation is not guaranteed. In fact, the MILP/MIQP problem becomes intractable when the sample size is large. Comparing with stochastic optimization, two largest merits of robust optimization are that the solution can be immunized against all uncertainties and PDF is not required. In [11], [12], robust SCUC problem is solved in two stages. The first stage is to determine the unit commitment (UC) solution which is immunized against the worst case with the lowest cost. In the second stage, a feasible solution to SCED is obtained. Affinely adjustable robust optimization (AARO) models are proposed recently [13]–[15]. They employ an affine function to adjust the generation output following the load deviation. Recently, we propose an economic-efficient robust SCUC model with a fast solution approach [16]. Although applying robust techniques in SCUC/SCED receives a lot of attentions from researchers, it still remains a big challenge on how to credit the flexibilities in the U.S. electricity markets. In the existing Ancillary Service (AS) Market, the reserves are determined in advance [17]. The amount of required reserves is generally extracted from larger number of Monte Carlo simulations for the contingencies [18]. With the help of the AARO, those reserves are determined in one shot based on uncertainty information. Then a critical issue is how to price those reserves when there are no explicit reserve requirement constraints. On the other hand, some reserves are free byproducts in the co-optimization approach [17]. They are kept because the market participants want to get the energy profits. Moreover, some reserves are scarce resources due to their deliverability. These observations indicate that not all the available reserves in the system are valuable from the system operator’s point of view. In many countries, electricity markets are still evolving with the challenges of uncertain energy resource and load [19]. The ramping products are proposed by California ISO [20] to accommodate the uncertainties. It should be emphasized that the bus-level delivery is not considered for ramping capacity in [20]. Before applying the robust optimization SCED in the real market, the corresponding pricing theory is imperative. This paper tries to propose some new ideas to clear this obstacle. The three major contributions of this paper are listed as follows. 1) A new concept, deliverable generation ramping reserve, is proposed within the AARO SCED framework. The generation ramping reserve is the additional ramping capability of the generator when part of it is “locked” in the SCED schedule. 2) The prices for the generation ramping reserves as well generation capacity reserves are derived within the robust co-optimization framework. With the help of the price information, the valuable reserves can be easily identified among the available reserves. 3) The market equilibrium is characterized by the proposed prices and dispatch instructions. The market participants can get the maximal profit by following ISO’s the dispatch instruction and price signals. The rest of this paper is organized as follows. The derivation of the reserve prices is presented in Section II based on AARO SCED, and then the market mechanism to credit flexibilities is discussed. Case studies for 3-Bus and IEEE 118-Bus systems are presented in Section III. Section IV concludes this paper. II. AARO SCED AND P RICES In electricity markets, RTOs/ISOs normally operate two markets including DAM and RTM (or balancing market) [21]. The majority of the trades is cleared in DAM via SCUC [21], and SCED is normally performed periodically in RTM. This paper mainly focuses on the RTM. In standard SCED problem, the unit generation output is subject to the following constraints which include unit capacity limits (1) and unit ramping up/down limits (2) (3). Iˆi,t Pimin ≤ Pi,t ≤ Iˆi,t Pimax , ∀i, t Pi,t − Pi,(t−1) ≤ RiU (1 − ŷi,t ) + Pimin ŷi,t , ∀i, t −Pi,t + Pi,(t−1) ≤ RiD (1 − ẑi,t ) + Pimin ẑi,t , ∀i, t (1) (2) (3) Equations (2) and (3) show that a unit has to operate at its minimum capacity in two cases: right after it is turned on or right before it is turned off, which implies that the unit cannot provide reserve in those two cases. For notation brevity, we use matrix and vector to replace the formulations above. Then the SCED problem can be formulated as X min Pi> Qi Pi + Bi> Pi + fi (4) Pi s.t. (λ) i X Pi = Dd, (5) i (αi ≥ 0) (η ≥ 0) APi ≤ Ri , ∀i X Γi Pi − Γd d ≤ F , i (6) (7) 3 where (4) stands the operation cost. (5) denotes the load balance constraints. (6) is the compact form of (1)-(3). (7) represent the transmission constraints. Γi ∈ R2NL NT ×NT , and Γd ∈ R2NL NT ×ND NT . Due to the forecasting errors of renewable power output and load, ISOs/RTOs need to run SCED on a rolling basis in real time to balance the system. Recently, some approaches have been successfully applied in the SCUC/SCED problem to address the uncertainty issues caused by variations of load and renewables. Both stochastic SCUC/SCED and robust SCUC/SCED are studied intensively when considering the uncertainties. To our best knowledge, this paper represents the first work on pricing the reserves in robust optimization framework. Hence, the following assumptions are made so that we can focus on the concept. • • • • • • Transmission loss is ignored in the SCED problem. The proposed approach is for ex ante dispatch and ex ante pricing. It is assumed that units are dispatched according to these instructions during the scheduling intervals. Units bid only energy price. The reserve bid is zero. Uncertainty comes from loads. Renewables are treated as negative loads. Other uncertainties such as contingencies are not discussed in this paper. Uncertainty set information is available to the ISO/RTO. Expectation and covariance of uncertainties can be obtained from historical data. However, PDF information is not specified for uncertainty as it is hard to obtain for uncertain sources such as RES. as (ROP), can be formulated as i X h (ROP) : min E P̂i> Qi P̂i + Bi> P̂i + fi Pi ,Gi i P̂i = Pi + Gi , ∀i, (8) where Gi ∈ RNT ×ND NT is the affine adjustment matrix. Pi ∈ RNT and P̂i ∈ RNT are base dispatch and adjusted dispatch respectively, and  ∈ RND NT is the uncertainty vector (i.e., deviation of loads from forecasted values). The new unit dispatch can be regulated based on the load deviation. It is noted that  ∈ U, and U := { : S ≤ h}, (9) where S ∈ RNK ×ND NT and h ∈ RNK . U is a polyhedron which includes more than just the lower and upper bounds for uncertainty. It is noted that entry in h is considered as uncertainty level which is positive. The AARO SCED, denoted (11) i (8), where Qi is a semi-definite matrix with only diagonal entry. The objective function (10) is to minimize the expected cost. Without loss of generality, assume E() = 0. The objective function (10) can be rewritten as X  Pi> Qi Pi + Bi> Pi + Λ(Gi ) , i > where Λ(Gi ) = Tr[G> i Qi Gi E( )]+fi . It is assumed that > covariance matrix E( ) is available, but PDF is unavailable. The problem (ROP) is converted to a computationally tractable problem (P) as follows, where the constraints including uncertain parameters are exactly reformulated. X  (P) : min Pi> Qi Pi + Bi> Pi + Λ(Gi ) (14) Pi ,Gi ,ρi ,ζ s.t. (λ) i X Pi = Dd (15) Gi = D (16) i (γ) X i (αi ≥ 0) −Ri + APi + ρ> i h ≤ 0, ∀i (η ≥ 0) The basic idea of AARO optimization is originally from paper [15], in which a linear “feedback” in control theory is used to adjust dispatch with the realization of load. Authors in [13], [14], [22] applied it to solve SCED problem. In this section, the generation output is affinely adjusted according to the uncertainties, P̂i = D(d + ), ∀ ∈ U AP̂i ≤ Ri , ∀i, ∀ ∈ U (12) X Γi P̂i − Γd (d + ) ≤ F , ∀ ∈ U (13) (βi ) A. Affinely Adjustable Robust SCED X s.t. (10) i (τ ) (17) ρ> i S = 0, ∀i (18) X > −F − Γd d + Γi Pi + ζ h ≤ 0(19) AGi − X i i Γi Gi − Γd − ζ > S = 0 (20) ρi ≥ 0, ζ ≥ 0, where ρi ∈ R and ζ > ∈ R2NL NT ×NK are also variables. (15) and (16) are derived from (8) and (11). (17)(20) are obtained from strong duality. Problem (P) is convex and can be solved efficiently by commercial solvers such as CPLEX and GUROBI. It can be observed that no PDF information is required to solve (P). Different from the standard SCED (4)-(7), extra terms ρ> i h and ζ > h are added in inequality constraints (17) and (19), > respectively, in problem (P). As ρ> ≥ 0 and h ≥ 0, i ≥ 0, ζ > > ρi h and ζ h are non-negative. It indicates that certain unit and transmission constraints in standard SCED are replaced with stronger constraints in the robust framework. Thus, the system actually keeps certain flexibilities for uncertainty accommodation. In the following sections, we will analyze these flexibilities, which are also called reserves. > 4NT ×NK B. Generation Ramping Reserve and Capacity Reserve An Uncertainty Mitigator (UM) refers to a flexible resource provider that participates in the management of uncertainties. 4 C. Marginal Prices Power (MW) RR Ramping Rate Limit Pi,t+1 LR P i,t t t+1 Time Interval Fig. 1. Illustration of Upward Ramping Reserve (LR: Locked Ramping, RR: Ramping Reserve) The flexible resources include generators with available ramping capabilities and adjustable loads. UMs have to keep certain reserves in order to accommodate the uncertainties. Compared to (6), constraint (17) may be binding even when the scheduled dispatch does not reach the capacity limits (1) or ramping limits (2)-(3). Based on the optimal solution to (P), the reserves can be calculated. The generation ramping reserve is defined as the unused unit ramping capability or the value of the slack variable for (2-3), i.e.   ∗ ∗ Pimin ŷi,t − Pi,t − Pi,(t−1) U , ∀i, t, Qru i,t := Ri (1 − ŷi,t ) + t − (t − 1) (21)   ∗ ∗ Pimin ẑi,t − Pi,(t−1) − Pi,t D , ∀i, t, Qrd := R (1 − ẑ ) + i,t i,t i t − (t − 1) (22) rd where Qru and Q are the upward and downward ramping i,t i,t reserves, respectively. Fig. 1 illustrate the concept of the upward ramping reserve. With scheduled generation outputs at t and t + 1, the locked ramping or the used unit ramping capability is (Pi,t+1 −Pi,t )/1. The generation ramping reserve is the available ramping rate less the locked ramping. The ramping reserve guarantees that the uncertainty mitigator still has additional ramping capability during the scheduled ramping process. In the existing AS market, the “locked” ramping is normally ignored for the spinning reserves [23], [24]. In the RTM, the time resolution is 5 minutes or 15 minutes, if we ignore the ramping process, there is a chance that system cannot provide enough ramping capability to accommodate the uncertainties. In contrast, the time resolution is one hour in DAM, and the units have enough time to redispatch even if the locked ramping is ignored [17], [23]. The generation capacity reserve is defined as unused unit generation capacity or the constraint slack for (1), i.e. ∗ ˆ max − Pi,t Qcu , i,t := Ii,t Pi cd ∗ min Qi,t := Pi,t − Iˆi,t Pi , ∀i, t (23) (24) cu where Qcd i,t and Qi,t are the lower and upper generation capacity reserves, respectively. From the system’s point of view, the total capacity reserves are fixed when the unit commitment and load level are determined. In most generation and reserve co-optimization approaches in AS market, the explicit reserve requirement constraint is modeled [17], [18], [25]. The shadow prices of this type of constraint is employed to derive the reserve price which reflects the coupled effects of the generation and reserve. Instead of setting the reserve manually and heuristically based on Monte Carlo simulations, the reserves in the AARO SCED are determined automatically in one shot. Although it has obvious advantages over the traditional reserve determination, it also poses new challenges on reserve price derivation. The existing pricing approaches cannot be used directly [17], [18] due to the lack of explicit reserve requirement constraints. While the amount of reserves can be calculated according to (21)-(24), the question is how to set the prices for them. On the one hand, it is well known that not all the reserves are deliverable for uncertainty accommodation due to network constraints. On the other hand, the generation and reserve are coupled together in the RTM even if the reserve bid price is zero [26], and the market clearing price for reserve has certain relations with that for energy. In this paper, we call the reserve obtained by (21)-(24) available reserve. If a small increment or decrement of the reserve amount causes change of the expected operation cost in (P), then this type of reserve is called valuable reserve. To determine the exact value a reserve has, we derive the marginal prices for the reserve according to the Lagrangian function as follows. The Lagrangian function for (P) is Φ(Pi , Gi , ρi , ζ, λ, γ, αi , βi , η, τ ) X  = Pi> Qi Pi + Bi> Pi + Λ(Gi ) i + λ> Dd − + X X i > αi (APi X  Pi + Tr[γ > (D − Gi )] + ρ> i h i + η > − F − Γd d + + Tr[τ > X i − Ri ) + X i i Tr[βi> (AGi  Γi Pi + ζ > h (25)  − ρ> i S)]  Γi Gi − Γd − ζ > S ] The ramping reserve price for UM i is defined as the marginal expected cost due to a unit decrement of the generation ramping rate of UM i. The capacity reserve price for UM i is defined as the marginal expected cost due to a unit decrement of the generation capacity of UM i. They can be obtained from the Lagrangian function as π ri = − ∂Φ ∂Ri = α∗i . (26) Hence, the reserve provided by i is valuable only when π ri is non-zero. Note that α∗i consists of Lagrangian multipliers for unit ramping limits and unit capacity limits. The LMP for AARO SCED can be obtained based on its definition. It is the marginal expected cost due to a unit increment of the load. For generator i, it is formulated as ∗ π ei = λ∗ − Γ> i η , (27) 5 where π ei ∈ RNT . π ei also consists of energy component and congestion component. As shown in [13], the affine adjustment price can be obtained as ∗ > ∗ π ai = γ ∗ − Γ> i τ − A βi , (28) π ai ∈ RNT ×ND NT represents the marginal value of the a adjustment coefficient in Gi . As stated in [13], Tr[G> i πi ] a is the payment to i. It is noted that the unit of π i is $ as Gi is participant factor. D. Credit to Uncertainty Mitigators Within the AARO framework, UMs help the system withstand the “load deviation” in the future. As the generation and the reserve are coupled together, the credit to reserve should reflect the coupling effect. Only the UMs who provide the valuable reserves are entitled to credits. The price of the flexible resources are π ri for UM i. The total credit allocated to i is > Θi = Ri − APi∗ π ri , (29) which is the product of the reserve price and the reserve amount. In fact, the reserve price π ri reflects how much “value” the reserve has. Ri − APi∗ reflects the available reserve, which is the reserve quantity at each time interval. Only when the reserve is a valuable reserve (i.e. π ri 6= 0), UM i get the reserve credit. Otherwise, the credit entitled to UM i is zero even if the available reserve it provides is non-zero. There are similar phenomenons in the traditional zonal-based reserve market. For example, the reserve price $0/MWh at a specific zone occurs when the cleared system reserve is higher than the required amount in Case I of Section VI [17]. E. Market Equilibrium source i can obtain the maximum profit by following the ISO’s dispatch instruction (Pi∗ , G∗i ). If the objective function (14) is strictly convex, then (Pi∗ , G∗i ) is the unique choice for i to get the maximal profit. Price signal π ri (associated with credit Θi ) and π ei provide the incentives for i to dispatch power output to Pi∗ , which supplies the load and maintains the ramping and capacity reserves. In addition, the price signal π ai provides the incentive for i to follow the adjustment instruction Gi . Given that the optimality condition of problem (P) is satisfied, dispatch signal (Pi∗ , G∗i ) and price signal (π ei , π ai , α∗i ) constitute a competitive partial equilibrium [27]. The assumption made for the equilibrium model is that the market participant uses affine policy to adjust the generation, so the dispatch obtained from AARO SCED is near-optimal solution. Consequently, the equilibrium conditions are also near-optimal for market participants. An alternative way to get the partial market equilibrium is to lump the reserve price into the LMP. However, it has serious incentive issues. The integrated LMP can be written as ∗ > π̂ie = λ∗ − Γ> i η − A αi . (31) (π̂ie )> Pi = (π ei )> Pi − (αi )> APi . (32) The new credit UM i receives on the energy and reserve is It can be observed that the reserve credit is negative when the shadow price of the upper bound constraint is nonzero. It means that the more flexible resources UM provides, the fewer profit it gets. The UM is provided negative incentives for the flexible resources. In contrast, the reserve credit defined in (29) is always nonnegative. III. C ASE S TUDY A 3-Bus system and the modified IEEE 118-bus system are studied in this section to illustrate the concepts of available/valuable ramping/capacity reserves and the associated prices, as well as their impacts on market participants. The simulations are carried out by CPLEX 12.5 on PC with Intel i7-3770 3.40GHZ 8GB RAM. In the partial market equilibrium model, it is assumed that market participants are price takers [27]. This assumption is popular in the electricity market [25], [28]. The expected profit maximization problem for source i can be formulated as ( ) a > Pi > π ei + Tr[G> π ] − B (P + G ) i i i i i (PMPi ) : max E Pi ,Gi −(Pi + Gi )> Qi (Pi + Gi ) − fi + Θi A. 3-Bus System The 3-Bus system is consisted of two units, one wind farm, s.t. (8)(12) two loads, and three lines. Please refer http://motor.ece.iit.edu/ where the decision variables for source i are Pi and Gi , data/rscuc/3 bus data.pdf for the detailed data. For simplicity, a given the price signal π ei ,π ai , and π ri . Credit Tr[G> three time intervals are studied and a single-segment increi π i ] is for the affine adjustment matrix as stated in [13]. It should mental cost (IC) is employed to represent the fuel cost. The be noted that the constraint for mitigator i is (12), which is time resolution is 15 minutes. It is assumed that both units in why incentive Θi is necessary for i to follow the dispatch the system are committed, which is determined in the DAM. instruction. The objective function can be converted to Load in the current interval (i.e., Time 1) is assumed to be > e > a > r accurate. Loads from Time 2 and Time 3 are forecasted based Pi π i + Tr[Gi π i ] + (Ri − APi ) π i   (30) on current available information, and forecasting errors may > −Pi> QPi − Bi> Pi − fi − Tr G> i Qi Gi E( ) exist. Assume that the expectation of uncertainties at Time 2 It can be observed that (30) is a portion of the Lagrangian and Time 3 are 0, and their probability distribution is unknown. The total expected cost calculated based on the AARO function (25). The optimal solution (Pi , Gi ) to (PMPi ) is a function of (π ei , π ai , π ri ). Since the problem (P) is convex and SCED is $1380.9. It is higher than the standard SCED cost Slater’s condition is satisfied, the strong duality holds. There- $1333.5, which cannot be immuned against uncertainties. It fore, the saddle point (Pi∗ , G∗i ), which is the optimal solution indicates that the expensive G2 supplies more loads within to (P), is also the optimal solution to (PMPi ). Consequently, AARO SCED than it does in standard SCED. The reason 6 TABLE I BASE ED AND LMP FOR 3-B US S YSTEM IN C ASE 2 G1 (MW) G2 (MW) 1 2 3 126.5 131.65 143.6 13.5 23.35 23.4 Load (MW) Time 6,280 LMP ($/MWh) Bus1 Bus2 Bus3 10 10 10 10 32.5 23.5 10 32.5 23.5 6,260 6,240 6,220 1 2 3 4 5 Time Interval 6 7 8 Fig. 2. System-wide Net Load TABLE II U PWARD R ESERVES AND P RICES FOR 3-B US S YSTEM IN C ASE 2 Time 1 2 3 G1 G2 RR RRP CR CRP RR RRP CR CRP 18.5 19.85 13.05 0 0 0 53.5 48.35 36.4 0 0 0 6.5 0.15 9.95 0 15 7.5 66.5 56.65 56.6 0 0 0 RR: Ramping Reserve, MW/15min; RRP: Ramping Reserve Price, $/(MWh/15min) CR: Capacity Reserve, MW; CRP: Capacity Reserve Price, $/MWh TABLE III C REDITS E NTITLED TO U NITS BASED ON R ESERVE P RICES IN C ASE 2 ($) Time 1 2 3 G1 0 0 0 G2 0 15*0.15*0.25=0.5625 7.5*9.95*0.25=18.6563 of dispatching the extra generation from G2 is that operator needs additional deliverable reserves to accommodate the uncertainties while minimizing the total cost. The non-zero 1 2 1 1 entries in G1 ∈ R3×6 are g11 = g12 = 1, g23 = 1, g24 = 1 3×6 0.98, g36 = 0.4, and the non-zero entries in G2 ∈ R are 2 2 2 g24 = 0.02, g35 = 1, g36 = 0.6. If the loads on bus 1 and bus 3 at interval 2 are increased to 97MW and 67.5MW, respectively, then the units can be re-dispatched based on the adjustment matrix to 131.65 + 1 × 7 + 0.98 × 2.5 = 141.025MW and 23.35 + 0 × 7 + 0.02 × 2.5 = 23.475MW. The question is whether the units have incentives to maintain the reserves. First, we consider the scenario without reserve credits. The LMP at bus 2 at Time 2 of $32.5/MWh is larger than G2’s marginal cost of $10/MWh. Therefore, G2 is inclined to supply more loads at Time 2. The increase of the output from G2 will shrink the reserve it can provide. The fact that G2 has negative profit at Time 1 is the uplift issue [29], which is beyond the scope of this paper. In this scenario, the market participants would ignore the uncertainties and game the market. Now, we consider the second scenario with reserve credits. The upward reserves provided by UMs are shown in Table II. It is observed that the capacity reserve is not scarce resource, i.e. the online capacity is adequate. They are just available reserves. In contrast, the prices of upward ramping reserve at Time 2 and Time 3 are non-zeros. According to the definition in this paper, they are valuable reserves. In this scenario, UMs are entitled certain credits based on the contribution. As shown in Table III, uncertainty mitigator G2 is entitled $0.56 at Time 2 and $18.66 at Time 3, where $15/(MWh/15min) and $7.5/(MWh/15min) are the entries in π r2 for ramping constraints at Time 2 and Time 3, respectively; and 0.15 MW/15min and 9.95 MW/15min are the ramping reserves of G2 at Times 2 and 3, respectively. The credit is calculated based on (29). It is noted that the credits are time-coupled, as the ramping reserve is calculated according to the difference of the power outputs between two intervals. Next we give an example to show whether G2 is inclined to deviate from the base dispatch instruction with the credits from LMPs and π ri . If G2 follows the instruction P2∗ as shown in Table I, then the total credit associated with LMPs and π ri are [13.5, 23.35, 23.4] · [10, 32.5, 32.5]> · 0.25 + 0.5625 + 18.6563 = $432.8125. Consider a possible base dispatch [12.5, 22.35, 23.4], where G2 generates 1MW less at Time 1 as its profit is negative at Time 1, and it also generates 1MW less at Time 2 to maintain the same ramping reserve. Then the new credit is [12.5, 22.35, 23.4] · [10, 32.5, 32.5]> · 0.25 + 0.5625 + 7.5·8.95·0.25 = $420.3125, where ramping reserve at Time 3 is decreased to 8.95MW/15min. The credit is $12.5 lower than that by following P2∗ , and the saved fuel cost by supplying smaller load is 2 · 25 · 0.25 = $12.5. Therefore, G2 does not get more profit by using this dispatch. This example illustrates how G2 gets credit associated with LMPs and π ri , and why G2 is not inclined to deviate the dispatch instruction P2∗ . The more rigorous mathematical analysis on market equilibrium is shown in Section II-E. B. Modified IEEE 118-Bus System There are 54 traditional units and 186 branches in the modified IEEE 118-Bus system. The scheduling period is 2 hours, and the time interval is 15 minutes. The loads are depicted in Fig. 2. The UCs are determined in advance by the solution to robust SCUC problem with 5% reserves. Five wind farms are introduced in the system, and they are located at buses 11, 49, 60, 78, and 90, respectively. We denote the set of buses with uncertainty as M. It is assumed that the forecasted power output (i.e. nominal output) and installed capacity for each wind farm are 100 MW and 200 MW, respectively. The uncertainties in this case are from the RES only. The uncertainty m,t satisfies    |m,t | ≤ 100 · r1 1 + 0.01 · (t − 1) , m ∈ M, ∀t    P m,t ≤ 500 · r1 · r2 1 + 0.01 · (t − 1) , m ∈ M, ∀t m where r1 reflects the forecast error confidence interval for a single wind farm [4], [14], and r2 reflects the forecast error confidence interval for the aggregated wind output. When r2 < 1, it indicates that the aggregated forecast error confidence interval is smaller than the sum of five single intervals. In the experiment, the forecast error increases with the time intervals. 7 TABLE IV R ESERVES W.R.T I NCREASING U NCERTAINTY L EVELS AND F IXED N OMINAL W IND P OWER (r2 = 1, t = 2) 4,000 r1 0 0.3 0.4 r1 0.5 0.6 0.7 Fig. 3. Total Reserve Credit W.R.T. Uncertainty Levels and Fixed Nominal Wind Power (r2 = 1) The detailed data including unit parameters, uncertainty correlation matrix, line reactance and ratings, and net load profiles can be found at http://motor.ece.iit.edu/Data/118 UMP.xls. We consider the interval bounds for the uncertainties, and perform the sensitivity analysis with respect to r1 . Fig. 3 shows the reserve credits (RC) the UMs receive with the change of the r1 . The reserve credit (RC) is the sum of the ramping reserve credit and capacity reserve credit UMs are entitled to. When r1 is high, the UMs are also entitled to high credits. As shown in (29), the reserve credits are the sum of the products of the amount of valuable reserve and the price of the valuable reserve. They are analyzed as follows. Table IV presents the upward/downward available reserves and valuable reserves at Time 2 with increasing forecast errors, fixed normal wind power output (100MW each), and fixed r2 . The r1 ∈ [0.1, 0.7], so the error in percentage of the installed capacity (200MW each) is from 5% to 35%. It is observed that the available reserves remain the same while valuable reserve change dramatically with the forecast errors. As shown in Table IV, upward available ramping reserve remains 886.70MW/15min, and the capacity reserve remains 661.43MW. The main reason is that the unit commitment and load demand is fixed at Time 2 in the system. In contrast, the upward valuable reserve is 0 when r1 = 0.1. It indicates that the opportunity cost of keeping the ramping reserve for UM is zero as it can recover the profit from the energy credit. When r1 is 0.2, 0.3 and 0.4, the valuable ramping reserve is around 180MW/15min, and the valuable capacity reserve is around 11MW, 61MW, and 112MW respectively. UMs are entitled to credits by keeping the reserves, which is also shown in Fig. 3. It suggests that opportunity cost of keeping the reserve is nonzero, i.e., UMs can get more profits by deviating from the dispatch instruction if they are not entitled to reserve credits. When r1 is further increased to 0.5, the amount of valuable ramping reserve jumps to 479MW/15min. It means that more available reserves become valuable when the uncertainty level is high. The valuable capacity reserve also increases to 163 MW in this case. A similar tendency can also be observed for the downward reserves shown in Table IV. It should be emphasized that the amount of valuable reserve doesn’t change monotonically with the uncertainty level. Instead, what we revealed in this paper is a trend. The upward available ramping reserve and the price of unit 42 are depicted for different time intervals in Fig. 4 with r1 = 0.7, r2 = 1. As shown in Fig. 4, at Time 7, the unit only provides available reserve but not valuable reserve as its 0.1 0.2 0.3 0.4 0.5 0.6 0.7 886.79 886.79 886.79 886.79 886.79 886.79 886.79 Downward Reserve 0 180.79 180.29 179.79 479.29 513.33 684.04 661.43 661.43 661.43 661.43 661.43 661.43 661.43 0 10.61 61.36 112.11 162.86 215.49 316.72 938.46 938.46 938.46 938.46 938.46 938.46 938.46 0 10.37 0 0 361.61 337.5 680.33 4203.57 0 4203.57 0 4203.57 0 4203.57 0 4203.57 0 4203.57 4.52 4203.57 12.14 AvaRamp: Available Ramping Reserve (MW/15min); ValRamp: Valuable Ramping Reserve (MW/15min); AvaCap: Available Capacity Reserve (MW); ValCap: Valuable Capacity Reserve (MW); Ramping Reserve Ramping Reserve (MW/15min) 0.2 Ramping Reserve Price 8 4 6 4 2 2 0 0 1 2 3 4 5 6 7 8 Time Interval Fig. 4. Upward Ramping Reserve and Price for Unit 42 (r1 = 0.7, r2 = 1) price is zero. It can be observed that the ramping reserve price reaches its highest point at Time 5, which is also the peak load interval. In contrast, the ramping reserve price is low at Time 6 although the load demand at Time 6 is still relatively high compared to those at other intervals. It is observed the load climbs from Time 4 to Time 5, but falls from Time 5 to Time 6 as shown in Fig. 2. It indicates that the ramping reserve price is not only related with the load demand but also with the load change. In this case, the upward ramping reserve is scarce resource at Time 5, and the opportunity cost of keeping them is also high. In contrast, the upward ramping reserve is relatively cheap when the load demand is falling at Time 6, 7, and 8. Fig. 5 depicts the available capacity reserve and the price of capacity reserve for unit 24 with r1 = 0.7, r2 = 1. Although the reserve amount unit 24 keeps is the same at each time interval, the price is different. It is observed that the capacity reserve price in this case has a similar trend to the system load level shown in Fig. 2. For example, the capacity reserve Capacity Reserve Capacity Reserve (MW) 0.1 Upward Reserve AvaRamp ValRamp AvaCap ValCap AvaRamp ValRamp AvaCap ValCap Ramping Reserve Price ($/(MW/15min)) 2,000 Capacity Reserve Price 14 10 12 5 10 1 2 3 4 5 6 7 Capacity Reserve Price ($/MW) Reserve Credit ($) 6,000 8 Time Interval Fig. 5. Upward Capacity Reserve and Price for Unit 24 (r1 = 0.7, r2 = 1) 8 2,000 RC EOC 1.94 1.93 1,500 EOC ($) RC ($) ·105 1,000 0.8 0.9 1 r2 Fig. 6. Reserve Credit (RC) and Expected Operation Cost (EOC) with Different r2 (r1 = 0.6) is the most expensive at Time 5 when the peak load occurs. The reason is that the system-wide upward capacity reserve is the online installed capacity, which is fixed, less the load level. When the load level is high, the upward capacity reserve is small which becomes a scarce resource in the system. Reserve credits with respect to different r2 are presented in Fig. 6. It shows that the decrease of r2 (from 1 to 0.9 to 0.8) also leads to lower payments related to reserve. For example, when r2 decreases from 1 to 0.8, the total RC decreases from around $2,300 to $1,000. The expected operation cost also decreases from $194,000 to $192,000. It indicates that the shrinking uncertainty set actually increases the feasible set for the robust dispatches. The numerical results in this part indicate that the reserve payment proposed in this paper helps maximize the social warfare. When the uncertainty level is high, the payment related to reserve is also high, It may attract long-term investment of flexible resources. More flexible resources also mean the system has more capabilities to handle the uncertainties, and the system can accommodate higher RES penetrations. IV. C ONCLUSIONS This paper proposes a new concept, ramping reserve, within the AARO SCED framework. AARO SCED is an effective tool in RTM to address the uncertainty issue although its solution may only be near-optimal. The flexibilities in this paper include the generation ramping reserve and the generation capacity reserve. The prices for the ramping reserve and capacity reserve are also derived based on the Lagrangian function. They are the opportunity costs of the uncertainty mitigators to keep the reserves or flexibilities. With the help of these prices, the reserves are classified into two categories, which are available reserves and valuable reserves. The case studies explain the concept of these reserves and the impacts on the behaviors of market participants. Many researches on this topic are open in the future. With increasing RES penetration in the power system, the flexibilities play a crucial role in uncertainty accommodation. The prices derived in this paper provide an option on how to provide the reserve signals within the robust optimization framework. Those reserve credits to UMs may attract the investment of flexible resources in the long term. In return, new flexibility investment allows the system to accommodate higher RES level. It should be pointed out that the reserve prices are unitspecified. It is admitted that it is not perfect. It is ideal that all the resources at the same bus have the same price. An extension of the proposed reserve prices is to set the maximum ramping and capacity reserve prices for the units located at a node as the nodal price. In this way, the nodal reserve prices are determined by the most expensive opportunity cost for the reserve in the node. However, due to the affine policy and the non-zero optimality of the AARO SCED, it may deteriorate the partial market equilibrium to a certain extent. R EFERENCES [1] R. Wiser and M. Bolinger, “2011 wind technologies market report,” Lawrence Berkeley National Laboratory, Tech. Rep., 2012. [2] “2012 economic demand response performance report,” PJM Interconnection, Tech. Rep., 2012. [Online]. Available: http://www.pjm.com [3] H. Holttinen, “Impact of hourly wind power variations on the system operation in the nordic countries,” Wind Energy, vol. 8, no. 2, pp. 197– 218, 2005. [4] B.-M. Hodge and M. Milligan, “Wind power forecasting error distributions over multiple timescales,” in Power and Energy Society General Meeting, 2011 IEEE. IEEE, 2011, pp. 1–8. [5] “Integration of renewable resources,” California ISO, Tech. Rep., 2010. [6] “Integration of wind into system dispatch,” New York ISO, Tech. Rep., 2008. [7] F. Borggrefe and K. Neuhoff, “Balancing and intraday market design: Options for wind integration,” Discussion Papers, German Institute for Economic Research, DIW Berlin, Tech. Rep., 2011. [8] California ISO, “CAISO hour-ahead scheduling process.” [9] S. Takriti, J. Birge, and E. Long, “A stochastic model for the unit commitment problem,” IEEE Trans. Power Sys., vol. 11, no. 3, pp. 1497– 1508, 1996. [10] L. Wu, M. Shahidehpour, and Z. Li, “Comparison of scenario-based and interval optimization approaches to stochastic SCUC,” IEEE Trans. Power Sys., vol. 27, no. 2, pp. 913–921, 2012. [11] R. Jiang, M. Zhang, G. Li, and Y. Guan, “Two-stage network constrained robust unit commitment problem,” European Journal of Operational Research, vol. 234, no. 3, pp. 751 – 762, 2014. [12] D. Bertsimas, E. Litvinov, X. Sun, J. Zhao, and T. Zheng, “Adaptive robust optimization for the security constrained unit commitment problem,” IEEE Trans. Power Syst., vol. 28, no. 1, pp. 52–63, 2013. [13] J. Warrington, P. Goulart, S. Mariethoz, and M. Morari, “Policy-based reserves for power systems,” IEEE Trans. Power Sys., vol. 28, no. 4, pp. 4427–4437, 2013. [14] R. A. Jabr, “Adjustable robust opf with renewable energy sources,” IEEE Trans. Power Sys., vol. 28, no. 4, pp. 4742–4751, 2013. [15] A. Ben-Tal, A. Goryashko, E. Guslitzer, and A. Nemirovski, “Adjustable robust solutions of uncertain linear programs,” Math. Program., Ser. A, vol. 99, no. 2, pp. 351–376, Mar. 2004. [16] H. Ye and Z. Li, “Robust security-constrained unit commitment with recourse cost requirement,” in Power Energy Society General Meeting, 2015 IEEE, July 2015, pp. 1–5. [17] T. Zheng and E. Litvinov, “Contingency-Based Zonal Reserve Modeling and Pricing in a Co-Optimized Energy and Reserve Market,” IEEE Transactions on Power Systems, vol. 23, no. 2, pp. 277–286, May 2008. [18] J. Wang, M. Shahidehpour, and Z. Li, “Contingency-constrained reserve requirements in joint energy and ancillary services auction,” Power Systems, IEEE Transactions on, vol. 24, no. 3, pp. 1457–1468, 2009. [19] C. Weber, “Adequate intraday market design to enable the integration of wind energy into the european power systems,” Energy Policy, vol. 38, no. 7, pp. 3155–3163, 2010. [20] C. ISO, “Flexible ramping product-draft technical appendix,” http://www.caiso.com/Documents/DraftTechnicalAppendix FlexibleRampingProduct.pdf, 2015, [Online; accessed 1-July-2015]. [21] A. L. Ott, “Experience with PJM market operation, system design, and implementation,” IEEE Trans. Power Sys., vol. 18, no. 2, pp. 528–534, 2003. [22] Z. Li, W. Wu, B. Zhang, and B. Wang, “Adjustable robust realtime power dispatch with large-scale wind power integration,” IEEE Transactions on Sustainable Energy, vol. PP, no. 99, pp. 1–12, 2015. [23] Z. Li and M. Shahidehpour, “Security-constrained unit commitment for simultaneous clearing of energy and ancillary services markets,” IEEE Trans. Power Sys., vol. 20, no. 2, pp. 1079–1088, 2005. [24] J. F. Ellison, L. S. Tesfatsion, V. W. Loose, and R. H. Byrne, “Project report: A survey of operating reserve markets in us iso/rto-managed electric energy regions,” Sandia Natl Labs Publications, 2012. [25] T. Zheng and E. Litvinov, “On ex post pricing in the real-time electricity market,” IEEE Trans. Power Sys., vol. 26, no. 1, pp. 153–164, 2011. 9 [26] ISO New England Manual for Market Operations Manual M-11 Revision 44, ISO New England Inc., access:May 19, 2015. [Online]. Available: http://www.iso-ne.com/static-assets/documents/rules proceds/ isone mnls/M11/m 11 market operations revision 44 05 23 13.doc [27] A. Mas-Colell, M. D. Whinston, J. R. Green et al., Microeconomic theory. Oxford university press New York, 1995, vol. 1. [28] M. Shahidehpour, H. Yamin, and Z. Li, Market Operations in Electric Power Systems: Forecasting, Scheduling, and Risk Management, 1st ed. Wiley-IEEE Press, 2002. [29] W. W. Hogan and B. J. Ring, “On minimum-uplift pricing for electricity markets,” Electricity Policy Group.
3cs.SY